@tricoteuses/tisseuse 0.14.16 → 0.14.18
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/README.md +12 -1
- package/dist/{html-DA1zf9Pf.js → html-DN3bob0k.js} +124 -64
- package/dist/index.js +139 -122
- package/dist/server.js +667 -667
- package/dist/src/lib/index.d.ts +1 -1
- package/dist/src/lib/linkers/cited-article.test.d.ts +1 -0
- package/dist/src/lib/links.d.ts +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -181,7 +181,18 @@ npm run audit:doctrinal-references:check
|
|
|
181
181
|
Cette commande compare le résultat à `audits/doctrinal-references-baseline.json`
|
|
182
182
|
et échoue si la couverture régresse. Le BOFiP y est mesuré sur les formes
|
|
183
183
|
doctrinales figées ; le BOSS et Ameli y sont en outre mesurés sur
|
|
184
|
-
l'intégralité des citations d'articles détectées par le parseur.
|
|
184
|
+
l'intégralité des citations d'articles détectées par le parseur. Le recalage
|
|
185
|
+
BOFiP à 63 977 références détectées (62 727 résolues, 79 non résolues)
|
|
186
|
+
suit une différence de 25 anciennes détections après les optimisations du
|
|
187
|
+
fast path (frontière de mot et fenêtre de recouvrement). Cette différence ne
|
|
188
|
+
doit pas être rétablie en bloc : `c. civ.` ne doit pas être reconnu à
|
|
189
|
+
l'intérieur de `proc. civ.`, ni `CGI` à l'intérieur de `FranceCGI` ; élargir la
|
|
190
|
+
fenêtre peut à tort rapporter un article de l'annexe au CGI principal. La citation complète
|
|
191
|
+
`code de proc. civ., art. 1300` est reconnue séparément et liée au Code de
|
|
192
|
+
procédure civile. Ne pas « corriger » la baseline en rétablissant des liens
|
|
193
|
+
vers le Code civil sur ces sous-chaînes.
|
|
194
|
+
|
|
195
|
+
Pour produire les artefacts détaillés :
|
|
185
196
|
|
|
186
197
|
```sh
|
|
187
198
|
npm run audit:doctrinal-references -- \
|
|
@@ -10462,7 +10462,7 @@ var tm = [
|
|
|
10462
10462
|
{
|
|
10463
10463
|
cid: "LEGITEXT000006070716",
|
|
10464
10464
|
nature: "CODE",
|
|
10465
|
-
pattern: String.raw`c
|
|
10465
|
+
pattern: String.raw`(?:code\s+de\s+|c\s*\.?\s*)pr(?:oc(?:[eé]dure)?)?\.?\s*civ(?:il)?\.?|cpc`,
|
|
10466
10466
|
title: "Code de procédure civile"
|
|
10467
10467
|
},
|
|
10468
10468
|
{
|
|
@@ -14594,7 +14594,13 @@ function* Kv(e) {
|
|
|
14594
14594
|
//#endregion
|
|
14595
14595
|
//#region src/lib/links.ts
|
|
14596
14596
|
var qv = ["Exploratrice", "Forgejo"];
|
|
14597
|
-
function Jv(e
|
|
14597
|
+
function Jv(e) {
|
|
14598
|
+
let t = /^articles?\s+(?:n°\s*)?((?:1er|\d+)(?:\s+(?:bis|ter|quater|quinquies|septies))?(?:[-.·\s]\d+)*)\s+(?:du|de\s+la|de\s+l'|des|au|à)\b/iu.exec(e);
|
|
14599
|
+
if (t === null) return;
|
|
14600
|
+
let n = t[1].replace(/^(\d+)er\b/iu, "$1").replace(/[.·\s]/gu, "-").replace(/-{2,}/gu, "-").replace(/^-|-$/gu, "");
|
|
14601
|
+
return /^\d+(?:-\d+)*(?:-(?:bis|ter|quater|quinquies|septies))?$/iu.test(n) ? n : void 0;
|
|
14602
|
+
}
|
|
14603
|
+
function Yv(e, t, n) {
|
|
14598
14604
|
if (n.match(qe) === null) throw Error(`Unknown ID format: ${n}`);
|
|
14599
14605
|
switch (e) {
|
|
14600
14606
|
case "Exploratrice": return new URL(`legifrance/articles/${n}/versions`, t).toString();
|
|
@@ -14602,7 +14608,7 @@ function Jv(e, t, n) {
|
|
|
14602
14608
|
default: m("urlFromArticleVersionsId linkType", e);
|
|
14603
14609
|
}
|
|
14604
14610
|
}
|
|
14605
|
-
function
|
|
14611
|
+
function Xv(e, t, n) {
|
|
14606
14612
|
let r = n.match(qe);
|
|
14607
14613
|
if (r === null) throw Error(`Unknown ID format: ${n}`);
|
|
14608
14614
|
switch (e) {
|
|
@@ -14623,19 +14629,19 @@ function Yv(e, t, n) {
|
|
|
14623
14629
|
}
|
|
14624
14630
|
//#endregion
|
|
14625
14631
|
//#region src/lib/linkers/html.ts
|
|
14626
|
-
function
|
|
14632
|
+
function Zv(e, t) {
|
|
14627
14633
|
if (e !== void 0) return e;
|
|
14628
14634
|
if (t !== void 0) return new sv(t);
|
|
14629
14635
|
throw Error("A Canutes database or legal resolver is required");
|
|
14630
14636
|
}
|
|
14631
|
-
function
|
|
14637
|
+
function Qv(e, t) {
|
|
14632
14638
|
return t.type === "reference_et_action" ? JSON.stringify({
|
|
14633
14639
|
...e,
|
|
14634
14640
|
action: t.action
|
|
14635
14641
|
}) : JSON.stringify(e);
|
|
14636
14642
|
}
|
|
14637
|
-
async function
|
|
14638
|
-
let f = new Ee("addLinksToHtml"), p =
|
|
14643
|
+
async function $v({ canutesDb: e, legiResolver: t, date: n, html: r, linkBaseUrl: i, linkType: a, logIgnoredReferencesTypes: o, logPartialReferences: s, logReferences: c, onLink: l, previousContext: u, state: d }) {
|
|
14644
|
+
let f = new Ee("addLinksToHtml"), p = Zv(t, e);
|
|
14639
14645
|
await f.time("preloadTextTitlesInfos", () => p.preloadTextTitlesInfos());
|
|
14640
14646
|
let h = f.timeSync("simplifyHtml", () => v({ removeAWithHref: !0 })(r), {
|
|
14641
14647
|
inputSize: r.length,
|
|
@@ -14657,7 +14663,7 @@ async function Qv({ canutesDb: e, legiResolver: t, date: n, html: r, linkBaseUrl
|
|
|
14657
14663
|
case "article_definition": {
|
|
14658
14664
|
let { article: t, originalTransformation: n, textId: i } = e;
|
|
14659
14665
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(e, null, 2)}`);
|
|
14660
|
-
|
|
14666
|
+
ty({
|
|
14661
14667
|
inputHtml: r,
|
|
14662
14668
|
originalTransformation: n,
|
|
14663
14669
|
output: { replacements: _ },
|
|
@@ -14670,10 +14676,10 @@ async function Qv({ canutesDb: e, legiResolver: t, date: n, html: r, linkBaseUrl
|
|
|
14670
14676
|
let { articleId: t, historyArticleId: n, originalTransformation: o } = e;
|
|
14671
14677
|
if (t === void 0 && n === void 0) break;
|
|
14672
14678
|
if (o === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
14673
|
-
let s = t === void 0 ?
|
|
14679
|
+
let s = t === void 0 ? Yv(a, i, n) : Xv(a, i, t);
|
|
14674
14680
|
if (s === void 0) break;
|
|
14675
14681
|
let c = t === void 0 ? `class="lien_article_historique" href="${s}" title="Versions de l'article"` : `class="lien_article_externe" href="${s}"`;
|
|
14676
|
-
|
|
14682
|
+
ty({
|
|
14677
14683
|
inputHtml: r,
|
|
14678
14684
|
originalTransformation: o,
|
|
14679
14685
|
output: { replacements: _ },
|
|
@@ -14686,29 +14692,56 @@ async function Qv({ canutesDb: e, legiResolver: t, date: n, html: r, linkBaseUrl
|
|
|
14686
14692
|
let { originalTransformation: t, sectionTaId: n } = e;
|
|
14687
14693
|
if (n !== void 0) {
|
|
14688
14694
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
14689
|
-
|
|
14695
|
+
ty({
|
|
14690
14696
|
inputHtml: r,
|
|
14691
14697
|
originalTransformation: t,
|
|
14692
14698
|
output: { replacements: _ },
|
|
14693
14699
|
replacementCounter: y,
|
|
14694
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_division_externe" href="${
|
|
14700
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_division_externe" href="${Xv(a, i, n)}">${e}</a>`
|
|
14695
14701
|
});
|
|
14696
14702
|
}
|
|
14697
14703
|
break;
|
|
14698
14704
|
}
|
|
14699
14705
|
case "external_text": {
|
|
14700
|
-
let { originalTransformation: t, text:
|
|
14701
|
-
if (
|
|
14702
|
-
|
|
14706
|
+
let { originalTransformation: t, text: o } = e;
|
|
14707
|
+
if (o.cid === void 0) {
|
|
14708
|
+
o.relative !== 0 && s && console.error(`Link to text "${g.text(o.position)}" without CID: ${JSON.stringify(o, null, 2)}`);
|
|
14703
14709
|
continue;
|
|
14704
14710
|
}
|
|
14705
14711
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
14706
|
-
|
|
14712
|
+
let c = Jv(g.text(o.position)), l, u;
|
|
14713
|
+
if (c !== void 0) {
|
|
14714
|
+
let e = await p.getActiveArticlesByTextAndNum({
|
|
14715
|
+
date: n,
|
|
14716
|
+
num: c,
|
|
14717
|
+
textId: o.cid
|
|
14718
|
+
}), t = e.filter(({ dateDebut: e, dateFin: t }) => e <= n && t > n);
|
|
14719
|
+
if (t.length === 1) l = t[0].id;
|
|
14720
|
+
else if (e.length > 0) {
|
|
14721
|
+
let e = await p.getArticleHistoryInfo({
|
|
14722
|
+
num: c,
|
|
14723
|
+
textId: o.cid
|
|
14724
|
+
});
|
|
14725
|
+
e !== void 0 && (u = e.articleId);
|
|
14726
|
+
}
|
|
14727
|
+
}
|
|
14728
|
+
if (l === void 0 && u === void 0) {
|
|
14729
|
+
ty({
|
|
14730
|
+
inputHtml: r,
|
|
14731
|
+
originalTransformation: t,
|
|
14732
|
+
output: { replacements: _ },
|
|
14733
|
+
replacementCounter: y,
|
|
14734
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_texte_externe" href="${Xv(a, i, o.cid)}">${e}</a>`
|
|
14735
|
+
});
|
|
14736
|
+
break;
|
|
14737
|
+
}
|
|
14738
|
+
let d = l ?? u, f = l === void 0 ? `class="lien_article_historique" href="${Yv(a, i, d)}" title="Versions de l'article"` : `class="lien_article_externe" href="${Xv(a, i, d)}"`;
|
|
14739
|
+
ty({
|
|
14707
14740
|
inputHtml: r,
|
|
14708
14741
|
originalTransformation: t,
|
|
14709
14742
|
output: { replacements: _ },
|
|
14710
14743
|
replacementCounter: y,
|
|
14711
|
-
tagHtmlFromOriginal: (e) => `<a
|
|
14744
|
+
tagHtmlFromOriginal: (e) => `<a ${f}>${e}</a>`
|
|
14712
14745
|
});
|
|
14713
14746
|
break;
|
|
14714
14747
|
}
|
|
@@ -14716,7 +14749,7 @@ async function Qv({ canutesDb: e, legiResolver: t, date: n, html: r, linkBaseUrl
|
|
|
14716
14749
|
let { url: t, originalTransformation: n } = e;
|
|
14717
14750
|
if (t === void 0) continue;
|
|
14718
14751
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in european text link: ${JSON.stringify(e, null, 2)}`);
|
|
14719
|
-
|
|
14752
|
+
ty({
|
|
14720
14753
|
inputHtml: r,
|
|
14721
14754
|
originalTransformation: n,
|
|
14722
14755
|
output: { replacements: _ },
|
|
@@ -14728,7 +14761,7 @@ async function Qv({ canutesDb: e, legiResolver: t, date: n, html: r, linkBaseUrl
|
|
|
14728
14761
|
case "internal_article": {
|
|
14729
14762
|
let { definition: t, originalTransformation: n } = e;
|
|
14730
14763
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
14731
|
-
|
|
14764
|
+
ty({
|
|
14732
14765
|
inputHtml: r,
|
|
14733
14766
|
originalTransformation: n,
|
|
14734
14767
|
output: { replacements: _ },
|
|
@@ -14740,7 +14773,7 @@ async function Qv({ canutesDb: e, legiResolver: t, date: n, html: r, linkBaseUrl
|
|
|
14740
14773
|
default: m("Link", e);
|
|
14741
14774
|
}
|
|
14742
14775
|
}, { count: b + 1 });
|
|
14743
|
-
let ee = f.timeSync("applyHtmlReplacements", () =>
|
|
14776
|
+
let ee = f.timeSync("applyHtmlReplacements", () => ey(r, _), {
|
|
14744
14777
|
count: _.length,
|
|
14745
14778
|
inputSize: r.length
|
|
14746
14779
|
});
|
|
@@ -14752,13 +14785,13 @@ async function Qv({ canutesDb: e, legiResolver: t, date: n, html: r, linkBaseUrl
|
|
|
14752
14785
|
output: _.length === 0 ? null : ee
|
|
14753
14786
|
};
|
|
14754
14787
|
}
|
|
14755
|
-
function
|
|
14788
|
+
function ey(e, t) {
|
|
14756
14789
|
if (t.length === 0) return e;
|
|
14757
14790
|
let n = [], r = 0;
|
|
14758
14791
|
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);
|
|
14759
14792
|
return n.push(e.slice(r)), n.join("");
|
|
14760
14793
|
}
|
|
14761
|
-
function
|
|
14794
|
+
function ty({ inputHtml: e, originalTransformation: t, output: n, replacementCounter: r, tagHtmlFromOriginal: i }) {
|
|
14762
14795
|
let a = te(t, i(p(e, t, 0) ?? ""));
|
|
14763
14796
|
n.replacements.push({
|
|
14764
14797
|
order: r.value++,
|
|
@@ -14767,11 +14800,11 @@ function ey({ inputHtml: e, originalTransformation: t, output: n, replacementCou
|
|
|
14767
14800
|
stop: t.position.stop
|
|
14768
14801
|
});
|
|
14769
14802
|
}
|
|
14770
|
-
function
|
|
14803
|
+
function ny({ attributes: e, inputHtml: t, originalTransformation: n, outputByType: r, replacementCounter: i }) {
|
|
14771
14804
|
let a = Object.entries(e).map(([e, t]) => `${e}="${tt(t, !0)}"`).join(" ");
|
|
14772
14805
|
for (let e of ["links", "links_or_references"]) {
|
|
14773
14806
|
let o = r[e];
|
|
14774
|
-
o !== void 0 &&
|
|
14807
|
+
o !== void 0 && ty({
|
|
14775
14808
|
inputHtml: t,
|
|
14776
14809
|
originalTransformation: n,
|
|
14777
14810
|
output: o,
|
|
@@ -14780,11 +14813,11 @@ function ty({ attributes: e, inputHtml: t, originalTransformation: n, outputByTy
|
|
|
14780
14813
|
});
|
|
14781
14814
|
}
|
|
14782
14815
|
}
|
|
14783
|
-
function
|
|
14816
|
+
function ry({ id: e, outputByType: t }) {
|
|
14784
14817
|
return t.references !== void 0 || e === void 0 && t.links_or_references !== void 0;
|
|
14785
14818
|
}
|
|
14786
|
-
async function
|
|
14787
|
-
let p =
|
|
14819
|
+
async function iy({ canutesDb: e, legiResolver: t, date: n, defaultTextId: r, htmlTransformation: i, inputHtml: a, linkBaseUrl: o, linkType: s, logIgnoredReferencesTypes: c, logPartialReferences: l, logReferences: u, outputTypes: d, referredLegifranceTextsInfos: f }) {
|
|
14820
|
+
let p = Zv(t, e);
|
|
14788
14821
|
await p.preloadTextTitlesInfos();
|
|
14789
14822
|
let h = new x(i.output), g = {}, _ = {};
|
|
14790
14823
|
for (let e of d) _[e] = {
|
|
@@ -14806,7 +14839,7 @@ async function ry({ canutesDb: e, legiResolver: t, date: n, defaultTextId: r, ht
|
|
|
14806
14839
|
case "article_definition": {
|
|
14807
14840
|
let { article: t, originalTransformation: n, textId: r } = e;
|
|
14808
14841
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(e, null, 2)}`);
|
|
14809
|
-
for (let e of Object.values(_))
|
|
14842
|
+
for (let e of Object.values(_)) ty({
|
|
14810
14843
|
inputHtml: a,
|
|
14811
14844
|
originalTransformation: n,
|
|
14812
14845
|
output: e,
|
|
@@ -14819,10 +14852,10 @@ async function ry({ canutesDb: e, legiResolver: t, date: n, defaultTextId: r, ht
|
|
|
14819
14852
|
let { article: t, articleId: n, historyArticleId: r, originalTransformation: i } = e;
|
|
14820
14853
|
if (i === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
14821
14854
|
if (n !== void 0) {
|
|
14822
|
-
if (
|
|
14855
|
+
if (ny({
|
|
14823
14856
|
attributes: {
|
|
14824
14857
|
class: "lien_article_externe",
|
|
14825
|
-
href:
|
|
14858
|
+
href: Xv(s, o, n)
|
|
14826
14859
|
},
|
|
14827
14860
|
inputHtml: a,
|
|
14828
14861
|
originalTransformation: i,
|
|
@@ -14833,8 +14866,8 @@ async function ry({ canutesDb: e, legiResolver: t, date: n, defaultTextId: r, ht
|
|
|
14833
14866
|
e != null && (g[e] = (g[e] ?? 0) + 1);
|
|
14834
14867
|
}
|
|
14835
14868
|
} else if (r !== void 0) {
|
|
14836
|
-
let e =
|
|
14837
|
-
e !== void 0 &&
|
|
14869
|
+
let e = Yv(s, o, r);
|
|
14870
|
+
e !== void 0 && ny({
|
|
14838
14871
|
attributes: {
|
|
14839
14872
|
class: "lien_article_historique",
|
|
14840
14873
|
href: e,
|
|
@@ -14846,14 +14879,14 @@ async function ry({ canutesDb: e, legiResolver: t, date: n, defaultTextId: r, ht
|
|
|
14846
14879
|
replacementCounter: v
|
|
14847
14880
|
});
|
|
14848
14881
|
}
|
|
14849
|
-
|
|
14882
|
+
ry({
|
|
14850
14883
|
id: n,
|
|
14851
14884
|
outputByType: _
|
|
14852
|
-
}) &&
|
|
14885
|
+
}) && ay({
|
|
14853
14886
|
attributes: {
|
|
14854
14887
|
class: "reference_article",
|
|
14855
14888
|
style: "background-color: #eae462",
|
|
14856
|
-
title:
|
|
14889
|
+
title: Qv(t, e.reference)
|
|
14857
14890
|
},
|
|
14858
14891
|
id: n,
|
|
14859
14892
|
inputHtml: a,
|
|
@@ -14866,10 +14899,10 @@ async function ry({ canutesDb: e, legiResolver: t, date: n, defaultTextId: r, ht
|
|
|
14866
14899
|
case "external_division": {
|
|
14867
14900
|
let { division: t, originalTransformation: n, sectionTaId: r } = e;
|
|
14868
14901
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
14869
|
-
if (r !== void 0 && (
|
|
14902
|
+
if (r !== void 0 && (ny({
|
|
14870
14903
|
attributes: {
|
|
14871
14904
|
class: "lien_division_externe",
|
|
14872
|
-
href:
|
|
14905
|
+
href: Xv(s, o, r)
|
|
14873
14906
|
},
|
|
14874
14907
|
inputHtml: a,
|
|
14875
14908
|
originalTransformation: n,
|
|
@@ -14879,14 +14912,14 @@ async function ry({ canutesDb: e, legiResolver: t, date: n, defaultTextId: r, ht
|
|
|
14879
14912
|
let e = await p.getTextIdFromSegmentId(r);
|
|
14880
14913
|
e != null && (g[e] = (g[e] ?? 0) + 1);
|
|
14881
14914
|
}
|
|
14882
|
-
|
|
14915
|
+
ry({
|
|
14883
14916
|
id: r,
|
|
14884
14917
|
outputByType: _
|
|
14885
|
-
}) &&
|
|
14918
|
+
}) && ay({
|
|
14886
14919
|
attributes: {
|
|
14887
14920
|
class: "reference_division",
|
|
14888
14921
|
style: "background-color: #eae462",
|
|
14889
|
-
title:
|
|
14922
|
+
title: Qv(t, e.reference)
|
|
14890
14923
|
},
|
|
14891
14924
|
id: r,
|
|
14892
14925
|
inputHtml: a,
|
|
@@ -14899,7 +14932,7 @@ async function ry({ canutesDb: e, legiResolver: t, date: n, defaultTextId: r, ht
|
|
|
14899
14932
|
case "european_text": {
|
|
14900
14933
|
let { url: t, originalTransformation: n, text: r, titleId: i } = e;
|
|
14901
14934
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
14902
|
-
|
|
14935
|
+
ny({
|
|
14903
14936
|
attributes: {
|
|
14904
14937
|
class: "lien_texte_european",
|
|
14905
14938
|
href: t,
|
|
@@ -14909,14 +14942,14 @@ async function ry({ canutesDb: e, legiResolver: t, date: n, defaultTextId: r, ht
|
|
|
14909
14942
|
originalTransformation: n,
|
|
14910
14943
|
outputByType: _,
|
|
14911
14944
|
replacementCounter: v
|
|
14912
|
-
}),
|
|
14945
|
+
}), ry({
|
|
14913
14946
|
id: i,
|
|
14914
14947
|
outputByType: _
|
|
14915
|
-
}) &&
|
|
14948
|
+
}) && ay({
|
|
14916
14949
|
attributes: {
|
|
14917
14950
|
class: "reference_texte",
|
|
14918
14951
|
style: "background-color: #eae462",
|
|
14919
|
-
title:
|
|
14952
|
+
title: Qv(r, e.reference)
|
|
14920
14953
|
},
|
|
14921
14954
|
id: i,
|
|
14922
14955
|
inputHtml: a,
|
|
@@ -14927,27 +14960,54 @@ async function ry({ canutesDb: e, legiResolver: t, date: n, defaultTextId: r, ht
|
|
|
14927
14960
|
break;
|
|
14928
14961
|
}
|
|
14929
14962
|
case "external_text": {
|
|
14930
|
-
let { originalTransformation: t, text:
|
|
14963
|
+
let { originalTransformation: t, text: r } = e;
|
|
14931
14964
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
14932
|
-
|
|
14933
|
-
|
|
14934
|
-
|
|
14935
|
-
|
|
14936
|
-
|
|
14937
|
-
|
|
14938
|
-
|
|
14939
|
-
|
|
14940
|
-
|
|
14941
|
-
|
|
14942
|
-
|
|
14965
|
+
if (r.cid === void 0) !r.present && l && console.error(`Link to text "${h.text(r.position)}" without CID: ${JSON.stringify(r, null, 2)}`);
|
|
14966
|
+
else {
|
|
14967
|
+
let e = Jv(h.text(r.position)), i;
|
|
14968
|
+
if (e !== void 0) {
|
|
14969
|
+
let t = await p.getActiveArticlesByTextAndNum({
|
|
14970
|
+
date: n,
|
|
14971
|
+
num: e,
|
|
14972
|
+
textId: r.cid
|
|
14973
|
+
}), a = t.filter(({ dateDebut: e, dateFin: t }) => e <= n && t > n);
|
|
14974
|
+
if (a.length === 1) i = {
|
|
14975
|
+
class: "lien_article_externe",
|
|
14976
|
+
href: Xv(s, o, a[0].id)
|
|
14977
|
+
};
|
|
14978
|
+
else if (t.length > 0) {
|
|
14979
|
+
let t = await p.getArticleHistoryInfo({
|
|
14980
|
+
num: e,
|
|
14981
|
+
textId: r.cid
|
|
14982
|
+
}), n = t === void 0 ? void 0 : Yv(s, o, t.articleId);
|
|
14983
|
+
n !== void 0 && (i = {
|
|
14984
|
+
class: "lien_article_historique",
|
|
14985
|
+
href: n,
|
|
14986
|
+
title: "Versions de l'article"
|
|
14987
|
+
});
|
|
14988
|
+
}
|
|
14989
|
+
}
|
|
14990
|
+
ny({
|
|
14991
|
+
attributes: i ?? {
|
|
14992
|
+
class: "lien_texte_externe",
|
|
14993
|
+
href: Xv(s, o, r.cid)
|
|
14994
|
+
},
|
|
14995
|
+
inputHtml: a,
|
|
14996
|
+
originalTransformation: t,
|
|
14997
|
+
outputByType: _,
|
|
14998
|
+
replacementCounter: v
|
|
14999
|
+
}), i === void 0 && f && (g[r.cid] = (g[r.cid] ?? 0) + 1);
|
|
15000
|
+
}
|
|
15001
|
+
ry({
|
|
15002
|
+
id: r.cid,
|
|
14943
15003
|
outputByType: _
|
|
14944
|
-
}) &&
|
|
15004
|
+
}) && ay({
|
|
14945
15005
|
attributes: {
|
|
14946
15006
|
class: "reference_texte",
|
|
14947
15007
|
style: "background-color: #eae462",
|
|
14948
|
-
title:
|
|
15008
|
+
title: Qv(r, e.reference)
|
|
14949
15009
|
},
|
|
14950
|
-
id:
|
|
15010
|
+
id: r.cid,
|
|
14951
15011
|
inputHtml: a,
|
|
14952
15012
|
originalTransformation: t,
|
|
14953
15013
|
outputByType: _,
|
|
@@ -14958,7 +15018,7 @@ async function ry({ canutesDb: e, legiResolver: t, date: n, defaultTextId: r, ht
|
|
|
14958
15018
|
case "internal_article": {
|
|
14959
15019
|
let { definition: t, originalTransformation: n } = e;
|
|
14960
15020
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
14961
|
-
for (let e of Object.values(_))
|
|
15021
|
+
for (let e of Object.values(_)) ty({
|
|
14962
15022
|
inputHtml: a,
|
|
14963
15023
|
originalTransformation: n,
|
|
14964
15024
|
output: e,
|
|
@@ -14969,18 +15029,18 @@ async function ry({ canutesDb: e, legiResolver: t, date: n, defaultTextId: r, ht
|
|
|
14969
15029
|
}
|
|
14970
15030
|
default: m("Link", e);
|
|
14971
15031
|
}
|
|
14972
|
-
for (let e of Object.values(_)) e.html =
|
|
15032
|
+
for (let e of Object.values(_)) e.html = ey(a, e.replacements);
|
|
14973
15033
|
return {
|
|
14974
15034
|
outputByType: _,
|
|
14975
15035
|
referredLegifranceTextCountByCid: g
|
|
14976
15036
|
};
|
|
14977
15037
|
}
|
|
14978
|
-
function
|
|
15038
|
+
function ay({ attributes: e, id: t, inputHtml: n, originalTransformation: r, outputByType: i, replacementCounter: a }) {
|
|
14979
15039
|
let o = Object.entries(e).map(([e, t]) => `${e}="${tt(t, !0)}"`).join(" ");
|
|
14980
15040
|
for (let e of ["links_or_references", "references"]) {
|
|
14981
15041
|
if (e === "links_or_references" && t !== void 0) continue;
|
|
14982
15042
|
let s = i[e];
|
|
14983
|
-
s !== void 0 &&
|
|
15043
|
+
s !== void 0 && ty({
|
|
14984
15044
|
inputHtml: n,
|
|
14985
15045
|
originalTransformation: r,
|
|
14986
15046
|
output: s,
|
|
@@ -14990,4 +15050,4 @@ function iy({ attributes: e, id: t, inputHtml: n, originalTransformation: r, out
|
|
|
14990
15050
|
}
|
|
14991
15051
|
}
|
|
14992
15052
|
//#endregion
|
|
14993
|
-
export {
|
|
15053
|
+
export { Vp as $, nh as A, gt as At, Nm as B, ot as Bt, ag as C, Vt as Ct, ih as D, Bt as Dt, lh as E, zt as Et, th as F, nt as Ft, xm as G, ut as Gt, wm as H, ft as Ht, Wm as I, rt as It, Yp as J, mm as K, lt as Kt, Hm as L, st as Lt, Zm as M, E as Mt, $m as N, D as Nt, ah as O, kt as Ot, eh as P, St as Pt, Pp as Q, Um as R, it as Rt, sg as S, Xt as St, Gh as T, Ot as Tt, Sm as U, pt as Ut, jm as V, dt as Vt, Cm as W, ct as Wt, em as X, Xp as Y, Jp as Z, J_ as _, cn as _t, Yv as a, vn as at, dg as b, Jt as bt, Gv as c, Tn as ct, gv as d, pn as dt, Sp as et, Hv as f, dn as ft, tv as g, rn as gt, K_ as h, on as ht, qv as i, En as it, Xm as j, vt as jt, rh as k, ht as kt, Uv as l, mn as lt, fg as m, an as mt, $v as n, qp as nt, Xv as o, yn as ot, sv as p, nn as pt, Z as q, Jv as r, pp as rt, Wv as s, Sn as st, iy as t, Cp as tt, Kv as u, _n as ut, ev as v, $t as vt, Kh as w, Ht as wt, og as x, Yt as xt, q_ as y, Zt as yt, Fm as z, at as zt };
|