@treeviz/gedcom-parser 2.1.17 → 2.1.22

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.
@@ -300,11 +300,28 @@ var hungarianOrdinalize = (n) => {
300
300
  // src/kinship-translator/patterns.hu.ts
301
301
  var parentRelationsHu = {
302
302
  step: "mostoha",
303
- foster: "nevelt",
303
+ foster: { ancestor: "nevel\u0151", other: "nevelt" },
304
304
  birth: "v\xE9rszerinti",
305
305
  biological: "v\xE9rszerinti",
306
- adopted: "\xF6r\xF6kbefogadott"
306
+ adopted: { ancestor: "\xF6r\xF6kbefogad\xF3", other: "\xF6r\xF6kbefogadott" }
307
307
  };
308
+ var parentRelationPrefix = (relation, ancestor) => {
309
+ const label = parentRelationsHu[relation];
310
+ if (!label) {
311
+ return;
312
+ }
313
+ if (typeof label === "string") {
314
+ return label;
315
+ }
316
+ return ancestor ? label.ancestor : label.other;
317
+ };
318
+ var parentRelationModifiers = [
319
+ ...new Set(
320
+ Object.values(parentRelationsHu).flatMap(
321
+ (label) => typeof label === "string" ? [label] : [label.ancestor, label.other]
322
+ )
323
+ )
324
+ ].join("|");
308
325
  var nominativus = {
309
326
  apa: { nominativus: "apa", dativus: "apj\xE1nak", possessivus: "apja" },
310
327
  anya: { nominativus: "anya", dativus: "anyj\xE1nak", possessivus: "anyja" },
@@ -382,15 +399,9 @@ var casesHu = {
382
399
  var InLawsHu = {
383
400
  "gyermek feles\xE9ge": "meny",
384
401
  "gyermek f\xE9rje": "v\u0151",
385
- [`(f\xE9rj|feles\xE9g) (?<mod1>(${Object.values(parentRelationsHu).join(
386
- "|"
387
- )}) )?anyja`]: "any\xF3s",
388
- [`(f\xE9rj|feles\xE9g) (?<mod1>(${Object.values(parentRelationsHu).join(
389
- "|"
390
- )}) )?apja`]: "ap\xF3s",
391
- [`(f\xE9rj|feles\xE9g) (?<mod1>(${Object.values(parentRelationsHu).join(
392
- "|"
393
- )}) )?(f\xE9l)?testv\xE9re`]: (indi) => {
402
+ [`(f\xE9rj|feles\xE9g) (?<mod1>(${parentRelationModifiers}) )?anyja`]: "any\xF3s",
403
+ [`(f\xE9rj|feles\xE9g) (?<mod1>(${parentRelationModifiers}) )?apja`]: "ap\xF3s",
404
+ [`(f\xE9rj|feles\xE9g) (?<mod1>(${parentRelationModifiers}) )?(f\xE9l)?testv\xE9re`]: (indi) => {
394
405
  if (indi?.isMale()) {
395
406
  return "s\xF3gor";
396
407
  }
@@ -667,7 +678,12 @@ var KinshipTranslatorHU = class extends KinshipTranslatorBasic {
667
678
  if (!relation || !this.pathN?.relation) {
668
679
  return relation ?? "";
669
680
  }
670
- return `${parentRelationsHu[this.pathN.relation]} ${relation}`;
681
+ const isAncestor = (this.pathN.level ?? 0) > 0 && (this.pathN.degree ?? 0) === 0;
682
+ const prefix = parentRelationPrefix(this.pathN.relation, isAncestor);
683
+ if (!prefix) {
684
+ return relation;
685
+ }
686
+ return `${prefix} ${relation}`;
671
687
  }
672
688
  };
673
689
 
@@ -867,6 +883,10 @@ var KinshipTranslatorEn = class extends KinshipTranslatorBasic {
867
883
  if (!relation || !this.pathN?.relation) {
868
884
  return relation ?? "";
869
885
  }
886
+ if (this.pathN.relation === "adopted") {
887
+ const isAncestor = (this.pathN.level ?? 0) > 0 && (this.pathN.degree ?? 0) === 0;
888
+ return `${isAncestor ? "adoptive" : "adopted"} ${relation}`;
889
+ }
870
890
  return `${this.pathN.relation} ${relation}`;
871
891
  }
872
892
  };
@@ -1802,6 +1822,39 @@ var lineal = (level, sex, kind) => {
1802
1822
  }
1803
1823
  return `${L - 1}\u4E16\u306E\u5B6B`;
1804
1824
  };
1825
+ var adoptedRelation = (relation) => {
1826
+ if (relation === "\u7236") {
1827
+ return "\u990A\u7236";
1828
+ }
1829
+ if (relation === "\u6BCD") {
1830
+ return "\u990A\u6BCD";
1831
+ }
1832
+ if (relation === "\u89AA") {
1833
+ return "\u990A\u89AA";
1834
+ }
1835
+ if (relation === "\u606F\u5B50" || relation === "\u5B50") {
1836
+ return "\u990A\u5B50";
1837
+ }
1838
+ if (relation === "\u5A18") {
1839
+ return "\u990A\u5973";
1840
+ }
1841
+ return `\u990A${relation}`;
1842
+ };
1843
+ var fosterRelation = (relation) => {
1844
+ if (relation === "\u7236") {
1845
+ return "\u91CC\u7236";
1846
+ }
1847
+ if (relation === "\u6BCD") {
1848
+ return "\u91CC\u6BCD";
1849
+ }
1850
+ if (relation === "\u89AA") {
1851
+ return "\u91CC\u89AA";
1852
+ }
1853
+ if (relation === "\u606F\u5B50" || relation === "\u5A18" || relation === "\u5B50") {
1854
+ return "\u91CC\u5B50";
1855
+ }
1856
+ return `\u91CC${relation}`;
1857
+ };
1805
1858
  var cousinPlain = (degree) => {
1806
1859
  if (degree <= 1) {
1807
1860
  return "\u3044\u3068\u3053";
@@ -1961,10 +2014,10 @@ var KinshipTranslatorJa = class extends KinshipTranslatorBasic {
1961
2014
  return `\u7D99${relation}`;
1962
2015
  }
1963
2016
  if (this.pathN.relation === "adopted") {
1964
- return `\u990A\u5B50\u306E${relation}`;
2017
+ return adoptedRelation(relation);
1965
2018
  }
1966
2019
  if (this.pathN.relation === "foster") {
1967
- return `\u91CC\u89AA\u306E${relation}`;
2020
+ return fosterRelation(relation);
1968
2021
  }
1969
2022
  return relation;
1970
2023
  }
@@ -2416,6 +2469,30 @@ var mediaIdValue = (obje, path) => {
2416
2469
  return typeof value === "string" && value.trim() ? value.trim() : void 0;
2417
2470
  };
2418
2471
  var resolveObjeMediaId = (obje) => mediaIdValue(obje, "RIN") || mediaIdValue(obje, "_CLON._OID") || mediaIdValue(obje, "_MSER._LKID") || mediaIdValue(obje, "_OID") || mediaIdValue(obje, "_LKID");
2472
+ var ANCESTRY_TREE_MEDIA_NAMESPACE = 1093;
2473
+ var ANCESTRY_NAMESPACE_IN_URL = /\/namespaces\/(\d+)\/media\//i;
2474
+ var parseAncestryNamespaceFromUrl = (url) => {
2475
+ if (!url) {
2476
+ return void 0;
2477
+ }
2478
+ const match = url.match(ANCESTRY_NAMESPACE_IN_URL);
2479
+ const namespace = match?.[1] ? Number(match[1]) : NaN;
2480
+ return Number.isFinite(namespace) ? namespace : void 0;
2481
+ };
2482
+ var isAncestryOriginObje = (obje) => {
2483
+ if (!obje) {
2484
+ return false;
2485
+ }
2486
+ const orig = mediaIdValue(obje, "_ORIG");
2487
+ if (orig?.toLowerCase() === "acom") {
2488
+ return true;
2489
+ }
2490
+ const file = mediaIdValue(obje, "FILE") ?? "";
2491
+ if (parseAncestryNamespaceFromUrl(file)) {
2492
+ return true;
2493
+ }
2494
+ return Boolean(resolveObjeMediaId(obje) && !file.trim());
2495
+ };
2419
2496
  var ANCESTRY_MEDIA_RETRIEVAL_PREFIX = "https://www.ancestry.com/api/media/retrieval/v2/image";
2420
2497
  var ANCESTRY_MEDIA_QUERY = "client=trees-mediaservice&imageQuality=hq";
2421
2498
  var ancestryMediaPath = (namespace, imgId) => `/namespaces/${namespace}/media/${imgId}?${ANCESTRY_MEDIA_QUERY}`;
@@ -2791,8 +2868,25 @@ var Common = class _Common {
2791
2868
  getHeadRecord() {
2792
2869
  return get(this, "HEAD") || get(this.getGedcom(), "HEAD");
2793
2870
  }
2871
+ unwrapHeadRecord(node) {
2872
+ if (!node) {
2873
+ return void 0;
2874
+ }
2875
+ const common = node instanceof List ? node.index(0) : node;
2876
+ if (!common || typeof common.get !== "function") {
2877
+ return void 0;
2878
+ }
2879
+ const nested = common.get("HEAD");
2880
+ if (nested instanceof List) {
2881
+ return nested.index(0) ?? common;
2882
+ }
2883
+ if (nested instanceof _Common) {
2884
+ return nested;
2885
+ }
2886
+ return common;
2887
+ }
2794
2888
  getOriginalHeadRecord() {
2795
- return get(this, ORIG_HEAD_TAG) || get(this.getGedcom(), ORIG_HEAD_TAG) || get(this.getHeadRecord(), ORIG_HEAD_TAG);
2889
+ return this.unwrapHeadRecord(get(this, ORIG_HEAD_TAG)) || this.unwrapHeadRecord(get(this.getGedcom(), ORIG_HEAD_TAG)) || this.unwrapHeadRecord(get(this.getHeadRecord(), ORIG_HEAD_TAG));
2796
2890
  }
2797
2891
  getSourceHeads() {
2798
2892
  const heads = [this.getOriginalHeadRecord(), this.getHeadRecord()];
@@ -2800,9 +2894,23 @@ var Common = class _Common {
2800
2894
  return Boolean(head && heads.indexOf(head) === index);
2801
2895
  });
2802
2896
  }
2897
+ sourceHeadField(head, path) {
2898
+ const normalized = path.endsWith(".value") ? path.slice(0, -".value".length) : path;
2899
+ const node = head.get(normalized);
2900
+ if (!node) {
2901
+ return void 0;
2902
+ }
2903
+ if (node instanceof List) {
2904
+ return node.index(0)?.toValue();
2905
+ }
2906
+ if (typeof node.toValue === "function") {
2907
+ return node.toValue();
2908
+ }
2909
+ return void 0;
2910
+ }
2803
2911
  getFromSourceHeads(path) {
2804
2912
  for (const head of this.getSourceHeads()) {
2805
- const value = get(head, path);
2913
+ const value = this.sourceHeadField(head, path);
2806
2914
  if (value !== void 0 && value !== null && value !== "") {
2807
2915
  return value;
2808
2916
  }
@@ -2811,8 +2919,8 @@ var Common = class _Common {
2811
2919
  }
2812
2920
  sourStartsWith(prefix) {
2813
2921
  return this.getSourceHeads().some((head) => {
2814
- const sour = get(head, "SOUR.value");
2815
- return !!sour?.toLowerCase()?.startsWith(prefix);
2922
+ const sour = this.sourceHeadField(head, "SOUR");
2923
+ return typeof sour === "string" && sour.toLowerCase().startsWith(prefix);
2816
2924
  });
2817
2925
  }
2818
2926
  isGenoPro() {
@@ -2822,7 +2930,7 @@ var Common = class _Common {
2822
2930
  return this.sourStartsWith("ahnenblatt");
2823
2931
  }
2824
2932
  isGeni() {
2825
- return this.sourStartsWith("geni");
2933
+ return this.sourStartsWith("geni.com");
2826
2934
  }
2827
2935
  isAncestry() {
2828
2936
  return this.sourStartsWith("ancestry");
@@ -2830,6 +2938,51 @@ var Common = class _Common {
2830
2938
  isMyHeritage() {
2831
2939
  return this.sourStartsWith("myheritage");
2832
2940
  }
2941
+ /**
2942
+ * GEDCOM root for Ancestry media helpers.
2943
+ * `this._gedcom` when called on a child record; `this` when called on the file root.
2944
+ *
2945
+ * Cannot use `instanceof GedCom`: `GedComType` is a type alias (erased at runtime),
2946
+ * and importing the `GedCom` class here would cycle (`GedCom extends Common`).
2947
+ * The root is the only Common with an `objes()` method.
2948
+ */
2949
+ hostGedcom() {
2950
+ const linked = this.getGedcom();
2951
+ if (linked) {
2952
+ return linked;
2953
+ }
2954
+ if ("objes" in this && typeof this.objes === "function") {
2955
+ return this;
2956
+ }
2957
+ return void 0;
2958
+ }
2959
+ /** True when the file still has Ancestry tree media (`_ORIG acom`, `_OID`, retrieval URL). */
2960
+ hasAncestryOriginMedia() {
2961
+ const objes = this.hostGedcom()?.objes?.();
2962
+ return objes?.values().some((obje) => isAncestryOriginObje(obje)) ?? false;
2963
+ }
2964
+ /**
2965
+ * Namespace for Ancestry tree photos. Prefer a `namespaces/{id}` FILE URL
2966
+ * (TreeViz GEDCOM 7 / GEDZIP export), otherwise 1093 for member-tree media.
2967
+ */
2968
+ getAncestryMediaNamespace() {
2969
+ const objes = this.hostGedcom()?.objes?.();
2970
+ if (objes) {
2971
+ for (const obje of objes.values()) {
2972
+ const file = obje?.get("FILE")?.toValue();
2973
+ const fromUrl = parseAncestryNamespaceFromUrl(
2974
+ typeof file === "string" ? file : void 0
2975
+ );
2976
+ if (fromUrl) {
2977
+ return fromUrl;
2978
+ }
2979
+ }
2980
+ }
2981
+ if (this.isAncestry() || this.hasAncestryOriginMedia()) {
2982
+ return ANCESTRY_TREE_MEDIA_NAMESPACE;
2983
+ }
2984
+ return void 0;
2985
+ }
2833
2986
  /**
2834
2987
  * Get the source type as a string (for prefixing tree IDs and names)
2835
2988
  * Returns the detected source type or undefined if unknown
@@ -2846,13 +2999,13 @@ var Common = class _Common {
2846
2999
  }
2847
3000
  isFamilySearch() {
2848
3001
  return this.getSourceHeads().some((head) => {
2849
- const sourName = get(head, "SOUR.NAME.value");
3002
+ const sourName = this.sourceHeadField(head, "SOUR.NAME");
2850
3003
  return sourName === "FamilySearch API";
2851
3004
  });
2852
3005
  }
2853
3006
  isGNO2GED() {
2854
3007
  return this.getSourceHeads().some((head) => {
2855
- const sour = get(head, "SOUR.value");
3008
+ const sour = this.sourceHeadField(head, "SOUR");
2856
3009
  return sour === "GNO2GED";
2857
3010
  });
2858
3011
  }
@@ -2897,8 +3050,7 @@ var Common = class _Common {
2897
3050
  return this.getFromSourceHeads("SOUR._TREE.value") || (get(this, "HEAD.SOUR._TREE.value") || get(this.getGedcom(), "HEAD.SOUR._TREE.value"));
2898
3051
  }
2899
3052
  getMyHeritageTreeName() {
2900
- const path = "HEAD.FILE.value";
2901
- const treeDetails = get(this, path) || get(this.getGedcom(), path);
3053
+ const treeDetails = this.getFromSourceHeads("FILE.value") || (get(this, "HEAD.FILE.value") || get(this.getGedcom(), "HEAD.FILE.value"));
2902
3054
  return treeDetails?.match(
2903
3055
  /Exported by MyHeritage.com from (?<tree>.+) in.+$/
2904
3056
  )?.groups?.tree;
@@ -2915,7 +3067,7 @@ var Common = class _Common {
2915
3067
  if (treeName) {
2916
3068
  return treeName;
2917
3069
  }
2918
- const fileName = get(this, "HEAD.FILE.value") || get(this.getGedcom(), "HEAD.FILE.value");
3070
+ const fileName = this.getFromSourceHeads("FILE.value") || get(this, "HEAD.FILE.value") || get(this.getGedcom(), "HEAD.FILE.value");
2919
3071
  return fileName || "FamilySearch Import";
2920
3072
  }
2921
3073
  getAhnenblattTreeId() {
@@ -4995,6 +5147,28 @@ var resolveLocalMediaUrl = async (path, context) => {
4995
5147
  };
4996
5148
  var implemented = (type, ...args) => {
4997
5149
  };
5150
+
5151
+ // src/utils/multimedia.ts
5152
+ var mergeMediaListsByObjeKey = (...lists) => {
5153
+ const merged = {};
5154
+ const seen = /* @__PURE__ */ new Set();
5155
+ for (const list of lists) {
5156
+ if (!list) {
5157
+ continue;
5158
+ }
5159
+ for (const [id, item] of Object.entries(list)) {
5160
+ const objeKey = item.key ? String(item.key) : "";
5161
+ if (objeKey && seen.has(objeKey)) {
5162
+ continue;
5163
+ }
5164
+ merged[id] = item;
5165
+ if (objeKey) {
5166
+ seen.add(objeKey);
5167
+ }
5168
+ }
5169
+ }
5170
+ return merged;
5171
+ };
4998
5172
  var uniqueItemsCache = /* @__PURE__ */ new WeakMap();
4999
5173
  var setNestedGroup = (obj, key, value, uniqueCounting = true) => {
5000
5174
  const parts = Array.isArray(key) ? key : key.split(/,\s*/);
@@ -5768,10 +5942,12 @@ var relativesOnLevelCache = relativesCache("relativesOnLevelCache");
5768
5942
  var relativesOnDegreeCache = relativesCache("relativesOnDegreeCache");
5769
5943
  var Indi = class extends Common {
5770
5944
  toName() {
5771
- return this.get("NAME")?.toValue();
5945
+ const name = this.get("NAME");
5946
+ const value = name?.index(0)?.toValue() ?? name?.toValue();
5947
+ return typeof value === "string" ? value : void 0;
5772
5948
  }
5773
5949
  toNaturalName() {
5774
- return this.get("NAME")?.toValue()?.replaceAll("/", "");
5950
+ return this.toName()?.replaceAll("/", "");
5775
5951
  }
5776
5952
  toList() {
5777
5953
  return new Individuals().concat(
@@ -6254,7 +6430,10 @@ var Indi = class extends Common {
6254
6430
  return result;
6255
6431
  }
6256
6432
  ancestryLink() {
6257
- const www = this.getFromSourceHeads("SOUR.CORP.WWW.value") || this._gedcom?.HEAD?.SOUR?.CORP?.WWW?.value;
6433
+ let www = this.getFromSourceHeads("SOUR.CORP.WWW.value") || this._gedcom?.HEAD?.SOUR?.CORP?.WWW?.value;
6434
+ if (!www || /treeviz/i.test(String(www))) {
6435
+ www = "www.ancestry.com";
6436
+ }
6258
6437
  const tree = this.getAncestryTreeId();
6259
6438
  if (this.id) {
6260
6439
  return `https://${www}/family-tree/person/tree/${tree}/person/${this.id.replace(
@@ -6266,14 +6445,15 @@ var Indi = class extends Common {
6266
6445
  async ancestryMedia(namespace) {
6267
6446
  const list = {};
6268
6447
  const objeList = this.get("OBJE")?.toList().copy();
6269
- const www = this.getFromSourceHeads("SOUR.CORP.WWW.value") || this._gedcom?.HEAD?.SOUR?.CORP?.WWW?.value;
6448
+ this.getFromSourceHeads("SOUR.CORP.WWW.value") || this._gedcom?.HEAD?.SOUR?.CORP?.WWW?.value;
6270
6449
  const tree = this.getAncestryTreeId();
6450
+ const usedNamespace = namespace || this.getAncestryMediaNamespace() || ANCESTRY_TREE_MEDIA_NAMESPACE;
6271
6451
  if (objeList) {
6272
6452
  await Promise.all(
6273
6453
  objeList.map(async (objeRef) => {
6274
6454
  const key = objeXrefKey(objeRef, 0);
6275
6455
  const obje = objeRef?.standardizeMedia(
6276
- namespace,
6456
+ usedNamespace,
6277
6457
  true,
6278
6458
  ancestryMediaFileUrl
6279
6459
  );
@@ -6285,27 +6465,9 @@ var Indi = class extends Common {
6285
6465
  const type = resolveObjeForm(obje) ?? (url ? getFileExtension(url) : void 0) ?? "raw";
6286
6466
  let imgId = media;
6287
6467
  const hasEmbeddedOrLocalFile = !!url && (url.startsWith("data:") || url.startsWith("blob:") || !/^https?:\/\//i.test(url));
6288
- if (!hasEmbeddedOrLocalFile && (!www || !tree || !this.id)) {
6289
- return;
6290
- }
6291
6468
  if (!this.id) {
6292
6469
  return;
6293
6470
  }
6294
- if (!namespace && !url) {
6295
- try {
6296
- if (media) {
6297
- const mediaDetailsResponse = await fetch(
6298
- `https://www.ancestry.com/api/media/viewer/v2/trees/${tree}/media?id=${media}`
6299
- );
6300
- const mediaDetails = await mediaDetailsResponse.json();
6301
- if (mediaDetails.url) {
6302
- url = `${mediaDetails.url}&imageQuality=hq`;
6303
- }
6304
- }
6305
- } catch (_e) {
6306
- }
6307
- url = url || `https://${www}/mediaui-viewer/tree/${tree}/media/${media}`;
6308
- }
6309
6471
  if (!imgId && hasEmbeddedOrLocalFile && url) {
6310
6472
  imgId = typeof media === "string" && media || `local-${String(key).replace(/[@]/g, "")}-${getFileExtension(url) || "bin"}`;
6311
6473
  }
@@ -6330,14 +6492,25 @@ var Indi = class extends Common {
6330
6492
  }
6331
6493
  return list;
6332
6494
  }
6333
- myheritageLink(poolId = 0) {
6334
- const www = (this.getFromSourceHeads("SOUR.CORP.value") || this._gedcom?.HEAD?.SOUR?.CORP?.value)?.toLowerCase().replace(/^www\./gi, "");
6495
+ myheritageLink(poolId = 0, treeToken) {
6496
+ let www = (this.getFromSourceHeads("SOUR.CORP.value") || this._gedcom?.HEAD?.SOUR?.CORP?.value)?.toLowerCase().replace(/^www\./gi, "");
6497
+ if (!www || /treeviz/i.test(www)) {
6498
+ www = "myheritage.com";
6499
+ }
6500
+ if (!this.id) {
6501
+ return;
6502
+ }
6503
+ const id = Number(this.id.replace(/@|I/g, "")) + poolId;
6504
+ if (!Number.isFinite(id)) {
6505
+ return;
6506
+ }
6507
+ const slug = this.toNaturalName()?.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || String(id);
6508
+ if (treeToken) {
6509
+ return `https://www.${www}/profile-${treeToken}-${id}/${slug}`;
6510
+ }
6335
6511
  const site = this.getMyHeritageTreeId();
6336
- const file = this._gedcom?.HEAD?.get("FILE")?.toValue()?.match(/Exported by MyHeritage.com from .+ in (?<site>.+) on .+$/)?.groups?.site;
6337
- const normalizedFile = file?.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-");
6338
- if (normalizedFile && this.id) {
6339
- const id = Number(this.id.replace(/@|I/g, "")) + poolId;
6340
- return `https://www.${www}/site-family-tree-${site}/${normalizedFile}#!profile-${id}-info`;
6512
+ if (site) {
6513
+ return `https://www.${www}/person-${id}_${site}_${site}/${slug}`;
6341
6514
  }
6342
6515
  }
6343
6516
  myheritageMedia() {
@@ -6386,6 +6559,14 @@ var Indi = class extends Common {
6386
6559
  });
6387
6560
  return list;
6388
6561
  }
6562
+ geniLink() {
6563
+ if (!this.id) {
6564
+ return;
6565
+ }
6566
+ const id = this.id.replace(/@|I/g, "");
6567
+ const given = this.toNaturalName()?.trim().split(/\s+/)[0] || id;
6568
+ return `https://www.geni.com/people/${given}/${id}`;
6569
+ }
6389
6570
  familySearchLink() {
6390
6571
  const wwwTags = this.get("WWW")?.toList();
6391
6572
  const wwwTag = wwwTags?.find((wwwTag2) => {
@@ -6554,16 +6735,26 @@ var Indi = class extends Common {
6554
6735
  return list;
6555
6736
  }
6556
6737
  async multimedia(namespace) {
6557
- if (this?.isAncestry()) {
6558
- return await this.ancestryMedia(namespace);
6738
+ const lists = [];
6739
+ const ownObjes = this.get("OBJE")?.toList()?.values() ?? [];
6740
+ const ownAncestryMedia = ownObjes.some(
6741
+ (obje) => !!obje && (isAncestryOriginObje(obje) || isAncestryOriginObje(obje.ref))
6742
+ );
6743
+ if (this.isAncestry() || ownAncestryMedia) {
6744
+ lists.push(
6745
+ await this.ancestryMedia(
6746
+ namespace || this.getAncestryMediaNamespace()
6747
+ )
6748
+ );
6559
6749
  }
6560
6750
  if (this?.isMyHeritage()) {
6561
- return this.myheritageMedia();
6751
+ lists.push(this.myheritageMedia());
6562
6752
  }
6563
6753
  if (this?.isGeni()) {
6564
- return this.geniMedia();
6754
+ lists.push(this.geniMedia());
6565
6755
  }
6566
- return this.universalMedia();
6756
+ lists.push(this.universalMedia());
6757
+ return mergeMediaListsByObjeKey(...lists);
6567
6758
  }
6568
6759
  async getProfilePicture(namespace, onlyPrimary = true) {
6569
6760
  if (!this.id) {
@@ -6656,12 +6847,15 @@ var Indi = class extends Common {
6656
6847
  );
6657
6848
  return void 0;
6658
6849
  }
6659
- link(poolId) {
6850
+ link(poolId, treeToken) {
6660
6851
  if (this?.isAncestry()) {
6661
6852
  return this.ancestryLink();
6662
6853
  }
6663
6854
  if (this?.isMyHeritage()) {
6664
- return this.myheritageLink(poolId);
6855
+ return this.myheritageLink(poolId, treeToken);
6856
+ }
6857
+ if (this?.isGeni()) {
6858
+ return this.geniLink();
6665
6859
  }
6666
6860
  if (this?.isFamilySearch()) {
6667
6861
  return this.familySearchLink();
@@ -1 +1 @@
1
- {"version":3,"file":"kinship-translator.en.d.ts","sourceRoot":"","sources":["../../src/kinship-translator/kinship-translator.en.ts"],"names":[],"mappings":"AAGA,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAGhE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,sBAAsB;IACtE,OAAO,CAAC,YAAY;IAiBpB,QAAQ;IAaR,OAAO;IAcP,MAAM;IAeN,OAAO;IAkBP,MAAM;IAcN,KAAK;IAcL,OAAO;IAYP,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAYvC,MAAM;IAYN,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAmBtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAmBtC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IA0BhC,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAiCnC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;CAO1C"}
1
+ {"version":3,"file":"kinship-translator.en.d.ts","sourceRoot":"","sources":["../../src/kinship-translator/kinship-translator.en.ts"],"names":[],"mappings":"AAGA,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAGhE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,sBAAsB;IACtE,OAAO,CAAC,YAAY;IAiBpB,QAAQ;IAaR,OAAO;IAcP,MAAM;IAeN,OAAO;IAkBP,MAAM;IAcN,KAAK;IAcL,OAAO;IAYP,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAYvC,MAAM;IAYN,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAmBtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAmBtC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IA0BhC,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAiCnC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;CAe1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"kinship-translator.hu.d.ts","sourceRoot":"","sources":["../../src/kinship-translator/kinship-translator.hu.ts"],"names":[],"mappings":"AAGA,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAIhE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,sBAAsB;IACtE,OAAO,CAAC,YAAY;IA6BpB,OAAO,CAAC,YAAY;IA+BpB,QAAQ;IAaR,OAAO;IAgBP,MAAM;IA6BN,OAAO;IAmCP,MAAM;IA+BN,KAAK;IAYL,OAAO;IAIP,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAcvC;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAalB,MAAM;IAYN,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAmBtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAuBtC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAoChC,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IA6CnC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;CAO1C"}
1
+ {"version":3,"file":"kinship-translator.hu.d.ts","sourceRoot":"","sources":["../../src/kinship-translator/kinship-translator.hu.ts"],"names":[],"mappings":"AAGA,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAIhE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,sBAAsB;IACtE,OAAO,CAAC,YAAY;IA6BpB,OAAO,CAAC,YAAY;IA+BpB,QAAQ;IAaR,OAAO;IAgBP,MAAM;IA6BN,OAAO;IAmCP,MAAM;IA+BN,KAAK;IAYL,OAAO;IAIP,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAcvC;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAalB,MAAM;IAYN,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAmBtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAuBtC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAoChC,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IA6CnC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;CAc1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"kinship-translator.ja.d.ts","sourceRoot":"","sources":["../../src/kinship-translator/kinship-translator.ja.ts"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAgFhE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,sBAAsB;IACtE,QAAQ;IAQR,OAAO;IAeP,MAAM;IAiBN,OAAO;IAiBP,MAAM;IAQN,KAAK;IAQL,OAAO;IAIP,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAOvC,MAAM;IAIN,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAatC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAStC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAsBhC,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAanC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;CA+B1C"}
1
+ {"version":3,"file":"kinship-translator.ja.d.ts","sourceRoot":"","sources":["../../src/kinship-translator/kinship-translator.ja.ts"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAqHhE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,sBAAsB;IACtE,QAAQ;IAQR,OAAO;IAeP,MAAM;IAiBN,OAAO;IAiBP,MAAM;IAQN,KAAK;IAQL,OAAO;IAIP,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAOvC,MAAM;IAIN,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAatC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAStC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAsBhC,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAanC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;CA+B1C"}
@@ -1,6 +1,17 @@
1
1
  import type { IndiType } from "../classes/indi";
2
2
  import type { CrossCases } from "./types";
3
- export declare const parentRelationsHu: Record<string, string>;
3
+ /**
4
+ * A string is the same in both directions (mostoha apa / mostoha gyermek).
5
+ * A directed pair flips with the link: the ancestor is the one who raises
6
+ * or adopts (nevelő, örökbefogadó); everyone else was raised or adopted
7
+ * (nevelt, örökbefogadott).
8
+ */
9
+ export type ParentRelationLabel = string | {
10
+ ancestor: string;
11
+ other: string;
12
+ };
13
+ export declare const parentRelationsHu: Record<string, ParentRelationLabel>;
14
+ export declare const parentRelationPrefix: (relation: string, ancestor: boolean) => string | undefined;
4
15
  export declare const casesHu: CrossCases;
5
16
  export declare const InLawsHu: Record<string, string | ((indi?: IndiType) => string | undefined)>;
6
17
  //# sourceMappingURL=patterns.hu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"patterns.hu.d.ts","sourceRoot":"","sources":["../../src/kinship-translator/patterns.hu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,SAAS,CAAC;AAErD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMpD,CAAC;AA4EF,eAAO,MAAM,OAAO,EAAE,UAIrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAC5B,MAAM,EACN,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,KAAK,MAAM,GAAG,SAAS,CAAC,CAsBlD,CAAC"}
1
+ {"version":3,"file":"patterns.hu.d.ts","sourceRoot":"","sources":["../../src/kinship-translator/patterns.hu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,SAAS,CAAC;AAErD;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAC5B,MAAM,GACN;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAMjE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAChC,UAAU,MAAM,EAChB,UAAU,OAAO,KACf,MAAM,GAAG,SAWX,CAAC;AAsFF,eAAO,MAAM,OAAO,EAAE,UAIrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAC5B,MAAM,EACN,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,KAAK,MAAM,GAAG,SAAS,CAAC,CAkBlD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"gedzip.d.ts","sourceRoot":"","sources":["../../src/utils/gedzip.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,eAAO,MAAM,WAAW,4CAA4C,CAAC;AACrE,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AACtC,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG;IAC9B,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,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