@tricoteuses/assemblee 2.5.21 → 2.5.23

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/lib/loaders.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import C from "node:assert";
2
2
  import n from "fs-extra";
3
- import s from "node:path";
3
+ import i from "node:path";
4
4
  import "node:crypto";
5
- import { L as r, a1 as U, a2 as M, a3 as q, a4 as Z, a5 as B, a6 as J, Y as G, $ as K, a0 as ee, X as te, Z as ie, _ as se } from "./uids-DaRrTkI-.js";
5
+ import { L as r, a1 as U, a2 as M, a3 as q, a4 as Z, a5 as B, a6 as J, Y, $ as G, a0 as K, X as ee, Z as te, _ as se } from "./uids-DaRrTkI-.js";
6
6
  import "glob";
7
7
  import { getChangedFilesSinceCommit as k } from "./git.js";
8
8
  import { C as N } from "./amendements-40Z7OJLT.js";
9
- var I = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ActeursEtOrganes = 1] = "ActeursEtOrganes", t[t.Agendas = 2] = "Agendas", t[t.Amendements = 4] = "Amendements", t[t.DossiersLegislatifs = 8] = "DossiersLegislatifs", t[t.Photos = 16] = "Photos", t[t.Scrutins = 32] = "Scrutins", t[t.Questions = 64] = "Questions", t[t.ComptesRendusSeances = 128] = "ComptesRendusSeances", t[t.All = 255] = "All", t))(I || {});
10
- async function h(t, i) {
11
- const e = s.join(i, t.filename);
12
- await n.pathExists(e) && await n.remove(e), await n.pathExists(s.join(i, `${t.filename}.temp`, "json")) ? await n.move(
13
- s.join(i, `${t.filename}.temp`, "json"),
9
+ var v = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ActeursEtOrganes = 1] = "ActeursEtOrganes", t[t.Agendas = 2] = "Agendas", t[t.Amendements = 4] = "Amendements", t[t.DossiersLegislatifs = 8] = "DossiersLegislatifs", t[t.Photos = 16] = "Photos", t[t.Scrutins = 32] = "Scrutins", t[t.Questions = 64] = "Questions", t[t.ComptesRendusSeances = 128] = "ComptesRendusSeances", t[t.All = 255] = "All", t))(v || {});
10
+ async function h(t, s) {
11
+ const e = i.join(s, t.filename);
12
+ await n.pathExists(e) && await n.remove(e), await n.pathExists(i.join(s, `${t.filename}.temp`, "json")) ? await n.move(
13
+ i.join(s, `${t.filename}.temp`, "json"),
14
14
  e
15
15
  ) : await n.mkdir(e);
16
16
  }
17
- const A = {
17
+ const S = {
18
18
  acteursEtOrganes: [
19
19
  {
20
20
  // AMO10 (XVII)
@@ -280,16 +280,16 @@ const A = {
280
280
  filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVII.json",
281
281
  ignoreForWeb: !0,
282
282
  legislature: r.DixSept,
283
- repairZip: async (t, i) => {
284
- const e = s.join(i, t.filename);
283
+ repairZip: async (t, s) => {
284
+ const e = i.join(s, t.filename);
285
285
  await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.pathExists(
286
- s.join(i, `${t.filename}.temp`, "acteur")
286
+ i.join(s, `${t.filename}.temp`, "acteur")
287
287
  ) && await n.move(
288
- s.join(i, `${t.filename}.temp`, "acteur"),
289
- s.join(e, "acteur")
288
+ i.join(s, `${t.filename}.temp`, "acteur"),
289
+ i.join(e, "acteur")
290
290
  ), await n.move(
291
- s.join(i, `${t.filename}.temp`, "organe"),
292
- s.join(e, "organe")
291
+ i.join(s, `${t.filename}.temp`, "organe"),
292
+ i.join(e, "organe")
293
293
  );
294
294
  },
295
295
  structure: 1,
@@ -324,16 +324,16 @@ const A = {
324
324
  filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVI.json",
325
325
  ignoreForWeb: !0,
326
326
  legislature: r.Seize,
327
- repairZip: async (t, i) => {
328
- const e = s.join(i, t.filename);
327
+ repairZip: async (t, s) => {
328
+ const e = i.join(s, t.filename);
329
329
  await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.pathExists(
330
- s.join(i, `${t.filename}.temp`, "acteur")
330
+ i.join(s, `${t.filename}.temp`, "acteur")
331
331
  ) && await n.move(
332
- s.join(i, `${t.filename}.temp`, "acteur"),
333
- s.join(e, "acteur")
332
+ i.join(s, `${t.filename}.temp`, "acteur"),
333
+ i.join(e, "acteur")
334
334
  ), await n.move(
335
- s.join(i, `${t.filename}.temp`, "organe"),
336
- s.join(e, "organe")
335
+ i.join(s, `${t.filename}.temp`, "organe"),
336
+ i.join(e, "organe")
337
337
  );
338
338
  },
339
339
  structure: 1,
@@ -368,14 +368,14 @@ const A = {
368
368
  filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XV.json",
369
369
  ignoreForWeb: !0,
370
370
  legislature: r.Quinze,
371
- repairZip: async (t, i) => {
372
- const e = s.join(i, t.filename);
371
+ repairZip: async (t, s) => {
372
+ const e = i.join(s, t.filename);
373
373
  await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
374
- s.join(i, `${t.filename}.temp`, "acteur"),
375
- s.join(e, "acteur")
374
+ i.join(s, `${t.filename}.temp`, "acteur"),
375
+ i.join(e, "acteur")
376
376
  ), await n.move(
377
- s.join(i, `${t.filename}.temp`, "organe"),
378
- s.join(e, "organe")
377
+ i.join(s, `${t.filename}.temp`, "organe"),
378
+ i.join(e, "organe")
379
379
  );
380
380
  },
381
381
  structure: 1,
@@ -400,17 +400,17 @@ const A = {
400
400
  filename: "AMO50_acteurs_mandats_organes_divises_XVII.json",
401
401
  ignoreForWeb: !0,
402
402
  legislature: r.DixSept,
403
- repairZip: async (t, i) => {
404
- const e = s.join(i, t.filename);
403
+ repairZip: async (t, s) => {
404
+ const e = i.join(s, t.filename);
405
405
  await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
406
- s.join(i, `${t.filename}.temp`, "mandat"),
407
- s.join(e, "mandat")
406
+ i.join(s, `${t.filename}.temp`, "mandat"),
407
+ i.join(e, "mandat")
408
408
  ), await n.move(
409
- s.join(i, `${t.filename}.temp`, "acteur"),
410
- s.join(e, "acteur")
409
+ i.join(s, `${t.filename}.temp`, "acteur"),
410
+ i.join(e, "acteur")
411
411
  ), await n.move(
412
- s.join(i, `${t.filename}.temp`, "organe"),
413
- s.join(e, "organe")
412
+ i.join(s, `${t.filename}.temp`, "organe"),
413
+ i.join(e, "organe")
414
414
  );
415
415
  },
416
416
  structure: 1,
@@ -435,17 +435,17 @@ const A = {
435
435
  filename: "AMO50_acteurs_mandats_organes_divises_XVI.json",
436
436
  ignoreForWeb: !0,
437
437
  legislature: r.Seize,
438
- repairZip: async (t, i) => {
439
- const e = s.join(i, t.filename);
438
+ repairZip: async (t, s) => {
439
+ const e = i.join(s, t.filename);
440
440
  await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
441
- s.join(i, `${t.filename}.temp`, "mandat"),
442
- s.join(e, "mandat")
441
+ i.join(s, `${t.filename}.temp`, "mandat"),
442
+ i.join(e, "mandat")
443
443
  ), await n.move(
444
- s.join(i, `${t.filename}.temp`, "acteur"),
445
- s.join(e, "acteur")
444
+ i.join(s, `${t.filename}.temp`, "acteur"),
445
+ i.join(e, "acteur")
446
446
  ), await n.move(
447
- s.join(i, `${t.filename}.temp`, "organe"),
448
- s.join(e, "organe")
447
+ i.join(s, `${t.filename}.temp`, "organe"),
448
+ i.join(e, "organe")
449
449
  );
450
450
  },
451
451
  structure: 1,
@@ -470,17 +470,17 @@ const A = {
470
470
  filename: "AMO50_acteurs_mandats_organes_divises_XV.json",
471
471
  ignoreForWeb: !0,
472
472
  legislature: r.Quinze,
473
- repairZip: async (t, i) => {
474
- const e = s.join(i, t.filename);
473
+ repairZip: async (t, s) => {
474
+ const e = i.join(s, t.filename);
475
475
  await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
476
- s.join(i, `${t.filename}.temp`, "mandat"),
477
- s.join(e, "mandat")
476
+ i.join(s, `${t.filename}.temp`, "mandat"),
477
+ i.join(e, "mandat")
478
478
  ), await n.move(
479
- s.join(i, `${t.filename}.temp`, "acteur"),
480
- s.join(e, "acteur")
479
+ i.join(s, `${t.filename}.temp`, "acteur"),
480
+ i.join(e, "acteur")
481
481
  ), await n.move(
482
- s.join(i, `${t.filename}.temp`, "organe"),
483
- s.join(e, "organe")
482
+ i.join(s, `${t.filename}.temp`, "organe"),
483
+ i.join(e, "organe")
484
484
  );
485
485
  },
486
486
  structure: 1,
@@ -676,10 +676,10 @@ const A = {
676
676
  {
677
677
  filename: "Comptes_Rendus_Seances_XVII.xml",
678
678
  legislature: r.DixSept,
679
- repairZip: async (t, i) => {
680
- const e = s.join(i, t.filename);
679
+ repairZip: async (t, s) => {
680
+ const e = i.join(s, t.filename);
681
681
  await n.pathExists(e) && await n.remove(e), await n.move(
682
- s.join(i, `${t.filename}.temp`, "xml"),
682
+ i.join(s, `${t.filename}.temp`, "xml"),
683
683
  e
684
684
  );
685
685
  },
@@ -690,10 +690,10 @@ const A = {
690
690
  {
691
691
  filename: "Comptes_Rendus_Seances_XVI.xml",
692
692
  legislature: r.Seize,
693
- repairZip: async (t, i) => {
694
- const e = s.join(i, t.filename);
693
+ repairZip: async (t, s) => {
694
+ const e = i.join(s, t.filename);
695
695
  await n.pathExists(e) && await n.remove(e), await n.move(
696
- s.join(i, `${t.filename}.temp`, "xml"),
696
+ i.join(s, `${t.filename}.temp`, "xml"),
697
697
  e
698
698
  );
699
699
  },
@@ -703,14 +703,14 @@ const A = {
703
703
  }
704
704
  ]
705
705
  };
706
- function* P(t, i = []) {
707
- const e = s.join(t, ...i);
706
+ function* x(t, s = []) {
707
+ const e = i.join(t, ...s);
708
708
  if (n.existsSync(e))
709
709
  for (const a of n.readdirSync(e)) {
710
710
  if (a[0] === ".")
711
711
  continue;
712
- const u = s.join(e, a), d = [...i, a];
713
- n.statSync(u).isDirectory() ? yield* P(t, d) : yield d;
712
+ const f = i.join(e, a), d = [...s, a];
713
+ n.statSync(f).isDirectory() ? yield* x(t, d) : yield d;
714
714
  }
715
715
  }
716
716
  const Q = [
@@ -741,109 +741,106 @@ const Q = [
741
741
  1,
742
742
  "I"
743
743
  ];
744
- function ne(t) {
744
+ function ie(t) {
745
745
  if (t < 0)
746
746
  return;
747
747
  if (t === 0)
748
748
  return "0I";
749
- let i = "";
749
+ let s = "";
750
750
  for (let e = 0; e < Q.length; e += 2)
751
751
  for (; t >= Q[e]; )
752
- i += Q[e + 1], t -= Q[e];
753
- return i;
752
+ s += Q[e + 1], t -= Q[e];
753
+ return s;
754
754
  }
755
- function* O(t, i, e, a, u, d = "json", { enriched: l = !1, log: j = !1, noValidation: y = !1, sinceCommit: S } = {}) {
756
- const v = /* @__PURE__ */ new Set();
757
- for (const b of e) {
758
- if (b.ignoreForWeb || !oe(i, b))
755
+ function* z(t, s, e, a, f, d = "json", { log: c = !1, noValidation: _ = !1, sinceCommit: j } = {}) {
756
+ const F = /* @__PURE__ */ new Set();
757
+ for (const A of e) {
758
+ if (A.ignoreForWeb || !ne(s, A))
759
759
  continue;
760
- const x = new RegExp(`\\.${d}$`), D = s.join(
760
+ const D = new RegExp(`\\.${d}$`), I = i.join(
761
761
  t,
762
- b.filename.replace(
763
- x,
764
- l ? "_enrichi" : "_nettoye"
765
- )
766
- ), z = S ? k(D, S, {
762
+ A.filename.replace(D, "_nettoye")
763
+ ), L = j ? k(I, j, {
767
764
  diffFilter: "AMR"
768
765
  }) : null;
769
- j && S && (console.log(
770
- `Filtering files changed since commit ${S} in ${D}`
771
- ), console.log(`Found ${z?.size || 0} changed files`));
772
- for (const X of P(D, u)) {
766
+ c && j && (console.log(
767
+ `Filtering files changed since commit ${j} in ${I}`
768
+ ), console.log(`Found ${L?.size || 0} changed files`));
769
+ for (const X of x(I, f)) {
773
770
  if (!X[X.length - 1].endsWith(".json"))
774
771
  continue;
775
- const V = s.join(D, ...X), p = s.join(...X), o = z?.get(p);
776
- if (z && !o)
772
+ const b = i.join(I, ...X), V = i.join(...X), o = L?.get(V);
773
+ if (L && !o)
777
774
  continue;
778
- j && console.log(`Loading file: ${V}…`);
779
- let f = n.readFileSync(V, { encoding: "utf8" });
780
- const c = y ? JSON.parse(f) : a(f);
781
- v.has(c.uid) || (v.add(c.uid), yield {
782
- datasetLegislature: b.legislature,
783
- filePath: V,
784
- item: c,
775
+ c && console.log(`Loading file: ${b}…`);
776
+ let u = n.readFileSync(b, { encoding: "utf8" });
777
+ const m = _ ? JSON.parse(u) : a(u);
778
+ F.has(m.uid) || (F.add(m.uid), yield {
779
+ datasetLegislature: A.legislature,
780
+ filePath: b,
781
+ item: m,
785
782
  ...o && { gitStatus: o }
786
- }, f = null);
783
+ }, u = null);
787
784
  }
788
- if (S) {
785
+ if (j) {
789
786
  const X = k(
790
- D,
791
- S,
787
+ I,
788
+ j,
792
789
  {
793
790
  diffFilter: "D"
794
791
  }
795
792
  );
796
- for (const [$, V] of X.entries()) {
797
- const p = s.join(D, $);
798
- j && console.log(`Deleted file: ${p}`);
799
- const f = { uid: s.basename($, `.${d}`) };
793
+ for (const [P, b] of X.entries()) {
794
+ const V = i.join(I, P);
795
+ c && console.log(`Deleted file: ${V}`);
796
+ const u = { uid: i.basename(P, `.${d}`) };
800
797
  yield {
801
- datasetLegislature: b.legislature,
802
- filePath: p,
803
- item: f,
804
- gitStatus: V
798
+ datasetLegislature: A.legislature,
799
+ filePath: V,
800
+ item: u,
801
+ gitStatus: b
805
802
  };
806
803
  }
807
804
  }
808
805
  }
809
- v.clear();
806
+ F.clear();
810
807
  }
811
- function oe(t, i) {
808
+ function ne(t, s) {
812
809
  const e = Array.isArray(t) ? t : t !== void 0 ? [t] : [];
813
- return t === void 0 || e.includes(0) || i.legislature === r.All ? !0 : e.includes(i.legislature);
810
+ return t === void 0 || e.includes(0) || s.legislature === r.All ? !0 : e.includes(s.legislature);
814
811
  }
815
- function* ge(t, i, e = {}) {
812
+ function* pe(t, s, e = {}) {
816
813
  for (const {
817
814
  datasetLegislature: a,
818
- item: u,
815
+ item: f,
819
816
  filePath: d,
820
- gitStatus: l
821
- } of O(
817
+ gitStatus: c
818
+ } of z(
822
819
  t,
823
- i,
824
- A.acteursEtOrganes,
820
+ s,
821
+ S.acteursEtOrganes,
825
822
  U.toActeur,
826
823
  ["acteurs"],
827
824
  "json",
828
825
  e
829
826
  ))
830
827
  yield {
831
- acteur: u,
828
+ acteur: f,
832
829
  datasetLegislature: a,
833
830
  filePath: d,
834
- ...l && { gitStatus: l }
831
+ ...c && { gitStatus: c }
835
832
  };
836
833
  }
837
- function* _e(t, i, e = {}) {
834
+ function* ge(t, s, e = {}) {
838
835
  for (const {
839
836
  item: a,
840
- datasetLegislature: u,
837
+ datasetLegislature: f,
841
838
  filePath: d,
842
- gitStatus: l
843
- } of O(
839
+ gitStatus: c
840
+ } of z(
844
841
  t,
845
- i,
846
- A.acteursEtOrganes,
842
+ s,
843
+ S.acteursEtOrganes,
847
844
  U.toOrgane,
848
845
  ["organes"],
849
846
  "json",
@@ -851,43 +848,43 @@ function* _e(t, i, e = {}) {
851
848
  ))
852
849
  yield {
853
850
  organe: a,
854
- datasetLegislature: u,
851
+ datasetLegislature: f,
855
852
  filePath: d,
856
- ...l && { gitStatus: l }
853
+ ...c && { gitStatus: c }
857
854
  };
858
855
  }
859
- function* je(t, i, e = {}) {
856
+ function* _e(t, s, e = {}) {
860
857
  for (const {
861
858
  datasetLegislature: a,
862
- item: u,
859
+ item: f,
863
860
  filePath: d,
864
- gitStatus: l
865
- } of O(
861
+ gitStatus: c
862
+ } of z(
866
863
  t,
867
- i,
868
- A.amendements,
864
+ s,
865
+ S.amendements,
869
866
  N.toAmendement,
870
867
  [],
871
868
  "json",
872
869
  e
873
870
  ))
874
871
  yield {
875
- amendement: u,
872
+ amendement: f,
876
873
  datasetLegislature: a,
877
874
  filePath: d,
878
- ...l && { gitStatus: l }
875
+ ...c && { gitStatus: c }
879
876
  };
880
877
  }
881
- function* he(t, i, e = {}) {
878
+ function* je(t, s, e = {}) {
882
879
  for (const {
883
880
  item: a,
884
- datasetLegislature: u,
881
+ datasetLegislature: f,
885
882
  filePath: d,
886
- gitStatus: l
887
- } of O(
883
+ gitStatus: c
884
+ } of z(
888
885
  t,
889
- i,
890
- A.dossiersLegislatifs,
886
+ s,
887
+ S.dossiersLegislatifs,
891
888
  q.toDocument,
892
889
  ["documents"],
893
890
  "json",
@@ -895,21 +892,21 @@ function* he(t, i, e = {}) {
895
892
  ))
896
893
  yield {
897
894
  document: a,
898
- datasetLegislature: u,
895
+ datasetLegislature: f,
899
896
  filePath: d,
900
- ...l && { gitStatus: l }
897
+ ...c && { gitStatus: c }
901
898
  };
902
899
  }
903
- function* ye(t, i, e = {}) {
900
+ function* he(t, s, e = {}) {
904
901
  for (const {
905
902
  item: a,
906
- datasetLegislature: u,
903
+ datasetLegislature: f,
907
904
  filePath: d,
908
- gitStatus: l
909
- } of O(
905
+ gitStatus: c
906
+ } of z(
910
907
  t,
911
- i,
912
- A.dossiersLegislatifs,
908
+ s,
909
+ S.dossiersLegislatifs,
913
910
  q.toDossierParlementaire,
914
911
  ["dossiers"],
915
912
  "json",
@@ -917,21 +914,21 @@ function* ye(t, i, e = {}) {
917
914
  ))
918
915
  yield {
919
916
  dossierParlementaire: a,
920
- datasetLegislature: u,
917
+ datasetLegislature: f,
921
918
  filePath: d,
922
- ...l && { gitStatus: l }
919
+ ...c && { gitStatus: c }
923
920
  };
924
921
  }
925
- function* Se(t, i, e = {}) {
922
+ function* ye(t, s, e = {}) {
926
923
  for (const {
927
924
  item: a,
928
- datasetLegislature: u,
925
+ datasetLegislature: f,
929
926
  filePath: d,
930
- gitStatus: l
931
- } of O(
927
+ gitStatus: c
928
+ } of z(
932
929
  t,
933
- i,
934
- A.agendas,
930
+ s,
931
+ S.agendas,
935
932
  M.toReunion,
936
933
  [],
937
934
  "json",
@@ -939,21 +936,21 @@ function* Se(t, i, e = {}) {
939
936
  ))
940
937
  yield {
941
938
  reunion: a,
942
- datasetLegislature: u,
939
+ datasetLegislature: f,
943
940
  filePath: d,
944
- ...l && { gitStatus: l }
941
+ ...c && { gitStatus: c }
945
942
  };
946
943
  }
947
- function* Ae(t, i, e = {}) {
944
+ function* Se(t, s, e = {}) {
948
945
  for (const {
949
946
  item: a,
950
- datasetLegislature: u,
947
+ datasetLegislature: f,
951
948
  filePath: d,
952
- gitStatus: l
953
- } of O(
949
+ gitStatus: c
950
+ } of z(
954
951
  t,
955
- i,
956
- A.scrutins,
952
+ s,
953
+ S.scrutins,
957
954
  Z.toScrutin,
958
955
  [],
959
956
  "json",
@@ -961,21 +958,21 @@ function* Ae(t, i, e = {}) {
961
958
  ))
962
959
  yield {
963
960
  scrutin: a,
964
- datasetLegislature: u,
961
+ datasetLegislature: f,
965
962
  filePath: d,
966
- ...l && { gitStatus: l }
963
+ ...c && { gitStatus: c }
967
964
  };
968
965
  }
969
- function* Fe(t, i, e = {}) {
966
+ function* Ae(t, s, e = {}) {
970
967
  for (const {
971
968
  item: a,
972
- datasetLegislature: u,
969
+ datasetLegislature: f,
973
970
  filePath: d,
974
- gitStatus: l
975
- } of O(
971
+ gitStatus: c
972
+ } of z(
976
973
  t,
977
- i,
978
- A.questions,
974
+ s,
975
+ S.questions,
979
976
  B.toQuestion,
980
977
  [],
981
978
  "json",
@@ -983,21 +980,21 @@ function* Fe(t, i, e = {}) {
983
980
  ))
984
981
  yield {
985
982
  question: a,
986
- datasetLegislature: u,
983
+ datasetLegislature: f,
987
984
  filePath: d,
988
- ...l && { gitStatus: l }
985
+ ...c && { gitStatus: c }
989
986
  };
990
987
  }
991
- function* ve(t, i, e = {}) {
988
+ function* Fe(t, s, e = {}) {
992
989
  for (const {
993
990
  item: a,
994
- datasetLegislature: u,
991
+ datasetLegislature: f,
995
992
  filePath: d,
996
- gitStatus: l
997
- } of O(
993
+ gitStatus: c
994
+ } of z(
998
995
  t,
999
- i,
1000
- A.comptesRendusSeances,
996
+ s,
997
+ S.comptesRendusSeances,
1001
998
  J.toCompteRendu,
1002
999
  [],
1003
1000
  "xml",
@@ -1005,548 +1002,548 @@ function* ve(t, i, e = {}) {
1005
1002
  ))
1006
1003
  yield {
1007
1004
  compteRendu: a,
1008
- datasetLegislature: u,
1005
+ datasetLegislature: f,
1009
1006
  filePath: d,
1010
- ...l && { gitStatus: l }
1007
+ ...c && { gitStatus: c }
1011
1008
  };
1012
1009
  }
1013
- function* Ie(t, i, { enriched: e = !1 } = {}) {
1014
- const a = `Comptes_Rendus_Commissions_${ne(i)}${e ? "_enrichi" : "_nettoye"}`, u = s.join(t, a);
1015
- if (n.existsSync(u))
1016
- for (const d of T(u))
1010
+ function* ve(t, s, {} = {}) {
1011
+ const e = `Comptes_Rendus_Commissions_${ie(s)}_nettoye`, a = i.join(t, e);
1012
+ if (n.existsSync(a))
1013
+ for (const f of T(a))
1017
1014
  try {
1018
- const l = n.readFileSync(d, "utf-8");
1015
+ const d = n.readFileSync(f, "utf-8");
1019
1016
  yield {
1020
- compteRendu: JSON.parse(l),
1021
- datasetLegislature: i,
1022
- filePath: d
1017
+ compteRendu: JSON.parse(d),
1018
+ datasetLegislature: s,
1019
+ filePath: f
1023
1020
  };
1024
- } catch (l) {
1025
- console.warn(`Erreur lors de la lecture du fichier ${d} :`, l);
1021
+ } catch (d) {
1022
+ console.warn(`Erreur lors de la lecture du fichier ${f} :`, d);
1026
1023
  }
1027
1024
  }
1028
1025
  function* T(t) {
1029
1026
  if (n.existsSync(t))
1030
- for (const i of n.readdirSync(t, { withFileTypes: !0 })) {
1031
- const e = s.join(t, i.name);
1032
- i.isDirectory() ? yield* T(e) : i.isFile() && e.endsWith(".json") && (yield e);
1027
+ for (const s of n.readdirSync(t, { withFileTypes: !0 })) {
1028
+ const e = i.join(t, s.name);
1029
+ s.isDirectory() ? yield* T(e) : s.isFile() && e.endsWith(".json") && (yield e);
1033
1030
  }
1034
1031
  }
1035
- function be(t, i, e, { enriched: a = !1, log: u = !1 } = {}) {
1036
- const d = {}, l = {};
1037
- if (i & I.ActeursEtOrganes)
1038
- for (const o of A.acteursEtOrganes) {
1032
+ function Ie(t, s, e, { log: a = !1 } = {}) {
1033
+ const f = {}, d = {};
1034
+ if (s & v.ActeursEtOrganes)
1035
+ for (const o of S.acteursEtOrganes) {
1039
1036
  if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1040
1037
  continue;
1041
- const f = s.join(
1038
+ const u = i.join(
1042
1039
  t,
1043
- o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1040
+ o.filename.replace(/\.json$/, "_nettoye")
1044
1041
  );
1045
- for (const c of P(f, ["acteurs"])) {
1046
- if (!c[c.length - 1].endsWith(".json"))
1042
+ for (const m of x(u, ["acteurs"])) {
1043
+ if (!m[m.length - 1].endsWith(".json"))
1047
1044
  continue;
1048
- const _ = s.join(f, ...c);
1049
- u && console.log(`Loading file: ${_}…`);
1050
- const F = n.readFileSync(_, {
1045
+ const l = i.join(u, ...m);
1046
+ a && console.log(`Loading file: ${l}…`);
1047
+ const g = n.readFileSync(l, {
1051
1048
  encoding: "utf8"
1052
- }), g = U.toActeur(F);
1053
- d[g.uid] === void 0 && (d[g.uid] = g);
1049
+ }), p = U.toActeur(g);
1050
+ f[p.uid] === void 0 && (f[p.uid] = p);
1054
1051
  }
1055
- for (const c of P(f, ["organes"])) {
1056
- if (!c[c.length - 1].endsWith(".json"))
1052
+ for (const m of x(u, ["organes"])) {
1053
+ if (!m[m.length - 1].endsWith(".json"))
1057
1054
  continue;
1058
- const _ = s.join(f, ...c);
1059
- u && console.log(`Loading file: ${_}…`);
1060
- const F = n.readFileSync(_, {
1055
+ const l = i.join(u, ...m);
1056
+ a && console.log(`Loading file: ${l}…`);
1057
+ const g = n.readFileSync(l, {
1061
1058
  encoding: "utf8"
1062
- }), g = U.toOrgane(F);
1063
- l[g.uid] === void 0 && (l[g.uid] = g);
1059
+ }), p = U.toOrgane(g);
1060
+ d[p.uid] === void 0 && (d[p.uid] = p);
1064
1061
  }
1065
1062
  }
1066
- const j = {}, y = {}, S = {};
1067
- if (i & I.Agendas)
1068
- for (const o of A.agendas) {
1063
+ const c = {}, _ = {}, j = {};
1064
+ if (s & v.Agendas)
1065
+ for (const o of S.agendas) {
1069
1066
  if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1070
1067
  continue;
1071
- const f = s.join(
1068
+ const u = i.join(
1072
1069
  t,
1073
- o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1070
+ o.filename.replace(/\.json$/, "_nettoye")
1074
1071
  );
1075
- for (const c of P(f)) {
1076
- if (!c[c.length - 1].endsWith(".json"))
1072
+ for (const m of x(u)) {
1073
+ if (!m[m.length - 1].endsWith(".json"))
1077
1074
  continue;
1078
- const _ = s.join(f, ...c);
1079
- u && console.log(`Loading file: ${_}…`);
1080
- const F = n.readFileSync(_, {
1075
+ const l = i.join(u, ...m);
1076
+ a && console.log(`Loading file: ${l}…`);
1077
+ const g = n.readFileSync(l, {
1081
1078
  encoding: "utf8"
1082
- }), g = M.toReunion(F);
1083
- j[g.uid] === void 0 && (j[g.uid] = g);
1084
- const L = g.timestampDebut.toISOString().split("T")[0];
1085
- let w = y[L];
1086
- w === void 0 && (w = y[L] = []), w.push(g);
1087
- const R = g.odj;
1088
- if (R !== void 0)
1089
- for (const Y of R.pointsOdj || [])
1090
- for (const E of Y.dossiersLegislatifsRefs || []) {
1091
- let W = S[E];
1092
- W === void 0 && (W = S[E] = []), W.push(g);
1079
+ }), p = M.toReunion(g);
1080
+ c[p.uid] === void 0 && (c[p.uid] = p);
1081
+ const $ = p.timestampDebut.toISOString().split("T")[0];
1082
+ let O = _[$];
1083
+ O === void 0 && (O = _[$] = []), O.push(p);
1084
+ const w = p.odj;
1085
+ if (w !== void 0)
1086
+ for (const R of w.pointsOdj || [])
1087
+ for (const E of R.dossiersLegislatifsRefs || []) {
1088
+ let W = j[E];
1089
+ W === void 0 && (W = j[E] = []), W.push(p);
1093
1090
  }
1094
1091
  }
1095
1092
  }
1096
- const v = {};
1097
- if (i & I.Amendements)
1098
- for (const o of A.amendements) {
1093
+ const F = {};
1094
+ if (s & v.Amendements)
1095
+ for (const o of S.amendements) {
1099
1096
  if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1100
1097
  continue;
1101
- const f = s.join(
1098
+ const u = i.join(
1102
1099
  t,
1103
- o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1100
+ o.filename.replace(/\.json$/, "_nettoye")
1104
1101
  );
1105
- for (const c of P(f)) {
1106
- if (!c[c.length - 1].endsWith(".json"))
1102
+ for (const m of x(u)) {
1103
+ if (!m[m.length - 1].endsWith(".json"))
1107
1104
  continue;
1108
- const _ = s.join(f, ...c);
1109
- u && console.log(`Loading file: ${_}…`);
1110
- const F = n.readFileSync(_, {
1105
+ const l = i.join(u, ...m);
1106
+ a && console.log(`Loading file: ${l}…`);
1107
+ const g = n.readFileSync(l, {
1111
1108
  encoding: "utf8"
1112
- }), g = N.toAmendement(F);
1113
- v[g.uid] === void 0 && (v[g.uid] = g);
1109
+ }), p = N.toAmendement(g);
1110
+ F[p.uid] === void 0 && (F[p.uid] = p);
1114
1111
  }
1115
1112
  }
1116
- const b = {}, x = {}, D = {}, z = {};
1117
- if (i & I.DossiersLegislatifs)
1118
- for (const o of A.dossiersLegislatifs) {
1113
+ const A = {}, D = {}, I = {}, L = {};
1114
+ if (s & v.DossiersLegislatifs)
1115
+ for (const o of S.dossiersLegislatifs) {
1119
1116
  if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1120
1117
  continue;
1121
- const f = s.join(
1118
+ const u = i.join(
1122
1119
  t,
1123
- o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1120
+ o.filename.replace(/\.json$/, "_nettoye")
1124
1121
  );
1125
- for (const c of P(f, ["documents"])) {
1126
- if (!c[c.length - 1].endsWith(".json"))
1122
+ for (const m of x(u, ["documents"])) {
1123
+ if (!m[m.length - 1].endsWith(".json"))
1127
1124
  continue;
1128
- const _ = s.join(f, ...c);
1129
- u && console.log(`Loading file: ${_}…`);
1130
- const F = n.readFileSync(_, {
1125
+ const l = i.join(u, ...m);
1126
+ a && console.log(`Loading file: ${l}…`);
1127
+ const g = n.readFileSync(l, {
1131
1128
  encoding: "utf8"
1132
- }), g = q.toDocument(F);
1133
- b[g.uid] === void 0 && (b[g.uid] = g);
1129
+ }), p = q.toDocument(g);
1130
+ A[p.uid] === void 0 && (A[p.uid] = p);
1134
1131
  }
1135
- for (const c of P(f, ["dossiers"])) {
1136
- if (!c[c.length - 1].endsWith(".json"))
1132
+ for (const m of x(u, ["dossiers"])) {
1133
+ if (!m[m.length - 1].endsWith(".json"))
1137
1134
  continue;
1138
- const _ = s.join(f, ...c);
1139
- u && console.log(`Loading file: ${_}…`);
1140
- const F = n.readFileSync(_, {
1135
+ const l = i.join(u, ...m);
1136
+ a && console.log(`Loading file: ${l}…`);
1137
+ const g = n.readFileSync(l, {
1141
1138
  encoding: "utf8"
1142
- }), g = q.toDossierParlementaire(F), L = g.titreDossier;
1143
- L.senatChemin && x[L.senatChemin] === void 0 && (x[L.senatChemin] = g), L.titreChemin && D[L.titreChemin] === void 0 && (D[L.titreChemin] = g), z[g.uid] === void 0 && (z[g.uid] = g);
1139
+ }), p = q.toDossierParlementaire(g), $ = p.titreDossier;
1140
+ $.senatChemin && D[$.senatChemin] === void 0 && (D[$.senatChemin] = p), $.titreChemin && I[$.titreChemin] === void 0 && (I[$.titreChemin] = p), L[p.uid] === void 0 && (L[p.uid] = p);
1144
1141
  }
1145
1142
  }
1146
1143
  let X = {};
1147
- if (i & I.Photos) {
1144
+ if (s & v.Photos) {
1148
1145
  {
1149
- const o = s.join(
1146
+ const o = i.join(
1150
1147
  t,
1151
1148
  `photos_deputes_${// TODO: Handle Legislature.All.
1152
1149
  e === r.All ? r.DixSept : e}`,
1153
1150
  "deputes.json"
1154
1151
  );
1155
1152
  if (n.existsSync(o)) {
1156
- u && console.log(`Loading file: ${o}`);
1157
- const f = n.readFileSync(o, { encoding: "utf8" });
1158
- Object.assign(X, JSON.parse(f));
1159
- } else u && console.log(`Ignoring missing file: ${o}`);
1153
+ a && console.log(`Loading file: ${o}`);
1154
+ const u = n.readFileSync(o, { encoding: "utf8" });
1155
+ Object.assign(X, JSON.parse(u));
1156
+ } else a && console.log(`Ignoring missing file: ${o}`);
1160
1157
  }
1161
1158
  {
1162
- const o = s.join(
1159
+ const o = i.join(
1163
1160
  t,
1164
1161
  "photos_senateurs",
1165
1162
  "senateurs.json"
1166
1163
  );
1167
1164
  if (n.existsSync(o)) {
1168
- u && console.log(`Loading file: ${o}`);
1169
- const f = n.readFileSync(o, { encoding: "utf8" });
1170
- Object.assign(X, JSON.parse(f));
1171
- } else u && console.log(`Ignoring missing file: ${o}`);
1165
+ a && console.log(`Loading file: ${o}`);
1166
+ const u = n.readFileSync(o, { encoding: "utf8" });
1167
+ Object.assign(X, JSON.parse(u));
1168
+ } else a && console.log(`Ignoring missing file: ${o}`);
1172
1169
  }
1173
1170
  }
1174
- const $ = {};
1175
- if (i & I.Scrutins)
1176
- for (const o of A.scrutins) {
1171
+ const P = {};
1172
+ if (s & v.Scrutins)
1173
+ for (const o of S.scrutins) {
1177
1174
  if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1178
1175
  continue;
1179
- const f = s.join(
1176
+ const u = i.join(
1180
1177
  t,
1181
- o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1178
+ o.filename.replace(/\.json$/, "_nettoye")
1182
1179
  );
1183
- for (const c of P(f)) {
1184
- if (!c[c.length - 1].endsWith(".json"))
1180
+ for (const m of x(u)) {
1181
+ if (!m[m.length - 1].endsWith(".json"))
1185
1182
  continue;
1186
- const _ = s.join(f, ...c);
1187
- u && console.log(`Loading file: ${_}…`);
1188
- const F = n.readFileSync(_, {
1183
+ const l = i.join(u, ...m);
1184
+ a && console.log(`Loading file: ${l}…`);
1185
+ const g = n.readFileSync(l, {
1189
1186
  encoding: "utf8"
1190
- }), g = Z.toScrutin(F);
1191
- $[g.uid] === void 0 && ($[g.uid] = g);
1187
+ }), p = Z.toScrutin(g);
1188
+ P[p.uid] === void 0 && (P[p.uid] = p);
1192
1189
  }
1193
1190
  }
1194
- const V = {};
1195
- if (i & I.Questions)
1196
- for (const o of A.questions) {
1191
+ const b = {};
1192
+ if (s & v.Questions)
1193
+ for (const o of S.questions) {
1197
1194
  if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1198
1195
  continue;
1199
- const f = s.join(
1196
+ const u = i.join(
1200
1197
  t,
1201
- o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1198
+ o.filename.replace(/\.json$/, "_nettoye")
1202
1199
  );
1203
- for (const c of P(f)) {
1204
- if (!c[c.length - 1].endsWith(".json"))
1200
+ for (const m of x(u)) {
1201
+ if (!m[m.length - 1].endsWith(".json"))
1205
1202
  continue;
1206
- const _ = s.join(f, ...c);
1207
- u && console.log(`Loading file: ${_}…`);
1208
- const F = n.readFileSync(_, {
1203
+ const l = i.join(u, ...m);
1204
+ a && console.log(`Loading file: ${l}…`);
1205
+ const g = n.readFileSync(l, {
1209
1206
  encoding: "utf8"
1210
- }), g = B.toQuestion(F);
1211
- V[g.uid] === void 0 && (V[g.uid] = g);
1207
+ }), p = B.toQuestion(g);
1208
+ b[p.uid] === void 0 && (b[p.uid] = p);
1212
1209
  }
1213
1210
  }
1214
- const p = {};
1215
- if (i & I.ComptesRendusSeances)
1216
- for (const o of A.comptesRendusSeances) {
1211
+ const V = {};
1212
+ if (s & v.ComptesRendusSeances)
1213
+ for (const o of S.comptesRendusSeances) {
1217
1214
  if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1218
1215
  continue;
1219
- const f = s.join(
1216
+ const u = i.join(
1220
1217
  t,
1221
- o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1218
+ o.filename.replace(/\.json$/, "_nettoye")
1222
1219
  );
1223
- for (const c of P(f)) {
1224
- if (!c[c.length - 1].endsWith(".json"))
1220
+ for (const m of x(u)) {
1221
+ if (!m[m.length - 1].endsWith(".json"))
1225
1222
  continue;
1226
- const _ = s.join(f, ...c);
1227
- u && console.log(`Loading file: ${_}…`);
1228
- const F = n.readFileSync(_, {
1223
+ const l = i.join(u, ...m);
1224
+ a && console.log(`Loading file: ${l}…`);
1225
+ const g = n.readFileSync(l, {
1229
1226
  encoding: "utf8"
1230
- }), g = J.toCompteRendu(F);
1231
- p[g.uid] === void 0 && (p[g.uid] = g);
1227
+ }), p = J.toCompteRendu(g);
1228
+ V[p.uid] === void 0 && (V[p.uid] = p);
1232
1229
  }
1233
1230
  }
1234
1231
  return {
1235
- acteurByUid: d,
1236
- amendementByUid: v,
1237
- documentByUid: b,
1238
- dossierParlementaireBySenatChemin: x,
1239
- dossierParlementaireByTitreChemin: D,
1240
- dossierParlementaireByUid: z,
1241
- organeByUid: l,
1232
+ acteurByUid: f,
1233
+ amendementByUid: F,
1234
+ documentByUid: A,
1235
+ dossierParlementaireBySenatChemin: D,
1236
+ dossierParlementaireByTitreChemin: I,
1237
+ dossierParlementaireByUid: L,
1238
+ organeByUid: d,
1242
1239
  photoByUid: X,
1243
- reunionByUid: j,
1244
- reunionsByDay: y,
1245
- reunionsByDossierUid: S,
1246
- scrutinByUid: $,
1247
- questionByUid: V,
1248
- compteRenduByUid: p
1240
+ reunionByUid: c,
1241
+ reunionsByDay: _,
1242
+ reunionsByDossierUid: j,
1243
+ scrutinByUid: P,
1244
+ questionByUid: b,
1245
+ compteRenduByUid: V
1249
1246
  };
1250
1247
  }
1251
- function De(t, i, e, { log: a = !1 } = {}) {
1252
- const u = {}, d = {};
1253
- if (i & I.ActeursEtOrganes)
1254
- for (const p of A.acteursEtOrganes) {
1255
- if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1248
+ function be(t, s, e, { log: a = !1 } = {}) {
1249
+ const f = {}, d = {};
1250
+ if (s & v.ActeursEtOrganes)
1251
+ for (const o of S.acteursEtOrganes) {
1252
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1256
1253
  continue;
1257
- const o = s.join(
1254
+ const u = i.join(
1258
1255
  t,
1259
- p.filename.replace(/\.json$/, "_nettoye.json")
1256
+ o.filename.replace(/\.json$/, "_nettoye.json")
1260
1257
  );
1261
- a && console.log(`Loading file: ${o}`);
1262
- const f = n.readFileSync(o, { encoding: "utf8" }), c = U.toActeursEtOrganes(f);
1263
- for (const m of c.acteurs)
1264
- u[m.uid] === void 0 && (u[m.uid] = m);
1265
- for (const m of c.organes)
1266
- d[m.uid] === void 0 && (d[m.uid] = m);
1258
+ a && console.log(`Loading file: ${u}`);
1259
+ const m = n.readFileSync(u, { encoding: "utf8" }), y = U.toActeursEtOrganes(m);
1260
+ for (const l of y.acteurs)
1261
+ f[l.uid] === void 0 && (f[l.uid] = l);
1262
+ for (const l of y.organes)
1263
+ d[l.uid] === void 0 && (d[l.uid] = l);
1267
1264
  }
1268
- const l = {}, j = {}, y = {};
1269
- if (i & I.Agendas)
1270
- for (const p of A.agendas) {
1271
- if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1265
+ const c = {}, _ = {}, j = {};
1266
+ if (s & v.Agendas)
1267
+ for (const o of S.agendas) {
1268
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1272
1269
  continue;
1273
- const o = s.join(
1270
+ const u = i.join(
1274
1271
  t,
1275
- p.filename.replace(/\.json$/, "_nettoye.json")
1272
+ o.filename.replace(/\.json$/, "_nettoye.json")
1276
1273
  );
1277
- a && console.log(`Loading file: ${o}`);
1278
- const f = n.readFileSync(o, { encoding: "utf8" }), c = M.toAgendas(f);
1279
- for (const m of c.reunions) {
1280
- l[m.uid] === void 0 && (l[m.uid] = m);
1281
- const _ = m.timestampDebut.toISOString().split("T")[0];
1282
- let F = j[_];
1283
- F === void 0 && (F = j[_] = []), F.push(m);
1284
- const g = m.odj;
1285
- if (g !== void 0)
1286
- for (const L of g.pointsOdj || [])
1287
- for (const w of L.dossiersLegislatifsRefs || []) {
1288
- let R = y[w];
1289
- R === void 0 && (R = y[w] = []), R.push(m);
1274
+ a && console.log(`Loading file: ${u}`);
1275
+ const m = n.readFileSync(u, { encoding: "utf8" }), y = M.toAgendas(m);
1276
+ for (const l of y.reunions) {
1277
+ c[l.uid] === void 0 && (c[l.uid] = l);
1278
+ const g = l.timestampDebut.toISOString().split("T")[0];
1279
+ let p = _[g];
1280
+ p === void 0 && (p = _[g] = []), p.push(l);
1281
+ const $ = l.odj;
1282
+ if ($ !== void 0)
1283
+ for (const O of $.pointsOdj || [])
1284
+ for (const w of O.dossiersLegislatifsRefs || []) {
1285
+ let R = j[w];
1286
+ R === void 0 && (R = j[w] = []), R.push(l);
1290
1287
  }
1291
1288
  }
1292
1289
  }
1293
- const S = {};
1294
- if (i & I.Amendements)
1295
- for (const p of A.amendements) {
1296
- if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1290
+ const F = {};
1291
+ if (s & v.Amendements)
1292
+ for (const o of S.amendements) {
1293
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1297
1294
  continue;
1298
- const o = s.join(
1295
+ const u = i.join(
1299
1296
  t,
1300
- p.filename.replace(/\.json$/, "_nettoye.json")
1297
+ o.filename.replace(/\.json$/, "_nettoye.json")
1301
1298
  );
1302
- a && console.log(`Loading file: ${o}`);
1303
- const f = n.readFileSync(o, { encoding: "utf8" }), c = N.toAmendements(f);
1304
- for (const m of c.textesLegislatifs)
1305
- for (const _ of m.amendements)
1306
- S[_.uid] === void 0 && (S[_.uid] = _);
1299
+ a && console.log(`Loading file: ${u}`);
1300
+ const m = n.readFileSync(u, { encoding: "utf8" }), y = N.toAmendements(m);
1301
+ for (const l of y.textesLegislatifs)
1302
+ for (const g of l.amendements)
1303
+ F[g.uid] === void 0 && (F[g.uid] = g);
1307
1304
  }
1308
- const v = {}, b = {}, x = {}, D = {};
1309
- if (i & I.DossiersLegislatifs)
1310
- for (const p of A.dossiersLegislatifs) {
1311
- if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1305
+ const A = {}, D = {}, I = {}, L = {};
1306
+ if (s & v.DossiersLegislatifs)
1307
+ for (const o of S.dossiersLegislatifs) {
1308
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1312
1309
  continue;
1313
- const o = s.join(
1310
+ const u = i.join(
1314
1311
  t,
1315
- p.filename.replace(/\.json$/, "_nettoye.json")
1312
+ o.filename.replace(/\.json$/, "_nettoye.json")
1316
1313
  );
1317
- a && console.log(`Loading file: ${o}`);
1318
- const f = n.readFileSync(o, { encoding: "utf8" }), c = q.toDossiersLegislatifs(f);
1319
- for (const m of c.textesLegislatifs)
1320
- v[m.uid] === void 0 && (v[m.uid] = m);
1321
- for (const m of c.dossiersParlementaires) {
1322
- const _ = m.titreDossier;
1323
- _.senatChemin && b[_.senatChemin] === void 0 && (b[_.senatChemin] = m), _.titreChemin && x[_.titreChemin] === void 0 && (x[_.titreChemin] = m), D[m.uid] === void 0 && (D[m.uid] = m);
1314
+ a && console.log(`Loading file: ${u}`);
1315
+ const m = n.readFileSync(u, { encoding: "utf8" }), y = q.toDossiersLegislatifs(m);
1316
+ for (const l of y.textesLegislatifs)
1317
+ A[l.uid] === void 0 && (A[l.uid] = l);
1318
+ for (const l of y.dossiersParlementaires) {
1319
+ const g = l.titreDossier;
1320
+ g.senatChemin && D[g.senatChemin] === void 0 && (D[g.senatChemin] = l), g.titreChemin && I[g.titreChemin] === void 0 && (I[g.titreChemin] = l), L[l.uid] === void 0 && (L[l.uid] = l);
1324
1321
  }
1325
1322
  }
1326
- const z = {};
1327
- if (i & I.Photos) {
1328
- const p = {};
1323
+ const X = {};
1324
+ if (s & v.Photos) {
1325
+ const o = {};
1329
1326
  {
1330
- const o = s.join(
1327
+ const u = i.join(
1331
1328
  t,
1332
1329
  `photos_deputes_${// TODO: Handle Legislature.All.
1333
1330
  e === r.All ? r.DixSept : e}`,
1334
1331
  "deputes.json"
1335
1332
  );
1336
- if (n.existsSync(o)) {
1337
- a && console.log(`Loading file: ${o}`);
1338
- const f = n.readFileSync(o, { encoding: "utf8" });
1339
- Object.assign(p, JSON.parse(f));
1340
- } else a && console.log(`Ignoring missing file: ${o}`);
1333
+ if (n.existsSync(u)) {
1334
+ a && console.log(`Loading file: ${u}`);
1335
+ const m = n.readFileSync(u, { encoding: "utf8" });
1336
+ Object.assign(o, JSON.parse(m));
1337
+ } else a && console.log(`Ignoring missing file: ${u}`);
1341
1338
  }
1342
1339
  {
1343
- const o = s.join(
1340
+ const u = i.join(
1344
1341
  t,
1345
1342
  "photos_senateurs",
1346
1343
  "senateurs.json"
1347
1344
  );
1348
- if (n.existsSync(o)) {
1349
- a && console.log(`Loading file: ${o}`);
1350
- const f = n.readFileSync(o, { encoding: "utf8" });
1351
- Object.assign(p, JSON.parse(f));
1352
- } else a && console.log(`Ignoring missing file: ${o}`);
1345
+ if (n.existsSync(u)) {
1346
+ a && console.log(`Loading file: ${u}`);
1347
+ const m = n.readFileSync(u, { encoding: "utf8" });
1348
+ Object.assign(o, JSON.parse(m));
1349
+ } else a && console.log(`Ignoring missing file: ${u}`);
1353
1350
  }
1354
1351
  }
1355
- const X = {};
1356
- if (i & I.Scrutins)
1357
- for (const p of A.scrutins) {
1358
- if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1352
+ const P = {};
1353
+ if (s & v.Scrutins)
1354
+ for (const o of S.scrutins) {
1355
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1359
1356
  continue;
1360
- const o = s.join(
1357
+ const u = i.join(
1361
1358
  t,
1362
- p.filename.replace(/\.json$/, "_nettoye.json")
1359
+ o.filename.replace(/\.json$/, "_nettoye.json")
1363
1360
  );
1364
- a && console.log(`Loading file: ${o}`);
1365
- const f = n.readFileSync(o, { encoding: "utf8" }), c = Z.toScrutins(f);
1366
- for (const m of c.scrutins)
1367
- X[m.uid] === void 0 && (X[m.uid] = m);
1361
+ a && console.log(`Loading file: ${u}`);
1362
+ const m = n.readFileSync(u, { encoding: "utf8" }), y = Z.toScrutins(m);
1363
+ for (const l of y.scrutins)
1364
+ P[l.uid] === void 0 && (P[l.uid] = l);
1368
1365
  }
1369
- const $ = {};
1370
- if (i & I.Questions)
1371
- for (const p of A.questions) {
1372
- if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1366
+ const b = {};
1367
+ if (s & v.Questions)
1368
+ for (const o of S.questions) {
1369
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1373
1370
  continue;
1374
- const o = s.join(
1371
+ const u = i.join(
1375
1372
  t,
1376
- p.filename.replace(/\.json$/, "_nettoye.json")
1373
+ o.filename.replace(/\.json$/, "_nettoye.json")
1377
1374
  );
1378
- a && console.log(`Loading file: ${o}`);
1379
- const f = n.readFileSync(o, { encoding: "utf8" }), c = B.toQuestions(f);
1380
- for (const m of c.questions)
1381
- $[m.uid] === void 0 && ($[m.uid] = m);
1375
+ a && console.log(`Loading file: ${u}`);
1376
+ const m = n.readFileSync(u, { encoding: "utf8" }), y = B.toQuestions(m);
1377
+ for (const l of y.questions)
1378
+ b[l.uid] === void 0 && (b[l.uid] = l);
1382
1379
  }
1383
1380
  const V = {};
1384
- if (i & I.ComptesRendusSeances)
1385
- for (const p of A.comptesRendusSeances) {
1386
- if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1381
+ if (s & v.ComptesRendusSeances)
1382
+ for (const o of S.comptesRendusSeances) {
1383
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1387
1384
  continue;
1388
- const o = s.join(
1385
+ const u = i.join(
1389
1386
  t,
1390
- p.filename.replace(/\.json$/, "_nettoye.json")
1387
+ o.filename.replace(/\.json$/, "_nettoye.json")
1391
1388
  );
1392
- a && console.log(`Loading file: ${o}`);
1393
- const f = n.readFileSync(o, { encoding: "utf8" }), c = J.toComptesRendus(f);
1394
- for (const m of c.comptesRendus)
1395
- V[m.uid] === void 0 && (V[m.uid] = m);
1389
+ a && console.log(`Loading file: ${u}`);
1390
+ const m = n.readFileSync(u, { encoding: "utf8" }), y = J.toComptesRendus(m);
1391
+ for (const l of y.comptesRendus)
1392
+ V[l.uid] === void 0 && (V[l.uid] = l);
1396
1393
  }
1397
1394
  return {
1398
- acteurByUid: u,
1399
- amendementByUid: S,
1400
- documentByUid: v,
1401
- dossierParlementaireBySenatChemin: b,
1402
- dossierParlementaireByTitreChemin: x,
1403
- dossierParlementaireByUid: D,
1395
+ acteurByUid: f,
1396
+ amendementByUid: F,
1397
+ documentByUid: A,
1398
+ dossierParlementaireBySenatChemin: D,
1399
+ dossierParlementaireByTitreChemin: I,
1400
+ dossierParlementaireByUid: L,
1404
1401
  organeByUid: d,
1405
- photoByUid: z,
1406
- reunionByUid: l,
1407
- reunionsByDay: j,
1408
- reunionsByDossierUid: y,
1409
- scrutinByUid: X,
1410
- questionByUid: $,
1402
+ photoByUid: X,
1403
+ reunionByUid: c,
1404
+ reunionsByDay: _,
1405
+ reunionsByDossierUid: j,
1406
+ scrutinByUid: P,
1407
+ questionByUid: b,
1411
1408
  compteRenduByUid: V
1412
1409
  };
1413
1410
  }
1414
- function Xe(t, i, e) {
1415
- const a = s.join(t, "Documents"), u = ae(a, i), d = s.join(u, "index.json");
1411
+ function De(t, s, e) {
1412
+ const a = i.join(t, "Documents"), f = oe(a, s), d = i.join(f, "index.json");
1416
1413
  if (!n.pathExistsSync(d))
1417
1414
  return;
1418
- const l = n.readJsonSync(d);
1419
- for (const j of e)
1420
- for (const { filename: y, url: S } of l[j] ?? [])
1421
- if (y !== void 0)
1422
- return { format: j, path: s.join(u, y), url: S };
1415
+ const c = n.readJsonSync(d);
1416
+ for (const _ of e)
1417
+ for (const { filename: j, url: F } of c[_] ?? [])
1418
+ if (j !== void 0)
1419
+ return { format: _, path: i.join(f, j), url: F };
1423
1420
  }
1424
- function Ve(t, i, { log: e = !1 } = {}) {
1425
- const a = s.join(
1421
+ function Xe(t, s, { log: e = !1 } = {}) {
1422
+ const a = i.join(
1426
1423
  t,
1427
1424
  `photos_deputes_${// TODO: Handle Legislature.All.
1428
- i === r.All ? r.DixSept : i}`,
1425
+ s === r.All ? r.DixSept : s}`,
1429
1426
  "deputes.json"
1430
1427
  );
1431
1428
  e && console.log(`Loading file: ${a}`);
1432
- const u = n.readFileSync(a, { encoding: "utf8" });
1433
- return JSON.parse(u);
1429
+ const f = n.readFileSync(a, { encoding: "utf8" });
1430
+ return JSON.parse(f);
1434
1431
  }
1435
- function $e(t, { log: i = !1 } = {}) {
1436
- const e = s.join(
1432
+ function Ve(t, { log: s = !1 } = {}) {
1433
+ const e = i.join(
1437
1434
  t,
1438
1435
  "photos_senateurs",
1439
1436
  "senateurs.json"
1440
1437
  );
1441
- i && console.log(`Loading file: ${e}`);
1438
+ s && console.log(`Loading file: ${e}`);
1442
1439
  const a = n.readFileSync(e, { encoding: "utf8" });
1443
1440
  return JSON.parse(a);
1444
1441
  }
1445
- function ae(t, i) {
1446
- const e = i.match(G);
1442
+ function oe(t, s) {
1443
+ const e = s.match(Y);
1447
1444
  C.notStrictEqual(
1448
1445
  e,
1449
1446
  null,
1450
- `Unexpected structure for document UID: ${i}`
1447
+ `Unexpected structure for document UID: ${s}`
1451
1448
  );
1452
- const a = e.groups, u = s.join(
1449
+ const a = e.groups, f = i.join(
1453
1450
  t,
1454
1451
  a.documentType ?? a.documentType2
1455
- ), d = s.join(u, a.chambre ?? a.chambre2), l = s.join(
1452
+ ), d = i.join(f, a.chambre ?? a.chambre2), c = i.join(
1456
1453
  d,
1457
1454
  a.republique ?? a.republique2
1458
- ), j = s.join(
1459
- l,
1455
+ ), _ = i.join(
1456
+ c,
1460
1457
  a.legislature ?? a.legislature2
1461
- ), y = a.etat;
1462
- if (y === void 0)
1463
- return n.ensureDirSync(j), s.join(j, i);
1464
- const S = s.join(j, y);
1465
- let v = "000000" + (a.numero ?? a.numero2);
1466
- v = v.substring(v.length - 6);
1467
- const b = s.join(S, v.substring(0, 3));
1468
- return n.ensureDirSync(b), s.join(b, i);
1458
+ ), j = a.etat;
1459
+ if (j === void 0)
1460
+ return n.ensureDirSync(_), i.join(_, s);
1461
+ const F = i.join(_, j);
1462
+ let A = "000000" + (a.numero ?? a.numero2);
1463
+ A = A.substring(A.length - 6);
1464
+ const D = i.join(F, A.substring(0, 3));
1465
+ return n.ensureDirSync(D), i.join(D, s);
1469
1466
  }
1470
- function Le(t, i) {
1471
- return H(t, i, ie);
1467
+ function $e(t, s) {
1468
+ return H(t, s, te);
1472
1469
  }
1473
- function Pe(t, i) {
1474
- const e = K.exec(i);
1470
+ function Le(t, s) {
1471
+ const e = G.exec(s);
1475
1472
  C.notStrictEqual(
1476
1473
  e,
1477
1474
  null,
1478
- `Unexpected structure for reunion UID: ${i}`
1475
+ `Unexpected structure for reunion UID: ${s}`
1479
1476
  );
1480
- const a = s.join(t, e[1]), u = s.join(a, e[2]), d = s.join(u, e[3]), l = s.join(d, e[4]), j = s.join(l, e[5]);
1481
- let y = "000000000" + e[6];
1482
- y = y.substring(y.length - 9);
1483
- const S = s.join(j, y.substring(0, 3)), v = s.join(S, y.substring(3, 3));
1484
- return n.ensureDirSync(v), s.join(v, i);
1477
+ const a = i.join(t, e[1]), f = i.join(a, e[2]), d = i.join(f, e[3]), c = i.join(d, e[4]), _ = i.join(c, e[5]);
1478
+ let j = "000000000" + e[6];
1479
+ j = j.substring(j.length - 9);
1480
+ const F = i.join(_, j.substring(0, 3)), A = i.join(F, j.substring(3, 3));
1481
+ return n.ensureDirSync(A), i.join(A, s);
1485
1482
  }
1486
- function xe(t, i) {
1487
- const e = ee.exec(i);
1483
+ function Pe(t, s) {
1484
+ const e = K.exec(s);
1488
1485
  C.notStrictEqual(
1489
1486
  e,
1490
1487
  null,
1491
- `Unexpected structure for scrutin UID: ${i}`
1488
+ `Unexpected structure for scrutin UID: ${s}`
1492
1489
  );
1493
- const a = s.join(t, e[1]), u = s.join(a, e[2]), d = s.join(u, e[3]);
1494
- let l = "000000" + e[4];
1495
- l = l.substring(l.length - 6);
1496
- const j = s.join(d, l.substring(0, 3));
1497
- return n.ensureDirSync(j), s.join(j, i);
1490
+ const a = i.join(t, e[1]), f = i.join(a, e[2]), d = i.join(f, e[3]);
1491
+ let c = "000000" + e[4];
1492
+ c = c.substring(c.length - 6);
1493
+ const _ = i.join(d, c.substring(0, 3));
1494
+ return n.ensureDirSync(_), i.join(_, s);
1498
1495
  }
1499
- function ze(t, i) {
1500
- return H(t, i, se);
1496
+ function xe(t, s) {
1497
+ return H(t, s, se);
1501
1498
  }
1502
- function Oe(t, i) {
1503
- const e = te.exec(i);
1499
+ function ze(t, s) {
1500
+ const e = ee.exec(s);
1504
1501
  C.notStrictEqual(
1505
1502
  e,
1506
1503
  null,
1507
- `Unexpected structure for object with UID: ${i}`
1504
+ `Unexpected structure for object with UID: ${s}`
1508
1505
  );
1509
- const a = s.join(t, e[2]), u = s.join(a, e[3]), d = s.join(u, e[4]), l = s.join(d, e[5]);
1510
- let j = "000000000" + e[7];
1511
- j = j.substring(j.length - 9);
1512
- const y = s.join(l, j.substring(0, 3)), S = s.join(y, j.substring(3, 3));
1513
- return n.ensureDirSync(S), s.join(S, i);
1506
+ const a = i.join(t, e[2]), f = i.join(a, e[3]), d = i.join(f, e[4]), c = i.join(d, e[5]);
1507
+ let _ = "000000000" + e[7];
1508
+ _ = _.substring(_.length - 9);
1509
+ const j = i.join(c, _.substring(0, 3)), F = i.join(j, _.substring(3, 3));
1510
+ return n.ensureDirSync(F), i.join(F, s);
1514
1511
  }
1515
- function H(t, i, e) {
1516
- const a = e.exec(i);
1512
+ function H(t, s, e) {
1513
+ const a = e.exec(s);
1517
1514
  C.notStrictEqual(
1518
1515
  a,
1519
1516
  null,
1520
- `Unexpected structure for object with UID: ${i}`
1517
+ `Unexpected structure for object with UID: ${s}`
1521
1518
  );
1522
- const u = s.join(t, a[1]), d = s.join(u, a[2]);
1523
- let l = "000000" + a[3];
1524
- l = l.substring(l.length - 6);
1525
- const j = s.join(d, l.substring(0, 3));
1526
- return n.ensureDirSync(j), s.join(j, i);
1519
+ const f = i.join(t, a[1]), d = i.join(f, a[2]);
1520
+ let c = "000000" + a[3];
1521
+ c = c.substring(c.length - 6);
1522
+ const _ = i.join(d, c.substring(0, 3));
1523
+ return n.ensureDirSync(_), i.join(_, s);
1527
1524
  }
1528
1525
  export {
1529
- I as EnabledDatasets,
1530
- ge as iterLoadAssembleeActeurs,
1531
- je as iterLoadAssembleeAmendements,
1532
- ve as iterLoadAssembleeComptesRendus,
1533
- Ie as iterLoadAssembleeComptesRendusCommissions,
1534
- he as iterLoadAssembleeDocuments,
1535
- ye as iterLoadAssembleeDossiersParlementaires,
1536
- _e as iterLoadAssembleeOrganes,
1537
- Fe as iterLoadAssembleeQuestions,
1538
- Se as iterLoadAssembleeReunions,
1539
- Ae as iterLoadAssembleeScrutins,
1540
- be as loadAssembleeData,
1541
- De as loadAssembleeDataFromBigFiles,
1542
- Xe as loadAssembleeDocumentFile,
1543
- Ve as loadAssembleePhotosDeputes,
1544
- $e as loadAssembleePhotosSenateurs,
1545
- Oe as pathFromCompteRenduUid,
1546
- ae as pathFromDocumentUid,
1547
- Le as pathFromDossierParlementaireUid,
1548
- ze as pathFromQuestionUid,
1549
- Pe as pathFromReunionUid,
1550
- xe as pathFromScrutinUid,
1551
- P as walkDir
1526
+ v as EnabledDatasets,
1527
+ pe as iterLoadAssembleeActeurs,
1528
+ _e as iterLoadAssembleeAmendements,
1529
+ Fe as iterLoadAssembleeComptesRendus,
1530
+ ve as iterLoadAssembleeComptesRendusCommissions,
1531
+ je as iterLoadAssembleeDocuments,
1532
+ he as iterLoadAssembleeDossiersParlementaires,
1533
+ ge as iterLoadAssembleeOrganes,
1534
+ Ae as iterLoadAssembleeQuestions,
1535
+ ye as iterLoadAssembleeReunions,
1536
+ Se as iterLoadAssembleeScrutins,
1537
+ Ie as loadAssembleeData,
1538
+ be as loadAssembleeDataFromBigFiles,
1539
+ De as loadAssembleeDocumentFile,
1540
+ Xe as loadAssembleePhotosDeputes,
1541
+ Ve as loadAssembleePhotosSenateurs,
1542
+ ze as pathFromCompteRenduUid,
1543
+ oe as pathFromDocumentUid,
1544
+ $e as pathFromDossierParlementaireUid,
1545
+ xe as pathFromQuestionUid,
1546
+ Le as pathFromReunionUid,
1547
+ Pe as pathFromScrutinUid,
1548
+ x as walkDir
1552
1549
  };