@tricoteuses/tisseuse 0.14.1 → 0.14.3
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/{html-BuWHzy52.js → html-IERGWCi4.js} +963 -589
- package/dist/index.js +45 -45
- package/dist/server.js +534 -419
- package/dist/src/lib/extractors/action_directives.d.ts +4 -0
- package/dist/src/lib/extractors/links.doctrinal.test.d.ts +1 -0
- package/dist/src/lib/index.d.ts +2 -0
- package/dist/src/lib/server/index.d.ts +1 -1
- package/dist/src/lib/server/parsed_bills.d.ts +16 -0
- package/dist/src/lib/server/shared_legal_text_sections.d.ts +10 -0
- package/dist/src/lib/server/shared_legal_text_sections.test.d.ts +1 -0
- package/dist/src/lib/server/sync_assemblee_legal_texts.d.ts +17 -0
- package/dist/src/lib/server/sync_assemblee_legal_texts.test.d.ts +1 -0
- package/dist/src/lib/text_parsers/ast.d.ts +2 -0
- package/dist/src/lib/text_parsers/citations.d.ts +4 -4
- package/dist/src/lib/text_parsers/doctrinal_references.d.ts +21 -0
- package/dist/src/lib/text_parsers/doctrinal_references.test.d.ts +1 -0
- package/dist/src/lib/text_parsers/legal_text_aliases.d.ts +12 -0
- package/dist/src/lib/text_parsers/repeated_actions.d.ts +1 -0
- package/package.json +1 -1
|
@@ -10348,7 +10348,38 @@ var Kp = C(String.raw`^« ?([^»\n]+)`, {
|
|
|
10348
10348
|
stop: n[1]
|
|
10349
10349
|
}, t.position());
|
|
10350
10350
|
}
|
|
10351
|
-
})
|
|
10351
|
+
});
|
|
10352
|
+
function Jp(e, t) {
|
|
10353
|
+
let n = e.indexOf("\n", t);
|
|
10354
|
+
return n === -1 ? !1 : /^[ \t]*«/u.test(e.slice(n + 1));
|
|
10355
|
+
}
|
|
10356
|
+
function Yp(e) {
|
|
10357
|
+
return /»[.;]?\s*$/u.exec(e);
|
|
10358
|
+
}
|
|
10359
|
+
var $ = T((e) => {
|
|
10360
|
+
let { input: t } = e, n = e.offset;
|
|
10361
|
+
if (t[n] !== "«" || t.indexOf("\n", n) === -1) return;
|
|
10362
|
+
let r = n, i = [];
|
|
10363
|
+
for (; r < t.length;) {
|
|
10364
|
+
let a = t.indexOf("\n", r), o = a === -1 ? t.length : a, s = t.slice(r, o), c = /^[ \t]*« ?/u.exec(s);
|
|
10365
|
+
if (c === null) break;
|
|
10366
|
+
let l = r + c[0].length, u = o, d = Yp(s), f = Jp(t, o), p = s.slice(c[0].length).includes("«");
|
|
10367
|
+
if (d !== null && (!f || !p)) for (u = r + d.index; u > l && /\s/u.test(t[u - 1]);) u--;
|
|
10368
|
+
if (i.push({ position: {
|
|
10369
|
+
start: l,
|
|
10370
|
+
stop: u
|
|
10371
|
+
} }), d !== null && !f) return e.length = r + d.index + d[0].length - n, e.usedInputs = t.slice(n, n + e.length), e.offset += e.length, e.length = 0, {
|
|
10372
|
+
content: i,
|
|
10373
|
+
position: {
|
|
10374
|
+
start: n,
|
|
10375
|
+
stop: e.offset
|
|
10376
|
+
},
|
|
10377
|
+
type: "citation"
|
|
10378
|
+
};
|
|
10379
|
+
if (a === -1) break;
|
|
10380
|
+
r = a + 1;
|
|
10381
|
+
}
|
|
10382
|
+
}, x([_(Kp, {
|
|
10352
10383
|
min: 1,
|
|
10353
10384
|
separator: C(String.raw`»?\n`),
|
|
10354
10385
|
value: (e) => e.map((e, t) => t === 0 ? e : e[1])
|
|
@@ -10357,7 +10388,7 @@ var Kp = C(String.raw`^« ?([^»\n]+)`, {
|
|
|
10357
10388
|
position: t.position(),
|
|
10358
10389
|
type: "citation"
|
|
10359
10390
|
}) }), x([ue, qp], { value: (e) => e[1] }));
|
|
10360
|
-
function
|
|
10391
|
+
function Xp(e, t) {
|
|
10361
10392
|
let n = 0, r = t.content[0].position, i = t.content.at(-1).position, a = t.content.map(({ position: t }) => e.input.slice(t.start, t.stop)).join("\n");
|
|
10362
10393
|
return {
|
|
10363
10394
|
input: e.text(t.position),
|
|
@@ -10388,12 +10419,309 @@ function Jp(e, t) {
|
|
|
10388
10419
|
title: "Conversion de citation"
|
|
10389
10420
|
};
|
|
10390
10421
|
}
|
|
10391
|
-
function
|
|
10392
|
-
return
|
|
10422
|
+
function Zp(e, t) {
|
|
10423
|
+
return Xp(new n(e), t).output;
|
|
10424
|
+
}
|
|
10425
|
+
//#endregion
|
|
10426
|
+
//#region src/lib/text_parsers/legal_text_aliases.ts
|
|
10427
|
+
var Qp = [
|
|
10428
|
+
{
|
|
10429
|
+
cid: "LEGITEXT000025024948",
|
|
10430
|
+
nature: "CODE",
|
|
10431
|
+
pattern: String.raw`(?:cpc|c\.?\s*pr(?:oc(?:[eé]dure)?)?\.?\s*civ(?:il)?\.?)\s*ex[eé]c(?:ution)?\.?`,
|
|
10432
|
+
title: "Code des procédures civiles d'exécution"
|
|
10433
|
+
},
|
|
10434
|
+
{
|
|
10435
|
+
cid: "LEGITEXT000006070716",
|
|
10436
|
+
nature: "CODE",
|
|
10437
|
+
pattern: String.raw`c\.?\s*pr(?:oc(?:[eé]dure)?)?\.?\s*civ(?:il)?\.?|cpc`,
|
|
10438
|
+
title: "Code de procédure civile"
|
|
10439
|
+
},
|
|
10440
|
+
{
|
|
10441
|
+
cid: "LEGITEXT000006071154",
|
|
10442
|
+
nature: "CODE",
|
|
10443
|
+
pattern: String.raw`c\.?\s*pr(?:oc(?:[eé]dure)?)?\.?\s*p[eé]n(?:al)?\.?|cpp`,
|
|
10444
|
+
title: "Code de procédure pénale"
|
|
10445
|
+
},
|
|
10446
|
+
{
|
|
10447
|
+
cid: "LEGITEXT000006070721",
|
|
10448
|
+
nature: "CODE",
|
|
10449
|
+
pattern: String.raw`c\.?\s*civ(?:il)?\.?`,
|
|
10450
|
+
title: "Code civil"
|
|
10451
|
+
},
|
|
10452
|
+
{
|
|
10453
|
+
cid: "LEGITEXT000005634379",
|
|
10454
|
+
nature: "CODE",
|
|
10455
|
+
pattern: String.raw`c\.?\s*com(?:merce)?\.?`,
|
|
10456
|
+
title: "Code de commerce"
|
|
10457
|
+
},
|
|
10458
|
+
{
|
|
10459
|
+
cid: "LEGITEXT000006072050",
|
|
10460
|
+
nature: "CODE",
|
|
10461
|
+
pattern: String.raw`c\.?\s*trav(?:ail)?\.?`,
|
|
10462
|
+
title: "Code du travail"
|
|
10463
|
+
},
|
|
10464
|
+
{
|
|
10465
|
+
cid: "LEGITEXT000006070719",
|
|
10466
|
+
nature: "CODE",
|
|
10467
|
+
pattern: String.raw`c\.?\s*p[eé]n(?:al)?\.?`,
|
|
10468
|
+
title: "Code pénal"
|
|
10469
|
+
},
|
|
10470
|
+
{
|
|
10471
|
+
cid: "LEGITEXT000006071367",
|
|
10472
|
+
nature: "CODE",
|
|
10473
|
+
pattern: String.raw`c\.?\s*rur(?:al)?\.?`,
|
|
10474
|
+
title: "Code rural et de la pêche maritime"
|
|
10475
|
+
},
|
|
10476
|
+
{
|
|
10477
|
+
cid: "LEGITEXT000006073984",
|
|
10478
|
+
nature: "CODE",
|
|
10479
|
+
pattern: String.raw`c\.?\s*assur(?:ances?)?\.?`,
|
|
10480
|
+
title: "Code des assurances"
|
|
10481
|
+
},
|
|
10482
|
+
{
|
|
10483
|
+
cid: "LEGITEXT000006069565",
|
|
10484
|
+
nature: "CODE",
|
|
10485
|
+
pattern: String.raw`c\.?\s*consom(?:mation)?\.?`,
|
|
10486
|
+
title: "Code de la consommation"
|
|
10487
|
+
},
|
|
10488
|
+
{
|
|
10489
|
+
cid: "LEGITEXT000006074075",
|
|
10490
|
+
nature: "CODE",
|
|
10491
|
+
pattern: String.raw`c\.?\s*urb(?:anisme)?\.?`,
|
|
10492
|
+
title: "Code de l'urbanisme"
|
|
10493
|
+
},
|
|
10494
|
+
{
|
|
10495
|
+
cid: "LEGITEXT000023086525",
|
|
10496
|
+
nature: "CODE",
|
|
10497
|
+
pattern: String.raw`c\.?\s*transp(?:orts?)?\.?`,
|
|
10498
|
+
title: "Code des transports"
|
|
10499
|
+
},
|
|
10500
|
+
{
|
|
10501
|
+
cid: "LEGITEXT000006069577",
|
|
10502
|
+
nature: "CODE",
|
|
10503
|
+
pattern: "cgi",
|
|
10504
|
+
title: "Code général des impôts"
|
|
10505
|
+
},
|
|
10506
|
+
{
|
|
10507
|
+
cid: "LEGITEXT000006069583",
|
|
10508
|
+
nature: "CODE",
|
|
10509
|
+
pattern: "lpf",
|
|
10510
|
+
title: "Livre des procédures fiscales"
|
|
10511
|
+
},
|
|
10512
|
+
{
|
|
10513
|
+
cid: "LEGITEXT000006073189",
|
|
10514
|
+
nature: "CODE",
|
|
10515
|
+
pattern: "css",
|
|
10516
|
+
title: "Code de la sécurité sociale"
|
|
10517
|
+
},
|
|
10518
|
+
{
|
|
10519
|
+
cid: "LEGITEXT000044595989",
|
|
10520
|
+
nature: "CODE",
|
|
10521
|
+
pattern: "cibs",
|
|
10522
|
+
title: "Code des impositions sur les biens et services"
|
|
10523
|
+
},
|
|
10524
|
+
{
|
|
10525
|
+
cid: "LEGITEXT000006070933",
|
|
10526
|
+
nature: "CODE",
|
|
10527
|
+
pattern: "cja",
|
|
10528
|
+
title: "Code de justice administrative"
|
|
10529
|
+
},
|
|
10530
|
+
{
|
|
10531
|
+
cid: "LEGITEXT000006074096",
|
|
10532
|
+
nature: "CODE",
|
|
10533
|
+
pattern: "cch",
|
|
10534
|
+
title: "Code de la construction et de l'habitation"
|
|
10535
|
+
},
|
|
10536
|
+
{
|
|
10537
|
+
cid: "LEGITEXT000006074069",
|
|
10538
|
+
nature: "CODE",
|
|
10539
|
+
pattern: "casf",
|
|
10540
|
+
title: "Code de l'action sociale et des familles"
|
|
10541
|
+
},
|
|
10542
|
+
{
|
|
10543
|
+
cid: "LEGITEXT000006070633",
|
|
10544
|
+
nature: "CODE",
|
|
10545
|
+
pattern: "cgct",
|
|
10546
|
+
title: "Code général des collectivités territoriales"
|
|
10547
|
+
},
|
|
10548
|
+
{
|
|
10549
|
+
cid: "LEGITEXT000006071164",
|
|
10550
|
+
nature: "CODE",
|
|
10551
|
+
pattern: "coj",
|
|
10552
|
+
title: "Code de l'organisation judiciaire"
|
|
10553
|
+
},
|
|
10554
|
+
{
|
|
10555
|
+
cid: "LEGITEXT000006069414",
|
|
10556
|
+
nature: "CODE",
|
|
10557
|
+
pattern: "cpi",
|
|
10558
|
+
title: "Code de la propriété intellectuelle"
|
|
10559
|
+
},
|
|
10560
|
+
{
|
|
10561
|
+
cid: "LEGITEXT000006070987",
|
|
10562
|
+
nature: "CODE",
|
|
10563
|
+
pattern: "cpce",
|
|
10564
|
+
title: "Code des postes et des communications électroniques"
|
|
10565
|
+
},
|
|
10566
|
+
{
|
|
10567
|
+
cid: "LEGITEXT000006072665",
|
|
10568
|
+
nature: "CODE",
|
|
10569
|
+
pattern: "csp",
|
|
10570
|
+
title: "Code de la santé publique"
|
|
10571
|
+
},
|
|
10572
|
+
{
|
|
10573
|
+
cid: "LEGITEXT000006070158",
|
|
10574
|
+
nature: "CODE",
|
|
10575
|
+
pattern: "ceseda",
|
|
10576
|
+
title: "Code de l'entrée et du séjour des étrangers et du droit d'asile"
|
|
10577
|
+
},
|
|
10578
|
+
{
|
|
10579
|
+
cid: "LEGITEXT000006072026",
|
|
10580
|
+
nature: "CODE",
|
|
10581
|
+
pattern: "(?:comofi|cmf)",
|
|
10582
|
+
title: "Code monétaire et financier"
|
|
10583
|
+
}
|
|
10584
|
+
], $p = Qp.map((e) => ({
|
|
10585
|
+
alias: e,
|
|
10586
|
+
regExp: RegExp(`^(?:${e.pattern})$`, "iv")
|
|
10587
|
+
})), em = `(?:${Qp.map(({ pattern: e }) => `(?:${e})`).join("|")})`, tm = {
|
|
10588
|
+
I: {
|
|
10589
|
+
cid: "LEGITEXT000006069568",
|
|
10590
|
+
nature: "CODE",
|
|
10591
|
+
title: "Code général des impôts, annexe I"
|
|
10592
|
+
},
|
|
10593
|
+
II: {
|
|
10594
|
+
cid: "LEGITEXT000006069569",
|
|
10595
|
+
nature: "CODE",
|
|
10596
|
+
title: "Code général des impôts, annexe II"
|
|
10597
|
+
},
|
|
10598
|
+
III: {
|
|
10599
|
+
cid: "LEGITEXT000006069574",
|
|
10600
|
+
nature: "CODE",
|
|
10601
|
+
title: "Code général des impôts, annexe III"
|
|
10602
|
+
},
|
|
10603
|
+
IV: {
|
|
10604
|
+
cid: "LEGITEXT000006069576",
|
|
10605
|
+
nature: "CODE",
|
|
10606
|
+
title: "Code général des impôts, annexe IV"
|
|
10607
|
+
}
|
|
10608
|
+
};
|
|
10609
|
+
function nm(e) {
|
|
10610
|
+
let t = $p.find(({ regExp: t }) => t.test(e))?.alias;
|
|
10611
|
+
if (t === void 0) return;
|
|
10612
|
+
let { cid: n, nature: r, title: i } = t;
|
|
10613
|
+
return {
|
|
10614
|
+
cid: n,
|
|
10615
|
+
nature: r,
|
|
10616
|
+
title: i
|
|
10617
|
+
};
|
|
10618
|
+
}
|
|
10619
|
+
function rm(e, t) {
|
|
10620
|
+
let n = nm(e);
|
|
10621
|
+
return n === void 0 ? void 0 : {
|
|
10622
|
+
...n,
|
|
10623
|
+
position: t,
|
|
10624
|
+
type: "texte"
|
|
10625
|
+
};
|
|
10393
10626
|
}
|
|
10627
|
+
var im = T(...Qp.map(({ pattern: e }) => C(`${e}(?=$|\\P{Alphabetic})`, {
|
|
10628
|
+
flags: "iv",
|
|
10629
|
+
value: (e, t) => rm(e[0], t.position())
|
|
10630
|
+
})));
|
|
10394
10631
|
//#endregion
|
|
10395
|
-
//#region src/lib/text_parsers/
|
|
10396
|
-
|
|
10632
|
+
//#region src/lib/text_parsers/doctrinal_references.ts
|
|
10633
|
+
function am(e, t) {
|
|
10634
|
+
let n = e.indices?.groups?.[t];
|
|
10635
|
+
return n === void 0 ? void 0 : {
|
|
10636
|
+
start: n[0],
|
|
10637
|
+
stop: n[1]
|
|
10638
|
+
};
|
|
10639
|
+
}
|
|
10640
|
+
function om(e) {
|
|
10641
|
+
let t = e.groups?.article?.trim(), n = e.groups?.text;
|
|
10642
|
+
if (t === void 0 || n === void 0) return;
|
|
10643
|
+
let r = am(e, "articleKeyword");
|
|
10644
|
+
if (r === void 0 && !/^(?:(?:L\.?\s*O|[LRDA])\*?\.?\s*)\d/iu.test(t)) return;
|
|
10645
|
+
let i = t.match(/^(?<article>.*\d(?:[\p{L}\d-]*))\s+(?<subdivision>[IVXLCDM]+(?:\s+(?:bis|ter|quater))?|\d+\s*(?:°|º))$/iu)?.groups?.article?.trim() ?? t, a = Jt(i), o = am(e, "article"), s = am(e, "text");
|
|
10646
|
+
if (a === void 0 || o === void 0 || s === void 0) return;
|
|
10647
|
+
let c = rm(n, s);
|
|
10648
|
+
if (c === void 0) return;
|
|
10649
|
+
let l = {
|
|
10650
|
+
num: a,
|
|
10651
|
+
position: {
|
|
10652
|
+
start: r?.start ?? o.start,
|
|
10653
|
+
stop: o.stop - (t.length - i.length)
|
|
10654
|
+
},
|
|
10655
|
+
type: "article"
|
|
10656
|
+
};
|
|
10657
|
+
return {
|
|
10658
|
+
child: l,
|
|
10659
|
+
parent: c,
|
|
10660
|
+
position: {
|
|
10661
|
+
start: Math.min(c.position.start, l.position.start),
|
|
10662
|
+
stop: Math.max(c.position.stop, l.position.stop)
|
|
10663
|
+
},
|
|
10664
|
+
type: "parent-enfant"
|
|
10665
|
+
};
|
|
10666
|
+
}
|
|
10667
|
+
var sm = C(String.raw`cgi\s*,\s*ann(?:exe)?\.?\s*(IV|III|II|I)`, {
|
|
10668
|
+
flags: "i",
|
|
10669
|
+
value: (e, t) => {
|
|
10670
|
+
let n = tm[e[1].toUpperCase()];
|
|
10671
|
+
return n === void 0 ? void 0 : {
|
|
10672
|
+
...n,
|
|
10673
|
+
position: t.position(),
|
|
10674
|
+
type: "texte"
|
|
10675
|
+
};
|
|
10676
|
+
}
|
|
10677
|
+
}), cm = o(Qt, { value: (e, t) => ({
|
|
10678
|
+
num: e,
|
|
10679
|
+
position: t.position(),
|
|
10680
|
+
type: "article"
|
|
10681
|
+
}) }), lm = x([C(String.raw`\s*,\s*art(?:icle)?\.?\s+`, { flags: "i" }), cm], { value: (e) => e[1] }), um = x([
|
|
10682
|
+
w(C(String.raw`(?:le|la|les)\s+`, { flags: "i" }), { default: "" }),
|
|
10683
|
+
T(sm, im),
|
|
10684
|
+
lm
|
|
10685
|
+
], { value: (e, t) => ({
|
|
10686
|
+
child: e[2],
|
|
10687
|
+
parent: e[1],
|
|
10688
|
+
position: t.position(),
|
|
10689
|
+
type: "parent-enfant"
|
|
10690
|
+
}) }), dm = C(String.raw`(?:(?<articleKeyword>articles?)\s+)?(?<article>\S[^\n,;:\(\)]*?)\s+(?:(?:du|de\s+la|de\s+l['’])\s+)?(?<text>${em})(?=$|\P{Alphabetic})`, {
|
|
10691
|
+
flags: "div",
|
|
10692
|
+
value: (e) => om(e)
|
|
10693
|
+
}), fm = C(String.raw`(?<article1>(?:(?:L\.?\s*O|[LRDA])\*?\.?\s*)\d[^\n,;:\(\)]*?)\s+(?<coordinator>et|ou)\s+(?<article2>(?:(?:L\.?\s*O|[LRDA])\*?\.?\s*)\d[^\n,;:\(\)]*?)\s+(?:(?:du|de\s+la|de\s+l['’])\s+)?(?<text>${em})(?=$|\P{Alphabetic})`, {
|
|
10694
|
+
flags: "div",
|
|
10695
|
+
value: (e) => {
|
|
10696
|
+
let t = am(e, "article1"), n = am(e, "article2"), r = am(e, "text"), i = e.groups?.article1, a = e.groups?.article2, o = e.groups?.coordinator, s = i === void 0 ? void 0 : Jt(i.trim()), c = a === void 0 ? void 0 : Jt(a.trim()), l = e.groups?.text === void 0 || r === void 0 ? void 0 : rm(e.groups.text, r);
|
|
10697
|
+
if (!(t === void 0 || n === void 0 || s === void 0 || c === void 0 || o !== "et" && o !== "ou" || l === void 0)) return {
|
|
10698
|
+
child: {
|
|
10699
|
+
coordinator: o,
|
|
10700
|
+
left: {
|
|
10701
|
+
num: s,
|
|
10702
|
+
position: t,
|
|
10703
|
+
type: "article"
|
|
10704
|
+
},
|
|
10705
|
+
position: {
|
|
10706
|
+
start: t.start,
|
|
10707
|
+
stop: n.stop
|
|
10708
|
+
},
|
|
10709
|
+
right: {
|
|
10710
|
+
num: c,
|
|
10711
|
+
position: n,
|
|
10712
|
+
type: "article"
|
|
10713
|
+
},
|
|
10714
|
+
type: "enumeration"
|
|
10715
|
+
},
|
|
10716
|
+
parent: l,
|
|
10717
|
+
position: {
|
|
10718
|
+
start: t.start,
|
|
10719
|
+
stop: l.position.stop
|
|
10720
|
+
},
|
|
10721
|
+
type: "parent-enfant"
|
|
10722
|
+
};
|
|
10723
|
+
}
|
|
10724
|
+
}), pm = T(um, fm, dm), mm = (e) => {
|
|
10397
10725
|
let t = e.offset, n = /,\s*(?:par\s+)?/guy;
|
|
10398
10726
|
if (n.lastIndex = t, !n.exec(e.input)) return;
|
|
10399
10727
|
e.offset = n.lastIndex;
|
|
@@ -10409,7 +10737,7 @@ var Xp = (e) => {
|
|
|
10409
10737
|
}
|
|
10410
10738
|
return e.offset = i.lastIndex, e.length = 0, e.usedInputs = e.input.slice(t, e.offset), r;
|
|
10411
10739
|
};
|
|
10412
|
-
function
|
|
10740
|
+
function hm(e) {
|
|
10413
10741
|
for (let t = 0; t < e.length; t += 1) {
|
|
10414
10742
|
let r = t === 0 ? void 0 : e[t - 1];
|
|
10415
10743
|
if (r && /[\p{L}\p{N}_]/u.test(r)) continue;
|
|
@@ -10418,7 +10746,15 @@ function Zp(e) {
|
|
|
10418
10746
|
}
|
|
10419
10747
|
return null;
|
|
10420
10748
|
}
|
|
10421
|
-
function
|
|
10749
|
+
function gm(e, t) {
|
|
10750
|
+
let r = e.slice(0, Math.max(0, t)), i = /(?:^|[^\p{L}\p{N}_])les\s+/giu, a = null;
|
|
10751
|
+
for (; i.exec(r) !== null;) {
|
|
10752
|
+
let e = new n(r, i.lastIndex), t = Ae(e);
|
|
10753
|
+
typeof t != "number" || t <= 1 || /^\s+occurrences\b/iu.exec(r.slice(e.offset)) && (a = t);
|
|
10754
|
+
}
|
|
10755
|
+
return a;
|
|
10756
|
+
}
|
|
10757
|
+
function _m(e) {
|
|
10422
10758
|
let t = [], r = /(?:,\s*)?par\s+/giu, i = 0, a;
|
|
10423
10759
|
for (; (a = r.exec(e)) !== null;) {
|
|
10424
10760
|
let o = new n(e, r.lastIndex);
|
|
@@ -10430,17 +10766,17 @@ function Qp(e) {
|
|
|
10430
10766
|
}
|
|
10431
10767
|
//#endregion
|
|
10432
10768
|
//#region src/lib/text_parsers/actions.ts
|
|
10433
|
-
var
|
|
10769
|
+
var vm = (e) => x([
|
|
10434
10770
|
C(e, { flags: "i" }),
|
|
10435
|
-
|
|
10771
|
+
mm,
|
|
10436
10772
|
C(e === "est" ? "remplacée?" : "remplacée?s", { flags: "i" })
|
|
10437
|
-
], { value: "remplacer" }),
|
|
10773
|
+
], { value: "remplacer" }), ym = T(ee(C("(modalités|conditions) d'application (de )?", { flags: "i" }), {
|
|
10438
10774
|
lookbackLength: 35,
|
|
10439
10775
|
value: { action: "précision" }
|
|
10440
10776
|
}), ee(C("en application (de )?", { flags: "i" }), {
|
|
10441
10777
|
lookbackLength: 35,
|
|
10442
10778
|
value: { action: "application" }
|
|
10443
|
-
})),
|
|
10779
|
+
})), bm = i("après|avant|ajoutée?s?|insérée?s?|complétée?s?|rédigée?s?|suit|modifiée?s?|rétablie?s?|remplacée?s?|supprimée?s?|abrogée?s?|devient", T(x([
|
|
10444
10780
|
b,
|
|
10445
10781
|
C("est complété par les mots ?", { flags: "i" }),
|
|
10446
10782
|
C(" ?:"),
|
|
@@ -10508,7 +10844,7 @@ var $p = (e) => x([
|
|
|
10508
10844
|
}), C("est rétablie? (ainsi qu'il|comme) suit", {
|
|
10509
10845
|
flags: "i",
|
|
10510
10846
|
value: "rétablir"
|
|
10511
|
-
}),
|
|
10847
|
+
}), vm("est"), C("est remplacée?", {
|
|
10512
10848
|
flags: "i",
|
|
10513
10849
|
value: "remplacer"
|
|
10514
10850
|
}), C("sont ainsi modifiée?s", {
|
|
@@ -10523,7 +10859,7 @@ var $p = (e) => x([
|
|
|
10523
10859
|
}), C("sont rétablie?s (ainsi qu'il|comme) suit", {
|
|
10524
10860
|
flags: "i",
|
|
10525
10861
|
value: "rétablir"
|
|
10526
|
-
}),
|
|
10862
|
+
}), vm("sont"), C("sont remplacée?s", {
|
|
10527
10863
|
flags: "i",
|
|
10528
10864
|
value: "remplacer"
|
|
10529
10865
|
}), C("sont renum[eé]rotée?s", {
|
|
@@ -10543,7 +10879,7 @@ var $p = (e) => x([
|
|
|
10543
10879
|
}), C("est remplacée?", {
|
|
10544
10880
|
flags: "i",
|
|
10545
10881
|
value: "remplacer"
|
|
10546
|
-
}),
|
|
10882
|
+
}), vm("est"), vm("sont"), C("sont remplacée?s", {
|
|
10547
10883
|
flags: "i",
|
|
10548
10884
|
value: "remplacer"
|
|
10549
10885
|
}), C("est modifiée?", {
|
|
@@ -10703,23 +11039,23 @@ var $p = (e) => x([
|
|
|
10703
11039
|
}), C("est supprimée?", {
|
|
10704
11040
|
flags: "i",
|
|
10705
11041
|
value: "supprimer"
|
|
10706
|
-
}))], { value: (e) => ({ action: e[1] }) }))),
|
|
11042
|
+
}))], { value: (e) => ({ action: e[1] }) }))), xm = T(un, wn), Sm = T(fn, xn, im, he), Cm = x([xm, _(x([le, Sm], { value: (e) => e[1] }))], { value: (e, t) => _t(e[0], e[1], t.position()) }), wm = x([Sm, _(x([le, Sm], { value: (e) => e[1] }))], { value: (e, t) => _t(e[0], e[1], t.position()) }), Tm = x([se, Cm], { value: (e) => e[1] }), Em = T(x([le, wm], { value: (e) => e[1] }), Tm), Dm = T(x([Ht, w(Em, { default: null })], { value: (e) => {
|
|
10707
11043
|
let t = e[0], n = e[1];
|
|
10708
11044
|
return n === null ? t : mt(n, t);
|
|
10709
|
-
} }),
|
|
11045
|
+
} }), Cm), Om = T(x([Ut, w(Em, { default: null })], { value: (e) => {
|
|
10710
11046
|
let t = e[0], n = e[1];
|
|
10711
11047
|
return n === null ? t : mt(n, t);
|
|
10712
|
-
} }),
|
|
10713
|
-
w(
|
|
11048
|
+
} }), wm), km = x([
|
|
11049
|
+
w(ym, { default: null }),
|
|
10714
11050
|
x([
|
|
10715
11051
|
p,
|
|
10716
|
-
|
|
11052
|
+
Dm,
|
|
10717
11053
|
w([w(C(" modifiée?s", { flags: "i" }), { default: "" }), C(" susvisée?s", { flags: "i" })], { default: "" })
|
|
10718
11054
|
], { value: (e, t) => ({
|
|
10719
11055
|
...e[1],
|
|
10720
11056
|
position: t.position()
|
|
10721
11057
|
}) }),
|
|
10722
|
-
w(
|
|
11058
|
+
w(bm, { default: null })
|
|
10723
11059
|
], { value: (e, t) => {
|
|
10724
11060
|
let n = e[2] ?? e[0];
|
|
10725
11061
|
return n === null ? e[1] : {
|
|
@@ -10728,18 +11064,18 @@ var $p = (e) => x([
|
|
|
10728
11064
|
reference: e[1],
|
|
10729
11065
|
type: "reference_et_action"
|
|
10730
11066
|
};
|
|
10731
|
-
} }),
|
|
10732
|
-
w(
|
|
11067
|
+
} }), Am = T(x([
|
|
11068
|
+
w(ym, { default: null }),
|
|
10733
11069
|
x([
|
|
10734
11070
|
ce,
|
|
10735
|
-
|
|
11071
|
+
Om,
|
|
10736
11072
|
w([w(C(" modifiée?", { flags: "i" }), { default: "" }), C(" susvisée?", { flags: "i" })], { default: "" }),
|
|
10737
11073
|
w(C(String.raw`, ?qui devient [^,]+ ","`, { flags: "i" }), { default: "" })
|
|
10738
11074
|
], { value: (e, t) => ({
|
|
10739
11075
|
...e[1],
|
|
10740
11076
|
position: t.position()
|
|
10741
11077
|
}) }),
|
|
10742
|
-
w(
|
|
11078
|
+
w(bm, { default: null })
|
|
10743
11079
|
], { value: (e, t) => {
|
|
10744
11080
|
let n = e[2] ?? e[0];
|
|
10745
11081
|
return n === null ? e[1] : {
|
|
@@ -10748,23 +11084,23 @@ var $p = (e) => x([
|
|
|
10748
11084
|
reference: e[1],
|
|
10749
11085
|
type: "reference_et_action"
|
|
10750
11086
|
};
|
|
10751
|
-
} }),
|
|
11087
|
+
} }), km), jm = i("article|loi|décret|code|alinéa|phrase|chapitre|titre|livre|partie|section|paragraphe|ordonnance|constitution|directive|règlement|\\d|[ivxlc]+|[a-zA-Z]", x([Am, _([T(Ct, St), Am])], { value: (e, t) => ht(e[0], e[1], t.position()) })), Mm = o(Om, { value: (e, t) => ({
|
|
10752
11088
|
...e,
|
|
10753
11089
|
position: t.position()
|
|
10754
|
-
}) }),
|
|
11090
|
+
}) }), Nm = T(_(Mm, {
|
|
10755
11091
|
min: 2,
|
|
10756
11092
|
separator: Ne,
|
|
10757
11093
|
value: (e) => [e[0], ...e.slice(1).map(([, e]) => e)]
|
|
10758
|
-
}), _(
|
|
11094
|
+
}), _(Mm, {
|
|
10759
11095
|
min: 2,
|
|
10760
11096
|
separator: C(String.raw`\n`),
|
|
10761
11097
|
value: (e) => [e[0], ...e.slice(1).map(([, e]) => e)]
|
|
10762
|
-
}), o(
|
|
11098
|
+
}), o(Mm, { value: (e) => [e] }));
|
|
10763
11099
|
//#endregion
|
|
10764
11100
|
//#region src/lib/extractors/references.ts
|
|
10765
|
-
function*
|
|
10766
|
-
let r =
|
|
10767
|
-
for (let e of
|
|
11101
|
+
function* Pm(e, t) {
|
|
11102
|
+
let r = Xp(e, t), i = new n(r.output), a = _e(r);
|
|
11103
|
+
for (let e of Im(i)) {
|
|
10768
11104
|
e = structuredClone(e), t.references === void 0 && (t.references = []), t.references.push(e);
|
|
10769
11105
|
for (let t of xt(e)) {
|
|
10770
11106
|
let e = t.position;
|
|
@@ -10773,132 +11109,132 @@ function* hm(e, t) {
|
|
|
10773
11109
|
yield e;
|
|
10774
11110
|
}
|
|
10775
11111
|
}
|
|
10776
|
-
function*
|
|
10777
|
-
yield*
|
|
11112
|
+
function* Fm(e, t = {}) {
|
|
11113
|
+
yield* Im(e, t);
|
|
10778
11114
|
}
|
|
10779
|
-
function*
|
|
10780
|
-
let n = i(String.raw`arrêtés?|circulaires?|code|constitution|décrets?(?:-loi)?|loi|ordonnance|art\.|articles?|chapitre|livre|paragraphe|partie|section|sous-paragraphe|sous-section|sous-sous-paragraphe|sous-titre|titre|alinéas?|phrases?|règlements?|directives?|décisions?|«|[IVXLCDM]+|[A-Z]|\d+`, T($, tn, _n,
|
|
11115
|
+
function* Im(e, t = {}) {
|
|
11116
|
+
let n = i(String.raw`arrêtés?|circulaires?|code|constitution|décrets?(?:-loi)?|loi|ordonnance|art\.|articles?|chapitre|livre|paragraphe|partie|section|sous-paragraphe|sous-section|sous-sous-paragraphe|sous-titre|titre|alinéas?|phrases?|règlements?|directives?|décisions?|«|[IVXLCDM]+|[A-Z]|\d+`, T($, tn, _n, pm, jm), 80, String.raw`(?<=^|\P{Alphabetic})(?:arrêtés?|circulaires?|code|constitution|décrets?(?:-loi)?|loi|ordonnance|art\.|articles?|chapitre|livre|paragraphe|partie|section|sous-paragraphe|sous-section|sous-sous-paragraphe|sous-titre|titre|alinéas?|phrases?|règlements?|directives?|décisions?|«|[IVXLCDM]+|[A-Z]|\d+)(?=$|\P{Alphabetic})`);
|
|
10781
11117
|
for (let r of n.extract(e, {
|
|
10782
11118
|
overlapWindow: 80,
|
|
10783
11119
|
overlapWindowForCandidate: t.overlapWindowForCandidate
|
|
10784
|
-
})) if (r !== void 0) if (r.type === "citation") yield*
|
|
11120
|
+
})) if (r !== void 0) if (r.type === "citation") yield* Pm(e, r);
|
|
10785
11121
|
else {
|
|
10786
11122
|
if (r.type === "reference_et_action" || r.type === "alinéa" || r.type === "article" || r.type === "chapitre" || r.type === "item" || r.type === "livre" || r.type === "paragraphe" || r.type === "partie" || r.type === "phrase" || r.type === "section" || r.type === "sous-paragraphe" || r.type === "sous-section" || r.type === "sous-sous-paragraphe" || r.type === "sous-titre" || r.type === "titre" || r.type === "texte" || r.type === "bounded-interval" || r.type === "counted-interval" || r.type === "enumeration" || r.type === "exclusion" || r.type === "parent-enfant" || r.type === "incomplete-header") {
|
|
10787
11123
|
for (let t of xt(r)) if (t.type === "reference_et_action") {
|
|
10788
11124
|
let { originalCitations: n } = t.action;
|
|
10789
|
-
if (n !== void 0) for (let t of n) for (let n of
|
|
11125
|
+
if (n !== void 0) for (let t of n) for (let n of Pm(e, t));
|
|
10790
11126
|
}
|
|
10791
11127
|
}
|
|
10792
11128
|
yield r;
|
|
10793
11129
|
}
|
|
10794
11130
|
}
|
|
10795
|
-
function*
|
|
11131
|
+
function* Lm(e, t) {
|
|
10796
11132
|
let n = _e(t);
|
|
10797
|
-
for (let t of
|
|
11133
|
+
for (let t of Fm(e)) {
|
|
10798
11134
|
for (let e of xt(t, { citations: !0 })) e.position !== void 0 && (e.originalTransformation = v(n, e.position));
|
|
10799
11135
|
yield t;
|
|
10800
11136
|
}
|
|
10801
11137
|
}
|
|
10802
|
-
var
|
|
11138
|
+
var Rm = (e) => [...Fm(e)], zm = (e, t) => [...Lm(e, t)], Bm = "(?:avant|apr[eè]s)", Vm = T(C("avant(?![-A-Za-zÀ-ÖØ-öø-ÿ0-9_])", {
|
|
10803
11139
|
flags: "i",
|
|
10804
11140
|
value: "before"
|
|
10805
11141
|
}), C("apr[eè]s(?![-A-Za-zÀ-ÖØ-öø-ÿ0-9_])", {
|
|
10806
11142
|
flags: "i",
|
|
10807
11143
|
value: "after"
|
|
10808
|
-
})),
|
|
11144
|
+
})), Hm = T(C("(?:au|a[uù])\\s+d[eé]but\\b", {
|
|
10809
11145
|
flags: "i",
|
|
10810
11146
|
value: "start"
|
|
10811
11147
|
}), C("(?:a|à)\\s+la\\s+fin\\b", {
|
|
10812
11148
|
flags: "i",
|
|
10813
11149
|
value: "end"
|
|
10814
11150
|
}));
|
|
10815
|
-
function
|
|
11151
|
+
function Um(e) {
|
|
10816
11152
|
return e === "before" ? "insert_before" : "insert_after";
|
|
10817
11153
|
}
|
|
10818
|
-
function
|
|
10819
|
-
let t =
|
|
11154
|
+
function Wm(e) {
|
|
11155
|
+
let t = Gm(e), n = /(?:^|[^\p{L}\p{N}_-])(avant|apres)(?![\p{L}\p{N}_-])/u.exec(t);
|
|
10820
11156
|
return n ? n[1] === "avant" ? "before" : "after" : null;
|
|
10821
11157
|
}
|
|
10822
|
-
function
|
|
11158
|
+
function Gm(e) {
|
|
10823
11159
|
return e.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
|
|
10824
11160
|
}
|
|
10825
11161
|
//#endregion
|
|
10826
11162
|
//#region src/lib/text_parsers/action_words.ts
|
|
10827
|
-
var
|
|
10828
|
-
function
|
|
11163
|
+
var Km = /\b(ins[èe]re|ins[ée]r[ée]|ajout|remplac|supprim|abrog|compl[èeé]t|r[ée]dig|r[ée]tabl|modifi(?:e|é|ée|és|ées|er|ant|ent))/iu;
|
|
11164
|
+
function qm(e) {
|
|
10829
11165
|
return e.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
|
|
10830
11166
|
}
|
|
10831
|
-
function
|
|
11167
|
+
function Jm(e, t = e) {
|
|
10832
11168
|
return /\bredige\b|\bredigee\b|\bredigees\b|\brediges\b|\bainsi\b/.test(e) || /\bdispositions suivantes\b/.test(t);
|
|
10833
11169
|
}
|
|
10834
|
-
function
|
|
10835
|
-
return
|
|
11170
|
+
function Ym(e) {
|
|
11171
|
+
return Wm(e) === "after";
|
|
10836
11172
|
}
|
|
10837
|
-
function
|
|
10838
|
-
return
|
|
11173
|
+
function Xm(e) {
|
|
11174
|
+
return Wm(e) === "before";
|
|
10839
11175
|
}
|
|
10840
|
-
function
|
|
11176
|
+
function Zm(e) {
|
|
10841
11177
|
return /\bretabl/.test(e);
|
|
10842
11178
|
}
|
|
10843
|
-
function
|
|
11179
|
+
function Qm(e) {
|
|
10844
11180
|
return /\binsere(?:e|es|s)?\b|\bajoute\b|\bajoutee\b|\bajoutes\b|\bajoutees\b|\bcomplete(?:e|es|s)?\b/.test(e);
|
|
10845
11181
|
}
|
|
10846
|
-
function
|
|
11182
|
+
function $m(e) {
|
|
10847
11183
|
return /\bremplace\b|\bremplacee\b|\bremplaces\b|\bremplacees\b/.test(e);
|
|
10848
11184
|
}
|
|
10849
|
-
function
|
|
11185
|
+
function eh(e) {
|
|
10850
11186
|
return /\bsupprime\b|\bsupprimee\b|\bsupprimes\b|\bsupprimees\b|\babroge\b|\babrogee\b|\babroges\b|\babrogees\b/.test(e);
|
|
10851
11187
|
}
|
|
10852
|
-
function
|
|
11188
|
+
function th(e) {
|
|
10853
11189
|
return /\b(remplace|modifie|redige|rediges|redigee|redigees)\b/.test(e);
|
|
10854
11190
|
}
|
|
10855
11191
|
//#endregion
|
|
10856
11192
|
//#region src/lib/extractors/portion_references.ts
|
|
10857
|
-
function
|
|
11193
|
+
function nh(e, t) {
|
|
10858
11194
|
e && (e.start += t, e.stop += t);
|
|
10859
11195
|
}
|
|
10860
|
-
function
|
|
11196
|
+
function rh(e, t) {
|
|
10861
11197
|
if (e.type === "parent-enfant") {
|
|
10862
|
-
|
|
11198
|
+
rh(e.parent, t), rh(e.child, t), nh(e.position, t);
|
|
10863
11199
|
return;
|
|
10864
11200
|
}
|
|
10865
11201
|
if (e.type === "bounded-interval") {
|
|
10866
|
-
|
|
11202
|
+
rh(e.first, t), rh(e.last, t), nh(e.position, t);
|
|
10867
11203
|
return;
|
|
10868
11204
|
}
|
|
10869
11205
|
if (e.type === "counted-interval") {
|
|
10870
|
-
|
|
11206
|
+
rh(e.first, t), nh(e.position, t);
|
|
10871
11207
|
return;
|
|
10872
11208
|
}
|
|
10873
11209
|
if (e.type === "enumeration" || e.type === "exclusion") {
|
|
10874
|
-
|
|
11210
|
+
rh(e.left, t), rh(e.right, t), nh(e.position, t);
|
|
10875
11211
|
return;
|
|
10876
11212
|
}
|
|
10877
11213
|
if (e.type === "reference_et_action") {
|
|
10878
|
-
|
|
11214
|
+
rh(e.reference, t), nh(e.position, t);
|
|
10879
11215
|
return;
|
|
10880
11216
|
}
|
|
10881
|
-
|
|
11217
|
+
nh(e.position, t);
|
|
10882
11218
|
}
|
|
10883
|
-
function
|
|
11219
|
+
function ih(e) {
|
|
10884
11220
|
return e.replace(/\b(de\s+l['’]?|de\s+la|de\s+le|du|des)\s*$/i, "");
|
|
10885
11221
|
}
|
|
10886
|
-
function
|
|
11222
|
+
function ah(e) {
|
|
10887
11223
|
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();
|
|
10888
11224
|
return n ? {
|
|
10889
11225
|
text: n,
|
|
10890
11226
|
offset: t
|
|
10891
11227
|
} : null;
|
|
10892
11228
|
}
|
|
10893
|
-
function
|
|
11229
|
+
function oh(e) {
|
|
10894
11230
|
return [...e.matchAll(/(?:^|\P{L})(\p{L})/gu)].map((e) => (e.index ?? 0) + e[0].length - (e[1]?.length ?? 0));
|
|
10895
11231
|
}
|
|
10896
|
-
function
|
|
11232
|
+
function sh(e) {
|
|
10897
11233
|
let t = new n(e), r = Rt(t);
|
|
10898
11234
|
return !r || t.remaining().trim().length !== 0 ? null : r;
|
|
10899
11235
|
}
|
|
10900
|
-
function
|
|
10901
|
-
for (let t of
|
|
11236
|
+
function ch(e) {
|
|
11237
|
+
for (let t of oh(e)) {
|
|
10902
11238
|
let r = new n(e, t), i = Et(r);
|
|
10903
11239
|
if (!(i === void 0 || r.remaining().trim() !== "")) return {
|
|
10904
11240
|
nature: i,
|
|
@@ -10907,17 +11243,17 @@ function Um(e) {
|
|
|
10907
11243
|
}
|
|
10908
11244
|
return null;
|
|
10909
11245
|
}
|
|
10910
|
-
function
|
|
11246
|
+
function lh(e, t) {
|
|
10911
11247
|
let n = e.trim().replace(/[;:,]\s*$/u, "").replace(/\b(?:est|sont)\s*$/iu, "").trim();
|
|
10912
11248
|
if (!n) return null;
|
|
10913
|
-
for (let e of
|
|
10914
|
-
let r = n.slice(e).trim(), i =
|
|
11249
|
+
for (let e of oh(n)) {
|
|
11250
|
+
let r = n.slice(e).trim(), i = ch(r);
|
|
10915
11251
|
if (!i) continue;
|
|
10916
|
-
let a =
|
|
11252
|
+
let a = _m(r.slice(0, i.start)).trim();
|
|
10917
11253
|
if (!a) continue;
|
|
10918
11254
|
let o = /\s*(,|\bet\b|\bou\b|(?<!\p{L})[aà](?!\p{L}))\s*/giu, s = [], c = 0, l;
|
|
10919
11255
|
for (; (l = o.exec(a)) !== null;) {
|
|
10920
|
-
let e =
|
|
11256
|
+
let e = qm(l[1] ?? "");
|
|
10921
11257
|
if (a.slice(c, l.index).trim() === "") {
|
|
10922
11258
|
e !== "a" && e !== "à" && (c = o.lastIndex);
|
|
10923
11259
|
continue;
|
|
@@ -10934,17 +11270,17 @@ function Wm(e, t) {
|
|
|
10934
11270
|
}), s.length < 2) continue;
|
|
10935
11271
|
let u = s.some((e) => e.separator === "à"), d = [], f = [], p = !0, m = i.nature, h;
|
|
10936
11272
|
for (let [n, r] of s.entries()) {
|
|
10937
|
-
let i =
|
|
11273
|
+
let i = ah(r.text);
|
|
10938
11274
|
if (!i) {
|
|
10939
11275
|
d.length = 0;
|
|
10940
11276
|
break;
|
|
10941
11277
|
}
|
|
10942
|
-
let a =
|
|
11278
|
+
let a = sh(`${i.text} ${m}`);
|
|
10943
11279
|
if (!a) {
|
|
10944
11280
|
d.length = 0;
|
|
10945
11281
|
break;
|
|
10946
11282
|
}
|
|
10947
|
-
|
|
11283
|
+
rh(a, t + e + r.start + i.offset), d.push(a), a.type !== m || a.index === void 0 || a.index < 1 ? p = !1 : (h !== void 0 && !u && a.index !== h + 1 && (p = !1), h = a.index), n < s.length - 1 && (f.push(r.separator ?? "et"), (r.separator ?? "et") === "ou" && (p = !1));
|
|
10948
11284
|
}
|
|
10949
11285
|
let [g, ..._] = d;
|
|
10950
11286
|
if (!g || _.length === 0) continue;
|
|
@@ -10961,16 +11297,16 @@ function Wm(e, t) {
|
|
|
10961
11297
|
}
|
|
10962
11298
|
return null;
|
|
10963
11299
|
}
|
|
10964
|
-
function
|
|
11300
|
+
function uh(e, t) {
|
|
10965
11301
|
let r = e.trim().replace(/[;:,]\s*$/u, "").replace(/\b(?:est|sont)\s*$/iu, "").trim();
|
|
10966
11302
|
if (!r) return null;
|
|
10967
|
-
for (let e of
|
|
11303
|
+
for (let e of oh(r)) {
|
|
10968
11304
|
let i = r.slice(e);
|
|
10969
11305
|
if (!i) continue;
|
|
10970
11306
|
let a = new n(i), o = Rt(a);
|
|
10971
11307
|
if (!o || a.offset === 0 || !se(a)) continue;
|
|
10972
|
-
let s = a.offset, c =
|
|
10973
|
-
if (c) return
|
|
11308
|
+
let s = a.offset, c = lh(i.slice(s), t + e + s);
|
|
11309
|
+
if (c) return rh(o, t + e), {
|
|
10974
11310
|
...mt(c, o),
|
|
10975
11311
|
position: {
|
|
10976
11312
|
start: o.position.start,
|
|
@@ -10980,57 +11316,57 @@ function Gm(e, t) {
|
|
|
10980
11316
|
}
|
|
10981
11317
|
return null;
|
|
10982
11318
|
}
|
|
10983
|
-
function
|
|
10984
|
-
let r =
|
|
11319
|
+
function dh(e, t) {
|
|
11320
|
+
let r = ih(e);
|
|
10985
11321
|
if (!r) return null;
|
|
10986
|
-
let i =
|
|
11322
|
+
let i = uh(r, t);
|
|
10987
11323
|
if (i) return i;
|
|
10988
|
-
let a =
|
|
11324
|
+
let a = lh(r, t);
|
|
10989
11325
|
if (a) return a;
|
|
10990
|
-
for (let e of
|
|
11326
|
+
for (let e of oh(r)) {
|
|
10991
11327
|
let i = r.slice(e);
|
|
10992
11328
|
if (!i) continue;
|
|
10993
11329
|
let a = new n(i), o = Rt(a);
|
|
10994
|
-
if (!(!o || a.offset === 0) && i.slice(a.offset).trim().length === 0) return
|
|
11330
|
+
if (!(!o || a.offset === 0) && i.slice(a.offset).trim().length === 0) return rh(o, t + e), o;
|
|
10995
11331
|
}
|
|
10996
11332
|
return null;
|
|
10997
11333
|
}
|
|
10998
|
-
function
|
|
11334
|
+
function fh(e) {
|
|
10999
11335
|
return Math.max(0, ...Rp(e).map((e) => e.kind === "single" ? e.steps.length : Math.max(e.first.length, e.last.length)));
|
|
11000
11336
|
}
|
|
11001
|
-
function
|
|
11337
|
+
function ph(e) {
|
|
11002
11338
|
return Rp(e).length;
|
|
11003
11339
|
}
|
|
11004
|
-
function
|
|
11340
|
+
function mh(e, t) {
|
|
11005
11341
|
if (!e) return t;
|
|
11006
11342
|
if (!t) return e;
|
|
11007
|
-
let n =
|
|
11008
|
-
return n === r ?
|
|
11343
|
+
let n = fh(e), r = fh(t);
|
|
11344
|
+
return n === r ? ph(e) >= ph(t) ? e : t : n > r ? e : t;
|
|
11009
11345
|
}
|
|
11010
|
-
function
|
|
11346
|
+
function hh(e) {
|
|
11011
11347
|
return e.map((e) => ({
|
|
11012
11348
|
reference: e,
|
|
11013
|
-
specificity:
|
|
11349
|
+
specificity: fh(e)
|
|
11014
11350
|
})).filter((e) => e.specificity > 0).sort((e, t) => t.specificity - e.specificity)[0]?.reference ?? null;
|
|
11015
11351
|
}
|
|
11016
|
-
function
|
|
11352
|
+
function gh(e, { actionIndex: t = e.length } = {}) {
|
|
11017
11353
|
let r = /\barticle\b/i.exec(e);
|
|
11018
11354
|
if (!r || r.index === void 0) return null;
|
|
11019
11355
|
let i = r.index, a = new n(e.slice(i)), o = fn(a);
|
|
11020
11356
|
if (!o) return null;
|
|
11021
|
-
|
|
11022
|
-
let s = e.slice(0, i), c = i + a.offset, l = e.slice(c, t), u =
|
|
11357
|
+
rh(o, i);
|
|
11358
|
+
let s = e.slice(0, i), c = i + a.offset, l = e.slice(c, t), u = mh(hh(_h(s)), dh(s, 0)) ?? hh(_h(l)) ?? dh(l, c);
|
|
11023
11359
|
return u ? mt(o, u) : null;
|
|
11024
11360
|
}
|
|
11025
|
-
function
|
|
11026
|
-
return
|
|
11361
|
+
function _h(e) {
|
|
11362
|
+
return Rm(new n(e));
|
|
11027
11363
|
}
|
|
11028
11364
|
//#endregion
|
|
11029
11365
|
//#region src/lib/extractors/quoted_text.ts
|
|
11030
|
-
function
|
|
11366
|
+
function vh(e) {
|
|
11031
11367
|
return e.split(/\n+/).map((e) => e.replace(/^\s*[«“"]\s*/u, "").trim()).filter((e) => e.length > 0).join("\n").replace(/[»”"]\s*$/u, "").trim();
|
|
11032
11368
|
}
|
|
11033
|
-
function
|
|
11369
|
+
function yh(e) {
|
|
11034
11370
|
let t = [], r = 0;
|
|
11035
11371
|
for (; r < e.length;) {
|
|
11036
11372
|
let i = e.indexOf("«", r);
|
|
@@ -11042,7 +11378,7 @@ function eh(e) {
|
|
|
11042
11378
|
r = i + 1;
|
|
11043
11379
|
continue;
|
|
11044
11380
|
}
|
|
11045
|
-
let s =
|
|
11381
|
+
let s = vh(Zp(e, o)), c = o.position ?? {
|
|
11046
11382
|
start: i,
|
|
11047
11383
|
stop: i + 1
|
|
11048
11384
|
};
|
|
@@ -11056,7 +11392,7 @@ function eh(e) {
|
|
|
11056
11392
|
}
|
|
11057
11393
|
return t;
|
|
11058
11394
|
}
|
|
11059
|
-
function
|
|
11395
|
+
function bh(e, t) {
|
|
11060
11396
|
if (t.length === 0) return e;
|
|
11061
11397
|
let n = 0, r = [];
|
|
11062
11398
|
for (let { start: i, end: a } of t) {
|
|
@@ -11065,7 +11401,7 @@ function th(e, t) {
|
|
|
11065
11401
|
}
|
|
11066
11402
|
return n < e.length && r.push(e.slice(n)), r.join("");
|
|
11067
11403
|
}
|
|
11068
|
-
function
|
|
11404
|
+
function xh(e) {
|
|
11069
11405
|
let t = [], n = 0;
|
|
11070
11406
|
for (; n < e.length;) {
|
|
11071
11407
|
let r = e.indexOf("«", n);
|
|
@@ -11085,13 +11421,13 @@ function nh(e) {
|
|
|
11085
11421
|
}
|
|
11086
11422
|
return t;
|
|
11087
11423
|
}
|
|
11088
|
-
function
|
|
11424
|
+
function Sh(e, t) {
|
|
11089
11425
|
return e ? t.some((t) => e.start >= t.start && e.stop <= t.end) : !1;
|
|
11090
11426
|
}
|
|
11091
|
-
function
|
|
11092
|
-
return
|
|
11427
|
+
function Ch(e, t) {
|
|
11428
|
+
return Sh(e, t);
|
|
11093
11429
|
}
|
|
11094
|
-
function
|
|
11430
|
+
function wh(e) {
|
|
11095
11431
|
if (!e.includes("«")) return e;
|
|
11096
11432
|
let t = e.split(""), n = !1;
|
|
11097
11433
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -11110,10 +11446,10 @@ function ah(e) {
|
|
|
11110
11446
|
}
|
|
11111
11447
|
//#endregion
|
|
11112
11448
|
//#region src/lib/text_parsers/action_citation_patterns.ts
|
|
11113
|
-
function
|
|
11449
|
+
function Th(e) {
|
|
11114
11450
|
return `(?:${e.join("|")})`;
|
|
11115
11451
|
}
|
|
11116
|
-
var
|
|
11452
|
+
var Eh = [
|
|
11117
11453
|
"(?:à\\s+|de\\s+)?l[’']année",
|
|
11118
11454
|
"(?:à\\s+|de\\s+)?la date",
|
|
11119
11455
|
"(?:à\\s+|de\\s+)?la mention",
|
|
@@ -11131,7 +11467,7 @@ var sh = [
|
|
|
11131
11467
|
"(?:aux|des|les)\\s+nombres",
|
|
11132
11468
|
"(?:aux|des|les)\\s+références",
|
|
11133
11469
|
"le tableau intitulé"
|
|
11134
|
-
],
|
|
11470
|
+
], Dh = [
|
|
11135
11471
|
"l[’']année",
|
|
11136
11472
|
"la date",
|
|
11137
11473
|
"la mention",
|
|
@@ -11149,10 +11485,10 @@ var sh = [
|
|
|
11149
11485
|
"les mots",
|
|
11150
11486
|
"les nombres",
|
|
11151
11487
|
"les références"
|
|
11152
|
-
],
|
|
11488
|
+
], Oh = Th(Eh), kh = Th(Dh);
|
|
11153
11489
|
//#endregion
|
|
11154
11490
|
//#region src/lib/text_parsers/action_directives.ts
|
|
11155
|
-
function
|
|
11491
|
+
function Ah(e) {
|
|
11156
11492
|
return e.type === "reference_et_action" ? {
|
|
11157
11493
|
action: e.action,
|
|
11158
11494
|
reference: e.reference
|
|
@@ -11161,7 +11497,7 @@ function dh(e) {
|
|
|
11161
11497
|
reference: e
|
|
11162
11498
|
};
|
|
11163
11499
|
}
|
|
11164
|
-
function
|
|
11500
|
+
function jh(e) {
|
|
11165
11501
|
let t = e.indices?.[0]?.[0] ?? e.index, n = /« ?(.*?) ?»/dg, r = [], i;
|
|
11166
11502
|
for (; (i = n.exec(e[0])) !== null;) {
|
|
11167
11503
|
let e = i.indices?.[1], n = i.indices?.[0];
|
|
@@ -11177,21 +11513,21 @@ function fh(e) {
|
|
|
11177
11513
|
}
|
|
11178
11514
|
return r;
|
|
11179
11515
|
}
|
|
11180
|
-
var
|
|
11181
|
-
C(`${
|
|
11516
|
+
var Mh = x([
|
|
11517
|
+
C(`${Oh}s?`, { flags: "i" }),
|
|
11182
11518
|
C(" ?: ?"),
|
|
11183
11519
|
$
|
|
11184
|
-
], { value: (e) => e[2] }),
|
|
11185
|
-
C(`${
|
|
11520
|
+
], { value: (e) => e[2] }), Nh = x([
|
|
11521
|
+
C(`${kh}s?(?: suivant(?:e)?s?)?`, { flags: "i" }),
|
|
11186
11522
|
C(" ?: ?"),
|
|
11187
11523
|
$
|
|
11188
|
-
], { value: (e) => e[2] }),
|
|
11524
|
+
], { value: (e) => e[2] }), Ph = x([
|
|
11189
11525
|
b,
|
|
11190
|
-
|
|
11526
|
+
Mh,
|
|
11191
11527
|
S,
|
|
11192
11528
|
T(C("est remplacée? par", { flags: "i" }), C("sont remplacée?s par", { flags: "i" })),
|
|
11193
11529
|
S,
|
|
11194
|
-
|
|
11530
|
+
Nh
|
|
11195
11531
|
], { value: (e) => ({
|
|
11196
11532
|
action: {
|
|
11197
11533
|
action: "remplacer",
|
|
@@ -11202,9 +11538,9 @@ var ph = x([
|
|
|
11202
11538
|
replacementCitation: e[5],
|
|
11203
11539
|
targetCitation: e[1]
|
|
11204
11540
|
}
|
|
11205
|
-
}) }),
|
|
11541
|
+
}) }), Fh = T(C(`(?:, ?| )(?:${Oh}s? ?: ?« ?[^»]+ ?»(?: ?(?:,|et) ?)*)+(?:est|sont) (?:supprimée?s?|abrogée?s?)`, {
|
|
11206
11542
|
flags: "di",
|
|
11207
|
-
value: (e) =>
|
|
11543
|
+
value: (e) => jh(e).map((e) => ({
|
|
11208
11544
|
action: {
|
|
11209
11545
|
action: "supprimer",
|
|
11210
11546
|
actionInContent: !0
|
|
@@ -11216,8 +11552,8 @@ var ph = x([
|
|
|
11216
11552
|
}))
|
|
11217
11553
|
}), x([
|
|
11218
11554
|
b,
|
|
11219
|
-
|
|
11220
|
-
_([C("(?:, ?| et )"),
|
|
11555
|
+
Mh,
|
|
11556
|
+
_([C("(?:, ?| et )"), Mh], { value: (e) => e.map((e) => e[1]) }),
|
|
11221
11557
|
S,
|
|
11222
11558
|
T(C("est supprimée?", { flags: "i" }), C("sont supprimée?s", { flags: "i" }), C("est abrogée?", { flags: "i" }), C("sont abrogée?s", { flags: "i" }))
|
|
11223
11559
|
], { value: (e) => [e[1], ...e[2] ?? []].map((e) => ({
|
|
@@ -11229,9 +11565,9 @@ var ph = x([
|
|
|
11229
11565
|
kind: "delete",
|
|
11230
11566
|
targetCitation: e
|
|
11231
11567
|
}
|
|
11232
|
-
})) })),
|
|
11568
|
+
})) })), Ih = T(x([
|
|
11233
11569
|
b,
|
|
11234
|
-
|
|
11570
|
+
Vm,
|
|
11235
11571
|
S,
|
|
11236
11572
|
C("(?:la référence|la mention|le mot|les mots|le signe)", { flags: "i" }),
|
|
11237
11573
|
C(" ?: ?"),
|
|
@@ -11247,10 +11583,10 @@ var ph = x([
|
|
|
11247
11583
|
},
|
|
11248
11584
|
operation: {
|
|
11249
11585
|
insertCitation: e[9],
|
|
11250
|
-
kind:
|
|
11586
|
+
kind: Um(e[1]),
|
|
11251
11587
|
targetCitation: e[5]
|
|
11252
11588
|
}
|
|
11253
|
-
}) }),
|
|
11589
|
+
}) }), Ph, Fh, x([
|
|
11254
11590
|
b,
|
|
11255
11591
|
T(C("est ainsi rédigée?", { flags: "i" }), C("sont ainsi rédigée?s", { flags: "i" }), C("est rédigée? (?:ainsi qu'il|comme) suit", { flags: "i" }), C("sont rédigée?s (?:ainsi qu'il|comme) suit", { flags: "i" })),
|
|
11256
11592
|
C(" ?: ?"),
|
|
@@ -11265,27 +11601,27 @@ var ph = x([
|
|
|
11265
11601
|
replacementCitation: e[3],
|
|
11266
11602
|
replacementKind: "text"
|
|
11267
11603
|
}
|
|
11268
|
-
}) })),
|
|
11604
|
+
}) })), Lh = T(Ih, x([C(" et"), Ih], { value: (e) => e[1] })), Rh = w(T(x([
|
|
11269
11605
|
S,
|
|
11270
11606
|
C("par", { flags: "i" }),
|
|
11271
11607
|
S,
|
|
11272
|
-
|
|
11608
|
+
Nh
|
|
11273
11609
|
], { value: (e) => ({
|
|
11274
11610
|
citation: e[3],
|
|
11275
11611
|
kind: "replace"
|
|
11276
|
-
}) }), x([S,
|
|
11612
|
+
}) }), x([S, Nh], { value: (e) => ({
|
|
11277
11613
|
citation: e[1],
|
|
11278
11614
|
kind: "insert"
|
|
11279
11615
|
}) })), { default: null });
|
|
11280
|
-
function
|
|
11616
|
+
function zh(e) {
|
|
11281
11617
|
return typeof e == "object" && !!e && "action" in e && "operation" in e;
|
|
11282
11618
|
}
|
|
11283
|
-
function
|
|
11619
|
+
function Bh(e) {
|
|
11284
11620
|
let t = [];
|
|
11285
|
-
for (let n of e)
|
|
11621
|
+
for (let n of e) zh(n) ? t.push(n) : Array.isArray(n) && t.push(...Bh(n));
|
|
11286
11622
|
return t;
|
|
11287
11623
|
}
|
|
11288
|
-
function
|
|
11624
|
+
function Vh(e, t) {
|
|
11289
11625
|
if (!e) return [];
|
|
11290
11626
|
let n = e.originalCitations ?? [];
|
|
11291
11627
|
if (e.action === "remplacer") {
|
|
@@ -11333,12 +11669,12 @@ function Sh(e, t) {
|
|
|
11333
11669
|
}
|
|
11334
11670
|
return [];
|
|
11335
11671
|
}
|
|
11336
|
-
var
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
_(
|
|
11672
|
+
var Hh = i("après|avant|remplacée?s?|supprimée?s?|abrogée?s?|ins[eé]r[eé]e?s?|ajout[eé]e?s?|rédigée?s?", x([
|
|
11673
|
+
jm,
|
|
11674
|
+
Rh,
|
|
11675
|
+
_(Lh, { value: (e) => Bh(e) })
|
|
11340
11676
|
], { value: (e, t) => {
|
|
11341
|
-
let { action: n, reference: r } =
|
|
11677
|
+
let { action: n, reference: r } = Ah(e[0]), i = [...Vh(n, e[1]), ...e[2] ?? []], a = n ?? i[0]?.action;
|
|
11342
11678
|
if (!(!a || i.length === 0)) return {
|
|
11343
11679
|
action: a,
|
|
11344
11680
|
operations: i.map(({ operation: e }) => e),
|
|
@@ -11346,7 +11682,7 @@ var Ch = i("après|avant|remplacée?s?|supprimée?s?|abrogée?s?|ins[eé]r[eé]e
|
|
|
11346
11682
|
reference: r,
|
|
11347
11683
|
type: "action_directive"
|
|
11348
11684
|
};
|
|
11349
|
-
} }), 200),
|
|
11685
|
+
} }), 200), Uh = x([
|
|
11350
11686
|
C("la\\s+fin\\s+de\\s+", { flags: "i" }),
|
|
11351
11687
|
w(C("(?:la\\s+|l['’]\\s*)", { flags: "i" }), { default: "" }),
|
|
11352
11688
|
T(C("phrase", {
|
|
@@ -11363,14 +11699,14 @@ var Ch = i("après|avant|remplacée?s?|supprimée?s?|abrogée?s?|ins[eé]r[eé]e
|
|
|
11363
11699
|
type: "tail_after_target",
|
|
11364
11700
|
unit: e[2]
|
|
11365
11701
|
}) });
|
|
11366
|
-
function
|
|
11702
|
+
function Wh(e) {
|
|
11367
11703
|
if (e.type === "phrase") return "phrase";
|
|
11368
11704
|
if (e.type === "alinéa") return "alinéa";
|
|
11369
11705
|
if (e.type === "article") return "article";
|
|
11370
|
-
if (e.type === "parent-enfant") return
|
|
11706
|
+
if (e.type === "parent-enfant") return Wh(e.child);
|
|
11371
11707
|
}
|
|
11372
|
-
function
|
|
11373
|
-
let t =
|
|
11708
|
+
function Gh(e) {
|
|
11709
|
+
let t = qm(e);
|
|
11374
11710
|
if (!/\bla\s+fin\s+d/iu.test(t)) return null;
|
|
11375
11711
|
let n = /\bla\s+fin\s+(?:de\s+la|d['’]?une|du|de\s+l['’]?|des)\s*[^,;.]*\bphrase\b/u.test(t) ? "phrase" : /\bla\s+fin\s+(?:de\s+la|d['’]?un|du|de\s+l['’]?|des)\s*[^,;.]*\balinea\b/u.test(t) ? "alinéa" : /\bla\s+fin\s+(?:de\s+l['’]?|d['’]?)article\b/u.test(t) ? "article" : void 0;
|
|
11376
11712
|
return {
|
|
@@ -11380,10 +11716,10 @@ function Eh(e) {
|
|
|
11380
11716
|
}
|
|
11381
11717
|
//#endregion
|
|
11382
11718
|
//#region src/lib/text_parsers/action_occurrences.ts
|
|
11383
|
-
function
|
|
11719
|
+
function Kh(e) {
|
|
11384
11720
|
return e.replace(/\s+/gu, " ").trim().normalize("NFD").replace(/[\u0300-\u036f]/gu, "").replace(/[’‘]/gu, "'").toLowerCase();
|
|
11385
11721
|
}
|
|
11386
|
-
function
|
|
11722
|
+
function qh(e, t) {
|
|
11387
11723
|
let n = e.slice(0, Math.max(0, t)), r = RegExp(`\\b(${we})\\s+occurrence\\b`, "giu"), i = null, a;
|
|
11388
11724
|
for (; (a = r.exec(n)) !== null;) {
|
|
11389
11725
|
let e = be(a[1] ?? "");
|
|
@@ -11391,37 +11727,37 @@ function Oh(e, t) {
|
|
|
11391
11727
|
}
|
|
11392
11728
|
return i;
|
|
11393
11729
|
}
|
|
11394
|
-
function
|
|
11395
|
-
let t =
|
|
11396
|
-
return /\b(?:derniere\s+occurrence|a\s+la\s+fin)\b/u.test(t) ? "last" :
|
|
11730
|
+
function Jh(e) {
|
|
11731
|
+
let t = Kh(e);
|
|
11732
|
+
return /\b(?:derniere\s+occurrence|a\s+la\s+fin)\b/u.test(t) ? "last" : qh(e, e.length) ?? void 0;
|
|
11397
11733
|
}
|
|
11398
11734
|
//#endregion
|
|
11399
11735
|
//#region src/lib/extractors/action_directives.ts
|
|
11400
|
-
var
|
|
11401
|
-
function
|
|
11736
|
+
var Yh = "(?:(?:alinea|alineas|section|sous-section|paragraphe|sous-paragraphe|sous-sous-paragraphe|chapitre|titre|livre|partie)|(?:[ivxlcdm]+|[a-z]|\\d+\\s*°?)(?:\\s+(?:bis|ter|quater|quinquies|sexies|septies|octies|nonies|decies|undecies|duodecies))?)", Xh = "(?:un|une|l['’]?|le|la)";
|
|
11737
|
+
function Zh(e) {
|
|
11402
11738
|
return /\b(?:les?|la|l['’]?)\s+(?:mots?|references?|mentions?|signes?|nombres?|montants?|taux|pourcentages?|dates?|annees?)\b/u.test(e);
|
|
11403
11739
|
}
|
|
11404
|
-
function
|
|
11740
|
+
function Qh(e) {
|
|
11405
11741
|
return /\b(?:une|la|les?)\s+phrases?\b/u.test(e);
|
|
11406
11742
|
}
|
|
11407
|
-
function
|
|
11408
|
-
return new RegExp(String.raw`\b(?:insere(?:e|es|s)?|ajoute(?:e|es|s)?|complete(?:e|es|s)?|retabli(?:e|es|s)?)\b[\s\S]{0,90}\b${
|
|
11743
|
+
function $h(e) {
|
|
11744
|
+
return new RegExp(String.raw`\b(?:insere(?:e|es|s)?|ajoute(?:e|es|s)?|complete(?:e|es|s)?|retabli(?:e|es|s)?)\b[\s\S]{0,90}\b${Xh}\s+${Yh}\b`, "u").test(e) ? !0 : new RegExp(String.raw`\b${Xh}\s+${Yh}\b[\s\S]{0,90}\b(?:est|sont)\s+(?:ainsi\s+)?(?:insere(?:e|es|s)?|ajoute(?:e|es|s)?|complete(?:e|es|s)?|retabli(?:e|es|s)?)\b`, "u").test(e);
|
|
11409
11745
|
}
|
|
11410
|
-
function
|
|
11411
|
-
if (!
|
|
11746
|
+
function eg({ hasRedactionIntro: e, insertText: t, normalized: n }) {
|
|
11747
|
+
if (!Zh(n) && !Qh(n) && ($h(n) && /\balinea\b/u.test(n) || e && yp(t))) return "block";
|
|
11412
11748
|
}
|
|
11413
|
-
function
|
|
11414
|
-
if (!
|
|
11749
|
+
function tg({ hasRedactionIntro: e, normalized: t, replacementText: n }) {
|
|
11750
|
+
if (!Qh(t) && (e && /\balineas?\b/u.test(t) || e && yp(n))) return "block";
|
|
11415
11751
|
}
|
|
11416
|
-
function
|
|
11752
|
+
function ng(e) {
|
|
11417
11753
|
let t = bp(e);
|
|
11418
11754
|
return t ? t.restText : e;
|
|
11419
11755
|
}
|
|
11420
|
-
function
|
|
11421
|
-
let t =
|
|
11756
|
+
function rg(e) {
|
|
11757
|
+
let t = ng(e);
|
|
11422
11758
|
return t === e ? e.replace(gp, "") : t;
|
|
11423
11759
|
}
|
|
11424
|
-
function
|
|
11760
|
+
function ig(e) {
|
|
11425
11761
|
let t = e.split("\n"), n = [], r = 0;
|
|
11426
11762
|
for (let e of t) {
|
|
11427
11763
|
let t = r, i = t + e.length;
|
|
@@ -11433,10 +11769,10 @@ function zh(e) {
|
|
|
11433
11769
|
}
|
|
11434
11770
|
return n;
|
|
11435
11771
|
}
|
|
11436
|
-
function
|
|
11772
|
+
function ag(e) {
|
|
11437
11773
|
return bp(e) !== void 0 || gp.test(e);
|
|
11438
11774
|
}
|
|
11439
|
-
function
|
|
11775
|
+
function og(e) {
|
|
11440
11776
|
if (gp.test(e)) return {
|
|
11441
11777
|
marker: "-",
|
|
11442
11778
|
level: 5
|
|
@@ -11444,87 +11780,87 @@ function Vh(e) {
|
|
|
11444
11780
|
let t = bp(e);
|
|
11445
11781
|
return t ? {
|
|
11446
11782
|
marker: t.token,
|
|
11447
|
-
level:
|
|
11783
|
+
level: sg(t.token)
|
|
11448
11784
|
} : null;
|
|
11449
11785
|
}
|
|
11450
|
-
function
|
|
11786
|
+
function sg(e) {
|
|
11451
11787
|
let t = e.trim().split(/\s+/u)[0]?.replace(/[^\p{L}\p{N}]+/gu, "") ?? "";
|
|
11452
11788
|
return /^\d+$/u.test(t) ? 2 : /^[ivxlcdm]+$/u.test(t) && (t.length > 1 || /^[ivx]$/u.test(t)) ? 4 : /^[a-z]$/u.test(t) ? 3 : vp(t) || /^[A-Z]$/u.test(t) ? 1 : 2;
|
|
11453
11789
|
}
|
|
11454
|
-
function
|
|
11790
|
+
function cg(e) {
|
|
11455
11791
|
let t = [], n = e;
|
|
11456
11792
|
for (;;) {
|
|
11457
|
-
let e =
|
|
11793
|
+
let e = og(n);
|
|
11458
11794
|
if (!e) return t;
|
|
11459
11795
|
t.push(e.marker);
|
|
11460
|
-
let r =
|
|
11796
|
+
let r = rg(n);
|
|
11461
11797
|
if (r === n) return t;
|
|
11462
11798
|
n = r.trimStart();
|
|
11463
11799
|
}
|
|
11464
11800
|
}
|
|
11465
|
-
function
|
|
11466
|
-
let t =
|
|
11801
|
+
function lg(e) {
|
|
11802
|
+
let t = qm(bh(e, yh(e)));
|
|
11467
11803
|
return /(?:^|[;:.]\s*)(?:(?:il\s+)?est|sont)\s+(?:inseree?s?|ajoutee?s?)\s+(?:la\s+reference|la\s+mention|les\s+mots|le\s+mot|le\s+signe|les\s+references)?\s*:/.exec(t)?.index ?? null;
|
|
11468
11804
|
}
|
|
11469
|
-
function
|
|
11470
|
-
let t =
|
|
11805
|
+
function ug(e) {
|
|
11806
|
+
let t = lg(e);
|
|
11471
11807
|
if (t !== null) return t;
|
|
11472
11808
|
for (let t = 0; t < e.length; t += 1) {
|
|
11473
11809
|
let r = new n(e.slice(t));
|
|
11474
|
-
if (
|
|
11810
|
+
if (bm(r) && r.offset > 0) return t;
|
|
11475
11811
|
}
|
|
11476
11812
|
return null;
|
|
11477
11813
|
}
|
|
11478
|
-
function
|
|
11814
|
+
function dg(e) {
|
|
11479
11815
|
return e.type === "reference_et_action" ? e.reference : e;
|
|
11480
11816
|
}
|
|
11481
|
-
function
|
|
11482
|
-
return
|
|
11817
|
+
function fg(e) {
|
|
11818
|
+
return Rm(new n(e)).map(dg).find((e) => bt(e) === "article") || (x_(e)?.reference ?? null);
|
|
11483
11819
|
}
|
|
11484
|
-
function
|
|
11485
|
-
let t =
|
|
11820
|
+
function pg(e) {
|
|
11821
|
+
let t = ug(e) ?? e.length, r = xh(e), i = Rm(new n(e)), a = i.flatMap((e) => Array.from(O(dg(e)))).filter((e) => e.type === "article" && e.position).map((e) => ({
|
|
11486
11822
|
start: e.position.start,
|
|
11487
11823
|
end: e.position.stop
|
|
11488
|
-
})), o = i.map(
|
|
11489
|
-
return u ?
|
|
11824
|
+
})), o = i.map(dg).filter((e) => !Ch(e.position, r) && !Sh(e.position, a) && bt(e) !== "article" && (e.position?.start ?? 0) < t).sort((e, t) => (e.position?.start ?? 0) - (t.position?.start ?? 0)), s = e.slice(0, t).trimEnd(), c = dh(a_(s), 0) ?? dh(s, 0) ?? dh(s.replace(/\b(?:est|sont)\s*$/iu, "").trimEnd(), 0), l = c && !Sh(c.position, a) ? c : null, u = o[0];
|
|
11825
|
+
return u ? mh(u, l) : l;
|
|
11490
11826
|
}
|
|
11491
|
-
function
|
|
11492
|
-
let t =
|
|
11827
|
+
function mg(e) {
|
|
11828
|
+
let t = ug(e) ?? e.length, r = xh(e), i = Rm(new n(e)).map(dg).filter((e) => !Ch(e.position, r) && (e.position?.start ?? 0) < t).sort((e, t) => (e.position?.start ?? 0) - (t.position?.start ?? 0));
|
|
11493
11829
|
return i.length === 0 ? null : i.find((e) => bt(e) !== "article") ?? null ?? i[0] ?? null;
|
|
11494
11830
|
}
|
|
11495
|
-
function
|
|
11496
|
-
let t = [e,
|
|
11831
|
+
function hg(e) {
|
|
11832
|
+
let t = [e, ng(e)].map((e) => e.trim()).filter((e, t, n) => e && n.indexOf(e) === t);
|
|
11497
11833
|
for (let e of t) {
|
|
11498
|
-
let t =
|
|
11834
|
+
let t = ug(e) ?? e.length, n = dh(e, 0) ?? gh(e, { actionIndex: t }) ?? mg(e) ?? fg(e);
|
|
11499
11835
|
if (n) return n;
|
|
11500
11836
|
}
|
|
11501
11837
|
return null;
|
|
11502
11838
|
}
|
|
11503
|
-
function
|
|
11839
|
+
function gg(e) {
|
|
11504
11840
|
return e?.toLowerCase().replace(/[.)]/g, "").trim();
|
|
11505
11841
|
}
|
|
11506
|
-
function
|
|
11507
|
-
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 &&
|
|
11842
|
+
function _g(e, t) {
|
|
11843
|
+
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 && gg(e.num) !== gg(t.num));
|
|
11508
11844
|
}
|
|
11509
|
-
function
|
|
11845
|
+
function vg(e) {
|
|
11510
11846
|
let t = null;
|
|
11511
11847
|
for (let n of O(e)) t = n;
|
|
11512
11848
|
return t;
|
|
11513
11849
|
}
|
|
11514
|
-
function
|
|
11515
|
-
return t && e.type === "parent-enfant" &&
|
|
11850
|
+
function yg(e, t) {
|
|
11851
|
+
return t && e.type === "parent-enfant" && _g(e.parent, t) ? e.child : e;
|
|
11516
11852
|
}
|
|
11517
|
-
function
|
|
11853
|
+
function bg(e, t) {
|
|
11518
11854
|
let n = null;
|
|
11519
11855
|
for (let r of O(e)) r.type === t && r.relative === void 0 && (r.index === void 0 && r.num === void 0 || (n = r));
|
|
11520
11856
|
return n;
|
|
11521
11857
|
}
|
|
11522
|
-
function
|
|
11858
|
+
function xg(e, t) {
|
|
11523
11859
|
if (!t) return e;
|
|
11524
11860
|
let n = structuredClone(e), r = (e) => {
|
|
11525
11861
|
if (e.type !== "parent-enfant" && e.type !== "bounded-interval" && e.type !== "counted-interval" && e.type !== "enumeration" && e.type !== "exclusion" && e.type !== "reference_et_action") {
|
|
11526
11862
|
if (e.relative === 0) {
|
|
11527
|
-
let n =
|
|
11863
|
+
let n = bg(t, e.type);
|
|
11528
11864
|
n && (e.index = n.index, e.num = n.num, delete e.relative);
|
|
11529
11865
|
}
|
|
11530
11866
|
return;
|
|
@@ -11550,7 +11886,7 @@ function ng(e, t) {
|
|
|
11550
11886
|
};
|
|
11551
11887
|
return r(n), n;
|
|
11552
11888
|
}
|
|
11553
|
-
function
|
|
11889
|
+
function Sg(e) {
|
|
11554
11890
|
let t = (e) => {
|
|
11555
11891
|
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;
|
|
11556
11892
|
switch (e.type) {
|
|
@@ -11564,14 +11900,14 @@ function rg(e) {
|
|
|
11564
11900
|
};
|
|
11565
11901
|
return t(e);
|
|
11566
11902
|
}
|
|
11567
|
-
function
|
|
11903
|
+
function Cg(e) {
|
|
11568
11904
|
let t = [], n = [];
|
|
11569
11905
|
for (let r of e) {
|
|
11570
|
-
if (!
|
|
11906
|
+
if (!ag(r.text)) {
|
|
11571
11907
|
n[n.length - 1]?.body.push(r);
|
|
11572
11908
|
continue;
|
|
11573
11909
|
}
|
|
11574
|
-
let e =
|
|
11910
|
+
let e = og(r.text), i = e?.level ?? 0, a = {
|
|
11575
11911
|
body: [],
|
|
11576
11912
|
children: [],
|
|
11577
11913
|
level: i,
|
|
@@ -11583,13 +11919,13 @@ function ig(e) {
|
|
|
11583
11919
|
}
|
|
11584
11920
|
return t;
|
|
11585
11921
|
}
|
|
11586
|
-
function
|
|
11922
|
+
function wg(e, t) {
|
|
11587
11923
|
if (!e) return t;
|
|
11588
11924
|
if (!t) return e;
|
|
11589
|
-
let n =
|
|
11925
|
+
let n = yg(t, vg(e));
|
|
11590
11926
|
return n.type === "article" || bt(n), mt(e, n);
|
|
11591
11927
|
}
|
|
11592
|
-
function
|
|
11928
|
+
function Tg(e, t) {
|
|
11593
11929
|
return {
|
|
11594
11930
|
...mt(e, t),
|
|
11595
11931
|
position: {
|
|
@@ -11598,16 +11934,16 @@ function og(e, t) {
|
|
|
11598
11934
|
}
|
|
11599
11935
|
};
|
|
11600
11936
|
}
|
|
11601
|
-
function
|
|
11602
|
-
return [
|
|
11937
|
+
function Eg(e) {
|
|
11938
|
+
return [rg(e.line.text), ...e.body.map((e) => e.text)].join("\n").trim();
|
|
11603
11939
|
}
|
|
11604
|
-
function
|
|
11940
|
+
function Dg(e) {
|
|
11605
11941
|
return e.body[e.body.length - 1]?.end ?? e.line.end;
|
|
11606
11942
|
}
|
|
11607
|
-
function
|
|
11943
|
+
function Og(e) {
|
|
11608
11944
|
return (e ?? "").replace(/°/gu, "").replace(/\s+/gu, " ").trim();
|
|
11609
11945
|
}
|
|
11610
|
-
function
|
|
11946
|
+
function kg(e, t) {
|
|
11611
11947
|
let r = new n(e, t), i = te(r);
|
|
11612
11948
|
return typeof i == "string" && r.offset > t ? {
|
|
11613
11949
|
date: i,
|
|
@@ -11615,14 +11951,14 @@ function ug(e, t) {
|
|
|
11615
11951
|
stop: r.offset
|
|
11616
11952
|
} : null;
|
|
11617
11953
|
}
|
|
11618
|
-
function
|
|
11619
|
-
let t =
|
|
11954
|
+
function Ag(e) {
|
|
11955
|
+
let t = xh(e), n = [];
|
|
11620
11956
|
for (let r = 0; r < e.length; r += 1) {
|
|
11621
11957
|
let i = e[r];
|
|
11622
11958
|
if (i === void 0 || !/\d/u.test(i)) continue;
|
|
11623
|
-
let a =
|
|
11959
|
+
let a = kg(e, r);
|
|
11624
11960
|
if (a) {
|
|
11625
|
-
if (
|
|
11961
|
+
if (Sh(a, t)) {
|
|
11626
11962
|
r = Math.max(r, a.stop - 1);
|
|
11627
11963
|
continue;
|
|
11628
11964
|
}
|
|
@@ -11631,25 +11967,25 @@ function dg(e) {
|
|
|
11631
11967
|
}
|
|
11632
11968
|
return n;
|
|
11633
11969
|
}
|
|
11634
|
-
function
|
|
11635
|
-
return
|
|
11970
|
+
function jg(e) {
|
|
11971
|
+
return qm(e).replace(/\s+/gu, " ");
|
|
11636
11972
|
}
|
|
11637
|
-
function
|
|
11638
|
-
let t =
|
|
11973
|
+
function Mg(e) {
|
|
11974
|
+
let t = jg(e), n = /\b(?:entr(?:e|ent|era|eront)\s+en\s+vigueur|s['’]?\s*appli(?:que|quent)|est\s+applicable|sont\s+applicables?|applicables?)\b/giu, r = null, i;
|
|
11639
11975
|
for (; (i = n.exec(t)) !== null;) r = i;
|
|
11640
11976
|
return r;
|
|
11641
11977
|
}
|
|
11642
|
-
function
|
|
11643
|
-
let n =
|
|
11644
|
-
return !!(/\bau\s*$/u.test(n) && r.startsWith(",") || /\ba compter\s+(?:du|de la|de l['’]?|des)?\s*$/u.test(n) || /\babroge(?:e|es|s)?\s+a compter\s+(?:du|de la|de l['’]?|des)?\s*$/u.test(n) ||
|
|
11978
|
+
function Ng(e, t) {
|
|
11979
|
+
let n = jg(e.slice(0, t.start)), r = jg(e.slice(t.stop));
|
|
11980
|
+
return !!(/\bau\s*$/u.test(n) && r.startsWith(",") || /\ba compter\s+(?:du|de la|de l['’]?|des)?\s*$/u.test(n) || /\babroge(?:e|es|s)?\s+a compter\s+(?:du|de la|de l['’]?|des)?\s*$/u.test(n) || Mg(e.slice(0, t.start)));
|
|
11645
11981
|
}
|
|
11646
|
-
function
|
|
11647
|
-
return
|
|
11982
|
+
function Pg(e) {
|
|
11983
|
+
return Ag(e).find((t) => Ng(e, t))?.date;
|
|
11648
11984
|
}
|
|
11649
|
-
function
|
|
11650
|
-
return e.map((e) =>
|
|
11985
|
+
function Fg(e) {
|
|
11986
|
+
return e.map((e) => Og(e.num)).filter((e) => e.length > 0);
|
|
11651
11987
|
}
|
|
11652
|
-
function
|
|
11988
|
+
function Ig(e, t) {
|
|
11653
11989
|
let n = e.at(-1), r = t.at(-1);
|
|
11654
11990
|
if (!n || !r) return [e, t];
|
|
11655
11991
|
let i = e.slice(0, -1), a = t.slice(0, -1);
|
|
@@ -11660,51 +11996,51 @@ function _g(e, t) {
|
|
|
11660
11996
|
for (let e = o; e <= s; e += 1) c.push([...i, String(e)]);
|
|
11661
11997
|
return c;
|
|
11662
11998
|
}
|
|
11663
|
-
function
|
|
11999
|
+
function Lg(e) {
|
|
11664
12000
|
if (e.kind === "single") {
|
|
11665
|
-
let t =
|
|
12001
|
+
let t = Fg(e.steps);
|
|
11666
12002
|
return t.length > 0 ? [t] : [];
|
|
11667
12003
|
}
|
|
11668
|
-
let t =
|
|
11669
|
-
return t.length === 0 && n.length === 0 ? [] :
|
|
12004
|
+
let t = Fg(e.first), n = Fg(e.last);
|
|
12005
|
+
return t.length === 0 && n.length === 0 ? [] : Ig(t, n);
|
|
11670
12006
|
}
|
|
11671
|
-
function
|
|
11672
|
-
let t =
|
|
11673
|
-
for (let e of t.map(
|
|
12007
|
+
function Rg(e) {
|
|
12008
|
+
let t = Rm(new n(e)), r = [];
|
|
12009
|
+
for (let e of t.map(dg)) {
|
|
11674
12010
|
if (e.type === "article" && e.present) {
|
|
11675
12011
|
r.push([]);
|
|
11676
12012
|
continue;
|
|
11677
12013
|
}
|
|
11678
|
-
for (let t of Rp(e)) r.push(...
|
|
12014
|
+
for (let t of Rp(e)) r.push(...Lg(t));
|
|
11679
12015
|
}
|
|
11680
12016
|
return r.filter((e, t, n) => n.findIndex((t) => t.join("\0") === e.join("\0")) === t);
|
|
11681
12017
|
}
|
|
11682
|
-
function
|
|
12018
|
+
function zg(e) {
|
|
11683
12019
|
let t = [], n = e.split(/(?<=[.;])\s+/u).map((e) => e.trim()).filter(Boolean);
|
|
11684
|
-
for (let e of n) for (let n of
|
|
11685
|
-
if (!
|
|
11686
|
-
let r =
|
|
12020
|
+
for (let e of n) for (let n of Ag(e)) {
|
|
12021
|
+
if (!Ng(e, n)) continue;
|
|
12022
|
+
let r = Mg(e.slice(0, n.start));
|
|
11687
12023
|
if (!r) continue;
|
|
11688
|
-
let i =
|
|
12024
|
+
let i = Rg(e.slice(0, r.index).trim());
|
|
11689
12025
|
if (i.length === 0) continue;
|
|
11690
12026
|
t.push({
|
|
11691
12027
|
date: n.date,
|
|
11692
12028
|
paths: i
|
|
11693
12029
|
});
|
|
11694
|
-
let a =
|
|
12030
|
+
let a = Bg(e.slice(n.stop), i);
|
|
11695
12031
|
t.push(...a);
|
|
11696
12032
|
}
|
|
11697
12033
|
return t;
|
|
11698
12034
|
}
|
|
11699
|
-
function
|
|
12035
|
+
function Bg(e, t) {
|
|
11700
12036
|
let n = /(?:^|[^\p{L}\p{N}_])(?:a|à)\s+l['’]exception\s+(.+?)(?:\bqui\b|\bentr(?:e|ent|era|eront)\s+en\s+vigueur\b)/iu.exec(e);
|
|
11701
12037
|
if (!n) return [];
|
|
11702
12038
|
let r = n.index + n[0].length, i = n[1]?.trim();
|
|
11703
12039
|
if (!i) return [];
|
|
11704
|
-
let a =
|
|
12040
|
+
let a = Rg(i);
|
|
11705
12041
|
if (a.length === 0) return [];
|
|
11706
12042
|
let o = [];
|
|
11707
|
-
for (let n of
|
|
12043
|
+
for (let n of Ag(e.slice(r))) {
|
|
11708
12044
|
let e = n.date;
|
|
11709
12045
|
o.push({
|
|
11710
12046
|
date: e,
|
|
@@ -11715,44 +12051,44 @@ function xg(e, t) {
|
|
|
11715
12051
|
}
|
|
11716
12052
|
return o;
|
|
11717
12053
|
}
|
|
11718
|
-
function
|
|
12054
|
+
function Vg(e, t, n) {
|
|
11719
12055
|
return [
|
|
11720
12056
|
...e,
|
|
11721
|
-
|
|
11722
|
-
...
|
|
12057
|
+
Og(t.marker),
|
|
12058
|
+
...cg(n).map(Og)
|
|
11723
12059
|
].filter((e) => e.length > 0);
|
|
11724
12060
|
}
|
|
11725
|
-
function
|
|
12061
|
+
function Hg(e) {
|
|
11726
12062
|
let t = [];
|
|
11727
|
-
for (let n of e) t.push(...
|
|
12063
|
+
for (let n of e) t.push(...zg(Eg(n))), t.push(...Hg(n.children));
|
|
11728
12064
|
return t;
|
|
11729
12065
|
}
|
|
11730
|
-
function
|
|
12066
|
+
function Ug(e, t) {
|
|
11731
12067
|
return t.length > e.length ? !1 : t.every((t, n) => e[n] === t);
|
|
11732
12068
|
}
|
|
11733
|
-
function
|
|
12069
|
+
function Wg(e, t) {
|
|
11734
12070
|
if (t.length > e.length) return !1;
|
|
11735
12071
|
let n = e.length - t.length;
|
|
11736
12072
|
return t.every((t, r) => e[n + r] === t);
|
|
11737
12073
|
}
|
|
11738
|
-
function
|
|
11739
|
-
return n ? n.some((n) =>
|
|
12074
|
+
function Gg(e, t, n) {
|
|
12075
|
+
return n ? n.some((n) => Gg(e, n) ? Gg(e, Ug(e, n) ? [...n, ...t] : t) : !1) : t.length === 0 ? !0 : Ug(e, t) || Wg(e, t);
|
|
11740
12076
|
}
|
|
11741
|
-
function
|
|
12077
|
+
function Kg(e, t, n) {
|
|
11742
12078
|
if (e.length === 0 || n.length === 0) return;
|
|
11743
12079
|
let r = new Map(t.map((e) => [e.directive, e.sourcePath]));
|
|
11744
12080
|
for (let t of e) {
|
|
11745
12081
|
if (t.applicabilityDate) continue;
|
|
11746
12082
|
let e = r.get(t) ?? [], i, a = -1;
|
|
11747
12083
|
for (let t of n) for (let n of t.paths) {
|
|
11748
|
-
if (!
|
|
12084
|
+
if (!Gg(e, n, t.parentPaths)) continue;
|
|
11749
12085
|
let r = n.length + Math.max(0, ...t.parentPaths?.map((e) => e.length) ?? [0]);
|
|
11750
12086
|
r > a && (i = t.date, a = r);
|
|
11751
12087
|
}
|
|
11752
12088
|
i && (t.applicabilityDate = i);
|
|
11753
12089
|
}
|
|
11754
12090
|
}
|
|
11755
|
-
function
|
|
12091
|
+
function qg(e, t) {
|
|
11756
12092
|
if (!e) return t;
|
|
11757
12093
|
if (!t) return e;
|
|
11758
12094
|
let n = t.rowIndex ?? e.rowIndex, r = t.columnIndex ?? e.columnIndex;
|
|
@@ -11762,39 +12098,39 @@ function Og(e, t) {
|
|
|
11762
12098
|
...r ? { columnIndex: r } : {}
|
|
11763
12099
|
};
|
|
11764
12100
|
}
|
|
11765
|
-
function
|
|
12101
|
+
function Jg(e) {
|
|
11766
12102
|
return e !== void 0 && (e.rowIndex !== void 0 || e.columnIndex !== void 0);
|
|
11767
12103
|
}
|
|
11768
|
-
function
|
|
12104
|
+
function Yg(e, t, n, r, i = [], a = []) {
|
|
11769
12105
|
let o = [], s = t;
|
|
11770
12106
|
for (let c of e) {
|
|
11771
|
-
let e =
|
|
12107
|
+
let e = rg(c.line.text), l = Vg(i, c, e), u = Eg(c);
|
|
11772
12108
|
if (!u) continue;
|
|
11773
|
-
let d =
|
|
11774
|
-
if (
|
|
12109
|
+
let d = qg(r, i_(u, r !== void 0)), f = hg(e), p = wg(t, f);
|
|
12110
|
+
if (ug(u) === null) {
|
|
11775
12111
|
if (c.children.length > 0) {
|
|
11776
|
-
let e = p ?? t, r =
|
|
12112
|
+
let e = p ?? t, r = Yg(c.children, e, n, d, l, a);
|
|
11777
12113
|
r.length > 0 && (o.push(...r), s = r[r.length - 1]?.reference ?? s);
|
|
11778
12114
|
continue;
|
|
11779
12115
|
}
|
|
11780
12116
|
s = p ?? s;
|
|
11781
12117
|
continue;
|
|
11782
12118
|
}
|
|
11783
|
-
let m =
|
|
12119
|
+
let m = fg(u), h = wg(t, pg(u) ?? m ?? f) ?? m ?? p;
|
|
11784
12120
|
if (!h) {
|
|
11785
12121
|
if (c.children.length > 0) {
|
|
11786
|
-
let e =
|
|
12122
|
+
let e = Yg(c.children, p ?? t, n, d, l, a);
|
|
11787
12123
|
o.push(...e);
|
|
11788
12124
|
}
|
|
11789
12125
|
continue;
|
|
11790
12126
|
}
|
|
11791
|
-
h =
|
|
11792
|
-
let g =
|
|
12127
|
+
h = xg(h, Sg(h) ? s ?? t : t);
|
|
12128
|
+
let g = b_({
|
|
11793
12129
|
action: { action: "modifier" },
|
|
11794
12130
|
reference: h,
|
|
11795
12131
|
sourcePosition: {
|
|
11796
12132
|
start: c.line.start,
|
|
11797
|
-
stop:
|
|
12133
|
+
stop: Dg(c)
|
|
11798
12134
|
},
|
|
11799
12135
|
sourceText: u,
|
|
11800
12136
|
fullText: n,
|
|
@@ -11802,7 +12138,7 @@ function Ag(e, t, n, r, i = [], a = []) {
|
|
|
11802
12138
|
});
|
|
11803
12139
|
if (!g) {
|
|
11804
12140
|
if (s = h, c.children.length > 0) {
|
|
11805
|
-
let e =
|
|
12141
|
+
let e = Yg(c.children, p ?? h, n, d, l, a);
|
|
11806
12142
|
o.push(...e), s = e[e.length - 1]?.reference ?? s;
|
|
11807
12143
|
}
|
|
11808
12144
|
continue;
|
|
@@ -11818,19 +12154,19 @@ function Ag(e, t, n, r, i = [], a = []) {
|
|
|
11818
12154
|
sourcePath: l
|
|
11819
12155
|
});
|
|
11820
12156
|
if (s = h, c.children.length > 0) {
|
|
11821
|
-
let e =
|
|
12157
|
+
let e = Yg(c.children, p ?? h, n, d, l, a);
|
|
11822
12158
|
e.length > 0 && (o.push(...e), s = e[e.length - 1]?.reference ?? s);
|
|
11823
12159
|
}
|
|
11824
12160
|
}
|
|
11825
|
-
return
|
|
12161
|
+
return y_(o);
|
|
11826
12162
|
}
|
|
11827
|
-
function
|
|
11828
|
-
let t =
|
|
12163
|
+
function Xg(e) {
|
|
12164
|
+
let t = ig(e), n = t.findIndex((e) => ag(e.text));
|
|
11829
12165
|
if (n === -1) return null;
|
|
11830
|
-
let r = t.slice(0, n).reverse().map((e) =>
|
|
11831
|
-
return
|
|
12166
|
+
let r = t.slice(0, n).reverse().map((e) => hg(e.text)).find((e) => e !== null) ?? null, i = Cg(t.slice(n)), a = [], o = Yg(i, r, e, void 0, [], a);
|
|
12167
|
+
return Kg(o, a, Hg(i)), o.length > 0 ? o : null;
|
|
11832
12168
|
}
|
|
11833
|
-
function
|
|
12169
|
+
function Zg(e, t) {
|
|
11834
12170
|
let n = e.indexOf("«");
|
|
11835
12171
|
if (n === -1) return;
|
|
11836
12172
|
let r = e.indexOf("»", n + 1);
|
|
@@ -11845,36 +12181,40 @@ function Mg(e, t) {
|
|
|
11845
12181
|
}
|
|
11846
12182
|
};
|
|
11847
12183
|
}
|
|
11848
|
-
function
|
|
11849
|
-
let t =
|
|
12184
|
+
function Qg(e) {
|
|
12185
|
+
let t = qm(e);
|
|
11850
12186
|
return /\btableau\b/.test(t) && /\b(?:tableau|celui)\s+(?:suivant|ainsi\s+redigee?|ainsi\s+rediges|ainsi\s+redigees)\b/.test(t);
|
|
11851
12187
|
}
|
|
11852
|
-
function
|
|
11853
|
-
for (let t of
|
|
11854
|
-
if (!
|
|
12188
|
+
function $g(e) {
|
|
12189
|
+
for (let t of ig(e)) {
|
|
12190
|
+
if (!Qg(t.text)) continue;
|
|
11855
12191
|
let e = t.text.indexOf(":");
|
|
11856
12192
|
return e === -1 ? t.end : t.start + e + 1;
|
|
11857
12193
|
}
|
|
11858
12194
|
return null;
|
|
11859
12195
|
}
|
|
11860
|
-
function
|
|
11861
|
-
let n =
|
|
11862
|
-
return n === null ?
|
|
12196
|
+
function e_(e, t) {
|
|
12197
|
+
let n = $g(e);
|
|
12198
|
+
return n === null ? Zg(e, t) : Zg(e.slice(n), t + n);
|
|
11863
12199
|
}
|
|
11864
|
-
function
|
|
11865
|
-
return
|
|
12200
|
+
function t_(e, t) {
|
|
12201
|
+
return qh(e, t);
|
|
12202
|
+
}
|
|
12203
|
+
function n_(e, t) {
|
|
12204
|
+
let n = gm(e, t);
|
|
12205
|
+
return n && n > 1 ? n : void 0;
|
|
11866
12206
|
}
|
|
11867
|
-
function
|
|
12207
|
+
function r_(e, t) {
|
|
11868
12208
|
if (!Array.isArray(e) || e.length < 2 || t.length < e.length) return e;
|
|
11869
12209
|
let n = e[0];
|
|
11870
12210
|
return e.some((e) => JSON.stringify(e) !== JSON.stringify(n)) ? e : n;
|
|
11871
12211
|
}
|
|
11872
|
-
function
|
|
11873
|
-
let n =
|
|
12212
|
+
function i_(e, t = !1) {
|
|
12213
|
+
let n = bh(e, yh(e)), r = qm(n), i = /\btableau\b/.test(r);
|
|
11874
12214
|
if (!i && !t) return;
|
|
11875
12215
|
let a = (e) => {
|
|
11876
12216
|
if (!e) return;
|
|
11877
|
-
let t = e.replace(/^(?:a|à)\s+la\s+/iu, "").trim(), n =
|
|
12217
|
+
let t = e.replace(/^(?:a|à)\s+la\s+/iu, "").trim(), n = qm(t);
|
|
11878
12218
|
if (/^derni(?:er|ere)s?\b/u.test(n)) return -1;
|
|
11879
12219
|
let r = be(t);
|
|
11880
12220
|
return r && r > 0 ? r : void 0;
|
|
@@ -11895,30 +12235,30 @@ function Rg(e, t = !1) {
|
|
|
11895
12235
|
let l = /\bla\s+(.+?)\s+ligne\b/iu.exec(n), u = /\bla\s+(.+?)\s+colonne\b/iu.exec(n);
|
|
11896
12236
|
return o(a(l?.[1]), a(u?.[1])) || (i ? { type: "table" } : void 0);
|
|
11897
12237
|
}
|
|
11898
|
-
function
|
|
12238
|
+
function a_(e) {
|
|
11899
12239
|
return e.replace(/(?:[,;:]\s*)?(?:(?:le|la|les|l['’])\s+)?(?:année|date|dispositions?|mention|montant|mot|mots|nombre|nombres|pourcentage|référence|références|signe|taux|texte|phrase|phrases|tableau)(?:\s+[^,;:]*)?\s*:?\s*$/iu, "").trimEnd();
|
|
11900
12240
|
}
|
|
11901
|
-
function
|
|
12241
|
+
function o_(e) {
|
|
11902
12242
|
return e.replace(/(?:[,;:]\s*)?(?:(?:le|la|les|l['’])\s+)?(?:année|date|dispositions?|mention|montant|mot|mots|nombre|nombres|pourcentage|référence|références|signe|taux|texte|tableau)(?:\s+[^,;:]*)?\s*:?\s*$/iu, "").trimEnd();
|
|
11903
12243
|
}
|
|
11904
|
-
var
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
12244
|
+
var s_ = [
|
|
12245
|
+
c_("(?:la\\s+date\\s+d(?:u|e|[’']))"),
|
|
12246
|
+
c_("(?:le\\s+montant\\s+d(?:e|[’']))"),
|
|
12247
|
+
c_("(?:la\\s+référence\\s+à)")
|
|
11908
12248
|
];
|
|
11909
|
-
function
|
|
12249
|
+
function c_(e) {
|
|
11910
12250
|
return new RegExp(String.raw`(?:^|[,;:]\s*)${e}\s+(?<target>.+?)\s+(?:est|sont)\s+remplac[eé]e?s?\s+par\s+${e}\s+(?<replacement>.+?)(?=\s*(?:[.;]|$))`, "iu");
|
|
11911
12251
|
}
|
|
11912
|
-
function
|
|
12252
|
+
function l_(e) {
|
|
11913
12253
|
return e.replace(/\s+/gu, " ").replace(/\s+([,;])/gu, "$1").trim();
|
|
11914
12254
|
}
|
|
11915
|
-
function
|
|
12255
|
+
function u_(e) {
|
|
11916
12256
|
if (e.includes("«") || e.includes("»")) return null;
|
|
11917
|
-
for (let t of
|
|
12257
|
+
for (let t of s_) {
|
|
11918
12258
|
let n = t.exec(e), r = n?.groups?.target, i = n?.groups?.replacement;
|
|
11919
12259
|
if (!(!r || !i)) return {
|
|
11920
|
-
targetText:
|
|
11921
|
-
replacementText:
|
|
12260
|
+
targetText: l_(r),
|
|
12261
|
+
replacementText: l_(i),
|
|
11922
12262
|
operandRange: {
|
|
11923
12263
|
start: n.index,
|
|
11924
12264
|
end: n.index + n[0].length
|
|
@@ -11927,19 +12267,22 @@ function Wg(e) {
|
|
|
11927
12267
|
}
|
|
11928
12268
|
return null;
|
|
11929
12269
|
}
|
|
11930
|
-
function
|
|
11931
|
-
let t =
|
|
12270
|
+
function d_(e) {
|
|
12271
|
+
let t = u_(e);
|
|
11932
12272
|
return t ? [t.operandRange] : [];
|
|
11933
12273
|
}
|
|
11934
|
-
function
|
|
11935
|
-
return
|
|
12274
|
+
function f_(e, t) {
|
|
12275
|
+
return Sh(e.position, t) ? !0 : Array.from(O(dg(e))).some((e) => Sh(e.position, t));
|
|
11936
12276
|
}
|
|
11937
|
-
function
|
|
11938
|
-
let
|
|
11939
|
-
let
|
|
11940
|
-
|
|
12277
|
+
function p_(e, t, n, r, i, a) {
|
|
12278
|
+
let o = qm(e), s = qm(bh(e, i)), c = Jm(s, o), l = Ym(s), u = Xm(s), d = n.action === "rétablir" || Zm(s), f = Qm(s) || d, p = $m(s), m = eh(s), h = Qg(e), g = u ? "insert_before" : "insert_after", _ = l ? Gh(s) : null, v = p ? _ : null, y = m ? _ : null, ee = () => {
|
|
12279
|
+
let n = i[0]?.start;
|
|
12280
|
+
return (n === void 0 ? void 0 : n_(t, n)) ?? hm(e) ?? void 0;
|
|
12281
|
+
}, te = ({ kind: e, targetText: t, insertText: n, expectsFollowingTable: r }) => {
|
|
12282
|
+
let i = eg({
|
|
12283
|
+
hasRedactionIntro: c,
|
|
11941
12284
|
insertText: n,
|
|
11942
|
-
normalized:
|
|
12285
|
+
normalized: o
|
|
11943
12286
|
});
|
|
11944
12287
|
return {
|
|
11945
12288
|
kind: e,
|
|
@@ -11949,131 +12292,140 @@ function qg(e, t, n, r, i) {
|
|
|
11949
12292
|
...r ? { expectsFollowingTable: r } : {}
|
|
11950
12293
|
};
|
|
11951
12294
|
};
|
|
11952
|
-
if ((
|
|
11953
|
-
let e =
|
|
12295
|
+
if ((l || u) && f && m && a.length >= 3) {
|
|
12296
|
+
let e = a.slice(0, -2), t = a.at(-2), n = a.at(-1);
|
|
11954
12297
|
if (e.length > 0 && t && n) return [{
|
|
11955
12298
|
kind: "delete",
|
|
11956
12299
|
targetText: e[0],
|
|
11957
12300
|
extraTargetTexts: e.slice(1)
|
|
11958
|
-
},
|
|
11959
|
-
kind:
|
|
12301
|
+
}, te({
|
|
12302
|
+
kind: g,
|
|
11960
12303
|
targetText: t,
|
|
11961
12304
|
insertText: n,
|
|
11962
|
-
expectsFollowingTable:
|
|
12305
|
+
expectsFollowingTable: h
|
|
11963
12306
|
})];
|
|
11964
12307
|
}
|
|
11965
|
-
if (!
|
|
11966
|
-
let e =
|
|
12308
|
+
if (!l && !u && f && m && a.length >= 2 && /\best ajoutee?\s+une phrase\b|\bune phrase ainsi redigee\b/.test(o)) {
|
|
12309
|
+
let e = a.slice(0, -1), t = a.at(-1);
|
|
11967
12310
|
if (e.length > 0 && t) return [{
|
|
11968
12311
|
kind: "delete",
|
|
11969
12312
|
targetText: e[0],
|
|
11970
12313
|
extraTargetTexts: e.slice(1)
|
|
11971
|
-
},
|
|
12314
|
+
}, te({
|
|
11972
12315
|
kind: "insert_after",
|
|
11973
12316
|
targetText: "",
|
|
11974
12317
|
insertText: t,
|
|
11975
|
-
expectsFollowingTable:
|
|
12318
|
+
expectsFollowingTable: h
|
|
11976
12319
|
})];
|
|
11977
12320
|
}
|
|
11978
|
-
if ((
|
|
11979
|
-
let e =
|
|
12321
|
+
if ((l || u) && f && p && a.length >= 4) {
|
|
12322
|
+
let e = a.at(-2), t = a.at(-1);
|
|
11980
12323
|
if (e && t) return [{
|
|
11981
12324
|
kind: "replace",
|
|
11982
|
-
targetText:
|
|
11983
|
-
replacementText:
|
|
11984
|
-
},
|
|
11985
|
-
kind:
|
|
12325
|
+
targetText: a[0],
|
|
12326
|
+
replacementText: a[1]
|
|
12327
|
+
}, te({
|
|
12328
|
+
kind: g,
|
|
11986
12329
|
targetText: e,
|
|
11987
12330
|
insertText: t,
|
|
11988
|
-
expectsFollowingTable:
|
|
12331
|
+
expectsFollowingTable: h
|
|
11989
12332
|
})];
|
|
11990
12333
|
}
|
|
11991
|
-
if (
|
|
11992
|
-
let e =
|
|
12334
|
+
if (p && m && !f && a.length >= 3) {
|
|
12335
|
+
let e = o.search(/\bremplace(?:e|es|s)?\b/u), t = o.search(/\bsupprime(?:e|es|s)?\b/u);
|
|
11993
12336
|
if (e !== -1 && t !== -1 && e < t) return [{
|
|
11994
12337
|
kind: "replace",
|
|
11995
|
-
targetText:
|
|
11996
|
-
replacementText:
|
|
11997
|
-
...
|
|
12338
|
+
targetText: a[0],
|
|
12339
|
+
replacementText: a[1],
|
|
12340
|
+
...v ? { targetScope: v } : {}
|
|
11998
12341
|
}, {
|
|
11999
12342
|
kind: "delete",
|
|
12000
|
-
targetText:
|
|
12001
|
-
extraTargetTexts:
|
|
12002
|
-
...
|
|
12343
|
+
targetText: a[2],
|
|
12344
|
+
extraTargetTexts: a.slice(3),
|
|
12345
|
+
...y ? { targetScope: y } : {}
|
|
12003
12346
|
}];
|
|
12004
|
-
if (e !== -1 && t !== -1 && t < e &&
|
|
12347
|
+
if (e !== -1 && t !== -1 && t < e && a.length >= 4) return [{
|
|
12005
12348
|
kind: "delete",
|
|
12006
|
-
targetText:
|
|
12007
|
-
extraTargetTexts:
|
|
12008
|
-
...
|
|
12349
|
+
targetText: a[0],
|
|
12350
|
+
extraTargetTexts: a.slice(1, -2),
|
|
12351
|
+
...y ? { targetScope: y } : {}
|
|
12009
12352
|
}, {
|
|
12010
12353
|
kind: "replace",
|
|
12011
|
-
targetText:
|
|
12012
|
-
replacementText:
|
|
12013
|
-
...
|
|
12354
|
+
targetText: a.at(-2) ?? "",
|
|
12355
|
+
replacementText: a.at(-1) ?? "",
|
|
12356
|
+
...v ? { targetScope: v } : {}
|
|
12014
12357
|
}];
|
|
12015
12358
|
}
|
|
12016
|
-
let
|
|
12017
|
-
if (
|
|
12359
|
+
let ne = s.match(/\bremplace(?:e|es|s)?\b/gu)?.length ?? 0;
|
|
12360
|
+
if (p && !f && a.length >= 4 && a.length % 2 == 0 && ne >= 2) {
|
|
12018
12361
|
let e = [];
|
|
12019
|
-
for (let t = 0; t <
|
|
12362
|
+
for (let t = 0; t < a.length; t += 2) e.push({
|
|
12020
12363
|
kind: "replace",
|
|
12021
|
-
targetText:
|
|
12022
|
-
replacementText:
|
|
12023
|
-
...
|
|
12364
|
+
targetText: a[t],
|
|
12365
|
+
replacementText: a[t + 1],
|
|
12366
|
+
...v ? { targetScope: v } : {}
|
|
12024
12367
|
});
|
|
12025
12368
|
return e;
|
|
12026
12369
|
}
|
|
12027
|
-
if (
|
|
12028
|
-
kind: "
|
|
12029
|
-
|
|
12030
|
-
|
|
12031
|
-
|
|
12032
|
-
|
|
12033
|
-
|
|
12370
|
+
if (n.action === "supprimer" || m) {
|
|
12371
|
+
if (r === "article" && a.length === 0) return { kind: "delete_article" };
|
|
12372
|
+
if (a.length >= 1) {
|
|
12373
|
+
let e = a.length === 1 ? ee() : void 0;
|
|
12374
|
+
return {
|
|
12375
|
+
kind: "delete",
|
|
12376
|
+
targetText: a[0],
|
|
12377
|
+
extraTargetTexts: a.slice(1),
|
|
12378
|
+
...e ? { targetOccurrenceCount: e } : {},
|
|
12379
|
+
...y ? { targetScope: y } : {}
|
|
12380
|
+
};
|
|
12381
|
+
}
|
|
12382
|
+
return { kind: "delete_portion" };
|
|
12383
|
+
}
|
|
12384
|
+
if (p && /\bpar\s+(?:le|un)\s+tableau\s+(?:suivant|ainsi\s+redigee?|ainsi\s+rediges|ainsi\s+redigees)\b/.test(o)) return {
|
|
12034
12385
|
kind: "replace_portion",
|
|
12035
12386
|
replacement: { type: "following_table" }
|
|
12036
12387
|
};
|
|
12037
|
-
if (
|
|
12038
|
-
let t =
|
|
12388
|
+
if (p && !f && !m && a.length === 0) {
|
|
12389
|
+
let t = u_(e);
|
|
12039
12390
|
if (t) return {
|
|
12040
12391
|
kind: "replace",
|
|
12041
12392
|
targetText: t.targetText,
|
|
12042
12393
|
replacementText: t.replacementText,
|
|
12043
|
-
...
|
|
12394
|
+
...v ? { targetScope: v } : {}
|
|
12044
12395
|
};
|
|
12045
12396
|
}
|
|
12046
|
-
if (
|
|
12047
|
-
let
|
|
12397
|
+
if (p && a.length >= 2) {
|
|
12398
|
+
let e = ee();
|
|
12399
|
+
return {
|
|
12048
12400
|
kind: "replace",
|
|
12049
|
-
targetText:
|
|
12050
|
-
replacementText:
|
|
12051
|
-
...
|
|
12401
|
+
targetText: a[0],
|
|
12402
|
+
replacementText: a[1],
|
|
12403
|
+
...e ? { targetOccurrenceCount: e } : {},
|
|
12404
|
+
...v ? { targetScope: v } : {}
|
|
12052
12405
|
};
|
|
12053
|
-
return t && t > 1 ? Array.from({ length: t }, () => n) : n;
|
|
12054
12406
|
}
|
|
12055
|
-
if (
|
|
12407
|
+
if (l && c && a.length >= 2 && _) return {
|
|
12056
12408
|
kind: "replace",
|
|
12057
|
-
targetText:
|
|
12058
|
-
replacementText:
|
|
12059
|
-
targetScope:
|
|
12409
|
+
targetText: a[0],
|
|
12410
|
+
replacementText: a[1],
|
|
12411
|
+
targetScope: _
|
|
12060
12412
|
};
|
|
12061
|
-
if (!
|
|
12062
|
-
let e =
|
|
12063
|
-
hasRedactionIntro:
|
|
12064
|
-
normalized:
|
|
12065
|
-
replacementText:
|
|
12413
|
+
if (!f && a.length === 1 && c) {
|
|
12414
|
+
let e = tg({
|
|
12415
|
+
hasRedactionIntro: c,
|
|
12416
|
+
normalized: o,
|
|
12417
|
+
replacementText: a[0]
|
|
12066
12418
|
});
|
|
12067
12419
|
return {
|
|
12068
12420
|
kind: "replace_portion",
|
|
12069
12421
|
replacement: {
|
|
12070
12422
|
type: "text",
|
|
12071
|
-
text:
|
|
12423
|
+
text: a[0]
|
|
12072
12424
|
},
|
|
12073
12425
|
...e ? { replacementLayout: e } : {}
|
|
12074
12426
|
};
|
|
12075
12427
|
}
|
|
12076
|
-
if (
|
|
12428
|
+
if (f && h) return te(u ? {
|
|
12077
12429
|
kind: "insert_before",
|
|
12078
12430
|
targetText: "",
|
|
12079
12431
|
insertText: "",
|
|
@@ -12084,42 +12436,42 @@ function qg(e, t, n, r, i) {
|
|
|
12084
12436
|
insertText: "",
|
|
12085
12437
|
expectsFollowingTable: !0
|
|
12086
12438
|
});
|
|
12087
|
-
if (
|
|
12088
|
-
if (
|
|
12439
|
+
if (f && a.length >= 2) {
|
|
12440
|
+
if (l) return te({
|
|
12089
12441
|
kind: "insert_after",
|
|
12090
|
-
targetText:
|
|
12091
|
-
insertText:
|
|
12092
|
-
expectsFollowingTable:
|
|
12442
|
+
targetText: a[0],
|
|
12443
|
+
insertText: a[1],
|
|
12444
|
+
expectsFollowingTable: h
|
|
12093
12445
|
});
|
|
12094
|
-
if (
|
|
12446
|
+
if (u) return te({
|
|
12095
12447
|
kind: "insert_before",
|
|
12096
|
-
targetText:
|
|
12097
|
-
insertText:
|
|
12098
|
-
expectsFollowingTable:
|
|
12448
|
+
targetText: a[0],
|
|
12449
|
+
insertText: a[1],
|
|
12450
|
+
expectsFollowingTable: h
|
|
12099
12451
|
});
|
|
12100
12452
|
}
|
|
12101
|
-
return
|
|
12453
|
+
return f && a.length === 1 ? te(l ? {
|
|
12102
12454
|
kind: "insert_after",
|
|
12103
12455
|
targetText: "",
|
|
12104
|
-
insertText:
|
|
12105
|
-
expectsFollowingTable:
|
|
12106
|
-
} :
|
|
12456
|
+
insertText: a[0],
|
|
12457
|
+
expectsFollowingTable: h
|
|
12458
|
+
} : u ? {
|
|
12107
12459
|
kind: "insert_before",
|
|
12108
12460
|
targetText: "",
|
|
12109
|
-
insertText:
|
|
12110
|
-
expectsFollowingTable:
|
|
12461
|
+
insertText: a[0],
|
|
12462
|
+
expectsFollowingTable: h
|
|
12111
12463
|
} : {
|
|
12112
12464
|
kind: "insert_after",
|
|
12113
12465
|
targetText: "",
|
|
12114
|
-
insertText:
|
|
12115
|
-
expectsFollowingTable:
|
|
12466
|
+
insertText: a[0],
|
|
12467
|
+
expectsFollowingTable: h
|
|
12116
12468
|
}) : null;
|
|
12117
12469
|
}
|
|
12118
|
-
function
|
|
12119
|
-
let t =
|
|
12470
|
+
function m_(e) {
|
|
12471
|
+
let t = qm(e);
|
|
12120
12472
|
return /\bapres\b/.test(t) && /\bla\s+fin\s+(?:(?:de\s+l['’]?)|d['’]?|de|du|des)?\s*$/u.test(t);
|
|
12121
12473
|
}
|
|
12122
|
-
function
|
|
12474
|
+
function h_(e) {
|
|
12123
12475
|
switch (e.kind) {
|
|
12124
12476
|
case "insert_after":
|
|
12125
12477
|
case "insert_before": return {
|
|
@@ -12135,6 +12487,7 @@ function Yg(e) {
|
|
|
12135
12487
|
targetText: e.targetText,
|
|
12136
12488
|
replacementText: e.replacementText,
|
|
12137
12489
|
replacement: e.replacement,
|
|
12490
|
+
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12138
12491
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12139
12492
|
...e.tableTarget ? { tableTarget: e.tableTarget } : {}
|
|
12140
12493
|
};
|
|
@@ -12151,6 +12504,7 @@ function Yg(e) {
|
|
|
12151
12504
|
targetText: e.targetText,
|
|
12152
12505
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12153
12506
|
...e.occurrenceIndex === void 0 ? {} : { occurrenceIndex: e.occurrenceIndex },
|
|
12507
|
+
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12154
12508
|
...e.tableTarget ? { tableTarget: e.tableTarget } : {}
|
|
12155
12509
|
};
|
|
12156
12510
|
case "delete_portion": return {
|
|
@@ -12160,11 +12514,11 @@ function Yg(e) {
|
|
|
12160
12514
|
case "delete_article": return { kind: "delete_article" };
|
|
12161
12515
|
}
|
|
12162
12516
|
}
|
|
12163
|
-
function
|
|
12517
|
+
function g_(e) {
|
|
12164
12518
|
let t = (t) => {
|
|
12165
12519
|
let n = e[t];
|
|
12166
12520
|
return typeof n == "string" ? n : "";
|
|
12167
|
-
}, n = "targetScope" in e && e.targetScope ? e.targetScope.type : "", r = "occurrenceIndex" in e && e.occurrenceIndex !== void 0 ? String(e.occurrenceIndex) : "", i = "insertLayout" in e && e.insertLayout ? e.insertLayout : "",
|
|
12521
|
+
}, n = "targetScope" in e && e.targetScope ? e.targetScope.type : "", r = "occurrenceIndex" in e && e.occurrenceIndex !== void 0 ? String(e.occurrenceIndex) : "", i = "targetOccurrenceCount" in e && e.targetOccurrenceCount !== void 0 ? String(e.targetOccurrenceCount) : "", a = "insertLayout" in e && e.insertLayout ? e.insertLayout : "", o = "replacementLayout" in e && e.replacementLayout ? e.replacementLayout : "";
|
|
12168
12522
|
return [
|
|
12169
12523
|
e.kind,
|
|
12170
12524
|
t("targetText"),
|
|
@@ -12173,10 +12527,11 @@ function Xg(e) {
|
|
|
12173
12527
|
n,
|
|
12174
12528
|
r,
|
|
12175
12529
|
i,
|
|
12176
|
-
a
|
|
12530
|
+
a,
|
|
12531
|
+
o
|
|
12177
12532
|
].join("|");
|
|
12178
12533
|
}
|
|
12179
|
-
function
|
|
12534
|
+
function __(e, t, n) {
|
|
12180
12535
|
return t.targetType === n.targetType && JSON.stringify(t.reference) === JSON.stringify(n.reference) && JSON.stringify(t.portionSelectors) === JSON.stringify(n.portionSelectors) ? e : {
|
|
12181
12536
|
...e,
|
|
12182
12537
|
targetType: t.targetType,
|
|
@@ -12184,10 +12539,10 @@ function Zg(e, t, n) {
|
|
|
12184
12539
|
portionSelectors: t.portionSelectors
|
|
12185
12540
|
};
|
|
12186
12541
|
}
|
|
12187
|
-
function
|
|
12188
|
-
return (e.kind === "compound" ? e.operations : [
|
|
12542
|
+
function v_(e, t) {
|
|
12543
|
+
return (e.kind === "compound" ? e.operations : [h_(e)]).map((n) => __(n, e, t));
|
|
12189
12544
|
}
|
|
12190
|
-
function
|
|
12545
|
+
function y_(e) {
|
|
12191
12546
|
let t = [];
|
|
12192
12547
|
for (let n = 0; n < e.length; n += 1) {
|
|
12193
12548
|
let r = e[n];
|
|
@@ -12202,14 +12557,14 @@ function $g(e) {
|
|
|
12202
12557
|
continue;
|
|
12203
12558
|
}
|
|
12204
12559
|
let o = i[0], s = [];
|
|
12205
|
-
for (let [e, t] of i.entries()) for (let [n, r] of
|
|
12560
|
+
for (let [e, t] of i.entries()) for (let [n, r] of v_(t, o).entries()) s.push({
|
|
12206
12561
|
directiveIndex: e,
|
|
12207
12562
|
operationIndex: n,
|
|
12208
12563
|
operation: r
|
|
12209
12564
|
});
|
|
12210
12565
|
let c = /* @__PURE__ */ new Set(), l = [];
|
|
12211
12566
|
for (let e = s.length - 1; e >= 0; --e) {
|
|
12212
|
-
let t = s[e], n =
|
|
12567
|
+
let t = s[e], n = g_(t.operation);
|
|
12213
12568
|
c.has(n) || (c.add(n), l.push(t));
|
|
12214
12569
|
}
|
|
12215
12570
|
l.sort((e, t) => e.directiveIndex - t.directiveIndex || e.operationIndex - t.operationIndex), t.push({
|
|
@@ -12228,14 +12583,14 @@ function $g(e) {
|
|
|
12228
12583
|
}
|
|
12229
12584
|
return t;
|
|
12230
12585
|
}
|
|
12231
|
-
function
|
|
12232
|
-
let o = e.target ?? bt(t), s = Rp(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 && !
|
|
12586
|
+
function b_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullText: i, tableTarget: a }) {
|
|
12587
|
+
let o = e.target ?? bt(t), s = Rp(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 && !m_(r.slice(0, n.start)) ? r.slice(n.start) : r, d = yh(u), f = p_(r, u, e, o, d, d.map((e) => e.text));
|
|
12233
12588
|
if (!f) return null;
|
|
12234
|
-
let p =
|
|
12589
|
+
let p = r_(f, s), m = Pg(r), h = {
|
|
12235
12590
|
...m ? { applicabilityDate: m } : {},
|
|
12236
12591
|
sourcePosition: n,
|
|
12237
12592
|
sourceText: r
|
|
12238
|
-
}, g =
|
|
12593
|
+
}, g = e_(c, l), _ = (e) => {
|
|
12239
12594
|
switch (e.kind) {
|
|
12240
12595
|
case "insert_after":
|
|
12241
12596
|
case "insert_before": return {
|
|
@@ -12251,6 +12606,7 @@ function e_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12251
12606
|
targetText: e.targetText,
|
|
12252
12607
|
replacementText: e.replacementText,
|
|
12253
12608
|
replacement: e.replacement,
|
|
12609
|
+
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12254
12610
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12255
12611
|
...e.tableTarget ? { tableTarget: e.tableTarget } : {}
|
|
12256
12612
|
};
|
|
@@ -12267,6 +12623,7 @@ function e_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12267
12623
|
targetText: e.targetText,
|
|
12268
12624
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12269
12625
|
...e.occurrenceIndex === void 0 ? {} : { occurrenceIndex: e.occurrenceIndex },
|
|
12626
|
+
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12270
12627
|
...e.tableTarget ? { tableTarget: e.tableTarget } : {}
|
|
12271
12628
|
};
|
|
12272
12629
|
case "delete_portion": return {
|
|
@@ -12294,7 +12651,7 @@ function e_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12294
12651
|
insertText: e.insertText,
|
|
12295
12652
|
...e.insertLayout ? { insertLayout: e.insertLayout } : {},
|
|
12296
12653
|
...e.expectsFollowingTable && g ? { citation: g } : {},
|
|
12297
|
-
...
|
|
12654
|
+
...Jg(a) ? { tableTarget: a } : {},
|
|
12298
12655
|
...h
|
|
12299
12656
|
};
|
|
12300
12657
|
case "replace": return {
|
|
@@ -12308,8 +12665,9 @@ function e_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12308
12665
|
type: "text",
|
|
12309
12666
|
text: e.replacementText
|
|
12310
12667
|
},
|
|
12668
|
+
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12311
12669
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12312
|
-
...
|
|
12670
|
+
...Jg(a) ? { tableTarget: a } : {},
|
|
12313
12671
|
...h
|
|
12314
12672
|
};
|
|
12315
12673
|
case "replace_portion": return e.replacement.type === "following_table" && !g ? null : {
|
|
@@ -12321,11 +12679,11 @@ function e_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12321
12679
|
replacement: e.replacement,
|
|
12322
12680
|
...e.replacementLayout ? { replacementLayout: e.replacementLayout } : {},
|
|
12323
12681
|
...e.replacement.type === "following_table" && g ? { citation: g } : {},
|
|
12324
|
-
...
|
|
12682
|
+
...Jg(a) ? { tableTarget: a } : {},
|
|
12325
12683
|
...h
|
|
12326
12684
|
};
|
|
12327
12685
|
case "delete": {
|
|
12328
|
-
let n = d.map((e) =>
|
|
12686
|
+
let n = d.map((e) => t_(u, e.start)), r = /* @__PURE__ */ new Map();
|
|
12329
12687
|
for (let [e, t] of d.entries()) r.has(t.text) || r.set(t.text, n[e] ?? null);
|
|
12330
12688
|
let i = [e.targetText, ...e.extraTargetTexts ?? []].filter((e) => e && e.trim().length > 0).filter((e, t, n) => n.indexOf(e) === t);
|
|
12331
12689
|
return i.length > 1 ? v(i.map((t) => ({
|
|
@@ -12333,7 +12691,8 @@ function e_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12333
12691
|
targetText: t,
|
|
12334
12692
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12335
12693
|
occurrenceIndex: r.get(t) ?? void 0,
|
|
12336
|
-
...
|
|
12694
|
+
...t === e.targetText && e.targetOccurrenceCount !== void 0 ? { targetOccurrenceCount: e.targetOccurrenceCount } : {},
|
|
12695
|
+
...Jg(a) ? { tableTarget: a } : {}
|
|
12337
12696
|
}))) : {
|
|
12338
12697
|
kind: "delete",
|
|
12339
12698
|
targetType: o,
|
|
@@ -12342,7 +12701,8 @@ function e_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12342
12701
|
targetText: e.targetText,
|
|
12343
12702
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12344
12703
|
occurrenceIndex: r.get(e.targetText) ?? void 0,
|
|
12345
|
-
...
|
|
12704
|
+
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12705
|
+
...Jg(a) ? { tableTarget: a } : {},
|
|
12346
12706
|
...h
|
|
12347
12707
|
};
|
|
12348
12708
|
}
|
|
@@ -12351,7 +12711,7 @@ function e_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12351
12711
|
targetType: o,
|
|
12352
12712
|
reference: t,
|
|
12353
12713
|
portionSelectors: s,
|
|
12354
|
-
...
|
|
12714
|
+
...Jg(a) ? { tableTarget: a } : {},
|
|
12355
12715
|
...h
|
|
12356
12716
|
};
|
|
12357
12717
|
case "delete_article": return o === "article" ? {
|
|
@@ -12375,7 +12735,7 @@ function e_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12375
12735
|
}
|
|
12376
12736
|
return y(p);
|
|
12377
12737
|
}
|
|
12378
|
-
function
|
|
12738
|
+
function x_(e) {
|
|
12379
12739
|
let t = /\barticle\s+([0-9]+(?:-[0-9]+)?(?:\s*[A-Z])?(?:\s+[a-z]+)?)\b/i.exec(e);
|
|
12380
12740
|
if (!t || t.index === void 0) return null;
|
|
12381
12741
|
let n = t.index, r = t.index + t[0].length;
|
|
@@ -12394,57 +12754,57 @@ function t_(e) {
|
|
|
12394
12754
|
}
|
|
12395
12755
|
};
|
|
12396
12756
|
}
|
|
12397
|
-
function
|
|
12757
|
+
function S_(e, t) {
|
|
12398
12758
|
let i = r(e).output;
|
|
12399
12759
|
if (t.allowListExtraction) {
|
|
12400
|
-
let e =
|
|
12760
|
+
let e = Xg(i);
|
|
12401
12761
|
if (e) return e;
|
|
12402
12762
|
}
|
|
12403
|
-
let a =
|
|
12404
|
-
if (l.length > 0 && (c = c.filter((e) => !
|
|
12405
|
-
let e =
|
|
12763
|
+
let a = xh(i), o = d_(i), s = wh(i), c = Rm(new n(i)), l = [...a, ...o];
|
|
12764
|
+
if (l.length > 0 && (c = c.filter((e) => !f_(e, l))), c.length === 0 && (c = Rm(new n(s.split(",")[0] ?? s))), c.length === 0) {
|
|
12765
|
+
let e = x_(s);
|
|
12406
12766
|
e && (c = [{
|
|
12407
12767
|
...e.reference,
|
|
12408
12768
|
position: e.position
|
|
12409
12769
|
}]);
|
|
12410
12770
|
}
|
|
12411
|
-
let u =
|
|
12771
|
+
let u = ug(s);
|
|
12412
12772
|
if (c.length === 1 && c[0]?.type === "article") {
|
|
12413
|
-
let e =
|
|
12773
|
+
let e = gh(s, { actionIndex: u ?? s.length });
|
|
12414
12774
|
e && (c = [e]);
|
|
12415
12775
|
}
|
|
12416
12776
|
if (u !== null) {
|
|
12417
|
-
let e = c.some((e) => bt(
|
|
12777
|
+
let e = c.some((e) => bt(dg(e)) === "article"), t = c.some((e) => [...O(dg(e))].some((e) => e.type === "article")), n = s.slice(0, u), r = dh(a_(n), 0) ?? dh(n, 0), i = c.map(dg).sort((e, t) => fh(t) - fh(e) || ph(t) - ph(e))[0], a = mh(i ?? null, r);
|
|
12418
12778
|
if (!e && a && a === r && (c = [r]), !t) {
|
|
12419
12779
|
let e = i, t = n.indexOf(":");
|
|
12420
12780
|
if (t !== -1) {
|
|
12421
|
-
let r = t + 1, i =
|
|
12422
|
-
e && i &&
|
|
12781
|
+
let r = t + 1, i = dh(o_(n.slice(r)), r), a = i ? Rp(i) : [];
|
|
12782
|
+
e && i && fh(e) > 0 && (a.length > 1 || a.some((e) => e.kind === "range")) && (c = [Tg(e, i)]);
|
|
12423
12783
|
}
|
|
12424
12784
|
}
|
|
12425
12785
|
if (t) {
|
|
12426
|
-
let e = c.map(
|
|
12427
|
-
t !== -1 && e && i &&
|
|
12786
|
+
let e = c.map(dg).filter((e) => [...O(e)].some((e) => e.type === "article")).sort((e, t) => fh(t) - fh(e) || ph(t) - ph(e))[0], t = n.indexOf(":"), r = t === -1 ? 0 : t + 1, i = dh(o_(n.slice(r)), r), a = i ? Rp(i) : [];
|
|
12787
|
+
t !== -1 && e && i && fh(e) > 0 && (a.length > 1 || a.some((e) => e.kind === "range")) && c.push(Tg(e, i));
|
|
12428
12788
|
}
|
|
12429
12789
|
}
|
|
12430
12790
|
let d = [];
|
|
12431
12791
|
for (let e of c) {
|
|
12432
12792
|
if (e.type === "reference_et_action") {
|
|
12433
|
-
let t = e.position?.start ?? 0, n = i.lastIndexOf("\n", Math.max(0, t - 1)) + 1, r =
|
|
12793
|
+
let t = e.position?.start ?? 0, n = i.lastIndexOf("\n", Math.max(0, t - 1)) + 1, r = m_(i.slice(n, t)) ? n : t, a = {
|
|
12434
12794
|
start: r,
|
|
12435
12795
|
stop: i.length
|
|
12436
|
-
}, o = i.slice(r), s =
|
|
12796
|
+
}, o = i.slice(r), s = b_({
|
|
12437
12797
|
action: e.action,
|
|
12438
12798
|
reference: e.reference,
|
|
12439
12799
|
sourcePosition: a,
|
|
12440
12800
|
sourceText: o,
|
|
12441
12801
|
fullText: i,
|
|
12442
|
-
tableTarget:
|
|
12802
|
+
tableTarget: i_(o) ?? i_(i)
|
|
12443
12803
|
});
|
|
12444
12804
|
s && (Array.isArray(s) ? d.push(...s) : d.push(s));
|
|
12445
12805
|
continue;
|
|
12446
12806
|
}
|
|
12447
|
-
let t =
|
|
12807
|
+
let t = b_({
|
|
12448
12808
|
action: { action: "modifier" },
|
|
12449
12809
|
reference: e,
|
|
12450
12810
|
sourcePosition: e.position ?? {
|
|
@@ -12453,73 +12813,87 @@ function n_(e, t) {
|
|
|
12453
12813
|
},
|
|
12454
12814
|
sourceText: i,
|
|
12455
12815
|
fullText: i,
|
|
12456
|
-
tableTarget:
|
|
12816
|
+
tableTarget: i_(i)
|
|
12457
12817
|
});
|
|
12458
12818
|
t && (Array.isArray(t) ? d.push(...t) : d.push(t));
|
|
12459
12819
|
}
|
|
12460
12820
|
if (d.length === 0) {
|
|
12461
|
-
let e =
|
|
12821
|
+
let e = x_(s);
|
|
12462
12822
|
if (e) {
|
|
12463
|
-
let t =
|
|
12823
|
+
let t = b_({
|
|
12464
12824
|
action: { action: "modifier" },
|
|
12465
12825
|
reference: e.reference,
|
|
12466
12826
|
sourcePosition: e.position,
|
|
12467
12827
|
sourceText: i,
|
|
12468
12828
|
fullText: i,
|
|
12469
|
-
tableTarget:
|
|
12829
|
+
tableTarget: i_(i)
|
|
12470
12830
|
});
|
|
12471
12831
|
t && (Array.isArray(t) ? d.push(...t) : d.push(t));
|
|
12472
12832
|
}
|
|
12473
12833
|
}
|
|
12474
|
-
return
|
|
12834
|
+
return y_(d);
|
|
12475
12835
|
}
|
|
12476
|
-
function
|
|
12836
|
+
function C_(e) {
|
|
12477
12837
|
let t = new n(r(e).output);
|
|
12478
|
-
return [...
|
|
12838
|
+
return [...Hh.extract(t, { overlapWindow: 100 })];
|
|
12479
12839
|
}
|
|
12480
|
-
function
|
|
12481
|
-
return
|
|
12840
|
+
function w_(e) {
|
|
12841
|
+
return S_(e, { allowListExtraction: !0 });
|
|
12482
12842
|
}
|
|
12483
|
-
var
|
|
12484
|
-
function
|
|
12485
|
-
let t =
|
|
12486
|
-
return t.includes("«") || t.includes("»") || !e.trim().endsWith(":") ? !1 :
|
|
12843
|
+
var T_ = w_;
|
|
12844
|
+
function E_(e) {
|
|
12845
|
+
let t = qm(e);
|
|
12846
|
+
return t.includes("«") || t.includes("»") || !e.trim().endsWith(":") ? !1 : th(t);
|
|
12847
|
+
}
|
|
12848
|
+
function D_(e) {
|
|
12849
|
+
return e.trimStart().startsWith("«");
|
|
12850
|
+
}
|
|
12851
|
+
function O_(e) {
|
|
12852
|
+
return /»[.;]?\s*$/u.test(e);
|
|
12853
|
+
}
|
|
12854
|
+
function k_(e, t) {
|
|
12855
|
+
for (let n = t; n < e.length; n += 1) {
|
|
12856
|
+
let t = ng(e[n]).trim();
|
|
12857
|
+
if (t.length > 0) return t;
|
|
12858
|
+
}
|
|
12487
12859
|
}
|
|
12488
|
-
function
|
|
12860
|
+
function A_(e, t) {
|
|
12489
12861
|
let n = [], r = !1, i = t + 1;
|
|
12490
12862
|
for (; i < e.length;) {
|
|
12491
|
-
let t = e[i], a =
|
|
12863
|
+
let t = e[i], a = ng(t);
|
|
12492
12864
|
if (!r && a.includes("«") && (r = !0), r) {
|
|
12493
|
-
|
|
12865
|
+
n.push(a);
|
|
12866
|
+
let t = k_(e, i + 1);
|
|
12867
|
+
if (O_(a) && (t === void 0 || !D_(t))) break;
|
|
12494
12868
|
} else if (a.trim().length > 0) break;
|
|
12495
12869
|
i += 1;
|
|
12496
12870
|
}
|
|
12497
12871
|
return !r || n.length === 0 ? null : {
|
|
12498
|
-
combinedText: [
|
|
12872
|
+
combinedText: [ng(e[t]), ...n].join("\n"),
|
|
12499
12873
|
endIndex: i
|
|
12500
12874
|
};
|
|
12501
12875
|
}
|
|
12502
|
-
function
|
|
12876
|
+
function j_(e) {
|
|
12503
12877
|
let t = a()(e).output.split("\n").map((e) => e.trim()).filter((e) => e.length > 0), n = [];
|
|
12504
12878
|
for (let e = 0; e < t.length; e += 1) {
|
|
12505
12879
|
let r = t[e];
|
|
12506
|
-
if (
|
|
12507
|
-
let r =
|
|
12880
|
+
if (E_(r)) {
|
|
12881
|
+
let r = A_(t, e);
|
|
12508
12882
|
if (r) {
|
|
12509
|
-
let t =
|
|
12883
|
+
let t = w_(r.combinedText);
|
|
12510
12884
|
if (t.length > 0) {
|
|
12511
12885
|
n.push(...t), e = r.endIndex;
|
|
12512
12886
|
continue;
|
|
12513
12887
|
}
|
|
12514
12888
|
}
|
|
12515
12889
|
}
|
|
12516
|
-
let i =
|
|
12890
|
+
let i = S_(r, { allowListExtraction: !1 });
|
|
12517
12891
|
i.length > 0 && n.push(...i);
|
|
12518
12892
|
}
|
|
12519
12893
|
return n;
|
|
12520
12894
|
}
|
|
12521
|
-
var
|
|
12522
|
-
function
|
|
12895
|
+
var M_ = j_, N_;
|
|
12896
|
+
function P_(e) {
|
|
12523
12897
|
return {
|
|
12524
12898
|
dateDebut: e.dateDebut ?? "0001-01-01",
|
|
12525
12899
|
dateFin: e.dateFin ?? "2999-01-01",
|
|
@@ -12528,7 +12902,7 @@ function d_(e) {
|
|
|
12528
12902
|
textId: e.textId
|
|
12529
12903
|
};
|
|
12530
12904
|
}
|
|
12531
|
-
function
|
|
12905
|
+
function F_(e) {
|
|
12532
12906
|
let t = e["@id"];
|
|
12533
12907
|
return t === void 0 ? null : {
|
|
12534
12908
|
dateDebut: e["@debut"] ?? null,
|
|
@@ -12538,10 +12912,10 @@ function f_(e) {
|
|
|
12538
12912
|
title: e["#text"] ?? null
|
|
12539
12913
|
};
|
|
12540
12914
|
}
|
|
12541
|
-
function
|
|
12915
|
+
function I_(e, t) {
|
|
12542
12916
|
return (e.dateDebut === null || e.dateDebut <= t) && (e.dateFin === null || e.dateFin >= t);
|
|
12543
12917
|
}
|
|
12544
|
-
var
|
|
12918
|
+
var L_ = class extends ke {
|
|
12545
12919
|
canutesDb;
|
|
12546
12920
|
articleRowsByNumByTextAndDate = /* @__PURE__ */ new Map();
|
|
12547
12921
|
directSectionChildrenByParentAndDate = /* @__PURE__ */ new Map();
|
|
@@ -12566,7 +12940,7 @@ var m_ = class extends ke {
|
|
|
12566
12940
|
WHERE
|
|
12567
12941
|
data -> 'CONTEXTE' -> 'TEXTE' ->> '@cid' = ${n}
|
|
12568
12942
|
AND num = ${t}
|
|
12569
|
-
`).map(
|
|
12943
|
+
`).map(P_), this.articleRowsByNumByTextAndDate.set(r, i)), i;
|
|
12570
12944
|
}
|
|
12571
12945
|
async getDirectSectionChildren({ date: e, parentPath: t }) {
|
|
12572
12946
|
let n = `${t}\0${e}`, r = this.directSectionChildrenByParentAndDate.get(n);
|
|
@@ -12580,7 +12954,7 @@ var m_ = class extends ke {
|
|
|
12580
12954
|
SELECT data
|
|
12581
12955
|
FROM legifrance.textelr
|
|
12582
12956
|
WHERE id = ${t}
|
|
12583
|
-
`)[0]?.data.STRUCT?.LIEN_SECTION_TA?.map(
|
|
12957
|
+
`)[0]?.data.STRUCT?.LIEN_SECTION_TA?.map(F_).filter((e) => e !== null).filter((t) => I_(t, e)) ?? [] : i.map(F_).filter((e) => e !== null).filter((t) => I_(t, e)), this.directSectionChildrenByParentAndDate.set(n, r);
|
|
12584
12958
|
}
|
|
12585
12959
|
return r;
|
|
12586
12960
|
}
|
|
@@ -12623,7 +12997,7 @@ var m_ = class extends ke {
|
|
|
12623
12997
|
FROM legifrance.article
|
|
12624
12998
|
WHERE num = ${t}
|
|
12625
12999
|
LIMIT 100
|
|
12626
|
-
`).map(
|
|
13000
|
+
`).map(P_), this.globalArticleRowsByNumAndDate.set(n, r)), r;
|
|
12627
13001
|
}
|
|
12628
13002
|
async preloadTextTitlesInfos(e = {}) {
|
|
12629
13003
|
let t = (t, n = {}) => {
|
|
@@ -12638,7 +13012,7 @@ var m_ = class extends ke {
|
|
|
12638
13012
|
return;
|
|
12639
13013
|
}
|
|
12640
13014
|
let n = new xe("canutes.preloadTextTitlesInfos");
|
|
12641
|
-
|
|
13015
|
+
N_ === void 0 ? (t("queryTextTitlesInfos:start"), N_ = (async () => {
|
|
12642
13016
|
let e = await n.time("queryTextTitlesInfos", () => this.canutesDb`
|
|
12643
13017
|
SELECT
|
|
12644
13018
|
data -> 'META' -> 'META_SPEC' -> 'META_TEXTE_CHRONICLE' ->> 'CID' AS cid,
|
|
@@ -12668,8 +13042,8 @@ var m_ = class extends ke {
|
|
|
12668
13042
|
`);
|
|
12669
13043
|
t("queryTextTitlesInfos:done", { count: e.length }), t("buildTextTitlesInfos:start", { count: e.length }), await Ee(e, { onProgress: ({ count: e, phase: n }) => t(`buildTextTitlesInfos:${n}`, { count: e }) }), t("buildTextTitlesInfos:done", { count: e.length }), t("setTextTitlesInfos:done");
|
|
12670
13044
|
})().catch((e) => {
|
|
12671
|
-
throw
|
|
12672
|
-
})) : t("waiting-for-shared-preload"), await
|
|
13045
|
+
throw N_ = void 0, e;
|
|
13046
|
+
})) : t("waiting-for-shared-preload"), await N_, n.log(), this.textTitlesInfosLoaded = !0;
|
|
12673
13047
|
}
|
|
12674
13048
|
async preloadUniqueActiveArticlesByNums({ date: e, nums: t }) {
|
|
12675
13049
|
let n = [...new Set([...t].filter(Boolean))].filter((t) => !this.globalArticleRowsByNumAndDate.has(`${t}\0${e}`));
|
|
@@ -12683,7 +13057,7 @@ var m_ = class extends ke {
|
|
|
12683
13057
|
data -> 'META' -> 'META_SPEC' -> 'META_ARTICLE' ->> 'DATE_FIN' AS "dateFin"
|
|
12684
13058
|
FROM legifrance.article
|
|
12685
13059
|
WHERE num IN ${this.canutesDb(n)}
|
|
12686
|
-
`).map(
|
|
13060
|
+
`).map(P_), i = /* @__PURE__ */ new Map();
|
|
12687
13061
|
for (let e of r) {
|
|
12688
13062
|
if (e.num === null) continue;
|
|
12689
13063
|
let t = i.get(e.num);
|
|
@@ -12694,15 +13068,15 @@ var m_ = class extends ke {
|
|
|
12694
13068
|
};
|
|
12695
13069
|
//#endregion
|
|
12696
13070
|
//#region src/lib/extractors/links.ts
|
|
12697
|
-
async function*
|
|
12698
|
-
let l = r ?? (e === void 0 ? void 0 : new
|
|
13071
|
+
async function* R_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgnoredReferencesTypes: i, logPartialReferences: a, logReferences: o, state: s, transformation: c }) {
|
|
13072
|
+
let l = r ?? (e === void 0 ? void 0 : new L_(e));
|
|
12699
13073
|
if (l === void 0) throw Error("A Canutes database or legal resolver is required");
|
|
12700
13074
|
let u = new xe("extractTextLinks"), d = {}, f = c === void 0 ? void 0 : _e(c), p = s === void 0 ? {} : structuredClone(s), m = u.timeSync("extractReferences", () => {
|
|
12701
13075
|
let e = [];
|
|
12702
|
-
for (let n of c === void 0 ?
|
|
13076
|
+
for (let n of c === void 0 ? Fm(t) : Lm(t, c)) o && console.log(`In "${t.input.slice(n.position.start, n.position.stop)}": \nReference "${t.text(n.position)}": ${JSON.stringify(n, null, 2)}`), e.push(n);
|
|
12703
13077
|
return e;
|
|
12704
13078
|
}, { inputSize: t.input.length }), h = performance.now();
|
|
12705
|
-
for (let e of m) for (let n of
|
|
13079
|
+
for (let e of m) for (let n of q_(t, e)) {
|
|
12706
13080
|
let r = n.type === "parent-enfant" ? n.parent : n;
|
|
12707
13081
|
switch (r.type) {
|
|
12708
13082
|
case "alinéa":
|
|
@@ -12731,7 +13105,7 @@ async function* h_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
12731
13105
|
r.definition && p.textId === void 0 && a && console.log(`In "${t.input.slice(e.position.start, e.position.stop)}": Missing state.textId for division definition`);
|
|
12732
13106
|
break;
|
|
12733
13107
|
case "texte":
|
|
12734
|
-
|
|
13108
|
+
z_({
|
|
12735
13109
|
context: t,
|
|
12736
13110
|
logPartialReferences: a,
|
|
12737
13111
|
reference: e,
|
|
@@ -12747,14 +13121,14 @@ async function* h_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
12747
13121
|
phase: "collectDefinitionsAndTextState"
|
|
12748
13122
|
});
|
|
12749
13123
|
let g = /* @__PURE__ */ new Set();
|
|
12750
|
-
for (let e of m) for (let t of
|
|
12751
|
-
let _ =
|
|
13124
|
+
for (let e of m) for (let t of K_(e, { citations: !0 })) g.add(t);
|
|
13125
|
+
let _ = B_(t, m);
|
|
12752
13126
|
await u.time("preloadActiveArticlesByTextIds", () => l.preloadActiveArticlesByTextIds({
|
|
12753
13127
|
date: n,
|
|
12754
13128
|
nums: g,
|
|
12755
13129
|
textIds: _
|
|
12756
13130
|
}), { count: _.size });
|
|
12757
|
-
let v = await u.time("collectUniqueFallbackArticleNums", () =>
|
|
13131
|
+
let v = await u.time("collectUniqueFallbackArticleNums", () => V_({
|
|
12758
13132
|
context: t,
|
|
12759
13133
|
date: n,
|
|
12760
13134
|
legiResolver: l,
|
|
@@ -12767,7 +13141,7 @@ async function* h_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
12767
13141
|
nums: v
|
|
12768
13142
|
}), { count: v.size }), p = s === void 0 ? {} : s;
|
|
12769
13143
|
let y = 0, ee = performance.now();
|
|
12770
|
-
for (let e of m) for await (let r of
|
|
13144
|
+
for (let e of m) for await (let r of Q_({
|
|
12771
13145
|
articleDefinitionByNumByTextId: d,
|
|
12772
13146
|
legiResolver: l,
|
|
12773
13147
|
context: t,
|
|
@@ -12784,7 +13158,7 @@ async function* h_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
12784
13158
|
phase: "iterReferenceLinks"
|
|
12785
13159
|
}), u.log({ referenceCount: m.length });
|
|
12786
13160
|
}
|
|
12787
|
-
function
|
|
13161
|
+
function z_({ context: e, logPartialReferences: t, reference: n, state: r, text: i }) {
|
|
12788
13162
|
switch (i.nature) {
|
|
12789
13163
|
case "ARRETE":
|
|
12790
13164
|
case "CIRCULAIRE":
|
|
@@ -12855,17 +13229,17 @@ function g_({ context: e, logPartialReferences: t, reference: n, state: r, text:
|
|
|
12855
13229
|
default: i.nature === void 0 ? delete r.textId : c("nature", i.nature);
|
|
12856
13230
|
}
|
|
12857
13231
|
}
|
|
12858
|
-
function
|
|
13232
|
+
function B_(e, t) {
|
|
12859
13233
|
let n = /* @__PURE__ */ new Set();
|
|
12860
|
-
for (let r of t) for (let t of
|
|
13234
|
+
for (let r of t) for (let t of q_(e, r, { citations: !0 })) {
|
|
12861
13235
|
let e = t.type === "parent-enfant" ? t.parent : t;
|
|
12862
13236
|
e.type === "texte" && e.cid !== void 0 ? n.add(e.cid) : e.type === "article" && e.implicitText?.cid !== void 0 && n.add(e.implicitText.cid);
|
|
12863
13237
|
}
|
|
12864
13238
|
return n;
|
|
12865
13239
|
}
|
|
12866
|
-
async function
|
|
13240
|
+
async function V_({ context: e, date: t, legiResolver: n, logPartialReferences: r, references: i, state: a }) {
|
|
12867
13241
|
let o = /* @__PURE__ */ new Set();
|
|
12868
|
-
for (let s of i) await
|
|
13242
|
+
for (let s of i) await H_({
|
|
12869
13243
|
articleNums: o,
|
|
12870
13244
|
context: e,
|
|
12871
13245
|
date: t,
|
|
@@ -12876,8 +13250,8 @@ async function v_({ context: e, date: t, legiResolver: n, logPartialReferences:
|
|
|
12876
13250
|
});
|
|
12877
13251
|
return o;
|
|
12878
13252
|
}
|
|
12879
|
-
async function
|
|
12880
|
-
for (let s of
|
|
13253
|
+
async function H_({ articleNums: e, context: t, date: n, legiResolver: r, logPartialReferences: i, reference: a, state: o }) {
|
|
13254
|
+
for (let s of q_(t, a)) await U_({
|
|
12881
13255
|
articleNums: e,
|
|
12882
13256
|
atomicOrParentChildReference: s,
|
|
12883
13257
|
context: t,
|
|
@@ -12892,7 +13266,7 @@ async function y_({ articleNums: e, context: t, date: n, legiResolver: r, logPar
|
|
|
12892
13266
|
if (s !== void 0) {
|
|
12893
13267
|
for (let a of s) if (a.references !== void 0) {
|
|
12894
13268
|
let s = structuredClone(o);
|
|
12895
|
-
for (let o of a.references) await
|
|
13269
|
+
for (let o of a.references) await H_({
|
|
12896
13270
|
articleNums: e,
|
|
12897
13271
|
context: t,
|
|
12898
13272
|
date: n,
|
|
@@ -12905,7 +13279,7 @@ async function y_({ articleNums: e, context: t, date: n, legiResolver: r, logPar
|
|
|
12905
13279
|
}
|
|
12906
13280
|
}
|
|
12907
13281
|
}
|
|
12908
|
-
async function
|
|
13282
|
+
async function U_({ articleNums: e, atomicOrParentChildReference: t, context: n, date: r, legiResolver: i, logPartialReferences: a, reference: o, state: s }) {
|
|
12909
13283
|
let c = t.type === "parent-enfant" ? t.parent : t, l = t.type === "parent-enfant" ? t : void 0;
|
|
12910
13284
|
switch (c.type) {
|
|
12911
13285
|
case "alinéa":
|
|
@@ -12914,7 +13288,7 @@ async function b_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
12914
13288
|
case "phrase": break;
|
|
12915
13289
|
case "article":
|
|
12916
13290
|
if (c.definition && s.textId !== void 0) break;
|
|
12917
|
-
await
|
|
13291
|
+
await W_({
|
|
12918
13292
|
article: c,
|
|
12919
13293
|
date: r,
|
|
12920
13294
|
legiResolver: i,
|
|
@@ -12932,7 +13306,7 @@ async function b_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
12932
13306
|
case "sous-titre":
|
|
12933
13307
|
case "titre":
|
|
12934
13308
|
if (c.definition && s.textId !== void 0) break;
|
|
12935
|
-
l !== void 0 && await
|
|
13309
|
+
l !== void 0 && await H_({
|
|
12936
13310
|
articleNums: e,
|
|
12937
13311
|
context: n,
|
|
12938
13312
|
date: r,
|
|
@@ -12943,13 +13317,13 @@ async function b_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
12943
13317
|
});
|
|
12944
13318
|
break;
|
|
12945
13319
|
case "texte":
|
|
12946
|
-
|
|
13320
|
+
z_({
|
|
12947
13321
|
context: n,
|
|
12948
13322
|
logPartialReferences: a,
|
|
12949
13323
|
reference: o,
|
|
12950
13324
|
state: s,
|
|
12951
13325
|
text: c
|
|
12952
|
-
}), l !== void 0 && await
|
|
13326
|
+
}), l !== void 0 && await H_({
|
|
12953
13327
|
articleNums: e,
|
|
12954
13328
|
context: n,
|
|
12955
13329
|
date: r,
|
|
@@ -12962,7 +13336,7 @@ async function b_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
12962
13336
|
default: break;
|
|
12963
13337
|
}
|
|
12964
13338
|
}
|
|
12965
|
-
async function
|
|
13339
|
+
async function W_({ article: e, date: t, legiResolver: n, state: r }) {
|
|
12966
13340
|
if (e.present || e.num === void 0) return !1;
|
|
12967
13341
|
let i = e.implicitText?.cid ?? r.textId;
|
|
12968
13342
|
return !(i !== void 0 && (await n.getActiveArticlesByTextAndNum({
|
|
@@ -12975,7 +13349,7 @@ async function x_({ article: e, date: t, legiResolver: n, state: r }) {
|
|
|
12975
13349
|
textId: r.defaultTextId
|
|
12976
13350
|
})).length > 0);
|
|
12977
13351
|
}
|
|
12978
|
-
async function*
|
|
13352
|
+
async function* G_({ ancestors: e, article: t, legiResolver: n, context: r, date: i, logPartialReferences: a, originalPositionsFromTransformedIterator: o, reference: s, state: c }) {
|
|
12979
13353
|
if (t.present) return;
|
|
12980
13354
|
let l = [], u = t.implicitText?.cid ?? c.textId;
|
|
12981
13355
|
if (u !== void 0 && (l = await n.getActiveArticlesByTextAndNum({
|
|
@@ -13011,91 +13385,91 @@ async function* S_({ ancestors: e, article: t, legiResolver: n, context: r, date
|
|
|
13011
13385
|
type: "external_article"
|
|
13012
13386
|
}).filter(([, e]) => e !== void 0));
|
|
13013
13387
|
}
|
|
13014
|
-
function*
|
|
13388
|
+
function* K_(e, { citations: t = !1 } = {}) {
|
|
13015
13389
|
switch (e.type) {
|
|
13016
13390
|
case "article":
|
|
13017
13391
|
e.num !== void 0 && (yield e.num);
|
|
13018
13392
|
break;
|
|
13019
13393
|
case "bounded-interval":
|
|
13020
|
-
yield*
|
|
13394
|
+
yield* K_(e.first, { citations: t }), yield* K_(e.last, { citations: t });
|
|
13021
13395
|
break;
|
|
13022
13396
|
case "counted-interval":
|
|
13023
|
-
yield*
|
|
13397
|
+
yield* K_(e.first, { citations: t });
|
|
13024
13398
|
break;
|
|
13025
13399
|
case "enumeration":
|
|
13026
13400
|
case "exclusion":
|
|
13027
|
-
yield*
|
|
13401
|
+
yield* K_(e.left, { citations: t }), yield* K_(e.right, { citations: t });
|
|
13028
13402
|
break;
|
|
13029
13403
|
case "parent-enfant":
|
|
13030
|
-
yield*
|
|
13404
|
+
yield* K_(e.parent, { citations: t }), yield* K_(e.child, { citations: t });
|
|
13031
13405
|
break;
|
|
13032
13406
|
case "reference_et_action":
|
|
13033
|
-
if (yield*
|
|
13407
|
+
if (yield* K_(e.reference, { citations: t }), t) {
|
|
13034
13408
|
let { originalCitations: n } = e.action;
|
|
13035
13409
|
if (n !== void 0) {
|
|
13036
|
-
for (let e of n) if (e.references !== void 0) for (let n of e.references) yield*
|
|
13410
|
+
for (let e of n) if (e.references !== void 0) for (let n of e.references) yield* K_(n, { citations: t });
|
|
13037
13411
|
}
|
|
13038
13412
|
}
|
|
13039
13413
|
break;
|
|
13040
13414
|
}
|
|
13041
13415
|
}
|
|
13042
|
-
function*
|
|
13416
|
+
function* q_(e, t, { citations: n = !1 } = {}) {
|
|
13043
13417
|
switch (t.type) {
|
|
13044
13418
|
case "bounded-interval":
|
|
13045
|
-
yield*
|
|
13419
|
+
yield* q_(e, t.first, { citations: n }), yield* q_(e, t.last, { citations: n });
|
|
13046
13420
|
break;
|
|
13047
13421
|
case "counted-interval":
|
|
13048
|
-
yield*
|
|
13422
|
+
yield* q_(e, t.first, { citations: n });
|
|
13049
13423
|
break;
|
|
13050
13424
|
case "enumeration":
|
|
13051
13425
|
case "exclusion":
|
|
13052
|
-
yield*
|
|
13426
|
+
yield* q_(e, t.left, { citations: n }), yield* q_(e, t.right, { citations: n });
|
|
13053
13427
|
break;
|
|
13054
13428
|
case "reference_et_action":
|
|
13055
|
-
if (yield*
|
|
13429
|
+
if (yield* q_(e, t.reference, { citations: n }), n) {
|
|
13056
13430
|
let { originalCitations: r } = t.action;
|
|
13057
13431
|
if (r !== void 0) {
|
|
13058
|
-
for (let t of r) if (t.references !== void 0) for (let r of t.references) yield*
|
|
13432
|
+
for (let t of r) if (t.references !== void 0) for (let r of t.references) yield* q_(e, r, { citations: n });
|
|
13059
13433
|
}
|
|
13060
13434
|
}
|
|
13061
13435
|
break;
|
|
13062
13436
|
default: yield t;
|
|
13063
13437
|
}
|
|
13064
13438
|
}
|
|
13065
|
-
function*
|
|
13439
|
+
function* J_(e, t) {
|
|
13066
13440
|
if (t.type === "texte") console.error(`iterDeepestDivisionsOrArticles must not be called with a text:\n${JSON.stringify(t, null, 2)}`);
|
|
13067
13441
|
else if (dt(t) || t.type === "article") yield t;
|
|
13068
13442
|
else if (!(ft(t) || t.type === "incomplete-header")) switch (t.type) {
|
|
13069
13443
|
case "bounded-interval":
|
|
13070
|
-
yield*
|
|
13444
|
+
yield* J_(e, t.first), yield* J_(e, t.last);
|
|
13071
13445
|
break;
|
|
13072
13446
|
case "counted-interval":
|
|
13073
|
-
yield*
|
|
13447
|
+
yield* J_(e, t.first);
|
|
13074
13448
|
break;
|
|
13075
13449
|
case "enumeration":
|
|
13076
13450
|
case "exclusion":
|
|
13077
|
-
yield*
|
|
13451
|
+
yield* J_(e, t.left), yield* J_(e, t.right);
|
|
13078
13452
|
break;
|
|
13079
13453
|
case "parent-enfant": {
|
|
13080
|
-
let n = [...
|
|
13081
|
-
n.length === 0 ? yield*
|
|
13454
|
+
let n = [...J_(e, t.child)];
|
|
13455
|
+
n.length === 0 ? yield* J_(e, t.parent) : yield* n;
|
|
13082
13456
|
break;
|
|
13083
13457
|
}
|
|
13084
13458
|
case "reference_et_action": {
|
|
13085
|
-
yield*
|
|
13459
|
+
yield* J_(e, t.reference);
|
|
13086
13460
|
let { originalCitations: n } = t.action;
|
|
13087
13461
|
if (n !== void 0) {
|
|
13088
|
-
for (let t of n) if (t.references !== void 0) for (let n of t.references) yield*
|
|
13462
|
+
for (let t of n) if (t.references !== void 0) for (let n of t.references) yield* J_(e, n);
|
|
13089
13463
|
}
|
|
13090
13464
|
break;
|
|
13091
13465
|
}
|
|
13092
13466
|
default: c("iterDeepestDivisionsOrArticles reference.type", t);
|
|
13093
13467
|
}
|
|
13094
13468
|
}
|
|
13095
|
-
function
|
|
13469
|
+
function Y_(e) {
|
|
13096
13470
|
return e?.split(":")[0].trim().toLowerCase().split(/\s+/).map((e) => e.trim()).filter((e) => e !== "").join(" ");
|
|
13097
13471
|
}
|
|
13098
|
-
async function*
|
|
13472
|
+
async function* X_({ ancestors: e, legiResolver: t, context: n, date: r, division: i, divisionChildReference: a, logIgnoredReferencesTypes: o, logPartialReferences: s, originalPositionsFromTransformedIterator: c, parentSectionChildren: l, reference: u, state: d }) {
|
|
13099
13473
|
if (i.present) return;
|
|
13100
13474
|
let f;
|
|
13101
13475
|
if (l === void 0 && d.textId !== void 0 && (l = await t.getDirectSectionChildren({
|
|
@@ -13103,20 +13477,20 @@ async function* D_({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13103
13477
|
parentPath: d.textId
|
|
13104
13478
|
})), l !== void 0) {
|
|
13105
13479
|
for (let e of l) {
|
|
13106
|
-
let t =
|
|
13480
|
+
let t = Y_(e.title);
|
|
13107
13481
|
if (t !== void 0) {
|
|
13108
13482
|
let n = !1;
|
|
13109
|
-
if (i.index !== void 0 && (n =
|
|
13483
|
+
if (i.index !== void 0 && (n = Z_(i.type, i.index).some((e) => e === t)), !n && i.num !== void 0 && (n = `${i.type} ${i.num.toLowerCase()}` === t), n) {
|
|
13110
13484
|
f = e;
|
|
13111
13485
|
break;
|
|
13112
13486
|
}
|
|
13113
13487
|
}
|
|
13114
13488
|
}
|
|
13115
13489
|
if (f === void 0 && (f = l.find((e) => {
|
|
13116
|
-
let t =
|
|
13490
|
+
let t = Y_(e.title)?.split(/\s+/);
|
|
13117
13491
|
return t !== void 0 && t.length === 2 && ot.includes(t[0]) && t[1] === "législative";
|
|
13118
13492
|
}), f !== void 0)) {
|
|
13119
|
-
let e =
|
|
13493
|
+
let e = Y_(f.title).split(/\s+/), t = {
|
|
13120
13494
|
start: i.position.stop,
|
|
13121
13495
|
stop: i.position.stop
|
|
13122
13496
|
}, n = c === void 0 ? void 0 : v(c, t), r = Object.fromEntries(Object.entries({
|
|
@@ -13134,8 +13508,8 @@ async function* D_({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13134
13508
|
}).filter(([, e]) => e !== void 0)), i = r;
|
|
13135
13509
|
}
|
|
13136
13510
|
}
|
|
13137
|
-
let p = a === void 0 ? [] : [...
|
|
13138
|
-
if (a !== void 0) for (let l of
|
|
13511
|
+
let p = a === void 0 ? [] : [...J_(n, a.child)], m = 0;
|
|
13512
|
+
if (a !== void 0) for (let l of q_(n, a.child)) {
|
|
13139
13513
|
let h = l.type === "parent-enfant" ? l.parent : l, g = l.type === "parent-enfant" ? l : void 0;
|
|
13140
13514
|
switch (h.type) {
|
|
13141
13515
|
case "alinéa":
|
|
@@ -13143,7 +13517,7 @@ async function* D_({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13143
13517
|
case "item":
|
|
13144
13518
|
case "phrase": break;
|
|
13145
13519
|
case "article":
|
|
13146
|
-
yield*
|
|
13520
|
+
yield* G_({
|
|
13147
13521
|
ancestors: p.length === 1 ? [...e ?? [], i] : void 0,
|
|
13148
13522
|
article: h,
|
|
13149
13523
|
legiResolver: t,
|
|
@@ -13169,7 +13543,7 @@ async function* D_({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13169
13543
|
f !== void 0 && (a = await t.getDirectSectionChildren({
|
|
13170
13544
|
date: r,
|
|
13171
13545
|
parentPath: f.path
|
|
13172
|
-
})), yield*
|
|
13546
|
+
})), yield* X_({
|
|
13173
13547
|
ancestors: p.length === 1 ? [...e ?? [], i] : void 0,
|
|
13174
13548
|
legiResolver: t,
|
|
13175
13549
|
context: n,
|
|
@@ -13207,7 +13581,7 @@ async function* D_({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13207
13581
|
}).filter(([, e]) => e !== void 0));
|
|
13208
13582
|
}
|
|
13209
13583
|
}
|
|
13210
|
-
function*
|
|
13584
|
+
function* Z_(e, t) {
|
|
13211
13585
|
let n = Math.floor(t), r = Math.floor((t - n) * 1e3);
|
|
13212
13586
|
if (r === 0) {
|
|
13213
13587
|
for (let t of re(n)) yield `${t.toLowerCase()} ${e}`;
|
|
@@ -13217,9 +13591,9 @@ function* O_(e, t) {
|
|
|
13217
13591
|
for (let r of f(n)) yield `${e} ${t} ${r.toLowerCase()}`;
|
|
13218
13592
|
}
|
|
13219
13593
|
}
|
|
13220
|
-
async function*
|
|
13594
|
+
async function* Q_({ articleDefinitionByNumByTextId: e, legiResolver: t, context: n, date: r, logIgnoredReferencesTypes: i, logPartialReferences: a, originalPositionsFromTransformedIterator: o, reference: s, state: c }) {
|
|
13221
13595
|
let l = e ?? {}, u = c === void 0 ? {} : c;
|
|
13222
|
-
for (let e of
|
|
13596
|
+
for (let e of q_(n, s)) {
|
|
13223
13597
|
let c = e.type === "parent-enfant" ? e.parent : e, d = e.type === "parent-enfant" ? e : void 0;
|
|
13224
13598
|
switch (c.type) {
|
|
13225
13599
|
case "alinéa":
|
|
@@ -13230,7 +13604,7 @@ async function* k_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13230
13604
|
if (c.definition && u.textId !== void 0) {
|
|
13231
13605
|
let e = l[u.textId]?.[c.num];
|
|
13232
13606
|
e !== void 0 && (e.originalTransformation === void 0 && o !== void 0 && (e.originalTransformation = v(o, e.position)), yield e);
|
|
13233
|
-
} else yield*
|
|
13607
|
+
} else yield* G_({
|
|
13234
13608
|
article: c,
|
|
13235
13609
|
legiResolver: t,
|
|
13236
13610
|
context: n,
|
|
@@ -13251,7 +13625,7 @@ async function* k_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13251
13625
|
case "sous-sous-paragraphe":
|
|
13252
13626
|
case "sous-titre":
|
|
13253
13627
|
case "titre":
|
|
13254
|
-
c.definition && u.textId !== void 0 || (yield*
|
|
13628
|
+
c.definition && u.textId !== void 0 || (yield* X_({
|
|
13255
13629
|
legiResolver: t,
|
|
13256
13630
|
context: n,
|
|
13257
13631
|
date: r,
|
|
@@ -13265,15 +13639,15 @@ async function* k_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13265
13639
|
}));
|
|
13266
13640
|
break;
|
|
13267
13641
|
case "texte": {
|
|
13268
|
-
|
|
13642
|
+
z_({
|
|
13269
13643
|
context: n,
|
|
13270
13644
|
logPartialReferences: a,
|
|
13271
13645
|
reference: s,
|
|
13272
13646
|
state: u,
|
|
13273
13647
|
text: c
|
|
13274
13648
|
});
|
|
13275
|
-
let e = d === void 0 ? [] : [...
|
|
13276
|
-
if (d !== void 0) for (let f of
|
|
13649
|
+
let e = d === void 0 ? [] : [...J_(n, d.child)], l = 0;
|
|
13650
|
+
if (d !== void 0) for (let f of q_(n, d.child)) {
|
|
13277
13651
|
let p = f.type === "parent-enfant" ? f.parent : f, m = f.type === "parent-enfant" ? f : void 0;
|
|
13278
13652
|
switch (p.type) {
|
|
13279
13653
|
case "alinéa":
|
|
@@ -13281,7 +13655,7 @@ async function* k_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13281
13655
|
case "item":
|
|
13282
13656
|
case "phrase": break;
|
|
13283
13657
|
case "article":
|
|
13284
|
-
yield*
|
|
13658
|
+
yield* G_({
|
|
13285
13659
|
ancestors: e.length === 1 ? [c] : void 0,
|
|
13286
13660
|
article: p,
|
|
13287
13661
|
legiResolver: t,
|
|
@@ -13307,7 +13681,7 @@ async function* k_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13307
13681
|
u.textId !== void 0 && (d = await t.getDirectSectionChildren({
|
|
13308
13682
|
date: r,
|
|
13309
13683
|
parentPath: u.textId
|
|
13310
|
-
})), yield*
|
|
13684
|
+
})), yield* X_({
|
|
13311
13685
|
ancestors: e.length === 1 ? [c] : void 0,
|
|
13312
13686
|
legiResolver: t,
|
|
13313
13687
|
context: n,
|
|
@@ -13358,7 +13732,7 @@ async function* k_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13358
13732
|
if (e !== void 0) {
|
|
13359
13733
|
for (let s of e) if (s.references !== void 0) {
|
|
13360
13734
|
let e = structuredClone(u);
|
|
13361
|
-
for (let c of s.references) yield*
|
|
13735
|
+
for (let c of s.references) yield* Q_({
|
|
13362
13736
|
articleDefinitionByNumByTextId: l,
|
|
13363
13737
|
legiResolver: t,
|
|
13364
13738
|
context: n,
|
|
@@ -13375,13 +13749,13 @@ async function* k_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13375
13749
|
}
|
|
13376
13750
|
//#endregion
|
|
13377
13751
|
//#region src/lib/extractors/table_of_contents.ts
|
|
13378
|
-
function
|
|
13752
|
+
function $_(e) {
|
|
13379
13753
|
let t = e;
|
|
13380
13754
|
return t.items ?? [...t.articles ?? [], ...t.divisions ?? []];
|
|
13381
13755
|
}
|
|
13382
|
-
function*
|
|
13756
|
+
function* ev({ context: e, tableOfContents: t, transformation: n }) {
|
|
13383
13757
|
let r = 0, i = _e(n);
|
|
13384
|
-
for (let n of
|
|
13758
|
+
for (let n of nv(t)) {
|
|
13385
13759
|
let t = n.line.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = RegExp(`^${t}$`, "m");
|
|
13386
13760
|
a.lastIndex = r;
|
|
13387
13761
|
let o = a.exec(e.input);
|
|
@@ -13393,7 +13767,7 @@ function* j_({ context: e, tableOfContents: t, transformation: n }) {
|
|
|
13393
13767
|
l.originalTransformation = c, l.position = s, yield l, r = s.stop;
|
|
13394
13768
|
}
|
|
13395
13769
|
}
|
|
13396
|
-
function
|
|
13770
|
+
function tv(e) {
|
|
13397
13771
|
let t = new n(e), r = { items: [] }, i = [];
|
|
13398
13772
|
for (let e of Tn(t)) if (dt(e)) {
|
|
13399
13773
|
let n = i.findIndex(({ type: t }) => t === e.type);
|
|
@@ -13411,14 +13785,14 @@ function M_(e) {
|
|
|
13411
13785
|
else throw Error(`Unexpected type "${e.type}" in definition:\n${JSON.stringify(e, null, 2)}`);
|
|
13412
13786
|
return r;
|
|
13413
13787
|
}
|
|
13414
|
-
function*
|
|
13788
|
+
function* nv(e) {
|
|
13415
13789
|
e.type !== void 0 && (yield e);
|
|
13416
|
-
for (let t of
|
|
13790
|
+
for (let t of $_(e)) t.type === "article" ? yield t : yield* nv(t);
|
|
13417
13791
|
}
|
|
13418
13792
|
//#endregion
|
|
13419
13793
|
//#region src/lib/links.ts
|
|
13420
|
-
var
|
|
13421
|
-
function
|
|
13794
|
+
var rv = ["Exploratrice", "Forgejo"];
|
|
13795
|
+
function iv(e, t, n) {
|
|
13422
13796
|
let r = n.match(Ke);
|
|
13423
13797
|
if (r === null) throw Error(`Unknown ID format: ${n}`);
|
|
13424
13798
|
switch (e) {
|
|
@@ -13439,19 +13813,19 @@ function F_(e, t, n) {
|
|
|
13439
13813
|
}
|
|
13440
13814
|
//#endregion
|
|
13441
13815
|
//#region src/lib/linkers/html.ts
|
|
13442
|
-
function
|
|
13816
|
+
function av(e, t) {
|
|
13443
13817
|
if (e !== void 0) return e;
|
|
13444
|
-
if (t !== void 0) return new
|
|
13818
|
+
if (t !== void 0) return new L_(t);
|
|
13445
13819
|
throw Error("A Canutes database or legal resolver is required");
|
|
13446
13820
|
}
|
|
13447
|
-
function
|
|
13821
|
+
function ov(e, t) {
|
|
13448
13822
|
return t.type === "reference_et_action" ? JSON.stringify({
|
|
13449
13823
|
...e,
|
|
13450
13824
|
action: t.action
|
|
13451
13825
|
}) : JSON.stringify(e);
|
|
13452
13826
|
}
|
|
13453
|
-
async function
|
|
13454
|
-
let h = new xe("addLinksToHtml"), g =
|
|
13827
|
+
async function sv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl: o, linkType: s, logIgnoredReferencesTypes: l, logPartialReferences: u, logReferences: d, onLink: f, previousContext: p, state: m }) {
|
|
13828
|
+
let h = new xe("addLinksToHtml"), g = av(t, e);
|
|
13455
13829
|
await h.time("preloadTextTitlesInfos", () => g.preloadTextTitlesInfos());
|
|
13456
13830
|
let _ = h.timeSync("simplifyHtml", () => a({ removeAWithHref: !0 })(i), {
|
|
13457
13831
|
inputSize: i.length,
|
|
@@ -13460,7 +13834,7 @@ async function R_({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13460
13834
|
v.currentArticle = p?.currentArticle, v.currentText = p?.currentText;
|
|
13461
13835
|
let y = [], ee = { value: 0 }, te = -1;
|
|
13462
13836
|
await h.time("extractTextLinks", async () => {
|
|
13463
|
-
for await (let e of
|
|
13837
|
+
for await (let e of R_({
|
|
13464
13838
|
legiResolver: g,
|
|
13465
13839
|
context: v,
|
|
13466
13840
|
date: r,
|
|
@@ -13473,7 +13847,7 @@ async function R_({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13473
13847
|
case "article_definition": {
|
|
13474
13848
|
let { article: t, originalTransformation: n, textId: r } = e;
|
|
13475
13849
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(e, null, 2)}`);
|
|
13476
|
-
|
|
13850
|
+
lv({
|
|
13477
13851
|
inputHtml: i,
|
|
13478
13852
|
originalTransformation: n,
|
|
13479
13853
|
output: { replacements: y },
|
|
@@ -13486,12 +13860,12 @@ async function R_({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13486
13860
|
let { articleId: t, originalTransformation: n } = e;
|
|
13487
13861
|
if (t !== void 0) {
|
|
13488
13862
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
13489
|
-
|
|
13863
|
+
lv({
|
|
13490
13864
|
inputHtml: i,
|
|
13491
13865
|
originalTransformation: n,
|
|
13492
13866
|
output: { replacements: y },
|
|
13493
13867
|
replacementCounter: ee,
|
|
13494
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_article_externe" href="${
|
|
13868
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_article_externe" href="${iv(s, o, t)}">${e}</a>`
|
|
13495
13869
|
});
|
|
13496
13870
|
}
|
|
13497
13871
|
break;
|
|
@@ -13500,12 +13874,12 @@ async function R_({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13500
13874
|
let { originalTransformation: t, sectionTaId: n } = e;
|
|
13501
13875
|
if (n !== void 0) {
|
|
13502
13876
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
13503
|
-
|
|
13877
|
+
lv({
|
|
13504
13878
|
inputHtml: i,
|
|
13505
13879
|
originalTransformation: t,
|
|
13506
13880
|
output: { replacements: y },
|
|
13507
13881
|
replacementCounter: ee,
|
|
13508
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_division_externe" href="${
|
|
13882
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_division_externe" href="${iv(s, o, n)}">${e}</a>`
|
|
13509
13883
|
});
|
|
13510
13884
|
}
|
|
13511
13885
|
break;
|
|
@@ -13517,12 +13891,12 @@ async function R_({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13517
13891
|
continue;
|
|
13518
13892
|
}
|
|
13519
13893
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
13520
|
-
|
|
13894
|
+
lv({
|
|
13521
13895
|
inputHtml: i,
|
|
13522
13896
|
originalTransformation: t,
|
|
13523
13897
|
output: { replacements: y },
|
|
13524
13898
|
replacementCounter: ee,
|
|
13525
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_texte_externe" href="${
|
|
13899
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_texte_externe" href="${iv(s, o, n.cid)}">${e}</a>`
|
|
13526
13900
|
});
|
|
13527
13901
|
break;
|
|
13528
13902
|
}
|
|
@@ -13530,7 +13904,7 @@ async function R_({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13530
13904
|
let { url: t, originalTransformation: n } = e;
|
|
13531
13905
|
if (t === void 0) continue;
|
|
13532
13906
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in european text link: ${JSON.stringify(e, null, 2)}`);
|
|
13533
|
-
|
|
13907
|
+
lv({
|
|
13534
13908
|
inputHtml: i,
|
|
13535
13909
|
originalTransformation: n,
|
|
13536
13910
|
output: { replacements: y },
|
|
@@ -13542,7 +13916,7 @@ async function R_({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13542
13916
|
case "internal_article": {
|
|
13543
13917
|
let { definition: t, originalTransformation: n } = e;
|
|
13544
13918
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
13545
|
-
|
|
13919
|
+
lv({
|
|
13546
13920
|
inputHtml: i,
|
|
13547
13921
|
originalTransformation: n,
|
|
13548
13922
|
output: { replacements: y },
|
|
@@ -13554,7 +13928,7 @@ async function R_({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13554
13928
|
default: c("Link", e);
|
|
13555
13929
|
}
|
|
13556
13930
|
}, { count: te + 1 });
|
|
13557
|
-
let ne = h.timeSync("applyHtmlReplacements", () =>
|
|
13931
|
+
let ne = h.timeSync("applyHtmlReplacements", () => cv(i, y), {
|
|
13558
13932
|
count: y.length,
|
|
13559
13933
|
inputSize: i.length
|
|
13560
13934
|
});
|
|
@@ -13566,13 +13940,13 @@ async function R_({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13566
13940
|
output: y.length === 0 ? null : ne
|
|
13567
13941
|
};
|
|
13568
13942
|
}
|
|
13569
|
-
function
|
|
13943
|
+
function cv(e, t) {
|
|
13570
13944
|
if (t.length === 0) return e;
|
|
13571
13945
|
let n = [], r = 0;
|
|
13572
13946
|
for (let i of t.toSorted((e, t) => e.start - t.start || e.stop - t.stop || e.order - t.order)) i.start < r || (n.push(e.slice(r, i.start)), n.push(i.replacement), r = i.stop);
|
|
13573
13947
|
return n.push(e.slice(r)), n.join("");
|
|
13574
13948
|
}
|
|
13575
|
-
function
|
|
13949
|
+
function lv({ inputHtml: e, originalTransformation: t, output: n, replacementCounter: r, tagHtmlFromOriginal: i }) {
|
|
13576
13950
|
let a = d(t, i(s(e, t, 0) ?? ""));
|
|
13577
13951
|
n.replacements.push({
|
|
13578
13952
|
order: r.value++,
|
|
@@ -13581,11 +13955,11 @@ function B_({ inputHtml: e, originalTransformation: t, output: n, replacementCou
|
|
|
13581
13955
|
stop: t.position.stop
|
|
13582
13956
|
});
|
|
13583
13957
|
}
|
|
13584
|
-
function
|
|
13958
|
+
function uv({ attributes: e, inputHtml: t, originalTransformation: n, outputByType: r, replacementCounter: i }) {
|
|
13585
13959
|
let a = Object.entries(e).map(([e, t]) => `${e}="${et(t, !0)}"`).join(" ");
|
|
13586
13960
|
for (let e of ["links", "links_or_references"]) {
|
|
13587
13961
|
let o = r[e];
|
|
13588
|
-
o !== void 0 &&
|
|
13962
|
+
o !== void 0 && lv({
|
|
13589
13963
|
inputHtml: t,
|
|
13590
13964
|
originalTransformation: n,
|
|
13591
13965
|
output: o,
|
|
@@ -13594,11 +13968,11 @@ function V_({ attributes: e, inputHtml: t, originalTransformation: n, outputByTy
|
|
|
13594
13968
|
});
|
|
13595
13969
|
}
|
|
13596
13970
|
}
|
|
13597
|
-
function
|
|
13971
|
+
function dv({ id: e, outputByType: t }) {
|
|
13598
13972
|
return t.references !== void 0 || e === void 0 && t.links_or_references !== void 0;
|
|
13599
13973
|
}
|
|
13600
|
-
async function
|
|
13601
|
-
let h =
|
|
13974
|
+
async function fv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, htmlTransformation: a, inputHtml: o, linkBaseUrl: s, linkType: l, logIgnoredReferencesTypes: u, logPartialReferences: d, logReferences: f, outputTypes: p, referredLegifranceTextsInfos: m }) {
|
|
13975
|
+
let h = av(t, e);
|
|
13602
13976
|
await h.preloadTextTitlesInfos();
|
|
13603
13977
|
let g = new n(a.output), _ = {}, v = {};
|
|
13604
13978
|
for (let e of p) v[e] = {
|
|
@@ -13607,7 +13981,7 @@ async function U_({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13607
13981
|
replacements: []
|
|
13608
13982
|
};
|
|
13609
13983
|
let y = { value: 0 };
|
|
13610
|
-
for await (let e of
|
|
13984
|
+
for await (let e of R_({
|
|
13611
13985
|
legiResolver: h,
|
|
13612
13986
|
context: g,
|
|
13613
13987
|
date: r,
|
|
@@ -13620,7 +13994,7 @@ async function U_({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13620
13994
|
case "article_definition": {
|
|
13621
13995
|
let { article: t, originalTransformation: n, textId: r } = e;
|
|
13622
13996
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(e, null, 2)}`);
|
|
13623
|
-
for (let e of Object.values(v))
|
|
13997
|
+
for (let e of Object.values(v)) lv({
|
|
13624
13998
|
inputHtml: o,
|
|
13625
13999
|
originalTransformation: n,
|
|
13626
14000
|
output: e,
|
|
@@ -13632,10 +14006,10 @@ async function U_({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13632
14006
|
case "external_article": {
|
|
13633
14007
|
let { article: t, articleId: n, originalTransformation: r } = e;
|
|
13634
14008
|
if (r === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
13635
|
-
if (n !== void 0 && (
|
|
14009
|
+
if (n !== void 0 && (uv({
|
|
13636
14010
|
attributes: {
|
|
13637
14011
|
class: "lien_article_externe",
|
|
13638
|
-
href:
|
|
14012
|
+
href: iv(l, s, n)
|
|
13639
14013
|
},
|
|
13640
14014
|
inputHtml: o,
|
|
13641
14015
|
originalTransformation: r,
|
|
@@ -13645,14 +14019,14 @@ async function U_({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13645
14019
|
let e = await h.getTextIdFromSegmentId(n);
|
|
13646
14020
|
e != null && (_[e] = (_[e] ?? 0) + 1);
|
|
13647
14021
|
}
|
|
13648
|
-
|
|
14022
|
+
dv({
|
|
13649
14023
|
id: n,
|
|
13650
14024
|
outputByType: v
|
|
13651
|
-
}) &&
|
|
14025
|
+
}) && pv({
|
|
13652
14026
|
attributes: {
|
|
13653
14027
|
class: "reference_article",
|
|
13654
14028
|
style: "background-color: #eae462",
|
|
13655
|
-
title:
|
|
14029
|
+
title: ov(t, e.reference)
|
|
13656
14030
|
},
|
|
13657
14031
|
id: n,
|
|
13658
14032
|
inputHtml: o,
|
|
@@ -13665,10 +14039,10 @@ async function U_({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13665
14039
|
case "external_division": {
|
|
13666
14040
|
let { division: t, originalTransformation: n, sectionTaId: r } = e;
|
|
13667
14041
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
13668
|
-
if (r !== void 0 && (
|
|
14042
|
+
if (r !== void 0 && (uv({
|
|
13669
14043
|
attributes: {
|
|
13670
14044
|
class: "lien_division_externe",
|
|
13671
|
-
href:
|
|
14045
|
+
href: iv(l, s, r)
|
|
13672
14046
|
},
|
|
13673
14047
|
inputHtml: o,
|
|
13674
14048
|
originalTransformation: n,
|
|
@@ -13678,14 +14052,14 @@ async function U_({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13678
14052
|
let e = await h.getTextIdFromSegmentId(r);
|
|
13679
14053
|
e != null && (_[e] = (_[e] ?? 0) + 1);
|
|
13680
14054
|
}
|
|
13681
|
-
|
|
14055
|
+
dv({
|
|
13682
14056
|
id: r,
|
|
13683
14057
|
outputByType: v
|
|
13684
|
-
}) &&
|
|
14058
|
+
}) && pv({
|
|
13685
14059
|
attributes: {
|
|
13686
14060
|
class: "reference_division",
|
|
13687
14061
|
style: "background-color: #eae462",
|
|
13688
|
-
title:
|
|
14062
|
+
title: ov(t, e.reference)
|
|
13689
14063
|
},
|
|
13690
14064
|
id: r,
|
|
13691
14065
|
inputHtml: o,
|
|
@@ -13698,7 +14072,7 @@ async function U_({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13698
14072
|
case "european_text": {
|
|
13699
14073
|
let { url: t, originalTransformation: n, text: r, titleId: i } = e;
|
|
13700
14074
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
13701
|
-
|
|
14075
|
+
uv({
|
|
13702
14076
|
attributes: {
|
|
13703
14077
|
class: "lien_texte_european",
|
|
13704
14078
|
href: t,
|
|
@@ -13708,14 +14082,14 @@ async function U_({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13708
14082
|
originalTransformation: n,
|
|
13709
14083
|
outputByType: v,
|
|
13710
14084
|
replacementCounter: y
|
|
13711
|
-
}),
|
|
14085
|
+
}), dv({
|
|
13712
14086
|
id: i,
|
|
13713
14087
|
outputByType: v
|
|
13714
|
-
}) &&
|
|
14088
|
+
}) && pv({
|
|
13715
14089
|
attributes: {
|
|
13716
14090
|
class: "reference_texte",
|
|
13717
14091
|
style: "background-color: #eae462",
|
|
13718
|
-
title:
|
|
14092
|
+
title: ov(r, e.reference)
|
|
13719
14093
|
},
|
|
13720
14094
|
id: i,
|
|
13721
14095
|
inputHtml: o,
|
|
@@ -13728,23 +14102,23 @@ async function U_({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13728
14102
|
case "external_text": {
|
|
13729
14103
|
let { originalTransformation: t, text: n } = e;
|
|
13730
14104
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
13731
|
-
n.cid === void 0 ? !n.present && d && console.error(`Link to text "${g.text(n.position)}" without CID: ${JSON.stringify(n, null, 2)}`) : (
|
|
14105
|
+
n.cid === void 0 ? !n.present && d && console.error(`Link to text "${g.text(n.position)}" without CID: ${JSON.stringify(n, null, 2)}`) : (uv({
|
|
13732
14106
|
attributes: {
|
|
13733
14107
|
class: "lien_texte_externe",
|
|
13734
|
-
href:
|
|
14108
|
+
href: iv(l, s, n.cid)
|
|
13735
14109
|
},
|
|
13736
14110
|
inputHtml: o,
|
|
13737
14111
|
originalTransformation: t,
|
|
13738
14112
|
outputByType: v,
|
|
13739
14113
|
replacementCounter: y
|
|
13740
|
-
}), m && (_[n.cid] = (_[n.cid] ?? 0) + 1)),
|
|
14114
|
+
}), m && (_[n.cid] = (_[n.cid] ?? 0) + 1)), dv({
|
|
13741
14115
|
id: n.cid,
|
|
13742
14116
|
outputByType: v
|
|
13743
|
-
}) &&
|
|
14117
|
+
}) && pv({
|
|
13744
14118
|
attributes: {
|
|
13745
14119
|
class: "reference_texte",
|
|
13746
14120
|
style: "background-color: #eae462",
|
|
13747
|
-
title:
|
|
14121
|
+
title: ov(n, e.reference)
|
|
13748
14122
|
},
|
|
13749
14123
|
id: n.cid,
|
|
13750
14124
|
inputHtml: o,
|
|
@@ -13757,7 +14131,7 @@ async function U_({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13757
14131
|
case "internal_article": {
|
|
13758
14132
|
let { definition: t, originalTransformation: n } = e;
|
|
13759
14133
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
13760
|
-
for (let e of Object.values(v))
|
|
14134
|
+
for (let e of Object.values(v)) lv({
|
|
13761
14135
|
inputHtml: o,
|
|
13762
14136
|
originalTransformation: n,
|
|
13763
14137
|
output: e,
|
|
@@ -13768,18 +14142,18 @@ async function U_({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13768
14142
|
}
|
|
13769
14143
|
default: c("Link", e);
|
|
13770
14144
|
}
|
|
13771
|
-
for (let e of Object.values(v)) e.html =
|
|
14145
|
+
for (let e of Object.values(v)) e.html = cv(o, e.replacements);
|
|
13772
14146
|
return {
|
|
13773
14147
|
outputByType: v,
|
|
13774
14148
|
referredLegifranceTextCountByCid: _
|
|
13775
14149
|
};
|
|
13776
14150
|
}
|
|
13777
|
-
function
|
|
14151
|
+
function pv({ attributes: e, id: t, inputHtml: n, originalTransformation: r, outputByType: i, replacementCounter: a }) {
|
|
13778
14152
|
let o = Object.entries(e).map(([e, t]) => `${e}="${et(t, !0)}"`).join(" ");
|
|
13779
14153
|
for (let e of ["links_or_references", "references"]) {
|
|
13780
14154
|
if (e === "links_or_references" && t !== void 0) continue;
|
|
13781
14155
|
let s = i[e];
|
|
13782
|
-
s !== void 0 &&
|
|
14156
|
+
s !== void 0 && lv({
|
|
13783
14157
|
inputHtml: n,
|
|
13784
14158
|
originalTransformation: r,
|
|
13785
14159
|
output: s,
|
|
@@ -13789,4 +14163,4 @@ function W_({ attributes: e, id: t, inputHtml: n, originalTransformation: r, out
|
|
|
13789
14163
|
}
|
|
13790
14164
|
}
|
|
13791
14165
|
//#endregion
|
|
13792
|
-
export {
|
|
14166
|
+
export { Wp as $, Lm as A, O as At, dm as B, ft as Bt, Km as C, Rt as Ct, Bm as D, ht as Dt, Vm as E, mt as Et, Mm as F, rt as Ft, Kp as G, um as H, lt as Ht, wm as I, it as It, Gp as J, qp as K, Sm as L, at as Lt, zm as M, tt as Mt, Nm as N, nt as Nt, Pm as O, _t as Ot, jm as P, ot as Pt, bp as Q, bm as R, ut as Rt, Oh as S, Dt as St, Um as T, Ot as Tt, im as U, ct as Ut, fm as V, st as Vt, $ as W, Rp as X, jp as Y, yp as Z, Jh as _, qt as _t, ev as a, wn as at, Hh as b, Bt as bt, nv as c, fn as ct, L_ as d, rn as dt, dp as et, C_ as f, an as ft, w_ as g, Xt as gt, j_ as h, Qt as ht, iv as i, xn as it, Rm as j, xt as jt, Fm as k, D as kt, R_ as l, un as lt, T_ as m, sn as mt, sv as n, _n as nt, tv as o, pn as ot, M_ as p, nn as pt, Zp as q, rv as r, vn as rt, $_ as s, gn as st, fv as t, Tn as tt, Q_ as u, tn as ut, Uh as v, Jt as vt, Hm as w, zt as wt, kh as x, Vt as xt, Wh as y, Yt as yt, pm as z, dt as zt };
|