@tekkare/romulus 0.1.338 → 0.1.339
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/layer/app/components/oip-drugs/fiches/BrandFiche.vue +41 -12
- package/layer/app/components/oip-drugs/heart/results/details/RecordDrawer.vue +81 -1
- package/layer/app/oip-drugs/esIndices.ts +4 -0
- package/layer/app/oip-drugs/utils/ansmDocuments.ts +122 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -166,7 +166,9 @@
|
|
|
166
166
|
<div v-else-if="chosenTab === derogatoryTabIndex && derogatoryTabIndex > 0" class="arg_page_layout">
|
|
167
167
|
<OipDrugsHeartResultsDetailsRecordList
|
|
168
168
|
:title="locale === 'en' ? 'ANSM derogatory access' : 'Accès dérogatoires ANSM'"
|
|
169
|
-
:subtitle="
|
|
169
|
+
:subtitle="derogatoryRecords.length > 1
|
|
170
|
+
? locale === 'en' ? 'statuses recorded for the brand' : 'statuts recensés pour la marque'
|
|
171
|
+
: locale === 'en' ? 'status recorded for the brand' : 'statut recensé pour la marque'"
|
|
170
172
|
:items="derogatoryRecords"
|
|
171
173
|
:source-uuid="HEART_SOURCE_UUIDS.ANSM"
|
|
172
174
|
:empty-label="locale === 'en' ? 'No derogatory access for this product.' : 'Aucun accès dérogatoire pour ce produit.'"
|
|
@@ -224,6 +226,7 @@ import useHeartIntlApprovals from "../../../oip-drugs/composables/useHeartIntlAp
|
|
|
224
226
|
import useHeartBrandMatches from "../../../oip-drugs/composables/useHeartBrandMatches";
|
|
225
227
|
import { HEART_LES_INDEX } from "../../../oip-drugs/composables/useHeartLesIndication";
|
|
226
228
|
import { HEART_SOURCE_UUIDS } from "../../../oip-drugs/utils/sourceUuids";
|
|
229
|
+
import { ansmDocumentsOf } from "../../../oip-drugs/utils/ansmDocuments";
|
|
227
230
|
import { HEART_INTL_PRICE_COUNTRIES } from "../../../oip-drugs/utils/heartIntlPrice";
|
|
228
231
|
import { heartFixMojibake } from "../../../oip-drugs/utils/heartStyleAndFormat";
|
|
229
232
|
import { heartStripBrandPrefix } from "../../../oip-drugs/utils/heartStyleAnsm";
|
|
@@ -271,6 +274,7 @@ const brandId = ref<string | null>(null);
|
|
|
271
274
|
const resultsQueryAnsm = ref<Array<{ _id: string; _source: any }>>([]);
|
|
272
275
|
const resultsQueryMitm = ref<Array<{ _id: string; _source: any }>>([]);
|
|
273
276
|
const resultsQueryPut = ref<Array<{ _id: string; _source: any }>>([]);
|
|
277
|
+
const resultsQueryDerogatory = ref<Array<{ _id: string; _source: any }>>([]);
|
|
274
278
|
const resultsQueryLes = ref<any[]>([]);
|
|
275
279
|
const indexQuery = ES_INDEX.BRAND_HAS;
|
|
276
280
|
const isLoadingQuery = ref(true);
|
|
@@ -508,14 +512,14 @@ const alertRecords = computed(() =>
|
|
|
508
512
|
);
|
|
509
513
|
|
|
510
514
|
/**
|
|
511
|
-
* Acces derogatoires ANSM de la marque (AAC, AAP, CPC, ATU, RTU, AMM)
|
|
512
|
-
*
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
+
* Acces derogatoires ANSM de la marque (AAC, AAP, CPC, ATU, RTU, AMM), lus
|
|
516
|
+
* dans leur index par `brand_group`, une entree par statut, la plus recente en
|
|
517
|
+
* tete. Pas dans le nested `derogatory_access` de la fiche HAS : deux produits
|
|
518
|
+
* sur trois n'ont pas de fiche HAS, l'onglet doit exister sans elle.
|
|
515
519
|
*/
|
|
516
520
|
const derogatoryRecords = computed(() =>
|
|
517
|
-
|
|
518
|
-
.
|
|
521
|
+
resultsQueryDerogatory.value
|
|
522
|
+
.map((hit) => hit._source ?? {})
|
|
519
523
|
.map((row: any) => {
|
|
520
524
|
const english = locale.value === "en";
|
|
521
525
|
const lastRenewal = [...(row.renewal_date ?? [])].sort().at(-1);
|
|
@@ -556,14 +560,14 @@ const derogatoryRecords = computed(() =>
|
|
|
556
560
|
.filter(Boolean)
|
|
557
561
|
.join("\n"),
|
|
558
562
|
},
|
|
559
|
-
{
|
|
560
|
-
key: "documents",
|
|
561
|
-
label: "Documents",
|
|
562
|
-
body: (row.document_url ?? []).join("\n"),
|
|
563
|
-
},
|
|
564
563
|
],
|
|
564
|
+
documents: ansmDocumentsOf(row.document_url, locale.value),
|
|
565
565
|
};
|
|
566
566
|
})
|
|
567
|
+
// Rangees sur la date affichee (refus, arret, octroi, sinon publication),
|
|
568
|
+
// celle qui fait aussi le groupe d'annee : triees sur la publication, une
|
|
569
|
+
// AAP publiee en 2021 et refusee en 2023 passait sous l'annee 2021.
|
|
570
|
+
.sort((a, b) => String(b.date ?? "").localeCompare(String(a.date ?? "")))
|
|
567
571
|
);
|
|
568
572
|
|
|
569
573
|
/** Etat ANSM : en cours ou accorde se lit bien, refuse ou defavorable mal. */
|
|
@@ -980,6 +984,29 @@ const customQueryPut = () => ({
|
|
|
980
984
|
sort: [{ authorization_date: { order: "desc", missing: "_last" } }],
|
|
981
985
|
track_total_hits: true,
|
|
982
986
|
});
|
|
987
|
+
// Acces derogatoires : `brand_group` est au format des marques HAS, la
|
|
988
|
+
// marque de la fiche suffit, qu'elle ait une fiche HAS ou non.
|
|
989
|
+
const launchQueryDerogatory = async (gen: number) => {
|
|
990
|
+
if (!live(gen)) return;
|
|
991
|
+
const brand = resultsQuery.value?.brand_group || brandMatch.value;
|
|
992
|
+
const res = await queryCustomElastic({
|
|
993
|
+
index: ES_INDEX.DEROGATORY_ACCESS_ANSM,
|
|
994
|
+
customQuery: {
|
|
995
|
+
from: 0,
|
|
996
|
+
query: { term: { brand_group: brand } },
|
|
997
|
+
size: 200,
|
|
998
|
+
sort: [{ published_date: { order: "desc", missing: "_last" } }],
|
|
999
|
+
} as any,
|
|
1000
|
+
allAnswer: true,
|
|
1001
|
+
}).catch((error) => {
|
|
1002
|
+
console.error("Error fetching derogatory access:", error);
|
|
1003
|
+
return null;
|
|
1004
|
+
});
|
|
1005
|
+
if (res?.hits?.hits && live(gen)) {
|
|
1006
|
+
resultsQueryDerogatory.value = res.hits.hits;
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
|
|
983
1010
|
const launchQueryPut = async (gen: number) => {
|
|
984
1011
|
if (!live(gen)) return;
|
|
985
1012
|
const res = await queryCustomElastic({
|
|
@@ -1049,6 +1076,7 @@ function reset() {
|
|
|
1049
1076
|
resultsQueryAnsm.value = [];
|
|
1050
1077
|
resultsQueryMitm.value = [];
|
|
1051
1078
|
resultsQueryPut.value = [];
|
|
1079
|
+
resultsQueryDerogatory.value = [];
|
|
1052
1080
|
resultsQueryLes.value = [];
|
|
1053
1081
|
selectedAnsmIndex.value = 0;
|
|
1054
1082
|
selectedMitmIndex.value = 0;
|
|
@@ -1078,6 +1106,7 @@ async function loadAll() {
|
|
|
1078
1106
|
launchQueryAnsm(gen),
|
|
1079
1107
|
launchQueryMitm(gen),
|
|
1080
1108
|
launchQueryPut(gen),
|
|
1109
|
+
launchQueryDerogatory(gen),
|
|
1081
1110
|
launchQueryLes(gen),
|
|
1082
1111
|
brandMatches.load(brand, indexQuery),
|
|
1083
1112
|
]);
|
|
@@ -33,6 +33,12 @@ const props = defineProps<{
|
|
|
33
33
|
*/
|
|
34
34
|
link?: { label: string; to: string; icon?: string } | null;
|
|
35
35
|
sections?: { key: string; label: string; body: string }[];
|
|
36
|
+
/**
|
|
37
|
+
* Documents nommes de l'enregistrement : un PDF que sert
|
|
38
|
+
* `/api/oip/pdf` (`preview`) s'ouvre dans la visionneuse, le reste
|
|
39
|
+
* dans un onglet (acces derogatoires ANSM).
|
|
40
|
+
*/
|
|
41
|
+
documents?: { key: string; name: string; url: string; preview: boolean }[];
|
|
36
42
|
}
|
|
37
43
|
| null;
|
|
38
44
|
/** Nom de la source affichee en pied. */
|
|
@@ -50,6 +56,24 @@ const sections = computed(() => (props.record?.sections ?? []).filter((s) => s.b
|
|
|
50
56
|
|
|
51
57
|
const accordion = computed(() => props.record?.layout === "accordion");
|
|
52
58
|
|
|
59
|
+
const documents = computed(() => props.record?.documents ?? []);
|
|
60
|
+
|
|
61
|
+
/** Apercu d'un PDF, dans la visionneuse commune aux tiroirs de documents. */
|
|
62
|
+
const previewOpen = ref(false);
|
|
63
|
+
const previewDoc = ref<{ name: string; url: string } | null>(null);
|
|
64
|
+
const previewSrc = computed(() =>
|
|
65
|
+
previewDoc.value ? `/api/oip/pdf?url=${encodeURIComponent(previewDoc.value.url)}` : null,
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
function openDocument(doc: { name: string; url: string; preview: boolean }) {
|
|
69
|
+
if (!doc.preview) {
|
|
70
|
+
window.open(doc.url, "_blank", "noopener");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
previewDoc.value = doc;
|
|
74
|
+
previewOpen.value = true;
|
|
75
|
+
}
|
|
76
|
+
|
|
53
77
|
/** Onglets : la rubrique affichee. */
|
|
54
78
|
const active = ref(0);
|
|
55
79
|
|
|
@@ -91,7 +115,8 @@ function follow(to: string) {
|
|
|
91
115
|
}
|
|
92
116
|
|
|
93
117
|
function onKeydown(event: KeyboardEvent) {
|
|
94
|
-
|
|
118
|
+
// L'apercu se ferme en premier : sans ce garde, Echap refermait les deux.
|
|
119
|
+
if (event.key === "Escape" && !previewOpen.value) emit("close");
|
|
95
120
|
}
|
|
96
121
|
|
|
97
122
|
onMounted(() => document.addEventListener("keydown", onKeydown));
|
|
@@ -189,6 +214,23 @@ onBeforeUnmount(() => document.removeEventListener("keydown", onKeydown));
|
|
|
189
214
|
</template>
|
|
190
215
|
</slot>
|
|
191
216
|
|
|
217
|
+
<!-- Les documents valent pour l'enregistrement entier : hors des
|
|
218
|
+
rubriques, comme dans le tiroir d'un avis HAS. -->
|
|
219
|
+
<section v-if="documents.length" class="rdr_docs">
|
|
220
|
+
<h3 class="rdr_docs_title">
|
|
221
|
+
Documents
|
|
222
|
+
<span class="rdr_docs_count">{{ documents.length }}</span>
|
|
223
|
+
</h3>
|
|
224
|
+
<RmFileRow
|
|
225
|
+
v-for="doc in documents"
|
|
226
|
+
:key="doc.key"
|
|
227
|
+
:name="doc.name"
|
|
228
|
+
:format="doc.preview ? 'pdf' : ''"
|
|
229
|
+
:action="doc.preview ? 'preview' : 'open'"
|
|
230
|
+
@select="openDocument(doc)"
|
|
231
|
+
/>
|
|
232
|
+
</section>
|
|
233
|
+
|
|
192
234
|
<a
|
|
193
235
|
v-if="record.url"
|
|
194
236
|
class="rdr_link"
|
|
@@ -209,6 +251,17 @@ onBeforeUnmount(() => document.removeEventListener("keydown", onKeydown));
|
|
|
209
251
|
</span>
|
|
210
252
|
</footer>
|
|
211
253
|
</aside>
|
|
254
|
+
|
|
255
|
+
<!-- Le voile du tiroir couvre le cadre entier : l'apercu se pose
|
|
256
|
+
au-dessus de lui, sinon il s'ouvre derriere. -->
|
|
257
|
+
<OipDocumentPreview
|
|
258
|
+
v-model="previewOpen"
|
|
259
|
+
:src="previewSrc"
|
|
260
|
+
:title="previewDoc?.name"
|
|
261
|
+
:external-src="previewDoc?.url"
|
|
262
|
+
:download-src="previewDoc?.url"
|
|
263
|
+
:z-index="320"
|
|
264
|
+
/>
|
|
212
265
|
</div>
|
|
213
266
|
</Transition>
|
|
214
267
|
</Teleport>
|
|
@@ -241,6 +294,33 @@ onBeforeUnmount(() => document.removeEventListener("keydown", onKeydown));
|
|
|
241
294
|
box-shadow: var(--overlay-shadow);
|
|
242
295
|
}
|
|
243
296
|
|
|
297
|
+
.rdr_docs {
|
|
298
|
+
display: flex;
|
|
299
|
+
flex-direction: column;
|
|
300
|
+
gap: 2px;
|
|
301
|
+
margin-top: 8px;
|
|
302
|
+
padding-top: 16px;
|
|
303
|
+
border-top: 1px solid var(--light);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.rdr_docs_title {
|
|
307
|
+
display: flex;
|
|
308
|
+
align-items: center;
|
|
309
|
+
gap: 8px;
|
|
310
|
+
margin-bottom: 8px;
|
|
311
|
+
font-size: 15px;
|
|
312
|
+
font-weight: 800;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.rdr_docs_count {
|
|
316
|
+
padding: 1px 8px;
|
|
317
|
+
border-radius: 999px;
|
|
318
|
+
background: var(--lightest);
|
|
319
|
+
color: var(--medium);
|
|
320
|
+
font-size: 12px;
|
|
321
|
+
font-weight: 700;
|
|
322
|
+
}
|
|
323
|
+
|
|
244
324
|
.rdr_panel_wide {
|
|
245
325
|
width: min(1040px, 100%);
|
|
246
326
|
}
|
|
@@ -108,6 +108,10 @@ export const ES_INDEX = {
|
|
|
108
108
|
// Une appreciation SMR ou ASMR par document (Dossier Playbook, retours d'experience).
|
|
109
109
|
SMR_ASMR_HAS: "a1218b4b-fc62-42a0-bc39-2ecc2e5b421d", // ope_block402_fr__drugs__smr_asmr__has
|
|
110
110
|
PUT_HAS: "79a2fd26-82a1-44d3-b9f8-d79a0e7352c3", // ope_block402_fr__drugs__put__has
|
|
111
|
+
// Acces derogatoires ANSM (AAC, AAP, CPC, ATU, RTU, AMM) : une ligne par
|
|
112
|
+
// statut, `brand_group` au format des marques HAS. Pas encore de ligne dans
|
|
113
|
+
// Directus : ecrit en clair (cf. R-05).
|
|
114
|
+
DEROGATORY_ACCESS_ANSM: "ope_block402_fr__drugs__derogatory_access__ansm",
|
|
111
115
|
INDICATION_SEARCH_HAS: "988a17af-b7a2-40af-941b-24116496c68e", // ope_block402_fr__drugs__indication__search__has
|
|
112
116
|
|
|
113
117
|
// Associations de patients. Sept index d'une meme famille, relies par
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Documents d'un acces derogatoire ANSM (`document_url`) : un nom lisible et
|
|
3
|
+
* la facon de l'ouvrir.
|
|
4
|
+
*
|
|
5
|
+
* L'index ne donne que des adresses. Les PDF de l'ANSM portent un nom de
|
|
6
|
+
* fichier parlant (`20230809-aap-epcoritamab-avis-ansm.pdf`) : on en tire la
|
|
7
|
+
* date et le libelle. Les autres liens (e-Saturne, fiche HAS, base publique,
|
|
8
|
+
* FDA...) prennent le nom de leur site. Un PDF d'un hote que sert
|
|
9
|
+
* `/api/oip/pdf` s'ouvre dans la visionneuse, le reste dans un onglet.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export type AnsmDocument = {
|
|
13
|
+
key: string;
|
|
14
|
+
name: string;
|
|
15
|
+
url: string;
|
|
16
|
+
/** PDF servi par `/api/oip/pdf` : visionneuse plutot qu'onglet. */
|
|
17
|
+
preview: boolean;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** Hotes acceptes par `/api/oip/pdf` (cf. server/api/oip/pdf.get.ts). */
|
|
21
|
+
const PREVIEW_HOSTS = new Set(["ansm.sante.fr", "has-sante.fr", "www.has-sante.fr"]);
|
|
22
|
+
|
|
23
|
+
const SITE_NAMES: Record<string, { fr: string; en: string }> = {
|
|
24
|
+
"icsaturne.ansm.sante.fr": { fr: "Portail e-Saturne (demande d'accès)", en: "e-Saturne portal (access request)" },
|
|
25
|
+
"ansm.sante.fr": { fr: "ANSM", en: "ANSM" },
|
|
26
|
+
"www.has-sante.fr": { fr: "HAS", en: "HAS" },
|
|
27
|
+
"has-sante.fr": { fr: "HAS", en: "HAS" },
|
|
28
|
+
"base-donnees-publique.medicaments.gouv.fr": { fr: "Base publique du médicament", en: "Public drug database" },
|
|
29
|
+
"www.accessdata.fda.gov": { fr: "FDA", en: "FDA" },
|
|
30
|
+
"www.medicines.org.uk": { fr: "eMC (Royaume-Uni)", en: "eMC (UK)" },
|
|
31
|
+
"www.ema.europa.eu": { fr: "EMA", en: "EMA" },
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** Sigles reecrits en capitales, le reste du nom de fichier en minuscules. */
|
|
35
|
+
const ACRONYMS: Record<string, string> = {
|
|
36
|
+
aac: "AAC", aap: "AAP", apac: "APAC", atu: "ATU", atuc: "ATUc", atun: "ATUn",
|
|
37
|
+
cpc: "CPC", rtu: "RTU", rcp: "RCP", amm: "AMM", ansm: "ANSM", has: "HAS",
|
|
38
|
+
pgr: "PGR", put: "PUT", ue: "UE", sc: "SC", iv: "IV",
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** Expressions recurrentes des noms de fichier, remises en francais. */
|
|
42
|
+
const PHRASES: [RegExp, string][] = [
|
|
43
|
+
[/\bresume (?:du )?rapport (?:de )?synthese\b/g, "résumé du rapport de synthèse"],
|
|
44
|
+
[/\bresume rapport\b/g, "résumé du rapport"],
|
|
45
|
+
[/\bavis ansm\b/g, "avis de l'ANSM"],
|
|
46
|
+
[/\brcp notice\b/g, "RCP et notice"],
|
|
47
|
+
[/\bpre amm\b/g, "pré-AMM"],
|
|
48
|
+
[/\bpost amm\b/g, "post-AMM"],
|
|
49
|
+
[/\bperiode du\b/g, "période du"],
|
|
50
|
+
[/\bperiode\b/g, "période"],
|
|
51
|
+
[/\blansm\b/g, "l'ANSM"],
|
|
52
|
+
[/\bacces precoce\b/g, "accès précoce"],
|
|
53
|
+
[/\bacces compassionnel\b/g, "accès compassionnel"],
|
|
54
|
+
[/\bdecision\b/g, "décision"],
|
|
55
|
+
[/\bmedicament\b/g, "médicament"],
|
|
56
|
+
[/\bno (\d+)\b/g, "n°$1"],
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
/** Fichiers bureautiques : nommes comme un PDF, ouverts dans un onglet. */
|
|
60
|
+
const FILE_EXTENSION = /\.(pdf|docx?|xlsx?|pptx?)$/i;
|
|
61
|
+
|
|
62
|
+
function humanize(slug: string): string {
|
|
63
|
+
let text = slug.replace(/[-_+]+/g, " ").replace(/\s+/g, " ").trim().toLowerCase();
|
|
64
|
+
for (const [pattern, replacement] of PHRASES) text = text.replace(pattern, replacement);
|
|
65
|
+
text = text
|
|
66
|
+
.split(" ")
|
|
67
|
+
.map((word) => ACRONYMS[word] ?? word.replace(/^n0*(\d+)$/, "n°$1"))
|
|
68
|
+
.join(" ");
|
|
69
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function fileName(file: string, en: boolean): string {
|
|
73
|
+
const base = file.replace(FILE_EXTENSION, "");
|
|
74
|
+
if (/^[0-9a-f]{32}$/i.test(base)) return en ? "PDF document" : "Document PDF";
|
|
75
|
+
if (/^\d+s\d+lbl$/i.test(base)) return en ? "FDA label" : "Étiquetage FDA";
|
|
76
|
+
const dated = base.match(/^(\d{4})(\d{2})(\d{2})[-_](.+)$/);
|
|
77
|
+
if (!dated) return humanize(base);
|
|
78
|
+
const [, y, m, d, rest] = dated;
|
|
79
|
+
return `${humanize(rest!)} (${d}/${m}/${y})`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function ansmDocumentsOf(urls: string[] | null | undefined, locale: string): AnsmDocument[] {
|
|
83
|
+
const en = locale === "en";
|
|
84
|
+
const seen = new Set<string>();
|
|
85
|
+
const out: AnsmDocument[] = [];
|
|
86
|
+
for (const raw of urls ?? []) {
|
|
87
|
+
let url: URL;
|
|
88
|
+
try {
|
|
89
|
+
url = new URL(raw);
|
|
90
|
+
} catch {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (url.protocol !== "https:" && url.protocol !== "http:") continue;
|
|
94
|
+
if (seen.has(url.href)) continue;
|
|
95
|
+
seen.add(url.href);
|
|
96
|
+
|
|
97
|
+
const file = decodeURIComponent(url.pathname.replace(/\/+$/, "").split("/").pop() ?? "");
|
|
98
|
+
const isPdf = /\.pdf$/i.test(file);
|
|
99
|
+
const isFile = FILE_EXTENSION.test(file);
|
|
100
|
+
// Un dernier segment sans sens (identifiant, code de langue) : le site seul.
|
|
101
|
+
const meaningless = !file || file.length < 4 || /^[0-9a-f]{16,}$/i.test(file);
|
|
102
|
+
const site = SITE_NAMES[url.hostname];
|
|
103
|
+
const siteName = site ? (en ? site.en : site.fr) : url.hostname.replace(/^www\./, "");
|
|
104
|
+
|
|
105
|
+
let name: string;
|
|
106
|
+
if (isFile) {
|
|
107
|
+
name = fileName(file, en);
|
|
108
|
+
} else if (url.hostname === "icsaturne.ansm.sante.fr" || meaningless) {
|
|
109
|
+
name = siteName;
|
|
110
|
+
} else {
|
|
111
|
+
name = `${siteName} : ${humanize(file).slice(0, 90)}`;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
out.push({
|
|
115
|
+
key: url.href,
|
|
116
|
+
name,
|
|
117
|
+
url: url.href,
|
|
118
|
+
preview: isPdf && url.protocol === "https:" && PREVIEW_HOSTS.has(url.hostname),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return out;
|
|
122
|
+
}
|