@talisdev/bibliographic-resource-parsers-lib 5.33.2 → 5.34.0
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.
|
@@ -1182,19 +1182,19 @@ const oc = /* @__PURE__ */ m("$ZodObject", (e, t) => {
|
|
|
1182
1182
|
}), sc = /* @__PURE__ */ m("$ZodObjectJIT", (e, t) => {
|
|
1183
1183
|
oc.init(e, t);
|
|
1184
1184
|
const r = e._zod.parse, n = Or(() => Ko(t)), o = (d) => {
|
|
1185
|
-
const g = new ka(["shape", "payload", "ctx"]), k = n.value, v = (
|
|
1186
|
-
const D = fn(
|
|
1185
|
+
const g = new ka(["shape", "payload", "ctx"]), k = n.value, v = (z) => {
|
|
1186
|
+
const D = fn(z);
|
|
1187
1187
|
return `shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`;
|
|
1188
1188
|
};
|
|
1189
1189
|
g.write("const input = payload.value;");
|
|
1190
1190
|
const O = /* @__PURE__ */ Object.create(null);
|
|
1191
1191
|
let q = 0;
|
|
1192
|
-
for (const
|
|
1193
|
-
O[
|
|
1192
|
+
for (const z of k.keys)
|
|
1193
|
+
O[z] = `key_${q++}`;
|
|
1194
1194
|
g.write("const newResult = {};");
|
|
1195
|
-
for (const
|
|
1196
|
-
const D = O[
|
|
1197
|
-
g.write(`const ${D} = ${v(
|
|
1195
|
+
for (const z of k.keys) {
|
|
1196
|
+
const D = O[z], U = fn(z), Q = d[z]?._zod?.optout === "optional";
|
|
1197
|
+
g.write(`const ${D} = ${v(z)};`), Q ? g.write(`
|
|
1198
1198
|
if (${D}.issues.length) {
|
|
1199
1199
|
if (${U} in input) {
|
|
1200
1200
|
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
@@ -1232,7 +1232,7 @@ const oc = /* @__PURE__ */ m("$ZodObject", (e, t) => {
|
|
|
1232
1232
|
}
|
|
1233
1233
|
g.write("payload.value = newResult;"), g.write("return payload;");
|
|
1234
1234
|
const ee = g.compile();
|
|
1235
|
-
return (
|
|
1235
|
+
return (z, D) => ee(d, z, D);
|
|
1236
1236
|
};
|
|
1237
1237
|
let i;
|
|
1238
1238
|
const s = at, a = !Lo.jitless, u = a && yi.value, l = t.catchall;
|
|
@@ -5676,7 +5676,7 @@ const Lm = (e) => {
|
|
|
5676
5676
|
return L();
|
|
5677
5677
|
}
|
|
5678
5678
|
};
|
|
5679
|
-
var
|
|
5679
|
+
var x = /* @__PURE__ */ ((e) => (e.NoResourceFound = "NoResourceFound", e.Z3988 = "Z3988", e.Z3988SearchResult = "Z3988SearchResult", e.Amazon = "Amazon", e.CupOfJo = "CupOfJo", e.IngentaConnect = "IngentaConnect", e.Jstor = "Jstor", e.Milne = "Milne", e.Primo = "Primo", e.SagePub = "SagePub", e.SageVideo = "SageVideo", e.ScienceDirect = "ScienceDirect", e.Springer = "Springer", e.Youtube = "Youtube", e.TaylorFrancis = "TaylorFrancis", e.Wiley = "Wiley", e.VuFind = "VuFind", e.ClinicalKey = "ClinicalKey", e.DOAJ = "DOAJ", e.Ebscohost = "Ebscohost", e.OpenStax = "OpenStax", e.CambridgeJournalsOnline = "CambridgeJournalsOnline", e.OpenTextbook = "OpenTextbook", e.AhaJournals = "AhaJournals", e.Ijees = "Ijees", e.BloomsburyCollections = "BloomsburyCollections", e.HeritageCirqa = "HeritageCirqa", e.BritishMedicalJournal = "BritishMedicalJournal", e.SummonSearchResult = "SummonSearchResult", e.ApplePodcasts = "ApplePodcasts", e.Arxiv = "Arxiv", e.KanopyVideo = "KanopyVideo", e.LaTrobeOpal = "LaTrobeOpal", e.BYUScholarsArchive = "BYUScholarsArchive", e.Informit = "Informit", e.Brill = "Brill", e))(x || {});
|
|
5680
5680
|
const Jn = {
|
|
5681
5681
|
NoResourceFound: qs,
|
|
5682
5682
|
Z3988: qr,
|
|
@@ -5714,7 +5714,7 @@ const Jn = {
|
|
|
5714
5714
|
BYUScholarsArchive: Tp,
|
|
5715
5715
|
Informit: Mm,
|
|
5716
5716
|
Brill: cg
|
|
5717
|
-
}, ug = "5.
|
|
5717
|
+
}, ug = "5.34.0", ui = () => ug, lg = ["com.au", "com", "ca", "co.uk", "de", "fr", "nl"], pg = lg.flatMap((e) => [
|
|
5718
5718
|
`amazon.${e}`,
|
|
5719
5719
|
`www.amazon.${e}`
|
|
5720
5720
|
]), mv = {
|
|
@@ -5725,226 +5725,233 @@ const Jn = {
|
|
|
5725
5725
|
regexp: "^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/search"
|
|
5726
5726
|
},
|
|
5727
5727
|
name: "Worldcat Search Results",
|
|
5728
|
-
parsers: [
|
|
5728
|
+
parsers: [x.Z3988SearchResult]
|
|
5729
5729
|
},
|
|
5730
5730
|
{
|
|
5731
5731
|
matcher: {
|
|
5732
5732
|
regexp: "^https://[a-z0-9\\-]+\\.summon\\.serialssolutions\\.com/"
|
|
5733
5733
|
},
|
|
5734
5734
|
name: "Summon Search Results",
|
|
5735
|
-
parsers: [
|
|
5735
|
+
parsers: [x.SummonSearchResult]
|
|
5736
5736
|
},
|
|
5737
5737
|
{
|
|
5738
5738
|
matcher: { regexp: "cupofjo[.-]com" },
|
|
5739
5739
|
name: "Cup of Jo",
|
|
5740
|
-
parsers: [
|
|
5740
|
+
parsers: [x.CupOfJo]
|
|
5741
5741
|
},
|
|
5742
5742
|
{
|
|
5743
5743
|
matcher: { hostnames: ["youtube.com", "www.youtube.com"] },
|
|
5744
5744
|
name: "Youtube",
|
|
5745
|
-
parsers: [
|
|
5745
|
+
parsers: [x.Youtube]
|
|
5746
5746
|
},
|
|
5747
5747
|
{
|
|
5748
5748
|
matcher: { regexp: "www[-.]sciencedirect[.-]com" },
|
|
5749
5749
|
name: "Science Direct",
|
|
5750
|
-
parsers: [
|
|
5750
|
+
parsers: [x.ScienceDirect]
|
|
5751
5751
|
},
|
|
5752
5752
|
{
|
|
5753
5753
|
matcher: { hostnames: pg },
|
|
5754
5754
|
name: "Amazon",
|
|
5755
|
-
parsers: [
|
|
5755
|
+
parsers: [x.Amazon]
|
|
5756
5756
|
},
|
|
5757
5757
|
{
|
|
5758
5758
|
matcher: { regexp: "^https://sk\\.sagepub\\.com/video/" },
|
|
5759
5759
|
name: "Sage Video",
|
|
5760
|
-
parsers: [
|
|
5760
|
+
parsers: [x.SageVideo]
|
|
5761
5761
|
},
|
|
5762
5762
|
{
|
|
5763
5763
|
matcher: {
|
|
5764
5764
|
regexp: "[/.-]((www|journals)[.-])?sagepub[.-]com"
|
|
5765
5765
|
},
|
|
5766
5766
|
name: "Sage Publishing",
|
|
5767
|
-
parsers: [
|
|
5767
|
+
parsers: [x.SagePub]
|
|
5768
5768
|
},
|
|
5769
5769
|
{
|
|
5770
5770
|
matcher: { regexp: "www[.-]tandfonline[.-]com" },
|
|
5771
5771
|
name: "Taylor & Francis",
|
|
5772
|
-
parsers: [
|
|
5772
|
+
parsers: [x.TaylorFrancis]
|
|
5773
5773
|
},
|
|
5774
5774
|
{
|
|
5775
5775
|
matcher: {
|
|
5776
5776
|
regexp: "[/.-]((www|onlinelibrary)[.-])?wiley[.-]com"
|
|
5777
5777
|
},
|
|
5778
5778
|
name: "Wiley",
|
|
5779
|
-
parsers: [
|
|
5779
|
+
parsers: [x.Wiley]
|
|
5780
5780
|
},
|
|
5781
5781
|
{
|
|
5782
5782
|
matcher: {
|
|
5783
5783
|
regexp: "^https://[a-z0-9\\-]+[.-]on[.-]worldcat[.-]org"
|
|
5784
5784
|
},
|
|
5785
5785
|
name: "Worldcat",
|
|
5786
|
-
parsers: [
|
|
5786
|
+
parsers: [x.Z3988]
|
|
5787
5787
|
},
|
|
5788
5788
|
{
|
|
5789
5789
|
matcher: { hostnames: ["catalogue.rau.ac.uk"] },
|
|
5790
5790
|
name: "Royal Agricultural University Library",
|
|
5791
|
-
parsers: [
|
|
5791
|
+
parsers: [x.Z3988]
|
|
5792
5792
|
},
|
|
5793
5793
|
{
|
|
5794
5794
|
matcher: { regexp: "link[.-]springer[.-]com" },
|
|
5795
5795
|
name: "Springer",
|
|
5796
|
-
parsers: [
|
|
5796
|
+
parsers: [x.Springer]
|
|
5797
5797
|
},
|
|
5798
5798
|
{
|
|
5799
5799
|
matcher: {
|
|
5800
5800
|
regexp: "^https://vufind\\.lboro\\.ac\\.uk/(Record|PrimoRecord)"
|
|
5801
5801
|
},
|
|
5802
5802
|
name: "VuFind",
|
|
5803
|
-
parsers: [
|
|
5803
|
+
parsers: [x.VuFind]
|
|
5804
5804
|
},
|
|
5805
5805
|
{
|
|
5806
5806
|
matcher: { regexp: "www[.-]clinicalkey[.-]com" },
|
|
5807
5807
|
name: "ClinicalKey",
|
|
5808
|
-
parsers: [
|
|
5808
|
+
parsers: [x.ClinicalKey]
|
|
5809
5809
|
},
|
|
5810
5810
|
{
|
|
5811
5811
|
matcher: {
|
|
5812
5812
|
regexp: "www[.-]jstor[.-]org"
|
|
5813
5813
|
},
|
|
5814
5814
|
name: "JSTOR",
|
|
5815
|
-
parsers: [
|
|
5815
|
+
parsers: [x.Jstor]
|
|
5816
5816
|
},
|
|
5817
5817
|
{
|
|
5818
5818
|
matcher: { regexp: "doaj[.-]org" },
|
|
5819
5819
|
name: "DOAJ",
|
|
5820
|
-
parsers: [
|
|
5820
|
+
parsers: [x.DOAJ]
|
|
5821
5821
|
},
|
|
5822
5822
|
{
|
|
5823
5823
|
matcher: {
|
|
5824
5824
|
regexp: "[/.-]ingentaconnect[.-]com"
|
|
5825
5825
|
},
|
|
5826
5826
|
name: "IngentaConnect",
|
|
5827
|
-
parsers: [
|
|
5827
|
+
parsers: [x.IngentaConnect]
|
|
5828
5828
|
},
|
|
5829
5829
|
{
|
|
5830
5830
|
matcher: {
|
|
5831
5831
|
regexp: "research[.-]ebsco[.-]com"
|
|
5832
5832
|
},
|
|
5833
5833
|
name: "EBSCOHost",
|
|
5834
|
-
parsers: [
|
|
5834
|
+
parsers: [x.Ebscohost]
|
|
5835
5835
|
},
|
|
5836
5836
|
{
|
|
5837
5837
|
matcher: {
|
|
5838
5838
|
regexp: "openstax[-.]org"
|
|
5839
5839
|
},
|
|
5840
5840
|
name: "OpenStax",
|
|
5841
|
-
parsers: [
|
|
5841
|
+
parsers: [x.OpenStax]
|
|
5842
5842
|
},
|
|
5843
5843
|
{
|
|
5844
5844
|
matcher: {
|
|
5845
5845
|
regexp: "open[.-]umn[.-]edu"
|
|
5846
5846
|
},
|
|
5847
5847
|
name: "OpenTextbook",
|
|
5848
|
-
parsers: [
|
|
5848
|
+
parsers: [x.OpenTextbook]
|
|
5849
5849
|
},
|
|
5850
5850
|
{
|
|
5851
5851
|
matcher: {
|
|
5852
5852
|
regexp: "milneopentextbooks[-.]org"
|
|
5853
5853
|
},
|
|
5854
5854
|
name: "Milne Open Textbooks",
|
|
5855
|
-
parsers: [
|
|
5855
|
+
parsers: [x.Milne]
|
|
5856
5856
|
},
|
|
5857
5857
|
{
|
|
5858
5858
|
matcher: {
|
|
5859
5859
|
regexp: "www[.-]perlego[.-]com"
|
|
5860
5860
|
},
|
|
5861
5861
|
name: "Perlego",
|
|
5862
|
-
parsers: [
|
|
5862
|
+
parsers: [x.Z3988]
|
|
5863
5863
|
},
|
|
5864
5864
|
{
|
|
5865
5865
|
matcher: {
|
|
5866
5866
|
regexp: "www[.-]ahajournals[.-]org"
|
|
5867
5867
|
},
|
|
5868
5868
|
name: "AHA Journals",
|
|
5869
|
-
parsers: [
|
|
5869
|
+
parsers: [x.AhaJournals]
|
|
5870
5870
|
},
|
|
5871
5871
|
{
|
|
5872
5872
|
matcher: {
|
|
5873
5873
|
regexp: "www[.-]cambridge[.-]org"
|
|
5874
5874
|
},
|
|
5875
5875
|
name: "Cambridge Journals Online",
|
|
5876
|
-
parsers: [
|
|
5876
|
+
parsers: [x.CambridgeJournalsOnline]
|
|
5877
5877
|
},
|
|
5878
5878
|
{
|
|
5879
5879
|
matcher: {
|
|
5880
5880
|
regexp: "www[.-]nieindia[.-]org"
|
|
5881
5881
|
},
|
|
5882
5882
|
name: "International Journal of Ecology and Environmental Sciences",
|
|
5883
|
-
parsers: [
|
|
5883
|
+
parsers: [x.Ijees]
|
|
5884
5884
|
},
|
|
5885
5885
|
{
|
|
5886
5886
|
matcher: {
|
|
5887
5887
|
regexp: "www[.-]bloomsburycollections[.-]com"
|
|
5888
5888
|
},
|
|
5889
5889
|
name: "Bloomsbury Collections",
|
|
5890
|
-
parsers: [
|
|
5890
|
+
parsers: [x.BloomsburyCollections]
|
|
5891
5891
|
},
|
|
5892
5892
|
{
|
|
5893
5893
|
matcher: {
|
|
5894
5894
|
regexp: "cirqahosting[.-]com"
|
|
5895
5895
|
},
|
|
5896
5896
|
name: "Heritage Cirqa",
|
|
5897
|
-
parsers: [
|
|
5897
|
+
parsers: [x.HeritageCirqa]
|
|
5898
5898
|
},
|
|
5899
5899
|
{
|
|
5900
5900
|
matcher: {
|
|
5901
5901
|
regexp: "www[.-]bmj[.-]com"
|
|
5902
5902
|
},
|
|
5903
5903
|
name: "British Medical Journal",
|
|
5904
|
-
parsers: [
|
|
5904
|
+
parsers: [x.BritishMedicalJournal]
|
|
5905
5905
|
},
|
|
5906
5906
|
{
|
|
5907
5907
|
matcher: {
|
|
5908
5908
|
regexp: "podcasts[.-]apple[.-]com"
|
|
5909
5909
|
},
|
|
5910
5910
|
name: "Apple Podcasts",
|
|
5911
|
-
parsers: [
|
|
5911
|
+
parsers: [x.ApplePodcasts]
|
|
5912
5912
|
},
|
|
5913
5913
|
{
|
|
5914
5914
|
matcher: {
|
|
5915
5915
|
regexp: "arxiv[.-]org"
|
|
5916
5916
|
},
|
|
5917
5917
|
name: "arxiv",
|
|
5918
|
-
parsers: [
|
|
5918
|
+
parsers: [x.Arxiv]
|
|
5919
5919
|
},
|
|
5920
5920
|
{
|
|
5921
5921
|
matcher: { regexp: "kanopy[.-]com" },
|
|
5922
5922
|
name: "Kanopy Video",
|
|
5923
|
-
parsers: [
|
|
5923
|
+
parsers: [x.KanopyVideo]
|
|
5924
5924
|
},
|
|
5925
5925
|
{
|
|
5926
5926
|
matcher: {
|
|
5927
5927
|
regexp: "opal[.-]latrobe[.-]edu[.-]au"
|
|
5928
5928
|
},
|
|
5929
5929
|
name: "La Trobe Opal",
|
|
5930
|
-
parsers: [
|
|
5930
|
+
parsers: [x.LaTrobeOpal]
|
|
5931
5931
|
},
|
|
5932
5932
|
{
|
|
5933
5933
|
matcher: {
|
|
5934
5934
|
hostnames: ["scholarsarchive.byu.edu"]
|
|
5935
5935
|
},
|
|
5936
5936
|
name: "BYU Scholars Archive",
|
|
5937
|
-
parsers: [
|
|
5937
|
+
parsers: [x.BYUScholarsArchive]
|
|
5938
5938
|
},
|
|
5939
5939
|
{
|
|
5940
5940
|
matcher: { regexp: "informit[.-]org" },
|
|
5941
5941
|
name: "Informit",
|
|
5942
|
-
parsers: [
|
|
5942
|
+
parsers: [x.Informit]
|
|
5943
5943
|
},
|
|
5944
5944
|
{
|
|
5945
5945
|
matcher: { regexp: "brill[.-]com" },
|
|
5946
5946
|
name: "Brill",
|
|
5947
|
-
parsers: [
|
|
5947
|
+
parsers: [x.Brill]
|
|
5948
|
+
},
|
|
5949
|
+
{
|
|
5950
|
+
matcher: {
|
|
5951
|
+
regexp: "/(discovery|primo-explore)/fulldisplay"
|
|
5952
|
+
},
|
|
5953
|
+
name: "Primo",
|
|
5954
|
+
parsers: [x.Primo]
|
|
5948
5955
|
}
|
|
5949
5956
|
]
|
|
5950
5957
|
}, li = R({
|
|
@@ -5962,7 +5969,7 @@ const Jn = {
|
|
|
5962
5969
|
}), fg = R({
|
|
5963
5970
|
siteRegistrations: B(hi),
|
|
5964
5971
|
version: h()
|
|
5965
|
-
}), gv = (e) => fg.safeParse(e).success, vv = (e) => hi.safeParse(e).success, bv = (e) => fi.safeParse(e).success, hg = (e) => Object.values(
|
|
5972
|
+
}), gv = (e) => fg.safeParse(e).success, vv = (e) => hi.safeParse(e).success, bv = (e) => fi.safeParse(e).success, hg = (e) => Object.values(x).includes(e), dg = (e) => typeof e == "object" && e !== null, mg = R({
|
|
5966
5973
|
url: h(),
|
|
5967
5974
|
document: Hl(dg)
|
|
5968
5975
|
}), _v = (e) => mg.safeParse(e).success;
|
|
@@ -6016,8 +6023,8 @@ function tt() {
|
|
|
6016
6023
|
O = O.split(`${q}*`).join(`${q}{0,${ee}}`).split(`${q}+`).join(`${q}{1,${ee}}`);
|
|
6017
6024
|
return O;
|
|
6018
6025
|
}, v = (O, q, ee) => {
|
|
6019
|
-
const
|
|
6020
|
-
i(O, D, q), l[O] = D, c[D] = q, u[D] =
|
|
6026
|
+
const z = k(q), D = f++;
|
|
6027
|
+
i(O, D, q), l[O] = D, c[D] = q, u[D] = z, s[D] = new RegExp(q, ee ? "g" : void 0), a[D] = new RegExp(z, ee ? "g" : void 0);
|
|
6021
6028
|
};
|
|
6022
6029
|
v("NUMERICIDENTIFIER", "0|[1-9]\\d*"), v("NUMERICIDENTIFIERLOOSE", "\\d+"), v("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${d}*`), v("MAINVERSION", `(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`), v("MAINVERSIONLOOSE", `(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`), v("PRERELEASEIDENTIFIER", `(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`), v("PRERELEASEIDENTIFIERLOOSE", `(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`), v("PRERELEASE", `(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`), v("PRERELEASELOOSE", `(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`), v("BUILDIDENTIFIER", `${d}+`), v("BUILD", `(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`), v("FULLPLAIN", `v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`), v("FULL", `^${c[l.FULLPLAIN]}$`), v("LOOSEPLAIN", `[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`), v("LOOSE", `^${c[l.LOOSEPLAIN]}$`), v("GTLT", "((?:<|>)?=?)"), v("XRANGEIDENTIFIERLOOSE", `${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), v("XRANGEIDENTIFIER", `${c[l.NUMERICIDENTIFIER]}|x|X|\\*`), v("XRANGEPLAIN", `[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`), v("XRANGEPLAINLOOSE", `[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`), v("XRANGE", `^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`), v("XRANGELOOSE", `^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`), v("COERCEPLAIN", `(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`), v("COERCE", `${c[l.COERCEPLAIN]}(?:$|[^\\d])`), v("COERCEFULL", c[l.COERCEPLAIN] + `(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`), v("COERCERTL", c[l.COERCE], !0), v("COERCERTLFULL", c[l.COERCEFULL], !0), v("LONETILDE", "(?:~>?)"), v("TILDETRIM", `(\\s*)${c[l.LONETILDE]}\\s+`, !0), t.tildeTrimReplace = "$1~", v("TILDE", `^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`), v("TILDELOOSE", `^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`), v("LONECARET", "(?:\\^)"), v("CARETTRIM", `(\\s*)${c[l.LONECARET]}\\s+`, !0), t.caretTrimReplace = "$1^", v("CARET", `^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`), v("CARETLOOSE", `^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`), v("COMPARATORLOOSE", `^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`), v("COMPARATOR", `^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`), v("COMPARATORTRIM", `(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`, !0), t.comparatorTrimReplace = "$1$2$3", v("HYPHENRANGE", `^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`), v("HYPHENRANGELOOSE", `^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`), v("STAR", "(<|>)?=?\\s*\\*"), v("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), v("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
6023
6030
|
})(it, it.exports)), it.exports;
|
|
@@ -6581,12 +6588,12 @@ function fe() {
|
|
|
6581
6588
|
for (; I && A.length; )
|
|
6582
6589
|
I = A.every((w) => C.intersects(w, _)), C = A.pop();
|
|
6583
6590
|
return I;
|
|
6584
|
-
}, ee = (S, _) => (S = S.replace(c[u.BUILD], ""), s("comp", S, _), S = F(S, _), s("caret", S), S = D(S, _), s("tildes", S), S = N(S, _), s("xrange", S), S = Ct(S, _), s("stars", S), S),
|
|
6591
|
+
}, ee = (S, _) => (S = S.replace(c[u.BUILD], ""), s("comp", S, _), S = F(S, _), s("caret", S), S = D(S, _), s("tildes", S), S = N(S, _), s("xrange", S), S = Ct(S, _), s("stars", S), S), z = (S) => !S || S.toLowerCase() === "x" || S === "*", D = (S, _) => S.trim().split(/\s+/).map((I) => U(I, _)).join(" "), U = (S, _) => {
|
|
6585
6592
|
const I = _.loose ? c[u.TILDELOOSE] : c[u.TILDE];
|
|
6586
6593
|
return S.replace(I, (A, C, w, P, Z) => {
|
|
6587
6594
|
s("tilde", S, A, C, w, P, Z);
|
|
6588
6595
|
let T;
|
|
6589
|
-
return
|
|
6596
|
+
return z(C) ? T = "" : z(w) ? T = `>=${C}.0.0 <${+C + 1}.0.0-0` : z(P) ? T = `>=${C}.${w}.0 <${C}.${+w + 1}.0-0` : Z ? (s("replaceTilde pr", Z), T = `>=${C}.${w}.${P}-${Z} <${C}.${+w + 1}.0-0`) : T = `>=${C}.${w}.${P} <${C}.${+w + 1}.0-0`, s("tilde return", T), T;
|
|
6590
6597
|
});
|
|
6591
6598
|
}, F = (S, _) => S.trim().split(/\s+/).map((I) => Q(I, _)).join(" "), Q = (S, _) => {
|
|
6592
6599
|
s("caret", S, _);
|
|
@@ -6594,17 +6601,17 @@ function fe() {
|
|
|
6594
6601
|
return S.replace(I, (C, w, P, Z, T) => {
|
|
6595
6602
|
s("caret", S, C, w, P, Z, T);
|
|
6596
6603
|
let M;
|
|
6597
|
-
return
|
|
6604
|
+
return z(w) ? M = "" : z(P) ? M = `>=${w}.0.0${A} <${+w + 1}.0.0-0` : z(Z) ? w === "0" ? M = `>=${w}.${P}.0${A} <${w}.${+P + 1}.0-0` : M = `>=${w}.${P}.0${A} <${+w + 1}.0.0-0` : T ? (s("replaceCaret pr", T), w === "0" ? P === "0" ? M = `>=${w}.${P}.${Z}-${T} <${w}.${P}.${+Z + 1}-0` : M = `>=${w}.${P}.${Z}-${T} <${w}.${+P + 1}.0-0` : M = `>=${w}.${P}.${Z}-${T} <${+w + 1}.0.0-0`) : (s("no pr"), w === "0" ? P === "0" ? M = `>=${w}.${P}.${Z}${A} <${w}.${P}.${+Z + 1}-0` : M = `>=${w}.${P}.${Z}${A} <${w}.${+P + 1}.0-0` : M = `>=${w}.${P}.${Z} <${+w + 1}.0.0-0`), s("caret return", M), M;
|
|
6598
6605
|
});
|
|
6599
6606
|
}, N = (S, _) => (s("replaceXRanges", S, _), S.split(/\s+/).map((I) => Je(I, _)).join(" ")), Je = (S, _) => {
|
|
6600
6607
|
S = S.trim();
|
|
6601
6608
|
const I = _.loose ? c[u.XRANGELOOSE] : c[u.XRANGE];
|
|
6602
6609
|
return S.replace(I, (A, C, w, P, Z, T) => {
|
|
6603
6610
|
s("xRange", S, A, C, w, P, Z, T);
|
|
6604
|
-
const M =
|
|
6611
|
+
const M = z(w), ne = M || z(P), te = ne || z(Z), Ue = te;
|
|
6605
6612
|
return C === "=" && Ue && (C = ""), T = _.includePrerelease ? "-0" : "", M ? C === ">" || C === "<" ? A = "<0.0.0-0" : A = "*" : C && Ue ? (ne && (P = 0), Z = 0, C === ">" ? (C = ">=", ne ? (w = +w + 1, P = 0, Z = 0) : (P = +P + 1, Z = 0)) : C === "<=" && (C = "<", ne ? w = +w + 1 : P = +P + 1), C === "<" && (T = "-0"), A = `${C + w}.${P}.${Z}${T}`) : ne ? A = `>=${w}.0.0${T} <${+w + 1}.0.0-0` : te && (A = `>=${w}.${P}.0${T} <${w}.${+P + 1}.0-0`), s("xRange return", A), A;
|
|
6606
6613
|
});
|
|
6607
|
-
}, Ct = (S, _) => (s("replaceStars", S, _), S.trim().replace(c[u.STAR], "")), Ot = (S, _) => (s("replaceGTE0", S, _), S.trim().replace(c[_.includePrerelease ? u.GTE0PRE : u.GTE0], "")), Pt = (S) => (_, I, A, C, w, P, Z, T, M, ne, te, Ue) => (
|
|
6614
|
+
}, Ct = (S, _) => (s("replaceStars", S, _), S.trim().replace(c[u.STAR], "")), Ot = (S, _) => (s("replaceGTE0", S, _), S.trim().replace(c[_.includePrerelease ? u.GTE0PRE : u.GTE0], "")), Pt = (S) => (_, I, A, C, w, P, Z, T, M, ne, te, Ue) => (z(A) ? I = "" : z(C) ? I = `>=${A}.0.0${S ? "-0" : ""}` : z(w) ? I = `>=${A}.${C}.0${S ? "-0" : ""}` : P ? I = `>=${I}` : I = `>=${I}${S ? "-0" : ""}`, z(M) ? T = "" : z(ne) ? T = `<${+M + 1}.0.0-0` : z(te) ? T = `<${M}.${+ne + 1}.0-0` : Ue ? T = `<=${M}.${ne}.${te}-${Ue}` : S ? T = `<${M}.${ne}.${+te + 1}-0` : T = `<=${T}`, `${I} ${T}`.trim()), Nt = (S, _, I) => {
|
|
6608
6615
|
for (let A = 0; A < S.length; A++)
|
|
6609
6616
|
if (!S[A].test(_))
|
|
6610
6617
|
return !1;
|
|
@@ -6792,8 +6799,8 @@ function ln() {
|
|
|
6792
6799
|
}
|
|
6793
6800
|
if (o(l, f, g))
|
|
6794
6801
|
return !1;
|
|
6795
|
-
for (let
|
|
6796
|
-
const D = f.set[
|
|
6802
|
+
for (let z = 0; z < f.set.length; ++z) {
|
|
6803
|
+
const D = f.set[z];
|
|
6797
6804
|
let U = null, F = null;
|
|
6798
6805
|
if (D.forEach((Q) => {
|
|
6799
6806
|
Q.semver === r && (Q = new t(">=0.0.0")), U = U || Q, F = F || Q, k(Q.semver, U.semver, g) ? U = Q : O(Q.semver, F.semver, g) && (F = Q);
|
|
@@ -6898,7 +6905,7 @@ function Dg() {
|
|
|
6898
6905
|
return !1;
|
|
6899
6906
|
return !0;
|
|
6900
6907
|
}
|
|
6901
|
-
let ee,
|
|
6908
|
+
let ee, z, D, U, F = O && !g.includePrerelease && O.semver.prerelease.length ? O.semver : !1, Q = v && !g.includePrerelease && v.semver.prerelease.length ? v.semver : !1;
|
|
6902
6909
|
F && F.prerelease.length === 1 && O.operator === "<" && F.prerelease[0] === 0 && (F = !1);
|
|
6903
6910
|
for (const N of d) {
|
|
6904
6911
|
if (U = U || N.operator === ">" || N.operator === ">=", D = D || N.operator === "<" || N.operator === "<=", v) {
|
|
@@ -6910,7 +6917,7 @@ function Dg() {
|
|
|
6910
6917
|
}
|
|
6911
6918
|
if (O) {
|
|
6912
6919
|
if (F && N.semver.prerelease && N.semver.prerelease.length && N.semver.major === F.major && N.semver.minor === F.minor && N.semver.patch === F.patch && (F = !1), N.operator === "<" || N.operator === "<=") {
|
|
6913
|
-
if (
|
|
6920
|
+
if (z = l(O, N, g), z === N && z !== O)
|
|
6914
6921
|
return !1;
|
|
6915
6922
|
} else if (O.operator === "<=" && !n(O.semver, String(N), g))
|
|
6916
6923
|
return !1;
|
|
@@ -6936,7 +6943,7 @@ var Ar, zo;
|
|
|
6936
6943
|
function Zg() {
|
|
6937
6944
|
if (zo) return Ar;
|
|
6938
6945
|
zo = 1;
|
|
6939
|
-
const e = tt(), t = At(), r = se(), n = di(), o = Be(), i = gg(), s = vg(), a = bg(), c = _g(), u = yg(), l = Sg(), f = Eg(), d = $g(), g = pe(), k = Ag(), v = wg(), O = sn(), q = kg(), ee = Rg(),
|
|
6946
|
+
const e = tt(), t = At(), r = se(), n = di(), o = Be(), i = gg(), s = vg(), a = bg(), c = _g(), u = yg(), l = Sg(), f = Eg(), d = $g(), g = pe(), k = Ag(), v = wg(), O = sn(), q = kg(), ee = Rg(), z = kt(), D = an(), U = mi(), F = gi(), Q = cn(), N = un(), Je = vi(), Ct = Ig(), Ot = Rt(), Pt = fe(), Nt = It(), S = Og(), _ = Pg(), I = Ng(), A = xg(), C = zg(), w = ln(), P = Tg(), Z = Lg(), T = jg(), M = qg(), ne = Dg();
|
|
6940
6947
|
return Ar = {
|
|
6941
6948
|
parse: o,
|
|
6942
6949
|
valid: i,
|
|
@@ -6953,7 +6960,7 @@ function Zg() {
|
|
|
6953
6960
|
compareBuild: O,
|
|
6954
6961
|
sort: q,
|
|
6955
6962
|
rsort: ee,
|
|
6956
|
-
gt:
|
|
6963
|
+
gt: z,
|
|
6957
6964
|
lt: D,
|
|
6958
6965
|
eq: U,
|
|
6959
6966
|
neq: F,
|
|
@@ -7013,7 +7020,7 @@ const Jg = (e, t) => Ug(t) ? t.hostnames.includes(new URL(e).hostname) : Vg(t) ?
|
|
|
7013
7020
|
...qs(),
|
|
7014
7021
|
meta: {
|
|
7015
7022
|
parserName: null,
|
|
7016
|
-
parserType:
|
|
7023
|
+
parserType: x.NoResourceFound,
|
|
7017
7024
|
referrer: t.url
|
|
7018
7025
|
}
|
|
7019
7026
|
};
|
|
@@ -7048,7 +7055,7 @@ export {
|
|
|
7048
7055
|
nv as OpenUrlWebpageResourceSchema,
|
|
7049
7056
|
Jn as PARSERS,
|
|
7050
7057
|
fg as ParserRegistrySchema,
|
|
7051
|
-
|
|
7058
|
+
x as ParserType,
|
|
7052
7059
|
$s as ParsingMetadataSchema,
|
|
7053
7060
|
cp as ParsingRequestSchema,
|
|
7054
7061
|
dp as ParsingResponseSchema,
|
|
@@ -36,4 +36,4 @@
|
|
|
36
36
|
|
|
37
37
|
`)}g.write("payload.value = newResult;"),g.write("return payload;");const re=g.compile();return(x,Z)=>re(d,x,Z)};let i;const s=nt,a=!Pn.jitless,u=a&&Di.value,l=t.catchall;let f;e._zod.parse=(d,g)=>{f??(f=n.value);const I=d.value;return s(I)?a&&u&&g?.async===!1&&g.jitless!==!0?(i||(i=o(t.shape)),d=i(d,g),l?Kn([],I,d,g,f,e):d):r(d,g):(d.issues.push({expected:"object",code:"invalid_type",input:I,inst:e}),d)}});function Qn(e,t,r,n){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!xe(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>Ee(s,n,ye())))}),t)}const wc=m("$ZodUnion",(e,t)=>{H.init(e,t),J(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),J(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),J(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),J(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Lt(i.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(r)return n(o,i);let s=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:o.value,issues:[]},i);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(c=>Qn(c,o,e,i)):Qn(a,o,e,i)}}),Rc=m("$ZodIntersection",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>eo(r,c,u)):eo(r,i,s)}});function Zt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Te(e)&&Te(t)){const r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};for(const i of n){const s=Zt(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],i=t[n],s=Zt(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function eo(e,t,r){const n=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const c of a.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(a);for(const a of r.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(a);const i=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&o&&e.issues.push({...o,keys:i}),xe(e))return e;const s=Zt(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const kc=m("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Te(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const i=[],s=t.keyType._zod.values;if(s){r.value={};const a=new Set;for(const u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const l=t.valueType._zod.run({value:o[u],issues:[]},n);l instanceof Promise?i.push(l.then(f=>{f.issues.length&&r.issues.push(...je(u,f.issues)),r.value[u]=f.value})):(l.issues.length&&r.issues.push(...je(u,l.issues)),r.value[u]=l.value)}let c;for(const u in o)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c})}else{r.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Vn.test(a)&&c.issues.length){const f=t.keyType._zod.run({value:Number(a),issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(c=f)}if(c.issues.length){t.mode==="loose"?r.value[a]=o[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(f=>Ee(f,n,ye())),input:a,path:[a],inst:e});continue}const l=t.valueType._zod.run({value:o[a],issues:[]},n);l instanceof Promise?i.push(l.then(f=>{f.issues.length&&r.issues.push(...je(a,f.issues)),r.value[c.value]=f.value})):(l.issues.length&&r.issues.push(...je(a,l.issues)),r.value[c.value]=l.value)}}return i.length?Promise.all(i).then(()=>r):r}}),Ic=m("$ZodEnum",(e,t)=>{H.init(e,t);const r=Nn(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Zi.has(typeof o)).map(o=>typeof o=="string"?Le(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),Cc=m("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Le(n):n?Le(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{const i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),Oc=m("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new On(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new ze;return r.value=o,r}});function to(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ro=m("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),J(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Lt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>to(i,r.value)):to(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Pc=m("$ZodExactOptional",(e,t)=>{ro.init(e,t),J(e._zod,"values",()=>t.innerType._zod.values),J(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Nc=m("$ZodNullable",(e,t)=>{H.init(e,t),J(e._zod,"optin",()=>t.innerType._zod.optin),J(e._zod,"optout",()=>t.innerType._zod.optout),J(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Lt(r.source)}|null)$`):void 0}),J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),zc=m("$ZodDefault",(e,t)=>{H.init(e,t),e._zod.optin="optional",J(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>no(i,t)):no(o,t)}});function no(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Tc=m("$ZodPrefault",(e,t)=>{H.init(e,t),e._zod.optin="optional",J(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Lc=m("$ZodNonOptional",(e,t)=>{H.init(e,t),J(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>oo(i,e)):oo(o,e)}});function oo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const xc=m("$ZodCatch",(e,t)=>{H.init(e,t),J(e._zod,"optin",()=>t.innerType._zod.optin),J(e._zod,"optout",()=>t.innerType._zod.optout),J(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>Ee(s,n,ye()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>Ee(i,n,ye()))},input:r.value}),r.issues=[]),r)}}),jc=m("$ZodPipe",(e,t)=>{H.init(e,t),J(e._zod,"values",()=>t.in._zod.values),J(e._zod,"optin",()=>t.in._zod.optin),J(e._zod,"optout",()=>t.out._zod.optout),J(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>ut(s,t.in,n)):ut(i,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>ut(i,t.out,n)):ut(o,t.out,n)}});function ut(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const qc=m("$ZodReadonly",(e,t)=>{H.init(e,t),J(e._zod,"propValues",()=>t.innerType._zod.propValues),J(e._zod,"values",()=>t.innerType._zod.values),J(e._zod,"optin",()=>t.innerType?._zod?.optin),J(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(so):so(o)}});function so(e){return e.value=Object.freeze(e.value),e}const Dc=m("$ZodCustom",(e,t)=>{ae.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>io(i,r,n,e));io(o,r,n,e)}});function io(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Ue(o))}}var ao;class Zc{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Bc(){return new Zc}(ao=globalThis).__zod_globalRegistry??(ao.__zod_globalRegistry=Bc());const Ve=globalThis.__zod_globalRegistry;function Jc(e,t){return new e({type:"string",...A(t)})}function Uc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...A(t)})}function co(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...A(t)})}function Vc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...A(t)})}function Mc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...A(t)})}function Fc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...A(t)})}function Wc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...A(t)})}function uo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...A(t)})}function Gc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...A(t)})}function Xc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...A(t)})}function Hc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...A(t)})}function Yc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...A(t)})}function Kc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...A(t)})}function Qc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...A(t)})}function eu(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...A(t)})}function tu(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...A(t)})}function ru(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...A(t)})}function nu(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...A(t)})}function ou(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...A(t)})}function su(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...A(t)})}function iu(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...A(t)})}function au(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...A(t)})}function cu(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...A(t)})}function uu(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...A(t)})}function lu(e,t){return new e({type:"string",format:"date",check:"string_format",...A(t)})}function pu(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...A(t)})}function fu(e,t){return new e({type:"string",format:"duration",check:"string_format",...A(t)})}function hu(e,t){return new e({type:"number",checks:[],...A(t)})}function du(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...A(t)})}function mu(e,t){return new e({type:"null",...A(t)})}function gu(e){return new e({type:"unknown"})}function vu(e,t){return new e({type:"never",...A(t)})}function lo(e,t){return new Fn({check:"less_than",...A(t),value:e,inclusive:!1})}function Bt(e,t){return new Fn({check:"less_than",...A(t),value:e,inclusive:!0})}function po(e,t){return new Wn({check:"greater_than",...A(t),value:e,inclusive:!1})}function Jt(e,t){return new Wn({check:"greater_than",...A(t),value:e,inclusive:!0})}function fo(e,t){return new za({check:"multiple_of",...A(t),value:e})}function ho(e,t){return new La({check:"max_length",...A(t),maximum:e})}function lt(e,t){return new xa({check:"min_length",...A(t),minimum:e})}function mo(e,t){return new ja({check:"length_equals",...A(t),length:e})}function bu(e,t){return new qa({check:"string_format",format:"regex",...A(t),pattern:e})}function yu(e){return new Da({check:"string_format",format:"lowercase",...A(e)})}function _u(e){return new Za({check:"string_format",format:"uppercase",...A(e)})}function Su(e,t){return new Ba({check:"string_format",format:"includes",...A(t),includes:e})}function Eu(e,t){return new Ja({check:"string_format",format:"starts_with",...A(t),prefix:e})}function $u(e,t){return new Ua({check:"string_format",format:"ends_with",...A(t),suffix:e})}function qe(e){return new Va({check:"overwrite",tx:e})}function Au(e){return qe(t=>t.normalize(e))}function wu(){return qe(e=>e.trim())}function Ru(){return qe(e=>e.toLowerCase())}function ku(){return qe(e=>e.toUpperCase())}function Iu(){return qe(e=>qi(e))}function Cu(e,t,r){return new e({type:"array",element:t,...A(r)})}function Ou(e,t,r){const n=A(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Pu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...A(r)})}function Nu(e){const t=zu(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Ue(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(Ue(o))}},e(r.value,r)));return t}function zu(e,t){const r=new ae({check:"custom",...A(t)});return r._zod.check=e,r}function go(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ve,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function te(e,t,r={path:[],schemaPath:[]}){var n;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{const d=s.schema,g=t.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(e,t,d,l)}const f=e._zod.parent;f&&(s.ref||(s.ref=f),te(f,t,l),t.seen.get(f).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),t.io==="input"&&oe(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function vo(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const s of e.seen.entries()){const a=e.metadataRegistry.get(s[0])?.id;if(a){const c=n.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0])}}const o=s=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const f=e.external.registry.get(s[0])?.id,d=e.external.uri??(I=>I);if(f)return{ref:d(f)};const g=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=g,{defId:g,ref:`${d("__shared")}#/${a}/${g}`}}if(s[1]===r)return{ref:"#"};const u=`#/${a}/`,l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},i=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:c,defId:u}=o(s);a.def={...a.schema},u&&(a.defId=u);const l=a.schema;for(const f in l)delete l[f];l.$ref=c};if(e.cycles==="throw")for(const s of e.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
38
38
|
|
|
39
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const a=s[1];if(t===s[0]){i(s);continue}if(e.external){const u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function bo(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=s=>{const a=e.seen.get(s);if(a.ref===null)return;const c=a.def??a.schema,u={...c},l=a.ref;if(a.ref=null,l){n(l);const d=e.seen.get(l),g=d.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,u),s._zod.parent===l)for(const v in c)v==="$ref"||v==="allOf"||v in u||delete c[v];if(g.$ref&&d.def)for(const v in c)v==="$ref"||v==="allOf"||v in d.def&&JSON.stringify(c[v])===JSON.stringify(d.def[v])&&delete c[v]}const f=s._zod.parent;if(f&&f!==l){n(f);const d=e.seen.get(f);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(const g in c)g==="$ref"||g==="allOf"||g in d.def&&JSON.stringify(c[g])===JSON.stringify(d.def[g])&&delete c[g]}e.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(const s of[...e.seen.entries()].reverse())n(s[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(s)}Object.assign(o,r.def??r.schema);const i=e.external?.defs??{};for(const s of e.seen.entries()){const a=s[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const s=JSON.parse(JSON.stringify(o));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:pt(t,"input",e.processors),output:pt(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function oe(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return oe(n.element,r);if(n.type==="set")return oe(n.valueType,r);if(n.type==="lazy")return oe(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return oe(n.innerType,r);if(n.type==="intersection")return oe(n.left,r)||oe(n.right,r);if(n.type==="record"||n.type==="map")return oe(n.keyType,r)||oe(n.valueType,r);if(n.type==="pipe")return oe(n.in,r)||oe(n.out,r);if(n.type==="object"){for(const o in n.shape)if(oe(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(oe(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(oe(o,r))return!0;return!!(n.rest&&oe(n.rest,r))}return!1}const Tu=(e,t={})=>r=>{const n=go({...r,processors:t});return te(e,n),vo(n,e),bo(n,e)},pt=(e,t,r={})=>n=>{const{libraryOptions:o,target:i}=n??{},s=go({...o??{},target:i,io:t,processors:r});return te(e,s),vo(s,e),bo(s,e)},Lu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},xu=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=Lu[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const l=[...c];l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},ju=(e,t,r,n)=>{const o=r,{minimum:i,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number",typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l),typeof i=="number"&&(o.minimum=i,typeof l=="number"&&t.target!=="draft-04"&&(l>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof s=="number"&&(o.maximum=s,typeof u=="number"&&t.target!=="draft-04"&&(u<=s?delete o.maximum:delete o.exclusiveMaximum)),typeof c=="number"&&(o.multipleOf=c)},qu=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Du=(e,t,r,n)=>{r.not={}},Zu=(e,t,r,n)=>{},Bu=(e,t,r,n)=>{const o=e._zod.def,i=Nn(o.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},Ju=(e,t,r,n)=>{const o=e._zod.def,i=[];for(const s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},Uu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Vu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Mu=(e,t,r,n)=>{const o=r,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=te(i.element,t,{...n,path:[...n.path,"items"]})},Fu=(e,t,r,n)=>{const o=r,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const u in s)o.properties[u]=te(s[u],t,{...n,path:[...n.path,"properties",u]});const a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{const l=i.shape[u]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(o.required=Array.from(c)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=te(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Wu=(e,t,r,n)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,c)=>te(a,t,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=s:r.anyOf=s},Gu=(e,t,r,n)=>{const o=e._zod.def,i=te(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=te(o.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c},Xu=(e,t,r,n)=>{const o=r,i=e._zod.def;o.type="object";const s=i.keyType,c=s._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){const l=te(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(const f of c)o.patternProperties[f.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=te(i.keyType,t,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=te(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const u=s._zod.values;if(u){const l=[...u].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(o.required=l)}},Hu=(e,t,r,n)=>{const o=e._zod.def,i=te(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Yu=(e,t,r,n)=>{const o=e._zod.def;te(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},Ku=(e,t,r,n)=>{const o=e._zod.def;te(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},Qu=(e,t,r,n)=>{const o=e._zod.def;te(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},el=(e,t,r,n)=>{const o=e._zod.def;te(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},tl=(e,t,r,n)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;te(i,t,n);const s=t.seen.get(e);s.ref=i},rl=(e,t,r,n)=>{const o=e._zod.def;te(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0},yo=(e,t,r,n)=>{const o=e._zod.def;te(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},nl=m("ZodISODateTime",(e,t)=>{oc.init(e,t),K.init(e,t)});function ol(e){return uu(nl,e)}const sl=m("ZodISODate",(e,t)=>{sc.init(e,t),K.init(e,t)});function il(e){return lu(sl,e)}const al=m("ZodISOTime",(e,t)=>{ic.init(e,t),K.init(e,t)});function cl(e){return pu(al,e)}const ul=m("ZodISODuration",(e,t)=>{ac.init(e,t),K.init(e,t)});function ll(e){return fu(ul,e)}const le=m("ZodError",(e,t)=>{qn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Yi(e,r)},flatten:{value:r=>Hi(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Nt,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Nt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),pl=jt(le),fl=qt(le),hl=st(le),dl=it(le),ml=ea(le),gl=ta(le),vl=ra(le),bl=na(le),yl=oa(le),_l=sa(le),Sl=ia(le),El=aa(le),Y=m("ZodType",(e,t)=>(H.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:pt(e,"input"),output:pt(e,"output")}}),e.toJSONSchema=Tu(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(_e(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>Se(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>pl(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>hl(e,r,n),e.parseAsync=async(r,n)=>fl(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>dl(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>ml(e,r,n),e.decode=(r,n)=>gl(e,r,n),e.encodeAsync=async(r,n)=>vl(e,r,n),e.decodeAsync=async(r,n)=>bl(e,r,n),e.safeEncode=(r,n)=>yl(e,r,n),e.safeDecode=(r,n)=>_l(e,r,n),e.safeEncodeAsync=async(r,n)=>Sl(e,r,n),e.safeDecodeAsync=async(r,n)=>El(e,r,n),e.refine=(r,n)=>e.check(mp(r,n)),e.superRefine=r=>e.check(gp(r)),e.overwrite=r=>e.check(qe(r)),e.optional=()=>me(e),e.exactOptional=()=>rp(e),e.nullable=()=>Co(e),e.nullish=()=>me(Co(e)),e.nonoptional=r=>cp(e,r),e.array=()=>U(e),e.or=r=>de([e,r]),e.and=r=>Hl(e,r),e.transform=r=>Po(e,ep(r)),e.default=r=>sp(e,r),e.prefault=r=>ap(e,r),e.catch=r=>lp(e,r),e.pipe=r=>Po(e,r),e.readonly=()=>hp(e),e.describe=r=>{const n=e.clone();return Ve.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Ve.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ve.get(e);const n=e.clone();return Ve.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),_o=m("_ZodString",(e,t)=>{Dt.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(n,o,i)=>xu(e,n,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(bu(...n)),e.includes=(...n)=>e.check(Su(...n)),e.startsWith=(...n)=>e.check(Eu(...n)),e.endsWith=(...n)=>e.check($u(...n)),e.min=(...n)=>e.check(lt(...n)),e.max=(...n)=>e.check(ho(...n)),e.length=(...n)=>e.check(mo(...n)),e.nonempty=(...n)=>e.check(lt(1,...n)),e.lowercase=n=>e.check(yu(n)),e.uppercase=n=>e.check(_u(n)),e.trim=()=>e.check(wu()),e.normalize=(...n)=>e.check(Au(...n)),e.toLowerCase=()=>e.check(Ru()),e.toUpperCase=()=>e.check(ku()),e.slugify=()=>e.check(Iu())}),$l=m("ZodString",(e,t)=>{Dt.init(e,t),_o.init(e,t),e.email=r=>e.check(Uc(Al,r)),e.url=r=>e.check(uo(Eo,r)),e.jwt=r=>e.check(cu(Zl,r)),e.emoji=r=>e.check(Gc(Rl,r)),e.guid=r=>e.check(co(So,r)),e.uuid=r=>e.check(Vc(ft,r)),e.uuidv4=r=>e.check(Mc(ft,r)),e.uuidv6=r=>e.check(Fc(ft,r)),e.uuidv7=r=>e.check(Wc(ft,r)),e.nanoid=r=>e.check(Xc(kl,r)),e.guid=r=>e.check(co(So,r)),e.cuid=r=>e.check(Hc(Il,r)),e.cuid2=r=>e.check(Yc(Cl,r)),e.ulid=r=>e.check(Kc(Ol,r)),e.base64=r=>e.check(su(jl,r)),e.base64url=r=>e.check(iu(ql,r)),e.xid=r=>e.check(Qc(Pl,r)),e.ksuid=r=>e.check(eu(Nl,r)),e.ipv4=r=>e.check(tu(zl,r)),e.ipv6=r=>e.check(ru(Tl,r)),e.cidrv4=r=>e.check(nu(Ll,r)),e.cidrv6=r=>e.check(ou(xl,r)),e.e164=r=>e.check(au(Dl,r)),e.datetime=r=>e.check(ol(r)),e.date=r=>e.check(il(r)),e.time=r=>e.check(cl(r)),e.duration=r=>e.check(ll(r))});function h(e){return Jc($l,e)}const K=m("ZodStringFormat",(e,t)=>{G.init(e,t),_o.init(e,t)}),Al=m("ZodEmail",(e,t)=>{Xa.init(e,t),K.init(e,t)}),So=m("ZodGUID",(e,t)=>{Wa.init(e,t),K.init(e,t)}),ft=m("ZodUUID",(e,t)=>{Ga.init(e,t),K.init(e,t)}),Eo=m("ZodURL",(e,t)=>{Ha.init(e,t),K.init(e,t)});function wl(e){return uo(Eo,e)}const Rl=m("ZodEmoji",(e,t)=>{Ya.init(e,t),K.init(e,t)}),kl=m("ZodNanoID",(e,t)=>{Ka.init(e,t),K.init(e,t)}),Il=m("ZodCUID",(e,t)=>{Qa.init(e,t),K.init(e,t)}),Cl=m("ZodCUID2",(e,t)=>{ec.init(e,t),K.init(e,t)}),Ol=m("ZodULID",(e,t)=>{tc.init(e,t),K.init(e,t)}),Pl=m("ZodXID",(e,t)=>{rc.init(e,t),K.init(e,t)}),Nl=m("ZodKSUID",(e,t)=>{nc.init(e,t),K.init(e,t)}),zl=m("ZodIPv4",(e,t)=>{cc.init(e,t),K.init(e,t)}),Tl=m("ZodIPv6",(e,t)=>{uc.init(e,t),K.init(e,t)}),Ll=m("ZodCIDRv4",(e,t)=>{lc.init(e,t),K.init(e,t)}),xl=m("ZodCIDRv6",(e,t)=>{pc.init(e,t),K.init(e,t)}),jl=m("ZodBase64",(e,t)=>{fc.init(e,t),K.init(e,t)}),ql=m("ZodBase64URL",(e,t)=>{dc.init(e,t),K.init(e,t)}),Dl=m("ZodE164",(e,t)=>{mc.init(e,t),K.init(e,t)}),Zl=m("ZodJWT",(e,t)=>{vc.init(e,t),K.init(e,t)}),$o=m("ZodNumber",(e,t)=>{Xn.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(n,o,i)=>ju(e,n,o),e.gt=(n,o)=>e.check(po(n,o)),e.gte=(n,o)=>e.check(Jt(n,o)),e.min=(n,o)=>e.check(Jt(n,o)),e.lt=(n,o)=>e.check(lo(n,o)),e.lte=(n,o)=>e.check(Bt(n,o)),e.max=(n,o)=>e.check(Bt(n,o)),e.int=n=>e.check(wo(n)),e.safe=n=>e.check(wo(n)),e.positive=n=>e.check(po(0,n)),e.nonnegative=n=>e.check(Jt(0,n)),e.negative=n=>e.check(lo(0,n)),e.nonpositive=n=>e.check(Bt(0,n)),e.multipleOf=(n,o)=>e.check(fo(n,o)),e.step=(n,o)=>e.check(fo(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Ao(e){return hu($o,e)}const Bl=m("ZodNumberFormat",(e,t)=>{bc.init(e,t),$o.init(e,t)});function wo(e){return du(Bl,e)}const Jl=m("ZodNull",(e,t)=>{yc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qu(e,r,n)});function ht(e){return mu(Jl,e)}const Ul=m("ZodUnknown",(e,t)=>{_c.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zu()});function Ro(){return gu(Ul)}const Vl=m("ZodNever",(e,t)=>{Sc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Du(e,r,n)});function Ml(e){return vu(Vl,e)}const Fl=m("ZodArray",(e,t)=>{Ec.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mu(e,r,n,o),e.element=t.element,e.min=(r,n)=>e.check(lt(r,n)),e.nonempty=r=>e.check(lt(1,r)),e.max=(r,n)=>e.check(ho(r,n)),e.length=(r,n)=>e.check(mo(r,n)),e.unwrap=()=>e.element});function U(e,t){return Cu(Fl,e,t)}const Wl=m("ZodObject",(e,t)=>{Ac.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fu(e,r,n,o),J(e,"shape",()=>t.shape),e.keyof=()=>Me(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ro()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ro()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ml()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Mi(e,r),e.safeExtend=r=>Fi(e,r),e.merge=r=>Wi(e,r),e.pick=r=>Ui(e,r),e.omit=r=>Vi(e,r),e.partial=(...r)=>Gi(Io,e,r[0]),e.required=(...r)=>Xi(Oo,e,r[0])});function k(e,t){const r={type:"object",shape:e??{},...A(t)};return new Wl(r)}const Gl=m("ZodUnion",(e,t)=>{wc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wu(e,r,n,o),e.options=t.options});function de(e,t){return new Gl({type:"union",options:e,...A(t)})}const Xl=m("ZodIntersection",(e,t)=>{Rc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gu(e,r,n,o)});function Hl(e,t){return new Xl({type:"intersection",left:e,right:t})}const Yl=m("ZodRecord",(e,t)=>{kc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xu(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function ko(e,t,r){return new Yl({type:"record",keyType:e,valueType:t,...A(r)})}const Ut=m("ZodEnum",(e,t)=>{Ic.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Bu(e,n,o),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const i={};for(const s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Ut({...t,checks:[],...A(o),entries:i})},e.exclude=(n,o)=>{const i={...t.entries};for(const s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Ut({...t,checks:[],...A(o),entries:i})}});function Me(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ut({type:"enum",entries:r,...A(t)})}const Kl=m("ZodLiteral",(e,t)=>{Cc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ju(e,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function X(e,t){return new Kl({type:"literal",values:Array.isArray(e)?e:[e],...A(t)})}const Ql=m("ZodTransform",(e,t)=>{Oc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vu(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new On(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(Ue(i,r.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(Ue(s))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function ep(e){return new Ql({type:"transform",transform:e})}const Io=m("ZodOptional",(e,t)=>{ro.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function me(e){return new Io({type:"optional",innerType:e})}const tp=m("ZodExactOptional",(e,t)=>{Pc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function rp(e){return new tp({type:"optional",innerType:e})}const np=m("ZodNullable",(e,t)=>{Nc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hu(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Co(e){return new np({type:"nullable",innerType:e})}const op=m("ZodDefault",(e,t)=>{zc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ku(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function sp(e,t){return new op({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():xn(t)}})}const ip=m("ZodPrefault",(e,t)=>{Tc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qu(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ap(e,t){return new ip({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():xn(t)}})}const Oo=m("ZodNonOptional",(e,t)=>{Lc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yu(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function cp(e,t){return new Oo({type:"nonoptional",innerType:e,...A(t)})}const up=m("ZodCatch",(e,t)=>{xc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>el(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lp(e,t){return new up({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const pp=m("ZodPipe",(e,t)=>{jc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>tl(e,r,n,o),e.in=t.in,e.out=t.out});function Po(e,t){return new pp({type:"pipe",in:e,out:t})}const fp=m("ZodReadonly",(e,t)=>{qc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rl(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function hp(e){return new fp({type:"readonly",innerType:e})}const No=m("ZodCustom",(e,t)=>{Dc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Uu(e,r)});function dp(e,t){return Ou(No,e??(()=>!0),t)}function mp(e,t={}){return Pu(No,e,t)}function gp(e){return Nu(e)}var S=(e=>(e.Article="article",e.AudioDocument="audiodocument",e.AudioVisualDocument="audiovisualdocument",e.Book="book",e.Bookitem="bookitem",e.Conference="conference",e.Document="document",e.Image="image",e.Issue="issue",e.Journal="journal",e.Preprint="preprint",e.Proceeding="proceeding",e.Report="report",e.Unknown="unknown",e.Webpage="webpage",e))(S||{});const vp=de([X("book"),X("bookitem"),X("conference"),X("document"),X("report"),X("proceeding"),X("unknown")]),bp=de([X("article"),X("conference"),X("issue"),X("journal"),X("preprint"),X("proceeding"),X("unknown")]),ve=k({artnum:h(),atitle:h(),aufirst:h(),aulast:h(),auinit:h(),auinit1:h(),auinitm:h(),ausuffix:h(),au:U(h()),aucorp:h(),bici:h(),btitle:h(),chron:h(),coden:h(),date:h(),edition:h(),eissn:h(),epage:h(),externalDBID:h(),externalDocID:h(),genre:Me(S),id:h(),isbn:h(),issn:h(),issue:h(),jtitle:h(),pages:h(),part:h(),place:h(),pub:h(),quarter:h(),rft_id:U(h()),series:h(),sici:h(),spage:h(),ssn:h(),stitle:h(),title:h(),tpages:h(),volume:h()}).partial(),Vt=k({bibid:h(),doi:h(),uri:h()}).partial(),yp=ve.pick({atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,bici:!0,btitle:!0,date:!0,edition:!0,epage:!0,id:!0,isbn:!0,issn:!0,pages:!0,place:!0,pub:!0,rft_id:!0,title:!0,tpages:!0,series:!0,spage:!0}).partial(),_p=ve.pick({artnum:!0,atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,chron:!0,coden:!0,date:!0,epage:!0,id:!0,isbn:!0,eissn:!0,issn:!0,issue:!0,title:!0,jtitle:!0,pages:!0,part:!0,pub:!0,rft_id:!0,sici:!0,spage:!0,stitle:!0,ssn:!0,quarter:!0,volume:!0}).partial(),Sp=ve.pick({au:!0,date:!0,isbn:!0,pub:!0,title:!0}).partial(),Ep=ve.pick({au:!0,date:!0,pub:!0,title:!0}).partial(),$p=ve.pick({au:!0,date:!0,pub:!0,title:!0,spage:!0,epage:!0}).partial(),Ap=ve.pick({au:!0,date:!0,title:!0}).partial(),zo=k({...ve.shape,...Vt.shape}),V=(e,t)=>({...t,genre:e}),q=(e,t)=>({...t,genre:e}),ge=e=>({...e,genre:S.AudioVisualDocument}),To=e=>({...e,genre:S.Image}),Mt=e=>({...e,genre:S.Document}),dt=e=>({...e,genre:S.Webpage}),Lo=e=>Object.keys(e.shape),xo=Lo(ve),Ft=Lo(Vt),wp=(e,t,r)=>{if(r.length>0&&typeof r[0]=="string"){const n=t.startsWith("rft_")?t:`rft.${t}`;e.append(n,r[0])}},Rp=(e,t,r)=>{e.append(t,r)},kp=(e,t,r)=>{e.append(`rft.${t}`,r)},jo=e=>Ft.includes(e),qo=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{Array.isArray(n)?wp(t,r,n):typeof n=="string"&&n&&(jo(r)?Rp(t,r,n):kp(t,r,n))}),t},Do=(e,t,r,n)=>{const o=t.getAll(r).filter(i=>!!i).map(i=>i.trim());return o.length===0?e:{...e,[n]:o}},Zo=e=>{const t=Ip(e),r=(o,i)=>{if(i==="au")return Do(o,t,"rft.au","au");if(i==="rft_id")return Do(o,t,"rft_id","rft_id");const s=jo(i)?i:`rft.${i}`,a=t.get(s);return a?{...o,[i]:a.trim()}:o},n=[...xo,...Ft].reduce(r,{});return Object.keys(n).length===0?null:n},Ip=e=>URL.canParse(e)?new URL(e).searchParams:new URLSearchParams(e);function Cp(e){return typeof e!="string"?!1:Object.values(S).includes(e)}var $e=(e=>(e.CA="CA",e.EUAPAC="EUAPAC",e))($e||{});const Wt=k({id:h(),name:h(),region:Me($e)}),Op=k({tenants:U(Wt)}),Bo=9*1024*1024,Jo=k({url:wl({error:e=>e.input===void 0?'should have the required string property "url"':'"url" must be a string'}),html:h({error:e=>e.input===void 0?'should have the required string property "html"':void 0}).max(Bo,{error:`"html" should be a string with a MAX Length of ${Bo}`}),tenantCode:h({error:e=>e.input===void 0?'should have the required string property "tenantCode"':void 0}).min(1,{error:'"tenantCode" must be a string'}),region:Me([$e.EUAPAC,$e.CA],{error:e=>e.input===void 0?'should have the required string property "region"':'"region" must be a string of EUAPAC or CA'})});function Pp(e){return Jo.safeParse(e).success}const Gt=k({name:h(),region:Me($e),apps:ko(h(),h())}),Uo=ko(h(),Gt),Vo=e=>Gt.safeParse(e).success,Mo=e=>Uo.safeParse(e).success;function Fo(e){return Wt.safeParse(e).success}function Np(e){return typeof e=="string"&&Object.keys($e).includes(e)}const zp=e=>{if(!Mo(e))throw new Error("Error: the customer list data is invalid.");return{tenants:Object.entries(e).map(([r,n])=>Tp(r,n))}},Tp=(e,t)=>{if(!Vo(t))throw new Error(`Invalid customer: ${t}`);const{name:r,region:n}=t,o={id:e,name:r,region:n};if(!Fo(o))throw new Error(`Invalid tenant: ${JSON.stringify(o)}`);return o},Xt=k({parserType:h(),parserName:h().nullable(),referrer:h()}),Ht=k({bookmarkingWorkflowUrl:ht(),resource:ht()}),Yt=k({bookmarkingWorkflowUrl:h(),resource:ht()}),Kt=k({bookmarkingWorkflowUrl:ht(),resource:zo}),Qt=k({z3988SearchResult:X(!0)}),er=k({summonSearchResult:X(!0)}),tr=de([Yt,Ht,Kt,Qt,er]),Wo=k({meta:Xt}).and(tr);function Lp(e){return{bookmarkingWorkflowUrl:e,resource:null}}function L(){return{bookmarkingWorkflowUrl:null,resource:null}}function E(e){return{bookmarkingWorkflowUrl:null,resource:e}}function Go(){return{z3988SearchResult:!0}}function Xo(){return{summonSearchResult:!0}}const xp=e=>{const t=e.getAttribute("title");return t?Zo(t):null},rr=({document:e})=>{const t=Array.from(e.querySelectorAll(".Z3988"));if(t.length===0)return L();const r=t.map(xp).find(n=>n!==null);return r?E(r):L()},jp=e=>{const t=Array.from(e.querySelectorAll(".author > a")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},qp=e=>e.querySelector("#rpi-attribute-book_details-edition > .rpi-attribute-value > span")?.textContent??void 0,Dp=e=>{const t=e.querySelector("#rpi-attribute-book_details-isbn10 > .rpi-attribute-value > span")?.textContent??void 0,r=e.querySelector("#rpi-attribute-book_details-isbn13 > .rpi-attribute-value > span")?.textContent??void 0;if(t&&r)return`${t},${r}`;if(t)return t;if(r)return r},Zp=e=>e.querySelector("#rpi-attribute-book_details-publication_date > .rpi-attribute-value > span")?.textContent??void 0,Bp=e=>e.querySelector("#rpi-attribute-book_details-publisher > .rpi-attribute-value > span")?.textContent??void 0,Jp=e=>e.querySelector("#rpi-attribute-book_details-series > .rpi-attribute-value > a")?.textContent??void 0,Up=e=>{const t=e.querySelector("#rpi-attribute-book_details-fiona_pages > .rpi-attribute-value > span")?.textContent??void 0;return(t?/\d+/.exec(t)?.[0]:null)??void 0},Vp=({document:e})=>{const t=jp(e),r=qp(e),n=Dp(e),o=Zp(e),i=Bp(e),s=Jp(e),a=e.getElementById("productTitle")?.textContent.trim()??void 0,c=Up(e);return{bookmarkingWorkflowUrl:null,resource:V(S.Book,{au:t,date:o,edition:r,isbn:n,pub:i,series:s,title:a,tpages:c})}},p=(e,t,r)=>{const n=Q(e,t,r);return n.length>0?n[0]:void 0},Q=(e,t,r)=>Array.from(e.querySelectorAll(`meta[${t}='${r}']`)).map(n=>n.getAttribute("content")).filter(n=>!!n?.trim()),Ho=e=>{const t=new Map,r=e.split(";").filter(n=>!!n);for(const n of r){const[o,i,s]=n.split(":");t.set(o,{type:i,value:s})}return t};var b=(e=>(e[e.None=0]="None",e[e.Book=1]="Book",e[e.Chapter=2]="Chapter",e[e.Journal=3]="Journal",e[e.Article=4]="Article",e[e.AudioVisual=5]="AudioVisual",e[e.Webpage=6]="Webpage",e[e.Document=7]="Document",e))(b||{});const Mp=e=>{if(!e)return;const t=/\b\d{4}\b/.exec(e);return t?t[0]:void 0},Fe=e=>{const t=e.querySelector("#publication_date p")?.textContent.trim()??p(e,"name","bepress_citation_date");return Mp(t)},Fp=e=>{const t=p(e,"name","bepress_citation_firstpage"),r=p(e,"name","bepress_citation_lastpage");return{spage:t,epage:r}},nr=e=>{const t=/https?:\/\/doi\.org\/(.+)/i,n=e.querySelector("#source p")?.textContent.trim()?.match(t);if(n?.length===2)return n[1];const i=e.querySelector("#recommended_citation p a")?.textContent.trim()?.match(t);if(i?.length===2)return i[1]},Wp=e=>{const t=[],r=e.querySelectorAll("tbody td");for(const n of r){const o=n.querySelector("strong");if(o&&!o.querySelector("a")){const i=o.textContent.trim();i&&t.push(i)}}return t},We=e=>p(e,"name","bepress_citation_title")??e.querySelector("title")?.textContent.trim(),mt=e=>Q(e,"name","author"),gt=e=>p(e,"name","bepress_citation_publisher"),or=e=>p(e,"name","bepress_citation_pdf_url"),Gp=(e,t)=>{if(t.includes("/etd/"))return b.Document;if(t.includes("/sophpm_music/")||t.includes("/streaming/"))return b.AudioVisual;if(t.includes("/vol"))return b.Article;if(t.includes("/facpub")||t.includes("/studentpub/")){const r={"book chapter":b.Book,"conference paper":b.Book,"peer-reviewed article":b.Article,other:b.Document},n=e.querySelector("#document_type p")?.textContent.toLowerCase().trim();return n?r[n]:void 0}return b.Journal},Xp=e=>{const t=We(e),r=mt(e),n=Fe(e),o=p(e,"name","bepress_citation_journal_title"),i=p(e,"name","bepress_citation_volume"),s=p(e,"name","bepress_citation_issue"),{epage:a,spage:c}=Fp(e),u=or(e),l=nr(e);return q(S.Article,{atitle:t,jtitle:o,au:r,date:n,volume:i,issue:s,epage:a,spage:c,doi:l,uri:u})},Hp=(e,t)=>{const r=e.querySelector(".inherit-title a")?.textContent.trim()??We(e),n=Wp(e),o=Fe(e),i=gt(e),s=nr(e);return q(S.Journal,{jtitle:r,au:n,date:o,pub:i,doi:s,uri:t})},Yp=e=>{const t=We(e),r=mt(e),n=Fe(e),o=gt(e),i=or(e),s=e.querySelector("#document_type p")?.textContent.toLowerCase().trim();if(s==="book chapter"){const c=e.querySelector("#source p")?.textContent.trim();return V(S.Bookitem,{pub:o,atitle:t,btitle:c,au:r,date:n,uri:i})}const a=nr(e);return s==="conference paper"?V(S.Conference,{pub:o,title:t,au:r,date:n,doi:a,uri:i}):V(S.Document,{pub:o,title:t,au:r,date:n,doi:a,uri:i})},Kp=(e,t)=>{const r=We(e),n=mt(e),o=Fe(e),i=gt(e);return ge({title:r,au:n,date:o,pub:i,uri:t})},Qp=e=>{const t=We(e),r=mt(e),n=Fe(e),o=gt(e),i=or(e);return Mt({pub:o,title:t,au:r,date:n,uri:i})},ef=({url:e,document:t})=>{switch(Gp(t,e)){case b.Article:return E(Xp(t));case b.Journal:return E(Hp(t,e));case b.Book:return E(Yp(t));case b.AudioVisual:return E(Kp(t,e));case b.Document:return E(Qp(t));default:return L()}},be=e=>{if(e)return e.replace(/[^0-9]/g,"")},Yo=e=>Array.from(e.querySelectorAll(".author-source-list li a")).filter(t=>t.childNodes.length>0).map(t=>t.childNodes[0].textContent?.trim()).filter(t=>!!t),Ko=e=>e.querySelector(".article-header")?.querySelector("h1 span")?.textContent.trim(),Qo=e=>({date:e?.textContent.match(/\d{4}/)?.[0],pub:"Elsevier Inc."}),tf=e=>{const t=e.querySelector(".article-meta");if(!t)return{};const r=t.querySelector(".issue")?.textContent??void 0,n=t.querySelector(".title")?.textContent.trim()??void 0,[o,i]=(r?.split(",")??[]).map(s=>s.trim());return{volume:be(o),issue:be(i),jtitle:n}},rf=e=>{const t=e.querySelector(".article-header .source")?.textContent,r=t?.match(/\d{4}-\d{2}-\d{2}/)?.[0],n=t?.match(/Pages (\d+-\d+)/),[o,i]=(n?.[1].split("-")??[]).map(u=>u.trim()),{jtitle:s,volume:a,issue:c}=tf(e);return E(q(S.Article,{au:Yo(e),atitle:Ko(e),spage:o,epage:i,date:r,jtitle:s,volume:a,issue:c}))},nf=e=>{const[t,r]=e.querySelectorAll(".source"),{date:n,pub:o}=Qo(r),i=e.querySelector(".browse__book-toc"),[s,a]=(i?.querySelector("h1")?.textContent.split(",")??[]).map(c=>c.trim());return E(V(S.Book,{btitle:s,edition:a,pub:o,au:t.textContent?[t.textContent]:void 0,date:n}))},of=e=>{const t=e.querySelector(".article-meta");if(!t)return{};const r=t.querySelector(".edition")?.textContent??void 0,n=t.querySelector(".title")?.textContent.trim()??void 0,o=t.querySelector(".copyright"),{date:i,pub:s}=Qo(o);return{edition:r,btitle:n,date:i,pub:s}},sf=e=>{const{edition:t,btitle:r,date:n,pub:o}=of(e),i=e.querySelector(".article-header .source")?.textContent,s=/(\d+-\d+|[IVXLCDM]+-[IVXLCDM]+)/i,a=i?.match(s),[c,u]=(a?.[1].split("-")??[]).map(l=>l.trim());return E(V(S.Bookitem,{au:Yo(e),atitle:Ko(e),btitle:r,edition:t,pub:o,date:n,spage:c,epage:u}))},af=/^[0-9X]$/,sr=e=>{if(!e)return;let t="";for(const r of e)af.test(r)&&(t+=r);if(t)return t},cf=(e,t)=>{const r=e.querySelector(".c-cksc-content-header__title")?.textContent.trim(),n=e.querySelector(".c-cksc-content-nice__button")?.textContent.trim(),o=e.querySelector(".c-cksc-content-nice__date")?.textContent.trim(),i=e.evaluate('//p[contains(text(), "ISBN")]',e,null,XPathResult.ANY_TYPE),s=sr(i.iterateNext()?.textContent);return E({genre:S.Document,title:r,pub:n,date:o,uri:t,isbn:s})},es=e=>e.querySelector(".browse-toc")??e.querySelector(".browse__journal"),uf=e=>es(e)?.querySelector("h1")?.firstElementChild?.textContent.trim(),lf=e=>{const t=es(e),r=t?.querySelector("figure figcaption.source");if(r){const[a,c,u]=r.textContent.split(",").map(l=>l.trim());return{date:a,volume:be(c),issue:be(u)}}const n=t?.querySelector("p")?.textContent,[o,i]=n?.split(",")??[];return{date:t?.querySelector(".source span")?.textContent??void 0,volume:be(o),issue:be(i)}},pf=e=>{const{date:t,volume:r,issue:n}=lf(e);return E(q(S.Journal,{jtitle:uf(e),date:t,volume:r,issue:n}))};var ts=(e=>(e.Book="Book",e.Chapter="Book Chapter",e.Article="Full Text Article",e.Journal="Journal",e.Guideline="Guideline",e))(ts||{});const ff=e=>Object.values(ts).includes(e),hf=(e,t)=>{const r=e.querySelector(".content-type")??e.querySelector(".c-cksc-content-header__content-type");if(!r)return t.includes("journal")?"Journal":void 0;const n=r.textContent;if(n&&ff(n))return n},df=({url:e,document:t})=>{switch(hf(t,e)){case"Book":return nf(t);case"Book Chapter":return sf(t);case"Full Text Article":return rf(t);case"Journal":return pf(t);case"Guideline":return cf(t,e);case void 0:return L()}},Ce=k({"@context":h()}),mf=e=>Ce.safeParse(e).success,rs='script[type="application/ld+json"]',ns=e=>Array.from(e.querySelectorAll(rs)),vt=e=>e.querySelector(rs),Ge=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(mf(r))return r}catch{return null}return null},gf=k({"@id":h(),"@type":h(),author:k({"@id":h()}).optional(),datePublished:h().optional(),dateModified:h().optional(),description:h().optional(),inLanguage:h().optional(),isPartOf:k({"@id":h()}).optional(),name:h().optional(),url:h().optional()}),vf=Ce.extend({"@graph":U(gf)}),bf=e=>vf.safeParse(e).success,yf=e=>{const t=ns(e);if(t.length===0)return null;const r=t.map(Ge).filter(bf).map(n=>n["@graph"]);return r.length!==1?null:r[0]},_f=(e,t)=>e.find(r=>r["@type"]===t)??null,Sf=(e,t)=>e.find(r=>r["@id"]===t)??null,Ef=e=>{const t=_f(e,"WebPage");if(!t)return null;const r=t.author?Sf(e,t.author["@id"]):void 0;return dt({au:r?.name?[r.name]:void 0,date:t.datePublished,title:t.name})},$f=({document:e})=>{const t=yf(e);return t?{bookmarkingWorkflowUrl:null,resource:Ef(t)}:L()},os=()=>L(),Af=e=>{const{pathname:t}=new URL(e);return t.startsWith("/toc/")?"journal":t.startsWith("/article/")?"article":void 0},wf=e=>{const t=e.querySelector("header h1 span")?.firstChild?.textContent?.trim(),r=e.querySelector("header p span")?.textContent.trim(),n=/\d{4}-\d{3}[\dX]/g,o=r?.match(n)??[],[i,s]=[o[0],o[1]],a=e.evaluate('//dt[contains(text(), "Publisher")]/following-sibling::dd/a',e,null,XPathResult.STRING_TYPE).stringValue.trim();return E(q(S.Journal,{pub:a,jtitle:t,issn:i,eissn:s}))},Rf=e=>{let t,r;const n=Q(e,"name","citation_issn");return n.length===2?(t=n[1],r=n[0]):t=n[0],{eissn:t,issn:r}},kf=e=>{const t=p(e,"name","citation_journal_title"),r=p(e,"name","citation_title"),n=Q(e,"name","citation_author"),o=p(e,"name","citation_doi"),{eissn:i,issn:s}=Rf(e),a=p(e,"name","citation_publisher"),c=p(e,"name","citation_publication_date"),u=p(e,"name","citation_volume"),l=p(e,"name","citation_issue"),f=p(e,"name","citation_firstpage"),d=p(e,"name","citation_lastpage");return E(q(S.Article,{jtitle:t,atitle:r,au:n,doi:o,eissn:i,issn:s,pub:a,date:c,volume:u,issue:l,spage:f,epage:d}))},If=({document:e,url:t})=>{switch(Af(t)){case"journal":return wf(e);case"article":return kf(e);case void 0:return L()}},Cf=e=>{const t=p(e,"name","pbContext");if(!t)return b.None;const r=Ho(t);switch(r.has("page")?r.get("page")?.value:null){case"Article/Chapter View":return b.Article;case"Table of Contents":return b.Journal;default:return b.None}},Of=e=>{const t=e.querySelector('meta[property="article:author"]')?.getAttribute("content")?.split(",").map(r=>r.trim());return t&&t.length>0?t:void 0},ss=e=>{const t=new Map,r=Array.from(e.querySelectorAll(".rlist>li>span")).map(i=>i.textContent.trim()).join(""),n=/^ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(r);n&&t.set("issn",n[1]);const o=/Online ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(r);return o&&t.set("eissn",o[1]),t},Pf=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationVolume"] > span[property="volumeNumber"]')?.textContent??void 0,Nf=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationIssue"] > span[property="issueNumber"]')?.textContent??void 0,zf=e=>e.querySelector('meta[name="dc.Identifier"][scheme="doi"]')?.getAttribute("content")??void 0,Tf=e=>e.querySelector("h1")?.textContent??void 0,Lf=e=>{const t=new Map,r=e.querySelector("h2.heading-m")?.textContent,n=r?.match(/Issue\s+(\d+(?:-\d+)?)/);n&&t.set("issue",n[1]);const o=r?.match(/Volume\s+(\d+)/);o&&t.set("volume",o[1]);const i=r?.match(/(\d{4})$/);return i&&t.set("date",i[1]),t},xf=e=>{const t=Of(e.document),r=p(e.document,"name","dc.Date"),n=zf(e.document),o=ss(e.document),i=o.get("issn"),s=o.get("eissn"),a=Nf(e.document),c=p(e.document,"name","citation_journal_title"),u=p(e.document,"name","dc.Publisher"),l=p(e.document,"name","dc.Title"),f=Pf(e.document);return q(S.Article,{au:t,date:r,eissn:s,issn:i,issue:a,jtitle:c,pub:u,title:l,volume:f,doi:n})},jf=e=>{const t=ss(e.document),r=t.get("issn"),n=t.get("eissn"),o=Tf(e.document),i=Lf(e.document),s=i.get("issue"),a=i.get("volume"),c=i.get("date");return q(S.Journal,{eissn:n,issn:r,jtitle:o,title:o,issue:s,volume:a,date:c})},qf=e=>{switch(Cf(e.document)){case b.Article:return E(xf(e));case b.Journal:return E(jf(e));default:return L()}},Df=e=>{const t=p(e,"name","citation_type"),r=p(e,"name","citation_article_type");return t==="JOUR"&&r?b.Article:t==="CHP"?b.Chapter:e.querySelector(".book-edition-year")?.textContent.includes("Book")?b.Book:e.getElementById("journal-title")?b.Journal:b.None},ir=e=>p(e,"name","citation_doi")??p(e,"name","dc.identifier")??e.querySelector(".doi .anchor-text")?.textContent??void 0,Zf=e=>{const t=Array.from(e.querySelectorAll(".kf-details .kf-detail-item:has(h3)")),r=new Map;for(const n of t){const o=n.querySelector("h3")?.textContent,i=n.querySelector("p")?.textContent;o&&i&&r.set(o,i)}return r},ar=(e,t)=>{const r=Array.from(e.querySelectorAll(t)).map(n=>n.textContent).filter(n=>!!n);return r.length>0?r:void 0},Bf=e=>{const t=e.querySelector(".js-issn")?.textContent;if(t)return t.replace("Online ISSN: ","")},Jf=e=>{const t=e.get("DOI");if(t)return URL.canParse(t)?new URL(t).pathname.substring(1):t},Uf=e=>{const t=Zf(e),r=p(e,"property","og:title"),n=p(e,"property","og:book:isbn"),o=t.get("Published"),i=ar(e,".authors-container .author-detail h3"),s=ir(e)??Jf(t);return V(S.Book,{au:i,date:o,doi:s,isbn:n,title:r})},Vf=e=>{const t=p(e,"property","og:title"),r=p(e,"property","og:book:isbn"),n=p(e,"name","citation_publication_date"),o=ar(e,".author-group .button-link-text"),i=p(e,"name","citation_firstpage"),s=p(e,"name","citation_lastpage"),a=p(e,"name","citation_publisher"),c=ir(e),u=p(e,"name","citation_inbook_title")??e.querySelector(".publication-title")?.textContent??void 0;return V(S.Bookitem,{au:o,btitle:u,date:n,doi:c,epage:s,isbn:r,pub:a,spage:i,title:t})},Mf=e=>{const t=p(e,"property","og:title"),r=p(e,"name","citation_issn"),n=p(e,"name","citation_publication_date"),o=ar(e,".author-group .button-link-text"),i=p(e,"name","citation_publisher"),s=p(e,"name","citation_firstpage"),a=p(e,"name","citation_issue"),c=p(e,"name","citation_volume"),u=ir(e),l=p(e,"name","citation_journal_title")??e.querySelector(".publication-title")?.textContent??void 0;return q(S.Article,{au:o,jtitle:l,date:n,doi:u,issn:r,issue:a,pub:i,spage:s,title:t,volume:c})},Ff=e=>{const t=e.getElementById("journal-title")?.textContent??void 0,r=Bf(e);return q(S.Journal,{issn:r,title:t})},Wf=({document:e})=>{switch(Df(e)){case b.Book:return E(Uf(e));case b.Chapter:return E(Vf(e));case b.Article:return E(Mf(e));case b.Journal:return E(Ff(e));default:return L()}},Gf=e=>{const t=p(e,"name","pbContext");return t&&Ho(t).has("article")?b.Article:b.Journal},Xf=e=>{const t=e.querySelector(".itemPageRangeHistory");if(!t)return;const n=Array.from(t.childNodes).find(o=>o.textContent?.trim().startsWith("Page"));if(n)return n.textContent?.replace(/Pages?/,"").trim()??void 0},Hf=e=>{const t=e.querySelector(".issue-heading")?.textContent;return t?t.split(",")[0]?.replace("Volume","").trim():void 0},Yf=e=>{const t=e.querySelector(".issue-heading .nav-toc-list")?.textContent;return t?t.replace("Issue","").trim():void 0},Kf=e=>{const t=p(e,"property","og:title"),r=p(e,"name","dc.Publisher"),n=p(e,"name","dc.Date"),o=p(e,"name","publication_doi"),i=p(e,"name","citation_journal_title"),s=Q(e,"name","dc.Creator"),a=Hf(e),c=Yf(e),u=Xf(e),l=u?.includes("-")?u.split("-")[0]:u,f=u?.includes("-")?u.split("-")[1]:u;return q(S.Article,{au:s,jtitle:i,date:n,doi:o,issue:c,pub:r,spage:l,epage:f,title:t,volume:a})},Qf=e=>{const t=p(e,"property","og:title"),r=p(e,"name","publication_doi");return q(S.Journal,{doi:r,title:t})},eh=({document:e})=>{switch(Gf(e)){case b.Article:return E(Kf(e));case b.Journal:return E(Qf(e));default:return L()}},th=e=>tr.safeParse(e).success,rh=e=>Wo.safeParse(e).success,nh=e=>Xt.safeParse(e).success;function oh(e){return Yt.safeParse(e).success}function bt(e){return Kt.safeParse(e).success}function is(e){return Qt.safeParse(e).success}function as(e){return er.safeParse(e).success}function sh(e){return Ht.safeParse(e).success}const ih=e=>Array.from(e.querySelectorAll("tr th")).find(n=>n.textContent.trim()==="DOI:")?.nextElementSibling?.querySelector('span[property="identifier"]')?.textContent??void 0,ah=e=>{const t=/Record\/(\d+)/.exec(e);if(t&&t.length>1)return t[1]},ch=e=>{const{url:t,document:r}=e,n=rr(e);if(!bt(n))return n;const o=ih(r);return o&&(n.resource.rft_id=[`info:doi/${o}`]),n.resource.bibid=ah(t),n},uh=Ce.extend({"@type":X("VideoObject"),name:h(),author:h(),genre:h(),description:h(),uploadDate:h(),duration:h(),thumbnailUrl:U(h())}),lh=e=>uh.safeParse(e).success,ph=e=>{const t=ns(e);if(t.length===0)return null;const r=t.map(Ge).filter(lh);return r.length!==1?null:r[0]},fh=({url:e,document:t})=>{const r=ph(t);return r?{bookmarkingWorkflowUrl:null,resource:ge({au:[r.author],date:r.uploadDate,title:r.name,uri:e})}:L()},cs=e=>p(e,"name","doi")??p(e,"name","DOI")??p(e,"name","citation_doi")??p(e,"name","dc.identifier")??p(e,"name","prism.doi")??void 0,us=e=>{const t=e.editor?.map(o=>o.name)??[],n=[...e.author?.map(o=>o.name)??[],...t];if(n.length!==0)return n};var Xe=(e=>(e.Book="Book",e.Journal="Journal",e.Periodical="Periodical",e.PublicationVolume="PublicationVolume",e.ScholarlyArticle="ScholarlyArticle",e.VideoObject="VideoObject",e.WebPage="WebPage",e))(Xe||{}),Ae=(e=>(e.Article="article",e.Book="book",e.Paper="Paper",e.Video="video.other",e.Website="website",e))(Ae||{}),pe=(e=>(e.Article="/article/",e.Book="/book/",e.Chapter="/chapter/",e.Video="/video/",e.ReferenceWorkEntry="/referenceworkentry/",e.ReferenceWork="/referencework/",e.Protocol="/protocol/",e.Collections="/collections/",e.Journal="/journal/",e.JournalIssue="/volumes-and-issues/",e))(pe||{});const ls=k({"@type":X(Xe.ScholarlyArticle),author:U(k({"@type":h(),name:h()})).optional(),editor:U(k({"@type":h(),name:h()})).optional(),datePublished:h().optional(),headline:h().optional(),issn:U(h()).optional(),pageStart:h().optional(),pageEnd:h().optional(),isPartOf:k({"@type":de([h(),U(h())]),name:h(),issn:U(h()).optional(),volumeNumber:h().optional(),isbn:U(h()).optional()}),publisher:k({"@type":h(),name:h()}).optional()}),ps=e=>ls.safeParse(e).success,hh=Ce.extend({"@type":X(Xe.WebPage),mainEntity:ls}),dh=e=>hh.safeParse(e).success,mh=k({"@type":U(h()),name:h().optional(),issn:U(h()),volumeNumber:h().optional()}),fs=e=>mh.safeParse(e).success,gh=(e,t)=>p(e,"name","citation_issn")??p(e,"name","prism.issn")??(ps(t.isPartOf)?t.isPartOf.issn?.[0]:void 0),hs=(e,t)=>{const r=us(t),n=p(e,"name","citation_online_date"),o=cs(e),i=p(e,"name","citation_issue"),s=gh(e,t),a=fs(t.isPartOf)&&t.isPartOf.issn.length>0?t.isPartOf.issn[1]:void 0,c=t.pageStart,u=t.pageEnd,l=t.headline,f=t.isPartOf.name,d=fs(t.isPartOf)?t.isPartOf.volumeNumber:void 0;return q(S.Article,{au:r,date:n,doi:o,issue:i,eissn:s,issn:a,spage:c,epage:u,atitle:l,jtitle:f,volume:d})},vh=Ce.extend({"@type":X(Xe.Book),copyrightYear:h().optional(),author:U(k({"@type":h(),name:h()})).optional(),editor:U(k({"@type":h(),name:h()})).optional(),isbn:h().optional(),name:h().optional(),numberOfPages:Ao().optional(),publisher:k({"@type":h(),name:h()}).optional()}),bh=e=>vh.safeParse(e).success,yh=e=>{const t=e.querySelectorAll(".c-bibliographic-information__list-item"),r=new Map;return t.forEach(n=>{const o=n.querySelector(".u-text-bold")?.textContent.trim(),i=n.querySelector(".c-bibliographic-information__value")?.textContent.trim();o&&i&&r.set(o,i)}),r},_h=(e,t)=>{const r=yh(e),n=us(t),o=t.copyrightYear?.toString(),i=cs(e)??r.get("DOI"),s=t.name??r.get("Book Title"),a=t.isbn??r.get("Softcover ISBN"),c=t.numberOfPages?.toString()??r.get("Number of Pages"),u=t.publisher?.name??r.get("Publisher");return V(S.Book,{au:n,date:o,doi:i,title:s,isbn:a,tpages:c,pub:u})},Sh=k({"@type":X("Periodical"),name:h(),url:h(),issn:U(h()),editor:U(k({givenName:h(),familyName:h()})),publisher:k({name:h()}),description:h()}),Eh=e=>Sh.safeParse(e).success,$h=e=>{const t=e.editor.map(({givenName:s,familyName:a})=>`${s} ${a}`),r=e.name,[n,o]=e.issn,i=e.publisher.name;return q(S.Journal,{au:t,jtitle:r,eissn:n,issn:o,pub:i})},Ah=k({"@type":X(Xe.VideoObject),name:h().optional(),description:h().optional(),thumbnailUrl:h().optional(),uploadDate:h().optional(),contentUrl:h().optional(),duration:h().optional()}),wh=e=>Ah.safeParse(e).success,Rh=(e,t)=>{const r=Array.from(e.querySelectorAll('dd[data-test="video-segment-author"]')).map(s=>s.textContent.trim()).filter(s=>!!s),n=t?.uploadDate?new Date(t.uploadDate).getFullYear().toString():void 0,o=t?.name??p(e,"property","og:title")??void 0,i=e.querySelector("video-about-doi")?.textContent??void 0;return ge({au:r.length>0?r:void 0,date:n,doi:i,title:o})},kh=e=>{const t=p(e,"property","og:title");return dt({title:t})},Ih=(e,t)=>{const r=p(t,"property","og:type");return r===Ae.Article&&e.includes(pe.Article)?b.Article:r===Ae.Book&&(e.includes(pe.Book)||e.includes(pe.ReferenceWork))?b.Book:r===Ae.Paper&&e.includes(pe.Chapter)?b.Chapter:r===Ae.Paper&&(e.includes(pe.ReferenceWorkEntry)||e.includes(pe.Protocol))?b.Article:r===Ae.Video&&e.includes(pe.Video)?b.AudioVisual:r===Ae.Website&&(e.includes(pe.Collections)||e.includes(pe.JournalIssue))?b.Webpage:r===Ae.Website&&e.includes(pe.Journal)?b.Journal:b.None},Ch=(e,t,r)=>e===b.AudioVisual&&wh(r)?E(Rh(t,r)):e===b.Book&&bh(r)?E(_h(t,r)):(e===b.Chapter||e===b.Article)&&ps(r)?E(hs(t,r)):e===b.Article&&dh(r)?E(hs(t,r.mainEntity)):e===b.Journal&&Eh(r)?E($h(r)):L(),Oh=({url:e,document:t})=>{const r=Ih(e,t);if(r===b.Webpage)return E(kh(t));const n=vt(t);if(!n)return L();const o=Ge(n);return o?Ch(r,t,o):L()},Ph=new Set(["Print ISBN","Online ISBN","DOI","First published","Online ISSN","Print ISSN"]),Nh=k({content:k({item:k({title:h(),"published-date":h()}),group:k({volume:h(),issue:h()}),series:k({title:h(),type:h(),eissn:h()})}).optional()}),ds=(e,t)=>{if(!e)return;const r=e.indexOf(t);return r>-1?e.substring(0,r):e},cr=e=>{const r=/\d+/.exec(e);if(r?.[0])return r[0]},zh=e=>{const t=e.querySelectorAll("script"),n=Array.from(t).find(o=>o.textContent.includes("adobeDataLayerJson"))?.textContent.match(/var adobeDataLayerJson = (\{.*?});/s);if(n?.length===2)try{const o=JSON.parse(n[1]);return Nh.parse(o)}catch{return}},Th=(e,t)=>{const r=p(e,"property","og:type"),n=t.includes("epdf");return r==="Book"||r==="books.book"?b.Book:r==="Chapter"?b.Chapter:r==="Journal"?b.Journal:r==="Article"||n?b.Article:b.None},yt=e=>{const t=Q(e,"name","citation_author"),r=Array.from(e.querySelectorAll("#product-details-content .product-authors")).map(o=>o.textContent).filter(o=>!!o),n=new Set([...t,...r]);return n.size>0?[...n]:void 0},Lh=e=>{const t=Array.from(e.querySelectorAll("#product-details-content .text-piped p")).map(r=>r.textContent).find(r=>r.endsWith(" pages"));if(t)return cr(t)},_t=e=>{const t=new Map,r=Array.from(e.querySelectorAll(".journal-info-container .info-block")).flatMap(n=>Array.from(n.querySelectorAll(".info_label")));for(const n of r){const o=n.nextElementSibling;if(!o?.classList.contains("info_value"))continue;const i=ds(n.textContent,":"),s=ds(o.textContent,":");!i||!s||Ph.has(i)&&t.set(i,s)}return t},St=(e,t)=>p(e,"property","books:release_date")??p(e,"name","citation_online_date")??t.get("First published")??void 0,ur=(e,t)=>p(e,"name","dc.identifier")??p(e,"name","citation_doi")??p(e,"name","publication_doi")??t.get("DOI")??void 0,ms=(e,t)=>{const r=new Set([p(e,"property","books:isbn"),t.get("Print ISBN"),t.get("Online ISBN")].filter(n=>!!n));return r.size>0?[...r].join(","):void 0},xh=e=>{let t,r;const n=e.querySelector(".cover-image__details div:first-of-type");if(n?.childNodes.length===2){const[o,i]=n.childNodes;o.textContent&&(t=cr(o.textContent)),i.textContent&&(r=cr(i.textContent))}return{volume:t,issue:r}},jh=e=>{const r=Array.from(e.querySelectorAll(".authors .author")).map(n=>n.textContent.trim().replace(",","")).filter(n=>!!n);return r.length>0?r:void 0},qh=e=>{const t=Array.from(e.querySelectorAll(".details-section .details-entry")),r=t.find(s=>s.querySelector(".details-label")?.textContent.trim()==="ISSN"),n=t.find(s=>s.querySelector(".details-label")?.textContent.trim()==="eISSN");let o,i;return r&&(o=r.querySelector(".details-value")?.textContent.trim()),n&&(i=n.querySelector(".details-value")?.textContent.trim()),{issn:o,eissn:i}},Dh=e=>{if(!e?.content?.group)return{volume:void 0,issue:void 0};const t=e.content.group.volume,r=e.content.group.issue;return r==="0"&&t==="0"?{volume:void 0,issue:void 0}:{volume:t,issue:r}},Zh=e=>{const n=Array.from(e.querySelectorAll(".details-section .details-entry")).find(s=>s.querySelector(".details-label")?.textContent.trim()==="Pages")?.querySelector(".details-value")?.textContent.trim(),[o,i]=(n?.split("-")??[void 0,void 0]).map(s=>s?.trim());return o?.toLowerCase()==="n/a"&&i?.toLowerCase()==="n/a"?{spage:void 0,epage:void 0}:{spage:o,epage:i}},Bh=e=>{const t=_t(e),r=yt(e),n=p(e,"property","og:title"),o=St(e,t),i=ur(e,t),s=ms(e,t),a=Lh(e);return V(S.Book,{au:r,date:o,doi:i,isbn:s,pages:a,title:n})},Jh=e=>{const t=_t(e),r=yt(e),n=p(e,"name","citation_book_title"),o=St(e,t),i=ur(e,t),s=ms(e,t),a=p(e,"name","citation_publisher"),c=p(e,"property","og:title");return V(S.Bookitem,{au:r,btitle:n,date:o,doi:i,isbn:s,pub:a,title:c})},Uh=e=>{const t=_t(e),r=yt(e),n=St(e,t),o=t.get("Online ISSN"),i=t.get("Print ISSN"),s=p(e,"property","og:title"),{volume:a,issue:c}=xh(e);return q(S.Journal,{au:r,date:n,eissn:o,issn:i,issue:c,title:s,volume:a})},Vh=e=>{const t=_t(e),r=zh(e),n=yt(e)??jh(e),o=St(e,t)??r?.content?.item["published-date"],i=ur(e,t),{issn:s,eissn:a}=qh(e),{volume:c,issue:u}=Dh(r),l=p(e,"property","og:title")??r?.content?.item.title,f=p(e,"name","citation_journal_title")??r?.content?.series.title,{spage:d,epage:g}=Zh(e);return q(S.Article,{au:n,date:o,doi:i,eissn:a,issn:s??p(e,"name","citation_issn"),issue:u,jtitle:f,title:l,volume:c,spage:d,epage:g})},Mh=({document:e,url:t})=>{switch(Th(e,t)){case b.Book:return E(Bh(e));case b.Chapter:return E(Jh(e));case b.Journal:return E(Uh(e));case b.Article:return E(Vh(e));default:return L()}},Fh=e=>{const t=Q(e,"name","citation_author");return t.length>0?t:void 0},Wh=({document:e})=>{const t=Fh(e),r=p(e,"name","citation_publication_date"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_isbn"),i=p(e,"name","citation_publisher"),s=p(e,"name","citation_title")??e.title,a=ge({au:t,date:r,doi:n,isbn:o,pub:i,title:s});return E(a)},Gh=({document:e})=>Array.from(e.querySelectorAll(".Z3988")).length<=1?L():Go(),Et=e=>{if(!(!e||e.length===0))return e[0]};function lr(e,t){const r=t.map(n=>{const o=e.querySelector(n)?.textContent??null;if(o&&o.trim()!=="")return o}).filter(n=>n);return Et(r)??null}function Xh(e,t){const r=t.flatMap(n=>Array.from(e.querySelectorAll(n)).flatMap(i=>{const s=i.textContent;return s&&s.trim()!==""?s.split(";").map(a=>a.trim()).filter(a=>a.length>0):[]}));return r.length>0?r:null}const He=(e,t)=>lr(e,[t])?.trim(),Hh=e=>{const t=e.querySelector(".content-meta-data__authors")?.textContent;if(t)return t.split(/,\s+|\s+and\s+/).filter(r=>!!r)},Yh=e=>{const t=Array.from(e.querySelectorAll('.tombstone-metadata [data-qa="item-authors"]')).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},Kh=e=>{const t=Array.from(e.querySelectorAll('.item-authors [data-qa="item-contributors"], .item-authors [data-qa="item-creators"]')).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},Qh=e=>{const t=Array.from(e.querySelectorAll(".contrib-type-author .name")).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},Oe=e=>{const t=new Set([...Kh(e)??[],...Hh(e)??[],...Qh(e)??[],...Yh(e)??[]]);return t.size?[...t]:void 0},Pe=(e,t)=>e.querySelector('[data-qa="published-date"]')?.textContent??e.querySelector(".summary-image")?.textContent??De(t?.get("date"))??De(t?.get("copyright date"))??De(t?.get("published date")),gs=e=>{const t=e.find(r=>r.startsWith("https://doi.org/"));if(t)return t.replace("https://doi.org/","")},vs=e=>{const t=e.get("local identifier");if(t?.length)return gs(t)},ed=e=>e.querySelector(".doi")?.getAttribute("href")??void 0,De=e=>{if(e?.length)return e[0]},Ne=e=>{const t=new Map;return Array.from(e.querySelectorAll(".metadata-element, .metadata")).map(r=>{const o=r.querySelector(".metadata-label")?.textContent.trim().toLowerCase(),i=Array.from(r.querySelectorAll(".metadata-value")).map(s=>s.textContent).filter(s=>!!s);return{name:o,values:i}}).forEach(({name:r,values:n})=>{!r||!n.length||t.set(r,n)}),t},bs=e=>{const t=Ne(e),r=e.querySelector(".summary-journal"),n=Array.from(r?.childNodes??[]),o=n[0]?.textContent??e.querySelector(".journal-link")?.textContent??void 0,i=n[2]?.textContent?.replace(/Published By:\s+?/i,"")??De(t.get("publisher"))??e.querySelector(".publisher-link")?.textContent??void 0;return{pub:i&&i.trim()!==""?i:void 0,jtitle:o&&o.trim()!==""?o:void 0}},td=e=>{const t=lr(e,['[data-qa="journal"]:first-child cite','[data-qa="copyright-statement"] > cite','[data-qa="collection-links"] mfe-content-details-pharos-link']);return t&&t.trim()!==""?t:void 0},$t=e=>be(e.querySelector('[data-qa="page-count"]')?.textContent),Ye=(e,t)=>e.querySelector(".publisher-link")?.textContent??De(t?.get("publisher")),we=e=>e.querySelector('[data-qa="item-title"]')?.textContent.trim()??e.querySelector("mfe-turnaway-pharos-heading")?.textContent.trim()??e.querySelector(".metadata mfe-toc-pharos-heading")?.textContent.trim()??e.querySelector(".journal_header-title")?.textContent.trim()??void 0,Re=e=>{if(!URL.canParse(e))return;const t=new URL(e);return t.origin+t.pathname},rd=e=>{const t=e.querySelector(".ccda-container > :first-child");let r,n;if(t?.textContent.includes("Volume")||t?.textContent.includes("Issue")){const o=t.textContent.trim().split(/,\s+/);for(const i of o)i.startsWith("Volume")?n=be(i):i.startsWith("Issue")&&(r=be(i))}return{issue:r,volume:n}},nd=e=>{const t=e.querySelector('[data-qa="item-src-info"]')?.textContent??p(e,"property","og:description")??p(e,"name","description");if(!t)return{};const r=/Vol\.\s*(\d+)/.exec(t),n=r?r[1]:void 0,o=/No\.\s*(\d+)/.exec(t),i=o?o[1]:void 0,s=/pp\.\s*(\d+)-(\d+)/.exec(t),a=s?s[1]:void 0,c=s?s[2]:void 0,u=/pp\.\s*\d+-\d+\s*\((\d+)\s*pages\)/.exec(t),l=u?u[1]:void 0;return{issue:i,volume:n,spage:a,epage:c,pages:l}},od=e=>{const t=lr(e,["mfe-turnaway-pharos-link",'[data-qa="item-src-info"]']);if(!t)return;const n=/\(.+\)/.exec(t)?.map(o=>{const i=/\d{4}/.exec(o);return i?i[0]:void 0});return Et(n)},sd=(e,t)=>{const r=we(e),n=Oe(e),o=Pe(e)??od(e),i=bs(e),s=i.jtitle??td(e)??void 0,a=i.pub,c=rd(e),u=nd(e),l=c.issue??u.issue,f=c.volume??u.volume,d=$t(e)??u.pages,g=u.spage,I=u.epage,v=Re(t),P=gs(Array.from(e.querySelector(".content-meta-data-stables")?.childNodes??[]).map(D=>D.textContent??""))??ed(e);return q(S.Article,{atitle:r,au:n,date:o,doi:P,epage:I,issue:l,jtitle:s,pages:d,pub:a,spage:g,uri:v,volume:f})},id=(e,t)=>{const r=Ne(e),n=Oe(e),o=Pe(e,r),i=we(e),s=Ye(e,r),a=Re(t);return ge({au:n,date:o,pub:s,title:i,uri:a})},ad=(e,t)=>{const r=Ne(e),n=Oe(e),o=we(e),i=Pe(e),s=$t(e),a=Ye(e,r),c=Re(t),u=vs(r);return V(S.Book,{au:n,date:i,doi:u,pages:s,pub:a,title:o,uri:c})},cd=(e,t)=>{const r=Ne(e),n=Oe(e),o=we(e),i=e.querySelector(".book-title-link")?.textContent??void 0,s=Pe(e,r),a=Array.from(e.querySelectorAll('[data-qa="book"] > span')).map(d=>d.textContent),c=$t(e),u=a.find(d=>d.includes("pp."))?.match(/(\d+)-(\d+)/)??void 0,l=Ye(e,r),f=Re(t);return V(S.Bookitem,{atitle:o,au:n,btitle:i,date:s,epage:u?.[2],pub:l,pages:c,spage:u?.[1],uri:f})},ud=(e,t)=>{const r=Ne(e),n=Oe(e),o=we(e),i=Pe(e),s=$t(e),a=Ye(e,r),c=Re(t),u=vs(r);return V(S.Document,{au:n,date:i,doi:u,pages:s,pub:a,title:o,uri:c})},ld=(e,t)=>{const r=Ne(e),n=Oe(e),o=Pe(e,r),i=we(e),s=Re(t);return To({au:n,date:o,title:i,uri:s})},pd=(e,t)=>{const{pub:r}=bs(e),n=we(e),o=e.querySelector(".eissn")?.textContent.replace(/EISSN\s+/,"").trim()??void 0,i=e.querySelector(".issn")?.textContent.replace(/ISSN\s+/,"").trim()??void 0,s=Re(t);return q(S.Journal,{eissn:o,issn:i,jtitle:n,pub:r,uri:s})};var ce=(e=>(e.Article="journal article",e.Audio="audio",e.Book="book",e.Chapter="book chapter",e.Document="document",e.Image="image",e.Journal="journal",e.ResearchReport="research report",e.Serial="serial",e.Video="video",e))(ce||{});const fd=(e,t)=>{const r=Ne(e),n=Oe(e),o=Pe(e,r),i=we(e),s=Ye(e,r),a=Re(t);return ge({au:n,date:o,pub:s,title:i,uri:a})},hd=e=>Object.values(ce).includes(e),dd=e=>{if(e.querySelector(".journal_header-title"))return ce.Journal;if(e.querySelector(".journal-link"))return ce.Article;const n=e.querySelector(".content-type > span")?.textContent.toLowerCase().trim()??e.querySelector(".content-meta-data-label")?.textContent.toLowerCase().trim();return hd(n)?n:null},md=(e,t)=>{switch(dd(e)){case ce.Article:case ce.Serial:return sd(e,t);case ce.Audio:return id(e,t);case ce.Book:return ad(e,t);case ce.Chapter:case ce.ResearchReport:return cd(e,t);case ce.Document:return ud(e,t);case ce.Image:return ld(e,t);case ce.Journal:return pd(e,t);case ce.Video:return fd(e,t);default:return null}},gd=({document:e,url:t})=>{const r=md(e,t);return r?E(r):L()},Ke=e=>{if(e){if(typeof e=="string")return e;if(e.length>0)return e[0]}else return},ys=e=>{if(e)return typeof e=="string"?e:Array.isArray(e)?e.length===0?void 0:Ke(e[0].name):Ke(e.name)},At=(...e)=>{const t=new Set(e.filter(r=>!!r));if(t.size!==0)return[...t]},vd=e=>{const t=ys(e.mainEntity.creator);return t?[t]:void 0},Qe=({lcn:e,title:t})=>({bibid:e,title:t}),bd=(e,t)=>{const r=At(...(e&&vd(e))??[],...t.authors??[]),n=At(...t.eissns??[]),o=At(e?.mainEntity.isbn?sr(e.mainEntity.isbn):void 0,...t.isbns??[]),i=At(...e?.mainEntity.issn??[],...t.issns??[]),[s,a]=e?.mainEntity.pagination?.split("-")??[];return{authors:r,date:t.date,doi:Ke(t.dois),edition:e?.mainEntity.edition??t.edition,epage:a,eissn:Ke(n),lcn:t.lcn??e?.identifier.value,isbn:o?.join(","),issn:Ke(i),issue:e?.mainEntity.issueNumber,jtitle:t.jtitle,publisher:t.publisher??ys(e?.mainEntity.publisher),spage:s,title:e?.name??t.title,volume:e?.mainEntity.volumeNumber}},yd=e=>q(S.Article,{...Qe(e),au:e.authors,doi:e.doi,eissn:e.eissn,epage:e.epage,issn:e.issn,issue:e.issue,jtitle:e.jtitle,pub:e.publisher,spage:e.spage,volume:e.volume}),_d=e=>ge({...Qe(e),au:e.authors,date:e.date,pub:e.publisher}),Sd=e=>V(S.Book,{...Qe(e),au:e.authors,date:e.date,doi:e.doi,edition:e.edition,epage:e.epage,isbn:e.isbn,pub:e.publisher,spage:e.spage}),Ed=e=>q(S.Journal,{...Qe(e),date:e.date,doi:e.doi,eissn:e.eissn,issn:e.issn,pub:e.publisher}),_s=k({"@type":X("Organization"),name:de([h(),U(h())])}),Ss=k({"@type":X("Person"),name:de([h(),U(h())])}),$d=Ce.extend({identifier:k({"@type":h(),propertyID:h(),value:h()}),mainEntity:k({"@type":h(),"@id":h(),creator:me(de([h(),Ss,U(Ss)])),edition:me(h()),isbn:me(h()),issn:me(U(h())),issueNumber:me(h()),pagination:me(h()),publisher:me(de([h(),_s,U(_s)])),volumeNumber:me(h())}),name:h()}),Ad=e=>{const t=vt(e);if(!t)return null;const r=Ge(t),n=$d.safeParse(r);return n.success?n.data:null},wd=e=>ge({...Qe(e),au:e.authors,date:e.date,pub:e.publisher}),Rd=/([0-9]{4}-[0-9]{1,2}-[0-9]{1,2}|[0-9]{4}-[0-9]{1,2}|[0-9]{4})/,Es=/(E?ISBN|E?ISSN|DOI)\s*:\s*/g,pr=e=>`*:has([title*="${e}" i]) + .item-details-element-container prm-highlight`,kd=e=>{if(!e)return;const t=Rd.exec(e);if(t)return t.length>1?t[1]:void 0},Id=e=>{const t=Array.from(e.querySelectorAll(pr("Identifier"))),r={};return t.map(n=>n.textContent).filter(n=>!!n).forEach(n=>{const o=[];let i;for(;(i=Es.exec(n))!==null;)o.push({id:i[1].toLowerCase(),index:i.index,start:Es.lastIndex});o.forEach(({id:s,start:a},c)=>{r[s]??=[],r[s].push(n.substring(a,o[c+1]?.index))})}),r},Cd=e=>Array.from(e.querySelectorAll(pr("Author"))).filter(t=>!!t.textContent&&t.parentElement!==null&&t.parentElement.getAttribute("aria-hidden")!=="true").map(t=>t.textContent.trim()),ke=(e,t)=>e.querySelector(pr(t))?.textContent.trim(),Od=e=>{const t=ke(e,"Creation Date"),r=ke(e,"Edition"),n=ke(e,"Publication Date"),o=ke(e,"Is Part Of"),i=ke(e,"Publisher"),s=ke(e,"Title"),a=ke(e,"MMS ID")??ke(e,"Record ID"),c=Cd(e),u=Id(e),[l]=o?.split(",")??[],f=kd(n??t),d=[...u.isbn??[],...u.eisbn??[]].map(g=>sr(g)).filter(g=>!!g);return{authors:c,date:f,dois:u.doi,edition:r,eissns:u.eissn,isbns:d,issns:u.issn,jtitle:l,lcn:a,publisher:i,title:s}};var $s=(e=>(e.Article="Article",e.Book="Book",e.Periodical="Periodical",e.Journal="Journal",e.AudioCD="Audio CD",e.CreativeWork="CreativeWork",e.Movie="Movie",e.Video="Video",e))($s||{});const Pd=e=>Object.values($s).includes(e),Nd=(e,t)=>{const r=t?.mainEntity["@type"]??e.querySelector(".media-content-type")?.textContent??void 0;if(Pd(r))return r},zd=({document:e})=>{const t=Ad(e),r=Od(e),n=bd(t,r);switch(Nd(e,t)){case"Article":return E(yd(n));case"Book":return E(Sd(n));case"Periodical":case"Journal":return E(Ed(n));case"Audio CD":case"CreativeWork":return E(_d(n));case"Movie":case"Video":return E(wd(n));default:return L()}},Td=e=>{const t=e.querySelectorAll('[id="Info"] > p'),n=Array.from(t).find(i=>i.textContent.includes("Document Type"))?.textContent,o=p(e,"name","DC.identifier");return o?.startsWith("info:doi/")||n?.includes("Article")?b.Article:o?.startsWith("urn:issn:")?b.Journal:void 0},Ld=e=>{const t=p(e,"name","DCTERMS.bibliographicCitation"),[r,n,o,i]=t?.split(",")??[];return{journalTitle:r,volume:n,issue:o,pages:i}},xd=e=>{const t=p(e,"name","DC.identifier");return(t?t.split("info:doi/"):null)?.[1]??void 0},jd=e=>e.evaluate('//*[@id="altLayoutPublisherLogo"]/p/a[1]',e,null,XPathResult.STRING_TYPE,null).stringValue,qd=e=>{const[t,r]=e?e.trim().split("-"):[void 0,void 0],n=r?.replace(/\(\d+\)/,"").trim();return{spage:t,epage:n}},Dd=e=>{const t=p(e,"name","DCTERMS.issued");if(!t)return;const n=/\d{4}/.exec(t);return n?n[0]:void 0},Zd=e=>{const t=p(e,"name","DC.title"),r=p(e,"name","DC.publisher"),n=Dd(e),o=Ld(e),i=o.journalTitle?.trim(),s=o.volume?.trim(),a=o.issue?.trim(),c=o.pages?qd(o.pages):void 0,u=c?.spage,l=c?.epage,f=Q(e,"name","DC.creator"),d=xd(e);return q(S.Article,{au:f,jtitle:i,date:n,doi:d,issue:a,pub:r,spage:u,epage:l,atitle:t,volume:s})},Bd=e=>{const t=p(e,"name","DC.title"),r=p(e,"name","DC.publisher"),n=jd(e);return q(S.Journal,{issn:n,title:t,pub:r})},Jd=({document:e})=>{switch(Td(e)){case b.Article:return E(Zd(e));case b.Journal:return E(Bd(e));default:return L()}},Ud=/^\d{4}-\d{3}[\dX]$/i,Vd=e=>Ud.test(e),As=e=>{const t=e.filter(Vd);return t.length?t:void 0},fr=e=>{const t=Q(e,"name","citation_author");return t.length?t:void 0},hr=e=>p(e,"name","citation_publication_date")?.match(/^\d{4}/)?.[0],Md=e=>p(e,"name","citation_doi"),ws=e=>{const t=Q(e,"name","citation_isbn");return t.length?t.join(","):void 0},Rs=e=>As(Q(e,"name","citation_issn")),dr=e=>p(e,"name","citation_journal_title"),mr=e=>p(e,"name","citation_publisher"),wt=e=>p(e,"name","citation_title"),Fd=e=>p(e,"name","citation_doi"),gr=e=>p(e,"name","citation_firstpage"),vr=e=>p(e,"name","citation_lastpage"),Wd=e=>p(e,"name","citation_issue"),Gd=e=>p(e,"name","citation_volume"),Xd=e=>q(S.Article,{atitle:wt(e),au:fr(e),date:hr(e),doi:Md(e),issn:Rs(e)?.[0],issue:Wd(e),jtitle:dr(e),pub:mr(e),volume:Gd(e),spage:gr(e),epage:vr(e)}),Hd=e=>V(S.Bookitem,{atitle:wt(e),au:fr(e),btitle:dr(e),date:hr(e),isbn:ws(e),pub:mr(e),spage:gr(e),epage:vr(e)}),Yd=e=>Mt({title:wt(e),au:fr(e),date:hr(e),pub:mr(e),spage:gr(e),epage:vr(e)}),ks=e=>!!e.isbn,Kd=e=>!!e.issn||e.type==="Article"&&!!e.journalTitle||!ks(e)&&!!e.journalTitle,Qd=e=>!!e.title,em=e=>{const t={type:Fd(e),isbn:ws(e),issn:Rs(e),journalTitle:dr(e),title:wt(e)};return ks(t)?Hd(e):Kd(t)?Xd(e):Qd(t)?Yd(e):null},tm=({url:e,document:t})=>{const r=em(t);return r?E({...r,uri:e}):L()},rm=k({"@content":h(),datePublished:h().optional(),mainEntity:k({type:h().optional(),name:h().optional(),author:U(k({name:h()})).optional(),publisher:k({type:h(),name:h()}).optional(),isbn:h().optional()})}),nm=e=>rm.safeParse(e).success,om=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(nm(r))return r}catch{return null}return null},sm=({document:e})=>{const t=vt(e);if(!t)return L();const r=om(t);if(!r)return L();const n=r.mainEntity.type,o=r.mainEntity.author?.map(u=>u.name),i=r.datePublished?.substring(0,4),s=r.mainEntity.name,a=r.mainEntity.isbn,c=r.mainEntity.publisher?.name;return n==="Book"?E(V(S.Book,{au:o,date:i,title:s,isbn:a,pub:c})):L()},im=Ce.extend({"@type":h().optional(),name:h().optional(),copyrightYear:Ao().optional(),author:U(k({name:h()})).optional(),publisher:U(k({name:h()})).optional()}),am=e=>im.safeParse(e).success,cm=({document:e,url:t})=>{const r=vt(e);if(!r)return L();const n=Ge(r);if(!n||!am(n))return L();const o=n["@type"],i=n.author?.map(l=>l.name),s=n.copyrightYear?.toString()??p(e,"property","og:book:release_date"),a=n.name,c=Et(n.publisher?.map(l=>l.name)),u=p(e,"property","og:book:isbn");return o==="Book"?E(V(S.Book,{au:i,date:s,title:a,isbn:u,pub:c,uri:t})):L()},um=e=>{const t=Array.from(e.querySelectorAll("a[rel=author]")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},lm=e=>{const t=Array.from(e.querySelectorAll("strong")).filter(r=>r.textContent.startsWith("ISBN")).map(r=>r.nextElementSibling?.textContent.trim());if(t.length!==0)return t[0]?.replace(/\s+/,",")},pm=({url:e,document:t})=>{const r=t.querySelector("h3.page-title")?.textContent.trim()??void 0,n=um(t),o=p(t,"property","article:published_time"),i=lm(t),s=V(S.Book,{au:n,date:o?.substring(0,4),isbn:i,pub:"Milne Open Textbooks",title:r,uri:e});return E(s)},fm=({document:e,url:t})=>{switch(hm(t)){case b.Chapter:return E(bm(e));case b.Book:return E(ym(e));case b.Article:return E(dm(e));case b.Journal:return E(mm(e));default:return L()}},hm=e=>{const{pathname:t}=new URL(e);return t.includes("/books/abs/")?b.Chapter:t.includes("/books/")?b.Book:/\/journals\/.+\/article\//.exec(t)!=null?b.Article:t.includes("/journals/")?b.Journal:b.None},dm=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_journal_title"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_volume"),i=p(e,"name","citation_issue"),s=p(e,"name","citation_firstpage"),a=p(e,"name","citation_lastpage"),c=p(e,"name","citation_publication_date")?.substring(0,4),u=p(e,"name","citation_publisher"),l=Is(e),f=As(Q(e,"name","citation_issn"));return q(S.Article,{atitle:t,au:l,jtitle:r,doi:n,volume:o,issue:i,issn:f?.[0],spage:s,epage:a,date:c,pub:u})},mm=e=>{const t=gm(e),r=vm(e),n=r.find(a=>a.type==="Print"),o=r.find(a=>a.type==="Online"),i=n?n.value:void 0,s=o?o.value:void 0;return q(S.Journal,{title:t,issn:i,eissn:s})},gm=e=>e.querySelector("h1.title")?.textContent.trim()??void 0,vm=e=>{const r=Array.from(e.querySelectorAll("span.bold")).find(i=>i.textContent.trim()==="ISSN:"),n=/^([0-9]{4}-[0-9]{3}[0-9X]) \((Print|Online)\)/,o=[];return r&&r.parentElement?.querySelectorAll("span.value")?.forEach(s=>{const a=s.textContent.trim(),c=n.exec(a);c&&o.push({value:c[1],type:c[2]})}),o},bm=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_inbook_title"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_publication_date")?.substring(0,4),i=p(e,"name","citation_publisher");return V(S.Bookitem,{atitle:t,btitle:r,doi:n,date:o,pub:i})},ym=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_doi"),n=p(e,"name","citation_isbn"),o=p(e,"name","citation_publication_date")?.substring(0,4),i=p(e,"name","citation_publisher"),s=Is(e);return V(S.Book,{title:t,au:s,doi:r,isbn:n,date:o,pub:i})},Is=e=>{const t=Q(e,"name","citation_author");return t.length?t:void 0},_m=e=>{switch(p(e,"property","og:type")){case"Article":return"Article";case"Journal":return"Journal";default:return}};function Sm(e){const t=p(e,"property","og:title"),r=p(e,"name","dc.Publisher"),n=p(e,"name","publication_doi");return E(q(S.Journal,{jtitle:t,pub:r,doi:n}))}function Em(e){const t=p(e,"name","dc.Title"),r=Q(e,"name","dc.Creator"),n=p(e,"name","dc.Date")?.substring(0,4),o=p(e,"name","publication_doi"),i=p(e,"name","citation_journal_title"),s=p(e,"name","dc.Publisher");return E(q(S.Article,{atitle:t,au:r,date:n,doi:o,jtitle:i,pub:s}))}const $m=({document:e})=>{switch(_m(e)){case"Journal":return Sm(e);case"Article":return Em(e);default:return L()}},Am=e=>{if(!e)return;const[t,r]=e.trim().split("-");return{spage:t,epage:r}},wm=e=>{const{pathname:t}=new URL(e);if(t.includes("/article/"))return b.Article},Rm=e=>{const t=p(e,"name","DC.Source"),r=p(e,"name","DC.Title"),n=Q(e,"name","DC.Creator.PersonalName"),o=p(e,"name","DC.Source.ISSN"),i=p(e,"name","citation_date")?.substring(0,4),s=p(e,"name","DC.Source.Volume"),a=p(e,"name","DC.Source.Issue"),c=p(e,"name","DC.Identifier.URI"),u=p(e,"name","DC.Identifier.pageNumber"),l=u?Am(u):void 0,f=l?.spage,d=l?.epage;return q(S.Article,{jtitle:t,atitle:r,au:n,issn:o,date:i,spage:f,epage:d,volume:s,issue:a,uri:c})},km=({document:e,url:t})=>wm(t)===b.Article?E(Rm(e)):L(),Im=e=>{switch(Cm(e)){case"eBook":return"Book";case"Reference":return"Chapter";default:return}},Cm=e=>e.querySelector("#vol-contentType a")?.textContent??void 0;function Om(e,t){const r=Cs(e),n=br(e),o=Ps(e),i=Ns(e),s=zs(e),a=Ts(e),c=br(e),u=t,{startPage:l,endPage:f}=Ls(e)??{};return E(V(S.Book,{au:r,btitle:n,date:o,doi:i,epage:f,isbn:s,pub:a,spage:l,title:c,uri:u}))}function Pm(e,t){const r=Cs(e),n=Os(e),o=br(e),i=Ps(e),s=Ns(e),a=zs(e),c=Ts(e),u=Os(e),l=t,{startPage:f,endPage:d}=Ls(e)??{};return E(V(S.Book,{au:r,atitle:n,btitle:o,date:i,doi:s,epage:d,isbn:a,pub:c,spage:f,title:u,uri:l}))}const Cs=e=>{const t=e.querySelectorAll("div#article_author p.author-bio b"),r=Array.from(t).map(n=>n.textContent).filter(n=>!!n).map(n=>n.trim());return r.length>0?r:void 0},Ze=(e,t)=>e.querySelector(`input#${t}`)?.getAttribute("value")??void 0,Nm=e=>p(e,"property","og:title"),br=e=>Ze(e,"titlevalue")??Nm(e),Os=e=>Ze(e,"chapter-title-squid"),Ps=e=>Ze(e,"pubdate-squid"),Ns=e=>Ze(e,"doi-squid"),zs=e=>Ze(e,"isbn-squid"),Ts=e=>Ze(e,"pubname-squid"),Ls=e=>{const t=e.querySelector("#pageRange")?.textContent??void 0;if(!t)return;const n=/(\d+)–(\d+)/.exec(t);if(n)return{startPage:n[1],endPage:n[2]}},zm=({document:e,url:t})=>{switch(Im(e)){case"Book":return Om(e,t);case"Chapter":return Pm(e,t);default:return L()}},Tm=(e,t)=>e.evaluate(`//*[@class="singleRecord_view_label"][contains(text(), "${t}")]/following-sibling::*[@class="singleRecord_view_data"]`,e,null,XPathResult.STRING_TYPE).stringValue.toLowerCase().trim(),Lm=e=>{switch(Tm(e,"Medium")){case"book":case"e-book":return S.Book;case"e-journal":return S.Journal;default:return S.Unknown}},xm=e=>{delete e.rft_id},jm=e=>{const t=rr(e);if(bt(t)){const r=Lm(e.document);t.resource.genre=r,xm(t.resource)}return t},qm=e=>{const t=p(e,"name","type")?.toLowerCase(),r=p(e,"name","og:type")?.toLowerCase(),n=p(e,"name","citation_article_type")?.toLowerCase();if(t==="article"||n==="article"||r==="article")return b.Article;const o=p(e,"name","twitter:title")?.trim(),i=p(e,"name","description")?.trim();if(o||i)return b.Webpage},Dm=e=>{const t=p(e,"name","DC.Title"),r=p(e,"name","DC.Publisher"),n=p(e,"name","DC.Date"),o=p(e,"name","DC.Identifier"),i=p(e,"name","citation_journal_title"),s=p(e,"name","citation_volume"),a=p(e,"name","citation_issn"),c=Q(e,"name","citation_author");return q(S.Article,{au:c,jtitle:i,date:n,doi:o,issn:a,pub:r,title:t,volume:s})},Zm=(e,t)=>{const r=p(t,"name","twitter:title");return dt({uri:e,title:r})},Bm=({url:e,document:t})=>{switch(qm(t)){case b.Article:return E(Dm(t));case b.Webpage:return E(Zm(e,t))}return L()},Jm=({document:e})=>Array.from(e.querySelectorAll(".availability.documentSummaryAvailability.availabilityContent")).length===0?L():Xo(),Um=/([0-9]{4})\s+at/;function Vm(e){if(!e)return;const t=Um.exec(e);if(t&&t.length>1)return t[1]}function xs(e,t){const r=e.getElementsByClassName(t);if(r.length!==0)return r[0].textContent}function Mm(e){const t={};return Array.from(e.getElementsByTagName("li")).reduce((r,n)=>{const o=xs(n,"title"),i=xs(n,"content");return o&&i&&(r[o]=i),r},t)}function Fm(e){const t=e.getElementsByClassName("information");if(t.length===0)return{};const r=Mm(t[0]),n=Vm(r.Published),o=r.Show;return{date:n,series:o}}const Wm=({url:e,document:t})=>{if(!new URL(e).searchParams.has("i"))return L();const n=S.AudioDocument,o=p(t,"property","og:site_name"),i=p(t,"property","og:title"),s=Fm(t);return E({genre:n,pub:o,title:i,uri:e,...s})},Gm=e=>{const t=p(e,"name","citation_date");return t?t.split("/").find(o=>/^\d{4}/.test(o))??void 0:void 0},Xm=e=>{const t=e.querySelector("#arxiv-doi-link")?.textContent;return t?t.replace("https://doi.org/","").trim():void 0},Hm=({document:e})=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_pdf_url"),n=Q(e,"name","citation_author"),o=Gm(e),i=Xm(e);return!t&&n.length===0&&!o&&!i?L():E(q(S.Article,{au:n,date:o,doi:i,title:t,uri:r}))},Ym=e=>{const t=He(e,"div.director-section div.term-info-section-items");if(!t)return;const r=t.split(",").map(n=>n.replace(/\s+/g," ").trim()).filter(n=>n.length>0);return r.length>0?r:void 0},Km=e=>{const t=new Map;return Array.from(e.querySelectorAll(".info-section-container")).forEach(r=>{const n=r.querySelector(".info-section-header .info-section-title")?.textContent.trim().toLowerCase();if(!n)return;const o=Array.from(r.querySelectorAll(".term-info-section-item")).map(i=>i.textContent.replace(",","").trim()).filter(i=>!!i);o.length&&t.set(n,o)}),t},Qm=({url:e,document:t})=>{const r=Km(t),n=Ym(t)??r.get("director"),o=He(t,"div.product-release-year"),i=He(t,"div.studio-section div.term-info-section-item")??De(r.get("supplier")),s=He(t,".product-title")??He(t,".movie-title"),a=ge({au:n,date:o,pub:i,title:s,uri:e});return E(a)},eg=e=>{if(p(e,"property","og:type")==="article")return b.Article};function tg(e){const t={},r=e.querySelector("[data-id=layout-form]");return r&&Array.from(r.getElementsByTagName("h2")).forEach(o=>{const i=o.textContent.toLowerCase(),a=Array.from(o.parentElement?.getElementsByTagName("span")??[]).map(c=>c.textContent||"");i&&(t[i]=a[0])}),t}function rg(e,t,r){return r.includes("publisher")?t.publisher:r.includes("place of publication, exhibition, or creation")?t["place of publication, exhibition, or creation"]:p(e,"name","DC.publisher")}function ng(e){const t=p(e,"name","citation_publication_date");return t?t.substring(0,4):p(e,"name","citation_online_date")?.substring(0,4)}const og=e=>{const t=tg(e),r=p(e,"name","DataCite.title"),n=Q(e,"name","DataCite.contributor"),o=ng(e),i=p(e,"name","DC.identifier.DOI"),s=Object.keys(t),a=rg(e,t,s),c=s.includes("journal")?t.journal:void 0,u=s.includes("volume")?t.volume:void 0,l=s.includes("issue")?t.issue:void 0,f=s.includes("issn")?t.issn:void 0,d=s.includes("electronic location (url)")?t["electronic location (url)"]:void 0;return q(S.Article,{jtitle:c,atitle:r,pub:a,au:n,date:o,doi:i,volume:u,issue:l,issn:f,uri:d})},sg=({document:e})=>eg(e)===b.Article?E(og(e)):L(),ig=e=>{const t=ue(e,"resource type");return t?t==="Other Journal Article"||t==="Journal Article"||t==="Journal Item"||t==="Book Review"?b.Article:t==="Book Chapter"||t==="Book Part"||t==="Conference Abstract"||t==="Book ChapterConference Paper"||t==="Conference Paper"||t==="Other Book Part"?b.Document:b.None:b.None},ag=e=>e.replace(":","").replace(" | ","").trim().toLowerCase(),cg=e=>{const t=new Map,r=e.querySelector("ul.rlist.publication-details__list");return r&&Array.from(r.querySelectorAll("li")).forEach(n=>{const o=Array.from(n.querySelectorAll("span.label")),i=Array.from(n.querySelectorAll("span.info"));o.forEach((s,a)=>{const c=ag(s.textContent),u=i[a]?.textContent?.trim();c&&u&&(t.has(c)||t.set(c,[]),t.get(c)?.push(u))})}),t},ue=(e,t)=>{const r=e.get(t);if(r)return Et(r)},ug=e=>Q(e,"name","dc.Creator").map(t=>t.trim()),lg=e=>{const t=Xh(e,[".loa-accordion a.author-name"]);return t?t.map(n=>n.replace("Authors:","").trim()):void 0},yr=e=>{const t=ug(e);return t.length>0?t:lg(e)},_r=e=>p(e,"name","dc.Title")??p(e,"property","og:title"),Sr=e=>p(e,"name","publication_doi"),Er=(e,t)=>ue(t,"date of publication")??p(e,"name","dc.Date"),js=e=>{const t=ue(e,"page range");let r,n;return t?.includes("-")&&(r=t?t.split("-")[0].trim():void 0,n=t?t.split("-")[1].trim():void 0),{pages:t,spage:r,epage:n}},pg=(e,t,r)=>{const n=_r(e),o=ue(t,"journal"),i=p(e,"name","citation_journal_title"),s=o??i,a=Sr(e),c=Er(e,t),u=ue(t,"publisher"),l=yr(e),f=ue(t,"volume"),d=ue(t,"issue"),g=js(t),I=ue(t,"issn (print)"),v=ue(t,"issn (electronic)");return q(S.Article,{title:n,jtitle:s,doi:a,date:c,pub:u,au:l,volume:f,issue:d,pages:g.pages,spage:g.spage,epage:g.epage,issn:I,eissn:v,uri:r})},fg=(e,t,r)=>{const n=_r(e),o=ue(t,"book title"),i=Sr(e),s=Er(e,t),a=ue(t,"publisher"),c=yr(e),u=js(t),l=ue(t,"isbn (print)");return V(S.Conference,{title:n,btitle:o,doi:i,date:s,pub:a,au:c,pages:u.pages,spage:u.spage,epage:u.epage,isbn:l,uri:r})},hg=(e,t,r)=>{const n=_r(e),o=Sr(e),i=Er(e,t),s=ue(t,"publisher"),a=yr(e),c=ue(t,"isbn (print)");return V(S.Document,{title:n,doi:o,date:i,pub:s,au:a,uri:r,isbn:c})},dg=({url:e,document:t})=>{const r=cg(t);switch(ig(r)){case b.Article:return E(pg(t,r,e));case b.Document:return E(fg(t,r,e));case b.None:return E(hg(t,r,e));default:return L()}},Be=e=>p(e,"property","og:title")?.trim()??void 0,qs=e=>p(e,"name","dc.identifier")??p(e,"name","citation_doi"),mg=e=>{const t=Be(e),r=t,n=Sg(e),o=_g(e),i=bg(e),s=yg(e),{issn:a,eissn:c}=vg(e);return E(q(S.Journal,{date:n,eissn:c,issn:a,issue:o,jtitle:r,pub:i,title:t,volume:s}))},gg=e=>e.includes("/journals/")&&e.includes("issue"),vg=e=>{const t=e.querySelector("dd.printissn.text-metadata-value > span")?.textContent.trim(),r=e.querySelector("dd.onlineissn.text-metadata-value > span")?.textContent.trim();return{issn:t,eissn:r}},bg=e=>e.querySelector("dd.publisher.text-metadata-value span")?.textContent.trim()??void 0,yg=e=>Be(e)?.match(/Volume\s+(\d+)/i)?.[1],_g=e=>Be(e)?.match(/Issue\s+(\d+)/i)?.[1],Sg=e=>Be(e)?.match(/\((\d{4})\)/)?.[1],Eg=e=>{const t=Be(e),r=p(e,"name","citation_title")??t,n=Q(e,"property","article:author"),o=$g(e),i=qs(e),s=p(e,"name","citation_lastpage"),a=p(e,"name","citation_issn"),c=p(e,"name","citation_issue"),u=p(e,"name","citation_journal_title"),l=p(e,"name","citation_publisher"),f=p(e,"name","citation_firstpage"),d=p(e,"name","citation_volume");return E(q(S.Article,{atitle:r,au:n,date:o,doi:i,epage:s,issn:a,issue:c,jtitle:u,pub:l,spage:f,title:t,volume:d}))},$g=e=>p(e,"property","article:published_time")??p(e,"name","citation_publication_date"),Ag=e=>{const t=Be(e),r=p(e,"name","citation_title")??t,n=wg(e),o=kg(e),i=qs(e),s=Ig(e),a=p(e,"name","citation_publisher");return E(V(S.Book,{au:n,btitle:r,date:o,doi:i,isbn:s,pub:a,title:t}))},wg=e=>{const t=Q(e,"property","book:author");if(t.length>0)return t;const r=Q(e,"name","citation_author");return r.length>0?r:Rg(e)},Rg=e=>Array.from(e.querySelectorAll('.contributor-details span[data-testid="author-name"]')).map(r=>(r.textContent||"").trim()).filter(r=>r.length>0),kg=e=>p(e,"property","book:release_date")??p(e,"name","citation_publication_date"),Ig=e=>p(e,"property","book:isbn")??p(e,"name","citation_isbn"),Cg=(e,t)=>{switch(p(e,"property","og:type")){case"article":return b.Article;case"book":return b.Book}return gg(t)?b.Journal:b.None},Og=({document:e,url:t})=>{switch(Cg(e,t)){case b.Article:return Eg(e);case b.Journal:return mg(e);case b.Book:return Ag(e);default:return L()}};var T=(e=>(e.NoResourceFound="NoResourceFound",e.Z3988="Z3988",e.Z3988SearchResult="Z3988SearchResult",e.Amazon="Amazon",e.CupOfJo="CupOfJo",e.IngentaConnect="IngentaConnect",e.Jstor="Jstor",e.Milne="Milne",e.Primo="Primo",e.SagePub="SagePub",e.SageVideo="SageVideo",e.ScienceDirect="ScienceDirect",e.Springer="Springer",e.Youtube="Youtube",e.TaylorFrancis="TaylorFrancis",e.Wiley="Wiley",e.VuFind="VuFind",e.ClinicalKey="ClinicalKey",e.DOAJ="DOAJ",e.Ebscohost="Ebscohost",e.OpenStax="OpenStax",e.CambridgeJournalsOnline="CambridgeJournalsOnline",e.OpenTextbook="OpenTextbook",e.AhaJournals="AhaJournals",e.Ijees="Ijees",e.BloomsburyCollections="BloomsburyCollections",e.HeritageCirqa="HeritageCirqa",e.BritishMedicalJournal="BritishMedicalJournal",e.SummonSearchResult="SummonSearchResult",e.ApplePodcasts="ApplePodcasts",e.Arxiv="Arxiv",e.KanopyVideo="KanopyVideo",e.LaTrobeOpal="LaTrobeOpal",e.BYUScholarsArchive="BYUScholarsArchive",e.Informit="Informit",e.Brill="Brill",e))(T||{});const $r={NoResourceFound:os,Z3988:rr,Z3988SearchResult:Gh,Amazon:Vp,CupOfJo:$f,Jstor:gd,Youtube:fh,SagePub:qf,SageVideo:Wh,ScienceDirect:Wf,Springer:Oh,TaylorFrancis:eh,Wiley:Mh,VuFind:ch,ClinicalKey:df,DOAJ:If,Primo:zd,IngentaConnect:Jd,Ebscohost:tm,OpenStax:sm,OpenTextbook:cm,Milne:pm,CambridgeJournalsOnline:fm,AhaJournals:$m,Ijees:km,BloomsburyCollections:zm,HeritageCirqa:jm,BritishMedicalJournal:Bm,SummonSearchResult:Jm,ApplePodcasts:Wm,Arxiv:Hm,KanopyVideo:Qm,LaTrobeOpal:sg,BYUScholarsArchive:ef,Informit:dg,Brill:Og},Pg="5.33.2",Ar=()=>Pg,Ng=["com.au","com","ca","co.uk","de","fr","nl"].flatMap(e=>[`amazon.${e}`,`www.amazon.${e}`]),zg={version:Ar(),siteRegistrations:[{matcher:{regexp:"^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/search"},name:"Worldcat Search Results",parsers:[T.Z3988SearchResult]},{matcher:{regexp:"^https://[a-z0-9\\-]+\\.summon\\.serialssolutions\\.com/"},name:"Summon Search Results",parsers:[T.SummonSearchResult]},{matcher:{regexp:"cupofjo[.-]com"},name:"Cup of Jo",parsers:[T.CupOfJo]},{matcher:{hostnames:["youtube.com","www.youtube.com"]},name:"Youtube",parsers:[T.Youtube]},{matcher:{regexp:"www[-.]sciencedirect[.-]com"},name:"Science Direct",parsers:[T.ScienceDirect]},{matcher:{hostnames:Ng},name:"Amazon",parsers:[T.Amazon]},{matcher:{regexp:"^https://sk\\.sagepub\\.com/video/"},name:"Sage Video",parsers:[T.SageVideo]},{matcher:{regexp:"[/.-]((www|journals)[.-])?sagepub[.-]com"},name:"Sage Publishing",parsers:[T.SagePub]},{matcher:{regexp:"www[.-]tandfonline[.-]com"},name:"Taylor & Francis",parsers:[T.TaylorFrancis]},{matcher:{regexp:"[/.-]((www|onlinelibrary)[.-])?wiley[.-]com"},name:"Wiley",parsers:[T.Wiley]},{matcher:{regexp:"^https://[a-z0-9\\-]+[.-]on[.-]worldcat[.-]org"},name:"Worldcat",parsers:[T.Z3988]},{matcher:{hostnames:["catalogue.rau.ac.uk"]},name:"Royal Agricultural University Library",parsers:[T.Z3988]},{matcher:{regexp:"link[.-]springer[.-]com"},name:"Springer",parsers:[T.Springer]},{matcher:{regexp:"^https://vufind\\.lboro\\.ac\\.uk/(Record|PrimoRecord)"},name:"VuFind",parsers:[T.VuFind]},{matcher:{regexp:"www[.-]clinicalkey[.-]com"},name:"ClinicalKey",parsers:[T.ClinicalKey]},{matcher:{regexp:"www[.-]jstor[.-]org"},name:"JSTOR",parsers:[T.Jstor]},{matcher:{regexp:"doaj[.-]org"},name:"DOAJ",parsers:[T.DOAJ]},{matcher:{regexp:"[/.-]ingentaconnect[.-]com"},name:"IngentaConnect",parsers:[T.IngentaConnect]},{matcher:{regexp:"research[.-]ebsco[.-]com"},name:"EBSCOHost",parsers:[T.Ebscohost]},{matcher:{regexp:"openstax[-.]org"},name:"OpenStax",parsers:[T.OpenStax]},{matcher:{regexp:"open[.-]umn[.-]edu"},name:"OpenTextbook",parsers:[T.OpenTextbook]},{matcher:{regexp:"milneopentextbooks[-.]org"},name:"Milne Open Textbooks",parsers:[T.Milne]},{matcher:{regexp:"www[.-]perlego[.-]com"},name:"Perlego",parsers:[T.Z3988]},{matcher:{regexp:"www[.-]ahajournals[.-]org"},name:"AHA Journals",parsers:[T.AhaJournals]},{matcher:{regexp:"www[.-]cambridge[.-]org"},name:"Cambridge Journals Online",parsers:[T.CambridgeJournalsOnline]},{matcher:{regexp:"www[.-]nieindia[.-]org"},name:"International Journal of Ecology and Environmental Sciences",parsers:[T.Ijees]},{matcher:{regexp:"www[.-]bloomsburycollections[.-]com"},name:"Bloomsbury Collections",parsers:[T.BloomsburyCollections]},{matcher:{regexp:"cirqahosting[.-]com"},name:"Heritage Cirqa",parsers:[T.HeritageCirqa]},{matcher:{regexp:"www[.-]bmj[.-]com"},name:"British Medical Journal",parsers:[T.BritishMedicalJournal]},{matcher:{regexp:"podcasts[.-]apple[.-]com"},name:"Apple Podcasts",parsers:[T.ApplePodcasts]},{matcher:{regexp:"arxiv[.-]org"},name:"arxiv",parsers:[T.Arxiv]},{matcher:{regexp:"kanopy[.-]com"},name:"Kanopy Video",parsers:[T.KanopyVideo]},{matcher:{regexp:"opal[.-]latrobe[.-]edu[.-]au"},name:"La Trobe Opal",parsers:[T.LaTrobeOpal]},{matcher:{hostnames:["scholarsarchive.byu.edu"]},name:"BYU Scholars Archive",parsers:[T.BYUScholarsArchive]},{matcher:{regexp:"informit[.-]org"},name:"Informit",parsers:[T.Informit]},{matcher:{regexp:"brill[.-]com"},name:"Brill",parsers:[T.Brill]}]},wr=k({hostnames:U(h()).min(1)}),Rr=k({regexp:h()}),kr=de([wr,Rr]),Ir=k({matcher:kr,name:h(),parsers:U(h()),libraryVersionRange:h().optional()}),Ds=k({siteRegistrations:U(Ir),version:h()}),Tg=e=>Ds.safeParse(e).success,Lg=e=>Ir.safeParse(e).success,xg=e=>kr.safeParse(e).success,Zs=e=>Object.values(T).includes(e),jg=e=>typeof e=="object"&&e!==null,Bs=k({url:h(),document:dp(jg)}),qg=e=>Bs.safeParse(e).success;var Rt={exports:{}},Cr,Js;function kt(){if(Js)return Cr;Js=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return Cr={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Cr}var Or,Us;function It(){return Us||(Us=1,Or=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Or}var Vs;function et(){return Vs||(Vs=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=kt(),i=It();t=e.exports={};const s=t.re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let f=0;const d="[a-zA-Z0-9-]",g=[["\\s",1],["\\d",o],[d,n]],I=P=>{for(const[D,re]of g)P=P.split(`${D}*`).join(`${D}{0,${re}}`).split(`${D}+`).join(`${D}{1,${re}}`);return P},v=(P,D,re)=>{const x=I(D),Z=f++;i(P,Z,D),l[P]=Z,c[Z]=D,u[Z]=x,s[Z]=new RegExp(D,re?"g":void 0),a[Z]=new RegExp(x,re?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),v("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${d}+`),v("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),v("FULL",`^${c[l.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),v("LOOSE",`^${c[l.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),v("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),v("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),v("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),v("COERCERTL",c[l.COERCE],!0),v("COERCERTLFULL",c[l.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",v("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",v("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Rt,Rt.exports)),Rt.exports}var Pr,Ms;function Nr(){if(Ms)return Pr;Ms=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Pr=n=>n?typeof n!="object"?e:n:t,Pr}var zr,Fs;function Ws(){if(Fs)return zr;Fs=1;const e=/^[0-9]+$/,t=(n,o)=>{if(typeof n=="number"&&typeof o=="number")return n===o?0:n<o?-1:1;const i=e.test(n),s=e.test(o);return i&&s&&(n=+n,o=+o),n===o?0:i&&!s?-1:s&&!i?1:n<o?-1:1};return zr={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},zr}var Tr,Gs;function se(){if(Gs)return Tr;Gs=1;const e=It(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=kt(),{safeRe:n,t:o}=et(),i=Nr(),{compareIdentifiers:s}=Ws();class a{constructor(u,l){if(l=i(l),u instanceof a){if(u.loose===!!l.loose&&u.includePrerelease===!!l.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const f=u.trim().match(l.loose?n[o.LOOSE]:n[o.FULL]);if(!f)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const g=+d;if(g>=0&&g<r)return g}return d}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof a)){if(typeof u=="string"&&u===this.version)return 0;u=new a(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof a||(u=new a(u,this.options)),this.major<u.major?-1:this.major>u.major?1:this.minor<u.minor?-1:this.minor>u.minor?1:this.patch<u.patch?-1:this.patch>u.patch?1:0}comparePre(u){if(u instanceof a||(u=new a(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let l=0;do{const f=this.prerelease[l],d=u.prerelease[l];if(e("prerelease compare",l,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++l)}compareBuild(u){u instanceof a||(u=new a(u,this.options));let l=0;do{const f=this.build[l],d=u.build[l];if(e("build compare",l,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++l)}inc(u,l,f){if(u.startsWith("pre")){if(!l&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const d=`-${l}`.match(this.options.loose?n[o.PRERELEASELOOSE]:n[o.PRERELEASE]);if(!d||d[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",l,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,f),this.inc("pre",l,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,f),this.inc("pre",l,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const d=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[d];else{let g=this.prerelease.length;for(;--g>=0;)typeof this.prerelease[g]=="number"&&(this.prerelease[g]++,g=-2);if(g===-1){if(l===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(l){let g=[l,d];f===!1&&(g=[l]),s(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=g):this.prerelease=g}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Tr=a,Tr}var Lr,Xs;function Je(){if(Xs)return Lr;Xs=1;const e=se();return Lr=(r,n,o=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(i){if(!o)return null;throw i}},Lr}var xr,Hs;function Dg(){if(Hs)return xr;Hs=1;const e=Je();return xr=(r,n)=>{const o=e(r,n);return o?o.version:null},xr}var jr,Ys;function Zg(){if(Ys)return jr;Ys=1;const e=Je();return jr=(r,n)=>{const o=e(r.trim().replace(/^[=v]+/,""),n);return o?o.version:null},jr}var qr,Ks;function Bg(){if(Ks)return qr;Ks=1;const e=se();return qr=(r,n,o,i,s)=>{typeof o=="string"&&(s=i,i=o,o=void 0);try{return new e(r instanceof e?r.version:r,o).inc(n,i,s).version}catch{return null}},qr}var Dr,Qs;function Jg(){if(Qs)return Dr;Qs=1;const e=Je();return Dr=(r,n)=>{const o=e(r,null,!0),i=e(n,null,!0),s=o.compare(i);if(s===0)return null;const a=s>0,c=a?o:i,u=a?i:o,l=!!c.prerelease.length;if(!!u.prerelease.length&&!l){if(!u.patch&&!u.minor)return"major";if(u.compareMain(c)===0)return u.minor&&!u.patch?"minor":"patch"}const d=l?"pre":"";return o.major!==i.major?d+"major":o.minor!==i.minor?d+"minor":o.patch!==i.patch?d+"patch":"prerelease"},Dr}var Zr,ei;function Ug(){if(ei)return Zr;ei=1;const e=se();return Zr=(r,n)=>new e(r,n).major,Zr}var Br,ti;function Vg(){if(ti)return Br;ti=1;const e=se();return Br=(r,n)=>new e(r,n).minor,Br}var Jr,ri;function Mg(){if(ri)return Jr;ri=1;const e=se();return Jr=(r,n)=>new e(r,n).patch,Jr}var Ur,ni;function Fg(){if(ni)return Ur;ni=1;const e=Je();return Ur=(r,n)=>{const o=e(r,n);return o&&o.prerelease.length?o.prerelease:null},Ur}var Vr,oi;function fe(){if(oi)return Vr;oi=1;const e=se();return Vr=(r,n,o)=>new e(r,o).compare(new e(n,o)),Vr}var Mr,si;function Wg(){if(si)return Mr;si=1;const e=fe();return Mr=(r,n,o)=>e(n,r,o),Mr}var Fr,ii;function Gg(){if(ii)return Fr;ii=1;const e=fe();return Fr=(r,n)=>e(r,n,!0),Fr}var Wr,ai;function Gr(){if(ai)return Wr;ai=1;const e=se();return Wr=(r,n,o)=>{const i=new e(r,o),s=new e(n,o);return i.compare(s)||i.compareBuild(s)},Wr}var Xr,ci;function Xg(){if(ci)return Xr;ci=1;const e=Gr();return Xr=(r,n)=>r.sort((o,i)=>e(o,i,n)),Xr}var Hr,ui;function Hg(){if(ui)return Hr;ui=1;const e=Gr();return Hr=(r,n)=>r.sort((o,i)=>e(i,o,n)),Hr}var Yr,li;function Ct(){if(li)return Yr;li=1;const e=fe();return Yr=(r,n,o)=>e(r,n,o)>0,Yr}var Kr,pi;function Qr(){if(pi)return Kr;pi=1;const e=fe();return Kr=(r,n,o)=>e(r,n,o)<0,Kr}var en,fi;function hi(){if(fi)return en;fi=1;const e=fe();return en=(r,n,o)=>e(r,n,o)===0,en}var tn,di;function mi(){if(di)return tn;di=1;const e=fe();return tn=(r,n,o)=>e(r,n,o)!==0,tn}var rn,gi;function nn(){if(gi)return rn;gi=1;const e=fe();return rn=(r,n,o)=>e(r,n,o)>=0,rn}var on,vi;function sn(){if(vi)return on;vi=1;const e=fe();return on=(r,n,o)=>e(r,n,o)<=0,on}var an,bi;function yi(){if(bi)return an;bi=1;const e=hi(),t=mi(),r=Ct(),n=nn(),o=Qr(),i=sn();return an=(a,c,u,l)=>{switch(c){case"===":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a===u;case"!==":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a!==u;case"":case"=":case"==":return e(a,u,l);case"!=":return t(a,u,l);case">":return r(a,u,l);case">=":return n(a,u,l);case"<":return o(a,u,l);case"<=":return i(a,u,l);default:throw new TypeError(`Invalid operator: ${c}`)}},an}var cn,_i;function Yg(){if(_i)return cn;_i=1;const e=se(),t=Je(),{safeRe:r,t:n}=et();return cn=(i,s)=>{if(i instanceof e)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;s=s||{};let a=null;if(!s.rtl)a=i.match(s.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const g=s.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let I;for(;(I=g.exec(i))&&(!a||a.index+a[0].length!==i.length);)(!a||I.index+I[0].length!==a.index+a[0].length)&&(a=I),g.lastIndex=I.index+I[1].length+I[2].length;g.lastIndex=-1}if(a===null)return null;const c=a[2],u=a[3]||"0",l=a[4]||"0",f=s.includePrerelease&&a[5]?`-${a[5]}`:"",d=s.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${c}.${u}.${l}${f}${d}`,s)},cn}var un,Si;function Kg(){if(Si)return un;Si=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(r,n)}return this}}return un=e,un}var ln,Ei;function he(){if(Ei)return ln;Ei=1;const e=/\s+/g;class t{constructor(_,C){if(C=o(C),_ instanceof t)return _.loose===!!C.loose&&_.includePrerelease===!!C.includePrerelease?_:new t(_.raw,C);if(_ instanceof i)return this.raw=_.value,this.set=[[_]],this.formatted=void 0,this;if(this.options=C,this.loose=!!C.loose,this.includePrerelease=!!C.includePrerelease,this.raw=_.trim().replace(e," "),this.set=this.raw.split("||").map(w=>this.parseRange(w.trim())).filter(w=>w.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const w=this.set[0];if(this.set=this.set.filter(O=>!v(O[0])),this.set.length===0)this.set=[w];else if(this.set.length>1){for(const O of this.set)if(O.length===1&&P(O[0])){this.set=[O];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let _=0;_<this.set.length;_++){_>0&&(this.formatted+="||");const C=this.set[_];for(let w=0;w<C.length;w++)w>0&&(this.formatted+=" "),this.formatted+=C[w].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(_){const w=((this.options.includePrerelease&&g)|(this.options.loose&&I))+":"+_,O=n.get(w);if(O)return O;const R=this.options.loose,N=R?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];_=_.replace(N,In(this.options.includePrerelease)),s("hyphen replace",_),_=_.replace(c[u.COMPARATORTRIM],l),s("comparator trim",_),_=_.replace(c[u.TILDETRIM],f),s("tilde trim",_),_=_.replace(c[u.CARETTRIM],d),s("caret trim",_);let B=_.split(" ").map(ne=>re(ne,this.options)).join(" ").split(/\s+/).map(ne=>kn(ne,this.options));R&&(B=B.filter(ne=>(s("loose invalid filter",ne,this.options),!!ne.match(c[u.COMPARATORLOOSE])))),s("range list",B);const j=new Map,W=B.map(ne=>new i(ne,this.options));for(const ne of W){if(v(ne))return[ne];j.set(ne.value,ne)}j.size>1&&j.has("")&&j.delete("");const ie=[...j.values()];return n.set(w,ie),ie}intersects(_,C){if(!(_ instanceof t))throw new TypeError("a Range is required");return this.set.some(w=>D(w,C)&&_.set.some(O=>D(O,C)&&w.every(R=>O.every(N=>R.intersects(N,C)))))}test(_){if(!_)return!1;if(typeof _=="string")try{_=new a(_,this.options)}catch{return!1}for(let C=0;C<this.set.length;C++)if(Cn(this.set[C],_,this.options))return!0;return!1}}ln=t;const r=Kg(),n=new r,o=Nr(),i=Ot(),s=It(),a=se(),{safeRe:c,t:u,comparatorTrimReplace:l,tildeTrimReplace:f,caretTrimReplace:d}=et(),{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:I}=kt(),v=$=>$.value==="<0.0.0-0",P=$=>$.value==="",D=($,_)=>{let C=!0;const w=$.slice();let O=w.pop();for(;C&&w.length;)C=w.every(R=>O.intersects(R,_)),O=w.pop();return C},re=($,_)=>($=$.replace(c[u.BUILD],""),s("comp",$,_),$=F($,_),s("caret",$),$=Z($,_),s("tildes",$),$=z($,_),s("xrange",$),$=Rn($,_),s("stars",$),$),x=$=>!$||$.toLowerCase()==="x"||$==="*",Z=($,_)=>$.trim().split(/\s+/).map(C=>M(C,_)).join(" "),M=($,_)=>{const C=_.loose?c[u.TILDELOOSE]:c[u.TILDE];return $.replace(C,(w,O,R,N,B)=>{s("tilde",$,w,O,R,N,B);let j;return x(O)?j="":x(R)?j=`>=${O}.0.0 <${+O+1}.0.0-0`:x(N)?j=`>=${O}.${R}.0 <${O}.${+R+1}.0-0`:B?(s("replaceTilde pr",B),j=`>=${O}.${R}.${N}-${B} <${O}.${+R+1}.0-0`):j=`>=${O}.${R}.${N} <${O}.${+R+1}.0-0`,s("tilde return",j),j})},F=($,_)=>$.trim().split(/\s+/).map(C=>ee(C,_)).join(" "),ee=($,_)=>{s("caret",$,_);const C=_.loose?c[u.CARETLOOSE]:c[u.CARET],w=_.includePrerelease?"-0":"";return $.replace(C,(O,R,N,B,j)=>{s("caret",$,O,R,N,B,j);let W;return x(R)?W="":x(N)?W=`>=${R}.0.0${w} <${+R+1}.0.0-0`:x(B)?R==="0"?W=`>=${R}.${N}.0${w} <${R}.${+N+1}.0-0`:W=`>=${R}.${N}.0${w} <${+R+1}.0.0-0`:j?(s("replaceCaret pr",j),R==="0"?N==="0"?W=`>=${R}.${N}.${B}-${j} <${R}.${N}.${+B+1}-0`:W=`>=${R}.${N}.${B}-${j} <${R}.${+N+1}.0-0`:W=`>=${R}.${N}.${B}-${j} <${+R+1}.0.0-0`):(s("no pr"),R==="0"?N==="0"?W=`>=${R}.${N}.${B}${w} <${R}.${N}.${+B+1}-0`:W=`>=${R}.${N}.${B}${w} <${R}.${+N+1}.0-0`:W=`>=${R}.${N}.${B} <${+R+1}.0.0-0`),s("caret return",W),W})},z=($,_)=>(s("replaceXRanges",$,_),$.split(/\s+/).map(C=>tt(C,_)).join(" ")),tt=($,_)=>{$=$.trim();const C=_.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return $.replace(C,(w,O,R,N,B,j)=>{s("xRange",$,w,O,R,N,B,j);const W=x(R),ie=W||x(N),ne=ie||x(B),rt=ne;return O==="="&&rt&&(O=""),j=_.includePrerelease?"-0":"",W?O===">"||O==="<"?w="<0.0.0-0":w="*":O&&rt?(ie&&(N=0),B=0,O===">"?(O=">=",ie?(R=+R+1,N=0,B=0):(N=+N+1,B=0)):O==="<="&&(O="<",ie?R=+R+1:N=+N+1),O==="<"&&(j="-0"),w=`${O+R}.${N}.${B}${j}`):ie?w=`>=${R}.0.0${j} <${+R+1}.0.0-0`:ne&&(w=`>=${R}.${N}.0${j} <${R}.${+N+1}.0-0`),s("xRange return",w),w})},Rn=($,_)=>(s("replaceStars",$,_),$.trim().replace(c[u.STAR],"")),kn=($,_)=>(s("replaceGTE0",$,_),$.trim().replace(c[_.includePrerelease?u.GTE0PRE:u.GTE0],"")),In=$=>(_,C,w,O,R,N,B,j,W,ie,ne,rt)=>(x(w)?C="":x(O)?C=`>=${w}.0.0${$?"-0":""}`:x(R)?C=`>=${w}.${O}.0${$?"-0":""}`:N?C=`>=${C}`:C=`>=${C}${$?"-0":""}`,x(W)?j="":x(ie)?j=`<${+W+1}.0.0-0`:x(ne)?j=`<${W}.${+ie+1}.0-0`:rt?j=`<=${W}.${ie}.${ne}-${rt}`:$?j=`<${W}.${ie}.${+ne+1}-0`:j=`<=${j}`,`${C} ${j}`.trim()),Cn=($,_,C)=>{for(let w=0;w<$.length;w++)if(!$[w].test(_))return!1;if(_.prerelease.length&&!C.includePrerelease){for(let w=0;w<$.length;w++)if(s($[w].semver),$[w].semver!==i.ANY&&$[w].semver.prerelease.length>0){const O=$[w].semver;if(O.major===_.major&&O.minor===_.minor&&O.patch===_.patch)return!0}return!1}return!0};return ln}var pn,$i;function Ot(){if($i)return pn;$i=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(l,f){if(f=r(f),l instanceof t){if(l.loose===!!f.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),s("comparator",l,f),this.options=f,this.loose=!!f.loose,this.parse(l),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(l){const f=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],d=l.match(f);if(!d)throw new TypeError(`Invalid comparator: ${l}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(l){if(s("Comparator.test",l,this.options.loose),this.semver===e||l===e)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return i(l,this.operator,this.semver,this.options)}intersects(l,f){if(!(l instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,f).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,f).test(l.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||i(this.semver,"<",l.semver,f)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||i(this.semver,">",l.semver,f)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}pn=t;const r=Nr(),{safeRe:n,t:o}=et(),i=yi(),s=It(),a=se(),c=he();return pn}var fn,Ai;function Pt(){if(Ai)return fn;Ai=1;const e=he();return fn=(r,n,o)=>{try{n=new e(n,o)}catch{return!1}return n.test(r)},fn}var hn,wi;function Qg(){if(wi)return hn;wi=1;const e=he();return hn=(r,n)=>new e(r,n).set.map(o=>o.map(i=>i.value).join(" ").trim().split(" ")),hn}var dn,Ri;function ev(){if(Ri)return dn;Ri=1;const e=se(),t=he();return dn=(n,o,i)=>{let s=null,a=null,c=null;try{c=new t(o,i)}catch{return null}return n.forEach(u=>{c.test(u)&&(!s||a.compare(u)===-1)&&(s=u,a=new e(s,i))}),s},dn}var mn,ki;function tv(){if(ki)return mn;ki=1;const e=se(),t=he();return mn=(n,o,i)=>{let s=null,a=null,c=null;try{c=new t(o,i)}catch{return null}return n.forEach(u=>{c.test(u)&&(!s||a.compare(u)===1)&&(s=u,a=new e(s,i))}),s},mn}var gn,Ii;function rv(){if(Ii)return gn;Ii=1;const e=se(),t=he(),r=Ct();return gn=(o,i)=>{o=new t(o,i);let s=new e("0.0.0");if(o.test(s)||(s=new e("0.0.0-0"),o.test(s)))return s;s=null;for(let a=0;a<o.set.length;++a){const c=o.set[a];let u=null;c.forEach(l=>{const f=new e(l.semver.version);switch(l.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!u||r(f,u))&&(u=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),u&&(!s||r(s,u))&&(s=u)}return s&&o.test(s)?s:null},gn}var vn,Ci;function nv(){if(Ci)return vn;Ci=1;const e=he();return vn=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},vn}var bn,Oi;function yn(){if(Oi)return bn;Oi=1;const e=se(),t=Ot(),{ANY:r}=t,n=he(),o=Pt(),i=Ct(),s=Qr(),a=sn(),c=nn();return bn=(l,f,d,g)=>{l=new e(l,g),f=new n(f,g);let I,v,P,D,re;switch(d){case">":I=i,v=a,P=s,D=">",re=">=";break;case"<":I=s,v=c,P=i,D="<",re="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(l,f,g))return!1;for(let x=0;x<f.set.length;++x){const Z=f.set[x];let M=null,F=null;if(Z.forEach(ee=>{ee.semver===r&&(ee=new t(">=0.0.0")),M=M||ee,F=F||ee,I(ee.semver,M.semver,g)?M=ee:P(ee.semver,F.semver,g)&&(F=ee)}),M.operator===D||M.operator===re||(!F.operator||F.operator===D)&&v(l,F.semver))return!1;if(F.operator===re&&P(l,F.semver))return!1}return!0},bn}var _n,Pi;function ov(){if(Pi)return _n;Pi=1;const e=yn();return _n=(r,n,o)=>e(r,n,">",o),_n}var Sn,Ni;function sv(){if(Ni)return Sn;Ni=1;const e=yn();return Sn=(r,n,o)=>e(r,n,"<",o),Sn}var En,zi;function iv(){if(zi)return En;zi=1;const e=he();return En=(r,n,o)=>(r=new e(r,o),n=new e(n,o),r.intersects(n,o)),En}var $n,Ti;function av(){if(Ti)return $n;Ti=1;const e=Pt(),t=fe();return $n=(r,n,o)=>{const i=[];let s=null,a=null;const c=r.sort((d,g)=>t(d,g,o));for(const d of c)e(d,n,o)?(a=d,s||(s=d)):(a&&i.push([s,a]),a=null,s=null);s&&i.push([s,null]);const u=[];for(const[d,g]of i)d===g?u.push(d):!g&&d===c[0]?u.push("*"):g?d===c[0]?u.push(`<=${g}`):u.push(`${d} - ${g}`):u.push(`>=${d}`);const l=u.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return l.length<f.length?l:n},$n}var An,Li;function cv(){if(Li)return An;Li=1;const e=he(),t=Ot(),{ANY:r}=t,n=Pt(),o=fe(),i=(f,d,g={})=>{if(f===d)return!0;f=new e(f,g),d=new e(d,g);let I=!1;e:for(const v of f.set){for(const P of d.set){const D=c(v,P,g);if(I=I||D!==null,D)continue e}if(I)return!1}return!0},s=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],c=(f,d,g)=>{if(f===d)return!0;if(f.length===1&&f[0].semver===r){if(d.length===1&&d[0].semver===r)return!0;g.includePrerelease?f=s:f=a}if(d.length===1&&d[0].semver===r){if(g.includePrerelease)return!0;d=a}const I=new Set;let v,P;for(const z of f)z.operator===">"||z.operator===">="?v=u(v,z,g):z.operator==="<"||z.operator==="<="?P=l(P,z,g):I.add(z.semver);if(I.size>1)return null;let D;if(v&&P){if(D=o(v.semver,P.semver,g),D>0)return null;if(D===0&&(v.operator!==">="||P.operator!=="<="))return null}for(const z of I){if(v&&!n(z,String(v),g)||P&&!n(z,String(P),g))return null;for(const tt of d)if(!n(z,String(tt),g))return!1;return!0}let re,x,Z,M,F=P&&!g.includePrerelease&&P.semver.prerelease.length?P.semver:!1,ee=v&&!g.includePrerelease&&v.semver.prerelease.length?v.semver:!1;F&&F.prerelease.length===1&&P.operator==="<"&&F.prerelease[0]===0&&(F=!1);for(const z of d){if(M=M||z.operator===">"||z.operator===">=",Z=Z||z.operator==="<"||z.operator==="<=",v){if(ee&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===ee.major&&z.semver.minor===ee.minor&&z.semver.patch===ee.patch&&(ee=!1),z.operator===">"||z.operator===">="){if(re=u(v,z,g),re===z&&re!==v)return!1}else if(v.operator===">="&&!n(v.semver,String(z),g))return!1}if(P){if(F&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===F.major&&z.semver.minor===F.minor&&z.semver.patch===F.patch&&(F=!1),z.operator==="<"||z.operator==="<="){if(x=l(P,z,g),x===z&&x!==P)return!1}else if(P.operator==="<="&&!n(P.semver,String(z),g))return!1}if(!z.operator&&(P||v)&&D!==0)return!1}return!(v&&Z&&!P&&D!==0||P&&M&&!v&&D!==0||ee||F)},u=(f,d,g)=>{if(!f)return d;const I=o(f.semver,d.semver,g);return I>0?f:I<0||d.operator===">"&&f.operator===">="?d:f},l=(f,d,g)=>{if(!f)return d;const I=o(f.semver,d.semver,g);return I<0?f:I>0||d.operator==="<"&&f.operator==="<="?d:f};return An=i,An}var wn,xi;function uv(){if(xi)return wn;xi=1;const e=et(),t=kt(),r=se(),n=Ws(),o=Je(),i=Dg(),s=Zg(),a=Bg(),c=Jg(),u=Ug(),l=Vg(),f=Mg(),d=Fg(),g=fe(),I=Wg(),v=Gg(),P=Gr(),D=Xg(),re=Hg(),x=Ct(),Z=Qr(),M=hi(),F=mi(),ee=nn(),z=sn(),tt=yi(),Rn=Yg(),kn=Ot(),In=he(),Cn=Pt(),$=Qg(),_=ev(),C=tv(),w=rv(),O=nv(),R=yn(),N=ov(),B=sv(),j=iv(),W=av(),ie=cv();return wn={parse:o,valid:i,clean:s,inc:a,diff:c,major:u,minor:l,patch:f,prerelease:d,compare:g,rcompare:I,compareLoose:v,compareBuild:P,sort:D,rsort:re,gt:x,lt:Z,eq:M,neq:F,gte:ee,lte:z,cmp:tt,coerce:Rn,Comparator:kn,Range:In,satisfies:Cn,toComparators:$,maxSatisfying:_,minSatisfying:C,minVersion:w,validRange:O,outside:R,gtr:N,ltr:B,intersects:j,simplifyRange:W,subset:ie,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},wn}var lv=uv();const pv=(e,t)=>fv(t)?t.hostnames.includes(new URL(e).hostname):hv(t)?!!e.match(t.regexp):!1,fv=e=>wr.safeParse(e).success,hv=e=>Rr.safeParse(e).success,dv=(e,t)=>t?lv.satisfies(e,t):!0,mv=(e,t,r)=>dv(t,r.libraryVersionRange)&&pv(e,r.matcher),gv=(e,t)=>e.siteRegistrations.filter(r=>mv(t,Ar(),r)),vv=(e,t)=>gv(e,t).flatMap(({parsers:o,name:i})=>o.filter(s=>Zs(s)&&s in $r).map(s=>({parser:$r[s],parserType:s,name:i}))),bv=(e,t)=>{const r=vv(e,t.url);for(const{parser:n,parserType:o,name:i}of r){const s=n(t);if(bt(s)||is(s)||as(s))return{...s,meta:{parserName:i,parserType:o,referrer:t.url}}}return{...os(),meta:{parserName:null,parserType:T.NoResourceFound,referrer:t.url}}},yv=(e,t)=>t===$e.CA?new URL(`https://${e}.rl.ca.talis.com`):new URL(`https://${e}.rl.talis.com`),_v=(e,t)=>{const r=yv(e,t);return new URL("/ui/forms/bookmarklet.html",r)},Sv=(e,t,r)=>{const n=qo(t);n.append("fast","true"),n.append("breakout","true"),r&&(r.parserName&&n.append("targetTitle",r.parserName),n.append("referrer",r.referrer));const o=new URL(e.toString());return o.search=n.toString(),o};y.BookGenresSchema=vp,y.CustomerListSchema=Uo,y.CustomerSchema=Gt,y.DirectLinkOnlyResultSchema=Yt,y.Genre=S,y.HostnamesMatcherSchema=wr,y.JournalGenresSchema=bp,y.NON_OPENURL_PROPERTIES=Ft,y.NonOpenUrlPropertiesSchema=Vt,y.NothingParsedResultSchema=Ht,y.OPENURL_KEYS=xo,y.OpenUrlAudioVisualResourceSchema=Sp,y.OpenUrlBookResourceSchema=yp,y.OpenUrlDocumentResourceSchema=$p,y.OpenUrlImageResourceSchema=Ep,y.OpenUrlJournalResourceSchema=_p,y.OpenUrlResourceSchema=ve,y.OpenUrlResultSchema=Kt,y.OpenUrlWebpageResourceSchema=Ap,y.PARSERS=$r,y.ParserRegistrySchema=Ds,y.ParserType=T,y.ParsingMetadataSchema=Xt,y.ParsingRequestSchema=Jo,y.ParsingResponseSchema=Wo,y.ParsingResultSchema=tr,y.REGISTRY=zg,y.RegExpMatcherSchema=Rr,y.ResourceDataSchema=Bs,y.ResourceSchema=zo,y.SiteRegistrationSchema=Ir,y.SummonSearchResultSchema=er,y.TenantRegion=$e,y.TenantRegistrySchema=Op,y.TenantSchema=Wt,y.UrlMatcherSchema=kr,y.Z3988SearchResultSchema=Qt,y.convertCustomerListToTenantRegistry=zp,y.createAudioVisual=ge,y.createBook=V,y.createDocument=Mt,y.createImage=To,y.createJournal=q,y.createWebpage=dt,y.directLinkOnly=Lp,y.fromOpenUrl=Zo,y.getBaseBookmarkingUrl=_v,y.getLibraryVersion=Ar,y.isCustomer=Vo,y.isCustomerList=Mo,y.isDirectLinkOnlyResult=oh,y.isGenre=Cp,y.isNothingParsedResult=sh,y.isOpenUrlResult=bt,y.isParserRegistry=Tg,y.isParserType=Zs,y.isParsingMetadata=nh,y.isParsingRequest=Pp,y.isParsingResponse=rh,y.isParsingResult=th,y.isResourceData=qg,y.isSiteRegistration=Lg,y.isSummonSearchResult=as,y.isTenant=Fo,y.isTenantRegion=Np,y.isUrlMatcher=xg,y.isZ3988SearchResult=is,y.nothingParsed=L,y.openUrlResource=E,y.parseResource=bv,y.summonSearchResult=Xo,y.toBookmarkingWorkflowUrl=Sv,y.toOpenUrl=qo,y.z3988SearchResult=Go,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
|
|
39
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const a=s[1];if(t===s[0]){i(s);continue}if(e.external){const u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function bo(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=s=>{const a=e.seen.get(s);if(a.ref===null)return;const c=a.def??a.schema,u={...c},l=a.ref;if(a.ref=null,l){n(l);const d=e.seen.get(l),g=d.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,u),s._zod.parent===l)for(const v in c)v==="$ref"||v==="allOf"||v in u||delete c[v];if(g.$ref&&d.def)for(const v in c)v==="$ref"||v==="allOf"||v in d.def&&JSON.stringify(c[v])===JSON.stringify(d.def[v])&&delete c[v]}const f=s._zod.parent;if(f&&f!==l){n(f);const d=e.seen.get(f);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(const g in c)g==="$ref"||g==="allOf"||g in d.def&&JSON.stringify(c[g])===JSON.stringify(d.def[g])&&delete c[g]}e.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(const s of[...e.seen.entries()].reverse())n(s[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(s)}Object.assign(o,r.def??r.schema);const i=e.external?.defs??{};for(const s of e.seen.entries()){const a=s[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const s=JSON.parse(JSON.stringify(o));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:pt(t,"input",e.processors),output:pt(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function oe(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return oe(n.element,r);if(n.type==="set")return oe(n.valueType,r);if(n.type==="lazy")return oe(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return oe(n.innerType,r);if(n.type==="intersection")return oe(n.left,r)||oe(n.right,r);if(n.type==="record"||n.type==="map")return oe(n.keyType,r)||oe(n.valueType,r);if(n.type==="pipe")return oe(n.in,r)||oe(n.out,r);if(n.type==="object"){for(const o in n.shape)if(oe(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(oe(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(oe(o,r))return!0;return!!(n.rest&&oe(n.rest,r))}return!1}const Tu=(e,t={})=>r=>{const n=go({...r,processors:t});return te(e,n),vo(n,e),bo(n,e)},pt=(e,t,r={})=>n=>{const{libraryOptions:o,target:i}=n??{},s=go({...o??{},target:i,io:t,processors:r});return te(e,s),vo(s,e),bo(s,e)},Lu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},xu=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=Lu[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const l=[...c];l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},ju=(e,t,r,n)=>{const o=r,{minimum:i,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number",typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l),typeof i=="number"&&(o.minimum=i,typeof l=="number"&&t.target!=="draft-04"&&(l>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof s=="number"&&(o.maximum=s,typeof u=="number"&&t.target!=="draft-04"&&(u<=s?delete o.maximum:delete o.exclusiveMaximum)),typeof c=="number"&&(o.multipleOf=c)},qu=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Du=(e,t,r,n)=>{r.not={}},Zu=(e,t,r,n)=>{},Bu=(e,t,r,n)=>{const o=e._zod.def,i=Nn(o.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},Ju=(e,t,r,n)=>{const o=e._zod.def,i=[];for(const s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},Uu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Vu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Mu=(e,t,r,n)=>{const o=r,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=te(i.element,t,{...n,path:[...n.path,"items"]})},Fu=(e,t,r,n)=>{const o=r,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const u in s)o.properties[u]=te(s[u],t,{...n,path:[...n.path,"properties",u]});const a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{const l=i.shape[u]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(o.required=Array.from(c)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=te(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Wu=(e,t,r,n)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,c)=>te(a,t,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=s:r.anyOf=s},Gu=(e,t,r,n)=>{const o=e._zod.def,i=te(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=te(o.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c},Xu=(e,t,r,n)=>{const o=r,i=e._zod.def;o.type="object";const s=i.keyType,c=s._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){const l=te(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(const f of c)o.patternProperties[f.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=te(i.keyType,t,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=te(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const u=s._zod.values;if(u){const l=[...u].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(o.required=l)}},Hu=(e,t,r,n)=>{const o=e._zod.def,i=te(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Yu=(e,t,r,n)=>{const o=e._zod.def;te(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},Ku=(e,t,r,n)=>{const o=e._zod.def;te(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},Qu=(e,t,r,n)=>{const o=e._zod.def;te(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},el=(e,t,r,n)=>{const o=e._zod.def;te(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},tl=(e,t,r,n)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;te(i,t,n);const s=t.seen.get(e);s.ref=i},rl=(e,t,r,n)=>{const o=e._zod.def;te(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0},yo=(e,t,r,n)=>{const o=e._zod.def;te(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},nl=m("ZodISODateTime",(e,t)=>{oc.init(e,t),K.init(e,t)});function ol(e){return uu(nl,e)}const sl=m("ZodISODate",(e,t)=>{sc.init(e,t),K.init(e,t)});function il(e){return lu(sl,e)}const al=m("ZodISOTime",(e,t)=>{ic.init(e,t),K.init(e,t)});function cl(e){return pu(al,e)}const ul=m("ZodISODuration",(e,t)=>{ac.init(e,t),K.init(e,t)});function ll(e){return fu(ul,e)}const le=m("ZodError",(e,t)=>{qn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Yi(e,r)},flatten:{value:r=>Hi(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Nt,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Nt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),pl=jt(le),fl=qt(le),hl=st(le),dl=it(le),ml=ea(le),gl=ta(le),vl=ra(le),bl=na(le),yl=oa(le),_l=sa(le),Sl=ia(le),El=aa(le),Y=m("ZodType",(e,t)=>(H.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:pt(e,"input"),output:pt(e,"output")}}),e.toJSONSchema=Tu(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(_e(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>Se(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>pl(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>hl(e,r,n),e.parseAsync=async(r,n)=>fl(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>dl(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>ml(e,r,n),e.decode=(r,n)=>gl(e,r,n),e.encodeAsync=async(r,n)=>vl(e,r,n),e.decodeAsync=async(r,n)=>bl(e,r,n),e.safeEncode=(r,n)=>yl(e,r,n),e.safeDecode=(r,n)=>_l(e,r,n),e.safeEncodeAsync=async(r,n)=>Sl(e,r,n),e.safeDecodeAsync=async(r,n)=>El(e,r,n),e.refine=(r,n)=>e.check(mp(r,n)),e.superRefine=r=>e.check(gp(r)),e.overwrite=r=>e.check(qe(r)),e.optional=()=>me(e),e.exactOptional=()=>rp(e),e.nullable=()=>Co(e),e.nullish=()=>me(Co(e)),e.nonoptional=r=>cp(e,r),e.array=()=>U(e),e.or=r=>de([e,r]),e.and=r=>Hl(e,r),e.transform=r=>Po(e,ep(r)),e.default=r=>sp(e,r),e.prefault=r=>ap(e,r),e.catch=r=>lp(e,r),e.pipe=r=>Po(e,r),e.readonly=()=>hp(e),e.describe=r=>{const n=e.clone();return Ve.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Ve.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ve.get(e);const n=e.clone();return Ve.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),_o=m("_ZodString",(e,t)=>{Dt.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(n,o,i)=>xu(e,n,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(bu(...n)),e.includes=(...n)=>e.check(Su(...n)),e.startsWith=(...n)=>e.check(Eu(...n)),e.endsWith=(...n)=>e.check($u(...n)),e.min=(...n)=>e.check(lt(...n)),e.max=(...n)=>e.check(ho(...n)),e.length=(...n)=>e.check(mo(...n)),e.nonempty=(...n)=>e.check(lt(1,...n)),e.lowercase=n=>e.check(yu(n)),e.uppercase=n=>e.check(_u(n)),e.trim=()=>e.check(wu()),e.normalize=(...n)=>e.check(Au(...n)),e.toLowerCase=()=>e.check(Ru()),e.toUpperCase=()=>e.check(ku()),e.slugify=()=>e.check(Iu())}),$l=m("ZodString",(e,t)=>{Dt.init(e,t),_o.init(e,t),e.email=r=>e.check(Uc(Al,r)),e.url=r=>e.check(uo(Eo,r)),e.jwt=r=>e.check(cu(Zl,r)),e.emoji=r=>e.check(Gc(Rl,r)),e.guid=r=>e.check(co(So,r)),e.uuid=r=>e.check(Vc(ft,r)),e.uuidv4=r=>e.check(Mc(ft,r)),e.uuidv6=r=>e.check(Fc(ft,r)),e.uuidv7=r=>e.check(Wc(ft,r)),e.nanoid=r=>e.check(Xc(kl,r)),e.guid=r=>e.check(co(So,r)),e.cuid=r=>e.check(Hc(Il,r)),e.cuid2=r=>e.check(Yc(Cl,r)),e.ulid=r=>e.check(Kc(Ol,r)),e.base64=r=>e.check(su(jl,r)),e.base64url=r=>e.check(iu(ql,r)),e.xid=r=>e.check(Qc(Pl,r)),e.ksuid=r=>e.check(eu(Nl,r)),e.ipv4=r=>e.check(tu(zl,r)),e.ipv6=r=>e.check(ru(Tl,r)),e.cidrv4=r=>e.check(nu(Ll,r)),e.cidrv6=r=>e.check(ou(xl,r)),e.e164=r=>e.check(au(Dl,r)),e.datetime=r=>e.check(ol(r)),e.date=r=>e.check(il(r)),e.time=r=>e.check(cl(r)),e.duration=r=>e.check(ll(r))});function h(e){return Jc($l,e)}const K=m("ZodStringFormat",(e,t)=>{G.init(e,t),_o.init(e,t)}),Al=m("ZodEmail",(e,t)=>{Xa.init(e,t),K.init(e,t)}),So=m("ZodGUID",(e,t)=>{Wa.init(e,t),K.init(e,t)}),ft=m("ZodUUID",(e,t)=>{Ga.init(e,t),K.init(e,t)}),Eo=m("ZodURL",(e,t)=>{Ha.init(e,t),K.init(e,t)});function wl(e){return uo(Eo,e)}const Rl=m("ZodEmoji",(e,t)=>{Ya.init(e,t),K.init(e,t)}),kl=m("ZodNanoID",(e,t)=>{Ka.init(e,t),K.init(e,t)}),Il=m("ZodCUID",(e,t)=>{Qa.init(e,t),K.init(e,t)}),Cl=m("ZodCUID2",(e,t)=>{ec.init(e,t),K.init(e,t)}),Ol=m("ZodULID",(e,t)=>{tc.init(e,t),K.init(e,t)}),Pl=m("ZodXID",(e,t)=>{rc.init(e,t),K.init(e,t)}),Nl=m("ZodKSUID",(e,t)=>{nc.init(e,t),K.init(e,t)}),zl=m("ZodIPv4",(e,t)=>{cc.init(e,t),K.init(e,t)}),Tl=m("ZodIPv6",(e,t)=>{uc.init(e,t),K.init(e,t)}),Ll=m("ZodCIDRv4",(e,t)=>{lc.init(e,t),K.init(e,t)}),xl=m("ZodCIDRv6",(e,t)=>{pc.init(e,t),K.init(e,t)}),jl=m("ZodBase64",(e,t)=>{fc.init(e,t),K.init(e,t)}),ql=m("ZodBase64URL",(e,t)=>{dc.init(e,t),K.init(e,t)}),Dl=m("ZodE164",(e,t)=>{mc.init(e,t),K.init(e,t)}),Zl=m("ZodJWT",(e,t)=>{vc.init(e,t),K.init(e,t)}),$o=m("ZodNumber",(e,t)=>{Xn.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(n,o,i)=>ju(e,n,o),e.gt=(n,o)=>e.check(po(n,o)),e.gte=(n,o)=>e.check(Jt(n,o)),e.min=(n,o)=>e.check(Jt(n,o)),e.lt=(n,o)=>e.check(lo(n,o)),e.lte=(n,o)=>e.check(Bt(n,o)),e.max=(n,o)=>e.check(Bt(n,o)),e.int=n=>e.check(wo(n)),e.safe=n=>e.check(wo(n)),e.positive=n=>e.check(po(0,n)),e.nonnegative=n=>e.check(Jt(0,n)),e.negative=n=>e.check(lo(0,n)),e.nonpositive=n=>e.check(Bt(0,n)),e.multipleOf=(n,o)=>e.check(fo(n,o)),e.step=(n,o)=>e.check(fo(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Ao(e){return hu($o,e)}const Bl=m("ZodNumberFormat",(e,t)=>{bc.init(e,t),$o.init(e,t)});function wo(e){return du(Bl,e)}const Jl=m("ZodNull",(e,t)=>{yc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qu(e,r,n)});function ht(e){return mu(Jl,e)}const Ul=m("ZodUnknown",(e,t)=>{_c.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zu()});function Ro(){return gu(Ul)}const Vl=m("ZodNever",(e,t)=>{Sc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Du(e,r,n)});function Ml(e){return vu(Vl,e)}const Fl=m("ZodArray",(e,t)=>{Ec.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mu(e,r,n,o),e.element=t.element,e.min=(r,n)=>e.check(lt(r,n)),e.nonempty=r=>e.check(lt(1,r)),e.max=(r,n)=>e.check(ho(r,n)),e.length=(r,n)=>e.check(mo(r,n)),e.unwrap=()=>e.element});function U(e,t){return Cu(Fl,e,t)}const Wl=m("ZodObject",(e,t)=>{Ac.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fu(e,r,n,o),J(e,"shape",()=>t.shape),e.keyof=()=>Me(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ro()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ro()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ml()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Mi(e,r),e.safeExtend=r=>Fi(e,r),e.merge=r=>Wi(e,r),e.pick=r=>Ui(e,r),e.omit=r=>Vi(e,r),e.partial=(...r)=>Gi(Io,e,r[0]),e.required=(...r)=>Xi(Oo,e,r[0])});function k(e,t){const r={type:"object",shape:e??{},...A(t)};return new Wl(r)}const Gl=m("ZodUnion",(e,t)=>{wc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wu(e,r,n,o),e.options=t.options});function de(e,t){return new Gl({type:"union",options:e,...A(t)})}const Xl=m("ZodIntersection",(e,t)=>{Rc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gu(e,r,n,o)});function Hl(e,t){return new Xl({type:"intersection",left:e,right:t})}const Yl=m("ZodRecord",(e,t)=>{kc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xu(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function ko(e,t,r){return new Yl({type:"record",keyType:e,valueType:t,...A(r)})}const Ut=m("ZodEnum",(e,t)=>{Ic.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Bu(e,n,o),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const i={};for(const s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Ut({...t,checks:[],...A(o),entries:i})},e.exclude=(n,o)=>{const i={...t.entries};for(const s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Ut({...t,checks:[],...A(o),entries:i})}});function Me(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ut({type:"enum",entries:r,...A(t)})}const Kl=m("ZodLiteral",(e,t)=>{Cc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ju(e,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function X(e,t){return new Kl({type:"literal",values:Array.isArray(e)?e:[e],...A(t)})}const Ql=m("ZodTransform",(e,t)=>{Oc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vu(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new On(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(Ue(i,r.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(Ue(s))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function ep(e){return new Ql({type:"transform",transform:e})}const Io=m("ZodOptional",(e,t)=>{ro.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function me(e){return new Io({type:"optional",innerType:e})}const tp=m("ZodExactOptional",(e,t)=>{Pc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function rp(e){return new tp({type:"optional",innerType:e})}const np=m("ZodNullable",(e,t)=>{Nc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hu(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Co(e){return new np({type:"nullable",innerType:e})}const op=m("ZodDefault",(e,t)=>{zc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ku(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function sp(e,t){return new op({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():xn(t)}})}const ip=m("ZodPrefault",(e,t)=>{Tc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qu(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ap(e,t){return new ip({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():xn(t)}})}const Oo=m("ZodNonOptional",(e,t)=>{Lc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yu(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function cp(e,t){return new Oo({type:"nonoptional",innerType:e,...A(t)})}const up=m("ZodCatch",(e,t)=>{xc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>el(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lp(e,t){return new up({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const pp=m("ZodPipe",(e,t)=>{jc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>tl(e,r,n,o),e.in=t.in,e.out=t.out});function Po(e,t){return new pp({type:"pipe",in:e,out:t})}const fp=m("ZodReadonly",(e,t)=>{qc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rl(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function hp(e){return new fp({type:"readonly",innerType:e})}const No=m("ZodCustom",(e,t)=>{Dc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Uu(e,r)});function dp(e,t){return Ou(No,e??(()=>!0),t)}function mp(e,t={}){return Pu(No,e,t)}function gp(e){return Nu(e)}var S=(e=>(e.Article="article",e.AudioDocument="audiodocument",e.AudioVisualDocument="audiovisualdocument",e.Book="book",e.Bookitem="bookitem",e.Conference="conference",e.Document="document",e.Image="image",e.Issue="issue",e.Journal="journal",e.Preprint="preprint",e.Proceeding="proceeding",e.Report="report",e.Unknown="unknown",e.Webpage="webpage",e))(S||{});const vp=de([X("book"),X("bookitem"),X("conference"),X("document"),X("report"),X("proceeding"),X("unknown")]),bp=de([X("article"),X("conference"),X("issue"),X("journal"),X("preprint"),X("proceeding"),X("unknown")]),ve=k({artnum:h(),atitle:h(),aufirst:h(),aulast:h(),auinit:h(),auinit1:h(),auinitm:h(),ausuffix:h(),au:U(h()),aucorp:h(),bici:h(),btitle:h(),chron:h(),coden:h(),date:h(),edition:h(),eissn:h(),epage:h(),externalDBID:h(),externalDocID:h(),genre:Me(S),id:h(),isbn:h(),issn:h(),issue:h(),jtitle:h(),pages:h(),part:h(),place:h(),pub:h(),quarter:h(),rft_id:U(h()),series:h(),sici:h(),spage:h(),ssn:h(),stitle:h(),title:h(),tpages:h(),volume:h()}).partial(),Vt=k({bibid:h(),doi:h(),uri:h()}).partial(),yp=ve.pick({atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,bici:!0,btitle:!0,date:!0,edition:!0,epage:!0,id:!0,isbn:!0,issn:!0,pages:!0,place:!0,pub:!0,rft_id:!0,title:!0,tpages:!0,series:!0,spage:!0}).partial(),_p=ve.pick({artnum:!0,atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,chron:!0,coden:!0,date:!0,epage:!0,id:!0,isbn:!0,eissn:!0,issn:!0,issue:!0,title:!0,jtitle:!0,pages:!0,part:!0,pub:!0,rft_id:!0,sici:!0,spage:!0,stitle:!0,ssn:!0,quarter:!0,volume:!0}).partial(),Sp=ve.pick({au:!0,date:!0,isbn:!0,pub:!0,title:!0}).partial(),Ep=ve.pick({au:!0,date:!0,pub:!0,title:!0}).partial(),$p=ve.pick({au:!0,date:!0,pub:!0,title:!0,spage:!0,epage:!0}).partial(),Ap=ve.pick({au:!0,date:!0,title:!0}).partial(),zo=k({...ve.shape,...Vt.shape}),V=(e,t)=>({...t,genre:e}),q=(e,t)=>({...t,genre:e}),ge=e=>({...e,genre:S.AudioVisualDocument}),To=e=>({...e,genre:S.Image}),Mt=e=>({...e,genre:S.Document}),dt=e=>({...e,genre:S.Webpage}),Lo=e=>Object.keys(e.shape),xo=Lo(ve),Ft=Lo(Vt),wp=(e,t,r)=>{if(r.length>0&&typeof r[0]=="string"){const n=t.startsWith("rft_")?t:`rft.${t}`;e.append(n,r[0])}},Rp=(e,t,r)=>{e.append(t,r)},kp=(e,t,r)=>{e.append(`rft.${t}`,r)},jo=e=>Ft.includes(e),qo=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{Array.isArray(n)?wp(t,r,n):typeof n=="string"&&n&&(jo(r)?Rp(t,r,n):kp(t,r,n))}),t},Do=(e,t,r,n)=>{const o=t.getAll(r).filter(i=>!!i).map(i=>i.trim());return o.length===0?e:{...e,[n]:o}},Zo=e=>{const t=Ip(e),r=(o,i)=>{if(i==="au")return Do(o,t,"rft.au","au");if(i==="rft_id")return Do(o,t,"rft_id","rft_id");const s=jo(i)?i:`rft.${i}`,a=t.get(s);return a?{...o,[i]:a.trim()}:o},n=[...xo,...Ft].reduce(r,{});return Object.keys(n).length===0?null:n},Ip=e=>URL.canParse(e)?new URL(e).searchParams:new URLSearchParams(e);function Cp(e){return typeof e!="string"?!1:Object.values(S).includes(e)}var $e=(e=>(e.CA="CA",e.EUAPAC="EUAPAC",e))($e||{});const Wt=k({id:h(),name:h(),region:Me($e)}),Op=k({tenants:U(Wt)}),Bo=9*1024*1024,Jo=k({url:wl({error:e=>e.input===void 0?'should have the required string property "url"':'"url" must be a string'}),html:h({error:e=>e.input===void 0?'should have the required string property "html"':void 0}).max(Bo,{error:`"html" should be a string with a MAX Length of ${Bo}`}),tenantCode:h({error:e=>e.input===void 0?'should have the required string property "tenantCode"':void 0}).min(1,{error:'"tenantCode" must be a string'}),region:Me([$e.EUAPAC,$e.CA],{error:e=>e.input===void 0?'should have the required string property "region"':'"region" must be a string of EUAPAC or CA'})});function Pp(e){return Jo.safeParse(e).success}const Gt=k({name:h(),region:Me($e),apps:ko(h(),h())}),Uo=ko(h(),Gt),Vo=e=>Gt.safeParse(e).success,Mo=e=>Uo.safeParse(e).success;function Fo(e){return Wt.safeParse(e).success}function Np(e){return typeof e=="string"&&Object.keys($e).includes(e)}const zp=e=>{if(!Mo(e))throw new Error("Error: the customer list data is invalid.");return{tenants:Object.entries(e).map(([r,n])=>Tp(r,n))}},Tp=(e,t)=>{if(!Vo(t))throw new Error(`Invalid customer: ${t}`);const{name:r,region:n}=t,o={id:e,name:r,region:n};if(!Fo(o))throw new Error(`Invalid tenant: ${JSON.stringify(o)}`);return o},Xt=k({parserType:h(),parserName:h().nullable(),referrer:h()}),Ht=k({bookmarkingWorkflowUrl:ht(),resource:ht()}),Yt=k({bookmarkingWorkflowUrl:h(),resource:ht()}),Kt=k({bookmarkingWorkflowUrl:ht(),resource:zo}),Qt=k({z3988SearchResult:X(!0)}),er=k({summonSearchResult:X(!0)}),tr=de([Yt,Ht,Kt,Qt,er]),Wo=k({meta:Xt}).and(tr);function Lp(e){return{bookmarkingWorkflowUrl:e,resource:null}}function L(){return{bookmarkingWorkflowUrl:null,resource:null}}function E(e){return{bookmarkingWorkflowUrl:null,resource:e}}function Go(){return{z3988SearchResult:!0}}function Xo(){return{summonSearchResult:!0}}const xp=e=>{const t=e.getAttribute("title");return t?Zo(t):null},rr=({document:e})=>{const t=Array.from(e.querySelectorAll(".Z3988"));if(t.length===0)return L();const r=t.map(xp).find(n=>n!==null);return r?E(r):L()},jp=e=>{const t=Array.from(e.querySelectorAll(".author > a")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},qp=e=>e.querySelector("#rpi-attribute-book_details-edition > .rpi-attribute-value > span")?.textContent??void 0,Dp=e=>{const t=e.querySelector("#rpi-attribute-book_details-isbn10 > .rpi-attribute-value > span")?.textContent??void 0,r=e.querySelector("#rpi-attribute-book_details-isbn13 > .rpi-attribute-value > span")?.textContent??void 0;if(t&&r)return`${t},${r}`;if(t)return t;if(r)return r},Zp=e=>e.querySelector("#rpi-attribute-book_details-publication_date > .rpi-attribute-value > span")?.textContent??void 0,Bp=e=>e.querySelector("#rpi-attribute-book_details-publisher > .rpi-attribute-value > span")?.textContent??void 0,Jp=e=>e.querySelector("#rpi-attribute-book_details-series > .rpi-attribute-value > a")?.textContent??void 0,Up=e=>{const t=e.querySelector("#rpi-attribute-book_details-fiona_pages > .rpi-attribute-value > span")?.textContent??void 0;return(t?/\d+/.exec(t)?.[0]:null)??void 0},Vp=({document:e})=>{const t=jp(e),r=qp(e),n=Dp(e),o=Zp(e),i=Bp(e),s=Jp(e),a=e.getElementById("productTitle")?.textContent.trim()??void 0,c=Up(e);return{bookmarkingWorkflowUrl:null,resource:V(S.Book,{au:t,date:o,edition:r,isbn:n,pub:i,series:s,title:a,tpages:c})}},p=(e,t,r)=>{const n=Q(e,t,r);return n.length>0?n[0]:void 0},Q=(e,t,r)=>Array.from(e.querySelectorAll(`meta[${t}='${r}']`)).map(n=>n.getAttribute("content")).filter(n=>!!n?.trim()),Ho=e=>{const t=new Map,r=e.split(";").filter(n=>!!n);for(const n of r){const[o,i,s]=n.split(":");t.set(o,{type:i,value:s})}return t};var b=(e=>(e[e.None=0]="None",e[e.Book=1]="Book",e[e.Chapter=2]="Chapter",e[e.Journal=3]="Journal",e[e.Article=4]="Article",e[e.AudioVisual=5]="AudioVisual",e[e.Webpage=6]="Webpage",e[e.Document=7]="Document",e))(b||{});const Mp=e=>{if(!e)return;const t=/\b\d{4}\b/.exec(e);return t?t[0]:void 0},Fe=e=>{const t=e.querySelector("#publication_date p")?.textContent.trim()??p(e,"name","bepress_citation_date");return Mp(t)},Fp=e=>{const t=p(e,"name","bepress_citation_firstpage"),r=p(e,"name","bepress_citation_lastpage");return{spage:t,epage:r}},nr=e=>{const t=/https?:\/\/doi\.org\/(.+)/i,n=e.querySelector("#source p")?.textContent.trim()?.match(t);if(n?.length===2)return n[1];const i=e.querySelector("#recommended_citation p a")?.textContent.trim()?.match(t);if(i?.length===2)return i[1]},Wp=e=>{const t=[],r=e.querySelectorAll("tbody td");for(const n of r){const o=n.querySelector("strong");if(o&&!o.querySelector("a")){const i=o.textContent.trim();i&&t.push(i)}}return t},We=e=>p(e,"name","bepress_citation_title")??e.querySelector("title")?.textContent.trim(),mt=e=>Q(e,"name","author"),gt=e=>p(e,"name","bepress_citation_publisher"),or=e=>p(e,"name","bepress_citation_pdf_url"),Gp=(e,t)=>{if(t.includes("/etd/"))return b.Document;if(t.includes("/sophpm_music/")||t.includes("/streaming/"))return b.AudioVisual;if(t.includes("/vol"))return b.Article;if(t.includes("/facpub")||t.includes("/studentpub/")){const r={"book chapter":b.Book,"conference paper":b.Book,"peer-reviewed article":b.Article,other:b.Document},n=e.querySelector("#document_type p")?.textContent.toLowerCase().trim();return n?r[n]:void 0}return b.Journal},Xp=e=>{const t=We(e),r=mt(e),n=Fe(e),o=p(e,"name","bepress_citation_journal_title"),i=p(e,"name","bepress_citation_volume"),s=p(e,"name","bepress_citation_issue"),{epage:a,spage:c}=Fp(e),u=or(e),l=nr(e);return q(S.Article,{atitle:t,jtitle:o,au:r,date:n,volume:i,issue:s,epage:a,spage:c,doi:l,uri:u})},Hp=(e,t)=>{const r=e.querySelector(".inherit-title a")?.textContent.trim()??We(e),n=Wp(e),o=Fe(e),i=gt(e),s=nr(e);return q(S.Journal,{jtitle:r,au:n,date:o,pub:i,doi:s,uri:t})},Yp=e=>{const t=We(e),r=mt(e),n=Fe(e),o=gt(e),i=or(e),s=e.querySelector("#document_type p")?.textContent.toLowerCase().trim();if(s==="book chapter"){const c=e.querySelector("#source p")?.textContent.trim();return V(S.Bookitem,{pub:o,atitle:t,btitle:c,au:r,date:n,uri:i})}const a=nr(e);return s==="conference paper"?V(S.Conference,{pub:o,title:t,au:r,date:n,doi:a,uri:i}):V(S.Document,{pub:o,title:t,au:r,date:n,doi:a,uri:i})},Kp=(e,t)=>{const r=We(e),n=mt(e),o=Fe(e),i=gt(e);return ge({title:r,au:n,date:o,pub:i,uri:t})},Qp=e=>{const t=We(e),r=mt(e),n=Fe(e),o=gt(e),i=or(e);return Mt({pub:o,title:t,au:r,date:n,uri:i})},ef=({url:e,document:t})=>{switch(Gp(t,e)){case b.Article:return E(Xp(t));case b.Journal:return E(Hp(t,e));case b.Book:return E(Yp(t));case b.AudioVisual:return E(Kp(t,e));case b.Document:return E(Qp(t));default:return L()}},be=e=>{if(e)return e.replace(/[^0-9]/g,"")},Yo=e=>Array.from(e.querySelectorAll(".author-source-list li a")).filter(t=>t.childNodes.length>0).map(t=>t.childNodes[0].textContent?.trim()).filter(t=>!!t),Ko=e=>e.querySelector(".article-header")?.querySelector("h1 span")?.textContent.trim(),Qo=e=>({date:e?.textContent.match(/\d{4}/)?.[0],pub:"Elsevier Inc."}),tf=e=>{const t=e.querySelector(".article-meta");if(!t)return{};const r=t.querySelector(".issue")?.textContent??void 0,n=t.querySelector(".title")?.textContent.trim()??void 0,[o,i]=(r?.split(",")??[]).map(s=>s.trim());return{volume:be(o),issue:be(i),jtitle:n}},rf=e=>{const t=e.querySelector(".article-header .source")?.textContent,r=t?.match(/\d{4}-\d{2}-\d{2}/)?.[0],n=t?.match(/Pages (\d+-\d+)/),[o,i]=(n?.[1].split("-")??[]).map(u=>u.trim()),{jtitle:s,volume:a,issue:c}=tf(e);return E(q(S.Article,{au:Yo(e),atitle:Ko(e),spage:o,epage:i,date:r,jtitle:s,volume:a,issue:c}))},nf=e=>{const[t,r]=e.querySelectorAll(".source"),{date:n,pub:o}=Qo(r),i=e.querySelector(".browse__book-toc"),[s,a]=(i?.querySelector("h1")?.textContent.split(",")??[]).map(c=>c.trim());return E(V(S.Book,{btitle:s,edition:a,pub:o,au:t.textContent?[t.textContent]:void 0,date:n}))},of=e=>{const t=e.querySelector(".article-meta");if(!t)return{};const r=t.querySelector(".edition")?.textContent??void 0,n=t.querySelector(".title")?.textContent.trim()??void 0,o=t.querySelector(".copyright"),{date:i,pub:s}=Qo(o);return{edition:r,btitle:n,date:i,pub:s}},sf=e=>{const{edition:t,btitle:r,date:n,pub:o}=of(e),i=e.querySelector(".article-header .source")?.textContent,s=/(\d+-\d+|[IVXLCDM]+-[IVXLCDM]+)/i,a=i?.match(s),[c,u]=(a?.[1].split("-")??[]).map(l=>l.trim());return E(V(S.Bookitem,{au:Yo(e),atitle:Ko(e),btitle:r,edition:t,pub:o,date:n,spage:c,epage:u}))},af=/^[0-9X]$/,sr=e=>{if(!e)return;let t="";for(const r of e)af.test(r)&&(t+=r);if(t)return t},cf=(e,t)=>{const r=e.querySelector(".c-cksc-content-header__title")?.textContent.trim(),n=e.querySelector(".c-cksc-content-nice__button")?.textContent.trim(),o=e.querySelector(".c-cksc-content-nice__date")?.textContent.trim(),i=e.evaluate('//p[contains(text(), "ISBN")]',e,null,XPathResult.ANY_TYPE),s=sr(i.iterateNext()?.textContent);return E({genre:S.Document,title:r,pub:n,date:o,uri:t,isbn:s})},es=e=>e.querySelector(".browse-toc")??e.querySelector(".browse__journal"),uf=e=>es(e)?.querySelector("h1")?.firstElementChild?.textContent.trim(),lf=e=>{const t=es(e),r=t?.querySelector("figure figcaption.source");if(r){const[a,c,u]=r.textContent.split(",").map(l=>l.trim());return{date:a,volume:be(c),issue:be(u)}}const n=t?.querySelector("p")?.textContent,[o,i]=n?.split(",")??[];return{date:t?.querySelector(".source span")?.textContent??void 0,volume:be(o),issue:be(i)}},pf=e=>{const{date:t,volume:r,issue:n}=lf(e);return E(q(S.Journal,{jtitle:uf(e),date:t,volume:r,issue:n}))};var ts=(e=>(e.Book="Book",e.Chapter="Book Chapter",e.Article="Full Text Article",e.Journal="Journal",e.Guideline="Guideline",e))(ts||{});const ff=e=>Object.values(ts).includes(e),hf=(e,t)=>{const r=e.querySelector(".content-type")??e.querySelector(".c-cksc-content-header__content-type");if(!r)return t.includes("journal")?"Journal":void 0;const n=r.textContent;if(n&&ff(n))return n},df=({url:e,document:t})=>{switch(hf(t,e)){case"Book":return nf(t);case"Book Chapter":return sf(t);case"Full Text Article":return rf(t);case"Journal":return pf(t);case"Guideline":return cf(t,e);case void 0:return L()}},Ce=k({"@context":h()}),mf=e=>Ce.safeParse(e).success,rs='script[type="application/ld+json"]',ns=e=>Array.from(e.querySelectorAll(rs)),vt=e=>e.querySelector(rs),Ge=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(mf(r))return r}catch{return null}return null},gf=k({"@id":h(),"@type":h(),author:k({"@id":h()}).optional(),datePublished:h().optional(),dateModified:h().optional(),description:h().optional(),inLanguage:h().optional(),isPartOf:k({"@id":h()}).optional(),name:h().optional(),url:h().optional()}),vf=Ce.extend({"@graph":U(gf)}),bf=e=>vf.safeParse(e).success,yf=e=>{const t=ns(e);if(t.length===0)return null;const r=t.map(Ge).filter(bf).map(n=>n["@graph"]);return r.length!==1?null:r[0]},_f=(e,t)=>e.find(r=>r["@type"]===t)??null,Sf=(e,t)=>e.find(r=>r["@id"]===t)??null,Ef=e=>{const t=_f(e,"WebPage");if(!t)return null;const r=t.author?Sf(e,t.author["@id"]):void 0;return dt({au:r?.name?[r.name]:void 0,date:t.datePublished,title:t.name})},$f=({document:e})=>{const t=yf(e);return t?{bookmarkingWorkflowUrl:null,resource:Ef(t)}:L()},os=()=>L(),Af=e=>{const{pathname:t}=new URL(e);return t.startsWith("/toc/")?"journal":t.startsWith("/article/")?"article":void 0},wf=e=>{const t=e.querySelector("header h1 span")?.firstChild?.textContent?.trim(),r=e.querySelector("header p span")?.textContent.trim(),n=/\d{4}-\d{3}[\dX]/g,o=r?.match(n)??[],[i,s]=[o[0],o[1]],a=e.evaluate('//dt[contains(text(), "Publisher")]/following-sibling::dd/a',e,null,XPathResult.STRING_TYPE).stringValue.trim();return E(q(S.Journal,{pub:a,jtitle:t,issn:i,eissn:s}))},Rf=e=>{let t,r;const n=Q(e,"name","citation_issn");return n.length===2?(t=n[1],r=n[0]):t=n[0],{eissn:t,issn:r}},kf=e=>{const t=p(e,"name","citation_journal_title"),r=p(e,"name","citation_title"),n=Q(e,"name","citation_author"),o=p(e,"name","citation_doi"),{eissn:i,issn:s}=Rf(e),a=p(e,"name","citation_publisher"),c=p(e,"name","citation_publication_date"),u=p(e,"name","citation_volume"),l=p(e,"name","citation_issue"),f=p(e,"name","citation_firstpage"),d=p(e,"name","citation_lastpage");return E(q(S.Article,{jtitle:t,atitle:r,au:n,doi:o,eissn:i,issn:s,pub:a,date:c,volume:u,issue:l,spage:f,epage:d}))},If=({document:e,url:t})=>{switch(Af(t)){case"journal":return wf(e);case"article":return kf(e);case void 0:return L()}},Cf=e=>{const t=p(e,"name","pbContext");if(!t)return b.None;const r=Ho(t);switch(r.has("page")?r.get("page")?.value:null){case"Article/Chapter View":return b.Article;case"Table of Contents":return b.Journal;default:return b.None}},Of=e=>{const t=e.querySelector('meta[property="article:author"]')?.getAttribute("content")?.split(",").map(r=>r.trim());return t&&t.length>0?t:void 0},ss=e=>{const t=new Map,r=Array.from(e.querySelectorAll(".rlist>li>span")).map(i=>i.textContent.trim()).join(""),n=/^ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(r);n&&t.set("issn",n[1]);const o=/Online ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(r);return o&&t.set("eissn",o[1]),t},Pf=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationVolume"] > span[property="volumeNumber"]')?.textContent??void 0,Nf=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationIssue"] > span[property="issueNumber"]')?.textContent??void 0,zf=e=>e.querySelector('meta[name="dc.Identifier"][scheme="doi"]')?.getAttribute("content")??void 0,Tf=e=>e.querySelector("h1")?.textContent??void 0,Lf=e=>{const t=new Map,r=e.querySelector("h2.heading-m")?.textContent,n=r?.match(/Issue\s+(\d+(?:-\d+)?)/);n&&t.set("issue",n[1]);const o=r?.match(/Volume\s+(\d+)/);o&&t.set("volume",o[1]);const i=r?.match(/(\d{4})$/);return i&&t.set("date",i[1]),t},xf=e=>{const t=Of(e.document),r=p(e.document,"name","dc.Date"),n=zf(e.document),o=ss(e.document),i=o.get("issn"),s=o.get("eissn"),a=Nf(e.document),c=p(e.document,"name","citation_journal_title"),u=p(e.document,"name","dc.Publisher"),l=p(e.document,"name","dc.Title"),f=Pf(e.document);return q(S.Article,{au:t,date:r,eissn:s,issn:i,issue:a,jtitle:c,pub:u,title:l,volume:f,doi:n})},jf=e=>{const t=ss(e.document),r=t.get("issn"),n=t.get("eissn"),o=Tf(e.document),i=Lf(e.document),s=i.get("issue"),a=i.get("volume"),c=i.get("date");return q(S.Journal,{eissn:n,issn:r,jtitle:o,title:o,issue:s,volume:a,date:c})},qf=e=>{switch(Cf(e.document)){case b.Article:return E(xf(e));case b.Journal:return E(jf(e));default:return L()}},Df=e=>{const t=p(e,"name","citation_type"),r=p(e,"name","citation_article_type");return t==="JOUR"&&r?b.Article:t==="CHP"?b.Chapter:e.querySelector(".book-edition-year")?.textContent.includes("Book")?b.Book:e.getElementById("journal-title")?b.Journal:b.None},ir=e=>p(e,"name","citation_doi")??p(e,"name","dc.identifier")??e.querySelector(".doi .anchor-text")?.textContent??void 0,Zf=e=>{const t=Array.from(e.querySelectorAll(".kf-details .kf-detail-item:has(h3)")),r=new Map;for(const n of t){const o=n.querySelector("h3")?.textContent,i=n.querySelector("p")?.textContent;o&&i&&r.set(o,i)}return r},ar=(e,t)=>{const r=Array.from(e.querySelectorAll(t)).map(n=>n.textContent).filter(n=>!!n);return r.length>0?r:void 0},Bf=e=>{const t=e.querySelector(".js-issn")?.textContent;if(t)return t.replace("Online ISSN: ","")},Jf=e=>{const t=e.get("DOI");if(t)return URL.canParse(t)?new URL(t).pathname.substring(1):t},Uf=e=>{const t=Zf(e),r=p(e,"property","og:title"),n=p(e,"property","og:book:isbn"),o=t.get("Published"),i=ar(e,".authors-container .author-detail h3"),s=ir(e)??Jf(t);return V(S.Book,{au:i,date:o,doi:s,isbn:n,title:r})},Vf=e=>{const t=p(e,"property","og:title"),r=p(e,"property","og:book:isbn"),n=p(e,"name","citation_publication_date"),o=ar(e,".author-group .button-link-text"),i=p(e,"name","citation_firstpage"),s=p(e,"name","citation_lastpage"),a=p(e,"name","citation_publisher"),c=ir(e),u=p(e,"name","citation_inbook_title")??e.querySelector(".publication-title")?.textContent??void 0;return V(S.Bookitem,{au:o,btitle:u,date:n,doi:c,epage:s,isbn:r,pub:a,spage:i,title:t})},Mf=e=>{const t=p(e,"property","og:title"),r=p(e,"name","citation_issn"),n=p(e,"name","citation_publication_date"),o=ar(e,".author-group .button-link-text"),i=p(e,"name","citation_publisher"),s=p(e,"name","citation_firstpage"),a=p(e,"name","citation_issue"),c=p(e,"name","citation_volume"),u=ir(e),l=p(e,"name","citation_journal_title")??e.querySelector(".publication-title")?.textContent??void 0;return q(S.Article,{au:o,jtitle:l,date:n,doi:u,issn:r,issue:a,pub:i,spage:s,title:t,volume:c})},Ff=e=>{const t=e.getElementById("journal-title")?.textContent??void 0,r=Bf(e);return q(S.Journal,{issn:r,title:t})},Wf=({document:e})=>{switch(Df(e)){case b.Book:return E(Uf(e));case b.Chapter:return E(Vf(e));case b.Article:return E(Mf(e));case b.Journal:return E(Ff(e));default:return L()}},Gf=e=>{const t=p(e,"name","pbContext");return t&&Ho(t).has("article")?b.Article:b.Journal},Xf=e=>{const t=e.querySelector(".itemPageRangeHistory");if(!t)return;const n=Array.from(t.childNodes).find(o=>o.textContent?.trim().startsWith("Page"));if(n)return n.textContent?.replace(/Pages?/,"").trim()??void 0},Hf=e=>{const t=e.querySelector(".issue-heading")?.textContent;return t?t.split(",")[0]?.replace("Volume","").trim():void 0},Yf=e=>{const t=e.querySelector(".issue-heading .nav-toc-list")?.textContent;return t?t.replace("Issue","").trim():void 0},Kf=e=>{const t=p(e,"property","og:title"),r=p(e,"name","dc.Publisher"),n=p(e,"name","dc.Date"),o=p(e,"name","publication_doi"),i=p(e,"name","citation_journal_title"),s=Q(e,"name","dc.Creator"),a=Hf(e),c=Yf(e),u=Xf(e),l=u?.includes("-")?u.split("-")[0]:u,f=u?.includes("-")?u.split("-")[1]:u;return q(S.Article,{au:s,jtitle:i,date:n,doi:o,issue:c,pub:r,spage:l,epage:f,title:t,volume:a})},Qf=e=>{const t=p(e,"property","og:title"),r=p(e,"name","publication_doi");return q(S.Journal,{doi:r,title:t})},eh=({document:e})=>{switch(Gf(e)){case b.Article:return E(Kf(e));case b.Journal:return E(Qf(e));default:return L()}},th=e=>tr.safeParse(e).success,rh=e=>Wo.safeParse(e).success,nh=e=>Xt.safeParse(e).success;function oh(e){return Yt.safeParse(e).success}function bt(e){return Kt.safeParse(e).success}function is(e){return Qt.safeParse(e).success}function as(e){return er.safeParse(e).success}function sh(e){return Ht.safeParse(e).success}const ih=e=>Array.from(e.querySelectorAll("tr th")).find(n=>n.textContent.trim()==="DOI:")?.nextElementSibling?.querySelector('span[property="identifier"]')?.textContent??void 0,ah=e=>{const t=/Record\/(\d+)/.exec(e);if(t&&t.length>1)return t[1]},ch=e=>{const{url:t,document:r}=e,n=rr(e);if(!bt(n))return n;const o=ih(r);return o&&(n.resource.rft_id=[`info:doi/${o}`]),n.resource.bibid=ah(t),n},uh=Ce.extend({"@type":X("VideoObject"),name:h(),author:h(),genre:h(),description:h(),uploadDate:h(),duration:h(),thumbnailUrl:U(h())}),lh=e=>uh.safeParse(e).success,ph=e=>{const t=ns(e);if(t.length===0)return null;const r=t.map(Ge).filter(lh);return r.length!==1?null:r[0]},fh=({url:e,document:t})=>{const r=ph(t);return r?{bookmarkingWorkflowUrl:null,resource:ge({au:[r.author],date:r.uploadDate,title:r.name,uri:e})}:L()},cs=e=>p(e,"name","doi")??p(e,"name","DOI")??p(e,"name","citation_doi")??p(e,"name","dc.identifier")??p(e,"name","prism.doi")??void 0,us=e=>{const t=e.editor?.map(o=>o.name)??[],n=[...e.author?.map(o=>o.name)??[],...t];if(n.length!==0)return n};var Xe=(e=>(e.Book="Book",e.Journal="Journal",e.Periodical="Periodical",e.PublicationVolume="PublicationVolume",e.ScholarlyArticle="ScholarlyArticle",e.VideoObject="VideoObject",e.WebPage="WebPage",e))(Xe||{}),Ae=(e=>(e.Article="article",e.Book="book",e.Paper="Paper",e.Video="video.other",e.Website="website",e))(Ae||{}),pe=(e=>(e.Article="/article/",e.Book="/book/",e.Chapter="/chapter/",e.Video="/video/",e.ReferenceWorkEntry="/referenceworkentry/",e.ReferenceWork="/referencework/",e.Protocol="/protocol/",e.Collections="/collections/",e.Journal="/journal/",e.JournalIssue="/volumes-and-issues/",e))(pe||{});const ls=k({"@type":X(Xe.ScholarlyArticle),author:U(k({"@type":h(),name:h()})).optional(),editor:U(k({"@type":h(),name:h()})).optional(),datePublished:h().optional(),headline:h().optional(),issn:U(h()).optional(),pageStart:h().optional(),pageEnd:h().optional(),isPartOf:k({"@type":de([h(),U(h())]),name:h(),issn:U(h()).optional(),volumeNumber:h().optional(),isbn:U(h()).optional()}),publisher:k({"@type":h(),name:h()}).optional()}),ps=e=>ls.safeParse(e).success,hh=Ce.extend({"@type":X(Xe.WebPage),mainEntity:ls}),dh=e=>hh.safeParse(e).success,mh=k({"@type":U(h()),name:h().optional(),issn:U(h()),volumeNumber:h().optional()}),fs=e=>mh.safeParse(e).success,gh=(e,t)=>p(e,"name","citation_issn")??p(e,"name","prism.issn")??(ps(t.isPartOf)?t.isPartOf.issn?.[0]:void 0),hs=(e,t)=>{const r=us(t),n=p(e,"name","citation_online_date"),o=cs(e),i=p(e,"name","citation_issue"),s=gh(e,t),a=fs(t.isPartOf)&&t.isPartOf.issn.length>0?t.isPartOf.issn[1]:void 0,c=t.pageStart,u=t.pageEnd,l=t.headline,f=t.isPartOf.name,d=fs(t.isPartOf)?t.isPartOf.volumeNumber:void 0;return q(S.Article,{au:r,date:n,doi:o,issue:i,eissn:s,issn:a,spage:c,epage:u,atitle:l,jtitle:f,volume:d})},vh=Ce.extend({"@type":X(Xe.Book),copyrightYear:h().optional(),author:U(k({"@type":h(),name:h()})).optional(),editor:U(k({"@type":h(),name:h()})).optional(),isbn:h().optional(),name:h().optional(),numberOfPages:Ao().optional(),publisher:k({"@type":h(),name:h()}).optional()}),bh=e=>vh.safeParse(e).success,yh=e=>{const t=e.querySelectorAll(".c-bibliographic-information__list-item"),r=new Map;return t.forEach(n=>{const o=n.querySelector(".u-text-bold")?.textContent.trim(),i=n.querySelector(".c-bibliographic-information__value")?.textContent.trim();o&&i&&r.set(o,i)}),r},_h=(e,t)=>{const r=yh(e),n=us(t),o=t.copyrightYear?.toString(),i=cs(e)??r.get("DOI"),s=t.name??r.get("Book Title"),a=t.isbn??r.get("Softcover ISBN"),c=t.numberOfPages?.toString()??r.get("Number of Pages"),u=t.publisher?.name??r.get("Publisher");return V(S.Book,{au:n,date:o,doi:i,title:s,isbn:a,tpages:c,pub:u})},Sh=k({"@type":X("Periodical"),name:h(),url:h(),issn:U(h()),editor:U(k({givenName:h(),familyName:h()})),publisher:k({name:h()}),description:h()}),Eh=e=>Sh.safeParse(e).success,$h=e=>{const t=e.editor.map(({givenName:s,familyName:a})=>`${s} ${a}`),r=e.name,[n,o]=e.issn,i=e.publisher.name;return q(S.Journal,{au:t,jtitle:r,eissn:n,issn:o,pub:i})},Ah=k({"@type":X(Xe.VideoObject),name:h().optional(),description:h().optional(),thumbnailUrl:h().optional(),uploadDate:h().optional(),contentUrl:h().optional(),duration:h().optional()}),wh=e=>Ah.safeParse(e).success,Rh=(e,t)=>{const r=Array.from(e.querySelectorAll('dd[data-test="video-segment-author"]')).map(s=>s.textContent.trim()).filter(s=>!!s),n=t?.uploadDate?new Date(t.uploadDate).getFullYear().toString():void 0,o=t?.name??p(e,"property","og:title")??void 0,i=e.querySelector("video-about-doi")?.textContent??void 0;return ge({au:r.length>0?r:void 0,date:n,doi:i,title:o})},kh=e=>{const t=p(e,"property","og:title");return dt({title:t})},Ih=(e,t)=>{const r=p(t,"property","og:type");return r===Ae.Article&&e.includes(pe.Article)?b.Article:r===Ae.Book&&(e.includes(pe.Book)||e.includes(pe.ReferenceWork))?b.Book:r===Ae.Paper&&e.includes(pe.Chapter)?b.Chapter:r===Ae.Paper&&(e.includes(pe.ReferenceWorkEntry)||e.includes(pe.Protocol))?b.Article:r===Ae.Video&&e.includes(pe.Video)?b.AudioVisual:r===Ae.Website&&(e.includes(pe.Collections)||e.includes(pe.JournalIssue))?b.Webpage:r===Ae.Website&&e.includes(pe.Journal)?b.Journal:b.None},Ch=(e,t,r)=>e===b.AudioVisual&&wh(r)?E(Rh(t,r)):e===b.Book&&bh(r)?E(_h(t,r)):(e===b.Chapter||e===b.Article)&&ps(r)?E(hs(t,r)):e===b.Article&&dh(r)?E(hs(t,r.mainEntity)):e===b.Journal&&Eh(r)?E($h(r)):L(),Oh=({url:e,document:t})=>{const r=Ih(e,t);if(r===b.Webpage)return E(kh(t));const n=vt(t);if(!n)return L();const o=Ge(n);return o?Ch(r,t,o):L()},Ph=new Set(["Print ISBN","Online ISBN","DOI","First published","Online ISSN","Print ISSN"]),Nh=k({content:k({item:k({title:h(),"published-date":h()}),group:k({volume:h(),issue:h()}),series:k({title:h(),type:h(),eissn:h()})}).optional()}),ds=(e,t)=>{if(!e)return;const r=e.indexOf(t);return r>-1?e.substring(0,r):e},cr=e=>{const r=/\d+/.exec(e);if(r?.[0])return r[0]},zh=e=>{const t=e.querySelectorAll("script"),n=Array.from(t).find(o=>o.textContent.includes("adobeDataLayerJson"))?.textContent.match(/var adobeDataLayerJson = (\{.*?});/s);if(n?.length===2)try{const o=JSON.parse(n[1]);return Nh.parse(o)}catch{return}},Th=(e,t)=>{const r=p(e,"property","og:type"),n=t.includes("epdf");return r==="Book"||r==="books.book"?b.Book:r==="Chapter"?b.Chapter:r==="Journal"?b.Journal:r==="Article"||n?b.Article:b.None},yt=e=>{const t=Q(e,"name","citation_author"),r=Array.from(e.querySelectorAll("#product-details-content .product-authors")).map(o=>o.textContent).filter(o=>!!o),n=new Set([...t,...r]);return n.size>0?[...n]:void 0},Lh=e=>{const t=Array.from(e.querySelectorAll("#product-details-content .text-piped p")).map(r=>r.textContent).find(r=>r.endsWith(" pages"));if(t)return cr(t)},_t=e=>{const t=new Map,r=Array.from(e.querySelectorAll(".journal-info-container .info-block")).flatMap(n=>Array.from(n.querySelectorAll(".info_label")));for(const n of r){const o=n.nextElementSibling;if(!o?.classList.contains("info_value"))continue;const i=ds(n.textContent,":"),s=ds(o.textContent,":");!i||!s||Ph.has(i)&&t.set(i,s)}return t},St=(e,t)=>p(e,"property","books:release_date")??p(e,"name","citation_online_date")??t.get("First published")??void 0,ur=(e,t)=>p(e,"name","dc.identifier")??p(e,"name","citation_doi")??p(e,"name","publication_doi")??t.get("DOI")??void 0,ms=(e,t)=>{const r=new Set([p(e,"property","books:isbn"),t.get("Print ISBN"),t.get("Online ISBN")].filter(n=>!!n));return r.size>0?[...r].join(","):void 0},xh=e=>{let t,r;const n=e.querySelector(".cover-image__details div:first-of-type");if(n?.childNodes.length===2){const[o,i]=n.childNodes;o.textContent&&(t=cr(o.textContent)),i.textContent&&(r=cr(i.textContent))}return{volume:t,issue:r}},jh=e=>{const r=Array.from(e.querySelectorAll(".authors .author")).map(n=>n.textContent.trim().replace(",","")).filter(n=>!!n);return r.length>0?r:void 0},qh=e=>{const t=Array.from(e.querySelectorAll(".details-section .details-entry")),r=t.find(s=>s.querySelector(".details-label")?.textContent.trim()==="ISSN"),n=t.find(s=>s.querySelector(".details-label")?.textContent.trim()==="eISSN");let o,i;return r&&(o=r.querySelector(".details-value")?.textContent.trim()),n&&(i=n.querySelector(".details-value")?.textContent.trim()),{issn:o,eissn:i}},Dh=e=>{if(!e?.content?.group)return{volume:void 0,issue:void 0};const t=e.content.group.volume,r=e.content.group.issue;return r==="0"&&t==="0"?{volume:void 0,issue:void 0}:{volume:t,issue:r}},Zh=e=>{const n=Array.from(e.querySelectorAll(".details-section .details-entry")).find(s=>s.querySelector(".details-label")?.textContent.trim()==="Pages")?.querySelector(".details-value")?.textContent.trim(),[o,i]=(n?.split("-")??[void 0,void 0]).map(s=>s?.trim());return o?.toLowerCase()==="n/a"&&i?.toLowerCase()==="n/a"?{spage:void 0,epage:void 0}:{spage:o,epage:i}},Bh=e=>{const t=_t(e),r=yt(e),n=p(e,"property","og:title"),o=St(e,t),i=ur(e,t),s=ms(e,t),a=Lh(e);return V(S.Book,{au:r,date:o,doi:i,isbn:s,pages:a,title:n})},Jh=e=>{const t=_t(e),r=yt(e),n=p(e,"name","citation_book_title"),o=St(e,t),i=ur(e,t),s=ms(e,t),a=p(e,"name","citation_publisher"),c=p(e,"property","og:title");return V(S.Bookitem,{au:r,btitle:n,date:o,doi:i,isbn:s,pub:a,title:c})},Uh=e=>{const t=_t(e),r=yt(e),n=St(e,t),o=t.get("Online ISSN"),i=t.get("Print ISSN"),s=p(e,"property","og:title"),{volume:a,issue:c}=xh(e);return q(S.Journal,{au:r,date:n,eissn:o,issn:i,issue:c,title:s,volume:a})},Vh=e=>{const t=_t(e),r=zh(e),n=yt(e)??jh(e),o=St(e,t)??r?.content?.item["published-date"],i=ur(e,t),{issn:s,eissn:a}=qh(e),{volume:c,issue:u}=Dh(r),l=p(e,"property","og:title")??r?.content?.item.title,f=p(e,"name","citation_journal_title")??r?.content?.series.title,{spage:d,epage:g}=Zh(e);return q(S.Article,{au:n,date:o,doi:i,eissn:a,issn:s??p(e,"name","citation_issn"),issue:u,jtitle:f,title:l,volume:c,spage:d,epage:g})},Mh=({document:e,url:t})=>{switch(Th(e,t)){case b.Book:return E(Bh(e));case b.Chapter:return E(Jh(e));case b.Journal:return E(Uh(e));case b.Article:return E(Vh(e));default:return L()}},Fh=e=>{const t=Q(e,"name","citation_author");return t.length>0?t:void 0},Wh=({document:e})=>{const t=Fh(e),r=p(e,"name","citation_publication_date"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_isbn"),i=p(e,"name","citation_publisher"),s=p(e,"name","citation_title")??e.title,a=ge({au:t,date:r,doi:n,isbn:o,pub:i,title:s});return E(a)},Gh=({document:e})=>Array.from(e.querySelectorAll(".Z3988")).length<=1?L():Go(),Et=e=>{if(!(!e||e.length===0))return e[0]};function lr(e,t){const r=t.map(n=>{const o=e.querySelector(n)?.textContent??null;if(o&&o.trim()!=="")return o}).filter(n=>n);return Et(r)??null}function Xh(e,t){const r=t.flatMap(n=>Array.from(e.querySelectorAll(n)).flatMap(i=>{const s=i.textContent;return s&&s.trim()!==""?s.split(";").map(a=>a.trim()).filter(a=>a.length>0):[]}));return r.length>0?r:null}const He=(e,t)=>lr(e,[t])?.trim(),Hh=e=>{const t=e.querySelector(".content-meta-data__authors")?.textContent;if(t)return t.split(/,\s+|\s+and\s+/).filter(r=>!!r)},Yh=e=>{const t=Array.from(e.querySelectorAll('.tombstone-metadata [data-qa="item-authors"]')).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},Kh=e=>{const t=Array.from(e.querySelectorAll('.item-authors [data-qa="item-contributors"], .item-authors [data-qa="item-creators"]')).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},Qh=e=>{const t=Array.from(e.querySelectorAll(".contrib-type-author .name")).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},Oe=e=>{const t=new Set([...Kh(e)??[],...Hh(e)??[],...Qh(e)??[],...Yh(e)??[]]);return t.size?[...t]:void 0},Pe=(e,t)=>e.querySelector('[data-qa="published-date"]')?.textContent??e.querySelector(".summary-image")?.textContent??De(t?.get("date"))??De(t?.get("copyright date"))??De(t?.get("published date")),gs=e=>{const t=e.find(r=>r.startsWith("https://doi.org/"));if(t)return t.replace("https://doi.org/","")},vs=e=>{const t=e.get("local identifier");if(t?.length)return gs(t)},ed=e=>e.querySelector(".doi")?.getAttribute("href")??void 0,De=e=>{if(e?.length)return e[0]},Ne=e=>{const t=new Map;return Array.from(e.querySelectorAll(".metadata-element, .metadata")).map(r=>{const o=r.querySelector(".metadata-label")?.textContent.trim().toLowerCase(),i=Array.from(r.querySelectorAll(".metadata-value")).map(s=>s.textContent).filter(s=>!!s);return{name:o,values:i}}).forEach(({name:r,values:n})=>{!r||!n.length||t.set(r,n)}),t},bs=e=>{const t=Ne(e),r=e.querySelector(".summary-journal"),n=Array.from(r?.childNodes??[]),o=n[0]?.textContent??e.querySelector(".journal-link")?.textContent??void 0,i=n[2]?.textContent?.replace(/Published By:\s+?/i,"")??De(t.get("publisher"))??e.querySelector(".publisher-link")?.textContent??void 0;return{pub:i&&i.trim()!==""?i:void 0,jtitle:o&&o.trim()!==""?o:void 0}},td=e=>{const t=lr(e,['[data-qa="journal"]:first-child cite','[data-qa="copyright-statement"] > cite','[data-qa="collection-links"] mfe-content-details-pharos-link']);return t&&t.trim()!==""?t:void 0},$t=e=>be(e.querySelector('[data-qa="page-count"]')?.textContent),Ye=(e,t)=>e.querySelector(".publisher-link")?.textContent??De(t?.get("publisher")),we=e=>e.querySelector('[data-qa="item-title"]')?.textContent.trim()??e.querySelector("mfe-turnaway-pharos-heading")?.textContent.trim()??e.querySelector(".metadata mfe-toc-pharos-heading")?.textContent.trim()??e.querySelector(".journal_header-title")?.textContent.trim()??void 0,Re=e=>{if(!URL.canParse(e))return;const t=new URL(e);return t.origin+t.pathname},rd=e=>{const t=e.querySelector(".ccda-container > :first-child");let r,n;if(t?.textContent.includes("Volume")||t?.textContent.includes("Issue")){const o=t.textContent.trim().split(/,\s+/);for(const i of o)i.startsWith("Volume")?n=be(i):i.startsWith("Issue")&&(r=be(i))}return{issue:r,volume:n}},nd=e=>{const t=e.querySelector('[data-qa="item-src-info"]')?.textContent??p(e,"property","og:description")??p(e,"name","description");if(!t)return{};const r=/Vol\.\s*(\d+)/.exec(t),n=r?r[1]:void 0,o=/No\.\s*(\d+)/.exec(t),i=o?o[1]:void 0,s=/pp\.\s*(\d+)-(\d+)/.exec(t),a=s?s[1]:void 0,c=s?s[2]:void 0,u=/pp\.\s*\d+-\d+\s*\((\d+)\s*pages\)/.exec(t),l=u?u[1]:void 0;return{issue:i,volume:n,spage:a,epage:c,pages:l}},od=e=>{const t=lr(e,["mfe-turnaway-pharos-link",'[data-qa="item-src-info"]']);if(!t)return;const n=/\(.+\)/.exec(t)?.map(o=>{const i=/\d{4}/.exec(o);return i?i[0]:void 0});return Et(n)},sd=(e,t)=>{const r=we(e),n=Oe(e),o=Pe(e)??od(e),i=bs(e),s=i.jtitle??td(e)??void 0,a=i.pub,c=rd(e),u=nd(e),l=c.issue??u.issue,f=c.volume??u.volume,d=$t(e)??u.pages,g=u.spage,I=u.epage,v=Re(t),P=gs(Array.from(e.querySelector(".content-meta-data-stables")?.childNodes??[]).map(D=>D.textContent??""))??ed(e);return q(S.Article,{atitle:r,au:n,date:o,doi:P,epage:I,issue:l,jtitle:s,pages:d,pub:a,spage:g,uri:v,volume:f})},id=(e,t)=>{const r=Ne(e),n=Oe(e),o=Pe(e,r),i=we(e),s=Ye(e,r),a=Re(t);return ge({au:n,date:o,pub:s,title:i,uri:a})},ad=(e,t)=>{const r=Ne(e),n=Oe(e),o=we(e),i=Pe(e),s=$t(e),a=Ye(e,r),c=Re(t),u=vs(r);return V(S.Book,{au:n,date:i,doi:u,pages:s,pub:a,title:o,uri:c})},cd=(e,t)=>{const r=Ne(e),n=Oe(e),o=we(e),i=e.querySelector(".book-title-link")?.textContent??void 0,s=Pe(e,r),a=Array.from(e.querySelectorAll('[data-qa="book"] > span')).map(d=>d.textContent),c=$t(e),u=a.find(d=>d.includes("pp."))?.match(/(\d+)-(\d+)/)??void 0,l=Ye(e,r),f=Re(t);return V(S.Bookitem,{atitle:o,au:n,btitle:i,date:s,epage:u?.[2],pub:l,pages:c,spage:u?.[1],uri:f})},ud=(e,t)=>{const r=Ne(e),n=Oe(e),o=we(e),i=Pe(e),s=$t(e),a=Ye(e,r),c=Re(t),u=vs(r);return V(S.Document,{au:n,date:i,doi:u,pages:s,pub:a,title:o,uri:c})},ld=(e,t)=>{const r=Ne(e),n=Oe(e),o=Pe(e,r),i=we(e),s=Re(t);return To({au:n,date:o,title:i,uri:s})},pd=(e,t)=>{const{pub:r}=bs(e),n=we(e),o=e.querySelector(".eissn")?.textContent.replace(/EISSN\s+/,"").trim()??void 0,i=e.querySelector(".issn")?.textContent.replace(/ISSN\s+/,"").trim()??void 0,s=Re(t);return q(S.Journal,{eissn:o,issn:i,jtitle:n,pub:r,uri:s})};var ce=(e=>(e.Article="journal article",e.Audio="audio",e.Book="book",e.Chapter="book chapter",e.Document="document",e.Image="image",e.Journal="journal",e.ResearchReport="research report",e.Serial="serial",e.Video="video",e))(ce||{});const fd=(e,t)=>{const r=Ne(e),n=Oe(e),o=Pe(e,r),i=we(e),s=Ye(e,r),a=Re(t);return ge({au:n,date:o,pub:s,title:i,uri:a})},hd=e=>Object.values(ce).includes(e),dd=e=>{if(e.querySelector(".journal_header-title"))return ce.Journal;if(e.querySelector(".journal-link"))return ce.Article;const n=e.querySelector(".content-type > span")?.textContent.toLowerCase().trim()??e.querySelector(".content-meta-data-label")?.textContent.toLowerCase().trim();return hd(n)?n:null},md=(e,t)=>{switch(dd(e)){case ce.Article:case ce.Serial:return sd(e,t);case ce.Audio:return id(e,t);case ce.Book:return ad(e,t);case ce.Chapter:case ce.ResearchReport:return cd(e,t);case ce.Document:return ud(e,t);case ce.Image:return ld(e,t);case ce.Journal:return pd(e,t);case ce.Video:return fd(e,t);default:return null}},gd=({document:e,url:t})=>{const r=md(e,t);return r?E(r):L()},Ke=e=>{if(e){if(typeof e=="string")return e;if(e.length>0)return e[0]}else return},ys=e=>{if(e)return typeof e=="string"?e:Array.isArray(e)?e.length===0?void 0:Ke(e[0].name):Ke(e.name)},At=(...e)=>{const t=new Set(e.filter(r=>!!r));if(t.size!==0)return[...t]},vd=e=>{const t=ys(e.mainEntity.creator);return t?[t]:void 0},Qe=({lcn:e,title:t})=>({bibid:e,title:t}),bd=(e,t)=>{const r=At(...(e&&vd(e))??[],...t.authors??[]),n=At(...t.eissns??[]),o=At(e?.mainEntity.isbn?sr(e.mainEntity.isbn):void 0,...t.isbns??[]),i=At(...e?.mainEntity.issn??[],...t.issns??[]),[s,a]=e?.mainEntity.pagination?.split("-")??[];return{authors:r,date:t.date,doi:Ke(t.dois),edition:e?.mainEntity.edition??t.edition,epage:a,eissn:Ke(n),lcn:t.lcn??e?.identifier.value,isbn:o?.join(","),issn:Ke(i),issue:e?.mainEntity.issueNumber,jtitle:t.jtitle,publisher:t.publisher??ys(e?.mainEntity.publisher),spage:s,title:e?.name??t.title,volume:e?.mainEntity.volumeNumber}},yd=e=>q(S.Article,{...Qe(e),au:e.authors,doi:e.doi,eissn:e.eissn,epage:e.epage,issn:e.issn,issue:e.issue,jtitle:e.jtitle,pub:e.publisher,spage:e.spage,volume:e.volume}),_d=e=>ge({...Qe(e),au:e.authors,date:e.date,pub:e.publisher}),Sd=e=>V(S.Book,{...Qe(e),au:e.authors,date:e.date,doi:e.doi,edition:e.edition,epage:e.epage,isbn:e.isbn,pub:e.publisher,spage:e.spage}),Ed=e=>q(S.Journal,{...Qe(e),date:e.date,doi:e.doi,eissn:e.eissn,issn:e.issn,pub:e.publisher}),_s=k({"@type":X("Organization"),name:de([h(),U(h())])}),Ss=k({"@type":X("Person"),name:de([h(),U(h())])}),$d=Ce.extend({identifier:k({"@type":h(),propertyID:h(),value:h()}),mainEntity:k({"@type":h(),"@id":h(),creator:me(de([h(),Ss,U(Ss)])),edition:me(h()),isbn:me(h()),issn:me(U(h())),issueNumber:me(h()),pagination:me(h()),publisher:me(de([h(),_s,U(_s)])),volumeNumber:me(h())}),name:h()}),Ad=e=>{const t=vt(e);if(!t)return null;const r=Ge(t),n=$d.safeParse(r);return n.success?n.data:null},wd=e=>ge({...Qe(e),au:e.authors,date:e.date,pub:e.publisher}),Rd=/([0-9]{4}-[0-9]{1,2}-[0-9]{1,2}|[0-9]{4}-[0-9]{1,2}|[0-9]{4})/,Es=/(E?ISBN|E?ISSN|DOI)\s*:\s*/g,pr=e=>`*:has([title*="${e}" i]) + .item-details-element-container prm-highlight`,kd=e=>{if(!e)return;const t=Rd.exec(e);if(t)return t.length>1?t[1]:void 0},Id=e=>{const t=Array.from(e.querySelectorAll(pr("Identifier"))),r={};return t.map(n=>n.textContent).filter(n=>!!n).forEach(n=>{const o=[];let i;for(;(i=Es.exec(n))!==null;)o.push({id:i[1].toLowerCase(),index:i.index,start:Es.lastIndex});o.forEach(({id:s,start:a},c)=>{r[s]??=[],r[s].push(n.substring(a,o[c+1]?.index))})}),r},Cd=e=>Array.from(e.querySelectorAll(pr("Author"))).filter(t=>!!t.textContent&&t.parentElement!==null&&t.parentElement.getAttribute("aria-hidden")!=="true").map(t=>t.textContent.trim()),ke=(e,t)=>e.querySelector(pr(t))?.textContent.trim(),Od=e=>{const t=ke(e,"Creation Date"),r=ke(e,"Edition"),n=ke(e,"Publication Date"),o=ke(e,"Is Part Of"),i=ke(e,"Publisher"),s=ke(e,"Title"),a=ke(e,"MMS ID")??ke(e,"Record ID"),c=Cd(e),u=Id(e),[l]=o?.split(",")??[],f=kd(n??t),d=[...u.isbn??[],...u.eisbn??[]].map(g=>sr(g)).filter(g=>!!g);return{authors:c,date:f,dois:u.doi,edition:r,eissns:u.eissn,isbns:d,issns:u.issn,jtitle:l,lcn:a,publisher:i,title:s}};var $s=(e=>(e.Article="Article",e.Book="Book",e.Periodical="Periodical",e.Journal="Journal",e.AudioCD="Audio CD",e.CreativeWork="CreativeWork",e.Movie="Movie",e.Video="Video",e))($s||{});const Pd=e=>Object.values($s).includes(e),Nd=(e,t)=>{const r=t?.mainEntity["@type"]??e.querySelector(".media-content-type")?.textContent??void 0;if(Pd(r))return r},zd=({document:e})=>{const t=Ad(e),r=Od(e),n=bd(t,r);switch(Nd(e,t)){case"Article":return E(yd(n));case"Book":return E(Sd(n));case"Periodical":case"Journal":return E(Ed(n));case"Audio CD":case"CreativeWork":return E(_d(n));case"Movie":case"Video":return E(wd(n));default:return L()}},Td=e=>{const t=e.querySelectorAll('[id="Info"] > p'),n=Array.from(t).find(i=>i.textContent.includes("Document Type"))?.textContent,o=p(e,"name","DC.identifier");return o?.startsWith("info:doi/")||n?.includes("Article")?b.Article:o?.startsWith("urn:issn:")?b.Journal:void 0},Ld=e=>{const t=p(e,"name","DCTERMS.bibliographicCitation"),[r,n,o,i]=t?.split(",")??[];return{journalTitle:r,volume:n,issue:o,pages:i}},xd=e=>{const t=p(e,"name","DC.identifier");return(t?t.split("info:doi/"):null)?.[1]??void 0},jd=e=>e.evaluate('//*[@id="altLayoutPublisherLogo"]/p/a[1]',e,null,XPathResult.STRING_TYPE,null).stringValue,qd=e=>{const[t,r]=e?e.trim().split("-"):[void 0,void 0],n=r?.replace(/\(\d+\)/,"").trim();return{spage:t,epage:n}},Dd=e=>{const t=p(e,"name","DCTERMS.issued");if(!t)return;const n=/\d{4}/.exec(t);return n?n[0]:void 0},Zd=e=>{const t=p(e,"name","DC.title"),r=p(e,"name","DC.publisher"),n=Dd(e),o=Ld(e),i=o.journalTitle?.trim(),s=o.volume?.trim(),a=o.issue?.trim(),c=o.pages?qd(o.pages):void 0,u=c?.spage,l=c?.epage,f=Q(e,"name","DC.creator"),d=xd(e);return q(S.Article,{au:f,jtitle:i,date:n,doi:d,issue:a,pub:r,spage:u,epage:l,atitle:t,volume:s})},Bd=e=>{const t=p(e,"name","DC.title"),r=p(e,"name","DC.publisher"),n=jd(e);return q(S.Journal,{issn:n,title:t,pub:r})},Jd=({document:e})=>{switch(Td(e)){case b.Article:return E(Zd(e));case b.Journal:return E(Bd(e));default:return L()}},Ud=/^\d{4}-\d{3}[\dX]$/i,Vd=e=>Ud.test(e),As=e=>{const t=e.filter(Vd);return t.length?t:void 0},fr=e=>{const t=Q(e,"name","citation_author");return t.length?t:void 0},hr=e=>p(e,"name","citation_publication_date")?.match(/^\d{4}/)?.[0],Md=e=>p(e,"name","citation_doi"),ws=e=>{const t=Q(e,"name","citation_isbn");return t.length?t.join(","):void 0},Rs=e=>As(Q(e,"name","citation_issn")),dr=e=>p(e,"name","citation_journal_title"),mr=e=>p(e,"name","citation_publisher"),wt=e=>p(e,"name","citation_title"),Fd=e=>p(e,"name","citation_doi"),gr=e=>p(e,"name","citation_firstpage"),vr=e=>p(e,"name","citation_lastpage"),Wd=e=>p(e,"name","citation_issue"),Gd=e=>p(e,"name","citation_volume"),Xd=e=>q(S.Article,{atitle:wt(e),au:fr(e),date:hr(e),doi:Md(e),issn:Rs(e)?.[0],issue:Wd(e),jtitle:dr(e),pub:mr(e),volume:Gd(e),spage:gr(e),epage:vr(e)}),Hd=e=>V(S.Bookitem,{atitle:wt(e),au:fr(e),btitle:dr(e),date:hr(e),isbn:ws(e),pub:mr(e),spage:gr(e),epage:vr(e)}),Yd=e=>Mt({title:wt(e),au:fr(e),date:hr(e),pub:mr(e),spage:gr(e),epage:vr(e)}),ks=e=>!!e.isbn,Kd=e=>!!e.issn||e.type==="Article"&&!!e.journalTitle||!ks(e)&&!!e.journalTitle,Qd=e=>!!e.title,em=e=>{const t={type:Fd(e),isbn:ws(e),issn:Rs(e),journalTitle:dr(e),title:wt(e)};return ks(t)?Hd(e):Kd(t)?Xd(e):Qd(t)?Yd(e):null},tm=({url:e,document:t})=>{const r=em(t);return r?E({...r,uri:e}):L()},rm=k({"@content":h(),datePublished:h().optional(),mainEntity:k({type:h().optional(),name:h().optional(),author:U(k({name:h()})).optional(),publisher:k({type:h(),name:h()}).optional(),isbn:h().optional()})}),nm=e=>rm.safeParse(e).success,om=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(nm(r))return r}catch{return null}return null},sm=({document:e})=>{const t=vt(e);if(!t)return L();const r=om(t);if(!r)return L();const n=r.mainEntity.type,o=r.mainEntity.author?.map(u=>u.name),i=r.datePublished?.substring(0,4),s=r.mainEntity.name,a=r.mainEntity.isbn,c=r.mainEntity.publisher?.name;return n==="Book"?E(V(S.Book,{au:o,date:i,title:s,isbn:a,pub:c})):L()},im=Ce.extend({"@type":h().optional(),name:h().optional(),copyrightYear:Ao().optional(),author:U(k({name:h()})).optional(),publisher:U(k({name:h()})).optional()}),am=e=>im.safeParse(e).success,cm=({document:e,url:t})=>{const r=vt(e);if(!r)return L();const n=Ge(r);if(!n||!am(n))return L();const o=n["@type"],i=n.author?.map(l=>l.name),s=n.copyrightYear?.toString()??p(e,"property","og:book:release_date"),a=n.name,c=Et(n.publisher?.map(l=>l.name)),u=p(e,"property","og:book:isbn");return o==="Book"?E(V(S.Book,{au:i,date:s,title:a,isbn:u,pub:c,uri:t})):L()},um=e=>{const t=Array.from(e.querySelectorAll("a[rel=author]")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},lm=e=>{const t=Array.from(e.querySelectorAll("strong")).filter(r=>r.textContent.startsWith("ISBN")).map(r=>r.nextElementSibling?.textContent.trim());if(t.length!==0)return t[0]?.replace(/\s+/,",")},pm=({url:e,document:t})=>{const r=t.querySelector("h3.page-title")?.textContent.trim()??void 0,n=um(t),o=p(t,"property","article:published_time"),i=lm(t),s=V(S.Book,{au:n,date:o?.substring(0,4),isbn:i,pub:"Milne Open Textbooks",title:r,uri:e});return E(s)},fm=({document:e,url:t})=>{switch(hm(t)){case b.Chapter:return E(bm(e));case b.Book:return E(ym(e));case b.Article:return E(dm(e));case b.Journal:return E(mm(e));default:return L()}},hm=e=>{const{pathname:t}=new URL(e);return t.includes("/books/abs/")?b.Chapter:t.includes("/books/")?b.Book:/\/journals\/.+\/article\//.exec(t)!=null?b.Article:t.includes("/journals/")?b.Journal:b.None},dm=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_journal_title"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_volume"),i=p(e,"name","citation_issue"),s=p(e,"name","citation_firstpage"),a=p(e,"name","citation_lastpage"),c=p(e,"name","citation_publication_date")?.substring(0,4),u=p(e,"name","citation_publisher"),l=Is(e),f=As(Q(e,"name","citation_issn"));return q(S.Article,{atitle:t,au:l,jtitle:r,doi:n,volume:o,issue:i,issn:f?.[0],spage:s,epage:a,date:c,pub:u})},mm=e=>{const t=gm(e),r=vm(e),n=r.find(a=>a.type==="Print"),o=r.find(a=>a.type==="Online"),i=n?n.value:void 0,s=o?o.value:void 0;return q(S.Journal,{title:t,issn:i,eissn:s})},gm=e=>e.querySelector("h1.title")?.textContent.trim()??void 0,vm=e=>{const r=Array.from(e.querySelectorAll("span.bold")).find(i=>i.textContent.trim()==="ISSN:"),n=/^([0-9]{4}-[0-9]{3}[0-9X]) \((Print|Online)\)/,o=[];return r&&r.parentElement?.querySelectorAll("span.value")?.forEach(s=>{const a=s.textContent.trim(),c=n.exec(a);c&&o.push({value:c[1],type:c[2]})}),o},bm=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_inbook_title"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_publication_date")?.substring(0,4),i=p(e,"name","citation_publisher");return V(S.Bookitem,{atitle:t,btitle:r,doi:n,date:o,pub:i})},ym=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_doi"),n=p(e,"name","citation_isbn"),o=p(e,"name","citation_publication_date")?.substring(0,4),i=p(e,"name","citation_publisher"),s=Is(e);return V(S.Book,{title:t,au:s,doi:r,isbn:n,date:o,pub:i})},Is=e=>{const t=Q(e,"name","citation_author");return t.length?t:void 0},_m=e=>{switch(p(e,"property","og:type")){case"Article":return"Article";case"Journal":return"Journal";default:return}};function Sm(e){const t=p(e,"property","og:title"),r=p(e,"name","dc.Publisher"),n=p(e,"name","publication_doi");return E(q(S.Journal,{jtitle:t,pub:r,doi:n}))}function Em(e){const t=p(e,"name","dc.Title"),r=Q(e,"name","dc.Creator"),n=p(e,"name","dc.Date")?.substring(0,4),o=p(e,"name","publication_doi"),i=p(e,"name","citation_journal_title"),s=p(e,"name","dc.Publisher");return E(q(S.Article,{atitle:t,au:r,date:n,doi:o,jtitle:i,pub:s}))}const $m=({document:e})=>{switch(_m(e)){case"Journal":return Sm(e);case"Article":return Em(e);default:return L()}},Am=e=>{if(!e)return;const[t,r]=e.trim().split("-");return{spage:t,epage:r}},wm=e=>{const{pathname:t}=new URL(e);if(t.includes("/article/"))return b.Article},Rm=e=>{const t=p(e,"name","DC.Source"),r=p(e,"name","DC.Title"),n=Q(e,"name","DC.Creator.PersonalName"),o=p(e,"name","DC.Source.ISSN"),i=p(e,"name","citation_date")?.substring(0,4),s=p(e,"name","DC.Source.Volume"),a=p(e,"name","DC.Source.Issue"),c=p(e,"name","DC.Identifier.URI"),u=p(e,"name","DC.Identifier.pageNumber"),l=u?Am(u):void 0,f=l?.spage,d=l?.epage;return q(S.Article,{jtitle:t,atitle:r,au:n,issn:o,date:i,spage:f,epage:d,volume:s,issue:a,uri:c})},km=({document:e,url:t})=>wm(t)===b.Article?E(Rm(e)):L(),Im=e=>{switch(Cm(e)){case"eBook":return"Book";case"Reference":return"Chapter";default:return}},Cm=e=>e.querySelector("#vol-contentType a")?.textContent??void 0;function Om(e,t){const r=Cs(e),n=br(e),o=Ps(e),i=Ns(e),s=zs(e),a=Ts(e),c=br(e),u=t,{startPage:l,endPage:f}=Ls(e)??{};return E(V(S.Book,{au:r,btitle:n,date:o,doi:i,epage:f,isbn:s,pub:a,spage:l,title:c,uri:u}))}function Pm(e,t){const r=Cs(e),n=Os(e),o=br(e),i=Ps(e),s=Ns(e),a=zs(e),c=Ts(e),u=Os(e),l=t,{startPage:f,endPage:d}=Ls(e)??{};return E(V(S.Book,{au:r,atitle:n,btitle:o,date:i,doi:s,epage:d,isbn:a,pub:c,spage:f,title:u,uri:l}))}const Cs=e=>{const t=e.querySelectorAll("div#article_author p.author-bio b"),r=Array.from(t).map(n=>n.textContent).filter(n=>!!n).map(n=>n.trim());return r.length>0?r:void 0},Ze=(e,t)=>e.querySelector(`input#${t}`)?.getAttribute("value")??void 0,Nm=e=>p(e,"property","og:title"),br=e=>Ze(e,"titlevalue")??Nm(e),Os=e=>Ze(e,"chapter-title-squid"),Ps=e=>Ze(e,"pubdate-squid"),Ns=e=>Ze(e,"doi-squid"),zs=e=>Ze(e,"isbn-squid"),Ts=e=>Ze(e,"pubname-squid"),Ls=e=>{const t=e.querySelector("#pageRange")?.textContent??void 0;if(!t)return;const n=/(\d+)–(\d+)/.exec(t);if(n)return{startPage:n[1],endPage:n[2]}},zm=({document:e,url:t})=>{switch(Im(e)){case"Book":return Om(e,t);case"Chapter":return Pm(e,t);default:return L()}},Tm=(e,t)=>e.evaluate(`//*[@class="singleRecord_view_label"][contains(text(), "${t}")]/following-sibling::*[@class="singleRecord_view_data"]`,e,null,XPathResult.STRING_TYPE).stringValue.toLowerCase().trim(),Lm=e=>{switch(Tm(e,"Medium")){case"book":case"e-book":return S.Book;case"e-journal":return S.Journal;default:return S.Unknown}},xm=e=>{delete e.rft_id},jm=e=>{const t=rr(e);if(bt(t)){const r=Lm(e.document);t.resource.genre=r,xm(t.resource)}return t},qm=e=>{const t=p(e,"name","type")?.toLowerCase(),r=p(e,"name","og:type")?.toLowerCase(),n=p(e,"name","citation_article_type")?.toLowerCase();if(t==="article"||n==="article"||r==="article")return b.Article;const o=p(e,"name","twitter:title")?.trim(),i=p(e,"name","description")?.trim();if(o||i)return b.Webpage},Dm=e=>{const t=p(e,"name","DC.Title"),r=p(e,"name","DC.Publisher"),n=p(e,"name","DC.Date"),o=p(e,"name","DC.Identifier"),i=p(e,"name","citation_journal_title"),s=p(e,"name","citation_volume"),a=p(e,"name","citation_issn"),c=Q(e,"name","citation_author");return q(S.Article,{au:c,jtitle:i,date:n,doi:o,issn:a,pub:r,title:t,volume:s})},Zm=(e,t)=>{const r=p(t,"name","twitter:title");return dt({uri:e,title:r})},Bm=({url:e,document:t})=>{switch(qm(t)){case b.Article:return E(Dm(t));case b.Webpage:return E(Zm(e,t))}return L()},Jm=({document:e})=>Array.from(e.querySelectorAll(".availability.documentSummaryAvailability.availabilityContent")).length===0?L():Xo(),Um=/([0-9]{4})\s+at/;function Vm(e){if(!e)return;const t=Um.exec(e);if(t&&t.length>1)return t[1]}function xs(e,t){const r=e.getElementsByClassName(t);if(r.length!==0)return r[0].textContent}function Mm(e){const t={};return Array.from(e.getElementsByTagName("li")).reduce((r,n)=>{const o=xs(n,"title"),i=xs(n,"content");return o&&i&&(r[o]=i),r},t)}function Fm(e){const t=e.getElementsByClassName("information");if(t.length===0)return{};const r=Mm(t[0]),n=Vm(r.Published),o=r.Show;return{date:n,series:o}}const Wm=({url:e,document:t})=>{if(!new URL(e).searchParams.has("i"))return L();const n=S.AudioDocument,o=p(t,"property","og:site_name"),i=p(t,"property","og:title"),s=Fm(t);return E({genre:n,pub:o,title:i,uri:e,...s})},Gm=e=>{const t=p(e,"name","citation_date");return t?t.split("/").find(o=>/^\d{4}/.test(o))??void 0:void 0},Xm=e=>{const t=e.querySelector("#arxiv-doi-link")?.textContent;return t?t.replace("https://doi.org/","").trim():void 0},Hm=({document:e})=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_pdf_url"),n=Q(e,"name","citation_author"),o=Gm(e),i=Xm(e);return!t&&n.length===0&&!o&&!i?L():E(q(S.Article,{au:n,date:o,doi:i,title:t,uri:r}))},Ym=e=>{const t=He(e,"div.director-section div.term-info-section-items");if(!t)return;const r=t.split(",").map(n=>n.replace(/\s+/g," ").trim()).filter(n=>n.length>0);return r.length>0?r:void 0},Km=e=>{const t=new Map;return Array.from(e.querySelectorAll(".info-section-container")).forEach(r=>{const n=r.querySelector(".info-section-header .info-section-title")?.textContent.trim().toLowerCase();if(!n)return;const o=Array.from(r.querySelectorAll(".term-info-section-item")).map(i=>i.textContent.replace(",","").trim()).filter(i=>!!i);o.length&&t.set(n,o)}),t},Qm=({url:e,document:t})=>{const r=Km(t),n=Ym(t)??r.get("director"),o=He(t,"div.product-release-year"),i=He(t,"div.studio-section div.term-info-section-item")??De(r.get("supplier")),s=He(t,".product-title")??He(t,".movie-title"),a=ge({au:n,date:o,pub:i,title:s,uri:e});return E(a)},eg=e=>{if(p(e,"property","og:type")==="article")return b.Article};function tg(e){const t={},r=e.querySelector("[data-id=layout-form]");return r&&Array.from(r.getElementsByTagName("h2")).forEach(o=>{const i=o.textContent.toLowerCase(),a=Array.from(o.parentElement?.getElementsByTagName("span")??[]).map(c=>c.textContent||"");i&&(t[i]=a[0])}),t}function rg(e,t,r){return r.includes("publisher")?t.publisher:r.includes("place of publication, exhibition, or creation")?t["place of publication, exhibition, or creation"]:p(e,"name","DC.publisher")}function ng(e){const t=p(e,"name","citation_publication_date");return t?t.substring(0,4):p(e,"name","citation_online_date")?.substring(0,4)}const og=e=>{const t=tg(e),r=p(e,"name","DataCite.title"),n=Q(e,"name","DataCite.contributor"),o=ng(e),i=p(e,"name","DC.identifier.DOI"),s=Object.keys(t),a=rg(e,t,s),c=s.includes("journal")?t.journal:void 0,u=s.includes("volume")?t.volume:void 0,l=s.includes("issue")?t.issue:void 0,f=s.includes("issn")?t.issn:void 0,d=s.includes("electronic location (url)")?t["electronic location (url)"]:void 0;return q(S.Article,{jtitle:c,atitle:r,pub:a,au:n,date:o,doi:i,volume:u,issue:l,issn:f,uri:d})},sg=({document:e})=>eg(e)===b.Article?E(og(e)):L(),ig=e=>{const t=ue(e,"resource type");return t?t==="Other Journal Article"||t==="Journal Article"||t==="Journal Item"||t==="Book Review"?b.Article:t==="Book Chapter"||t==="Book Part"||t==="Conference Abstract"||t==="Book ChapterConference Paper"||t==="Conference Paper"||t==="Other Book Part"?b.Document:b.None:b.None},ag=e=>e.replace(":","").replace(" | ","").trim().toLowerCase(),cg=e=>{const t=new Map,r=e.querySelector("ul.rlist.publication-details__list");return r&&Array.from(r.querySelectorAll("li")).forEach(n=>{const o=Array.from(n.querySelectorAll("span.label")),i=Array.from(n.querySelectorAll("span.info"));o.forEach((s,a)=>{const c=ag(s.textContent),u=i[a]?.textContent?.trim();c&&u&&(t.has(c)||t.set(c,[]),t.get(c)?.push(u))})}),t},ue=(e,t)=>{const r=e.get(t);if(r)return Et(r)},ug=e=>Q(e,"name","dc.Creator").map(t=>t.trim()),lg=e=>{const t=Xh(e,[".loa-accordion a.author-name"]);return t?t.map(n=>n.replace("Authors:","").trim()):void 0},yr=e=>{const t=ug(e);return t.length>0?t:lg(e)},_r=e=>p(e,"name","dc.Title")??p(e,"property","og:title"),Sr=e=>p(e,"name","publication_doi"),Er=(e,t)=>ue(t,"date of publication")??p(e,"name","dc.Date"),js=e=>{const t=ue(e,"page range");let r,n;return t?.includes("-")&&(r=t?t.split("-")[0].trim():void 0,n=t?t.split("-")[1].trim():void 0),{pages:t,spage:r,epage:n}},pg=(e,t,r)=>{const n=_r(e),o=ue(t,"journal"),i=p(e,"name","citation_journal_title"),s=o??i,a=Sr(e),c=Er(e,t),u=ue(t,"publisher"),l=yr(e),f=ue(t,"volume"),d=ue(t,"issue"),g=js(t),I=ue(t,"issn (print)"),v=ue(t,"issn (electronic)");return q(S.Article,{title:n,jtitle:s,doi:a,date:c,pub:u,au:l,volume:f,issue:d,pages:g.pages,spage:g.spage,epage:g.epage,issn:I,eissn:v,uri:r})},fg=(e,t,r)=>{const n=_r(e),o=ue(t,"book title"),i=Sr(e),s=Er(e,t),a=ue(t,"publisher"),c=yr(e),u=js(t),l=ue(t,"isbn (print)");return V(S.Conference,{title:n,btitle:o,doi:i,date:s,pub:a,au:c,pages:u.pages,spage:u.spage,epage:u.epage,isbn:l,uri:r})},hg=(e,t,r)=>{const n=_r(e),o=Sr(e),i=Er(e,t),s=ue(t,"publisher"),a=yr(e),c=ue(t,"isbn (print)");return V(S.Document,{title:n,doi:o,date:i,pub:s,au:a,uri:r,isbn:c})},dg=({url:e,document:t})=>{const r=cg(t);switch(ig(r)){case b.Article:return E(pg(t,r,e));case b.Document:return E(fg(t,r,e));case b.None:return E(hg(t,r,e));default:return L()}},Be=e=>p(e,"property","og:title")?.trim()??void 0,qs=e=>p(e,"name","dc.identifier")??p(e,"name","citation_doi"),mg=e=>{const t=Be(e),r=t,n=Sg(e),o=_g(e),i=bg(e),s=yg(e),{issn:a,eissn:c}=vg(e);return E(q(S.Journal,{date:n,eissn:c,issn:a,issue:o,jtitle:r,pub:i,title:t,volume:s}))},gg=e=>e.includes("/journals/")&&e.includes("issue"),vg=e=>{const t=e.querySelector("dd.printissn.text-metadata-value > span")?.textContent.trim(),r=e.querySelector("dd.onlineissn.text-metadata-value > span")?.textContent.trim();return{issn:t,eissn:r}},bg=e=>e.querySelector("dd.publisher.text-metadata-value span")?.textContent.trim()??void 0,yg=e=>Be(e)?.match(/Volume\s+(\d+)/i)?.[1],_g=e=>Be(e)?.match(/Issue\s+(\d+)/i)?.[1],Sg=e=>Be(e)?.match(/\((\d{4})\)/)?.[1],Eg=e=>{const t=Be(e),r=p(e,"name","citation_title")??t,n=Q(e,"property","article:author"),o=$g(e),i=qs(e),s=p(e,"name","citation_lastpage"),a=p(e,"name","citation_issn"),c=p(e,"name","citation_issue"),u=p(e,"name","citation_journal_title"),l=p(e,"name","citation_publisher"),f=p(e,"name","citation_firstpage"),d=p(e,"name","citation_volume");return E(q(S.Article,{atitle:r,au:n,date:o,doi:i,epage:s,issn:a,issue:c,jtitle:u,pub:l,spage:f,title:t,volume:d}))},$g=e=>p(e,"property","article:published_time")??p(e,"name","citation_publication_date"),Ag=e=>{const t=Be(e),r=p(e,"name","citation_title")??t,n=wg(e),o=kg(e),i=qs(e),s=Ig(e),a=p(e,"name","citation_publisher");return E(V(S.Book,{au:n,btitle:r,date:o,doi:i,isbn:s,pub:a,title:t}))},wg=e=>{const t=Q(e,"property","book:author");if(t.length>0)return t;const r=Q(e,"name","citation_author");return r.length>0?r:Rg(e)},Rg=e=>Array.from(e.querySelectorAll('.contributor-details span[data-testid="author-name"]')).map(r=>(r.textContent||"").trim()).filter(r=>r.length>0),kg=e=>p(e,"property","book:release_date")??p(e,"name","citation_publication_date"),Ig=e=>p(e,"property","book:isbn")??p(e,"name","citation_isbn"),Cg=(e,t)=>{switch(p(e,"property","og:type")){case"article":return b.Article;case"book":return b.Book}return gg(t)?b.Journal:b.None},Og=({document:e,url:t})=>{switch(Cg(e,t)){case b.Article:return Eg(e);case b.Journal:return mg(e);case b.Book:return Ag(e);default:return L()}};var z=(e=>(e.NoResourceFound="NoResourceFound",e.Z3988="Z3988",e.Z3988SearchResult="Z3988SearchResult",e.Amazon="Amazon",e.CupOfJo="CupOfJo",e.IngentaConnect="IngentaConnect",e.Jstor="Jstor",e.Milne="Milne",e.Primo="Primo",e.SagePub="SagePub",e.SageVideo="SageVideo",e.ScienceDirect="ScienceDirect",e.Springer="Springer",e.Youtube="Youtube",e.TaylorFrancis="TaylorFrancis",e.Wiley="Wiley",e.VuFind="VuFind",e.ClinicalKey="ClinicalKey",e.DOAJ="DOAJ",e.Ebscohost="Ebscohost",e.OpenStax="OpenStax",e.CambridgeJournalsOnline="CambridgeJournalsOnline",e.OpenTextbook="OpenTextbook",e.AhaJournals="AhaJournals",e.Ijees="Ijees",e.BloomsburyCollections="BloomsburyCollections",e.HeritageCirqa="HeritageCirqa",e.BritishMedicalJournal="BritishMedicalJournal",e.SummonSearchResult="SummonSearchResult",e.ApplePodcasts="ApplePodcasts",e.Arxiv="Arxiv",e.KanopyVideo="KanopyVideo",e.LaTrobeOpal="LaTrobeOpal",e.BYUScholarsArchive="BYUScholarsArchive",e.Informit="Informit",e.Brill="Brill",e))(z||{});const $r={NoResourceFound:os,Z3988:rr,Z3988SearchResult:Gh,Amazon:Vp,CupOfJo:$f,Jstor:gd,Youtube:fh,SagePub:qf,SageVideo:Wh,ScienceDirect:Wf,Springer:Oh,TaylorFrancis:eh,Wiley:Mh,VuFind:ch,ClinicalKey:df,DOAJ:If,Primo:zd,IngentaConnect:Jd,Ebscohost:tm,OpenStax:sm,OpenTextbook:cm,Milne:pm,CambridgeJournalsOnline:fm,AhaJournals:$m,Ijees:km,BloomsburyCollections:zm,HeritageCirqa:jm,BritishMedicalJournal:Bm,SummonSearchResult:Jm,ApplePodcasts:Wm,Arxiv:Hm,KanopyVideo:Qm,LaTrobeOpal:sg,BYUScholarsArchive:ef,Informit:dg,Brill:Og},Pg="5.34.0",Ar=()=>Pg,Ng=["com.au","com","ca","co.uk","de","fr","nl"].flatMap(e=>[`amazon.${e}`,`www.amazon.${e}`]),zg={version:Ar(),siteRegistrations:[{matcher:{regexp:"^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/search"},name:"Worldcat Search Results",parsers:[z.Z3988SearchResult]},{matcher:{regexp:"^https://[a-z0-9\\-]+\\.summon\\.serialssolutions\\.com/"},name:"Summon Search Results",parsers:[z.SummonSearchResult]},{matcher:{regexp:"cupofjo[.-]com"},name:"Cup of Jo",parsers:[z.CupOfJo]},{matcher:{hostnames:["youtube.com","www.youtube.com"]},name:"Youtube",parsers:[z.Youtube]},{matcher:{regexp:"www[-.]sciencedirect[.-]com"},name:"Science Direct",parsers:[z.ScienceDirect]},{matcher:{hostnames:Ng},name:"Amazon",parsers:[z.Amazon]},{matcher:{regexp:"^https://sk\\.sagepub\\.com/video/"},name:"Sage Video",parsers:[z.SageVideo]},{matcher:{regexp:"[/.-]((www|journals)[.-])?sagepub[.-]com"},name:"Sage Publishing",parsers:[z.SagePub]},{matcher:{regexp:"www[.-]tandfonline[.-]com"},name:"Taylor & Francis",parsers:[z.TaylorFrancis]},{matcher:{regexp:"[/.-]((www|onlinelibrary)[.-])?wiley[.-]com"},name:"Wiley",parsers:[z.Wiley]},{matcher:{regexp:"^https://[a-z0-9\\-]+[.-]on[.-]worldcat[.-]org"},name:"Worldcat",parsers:[z.Z3988]},{matcher:{hostnames:["catalogue.rau.ac.uk"]},name:"Royal Agricultural University Library",parsers:[z.Z3988]},{matcher:{regexp:"link[.-]springer[.-]com"},name:"Springer",parsers:[z.Springer]},{matcher:{regexp:"^https://vufind\\.lboro\\.ac\\.uk/(Record|PrimoRecord)"},name:"VuFind",parsers:[z.VuFind]},{matcher:{regexp:"www[.-]clinicalkey[.-]com"},name:"ClinicalKey",parsers:[z.ClinicalKey]},{matcher:{regexp:"www[.-]jstor[.-]org"},name:"JSTOR",parsers:[z.Jstor]},{matcher:{regexp:"doaj[.-]org"},name:"DOAJ",parsers:[z.DOAJ]},{matcher:{regexp:"[/.-]ingentaconnect[.-]com"},name:"IngentaConnect",parsers:[z.IngentaConnect]},{matcher:{regexp:"research[.-]ebsco[.-]com"},name:"EBSCOHost",parsers:[z.Ebscohost]},{matcher:{regexp:"openstax[-.]org"},name:"OpenStax",parsers:[z.OpenStax]},{matcher:{regexp:"open[.-]umn[.-]edu"},name:"OpenTextbook",parsers:[z.OpenTextbook]},{matcher:{regexp:"milneopentextbooks[-.]org"},name:"Milne Open Textbooks",parsers:[z.Milne]},{matcher:{regexp:"www[.-]perlego[.-]com"},name:"Perlego",parsers:[z.Z3988]},{matcher:{regexp:"www[.-]ahajournals[.-]org"},name:"AHA Journals",parsers:[z.AhaJournals]},{matcher:{regexp:"www[.-]cambridge[.-]org"},name:"Cambridge Journals Online",parsers:[z.CambridgeJournalsOnline]},{matcher:{regexp:"www[.-]nieindia[.-]org"},name:"International Journal of Ecology and Environmental Sciences",parsers:[z.Ijees]},{matcher:{regexp:"www[.-]bloomsburycollections[.-]com"},name:"Bloomsbury Collections",parsers:[z.BloomsburyCollections]},{matcher:{regexp:"cirqahosting[.-]com"},name:"Heritage Cirqa",parsers:[z.HeritageCirqa]},{matcher:{regexp:"www[.-]bmj[.-]com"},name:"British Medical Journal",parsers:[z.BritishMedicalJournal]},{matcher:{regexp:"podcasts[.-]apple[.-]com"},name:"Apple Podcasts",parsers:[z.ApplePodcasts]},{matcher:{regexp:"arxiv[.-]org"},name:"arxiv",parsers:[z.Arxiv]},{matcher:{regexp:"kanopy[.-]com"},name:"Kanopy Video",parsers:[z.KanopyVideo]},{matcher:{regexp:"opal[.-]latrobe[.-]edu[.-]au"},name:"La Trobe Opal",parsers:[z.LaTrobeOpal]},{matcher:{hostnames:["scholarsarchive.byu.edu"]},name:"BYU Scholars Archive",parsers:[z.BYUScholarsArchive]},{matcher:{regexp:"informit[.-]org"},name:"Informit",parsers:[z.Informit]},{matcher:{regexp:"brill[.-]com"},name:"Brill",parsers:[z.Brill]},{matcher:{regexp:"/(discovery|primo-explore)/fulldisplay"},name:"Primo",parsers:[z.Primo]}]},wr=k({hostnames:U(h()).min(1)}),Rr=k({regexp:h()}),kr=de([wr,Rr]),Ir=k({matcher:kr,name:h(),parsers:U(h()),libraryVersionRange:h().optional()}),Ds=k({siteRegistrations:U(Ir),version:h()}),Tg=e=>Ds.safeParse(e).success,Lg=e=>Ir.safeParse(e).success,xg=e=>kr.safeParse(e).success,Zs=e=>Object.values(z).includes(e),jg=e=>typeof e=="object"&&e!==null,Bs=k({url:h(),document:dp(jg)}),qg=e=>Bs.safeParse(e).success;var Rt={exports:{}},Cr,Js;function kt(){if(Js)return Cr;Js=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return Cr={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Cr}var Or,Us;function It(){return Us||(Us=1,Or=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Or}var Vs;function et(){return Vs||(Vs=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=kt(),i=It();t=e.exports={};const s=t.re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let f=0;const d="[a-zA-Z0-9-]",g=[["\\s",1],["\\d",o],[d,n]],I=P=>{for(const[D,re]of g)P=P.split(`${D}*`).join(`${D}{0,${re}}`).split(`${D}+`).join(`${D}{1,${re}}`);return P},v=(P,D,re)=>{const x=I(D),Z=f++;i(P,Z,D),l[P]=Z,c[Z]=D,u[Z]=x,s[Z]=new RegExp(D,re?"g":void 0),a[Z]=new RegExp(x,re?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),v("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${d}+`),v("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),v("FULL",`^${c[l.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),v("LOOSE",`^${c[l.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),v("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),v("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),v("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),v("COERCERTL",c[l.COERCE],!0),v("COERCERTLFULL",c[l.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",v("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",v("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Rt,Rt.exports)),Rt.exports}var Pr,Ms;function Nr(){if(Ms)return Pr;Ms=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Pr=n=>n?typeof n!="object"?e:n:t,Pr}var zr,Fs;function Ws(){if(Fs)return zr;Fs=1;const e=/^[0-9]+$/,t=(n,o)=>{if(typeof n=="number"&&typeof o=="number")return n===o?0:n<o?-1:1;const i=e.test(n),s=e.test(o);return i&&s&&(n=+n,o=+o),n===o?0:i&&!s?-1:s&&!i?1:n<o?-1:1};return zr={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},zr}var Tr,Gs;function se(){if(Gs)return Tr;Gs=1;const e=It(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=kt(),{safeRe:n,t:o}=et(),i=Nr(),{compareIdentifiers:s}=Ws();class a{constructor(u,l){if(l=i(l),u instanceof a){if(u.loose===!!l.loose&&u.includePrerelease===!!l.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const f=u.trim().match(l.loose?n[o.LOOSE]:n[o.FULL]);if(!f)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const g=+d;if(g>=0&&g<r)return g}return d}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof a)){if(typeof u=="string"&&u===this.version)return 0;u=new a(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof a||(u=new a(u,this.options)),this.major<u.major?-1:this.major>u.major?1:this.minor<u.minor?-1:this.minor>u.minor?1:this.patch<u.patch?-1:this.patch>u.patch?1:0}comparePre(u){if(u instanceof a||(u=new a(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let l=0;do{const f=this.prerelease[l],d=u.prerelease[l];if(e("prerelease compare",l,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++l)}compareBuild(u){u instanceof a||(u=new a(u,this.options));let l=0;do{const f=this.build[l],d=u.build[l];if(e("build compare",l,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++l)}inc(u,l,f){if(u.startsWith("pre")){if(!l&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const d=`-${l}`.match(this.options.loose?n[o.PRERELEASELOOSE]:n[o.PRERELEASE]);if(!d||d[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",l,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,f),this.inc("pre",l,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,f),this.inc("pre",l,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const d=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[d];else{let g=this.prerelease.length;for(;--g>=0;)typeof this.prerelease[g]=="number"&&(this.prerelease[g]++,g=-2);if(g===-1){if(l===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(l){let g=[l,d];f===!1&&(g=[l]),s(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=g):this.prerelease=g}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Tr=a,Tr}var Lr,Xs;function Je(){if(Xs)return Lr;Xs=1;const e=se();return Lr=(r,n,o=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(i){if(!o)return null;throw i}},Lr}var xr,Hs;function Dg(){if(Hs)return xr;Hs=1;const e=Je();return xr=(r,n)=>{const o=e(r,n);return o?o.version:null},xr}var jr,Ys;function Zg(){if(Ys)return jr;Ys=1;const e=Je();return jr=(r,n)=>{const o=e(r.trim().replace(/^[=v]+/,""),n);return o?o.version:null},jr}var qr,Ks;function Bg(){if(Ks)return qr;Ks=1;const e=se();return qr=(r,n,o,i,s)=>{typeof o=="string"&&(s=i,i=o,o=void 0);try{return new e(r instanceof e?r.version:r,o).inc(n,i,s).version}catch{return null}},qr}var Dr,Qs;function Jg(){if(Qs)return Dr;Qs=1;const e=Je();return Dr=(r,n)=>{const o=e(r,null,!0),i=e(n,null,!0),s=o.compare(i);if(s===0)return null;const a=s>0,c=a?o:i,u=a?i:o,l=!!c.prerelease.length;if(!!u.prerelease.length&&!l){if(!u.patch&&!u.minor)return"major";if(u.compareMain(c)===0)return u.minor&&!u.patch?"minor":"patch"}const d=l?"pre":"";return o.major!==i.major?d+"major":o.minor!==i.minor?d+"minor":o.patch!==i.patch?d+"patch":"prerelease"},Dr}var Zr,ei;function Ug(){if(ei)return Zr;ei=1;const e=se();return Zr=(r,n)=>new e(r,n).major,Zr}var Br,ti;function Vg(){if(ti)return Br;ti=1;const e=se();return Br=(r,n)=>new e(r,n).minor,Br}var Jr,ri;function Mg(){if(ri)return Jr;ri=1;const e=se();return Jr=(r,n)=>new e(r,n).patch,Jr}var Ur,ni;function Fg(){if(ni)return Ur;ni=1;const e=Je();return Ur=(r,n)=>{const o=e(r,n);return o&&o.prerelease.length?o.prerelease:null},Ur}var Vr,oi;function fe(){if(oi)return Vr;oi=1;const e=se();return Vr=(r,n,o)=>new e(r,o).compare(new e(n,o)),Vr}var Mr,si;function Wg(){if(si)return Mr;si=1;const e=fe();return Mr=(r,n,o)=>e(n,r,o),Mr}var Fr,ii;function Gg(){if(ii)return Fr;ii=1;const e=fe();return Fr=(r,n)=>e(r,n,!0),Fr}var Wr,ai;function Gr(){if(ai)return Wr;ai=1;const e=se();return Wr=(r,n,o)=>{const i=new e(r,o),s=new e(n,o);return i.compare(s)||i.compareBuild(s)},Wr}var Xr,ci;function Xg(){if(ci)return Xr;ci=1;const e=Gr();return Xr=(r,n)=>r.sort((o,i)=>e(o,i,n)),Xr}var Hr,ui;function Hg(){if(ui)return Hr;ui=1;const e=Gr();return Hr=(r,n)=>r.sort((o,i)=>e(i,o,n)),Hr}var Yr,li;function Ct(){if(li)return Yr;li=1;const e=fe();return Yr=(r,n,o)=>e(r,n,o)>0,Yr}var Kr,pi;function Qr(){if(pi)return Kr;pi=1;const e=fe();return Kr=(r,n,o)=>e(r,n,o)<0,Kr}var en,fi;function hi(){if(fi)return en;fi=1;const e=fe();return en=(r,n,o)=>e(r,n,o)===0,en}var tn,di;function mi(){if(di)return tn;di=1;const e=fe();return tn=(r,n,o)=>e(r,n,o)!==0,tn}var rn,gi;function nn(){if(gi)return rn;gi=1;const e=fe();return rn=(r,n,o)=>e(r,n,o)>=0,rn}var on,vi;function sn(){if(vi)return on;vi=1;const e=fe();return on=(r,n,o)=>e(r,n,o)<=0,on}var an,bi;function yi(){if(bi)return an;bi=1;const e=hi(),t=mi(),r=Ct(),n=nn(),o=Qr(),i=sn();return an=(a,c,u,l)=>{switch(c){case"===":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a===u;case"!==":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a!==u;case"":case"=":case"==":return e(a,u,l);case"!=":return t(a,u,l);case">":return r(a,u,l);case">=":return n(a,u,l);case"<":return o(a,u,l);case"<=":return i(a,u,l);default:throw new TypeError(`Invalid operator: ${c}`)}},an}var cn,_i;function Yg(){if(_i)return cn;_i=1;const e=se(),t=Je(),{safeRe:r,t:n}=et();return cn=(i,s)=>{if(i instanceof e)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;s=s||{};let a=null;if(!s.rtl)a=i.match(s.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const g=s.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let I;for(;(I=g.exec(i))&&(!a||a.index+a[0].length!==i.length);)(!a||I.index+I[0].length!==a.index+a[0].length)&&(a=I),g.lastIndex=I.index+I[1].length+I[2].length;g.lastIndex=-1}if(a===null)return null;const c=a[2],u=a[3]||"0",l=a[4]||"0",f=s.includePrerelease&&a[5]?`-${a[5]}`:"",d=s.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${c}.${u}.${l}${f}${d}`,s)},cn}var un,Si;function Kg(){if(Si)return un;Si=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(r,n)}return this}}return un=e,un}var ln,Ei;function he(){if(Ei)return ln;Ei=1;const e=/\s+/g;class t{constructor(_,C){if(C=o(C),_ instanceof t)return _.loose===!!C.loose&&_.includePrerelease===!!C.includePrerelease?_:new t(_.raw,C);if(_ instanceof i)return this.raw=_.value,this.set=[[_]],this.formatted=void 0,this;if(this.options=C,this.loose=!!C.loose,this.includePrerelease=!!C.includePrerelease,this.raw=_.trim().replace(e," "),this.set=this.raw.split("||").map(w=>this.parseRange(w.trim())).filter(w=>w.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const w=this.set[0];if(this.set=this.set.filter(O=>!v(O[0])),this.set.length===0)this.set=[w];else if(this.set.length>1){for(const O of this.set)if(O.length===1&&P(O[0])){this.set=[O];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let _=0;_<this.set.length;_++){_>0&&(this.formatted+="||");const C=this.set[_];for(let w=0;w<C.length;w++)w>0&&(this.formatted+=" "),this.formatted+=C[w].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(_){const w=((this.options.includePrerelease&&g)|(this.options.loose&&I))+":"+_,O=n.get(w);if(O)return O;const R=this.options.loose,N=R?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];_=_.replace(N,In(this.options.includePrerelease)),s("hyphen replace",_),_=_.replace(c[u.COMPARATORTRIM],l),s("comparator trim",_),_=_.replace(c[u.TILDETRIM],f),s("tilde trim",_),_=_.replace(c[u.CARETTRIM],d),s("caret trim",_);let B=_.split(" ").map(ne=>re(ne,this.options)).join(" ").split(/\s+/).map(ne=>kn(ne,this.options));R&&(B=B.filter(ne=>(s("loose invalid filter",ne,this.options),!!ne.match(c[u.COMPARATORLOOSE])))),s("range list",B);const j=new Map,W=B.map(ne=>new i(ne,this.options));for(const ne of W){if(v(ne))return[ne];j.set(ne.value,ne)}j.size>1&&j.has("")&&j.delete("");const ie=[...j.values()];return n.set(w,ie),ie}intersects(_,C){if(!(_ instanceof t))throw new TypeError("a Range is required");return this.set.some(w=>D(w,C)&&_.set.some(O=>D(O,C)&&w.every(R=>O.every(N=>R.intersects(N,C)))))}test(_){if(!_)return!1;if(typeof _=="string")try{_=new a(_,this.options)}catch{return!1}for(let C=0;C<this.set.length;C++)if(Cn(this.set[C],_,this.options))return!0;return!1}}ln=t;const r=Kg(),n=new r,o=Nr(),i=Ot(),s=It(),a=se(),{safeRe:c,t:u,comparatorTrimReplace:l,tildeTrimReplace:f,caretTrimReplace:d}=et(),{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:I}=kt(),v=$=>$.value==="<0.0.0-0",P=$=>$.value==="",D=($,_)=>{let C=!0;const w=$.slice();let O=w.pop();for(;C&&w.length;)C=w.every(R=>O.intersects(R,_)),O=w.pop();return C},re=($,_)=>($=$.replace(c[u.BUILD],""),s("comp",$,_),$=F($,_),s("caret",$),$=Z($,_),s("tildes",$),$=T($,_),s("xrange",$),$=Rn($,_),s("stars",$),$),x=$=>!$||$.toLowerCase()==="x"||$==="*",Z=($,_)=>$.trim().split(/\s+/).map(C=>M(C,_)).join(" "),M=($,_)=>{const C=_.loose?c[u.TILDELOOSE]:c[u.TILDE];return $.replace(C,(w,O,R,N,B)=>{s("tilde",$,w,O,R,N,B);let j;return x(O)?j="":x(R)?j=`>=${O}.0.0 <${+O+1}.0.0-0`:x(N)?j=`>=${O}.${R}.0 <${O}.${+R+1}.0-0`:B?(s("replaceTilde pr",B),j=`>=${O}.${R}.${N}-${B} <${O}.${+R+1}.0-0`):j=`>=${O}.${R}.${N} <${O}.${+R+1}.0-0`,s("tilde return",j),j})},F=($,_)=>$.trim().split(/\s+/).map(C=>ee(C,_)).join(" "),ee=($,_)=>{s("caret",$,_);const C=_.loose?c[u.CARETLOOSE]:c[u.CARET],w=_.includePrerelease?"-0":"";return $.replace(C,(O,R,N,B,j)=>{s("caret",$,O,R,N,B,j);let W;return x(R)?W="":x(N)?W=`>=${R}.0.0${w} <${+R+1}.0.0-0`:x(B)?R==="0"?W=`>=${R}.${N}.0${w} <${R}.${+N+1}.0-0`:W=`>=${R}.${N}.0${w} <${+R+1}.0.0-0`:j?(s("replaceCaret pr",j),R==="0"?N==="0"?W=`>=${R}.${N}.${B}-${j} <${R}.${N}.${+B+1}-0`:W=`>=${R}.${N}.${B}-${j} <${R}.${+N+1}.0-0`:W=`>=${R}.${N}.${B}-${j} <${+R+1}.0.0-0`):(s("no pr"),R==="0"?N==="0"?W=`>=${R}.${N}.${B}${w} <${R}.${N}.${+B+1}-0`:W=`>=${R}.${N}.${B}${w} <${R}.${+N+1}.0-0`:W=`>=${R}.${N}.${B} <${+R+1}.0.0-0`),s("caret return",W),W})},T=($,_)=>(s("replaceXRanges",$,_),$.split(/\s+/).map(C=>tt(C,_)).join(" ")),tt=($,_)=>{$=$.trim();const C=_.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return $.replace(C,(w,O,R,N,B,j)=>{s("xRange",$,w,O,R,N,B,j);const W=x(R),ie=W||x(N),ne=ie||x(B),rt=ne;return O==="="&&rt&&(O=""),j=_.includePrerelease?"-0":"",W?O===">"||O==="<"?w="<0.0.0-0":w="*":O&&rt?(ie&&(N=0),B=0,O===">"?(O=">=",ie?(R=+R+1,N=0,B=0):(N=+N+1,B=0)):O==="<="&&(O="<",ie?R=+R+1:N=+N+1),O==="<"&&(j="-0"),w=`${O+R}.${N}.${B}${j}`):ie?w=`>=${R}.0.0${j} <${+R+1}.0.0-0`:ne&&(w=`>=${R}.${N}.0${j} <${R}.${+N+1}.0-0`),s("xRange return",w),w})},Rn=($,_)=>(s("replaceStars",$,_),$.trim().replace(c[u.STAR],"")),kn=($,_)=>(s("replaceGTE0",$,_),$.trim().replace(c[_.includePrerelease?u.GTE0PRE:u.GTE0],"")),In=$=>(_,C,w,O,R,N,B,j,W,ie,ne,rt)=>(x(w)?C="":x(O)?C=`>=${w}.0.0${$?"-0":""}`:x(R)?C=`>=${w}.${O}.0${$?"-0":""}`:N?C=`>=${C}`:C=`>=${C}${$?"-0":""}`,x(W)?j="":x(ie)?j=`<${+W+1}.0.0-0`:x(ne)?j=`<${W}.${+ie+1}.0-0`:rt?j=`<=${W}.${ie}.${ne}-${rt}`:$?j=`<${W}.${ie}.${+ne+1}-0`:j=`<=${j}`,`${C} ${j}`.trim()),Cn=($,_,C)=>{for(let w=0;w<$.length;w++)if(!$[w].test(_))return!1;if(_.prerelease.length&&!C.includePrerelease){for(let w=0;w<$.length;w++)if(s($[w].semver),$[w].semver!==i.ANY&&$[w].semver.prerelease.length>0){const O=$[w].semver;if(O.major===_.major&&O.minor===_.minor&&O.patch===_.patch)return!0}return!1}return!0};return ln}var pn,$i;function Ot(){if($i)return pn;$i=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(l,f){if(f=r(f),l instanceof t){if(l.loose===!!f.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),s("comparator",l,f),this.options=f,this.loose=!!f.loose,this.parse(l),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(l){const f=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],d=l.match(f);if(!d)throw new TypeError(`Invalid comparator: ${l}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(l){if(s("Comparator.test",l,this.options.loose),this.semver===e||l===e)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return i(l,this.operator,this.semver,this.options)}intersects(l,f){if(!(l instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,f).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,f).test(l.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||i(this.semver,"<",l.semver,f)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||i(this.semver,">",l.semver,f)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}pn=t;const r=Nr(),{safeRe:n,t:o}=et(),i=yi(),s=It(),a=se(),c=he();return pn}var fn,Ai;function Pt(){if(Ai)return fn;Ai=1;const e=he();return fn=(r,n,o)=>{try{n=new e(n,o)}catch{return!1}return n.test(r)},fn}var hn,wi;function Qg(){if(wi)return hn;wi=1;const e=he();return hn=(r,n)=>new e(r,n).set.map(o=>o.map(i=>i.value).join(" ").trim().split(" ")),hn}var dn,Ri;function ev(){if(Ri)return dn;Ri=1;const e=se(),t=he();return dn=(n,o,i)=>{let s=null,a=null,c=null;try{c=new t(o,i)}catch{return null}return n.forEach(u=>{c.test(u)&&(!s||a.compare(u)===-1)&&(s=u,a=new e(s,i))}),s},dn}var mn,ki;function tv(){if(ki)return mn;ki=1;const e=se(),t=he();return mn=(n,o,i)=>{let s=null,a=null,c=null;try{c=new t(o,i)}catch{return null}return n.forEach(u=>{c.test(u)&&(!s||a.compare(u)===1)&&(s=u,a=new e(s,i))}),s},mn}var gn,Ii;function rv(){if(Ii)return gn;Ii=1;const e=se(),t=he(),r=Ct();return gn=(o,i)=>{o=new t(o,i);let s=new e("0.0.0");if(o.test(s)||(s=new e("0.0.0-0"),o.test(s)))return s;s=null;for(let a=0;a<o.set.length;++a){const c=o.set[a];let u=null;c.forEach(l=>{const f=new e(l.semver.version);switch(l.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!u||r(f,u))&&(u=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),u&&(!s||r(s,u))&&(s=u)}return s&&o.test(s)?s:null},gn}var vn,Ci;function nv(){if(Ci)return vn;Ci=1;const e=he();return vn=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},vn}var bn,Oi;function yn(){if(Oi)return bn;Oi=1;const e=se(),t=Ot(),{ANY:r}=t,n=he(),o=Pt(),i=Ct(),s=Qr(),a=sn(),c=nn();return bn=(l,f,d,g)=>{l=new e(l,g),f=new n(f,g);let I,v,P,D,re;switch(d){case">":I=i,v=a,P=s,D=">",re=">=";break;case"<":I=s,v=c,P=i,D="<",re="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(l,f,g))return!1;for(let x=0;x<f.set.length;++x){const Z=f.set[x];let M=null,F=null;if(Z.forEach(ee=>{ee.semver===r&&(ee=new t(">=0.0.0")),M=M||ee,F=F||ee,I(ee.semver,M.semver,g)?M=ee:P(ee.semver,F.semver,g)&&(F=ee)}),M.operator===D||M.operator===re||(!F.operator||F.operator===D)&&v(l,F.semver))return!1;if(F.operator===re&&P(l,F.semver))return!1}return!0},bn}var _n,Pi;function ov(){if(Pi)return _n;Pi=1;const e=yn();return _n=(r,n,o)=>e(r,n,">",o),_n}var Sn,Ni;function sv(){if(Ni)return Sn;Ni=1;const e=yn();return Sn=(r,n,o)=>e(r,n,"<",o),Sn}var En,zi;function iv(){if(zi)return En;zi=1;const e=he();return En=(r,n,o)=>(r=new e(r,o),n=new e(n,o),r.intersects(n,o)),En}var $n,Ti;function av(){if(Ti)return $n;Ti=1;const e=Pt(),t=fe();return $n=(r,n,o)=>{const i=[];let s=null,a=null;const c=r.sort((d,g)=>t(d,g,o));for(const d of c)e(d,n,o)?(a=d,s||(s=d)):(a&&i.push([s,a]),a=null,s=null);s&&i.push([s,null]);const u=[];for(const[d,g]of i)d===g?u.push(d):!g&&d===c[0]?u.push("*"):g?d===c[0]?u.push(`<=${g}`):u.push(`${d} - ${g}`):u.push(`>=${d}`);const l=u.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return l.length<f.length?l:n},$n}var An,Li;function cv(){if(Li)return An;Li=1;const e=he(),t=Ot(),{ANY:r}=t,n=Pt(),o=fe(),i=(f,d,g={})=>{if(f===d)return!0;f=new e(f,g),d=new e(d,g);let I=!1;e:for(const v of f.set){for(const P of d.set){const D=c(v,P,g);if(I=I||D!==null,D)continue e}if(I)return!1}return!0},s=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],c=(f,d,g)=>{if(f===d)return!0;if(f.length===1&&f[0].semver===r){if(d.length===1&&d[0].semver===r)return!0;g.includePrerelease?f=s:f=a}if(d.length===1&&d[0].semver===r){if(g.includePrerelease)return!0;d=a}const I=new Set;let v,P;for(const T of f)T.operator===">"||T.operator===">="?v=u(v,T,g):T.operator==="<"||T.operator==="<="?P=l(P,T,g):I.add(T.semver);if(I.size>1)return null;let D;if(v&&P){if(D=o(v.semver,P.semver,g),D>0)return null;if(D===0&&(v.operator!==">="||P.operator!=="<="))return null}for(const T of I){if(v&&!n(T,String(v),g)||P&&!n(T,String(P),g))return null;for(const tt of d)if(!n(T,String(tt),g))return!1;return!0}let re,x,Z,M,F=P&&!g.includePrerelease&&P.semver.prerelease.length?P.semver:!1,ee=v&&!g.includePrerelease&&v.semver.prerelease.length?v.semver:!1;F&&F.prerelease.length===1&&P.operator==="<"&&F.prerelease[0]===0&&(F=!1);for(const T of d){if(M=M||T.operator===">"||T.operator===">=",Z=Z||T.operator==="<"||T.operator==="<=",v){if(ee&&T.semver.prerelease&&T.semver.prerelease.length&&T.semver.major===ee.major&&T.semver.minor===ee.minor&&T.semver.patch===ee.patch&&(ee=!1),T.operator===">"||T.operator===">="){if(re=u(v,T,g),re===T&&re!==v)return!1}else if(v.operator===">="&&!n(v.semver,String(T),g))return!1}if(P){if(F&&T.semver.prerelease&&T.semver.prerelease.length&&T.semver.major===F.major&&T.semver.minor===F.minor&&T.semver.patch===F.patch&&(F=!1),T.operator==="<"||T.operator==="<="){if(x=l(P,T,g),x===T&&x!==P)return!1}else if(P.operator==="<="&&!n(P.semver,String(T),g))return!1}if(!T.operator&&(P||v)&&D!==0)return!1}return!(v&&Z&&!P&&D!==0||P&&M&&!v&&D!==0||ee||F)},u=(f,d,g)=>{if(!f)return d;const I=o(f.semver,d.semver,g);return I>0?f:I<0||d.operator===">"&&f.operator===">="?d:f},l=(f,d,g)=>{if(!f)return d;const I=o(f.semver,d.semver,g);return I<0?f:I>0||d.operator==="<"&&f.operator==="<="?d:f};return An=i,An}var wn,xi;function uv(){if(xi)return wn;xi=1;const e=et(),t=kt(),r=se(),n=Ws(),o=Je(),i=Dg(),s=Zg(),a=Bg(),c=Jg(),u=Ug(),l=Vg(),f=Mg(),d=Fg(),g=fe(),I=Wg(),v=Gg(),P=Gr(),D=Xg(),re=Hg(),x=Ct(),Z=Qr(),M=hi(),F=mi(),ee=nn(),T=sn(),tt=yi(),Rn=Yg(),kn=Ot(),In=he(),Cn=Pt(),$=Qg(),_=ev(),C=tv(),w=rv(),O=nv(),R=yn(),N=ov(),B=sv(),j=iv(),W=av(),ie=cv();return wn={parse:o,valid:i,clean:s,inc:a,diff:c,major:u,minor:l,patch:f,prerelease:d,compare:g,rcompare:I,compareLoose:v,compareBuild:P,sort:D,rsort:re,gt:x,lt:Z,eq:M,neq:F,gte:ee,lte:T,cmp:tt,coerce:Rn,Comparator:kn,Range:In,satisfies:Cn,toComparators:$,maxSatisfying:_,minSatisfying:C,minVersion:w,validRange:O,outside:R,gtr:N,ltr:B,intersects:j,simplifyRange:W,subset:ie,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},wn}var lv=uv();const pv=(e,t)=>fv(t)?t.hostnames.includes(new URL(e).hostname):hv(t)?!!e.match(t.regexp):!1,fv=e=>wr.safeParse(e).success,hv=e=>Rr.safeParse(e).success,dv=(e,t)=>t?lv.satisfies(e,t):!0,mv=(e,t,r)=>dv(t,r.libraryVersionRange)&&pv(e,r.matcher),gv=(e,t)=>e.siteRegistrations.filter(r=>mv(t,Ar(),r)),vv=(e,t)=>gv(e,t).flatMap(({parsers:o,name:i})=>o.filter(s=>Zs(s)&&s in $r).map(s=>({parser:$r[s],parserType:s,name:i}))),bv=(e,t)=>{const r=vv(e,t.url);for(const{parser:n,parserType:o,name:i}of r){const s=n(t);if(bt(s)||is(s)||as(s))return{...s,meta:{parserName:i,parserType:o,referrer:t.url}}}return{...os(),meta:{parserName:null,parserType:z.NoResourceFound,referrer:t.url}}},yv=(e,t)=>t===$e.CA?new URL(`https://${e}.rl.ca.talis.com`):new URL(`https://${e}.rl.talis.com`),_v=(e,t)=>{const r=yv(e,t);return new URL("/ui/forms/bookmarklet.html",r)},Sv=(e,t,r)=>{const n=qo(t);n.append("fast","true"),n.append("breakout","true"),r&&(r.parserName&&n.append("targetTitle",r.parserName),n.append("referrer",r.referrer));const o=new URL(e.toString());return o.search=n.toString(),o};y.BookGenresSchema=vp,y.CustomerListSchema=Uo,y.CustomerSchema=Gt,y.DirectLinkOnlyResultSchema=Yt,y.Genre=S,y.HostnamesMatcherSchema=wr,y.JournalGenresSchema=bp,y.NON_OPENURL_PROPERTIES=Ft,y.NonOpenUrlPropertiesSchema=Vt,y.NothingParsedResultSchema=Ht,y.OPENURL_KEYS=xo,y.OpenUrlAudioVisualResourceSchema=Sp,y.OpenUrlBookResourceSchema=yp,y.OpenUrlDocumentResourceSchema=$p,y.OpenUrlImageResourceSchema=Ep,y.OpenUrlJournalResourceSchema=_p,y.OpenUrlResourceSchema=ve,y.OpenUrlResultSchema=Kt,y.OpenUrlWebpageResourceSchema=Ap,y.PARSERS=$r,y.ParserRegistrySchema=Ds,y.ParserType=z,y.ParsingMetadataSchema=Xt,y.ParsingRequestSchema=Jo,y.ParsingResponseSchema=Wo,y.ParsingResultSchema=tr,y.REGISTRY=zg,y.RegExpMatcherSchema=Rr,y.ResourceDataSchema=Bs,y.ResourceSchema=zo,y.SiteRegistrationSchema=Ir,y.SummonSearchResultSchema=er,y.TenantRegion=$e,y.TenantRegistrySchema=Op,y.TenantSchema=Wt,y.UrlMatcherSchema=kr,y.Z3988SearchResultSchema=Qt,y.convertCustomerListToTenantRegistry=zp,y.createAudioVisual=ge,y.createBook=V,y.createDocument=Mt,y.createImage=To,y.createJournal=q,y.createWebpage=dt,y.directLinkOnly=Lp,y.fromOpenUrl=Zo,y.getBaseBookmarkingUrl=_v,y.getLibraryVersion=Ar,y.isCustomer=Vo,y.isCustomerList=Mo,y.isDirectLinkOnlyResult=oh,y.isGenre=Cp,y.isNothingParsedResult=sh,y.isOpenUrlResult=bt,y.isParserRegistry=Tg,y.isParserType=Zs,y.isParsingMetadata=nh,y.isParsingRequest=Pp,y.isParsingResponse=rh,y.isParsingResult=th,y.isResourceData=qg,y.isSiteRegistration=Lg,y.isSummonSearchResult=as,y.isTenant=Fo,y.isTenantRegion=Np,y.isUrlMatcher=xg,y.isZ3988SearchResult=is,y.nothingParsed=L,y.openUrlResource=E,y.parseResource=bv,y.summonSearchResult=Xo,y.toBookmarkingWorkflowUrl=Sv,y.toOpenUrl=qo,y.z3988SearchResult=Go,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"registry": "https://registry.npmjs.org/"
|
|
9
9
|
},
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "5.
|
|
11
|
+
"version": "5.34.0",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
@@ -36,20 +36,20 @@
|
|
|
36
36
|
"save-fixture": "tsx scripts/save-fixture.ts"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@commitlint/cli": "20.4.
|
|
40
|
-
"@commitlint/config-conventional": "20.4.
|
|
39
|
+
"@commitlint/cli": "20.4.3",
|
|
40
|
+
"@commitlint/config-conventional": "20.4.3",
|
|
41
41
|
"@eslint/js": "10.0.1",
|
|
42
42
|
"@types/eslint": "9.6.1",
|
|
43
|
-
"@types/node": "24.
|
|
43
|
+
"@types/node": "24.11.0",
|
|
44
44
|
"@types/semver": "7.7.1",
|
|
45
45
|
"@vitest/coverage-v8": "4.0.18",
|
|
46
46
|
"camelcase": "9.0.0",
|
|
47
47
|
"eslint": "10.0.2",
|
|
48
48
|
"eslint-config-prettier": "10.1.8",
|
|
49
49
|
"@vitest/eslint-plugin": "1.6.9",
|
|
50
|
-
"jsdom": "28.
|
|
50
|
+
"jsdom": "28.1.0",
|
|
51
51
|
"prettier": "3.8.1",
|
|
52
|
-
"puppeteer": "24.
|
|
52
|
+
"puppeteer": "24.38.0",
|
|
53
53
|
"tsx": "4.21.0",
|
|
54
54
|
"typescript": "5.9.3",
|
|
55
55
|
"typescript-eslint": "8.56.1",
|