@tricoteuses/assemblee
Version:
Retrieve, clean up & handle French Assemblée nationale's open data
1,222 lines (1,221 loc) • 37 kB
JavaScript
import { c as L, t as p, g as M, m as H, a, b as F, d as j, e as Q, f as X, h as G, i as V, l as z, j as Z, k as J, w as $, n as E, o as Y, p as K, q as b } from "./parse-Ccs6wcUg.js";
import { C as _ } from "./loaders-Csd5rgG_.js";
import { y as ze, _ as Ze, h as Je, f as $e, i as Ke, $ as et, a0 as tt, D as nt, z as rt, a7 as ot, A as it, E as at, j as st, F as ut, m as ct, X as ft, a1 as dt, a2 as mt, a3 as gt, a4 as ht, M as lt, N as yt, n as pt, o as Dt, a5 as vt, P as Rt, q as xt, r as wt, B as Ot, G as Tt, Q as bt, R as Bt, k as Mt, t as _t, S as St, H as At, I as Pt, J as Nt, K as Lt, L as Et, O as Yt, U as kt, Z as Ct, a6 as Ut, T as It, V as qt, l as Wt, v as Ht, Y as Ft, x as jt, W as Qt, g as Xt, c as Gt, a8 as Vt, p as zt, s as Zt, a as Jt, b as $t, d as Kt, u as en, a9 as tn, aa as nn, w as rn, e as on } from "./loaders-Csd5rgG_.js";
import { A as sn, a as un, C as cn, b as fn, c as dn, D as mn, E as gn, d as hn, S as ln, T as yn, e as pn, f as Dn, g as vn } from "./amendements-40Z7OJLT.js";
var k = /* @__PURE__ */ ((e) => (e.Amendements = "amendements", e))(k || {});
const Ye = Object.values(k);
var C = /* @__PURE__ */ ((e) => (e.Acte_organe = "acte.organe", e.Acte_provenance = "acte.provenance", e.Acte_rapporteurs_acteur = "acte.rapporteurs.acteur", e.Acte_reunion = "acte.reunion", e.Acte_texteAdopte = "acte.texteAdopte", e.Acte_texteAssocie = "acte.texteAssocie", e.Acte_textesAssocies_texteAssocie = "acte.textesAssocies.texteAssocie", e.Acte_votes = "acte.votes", e.Acteur_mandats_organes = "acteur.mandats.organes", e.Amendement_signataires_auteur_acteur = "amendement.signataires.auteur.acteur", e.Amendement_signataires_auteur_auteurRapporteurOrgane = "amendement.signataires.auteur.auteurRapporteurOrgane", e.Amendement_signataires_auteur_gouvernement = "amendement.signataires.auteur.gouvernement", e.Amendement_signataires_auteur_groupePolitique = "amendement.signataires.auteur.groupePolitique", e.Amendement_signataires_cosignataires = "amendement.signataires.cosignataires", e.Amendement_texteLegislatif = "amendement.texteLegislatif", e.Document_auteurs_acteur_acteur = "document.auteurs.acteur.acteur", e.Document_auteurs_organe = "document.auteurs.organe", e.Document_dossier = "document.dossier", e.Dossier_initiateur_acteurs_acteur = "dossier.initiateur.acteurs.acteur", e.Dossier_initiateur_organe = "dossier.initiateur.organe", e.Organe_organeParent = "organe.organeParent", e.Organe_organePrecedent = "organe.organePrecedent", e.Reunion_demandeurs_acteurs_acteur = "reunion.demandeurs.acteurs.acteur", e.Reunion_demandeurs_organe_organe = "reunion.demandeurs.organe.organe", e.Reunion_organeReuni = "reunion.organeReuni", e.Reunion_participants_participantsInternes_acteur = "reunion.participants.participantsInternes.acteur", e.Scrutin_miseAuPoint = "scrutin.miseAuPoint", e.Scrutin_organe = "scrutin.organe", e.Scrutin_ventilationVotes_groupes_organe = "scrutin.ventilationVotes.groupes.organe", e))(C || {});
const ke = Object.values(C);
function ee(e, ...t) {
const n = L.bind(
null,
t.find((r) => typeof r == "object")
);
return t.map(n);
}
function S(e, t) {
const n = p(e, t?.in);
return n.setHours(0, 0, 0, 0), n;
}
function te(e, t, n) {
const [r, o] = ee(
n?.in,
e,
t
), i = S(r), s = S(o), c = +i - M(i), u = +s - M(s);
return Math.round((c - u) / H);
}
function ne(e, t) {
const n = p(e, t?.in);
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
}
function re(e, t) {
const n = p(e, t?.in);
return te(n, ne(n)) + 1;
}
const h = {
// Year
y(e, t) {
const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
return a(t === "yy" ? r % 100 : r, t.length);
},
// Month
M(e, t) {
const n = e.getMonth();
return t === "M" ? String(n + 1) : a(n + 1, 2);
},
// Day of the month
d(e, t) {
return a(e.getDate(), t.length);
},
// AM or PM
a(e, t) {
const n = e.getHours() / 12 >= 1 ? "pm" : "am";
switch (t) {
case "a":
case "aa":
return n.toUpperCase();
case "aaa":
return n;
case "aaaaa":
return n[0];
case "aaaa":
default:
return n === "am" ? "a.m." : "p.m.";
}
},
// Hour [1-12]
h(e, t) {
return a(e.getHours() % 12 || 12, t.length);
},
// Hour [0-23]
H(e, t) {
return a(e.getHours(), t.length);
},
// Minute
m(e, t) {
return a(e.getMinutes(), t.length);
},
// Second
s(e, t) {
return a(e.getSeconds(), t.length);
},
// Fraction of second
S(e, t) {
const n = t.length, r = e.getMilliseconds(), o = Math.trunc(
r * Math.pow(10, n - 3)
);
return a(o, t.length);
}
}, D = {
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}, A = {
// Era
G: function(e, t, n) {
const r = e.getFullYear() > 0 ? 1 : 0;
switch (t) {
// AD, BC
case "G":
case "GG":
case "GGG":
return n.era(r, { width: "abbreviated" });
// A, B
case "GGGGG":
return n.era(r, { width: "narrow" });
// Anno Domini, Before Christ
case "GGGG":
default:
return n.era(r, { width: "wide" });
}
},
// Year
y: function(e, t, n) {
if (t === "yo") {
const r = e.getFullYear(), o = r > 0 ? r : 1 - r;
return n.ordinalNumber(o, { unit: "year" });
}
return h.y(e, t);
},
// Local week-numbering year
Y: function(e, t, n, r) {
const o = X(e, r), i = o > 0 ? o : 1 - o;
if (t === "YY") {
const s = i % 100;
return a(s, 2);
}
return t === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : a(i, t.length);
},
// ISO week-numbering year
R: function(e, t) {
const n = Q(e);
return a(n, t.length);
},
// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 | 1 | 1 |
// | BC 1 | 1 | 0 |
// | BC 2 | 2 | -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u: function(e, t) {
const n = e.getFullYear();
return a(n, t.length);
},
// Quarter
Q: function(e, t, n) {
const r = Math.ceil((e.getMonth() + 1) / 3);
switch (t) {
// 1, 2, 3, 4
case "Q":
return String(r);
// 01, 02, 03, 04
case "QQ":
return a(r, 2);
// 1st, 2nd, 3rd, 4th
case "Qo":
return n.ordinalNumber(r, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "QQQ":
return n.quarter(r, {
width: "abbreviated",
context: "formatting"
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "QQQQQ":
return n.quarter(r, {
width: "narrow",
context: "formatting"
});
// 1st quarter, 2nd quarter, ...
case "QQQQ":
default:
return n.quarter(r, {
width: "wide",
context: "formatting"
});
}
},
// Stand-alone quarter
q: function(e, t, n) {
const r = Math.ceil((e.getMonth() + 1) / 3);
switch (t) {
// 1, 2, 3, 4
case "q":
return String(r);
// 01, 02, 03, 04
case "qq":
return a(r, 2);
// 1st, 2nd, 3rd, 4th
case "qo":
return n.ordinalNumber(r, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "qqq":
return n.quarter(r, {
width: "abbreviated",
context: "standalone"
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "qqqqq":
return n.quarter(r, {
width: "narrow",
context: "standalone"
});
// 1st quarter, 2nd quarter, ...
case "qqqq":
default:
return n.quarter(r, {
width: "wide",
context: "standalone"
});
}
},
// Month
M: function(e, t, n) {
const r = e.getMonth();
switch (t) {
case "M":
case "MM":
return h.M(e, t);
// 1st, 2nd, ..., 12th
case "Mo":
return n.ordinalNumber(r + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "MMM":
return n.month(r, {
width: "abbreviated",
context: "formatting"
});
// J, F, ..., D
case "MMMMM":
return n.month(r, {
width: "narrow",
context: "formatting"
});
// January, February, ..., December
case "MMMM":
default:
return n.month(r, { width: "wide", context: "formatting" });
}
},
// Stand-alone month
L: function(e, t, n) {
const r = e.getMonth();
switch (t) {
// 1, 2, ..., 12
case "L":
return String(r + 1);
// 01, 02, ..., 12
case "LL":
return a(r + 1, 2);
// 1st, 2nd, ..., 12th
case "Lo":
return n.ordinalNumber(r + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "LLL":
return n.month(r, {
width: "abbreviated",
context: "standalone"
});
// J, F, ..., D
case "LLLLL":
return n.month(r, {
width: "narrow",
context: "standalone"
});
// January, February, ..., December
case "LLLL":
default:
return n.month(r, { width: "wide", context: "standalone" });
}
},
// Local week of year
w: function(e, t, n, r) {
const o = j(e, r);
return t === "wo" ? n.ordinalNumber(o, { unit: "week" }) : a(o, t.length);
},
// ISO week of year
I: function(e, t, n) {
const r = F(e);
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : a(r, t.length);
},
// Day of the month
d: function(e, t, n) {
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : h.d(e, t);
},
// Day of year
D: function(e, t, n) {
const r = re(e);
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : a(r, t.length);
},
// Day of week
E: function(e, t, n) {
const r = e.getDay();
switch (t) {
// Tue
case "E":
case "EE":
case "EEE":
return n.day(r, {
width: "abbreviated",
context: "formatting"
});
// T
case "EEEEE":
return n.day(r, {
width: "narrow",
context: "formatting"
});
// Tu
case "EEEEEE":
return n.day(r, {
width: "short",
context: "formatting"
});
// Tuesday
case "EEEE":
default:
return n.day(r, {
width: "wide",
context: "formatting"
});
}
},
// Local day of week
e: function(e, t, n, r) {
const o = e.getDay(), i = (o - r.weekStartsOn + 8) % 7 || 7;
switch (t) {
// Numerical value (Nth day of week with current locale or weekStartsOn)
case "e":
return String(i);
// Padded numerical value
case "ee":
return a(i, 2);
// 1st, 2nd, ..., 7th
case "eo":
return n.ordinalNumber(i, { unit: "day" });
case "eee":
return n.day(o, {
width: "abbreviated",
context: "formatting"
});
// T
case "eeeee":
return n.day(o, {
width: "narrow",
context: "formatting"
});
// Tu
case "eeeeee":
return n.day(o, {
width: "short",
context: "formatting"
});
// Tuesday
case "eeee":
default:
return n.day(o, {
width: "wide",
context: "formatting"
});
}
},
// Stand-alone local day of week
c: function(e, t, n, r) {
const o = e.getDay(), i = (o - r.weekStartsOn + 8) % 7 || 7;
switch (t) {
// Numerical value (same as in `e`)
case "c":
return String(i);
// Padded numerical value
case "cc":
return a(i, t.length);
// 1st, 2nd, ..., 7th
case "co":
return n.ordinalNumber(i, { unit: "day" });
case "ccc":
return n.day(o, {
width: "abbreviated",
context: "standalone"
});
// T
case "ccccc":
return n.day(o, {
width: "narrow",
context: "standalone"
});
// Tu
case "cccccc":
return n.day(o, {
width: "short",
context: "standalone"
});
// Tuesday
case "cccc":
default:
return n.day(o, {
width: "wide",
context: "standalone"
});
}
},
// ISO day of week
i: function(e, t, n) {
const r = e.getDay(), o = r === 0 ? 7 : r;
switch (t) {
// 2
case "i":
return String(o);
// 02
case "ii":
return a(o, t.length);
// 2nd
case "io":
return n.ordinalNumber(o, { unit: "day" });
// Tue
case "iii":
return n.day(r, {
width: "abbreviated",
context: "formatting"
});
// T
case "iiiii":
return n.day(r, {
width: "narrow",
context: "formatting"
});
// Tu
case "iiiiii":
return n.day(r, {
width: "short",
context: "formatting"
});
// Tuesday
case "iiii":
default:
return n.day(r, {
width: "wide",
context: "formatting"
});
}
},
// AM or PM
a: function(e, t, n) {
const o = e.getHours() / 12 >= 1 ? "pm" : "am";
switch (t) {
case "a":
case "aa":
return n.dayPeriod(o, {
width: "abbreviated",
context: "formatting"
});
case "aaa":
return n.dayPeriod(o, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "aaaaa":
return n.dayPeriod(o, {
width: "narrow",
context: "formatting"
});
case "aaaa":
default:
return n.dayPeriod(o, {
width: "wide",
context: "formatting"
});
}
},
// AM, PM, midnight, noon
b: function(e, t, n) {
const r = e.getHours();
let o;
switch (r === 12 ? o = D.noon : r === 0 ? o = D.midnight : o = r / 12 >= 1 ? "pm" : "am", t) {
case "b":
case "bb":
return n.dayPeriod(o, {
width: "abbreviated",
context: "formatting"
});
case "bbb":
return n.dayPeriod(o, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "bbbbb":
return n.dayPeriod(o, {
width: "narrow",
context: "formatting"
});
case "bbbb":
default:
return n.dayPeriod(o, {
width: "wide",
context: "formatting"
});
}
},
// in the morning, in the afternoon, in the evening, at night
B: function(e, t, n) {
const r = e.getHours();
let o;
switch (r >= 17 ? o = D.evening : r >= 12 ? o = D.afternoon : r >= 4 ? o = D.morning : o = D.night, t) {
case "B":
case "BB":
case "BBB":
return n.dayPeriod(o, {
width: "abbreviated",
context: "formatting"
});
case "BBBBB":
return n.dayPeriod(o, {
width: "narrow",
context: "formatting"
});
case "BBBB":
default:
return n.dayPeriod(o, {
width: "wide",
context: "formatting"
});
}
},
// Hour [1-12]
h: function(e, t, n) {
if (t === "ho") {
let r = e.getHours() % 12;
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
}
return h.h(e, t);
},
// Hour [0-23]
H: function(e, t, n) {
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : h.H(e, t);
},
// Hour [0-11]
K: function(e, t, n) {
const r = e.getHours() % 12;
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : a(r, t.length);
},
// Hour [1-24]
k: function(e, t, n) {
let r = e.getHours();
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : a(r, t.length);
},
// Minute
m: function(e, t, n) {
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : h.m(e, t);
},
// Second
s: function(e, t, n) {
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : h.s(e, t);
},
// Fraction of second
S: function(e, t) {
return h.S(e, t);
},
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function(e, t, n) {
const r = e.getTimezoneOffset();
if (r === 0)
return "Z";
switch (t) {
// Hours and optional minutes
case "X":
return N(r);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XX`
case "XXXX":
case "XX":
return y(r);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XXX`
case "XXXXX":
case "XXX":
// Hours and minutes with `:` delimiter
default:
return y(r, ":");
}
},
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function(e, t, n) {
const r = e.getTimezoneOffset();
switch (t) {
// Hours and optional minutes
case "x":
return N(r);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xx`
case "xxxx":
case "xx":
return y(r);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xxx`
case "xxxxx":
case "xxx":
// Hours and minutes with `:` delimiter
default:
return y(r, ":");
}
},
// Timezone (GMT)
O: function(e, t, n) {
const r = e.getTimezoneOffset();
switch (t) {
// Short
case "O":
case "OO":
case "OOO":
return "GMT" + P(r, ":");
// Long
case "OOOO":
default:
return "GMT" + y(r, ":");
}
},
// Timezone (specific non-location)
z: function(e, t, n) {
const r = e.getTimezoneOffset();
switch (t) {
// Short
case "z":
case "zz":
case "zzz":
return "GMT" + P(r, ":");
// Long
case "zzzz":
default:
return "GMT" + y(r, ":");
}
},
// Seconds timestamp
t: function(e, t, n) {
const r = Math.trunc(+e / 1e3);
return a(r, t.length);
},
// Milliseconds timestamp
T: function(e, t, n) {
return a(+e, t.length);
}
};
function P(e, t = "") {
const n = e > 0 ? "-" : "+", r = Math.abs(e), o = Math.trunc(r / 60), i = r % 60;
return i === 0 ? n + String(o) : n + String(o) + t + a(i, 2);
}
function N(e, t) {
return e % 60 === 0 ? (e > 0 ? "-" : "+") + a(Math.abs(e) / 60, 2) : y(e, t);
}
function y(e, t = "") {
const n = e > 0 ? "-" : "+", r = Math.abs(e), o = a(Math.trunc(r / 60), 2), i = a(r % 60, 2);
return n + o + t + i;
}
function oe(e) {
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
}
function ie(e) {
return !(!oe(e) && typeof e != "number" || isNaN(+p(e)));
}
const ae = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, se = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, ue = /^'([^]*?)'?$/, ce = /''/g, fe = /[a-zA-Z]/;
function B(e, t, n) {
const r = G(), o = n?.locale ?? r.locale ?? V, i = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, s = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, c = p(e, n?.in);
if (!ie(c))
throw new RangeError("Invalid time value");
let u = t.match(se).map((f) => {
const m = f[0];
if (m === "p" || m === "P") {
const O = z[m];
return O(f, o.formatLong);
}
return f;
}).join("").match(ae).map((f) => {
if (f === "''")
return { isToken: !1, value: "'" };
const m = f[0];
if (m === "'")
return { isToken: !1, value: de(f) };
if (A[m])
return { isToken: !0, value: f };
if (m.match(fe))
throw new RangeError(
"Format string contains an unescaped latin alphabet character `" + m + "`"
);
return { isToken: !1, value: f };
});
o.localize.preprocessor && (u = o.localize.preprocessor(c, u));
const d = {
firstWeekContainsDate: i,
weekStartsOn: s,
locale: o
};
return u.map((f) => {
if (!f.isToken) return f.value;
const m = f.value;
(!n?.useAdditionalWeekYearTokens && Z(m) || !n?.useAdditionalDayOfYearTokens && J(m)) && $(m, t, String(e));
const O = A[m[0]];
return O(c, m, o.localize, d);
}).join("");
}
function de(e) {
const t = e.match(ue);
return t ? t[1].replace(ce, "'") : e;
}
function w(e, t) {
const n = () => L(t?.in, NaN), o = le(e);
let i;
if (o.date) {
const d = ye(o.date, 2);
i = pe(d.restDateString, d.year);
}
if (!i || isNaN(+i)) return n();
const s = +i;
let c = 0, u;
if (o.time && (c = De(o.time), isNaN(c)))
return n();
if (o.timezone) {
if (u = ve(o.timezone), isNaN(u)) return n();
} else {
const d = new Date(s + c), f = p(0, t?.in);
return f.setFullYear(
d.getUTCFullYear(),
d.getUTCMonth(),
d.getUTCDate()
), f.setHours(
d.getUTCHours(),
d.getUTCMinutes(),
d.getUTCSeconds(),
d.getUTCMilliseconds()
), f;
}
return p(s + c + u, t?.in);
}
const R = {
dateTimeDelimiter: /[T ]/,
timeZoneDelimiter: /[Z ]/i,
timezone: /([Z+-].*)$/
}, me = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, ge = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, he = /^([+-])(\d{2})(?::?(\d{2}))?$/;
function le(e) {
const t = {}, n = e.split(R.dateTimeDelimiter);
let r;
if (n.length > 2)
return t;
if (/:/.test(n[0]) ? r = n[0] : (t.date = n[0], r = n[1], R.timeZoneDelimiter.test(t.date) && (t.date = e.split(R.timeZoneDelimiter)[0], r = e.substr(
t.date.length,
e.length
))), r) {
const o = R.timezone.exec(r);
o ? (t.time = r.replace(o[1], ""), t.timezone = o[1]) : t.time = r;
}
return t;
}
function ye(e, t) {
const n = new RegExp(
"^(?:(\\d{4}|[+-]\\d{" + (4 + t) + "})|(\\d{2}|[+-]\\d{" + (2 + t) + "})$)"
), r = e.match(n);
if (!r) return { year: NaN, restDateString: "" };
const o = r[1] ? parseInt(r[1]) : null, i = r[2] ? parseInt(r[2]) : null;
return {
year: i === null ? o : i * 100,
restDateString: e.slice((r[1] || r[2]).length)
};
}
function pe(e, t) {
if (t === null) return /* @__PURE__ */ new Date(NaN);
const n = e.match(me);
if (!n) return /* @__PURE__ */ new Date(NaN);
const r = !!n[4], o = v(n[1]), i = v(n[2]) - 1, s = v(n[3]), c = v(n[4]), u = v(n[5]) - 1;
if (r)
return Te(t, c, u) ? Re(t, c, u) : /* @__PURE__ */ new Date(NaN);
{
const d = /* @__PURE__ */ new Date(0);
return !we(t, i, s) || !Oe(t, o) ? /* @__PURE__ */ new Date(NaN) : (d.setUTCFullYear(t, i, Math.max(o, s)), d);
}
}
function v(e) {
return e ? parseInt(e) : 1;
}
function De(e) {
const t = e.match(ge);
if (!t) return NaN;
const n = T(t[1]), r = T(t[2]), o = T(t[3]);
return be(n, r, o) ? n * E + r * Y + o * 1e3 : NaN;
}
function T(e) {
return e && parseFloat(e.replace(",", ".")) || 0;
}
function ve(e) {
if (e === "Z") return 0;
const t = e.match(he);
if (!t) return 0;
const n = t[1] === "+" ? -1 : 1, r = parseInt(t[2]), o = t[3] && parseInt(t[3]) || 0;
return Be(r, o) ? n * (r * E + o * Y) : NaN;
}
function Re(e, t, n) {
const r = /* @__PURE__ */ new Date(0);
r.setUTCFullYear(e, 0, 4);
const o = r.getUTCDay() || 7, i = (t - 1) * 7 + n + 1 - o;
return r.setUTCDate(r.getUTCDate() + i), r;
}
const xe = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function U(e) {
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
}
function we(e, t, n) {
return t >= 0 && t <= 11 && n >= 1 && n <= (xe[t] || (U(e) ? 29 : 28));
}
function Oe(e, t) {
return t >= 1 && t <= (U(e) ? 366 : 365);
}
function Te(e, t, n) {
return t >= 1 && t <= 53 && n >= 0 && n <= 6;
}
function be(e, t, n) {
return e === 24 ? t === 0 && n === 0 : n >= 0 && n < 60 && t >= 0 && t < 60 && e >= 0 && e < 25;
}
function Be(e, t) {
return t >= 0 && t <= 59;
}
const Me = Date.prototype.toJSON, _e = function() {
try {
const e = this.getHours(), t = this.getMinutes(), n = this.getSeconds(), r = this.getMilliseconds(), o = -(this.getTimezoneOffset() / 60);
if (o === 0.15 && e === 0 && t === 9 && n === 21 || e - o === 0 && t === 0 && n === 0 && r === 0)
return this.toISOString().split("T")[0];
const i = new Date(
this.getFullYear(),
this.getMonth(),
this.getDate(),
e,
t,
n,
r
);
i.setHours(this.getHours() + o);
const s = i.toISOString().replace(/(\.0+)?Z$/, ""), c = o >= 0 ? "+" : "-", u = Math.abs(o) < 10 ? "0" : "";
return s + c + u + Math.abs(o).toString().split(".")[0] + ":00";
} catch {
Date.prototype.toJSON = Me;
const t = this.toJSON();
return Date.prototype.toJSON = _e, t;
}
}, Ce = new Intl.DateTimeFormat("fr-FR", {
day: "numeric",
month: "long",
weekday: "long",
year: "numeric"
}), Se = new Intl.DateTimeFormat("fr-FR", {
day: "numeric",
month: "short"
}), Ae = new Intl.DateTimeFormat("fr-FR", {
hour: "numeric",
minute: "2-digit"
});
function Ue(e, t) {
return e instanceof Date ? e : typeof e == "string" ? w(e) : t;
}
function Ie(e) {
return K(e, "yyyy-MM-ddXXX", /* @__PURE__ */ new Date());
}
function qe(e) {
const t = w(e);
return e = B(t, "EEEE d LLLL yyyy H'h'mm", { locale: b }), e.endsWith(" 0h00") && (e = e.substring(0, e.length - 5)), e;
}
function We(e, t) {
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate() ? Ae.format(e) : Se.format(e);
}
function He(e) {
const t = e instanceof Date ? e : w(e);
let n = B(t, "d LLLL yyyy H'h'mm", { locale: b });
return n.endsWith(" 0h00") && (n = n.substring(0, n.length - 5)), n;
}
function Fe(e) {
const t = e instanceof Date ? e : w(e);
return B(t, "H'h'mm", { locale: b });
}
function je(e) {
return new Date(e.getTime() - e.getTimezoneOffset() * 6e4).toISOString().split("T")[0];
}
function I(e, t, n) {
if (!n.has(e.uid)) {
if (n.add(e.uid), t.documentByUid !== void 0 && e.depotInitialLectureDefinitiveRef !== void 0) {
const r = t.documentByUid[e.depotInitialLectureDefinitiveRef];
r !== void 0 && (e.depotInitialLectureDefinitive = r, x(r, t, n));
}
if (t.organeByUid !== void 0 && e.organeRef !== void 0) {
const r = t.organeByUid[e.organeRef];
r !== void 0 && (e.organe = r, g(r, t, n));
}
if (t.organeByUid !== void 0 && e.provenanceRef !== void 0) {
const r = t.organeByUid[e.provenanceRef];
r !== void 0 && (e.provenance = r, g(r, t, n));
}
if (t.acteurByUid !== void 0 && e.rapporteurs !== void 0)
for (const r of e.rapporteurs) {
const o = t.acteurByUid[r.acteurRef];
o !== void 0 && (r.acteur = o, l(o, t, n));
}
if (t.reunionByUid !== void 0 && e.reunionRef !== void 0) {
const r = t.reunionByUid[e.reunionRef];
if (r !== void 0 && (e.reunion = r, Pe(r, t, n), e.odjRef !== void 0)) {
const o = r.odj;
if (o !== void 0 && o.pointsOdj !== void 0) {
for (const i of o.pointsOdj)
if (i.uid === e.odjRef) {
e.odj = i;
break;
}
}
}
}
if (t.documentByUid !== void 0 && e.texteAdopteRef !== void 0) {
const r = t.documentByUid[e.texteAdopteRef];
r !== void 0 && (e.texteAdopte = r, x(r, t, n));
}
if (t.documentByUid !== void 0 && e.texteAssocieRef !== void 0) {
const r = t.documentByUid[e.texteAssocieRef];
r !== void 0 && (e.texteAssocie = r, x(r, t, n));
}
if (t.documentByUid !== void 0 && e.textesAssocies !== void 0)
for (const r of e.textesAssocies) {
const o = t.documentByUid[r.texteAssocieRef];
o !== void 0 && (r.texteAssocie = o, x(o, t, n));
}
if (t.scrutinByUid !== void 0 && e.voteRefs !== void 0) {
const r = [];
for (const o of e.voteRefs) {
const i = t.scrutinByUid[o];
i !== void 0 && (r.push(i), Ne(i, t, n));
}
e.votes = r;
}
for (const r of e.actesLegislatifs || [])
I(r, t, n);
}
return e;
}
function l(e, t, n) {
if (!n.has(e.uid) && (n.add(e.uid), t.organeByUid !== void 0))
for (const r of e.mandats || []) {
const o = [];
for (const i of r.organesRefs) {
const s = t.organeByUid[i];
s !== void 0 && (o.push(s), g(s, t, n));
}
r.organes = o;
}
return e;
}
function Qe(e, t, n) {
if (!n.has(e.uid)) {
n.add(e.uid);
const r = e.signataires, o = r.auteur;
if (t.acteurByUid !== void 0 && o.acteurRef !== void 0) {
const i = t.acteurByUid[o.acteurRef];
i !== void 0 && (o.acteur = i, l(i, t, n));
}
if (t.organeByUid !== void 0 && o.auteurRapporteurOrganeRef !== void 0) {
const i = t.organeByUid[o.auteurRapporteurOrganeRef];
i !== void 0 && (o.auteurRapporteurOrgane = i, g(i, t, n));
}
if (t.organeByUid !== void 0 && o.gouvernementRef !== void 0) {
const i = t.organeByUid[o.gouvernementRef];
i !== void 0 && (o.gouvernement = i, g(i, t, n));
}
if (t.organeByUid !== void 0 && o.groupePolitiqueRef !== void 0) {
const i = t.organeByUid[o.groupePolitiqueRef];
i !== void 0 && (o.groupePolitique = i, g(i, t, n));
}
if (t.acteurByUid !== void 0 && r.cosignatairesRefs !== void 0) {
const s = [];
for (const c of r.cosignatairesRefs || []) {
const u = t.acteurByUid[c];
u !== void 0 && (s.push(u), l(u, t, n));
}
r.cosignataires = s;
}
}
return e;
}
function q(e, t, n) {
for (const r of e.auteurs) {
const o = r.acteur;
if (t.acteurByUid !== void 0 && o !== void 0) {
const i = t.acteurByUid[o.acteurRef];
i !== void 0 && (o.acteur = i, l(i, t, n));
}
if (t.organeByUid !== void 0 && r.organeRef !== void 0) {
const i = t.organeByUid[r.organeRef];
i !== void 0 && (r.organe = i, g(i, t, n));
}
}
if (t.dossierByUid !== void 0) {
const r = t.dossierByUid[e.dossierRef];
r !== void 0 && (e.dossier = r, W(r, t, n));
}
for (const r of e.divisions || [])
q(r, t, n);
return e;
}
function x(e, t, n) {
if (!n.has(e.uid)) {
n.add(e.uid);
for (const r of e.auteurs) {
const o = r.acteur;
if (t.acteurByUid !== void 0 && o !== void 0) {
const i = t.acteurByUid[o.acteurRef];
i !== void 0 && (o.acteur = i, l(i, t, n));
}
if (t.organeByUid !== void 0 && r.organeRef !== void 0) {
const i = t.organeByUid[r.organeRef];
i !== void 0 && (r.organe = i, g(i, t, n));
}
}
if (t.dossierByUid !== void 0) {
const r = t.dossierByUid[e.dossierRef];
r !== void 0 && (e.dossier = r, W(r, t, n));
}
for (const r of e.divisions || [])
q(r, t, n);
}
return e;
}
function W(e, t, n) {
if (!n.has(e.uid)) {
n.add(e.uid);
for (const o of e.actesLegislatifs ?? [])
I(o, t, n);
const r = e.initiateur;
if (r !== void 0) {
if (t.acteurByUid !== void 0)
for (const o of r.acteurs || []) {
const i = t.acteurByUid[o.acteurRef];
if (i !== void 0 && (o.acteur = i, l(i, t, n)), i !== void 0 && o.mandatRef !== void 0) {
for (const s of i.mandats || [])
if (s.uid === o.mandatRef) {
o.mandat = s;
break;
}
}
}
if (t.organeByUid !== void 0 && r.organeRef !== void 0) {
const o = t.organeByUid[r.organeRef];
o !== void 0 && (r.organe = o, g(o, t, n));
}
}
}
return e;
}
function g(e, t, n) {
if (!n.has(e.uid)) {
if (n.add(e.uid), t.organeByUid !== void 0 && e.organeParentRef !== void 0) {
const r = t.organeByUid[e.organeParentRef];
r !== void 0 && (e.organeParent = r, g(r, t, n));
}
if (t.organeByUid !== void 0 && e.organePrecedentRef !== void 0) {
const r = t.organeByUid[e.organePrecedentRef];
r !== void 0 && (e.organePrecedent = r, g(r, t, n));
}
}
return e;
}
function Pe(e, t, n) {
if (!n.has(e.uid)) {
n.add(e.uid);
const r = e.demandeurs;
if (r !== void 0) {
if (t.acteurByUid !== void 0)
for (const o of r.acteurs || []) {
const i = t.acteurByUid[o.acteurRef];
i !== void 0 && (o.acteur = i, l(i, t, n));
}
if (t.organeByUid !== void 0) {
const o = r.organe;
if (o !== void 0) {
const i = t.organeByUid[o.organeRef];
i !== void 0 && (o.organe = i, g(i, t, n));
}
}
}
if (t.organeByUid !== void 0 && e.organeReuniRef !== void 0) {
const o = t.organeByUid[e.organeReuniRef];
o !== void 0 && (e.organeReuni = o, g(o, t, n));
}
if (t.acteurByUid !== void 0) {
const o = e.participants;
if (o !== void 0)
for (const i of o.participantsInternes || []) {
const s = t.acteurByUid[i.acteurRef];
s !== void 0 && (i.acteur = s, l(s, t, n));
}
}
}
return e;
}
function Ne(e, t, n) {
return n.has(e.uid) || n.add(e.uid), e;
}
function Xe(e) {
if (e == null)
return "Organe inconnu";
switch (e.codeType) {
case _.Cmp:
return "Commission mixte paritaire";
case _.Gouvernement:
return e.libelle;
default:
return e.libelleAbrege;
}
}
export {
sn as AccordGouvernementDepotHorsDelai,
un as Action,
cn as AmendementsConvert,
fn as AvantAApres,
ze as Cause,
Ze as CausePositionVote,
Je as Civ,
$e as CodeActe,
dn as CodeEtat,
Ke as CodeNatureDep,
et as CodeSortScrutin,
_ as CodeTypeOrgane,
tt as CodeTypeVote,
nt as Decision,
mn as DivisionType,
rt as DocumentDenominationStructurelle,
ot as DocumentUrlFormat,
it as DossierParlementaireXsiType,
gn as EtatAmendementCode,
hn as EtatAmendementLibelle,
at as EtatCycleDeVie,
k as Facet,
st as FamSocPro,
ut as FinalStatus,
C as Follow,
ct as FormatReunion,
ft as Legislature,
dt as LibelleSortScrutin,
mt as LibelleTypeVote,
gt as LieuVote,
ht as ModePublicationDesVotes,
lt as Motif,
yt as NatureTravauxOdj,
pt as PersonneAuditionneeXsiType,
Dt as PointOdjXsiType,
vt as PositionMajoritaire,
Rt as PositionPolitique,
xt as Presence,
wt as Procedure,
Ot as Provenance,
Tt as Qualite,
bt as Quantieme,
Bt as Regime,
Mt as RegionType,
_t as ReunionXsiType,
ln as SortAmendement,
St as StatusOnly,
At as StatutAdoption,
Pt as TexteExterneAssocieTypeDoc,
Nt as TypeActeLegislatif,
yn as TypeAuteur,
Lt as TypeBudget,
Et as TypeCorrection,
Yt as TypeDocument,
kt as TypeJo,
Ct as TypeJoQuestion,
Ut as TypeMajorite,
It as TypeMandat,
pn as TypeMimeNom,
Dn as TypeMimeType,
qt as TypeMission,
Wt as TypeOrgane,
Ht as TypePointOdj,
vn as TypePosition,
Ft as TypeQuestion,
jt as TypeReunion,
Qt as TypeTexte,
Ye as allFacets,
ke as allFollows,
Xt as capitalizeFirstLetter,
Gt as commissionFondUidFromDossier,
Ue as dateFromNullableDateOrIsoString,
Ie as dateFromYearMonthDayTimezoneString,
qe as displayDateFromLocalIsoString,
Me as existingDateToJson,
We as formatRelativeFrenchTime,
Ce as frenchDateFormat,
Se as frenchDateSameYearShortFormat,
He as frenchDateWithoutDayOfWeekFromDateOrString,
Ae as frenchTimeFormat,
Fe as frenchTimeFromDateOrString,
l as insertActeurReferences,
Qe as insertAmendementReferences,
x as insertDocumentReferences,
W as insertDossierReferences,
g as insertOrganeReferences,
Pe as insertReunionReferences,
Ne as insertScrutinReferences,
Vt as iterDocumentOrDivisionUrls,
je as localIso8601StringFromDate,
_e as patchedDateToJson,
zt as pathFromDocumentUid,
Xe as shortNameFromOrgane,
Zt as stateFromActePath,
Jt as stateFromActes,
$t as stateFromDossier,
Kt as statusFromCodierLibelle,
en as uncapitalizeFirstLetter,
tn as urlFromDocument,
nn as urlFromScrutin,
rn as walkActes,
on as walkDocumentAndDivisions
};