@treeviz/gedcom-parser 2.1.8 → 2.1.11
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/classes/common.d.ts.map +1 -1
- package/dist/classes/gedcom.d.ts +5 -0
- package/dist/classes/gedcom.d.ts.map +1 -1
- package/dist/classes/index.js +588 -75
- package/dist/classes/indi.d.ts.map +1 -1
- package/dist/classes/obje.d.ts.map +1 -1
- package/dist/cli/index.js +588 -75
- package/dist/constants/index.js +557 -70
- package/dist/factories/index.js +557 -70
- package/dist/index.js +593 -85
- package/dist/interfaces/indi.d.ts +1 -0
- package/dist/interfaces/indi.d.ts.map +1 -1
- package/dist/kinship-translator/index.d.ts +2 -0
- package/dist/kinship-translator/index.d.ts.map +1 -1
- package/dist/kinship-translator/index.js +558 -71
- package/dist/kinship-translator/kinship-translator.ja.d.ts +18 -0
- package/dist/kinship-translator/kinship-translator.ja.d.ts.map +1 -0
- package/dist/kinship-translator/kinship-translator.zh.d.ts +18 -0
- package/dist/kinship-translator/kinship-translator.zh.d.ts.map +1 -0
- package/dist/kinship-translator/patterns.ja.d.ts +2 -0
- package/dist/kinship-translator/patterns.ja.d.ts.map +1 -0
- package/dist/kinship-translator/patterns.zh.d.ts +2 -0
- package/dist/kinship-translator/patterns.zh.d.ts.map +1 -0
- package/dist/kinship-translator/translators.d.ts +2 -0
- package/dist/kinship-translator/translators.d.ts.map +1 -1
- package/dist/kinship-translator/types.d.ts +1 -1
- package/dist/kinship-translator/types.d.ts.map +1 -1
- package/dist/utils/cache.d.ts.map +1 -1
- package/dist/utils/gedzip.d.ts.map +1 -1
- package/dist/utils/index.js +593 -85
- package/dist/utils/local-media.d.ts +7 -3
- package/dist/utils/local-media.d.ts.map +1 -1
- package/dist/utils/media-utils.d.ts +20 -0
- package/dist/utils/media-utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -195,7 +195,9 @@ __export(translators_exports, {
|
|
|
195
195
|
es: () => KinshipTranslatorEs,
|
|
196
196
|
fr: () => KinshipTranslatorFr,
|
|
197
197
|
hu: () => KinshipTranslatorHU,
|
|
198
|
-
|
|
198
|
+
ja: () => KinshipTranslatorJa,
|
|
199
|
+
ru: () => KinshipTranslatorRu,
|
|
200
|
+
zh: () => KinshipTranslatorZh
|
|
199
201
|
});
|
|
200
202
|
|
|
201
203
|
// src/utils/ordinalize.ts
|
|
@@ -1491,6 +1493,445 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
|
|
|
1491
1493
|
}
|
|
1492
1494
|
};
|
|
1493
1495
|
|
|
1496
|
+
// src/kinship-translator/patterns.ja.ts
|
|
1497
|
+
var InLawsJa = {
|
|
1498
|
+
"(\u5B50|\u5A18|\u606F\u5B50)\u306E\u914D\u5076\u8005": "\u7FA9\u7406\u306E\u5B50",
|
|
1499
|
+
"(\u5B50|\u5A18|\u606F\u5B50)\u306E\u59BB": "\u5AC1",
|
|
1500
|
+
"(\u5B50|\u5A18|\u606F\u5B50)\u306E\u592B": "\u5A7F",
|
|
1501
|
+
"(\u914D\u5076\u8005|\u59BB|\u592B)\u306E\u6BCD": "\u7FA9\u6BCD",
|
|
1502
|
+
"(\u914D\u5076\u8005|\u59BB|\u592B)\u306E\u7236": "\u7FA9\u7236",
|
|
1503
|
+
"(\u914D\u5076\u8005|\u59BB|\u592B)\u306E\u89AA": "\u7FA9\u7406\u306E\u89AA",
|
|
1504
|
+
"(\u7570\u7236\u6BCD\u306E)?(\u5144\u5F1F|\u59C9\u59B9|\u5144\u5F1F\u59C9\u59B9)\u306E\u59BB": "\u7FA9\u7406\u306E\u59C9\u59B9",
|
|
1505
|
+
"(\u7570\u7236\u6BCD\u306E)?(\u5144\u5F1F|\u59C9\u59B9|\u5144\u5F1F\u59C9\u59B9)\u306E\u592B": "\u7FA9\u7406\u306E\u5144\u5F1F",
|
|
1506
|
+
"(\u7570\u7236\u6BCD\u306E)?(\u5144\u5F1F|\u59C9\u59B9|\u5144\u5F1F\u59C9\u59B9)\u306E\u914D\u5076\u8005": "\u7FA9\u7406\u306E\u5144\u5F1F\u59C9\u59B9",
|
|
1507
|
+
"(\u7570\u7236\u6BCD\u306E)?\u59C9\u59B9\u306E(\u914D\u5076\u8005|\u59BB|\u592B)": "\u7FA9\u7406\u306E\u59C9\u59B9",
|
|
1508
|
+
"(\u7570\u7236\u6BCD\u306E)?\u5144\u5F1F\u306E(\u914D\u5076\u8005|\u59BB|\u592B)": "\u7FA9\u7406\u306E\u5144\u5F1F",
|
|
1509
|
+
"(\u7570\u7236\u6BCD\u306E)?\u5144\u5F1F\u59C9\u59B9\u306E(\u914D\u5076\u8005|\u59BB|\u592B)": "\u7FA9\u7406\u306E\u5144\u5F1F\u59C9\u59B9",
|
|
1510
|
+
"(\u7570\u7236\u6BCD\u306E)?(\u914D\u5076\u8005|\u59BB|\u592B)\u306E\u59C9\u59B9": "\u7FA9\u7406\u306E\u59C9\u59B9",
|
|
1511
|
+
"(\u7570\u7236\u6BCD\u306E)?(\u914D\u5076\u8005|\u59BB|\u592B)\u306E\u5144\u5F1F": "\u7FA9\u7406\u306E\u5144\u5F1F",
|
|
1512
|
+
"(\u7570\u7236\u6BCD\u306E)?(\u914D\u5076\u8005|\u59BB|\u592B)\u306E\u5144\u5F1F\u59C9\u59B9": "\u7FA9\u7406\u306E\u5144\u5F1F\u59C9\u59B9"
|
|
1513
|
+
};
|
|
1514
|
+
|
|
1515
|
+
// src/kinship-translator/kinship-translator.ja.ts
|
|
1516
|
+
var sexOf2 = (person) => {
|
|
1517
|
+
if (person?.isMale?.()) {
|
|
1518
|
+
return "m";
|
|
1519
|
+
}
|
|
1520
|
+
if (person?.isFemale?.()) {
|
|
1521
|
+
return "f";
|
|
1522
|
+
}
|
|
1523
|
+
return "n";
|
|
1524
|
+
};
|
|
1525
|
+
var pick = (sex, male, female, neutral) => {
|
|
1526
|
+
if (sex === "m") {
|
|
1527
|
+
return male;
|
|
1528
|
+
}
|
|
1529
|
+
if (sex === "f") {
|
|
1530
|
+
return female;
|
|
1531
|
+
}
|
|
1532
|
+
return neutral;
|
|
1533
|
+
};
|
|
1534
|
+
var lineal = (level, sex, kind) => {
|
|
1535
|
+
const L = Math.max(1, level);
|
|
1536
|
+
if (kind === "asc") {
|
|
1537
|
+
if (L <= 1) {
|
|
1538
|
+
return pick(sex, "\u7236", "\u6BCD", "\u89AA");
|
|
1539
|
+
}
|
|
1540
|
+
if (L === 2) {
|
|
1541
|
+
return pick(sex, "\u7956\u7236", "\u7956\u6BCD", "\u7956\u7236\u6BCD");
|
|
1542
|
+
}
|
|
1543
|
+
if (L === 3) {
|
|
1544
|
+
return pick(sex, "\u66FE\u7956\u7236", "\u66FE\u7956\u6BCD", "\u66FE\u7956\u7236\u6BCD");
|
|
1545
|
+
}
|
|
1546
|
+
if (L === 4) {
|
|
1547
|
+
return pick(sex, "\u9AD8\u7956\u7236", "\u9AD8\u7956\u6BCD", "\u9AD8\u7956\u7236\u6BCD");
|
|
1548
|
+
}
|
|
1549
|
+
return pick(
|
|
1550
|
+
sex,
|
|
1551
|
+
`${L - 1}\u4E16\u306E\u7956\u7236`,
|
|
1552
|
+
`${L - 1}\u4E16\u306E\u7956\u6BCD`,
|
|
1553
|
+
`${L - 1}\u4E16\u306E\u7956\u7236\u6BCD`
|
|
1554
|
+
);
|
|
1555
|
+
}
|
|
1556
|
+
if (L <= 1) {
|
|
1557
|
+
return pick(sex, "\u606F\u5B50", "\u5A18", "\u5B50");
|
|
1558
|
+
}
|
|
1559
|
+
if (L === 2) {
|
|
1560
|
+
return "\u5B6B";
|
|
1561
|
+
}
|
|
1562
|
+
if (L === 3) {
|
|
1563
|
+
return "\u66FE\u5B6B";
|
|
1564
|
+
}
|
|
1565
|
+
if (L === 4) {
|
|
1566
|
+
return "\u7384\u5B6B";
|
|
1567
|
+
}
|
|
1568
|
+
return `${L - 1}\u4E16\u306E\u5B6B`;
|
|
1569
|
+
};
|
|
1570
|
+
var cousinPlain = (degree) => {
|
|
1571
|
+
if (degree <= 1) {
|
|
1572
|
+
return "\u3044\u3068\u3053";
|
|
1573
|
+
}
|
|
1574
|
+
if (degree === 2) {
|
|
1575
|
+
return "\u307E\u305F\u3044\u3068\u3053";
|
|
1576
|
+
}
|
|
1577
|
+
if (degree === 3) {
|
|
1578
|
+
return "\u306F\u3068\u3053";
|
|
1579
|
+
}
|
|
1580
|
+
return `${degree}\u89AA\u7B49\u306E\u3044\u3068\u3053`;
|
|
1581
|
+
};
|
|
1582
|
+
var KinshipTranslatorJa = class extends KinshipTranslatorBasic {
|
|
1583
|
+
indirect() {
|
|
1584
|
+
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
1585
|
+
if (degree > 0) {
|
|
1586
|
+
degree = degree - 1;
|
|
1587
|
+
}
|
|
1588
|
+
return cousinPlain(degree);
|
|
1589
|
+
}
|
|
1590
|
+
removal() {
|
|
1591
|
+
const level = this.pathN?.level ?? 0;
|
|
1592
|
+
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
1593
|
+
if (degree > 0) {
|
|
1594
|
+
degree = degree - 1;
|
|
1595
|
+
}
|
|
1596
|
+
if (!degree) {
|
|
1597
|
+
return level < 0 ? this.nibling() : this.auncle();
|
|
1598
|
+
}
|
|
1599
|
+
const removed = Math.abs(level);
|
|
1600
|
+
return `${cousinPlain(degree)}\uFF08${removed}\u4E16\u4EE3\u9055\u3044\uFF09`;
|
|
1601
|
+
}
|
|
1602
|
+
auncle() {
|
|
1603
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
1604
|
+
const sex = sexOf2(this.personN);
|
|
1605
|
+
if (level <= 2) {
|
|
1606
|
+
return pick(sex, "\u304A\u3058", "\u304A\u3070", "\u304A\u3058/\u304A\u3070");
|
|
1607
|
+
}
|
|
1608
|
+
if (level === 3) {
|
|
1609
|
+
return pick(sex, "\u5927\u304A\u3058", "\u5927\u304A\u3070", "\u5927\u304A\u3058/\u5927\u304A\u3070");
|
|
1610
|
+
}
|
|
1611
|
+
return pick(
|
|
1612
|
+
sex,
|
|
1613
|
+
`${level - 2}\u4EE3\u524D\u306E\u304A\u3058`,
|
|
1614
|
+
`${level - 2}\u4EE3\u524D\u306E\u304A\u3070`,
|
|
1615
|
+
`${level - 2}\u4EE3\u524D\u306E\u304A\u3058/\u304A\u3070`
|
|
1616
|
+
);
|
|
1617
|
+
}
|
|
1618
|
+
nibling() {
|
|
1619
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
1620
|
+
const sex = sexOf2(this.personN);
|
|
1621
|
+
if (level <= 2) {
|
|
1622
|
+
return pick(sex, "\u7525", "\u59EA", "\u7525/\u59EA");
|
|
1623
|
+
}
|
|
1624
|
+
if (level === 3) {
|
|
1625
|
+
return pick(sex, "\u5927\u7525", "\u5927\u59EA", "\u5927\u7525/\u5927\u59EA");
|
|
1626
|
+
}
|
|
1627
|
+
return pick(
|
|
1628
|
+
sex,
|
|
1629
|
+
`${level - 2}\u4EE3\u4E0B\u306E\u7525`,
|
|
1630
|
+
`${level - 2}\u4EE3\u4E0B\u306E\u59EA`,
|
|
1631
|
+
`${level - 2}\u4EE3\u4E0B\u306E\u7525/\u59EA`
|
|
1632
|
+
);
|
|
1633
|
+
}
|
|
1634
|
+
parent() {
|
|
1635
|
+
return lineal(
|
|
1636
|
+
Math.abs(this.pathN?.level ?? 0),
|
|
1637
|
+
sexOf2(this.personN),
|
|
1638
|
+
"asc"
|
|
1639
|
+
);
|
|
1640
|
+
}
|
|
1641
|
+
child() {
|
|
1642
|
+
return lineal(
|
|
1643
|
+
Math.abs(this.pathN?.level ?? 0),
|
|
1644
|
+
sexOf2(this.personN),
|
|
1645
|
+
"desc"
|
|
1646
|
+
);
|
|
1647
|
+
}
|
|
1648
|
+
sibling() {
|
|
1649
|
+
return pick(sexOf2(this.personN), "\u5144\u5F1F", "\u59C9\u59B9", "\u5144\u5F1F\u59C9\u59B9");
|
|
1650
|
+
}
|
|
1651
|
+
halfBlood(relation) {
|
|
1652
|
+
if (!relation || !this.isHalfBlood) {
|
|
1653
|
+
return relation ?? "";
|
|
1654
|
+
}
|
|
1655
|
+
return `\u7570\u7236\u6BCD\u306E${relation}`;
|
|
1656
|
+
}
|
|
1657
|
+
spouse() {
|
|
1658
|
+
return pick(sexOf2(this.personN), "\u592B", "\u59BB", "\u914D\u5076\u8005");
|
|
1659
|
+
}
|
|
1660
|
+
ofSpouse(relation) {
|
|
1661
|
+
if (!relation) {
|
|
1662
|
+
return "";
|
|
1663
|
+
}
|
|
1664
|
+
const spouseType = pick(
|
|
1665
|
+
sexOf2(this.path?.[1].indi),
|
|
1666
|
+
"\u592B",
|
|
1667
|
+
"\u59BB",
|
|
1668
|
+
"\u914D\u5076\u8005"
|
|
1669
|
+
);
|
|
1670
|
+
return `${spouseType}\u306E${relation}`;
|
|
1671
|
+
}
|
|
1672
|
+
spouseOf(relation) {
|
|
1673
|
+
if (!relation) {
|
|
1674
|
+
return "";
|
|
1675
|
+
}
|
|
1676
|
+
const spouse = this.path?.[this.path.length - 1].indi;
|
|
1677
|
+
const spouseType = pick(sexOf2(spouse), "\u592B", "\u59BB", "\u914D\u5076\u8005");
|
|
1678
|
+
return `${relation}\u306E${spouseType}`;
|
|
1679
|
+
}
|
|
1680
|
+
of(relation) {
|
|
1681
|
+
const formattedName = nameFormatter(this.path?.[0]?.indi, {
|
|
1682
|
+
nameOrder: "last-first"
|
|
1683
|
+
});
|
|
1684
|
+
let name = formattedName.inOrder.filter(Boolean).join(" ");
|
|
1685
|
+
if (this.displayName === "none") {
|
|
1686
|
+
name = "";
|
|
1687
|
+
} else if (this.displayName === "givenname") {
|
|
1688
|
+
name = formattedName.givenname;
|
|
1689
|
+
} else if (this.displayName === "surname") {
|
|
1690
|
+
name = `${formattedName.surname}`;
|
|
1691
|
+
}
|
|
1692
|
+
if (!name || !relation) {
|
|
1693
|
+
return relation ?? "";
|
|
1694
|
+
}
|
|
1695
|
+
return `${name}\u306E${relation}`;
|
|
1696
|
+
}
|
|
1697
|
+
inLaw(relation) {
|
|
1698
|
+
let inLawRelation = relation;
|
|
1699
|
+
Object.keys(InLawsJa).find((pattern) => {
|
|
1700
|
+
const regex = new RegExp(`^${pattern}$`);
|
|
1701
|
+
if (relation?.match(regex)) {
|
|
1702
|
+
inLawRelation = InLawsJa[pattern];
|
|
1703
|
+
return true;
|
|
1704
|
+
}
|
|
1705
|
+
return false;
|
|
1706
|
+
});
|
|
1707
|
+
return inLawRelation ?? "";
|
|
1708
|
+
}
|
|
1709
|
+
relationType(relation) {
|
|
1710
|
+
if (!relation || !this.pathN?.relation) {
|
|
1711
|
+
return relation ?? "";
|
|
1712
|
+
}
|
|
1713
|
+
return `${this.pathN.relation}\u306E${relation}`;
|
|
1714
|
+
}
|
|
1715
|
+
};
|
|
1716
|
+
|
|
1717
|
+
// src/kinship-translator/patterns.zh.ts
|
|
1718
|
+
var InLawsZh = {
|
|
1719
|
+
"(\u5B50\u5973|\u5973\u513F|\u513F\u5B50)\u7684\u914D\u5076": "\u513F\u5AB3/\u5973\u5A7F",
|
|
1720
|
+
"(\u5B50\u5973|\u5973\u513F|\u513F\u5B50)\u7684\u59BB\u5B50": "\u513F\u5AB3",
|
|
1721
|
+
"(\u5B50\u5973|\u5973\u513F|\u513F\u5B50)\u7684\u4E08\u592B": "\u5973\u5A7F",
|
|
1722
|
+
"(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u6BCD\u4EB2": "\u5CB3\u6BCD/\u5A46\u5A46",
|
|
1723
|
+
"(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u7236\u4EB2": "\u5CB3\u7236/\u516C\u516C",
|
|
1724
|
+
"(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u7236\u6BCD": "\u5CB3\u7236\u5CB3\u6BCD/\u516C\u516C\u5A46\u5A46",
|
|
1725
|
+
"(\u5F02\u7236\u6BCD\u7684)?(\u5144\u5F1F\u59D0\u59B9|\u59D0\u59B9|\u5144\u5F1F)\u7684\u59BB\u5B50": "\u5AC2\u5B50/\u5F1F\u59B9",
|
|
1726
|
+
"(\u5F02\u7236\u6BCD\u7684)?(\u5144\u5F1F\u59D0\u59B9|\u59D0\u59B9|\u5144\u5F1F)\u7684\u4E08\u592B": "\u59D0\u592B/\u59B9\u592B",
|
|
1727
|
+
"(\u5F02\u7236\u6BCD\u7684)?(\u5144\u5F1F\u59D0\u59B9|\u59D0\u59B9|\u5144\u5F1F)\u7684\u914D\u5076": "\u59FB\u4EB2\u5144\u5F1F\u59D0\u59B9",
|
|
1728
|
+
"(\u5F02\u7236\u6BCD\u7684)?\u59D0\u59B9\u7684(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)": "\u59D0\u592B/\u59B9\u592B",
|
|
1729
|
+
"(\u5F02\u7236\u6BCD\u7684)?\u5144\u5F1F\u7684(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)": "\u5AC2\u5B50/\u5F1F\u59B9",
|
|
1730
|
+
"(\u5F02\u7236\u6BCD\u7684)?\u5144\u5F1F\u59D0\u59B9\u7684(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)": "\u59FB\u4EB2\u5144\u5F1F\u59D0\u59B9",
|
|
1731
|
+
"(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u59D0\u59B9": "\u59D1\u5B50/\u59E8\u5B50",
|
|
1732
|
+
"(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u5144\u5F1F": "\u5927\u4F2F/\u5C0F\u53D4/\u5185\u5144/\u5185\u5F1F",
|
|
1733
|
+
"(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u5144\u5F1F\u59D0\u59B9": "\u59FB\u4EB2\u5144\u5F1F\u59D0\u59B9"
|
|
1734
|
+
};
|
|
1735
|
+
|
|
1736
|
+
// src/kinship-translator/kinship-translator.zh.ts
|
|
1737
|
+
var sexOf3 = (person) => {
|
|
1738
|
+
if (person?.isMale?.()) {
|
|
1739
|
+
return "m";
|
|
1740
|
+
}
|
|
1741
|
+
if (person?.isFemale?.()) {
|
|
1742
|
+
return "f";
|
|
1743
|
+
}
|
|
1744
|
+
return "n";
|
|
1745
|
+
};
|
|
1746
|
+
var pick2 = (sex, male, female, neutral) => {
|
|
1747
|
+
if (sex === "m") {
|
|
1748
|
+
return male;
|
|
1749
|
+
}
|
|
1750
|
+
if (sex === "f") {
|
|
1751
|
+
return female;
|
|
1752
|
+
}
|
|
1753
|
+
return neutral;
|
|
1754
|
+
};
|
|
1755
|
+
var lineal2 = (level, sex, kind) => {
|
|
1756
|
+
const L = Math.max(1, level);
|
|
1757
|
+
if (kind === "asc") {
|
|
1758
|
+
if (L <= 1) {
|
|
1759
|
+
return pick2(sex, "\u7236\u4EB2", "\u6BCD\u4EB2", "\u7236\u6BCD");
|
|
1760
|
+
}
|
|
1761
|
+
if (L === 2) {
|
|
1762
|
+
return pick2(sex, "\u7956\u7236", "\u7956\u6BCD", "\u7956\u7236\u6BCD");
|
|
1763
|
+
}
|
|
1764
|
+
if (L === 3) {
|
|
1765
|
+
return pick2(sex, "\u66FE\u7956\u7236", "\u66FE\u7956\u6BCD", "\u66FE\u7956\u7236\u6BCD");
|
|
1766
|
+
}
|
|
1767
|
+
if (L === 4) {
|
|
1768
|
+
return pick2(sex, "\u9AD8\u7956\u7236", "\u9AD8\u7956\u6BCD", "\u9AD8\u7956\u7236\u6BCD");
|
|
1769
|
+
}
|
|
1770
|
+
return pick2(sex, `${L}\u4E16\u7956`, `${L}\u4E16\u7956\u6BCD`, `${L}\u4E16\u7956\u7236\u6BCD`);
|
|
1771
|
+
}
|
|
1772
|
+
if (L <= 1) {
|
|
1773
|
+
return pick2(sex, "\u513F\u5B50", "\u5973\u513F", "\u5B50\u5973");
|
|
1774
|
+
}
|
|
1775
|
+
if (L === 2) {
|
|
1776
|
+
return pick2(sex, "\u5B59\u5B50", "\u5B59\u5973", "\u5B59\u5B50\u5973");
|
|
1777
|
+
}
|
|
1778
|
+
if (L === 3) {
|
|
1779
|
+
return pick2(sex, "\u66FE\u5B59", "\u66FE\u5B59\u5973", "\u66FE\u5B59\u5B50\u5973");
|
|
1780
|
+
}
|
|
1781
|
+
if (L === 4) {
|
|
1782
|
+
return pick2(sex, "\u7384\u5B59", "\u7384\u5B59\u5973", "\u7384\u5B59\u5B50\u5973");
|
|
1783
|
+
}
|
|
1784
|
+
return pick2(sex, `${L}\u4E16\u5B59`, `${L}\u4E16\u5B59\u5973`, `${L}\u4E16\u5B59\u5B50\u5973`);
|
|
1785
|
+
};
|
|
1786
|
+
var cousinPlain2 = (degree, sex) => {
|
|
1787
|
+
if (degree <= 1) {
|
|
1788
|
+
return pick2(sex, "\u5802\u8868\u5144\u5F1F", "\u5802\u8868\u59D0\u59B9", "\u5802\u8868\u4EB2");
|
|
1789
|
+
}
|
|
1790
|
+
if (degree === 2) {
|
|
1791
|
+
return pick2(sex, "\u4ECE\u5802\u8868\u5144\u5F1F", "\u4ECE\u5802\u8868\u59D0\u59B9", "\u4ECE\u5802\u8868\u4EB2");
|
|
1792
|
+
}
|
|
1793
|
+
return pick2(
|
|
1794
|
+
sex,
|
|
1795
|
+
`${degree}\u4EE3\u5802\u8868\u5144\u5F1F`,
|
|
1796
|
+
`${degree}\u4EE3\u5802\u8868\u59D0\u59B9`,
|
|
1797
|
+
`${degree}\u4EE3\u5802\u8868\u4EB2`
|
|
1798
|
+
);
|
|
1799
|
+
};
|
|
1800
|
+
var KinshipTranslatorZh = class extends KinshipTranslatorBasic {
|
|
1801
|
+
indirect() {
|
|
1802
|
+
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
1803
|
+
if (degree > 0) {
|
|
1804
|
+
degree = degree - 1;
|
|
1805
|
+
}
|
|
1806
|
+
return cousinPlain2(degree, sexOf3(this.personN));
|
|
1807
|
+
}
|
|
1808
|
+
removal() {
|
|
1809
|
+
const level = this.pathN?.level ?? 0;
|
|
1810
|
+
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
1811
|
+
if (degree > 0) {
|
|
1812
|
+
degree = degree - 1;
|
|
1813
|
+
}
|
|
1814
|
+
if (!degree) {
|
|
1815
|
+
return level < 0 ? this.nibling() : this.auncle();
|
|
1816
|
+
}
|
|
1817
|
+
const removed = Math.abs(level);
|
|
1818
|
+
return `${cousinPlain2(degree, sexOf3(this.personN))}\uFF08\u9694${removed}\u4EE3\uFF09`;
|
|
1819
|
+
}
|
|
1820
|
+
auncle() {
|
|
1821
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
1822
|
+
const sex = sexOf3(this.personN);
|
|
1823
|
+
if (level <= 2) {
|
|
1824
|
+
return pick2(sex, "\u53D4\u53D4", "\u963F\u59E8", "\u53D4\u4F2F/\u59D1\u59E8");
|
|
1825
|
+
}
|
|
1826
|
+
if (level === 3) {
|
|
1827
|
+
return pick2(sex, "\u4F2F\u53D4\u7956\u7236", "\u59D1\u7956\u6BCD", "\u4F2F\u53D4\u7956\u7236\u6BCD");
|
|
1828
|
+
}
|
|
1829
|
+
return pick2(
|
|
1830
|
+
sex,
|
|
1831
|
+
`${level - 2}\u4EE3\u524D\u7684\u53D4\u53D4`,
|
|
1832
|
+
`${level - 2}\u4EE3\u524D\u7684\u963F\u59E8`,
|
|
1833
|
+
`${level - 2}\u4EE3\u524D\u7684\u53D4\u4F2F/\u59D1\u59E8`
|
|
1834
|
+
);
|
|
1835
|
+
}
|
|
1836
|
+
nibling() {
|
|
1837
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
1838
|
+
const sex = sexOf3(this.personN);
|
|
1839
|
+
if (level <= 2) {
|
|
1840
|
+
return pick2(sex, "\u4F84\u5B50", "\u4F84\u5973", "\u4F84\u5B50\u5973");
|
|
1841
|
+
}
|
|
1842
|
+
if (level === 3) {
|
|
1843
|
+
return pick2(sex, "\u4F84\u5B59", "\u4F84\u5B59\u5973", "\u4F84\u5B59\u5B50\u5973");
|
|
1844
|
+
}
|
|
1845
|
+
return pick2(
|
|
1846
|
+
sex,
|
|
1847
|
+
`${level - 2}\u4EE3\u4E0B\u7684\u4F84\u5B50`,
|
|
1848
|
+
`${level - 2}\u4EE3\u4E0B\u7684\u4F84\u5973`,
|
|
1849
|
+
`${level - 2}\u4EE3\u4E0B\u7684\u4F84\u5B50\u5973`
|
|
1850
|
+
);
|
|
1851
|
+
}
|
|
1852
|
+
parent() {
|
|
1853
|
+
return lineal2(
|
|
1854
|
+
Math.abs(this.pathN?.level ?? 0),
|
|
1855
|
+
sexOf3(this.personN),
|
|
1856
|
+
"asc"
|
|
1857
|
+
);
|
|
1858
|
+
}
|
|
1859
|
+
child() {
|
|
1860
|
+
return lineal2(
|
|
1861
|
+
Math.abs(this.pathN?.level ?? 0),
|
|
1862
|
+
sexOf3(this.personN),
|
|
1863
|
+
"desc"
|
|
1864
|
+
);
|
|
1865
|
+
}
|
|
1866
|
+
sibling() {
|
|
1867
|
+
return pick2(sexOf3(this.personN), "\u5144\u5F1F", "\u59D0\u59B9", "\u5144\u5F1F\u59D0\u59B9");
|
|
1868
|
+
}
|
|
1869
|
+
halfBlood(relation) {
|
|
1870
|
+
if (!relation || !this.isHalfBlood) {
|
|
1871
|
+
return relation ?? "";
|
|
1872
|
+
}
|
|
1873
|
+
return `\u5F02\u7236\u6BCD\u7684${relation}`;
|
|
1874
|
+
}
|
|
1875
|
+
spouse() {
|
|
1876
|
+
return pick2(sexOf3(this.personN), "\u4E08\u592B", "\u59BB\u5B50", "\u914D\u5076");
|
|
1877
|
+
}
|
|
1878
|
+
ofSpouse(relation) {
|
|
1879
|
+
if (!relation) {
|
|
1880
|
+
return "";
|
|
1881
|
+
}
|
|
1882
|
+
const spouseType = pick2(
|
|
1883
|
+
sexOf3(this.path?.[1].indi),
|
|
1884
|
+
"\u4E08\u592B",
|
|
1885
|
+
"\u59BB\u5B50",
|
|
1886
|
+
"\u914D\u5076"
|
|
1887
|
+
);
|
|
1888
|
+
return `${spouseType}\u7684${relation}`;
|
|
1889
|
+
}
|
|
1890
|
+
spouseOf(relation) {
|
|
1891
|
+
if (!relation) {
|
|
1892
|
+
return "";
|
|
1893
|
+
}
|
|
1894
|
+
const spouse = this.path?.[this.path.length - 1].indi;
|
|
1895
|
+
const spouseType = pick2(sexOf3(spouse), "\u4E08\u592B", "\u59BB\u5B50", "\u914D\u5076");
|
|
1896
|
+
return `${relation}\u7684${spouseType}`;
|
|
1897
|
+
}
|
|
1898
|
+
of(relation) {
|
|
1899
|
+
const formattedName = nameFormatter(this.path?.[0]?.indi, {
|
|
1900
|
+
nameOrder: "last-first"
|
|
1901
|
+
});
|
|
1902
|
+
let name = formattedName.inOrder.filter(Boolean).join(" ");
|
|
1903
|
+
if (this.displayName === "none") {
|
|
1904
|
+
name = "";
|
|
1905
|
+
} else if (this.displayName === "givenname") {
|
|
1906
|
+
name = formattedName.givenname;
|
|
1907
|
+
} else if (this.displayName === "surname") {
|
|
1908
|
+
name = `${formattedName.surname}`;
|
|
1909
|
+
}
|
|
1910
|
+
if (!name || !relation) {
|
|
1911
|
+
return relation ?? "";
|
|
1912
|
+
}
|
|
1913
|
+
return `${name}\u7684${relation}`;
|
|
1914
|
+
}
|
|
1915
|
+
inLaw(relation) {
|
|
1916
|
+
let inLawRelation = relation;
|
|
1917
|
+
Object.keys(InLawsZh).find((pattern) => {
|
|
1918
|
+
const regex = new RegExp(`^${pattern}$`);
|
|
1919
|
+
if (relation?.match(regex)) {
|
|
1920
|
+
inLawRelation = InLawsZh[pattern];
|
|
1921
|
+
return true;
|
|
1922
|
+
}
|
|
1923
|
+
return false;
|
|
1924
|
+
});
|
|
1925
|
+
return inLawRelation ?? "";
|
|
1926
|
+
}
|
|
1927
|
+
relationType(relation) {
|
|
1928
|
+
if (!relation || !this.pathN?.relation) {
|
|
1929
|
+
return relation ?? "";
|
|
1930
|
+
}
|
|
1931
|
+
return `${this.pathN.relation}${relation}`;
|
|
1932
|
+
}
|
|
1933
|
+
};
|
|
1934
|
+
|
|
1494
1935
|
// src/kinship-translator/kinship-translator.ts
|
|
1495
1936
|
var KinshipTranslator = class {
|
|
1496
1937
|
constructor(person1, person2, lang = "en", entirePath, displayName = "givenname") {
|
|
@@ -1851,6 +2292,82 @@ var ORIG_HEAD_TAG = "_ORIGHEAD";
|
|
|
1851
2292
|
// src/utils/gedcom-trailer.ts
|
|
1852
2293
|
var GEDCOM_TRAILER_TAG = "TRLR";
|
|
1853
2294
|
var isGedcomTrailerTag = (tag) => tag === GEDCOM_TRAILER_TAG;
|
|
2295
|
+
|
|
2296
|
+
// src/utils/media-utils.ts
|
|
2297
|
+
var getFileExtension = (filename) => {
|
|
2298
|
+
if (!filename) {
|
|
2299
|
+
return "";
|
|
2300
|
+
}
|
|
2301
|
+
if (filename.startsWith("data:")) {
|
|
2302
|
+
const mime = filename.slice(5).split(";")[0] || "";
|
|
2303
|
+
const subtype = (mime.split("/")[1] || "").toLowerCase();
|
|
2304
|
+
if (subtype === "jpeg") {
|
|
2305
|
+
return "jpg";
|
|
2306
|
+
}
|
|
2307
|
+
return subtype.split("+")[0] || "";
|
|
2308
|
+
}
|
|
2309
|
+
const withoutQuery = filename.split(/[?#]/)[0] || filename;
|
|
2310
|
+
const match = withoutQuery.match(/\.([^.]+)$/);
|
|
2311
|
+
return match ? match[1].toLowerCase() : "";
|
|
2312
|
+
};
|
|
2313
|
+
var isImageFormat = (format2) => {
|
|
2314
|
+
if (!format2) {
|
|
2315
|
+
return false;
|
|
2316
|
+
}
|
|
2317
|
+
let normalized = format2.toLowerCase().trim();
|
|
2318
|
+
if (normalized.startsWith("data:")) {
|
|
2319
|
+
normalized = getFileExtension(normalized);
|
|
2320
|
+
} else if (normalized.includes("/")) {
|
|
2321
|
+
normalized = normalized.split("/")[1]?.split("+")[0] || "";
|
|
2322
|
+
if (normalized === "jpeg") {
|
|
2323
|
+
normalized = "jpg";
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
2326
|
+
const imageFormats = [
|
|
2327
|
+
"jpg",
|
|
2328
|
+
"jpeg",
|
|
2329
|
+
"png",
|
|
2330
|
+
"gif",
|
|
2331
|
+
"bmp",
|
|
2332
|
+
"webp",
|
|
2333
|
+
"svg",
|
|
2334
|
+
"tiff",
|
|
2335
|
+
"tif"
|
|
2336
|
+
];
|
|
2337
|
+
return imageFormats.includes(normalized);
|
|
2338
|
+
};
|
|
2339
|
+
var resolveObjeForm = (obje) => {
|
|
2340
|
+
const value = obje?.get?.("FILE.FORM")?.toValue?.() ?? obje?.get?.("FORM")?.toValue?.();
|
|
2341
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
2342
|
+
};
|
|
2343
|
+
var mediaIdValue = (obje, path) => {
|
|
2344
|
+
const value = obje?.get?.(path)?.toValue?.();
|
|
2345
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
2346
|
+
};
|
|
2347
|
+
var resolveObjeMediaId = (obje) => mediaIdValue(obje, "RIN") || mediaIdValue(obje, "_CLON._OID") || mediaIdValue(obje, "_MSER._LKID") || mediaIdValue(obje, "_OID") || mediaIdValue(obje, "_LKID");
|
|
2348
|
+
var ANCESTRY_MEDIA_RETRIEVAL_PREFIX = "https://www.ancestry.com/api/media/retrieval/v2/image";
|
|
2349
|
+
var ANCESTRY_MEDIA_QUERY = "client=trees-mediaservice&imageQuality=hq";
|
|
2350
|
+
var ancestryMediaPath = (namespace, imgId) => `/namespaces/${namespace}/media/${imgId}?${ANCESTRY_MEDIA_QUERY}`;
|
|
2351
|
+
var ancestryMediaFileUrl = (namespace, imgId) => {
|
|
2352
|
+
if (!namespace || !imgId) {
|
|
2353
|
+
return void 0;
|
|
2354
|
+
}
|
|
2355
|
+
return `${ANCESTRY_MEDIA_RETRIEVAL_PREFIX}${ancestryMediaPath(namespace, imgId)}`;
|
|
2356
|
+
};
|
|
2357
|
+
var objeXrefKey = (obje, fallback = 0) => {
|
|
2358
|
+
if (typeof obje?.id === "string" && obje.id) {
|
|
2359
|
+
return obje.id;
|
|
2360
|
+
}
|
|
2361
|
+
const value = obje?.toValue?.();
|
|
2362
|
+
if (typeof value === "string" && value.trim()) {
|
|
2363
|
+
return value.trim();
|
|
2364
|
+
}
|
|
2365
|
+
if (typeof fallback === "string" && fallback.trim()) {
|
|
2366
|
+
return fallback.trim();
|
|
2367
|
+
}
|
|
2368
|
+
return `@O${fallback}@`;
|
|
2369
|
+
};
|
|
2370
|
+
var objeNoteValue = (obje) => mediaIdValue(obje, "FILE.NOTE") || mediaIdValue(obje, "NOTE") || "";
|
|
1854
2371
|
var List = class _List {
|
|
1855
2372
|
// length = 0;
|
|
1856
2373
|
constructor(items) {
|
|
@@ -2500,7 +3017,7 @@ var Common = class _Common {
|
|
|
2500
3017
|
this,
|
|
2501
3018
|
options.obje.namespace,
|
|
2502
3019
|
options.obje.override,
|
|
2503
|
-
void 0,
|
|
3020
|
+
this.isAncestry() ? ancestryMediaFileUrl : void 0,
|
|
2504
3021
|
options.gedcomVersion
|
|
2505
3022
|
);
|
|
2506
3023
|
}
|
|
@@ -3431,11 +3948,8 @@ var storeCache = {
|
|
|
3431
3948
|
getCacheDbs().relativesOnDegreeCache.setItem(value);
|
|
3432
3949
|
}
|
|
3433
3950
|
}, 50),
|
|
3434
|
-
//
|
|
3951
|
+
// Image bytes are stored as one IndexedDB record per photo.
|
|
3435
3952
|
profilePictureCache: debounce((value) => {
|
|
3436
|
-
if (value) {
|
|
3437
|
-
getCacheDbs().profilePictureCache.setItem(value);
|
|
3438
|
-
}
|
|
3439
3953
|
}, 100)
|
|
3440
3954
|
};
|
|
3441
3955
|
var resetRelativesCache = () => {
|
|
@@ -4122,65 +4636,23 @@ var isRemoteOrEmbeddedMediaUrl = (path) => {
|
|
|
4122
4636
|
}
|
|
4123
4637
|
return path.startsWith("data:") || path.startsWith("blob:") || /^https?:\/\//i.test(path);
|
|
4124
4638
|
};
|
|
4125
|
-
var resolveLocalMediaUrl = async (path) => {
|
|
4639
|
+
var resolveLocalMediaUrl = async (path, context) => {
|
|
4126
4640
|
if (!path) {
|
|
4127
4641
|
return void 0;
|
|
4128
4642
|
}
|
|
4129
|
-
if (
|
|
4643
|
+
if (path.startsWith("data:") || path.startsWith("blob:")) {
|
|
4130
4644
|
return path;
|
|
4131
4645
|
}
|
|
4132
|
-
const resolved = await localMediaResolver?.(path);
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
var implemented = (type, ...args) => {
|
|
4136
|
-
};
|
|
4137
|
-
|
|
4138
|
-
// src/utils/media-utils.ts
|
|
4139
|
-
var getFileExtension = (filename) => {
|
|
4140
|
-
if (!filename) {
|
|
4141
|
-
return "";
|
|
4142
|
-
}
|
|
4143
|
-
if (filename.startsWith("data:")) {
|
|
4144
|
-
const mime = filename.slice(5).split(";")[0] || "";
|
|
4145
|
-
const subtype = (mime.split("/")[1] || "").toLowerCase();
|
|
4146
|
-
if (subtype === "jpeg") {
|
|
4147
|
-
return "jpg";
|
|
4148
|
-
}
|
|
4149
|
-
return subtype.split("+")[0] || "";
|
|
4150
|
-
}
|
|
4151
|
-
const withoutQuery = filename.split(/[?#]/)[0] || filename;
|
|
4152
|
-
const match = withoutQuery.match(/\.([^.]+)$/);
|
|
4153
|
-
return match ? match[1].toLowerCase() : "";
|
|
4154
|
-
};
|
|
4155
|
-
var isImageFormat = (format2) => {
|
|
4156
|
-
if (!format2) {
|
|
4157
|
-
return false;
|
|
4646
|
+
const resolved = await localMediaResolver?.(path, context);
|
|
4647
|
+
if (resolved) {
|
|
4648
|
+
return resolved;
|
|
4158
4649
|
}
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
normalized = getFileExtension(normalized);
|
|
4162
|
-
} else if (normalized.includes("/")) {
|
|
4163
|
-
normalized = normalized.split("/")[1]?.split("+")[0] || "";
|
|
4164
|
-
if (normalized === "jpeg") {
|
|
4165
|
-
normalized = "jpg";
|
|
4166
|
-
}
|
|
4650
|
+
if (/^https?:\/\//i.test(path)) {
|
|
4651
|
+
return path;
|
|
4167
4652
|
}
|
|
4168
|
-
|
|
4169
|
-
"jpg",
|
|
4170
|
-
"jpeg",
|
|
4171
|
-
"png",
|
|
4172
|
-
"gif",
|
|
4173
|
-
"bmp",
|
|
4174
|
-
"webp",
|
|
4175
|
-
"svg",
|
|
4176
|
-
"tiff",
|
|
4177
|
-
"tif"
|
|
4178
|
-
];
|
|
4179
|
-
return imageFormats.includes(normalized);
|
|
4653
|
+
return void 0;
|
|
4180
4654
|
};
|
|
4181
|
-
var
|
|
4182
|
-
const value = obje?.get?.("FILE.FORM")?.toValue?.() ?? obje?.get?.("FORM")?.toValue?.();
|
|
4183
|
-
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
4655
|
+
var implemented = (type, ...args) => {
|
|
4184
4656
|
};
|
|
4185
4657
|
var uniqueItemsCache = /* @__PURE__ */ new WeakMap();
|
|
4186
4658
|
var setNestedGroup = (obj, key, value, uniqueCounting = true) => {
|
|
@@ -5458,22 +5930,19 @@ var Indi = class extends Common {
|
|
|
5458
5930
|
if (objeList) {
|
|
5459
5931
|
await Promise.all(
|
|
5460
5932
|
objeList.map(async (objeRef) => {
|
|
5461
|
-
const key = objeRef
|
|
5933
|
+
const key = objeXrefKey(objeRef, 0);
|
|
5462
5934
|
const obje = objeRef?.standardizeMedia(
|
|
5463
5935
|
namespace,
|
|
5464
5936
|
true,
|
|
5465
|
-
|
|
5466
|
-
return ns && iId ? `https://mediasvc.ancestry.com/v2/image/namespaces/${ns}/media/${iId}?client=trees-mediaservice&imageQuality=hq` : void 0;
|
|
5467
|
-
}
|
|
5937
|
+
ancestryMediaFileUrl
|
|
5468
5938
|
);
|
|
5469
5939
|
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
5470
|
-
const media =
|
|
5471
|
-
const clone = obje?.get("_CLON._OID")?.toValue();
|
|
5472
|
-
const mser = obje?.get("_MSER._LKID")?.toValue();
|
|
5940
|
+
const media = resolveObjeMediaId(obje);
|
|
5473
5941
|
let url = obje?.get("FILE")?.toValue();
|
|
5474
5942
|
const title = obje?.get("FILE.TITL")?.toValue() ?? obje?.get("TITL")?.toValue() ?? "";
|
|
5943
|
+
const note = objeNoteValue(obje);
|
|
5475
5944
|
const type = resolveObjeForm(obje) ?? (url ? getFileExtension(url) : void 0) ?? "raw";
|
|
5476
|
-
let imgId =
|
|
5945
|
+
let imgId = media;
|
|
5477
5946
|
const hasEmbeddedOrLocalFile = !!url && (url.startsWith("data:") || url.startsWith("blob:") || !/^https?:\/\//i.test(url));
|
|
5478
5947
|
if (!hasEmbeddedOrLocalFile && (!www || !tree || !this.id)) {
|
|
5479
5948
|
return;
|
|
@@ -5509,6 +5978,7 @@ var Indi = class extends Common {
|
|
|
5509
5978
|
imgId,
|
|
5510
5979
|
person: this.id,
|
|
5511
5980
|
title,
|
|
5981
|
+
note,
|
|
5512
5982
|
url,
|
|
5513
5983
|
contentType: type,
|
|
5514
5984
|
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
@@ -5547,7 +6017,7 @@ var Indi = class extends Common {
|
|
|
5547
6017
|
return;
|
|
5548
6018
|
}
|
|
5549
6019
|
const obje = o;
|
|
5550
|
-
const key =
|
|
6020
|
+
const key = objeXrefKey(obje, index);
|
|
5551
6021
|
obje.standardizeMedia();
|
|
5552
6022
|
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
5553
6023
|
const url = obje?.get("FILE")?.toValue();
|
|
@@ -5566,6 +6036,7 @@ var Indi = class extends Common {
|
|
|
5566
6036
|
imgId,
|
|
5567
6037
|
person: this.id,
|
|
5568
6038
|
title,
|
|
6039
|
+
note: objeNoteValue(obje),
|
|
5569
6040
|
url,
|
|
5570
6041
|
contentType: type,
|
|
5571
6042
|
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
@@ -5674,7 +6145,7 @@ var Indi = class extends Common {
|
|
|
5674
6145
|
if (!obje) {
|
|
5675
6146
|
return;
|
|
5676
6147
|
}
|
|
5677
|
-
const key =
|
|
6148
|
+
const key = objeXrefKey(obje, index);
|
|
5678
6149
|
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
5679
6150
|
const url = obje?.get("FILE")?.toValue();
|
|
5680
6151
|
const title = obje?.get("TITL")?.toValue() ?? "";
|
|
@@ -5691,6 +6162,7 @@ var Indi = class extends Common {
|
|
|
5691
6162
|
imgId,
|
|
5692
6163
|
person: this.id,
|
|
5693
6164
|
title,
|
|
6165
|
+
note: objeNoteValue(obje),
|
|
5694
6166
|
url,
|
|
5695
6167
|
contentType: type,
|
|
5696
6168
|
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
@@ -5714,7 +6186,7 @@ var Indi = class extends Common {
|
|
|
5714
6186
|
if (!obje) {
|
|
5715
6187
|
return;
|
|
5716
6188
|
}
|
|
5717
|
-
const key =
|
|
6189
|
+
const key = objeXrefKey(obje, index);
|
|
5718
6190
|
obje.standardizeMedia();
|
|
5719
6191
|
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
5720
6192
|
const url = obje?.get("FILE")?.toValue();
|
|
@@ -5731,6 +6203,7 @@ var Indi = class extends Common {
|
|
|
5731
6203
|
imgId,
|
|
5732
6204
|
person: this.id,
|
|
5733
6205
|
title,
|
|
6206
|
+
note: objeNoteValue(obje),
|
|
5734
6207
|
url,
|
|
5735
6208
|
contentType: type,
|
|
5736
6209
|
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
@@ -5762,7 +6235,12 @@ var Indi = class extends Common {
|
|
|
5762
6235
|
);
|
|
5763
6236
|
if (cached !== void 0) {
|
|
5764
6237
|
if (cached?.file && !isRemoteOrEmbeddedMediaUrl(cached.file)) {
|
|
5765
|
-
const resolvedCached = await resolveLocalMediaUrl(cached.file
|
|
6238
|
+
const resolvedCached = await resolveLocalMediaUrl(cached.file, {
|
|
6239
|
+
url: cached.file,
|
|
6240
|
+
person: this.id,
|
|
6241
|
+
tree: this.getTreeId?.(),
|
|
6242
|
+
treeName: this.getTreeName?.()
|
|
6243
|
+
});
|
|
5766
6244
|
if (resolvedCached && isRemoteOrEmbeddedMediaUrl(resolvedCached)) {
|
|
5767
6245
|
const refreshed = { ...cached, file: resolvedCached };
|
|
5768
6246
|
profilePictureCache(
|
|
@@ -5787,7 +6265,16 @@ var Indi = class extends Common {
|
|
|
5787
6265
|
}
|
|
5788
6266
|
const mediaArray = Object.values(mediaList);
|
|
5789
6267
|
const toDisplayableProfile = async (media, isPrimary) => {
|
|
5790
|
-
const resolvedFile = await resolveLocalMediaUrl(media.url
|
|
6268
|
+
const resolvedFile = await resolveLocalMediaUrl(media.url, {
|
|
6269
|
+
url: media.url,
|
|
6270
|
+
id: media.id,
|
|
6271
|
+
imgId: media.imgId,
|
|
6272
|
+
key: media.key,
|
|
6273
|
+
contentType: media.contentType,
|
|
6274
|
+
person: media.person || this.id,
|
|
6275
|
+
tree: media.tree || this.getTreeId?.(),
|
|
6276
|
+
treeName: this.getTreeName?.()
|
|
6277
|
+
});
|
|
5791
6278
|
if (!resolvedFile || !isRemoteOrEmbeddedMediaUrl(resolvedFile)) {
|
|
5792
6279
|
return void 0;
|
|
5793
6280
|
}
|
|
@@ -7565,4 +8052,4 @@ var KinshipTranslatorDe = class extends KinshipTranslatorBasic {
|
|
|
7565
8052
|
}
|
|
7566
8053
|
};
|
|
7567
8054
|
|
|
7568
|
-
export { KinshipTranslator, KinshipTranslatorBasic, KinshipTranslatorDe as KinshipTranslatorDE, KinshipTranslatorEn as KinshipTranslatorEN, KinshipTranslatorEs as KinshipTranslatorES, KinshipTranslatorFr as KinshipTranslatorFR, KinshipTranslatorHU, KinshipTranslatorRu as KinshipTranslatorRU, translators_exports as translators };
|
|
8055
|
+
export { KinshipTranslator, KinshipTranslatorBasic, KinshipTranslatorDe as KinshipTranslatorDE, KinshipTranslatorEn as KinshipTranslatorEN, KinshipTranslatorEs as KinshipTranslatorES, KinshipTranslatorFr as KinshipTranslatorFR, KinshipTranslatorHU, KinshipTranslatorJa as KinshipTranslatorJA, KinshipTranslatorRu as KinshipTranslatorRU, KinshipTranslatorZh as KinshipTranslatorZH, translators_exports as translators };
|