@mxmweb/fviewer 1.0.7 → 1.0.8
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/index.js +1076 -1068
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -4,10 +4,10 @@ var Km = (e) => {
|
|
|
4
4
|
};
|
|
5
5
|
var v0 = (e, t, r) => t in e ? m0(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
6
6
|
var Tg = (e, t, r) => v0(e, typeof t != "symbol" ? t + "" : t, r), _m = (e, t, r) => t.has(e) || Km("Cannot " + r);
|
|
7
|
-
var Gn = (e, t, r) => (_m(e, t, "read from private field"), r ? r.call(e) : t.get(e)),
|
|
7
|
+
var Gn = (e, t, r) => (_m(e, t, "read from private field"), r ? r.call(e) : t.get(e)), ml = (e, t, r) => t.has(e) ? Km("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), vl = (e, t, r, n) => (_m(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r), gl = (e, t, r) => (_m(e, t, "access private method"), r);
|
|
8
8
|
var km = (e, t, r, n) => ({
|
|
9
9
|
set _(s) {
|
|
10
|
-
|
|
10
|
+
vl(e, t, s, r);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
13
|
return Gn(e, t, n);
|
|
@@ -1023,13 +1023,13 @@ function it$1(e, t, r) {
|
|
|
1023
1023
|
for (var zt in Lt) me[zt] = zt === "className" ? ie(me[zt], Lt[zt]) : zt === "style" ? __assign(__assign({}, me[zt]), Lt[zt]) : Lt[zt];
|
|
1024
1024
|
}
|
|
1025
1025
|
return It.className && (me.className = ie(me.className, It.className)), me;
|
|
1026
|
-
}(kt, p, As),
|
|
1027
|
-
for (var ln in Ti) Ti[ln] === void 0 || ln[0] === "$" || ln === "as" || ln === "theme" && Ti.theme === As || (ln === "forwardedAs" ? dl.as = Ti.forwardedAs : Kn && !Kn(ln,
|
|
1026
|
+
}(kt, p, As), Oi = Ti.as || Yn, dl = {};
|
|
1027
|
+
for (var ln in Ti) Ti[ln] === void 0 || ln[0] === "$" || ln === "as" || ln === "theme" && Ti.theme === As || (ln === "forwardedAs" ? dl.as = Ti.forwardedAs : Kn && !Kn(ln, Oi) || (dl[ln] = Ti[ln]));
|
|
1028
1028
|
var Dt = function(Ur, It) {
|
|
1029
1029
|
var Br = Ge$1(), Ar = Ur.generateAndInjectStyles(It, Br.styleSheet, Br.stylis);
|
|
1030
1030
|
return Ar;
|
|
1031
1031
|
}(Fr, Ti), ot = ie(Is, Si);
|
|
1032
|
-
return Dt && (ot += " " + Dt), Ti.className && (ot += " " + Ti.className), dl[L$1(
|
|
1032
|
+
return Dt && (ot += " " + Dt), Ti.className && (ot += " " + Ti.className), dl[L$1(Oi) && !A$1.has(Oi) ? "class" : "className"] = ot, mt && (dl.ref = mt), createElement(Oi, dl);
|
|
1033
1033
|
}(nt, tt, N);
|
|
1034
1034
|
}
|
|
1035
1035
|
st.displayName = Ye;
|
|
@@ -1100,7 +1100,7 @@ function requirePdf() {
|
|
|
1100
1100
|
(e, t, r) => {
|
|
1101
1101
|
Object.defineProperty(t, "__esModule", {
|
|
1102
1102
|
value: !0
|
|
1103
|
-
}), t.VerbosityLevel = t.Util = t.UnknownErrorException = t.UnexpectedResponseException = t.UNSUPPORTED_FEATURES = t.TextRenderingMode = t.StreamType = t.RenderingIntentFlag = t.PermissionFlag = t.PasswordResponses = t.PasswordException = t.PageActionEventType = t.OPS = t.MissingPDFException = t.LINE_FACTOR = t.LINE_DESCENT_FACTOR = t.InvalidPDFException = t.ImageKind = t.IDENTITY_MATRIX = t.FormatError = t.FontType = t.FeatureTest = t.FONT_IDENTITY_MATRIX = t.DocumentActionEventType = t.CMapCompressionType = t.BaseException = t.AnnotationType = t.AnnotationStateModelType = t.AnnotationReviewState = t.AnnotationReplyType = t.AnnotationMode = t.AnnotationMarkedState = t.AnnotationFlag = t.AnnotationFieldFlag = t.AnnotationEditorType = t.AnnotationEditorPrefix = t.AnnotationEditorParamsType = t.AnnotationBorderStyleType = t.AnnotationActionEventType = t.AbortException = void 0, t.arrayByteLength = Un, t.arraysToBytes =
|
|
1103
|
+
}), t.VerbosityLevel = t.Util = t.UnknownErrorException = t.UnexpectedResponseException = t.UNSUPPORTED_FEATURES = t.TextRenderingMode = t.StreamType = t.RenderingIntentFlag = t.PermissionFlag = t.PasswordResponses = t.PasswordException = t.PageActionEventType = t.OPS = t.MissingPDFException = t.LINE_FACTOR = t.LINE_DESCENT_FACTOR = t.InvalidPDFException = t.ImageKind = t.IDENTITY_MATRIX = t.FormatError = t.FontType = t.FeatureTest = t.FONT_IDENTITY_MATRIX = t.DocumentActionEventType = t.CMapCompressionType = t.BaseException = t.AnnotationType = t.AnnotationStateModelType = t.AnnotationReviewState = t.AnnotationReplyType = t.AnnotationMode = t.AnnotationMarkedState = t.AnnotationFlag = t.AnnotationFieldFlag = t.AnnotationEditorType = t.AnnotationEditorPrefix = t.AnnotationEditorParamsType = t.AnnotationBorderStyleType = t.AnnotationActionEventType = t.AbortException = void 0, t.arrayByteLength = Un, t.arraysToBytes = ji, t.assert = Dt, t.bytesToString = Gr, t.createPromiseCapability = sm, t.createValidAbsoluteUrl = Ur, t.escapeString = xl, t.getModificationDate = nm, t.getVerbosityLevel = Ti, t.info = Oi, t.isArrayBuffer = Pl, t.isArrayEqual = tm, t.isAscii = Rl, t.objectFromMap = ki, t.objectSize = Pi, t.setVerbosityLevel = As, t.shadow = It, t.string32 = qs, t.stringToBytes = nr, t.stringToPDFString = wl, t.stringToUTF16BEString = Bl, t.stringToUTF8String = lg, t.unreachable = ln, t.utf8StringToString = Ol, t.warn = dl, r(2);
|
|
1104
1104
|
const n = [1, 0, 0, 1, 0, 0];
|
|
1105
1105
|
t.IDENTITY_MATRIX = n;
|
|
1106
1106
|
const s = [1e-3, 0, 0, 1e-3, 0, 0];
|
|
@@ -1464,28 +1464,28 @@ function requirePdf() {
|
|
|
1464
1464
|
};
|
|
1465
1465
|
t.PasswordResponses = Xn;
|
|
1466
1466
|
let Kn = Is.WARNINGS;
|
|
1467
|
-
function As(
|
|
1468
|
-
Number.isInteger(
|
|
1467
|
+
function As(pl) {
|
|
1468
|
+
Number.isInteger(pl) && (Kn = pl);
|
|
1469
1469
|
}
|
|
1470
1470
|
function Ti() {
|
|
1471
1471
|
return Kn;
|
|
1472
1472
|
}
|
|
1473
|
-
function
|
|
1474
|
-
Kn >= Is.INFOS && console.log(`Info: ${
|
|
1473
|
+
function Oi(pl) {
|
|
1474
|
+
Kn >= Is.INFOS && console.log(`Info: ${pl}`);
|
|
1475
1475
|
}
|
|
1476
|
-
function dl(
|
|
1477
|
-
Kn >= Is.WARNINGS && console.log(`Warning: ${
|
|
1476
|
+
function dl(pl) {
|
|
1477
|
+
Kn >= Is.WARNINGS && console.log(`Warning: ${pl}`);
|
|
1478
1478
|
}
|
|
1479
|
-
function ln(
|
|
1480
|
-
throw new Error(
|
|
1479
|
+
function ln(pl) {
|
|
1480
|
+
throw new Error(pl);
|
|
1481
1481
|
}
|
|
1482
|
-
function Dt(
|
|
1483
|
-
|
|
1482
|
+
function Dt(pl, Ni) {
|
|
1483
|
+
pl || ln(Ni);
|
|
1484
1484
|
}
|
|
1485
|
-
function ot(
|
|
1486
|
-
if (!
|
|
1485
|
+
function ot(pl) {
|
|
1486
|
+
if (!pl)
|
|
1487
1487
|
return !1;
|
|
1488
|
-
switch (
|
|
1488
|
+
switch (pl.protocol) {
|
|
1489
1489
|
case "http:":
|
|
1490
1490
|
case "https:":
|
|
1491
1491
|
case "ftp:":
|
|
@@ -1496,145 +1496,145 @@ function requirePdf() {
|
|
|
1496
1496
|
return !1;
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
|
-
function Ur(
|
|
1500
|
-
if (!
|
|
1499
|
+
function Ur(pl, Ni = null, _a = null) {
|
|
1500
|
+
if (!pl)
|
|
1501
1501
|
return null;
|
|
1502
1502
|
try {
|
|
1503
|
-
if (
|
|
1504
|
-
if (
|
|
1505
|
-
const Fl =
|
|
1506
|
-
Fl && Fl.length >= 2 && (
|
|
1503
|
+
if (_a && typeof pl == "string") {
|
|
1504
|
+
if (_a.addDefaultProtocol && pl.startsWith("www.")) {
|
|
1505
|
+
const Fl = pl.match(/\./g);
|
|
1506
|
+
Fl && Fl.length >= 2 && (pl = `http://${pl}`);
|
|
1507
1507
|
}
|
|
1508
|
-
if (
|
|
1508
|
+
if (_a.tryConvertEncoding)
|
|
1509
1509
|
try {
|
|
1510
|
-
|
|
1510
|
+
pl = lg(pl);
|
|
1511
1511
|
} catch {
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
|
-
const Dl =
|
|
1514
|
+
const Dl = Ni ? new URL(pl, Ni) : new URL(pl);
|
|
1515
1515
|
if (ot(Dl))
|
|
1516
1516
|
return Dl;
|
|
1517
1517
|
} catch {
|
|
1518
1518
|
}
|
|
1519
1519
|
return null;
|
|
1520
1520
|
}
|
|
1521
|
-
function It(
|
|
1522
|
-
return Object.defineProperty(
|
|
1523
|
-
value:
|
|
1521
|
+
function It(pl, Ni, _a) {
|
|
1522
|
+
return Object.defineProperty(pl, Ni, {
|
|
1523
|
+
value: _a,
|
|
1524
1524
|
enumerable: !0,
|
|
1525
1525
|
configurable: !0,
|
|
1526
1526
|
writable: !1
|
|
1527
|
-
}),
|
|
1527
|
+
}), _a;
|
|
1528
1528
|
}
|
|
1529
1529
|
const Br = function() {
|
|
1530
|
-
function
|
|
1531
|
-
this.constructor ===
|
|
1530
|
+
function Ni(_a, Dl) {
|
|
1531
|
+
this.constructor === Ni && ln("Cannot initialize BaseException."), this.message = _a, this.name = Dl;
|
|
1532
1532
|
}
|
|
1533
|
-
return
|
|
1533
|
+
return Ni.prototype = new Error(), Ni.constructor = Ni, Ni;
|
|
1534
1534
|
}();
|
|
1535
1535
|
t.BaseException = Br;
|
|
1536
1536
|
class Ar extends Br {
|
|
1537
|
-
constructor(
|
|
1538
|
-
super(
|
|
1537
|
+
constructor(Ni, _a) {
|
|
1538
|
+
super(Ni, "PasswordException"), this.code = _a;
|
|
1539
1539
|
}
|
|
1540
1540
|
}
|
|
1541
1541
|
t.PasswordException = Ar;
|
|
1542
1542
|
class me extends Br {
|
|
1543
|
-
constructor(
|
|
1544
|
-
super(
|
|
1543
|
+
constructor(Ni, _a) {
|
|
1544
|
+
super(Ni, "UnknownErrorException"), this.details = _a;
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
1547
|
t.UnknownErrorException = me;
|
|
1548
1548
|
class St extends Br {
|
|
1549
|
-
constructor(
|
|
1550
|
-
super(
|
|
1549
|
+
constructor(Ni) {
|
|
1550
|
+
super(Ni, "InvalidPDFException");
|
|
1551
1551
|
}
|
|
1552
1552
|
}
|
|
1553
1553
|
t.InvalidPDFException = St;
|
|
1554
1554
|
class Lt extends Br {
|
|
1555
|
-
constructor(
|
|
1556
|
-
super(
|
|
1555
|
+
constructor(Ni) {
|
|
1556
|
+
super(Ni, "MissingPDFException");
|
|
1557
1557
|
}
|
|
1558
1558
|
}
|
|
1559
1559
|
t.MissingPDFException = Lt;
|
|
1560
1560
|
class zt extends Br {
|
|
1561
|
-
constructor(
|
|
1562
|
-
super(
|
|
1561
|
+
constructor(Ni, _a) {
|
|
1562
|
+
super(Ni, "UnexpectedResponseException"), this.status = _a;
|
|
1563
1563
|
}
|
|
1564
1564
|
}
|
|
1565
1565
|
t.UnexpectedResponseException = zt;
|
|
1566
1566
|
class sr extends Br {
|
|
1567
|
-
constructor(
|
|
1568
|
-
super(
|
|
1567
|
+
constructor(Ni) {
|
|
1568
|
+
super(Ni, "FormatError");
|
|
1569
1569
|
}
|
|
1570
1570
|
}
|
|
1571
1571
|
t.FormatError = sr;
|
|
1572
1572
|
class un extends Br {
|
|
1573
|
-
constructor(
|
|
1574
|
-
super(
|
|
1573
|
+
constructor(Ni) {
|
|
1574
|
+
super(Ni, "AbortException");
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
1577
1577
|
t.AbortException = un;
|
|
1578
|
-
function Gr(
|
|
1579
|
-
(typeof
|
|
1580
|
-
const
|
|
1581
|
-
if (
|
|
1582
|
-
return String.fromCharCode.apply(null,
|
|
1578
|
+
function Gr(pl) {
|
|
1579
|
+
(typeof pl != "object" || pl === null || pl.length === void 0) && ln("Invalid argument for bytesToString");
|
|
1580
|
+
const Ni = pl.length, _a = 8192;
|
|
1581
|
+
if (Ni < _a)
|
|
1582
|
+
return String.fromCharCode.apply(null, pl);
|
|
1583
1583
|
const Dl = [];
|
|
1584
|
-
for (let Fl = 0; Fl <
|
|
1585
|
-
const fg = Math.min(Fl +
|
|
1584
|
+
for (let Fl = 0; Fl < Ni; Fl += _a) {
|
|
1585
|
+
const fg = Math.min(Fl + _a, Ni), cg = pl.subarray(Fl, fg);
|
|
1586
1586
|
Dl.push(String.fromCharCode.apply(null, cg));
|
|
1587
1587
|
}
|
|
1588
1588
|
return Dl.join("");
|
|
1589
1589
|
}
|
|
1590
|
-
function nr(
|
|
1591
|
-
typeof
|
|
1592
|
-
const
|
|
1593
|
-
for (let Dl = 0; Dl <
|
|
1594
|
-
|
|
1595
|
-
return
|
|
1590
|
+
function nr(pl) {
|
|
1591
|
+
typeof pl != "string" && ln("Invalid argument for stringToBytes");
|
|
1592
|
+
const Ni = pl.length, _a = new Uint8Array(Ni);
|
|
1593
|
+
for (let Dl = 0; Dl < Ni; ++Dl)
|
|
1594
|
+
_a[Dl] = pl.charCodeAt(Dl) & 255;
|
|
1595
|
+
return _a;
|
|
1596
1596
|
}
|
|
1597
|
-
function Un(
|
|
1598
|
-
if (
|
|
1599
|
-
return
|
|
1600
|
-
if (
|
|
1601
|
-
return
|
|
1597
|
+
function Un(pl) {
|
|
1598
|
+
if (pl.length !== void 0)
|
|
1599
|
+
return pl.length;
|
|
1600
|
+
if (pl.byteLength !== void 0)
|
|
1601
|
+
return pl.byteLength;
|
|
1602
1602
|
ln("Invalid argument for arrayByteLength");
|
|
1603
1603
|
}
|
|
1604
|
-
function
|
|
1605
|
-
const
|
|
1606
|
-
if (
|
|
1607
|
-
return
|
|
1608
|
-
let
|
|
1609
|
-
for (let fg = 0; fg <
|
|
1610
|
-
|
|
1604
|
+
function ji(pl) {
|
|
1605
|
+
const Ni = pl.length;
|
|
1606
|
+
if (Ni === 1 && pl[0] instanceof Uint8Array)
|
|
1607
|
+
return pl[0];
|
|
1608
|
+
let _a = 0;
|
|
1609
|
+
for (let fg = 0; fg < Ni; fg++)
|
|
1610
|
+
_a += Un(pl[fg]);
|
|
1611
1611
|
let Dl = 0;
|
|
1612
|
-
const Fl = new Uint8Array(
|
|
1613
|
-
for (let fg = 0; fg <
|
|
1614
|
-
let cg =
|
|
1612
|
+
const Fl = new Uint8Array(_a);
|
|
1613
|
+
for (let fg = 0; fg < Ni; fg++) {
|
|
1614
|
+
let cg = pl[fg];
|
|
1615
1615
|
cg instanceof Uint8Array || (typeof cg == "string" ? cg = nr(cg) : cg = new Uint8Array(cg));
|
|
1616
1616
|
const im = cg.byteLength;
|
|
1617
1617
|
Fl.set(cg, Dl), Dl += im;
|
|
1618
1618
|
}
|
|
1619
1619
|
return Fl;
|
|
1620
1620
|
}
|
|
1621
|
-
function
|
|
1622
|
-
return String.fromCharCode(
|
|
1621
|
+
function qs(pl) {
|
|
1622
|
+
return String.fromCharCode(pl >> 24 & 255, pl >> 16 & 255, pl >> 8 & 255, pl & 255);
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1625
|
-
return Object.keys(
|
|
1624
|
+
function Pi(pl) {
|
|
1625
|
+
return Object.keys(pl).length;
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1628
|
-
const
|
|
1629
|
-
for (const [
|
|
1630
|
-
|
|
1631
|
-
return
|
|
1627
|
+
function ki(pl) {
|
|
1628
|
+
const Ni = /* @__PURE__ */ Object.create(null);
|
|
1629
|
+
for (const [_a, Dl] of pl)
|
|
1630
|
+
Ni[_a] = Dl;
|
|
1631
|
+
return Ni;
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1634
|
-
const
|
|
1635
|
-
return
|
|
1633
|
+
function Ri() {
|
|
1634
|
+
const pl = new Uint8Array(4);
|
|
1635
|
+
return pl[0] = 1, new Uint32Array(pl.buffer, 0, 1)[0] === 1;
|
|
1636
1636
|
}
|
|
1637
|
-
function
|
|
1637
|
+
function hl() {
|
|
1638
1638
|
try {
|
|
1639
1639
|
return new Function(""), !0;
|
|
1640
1640
|
} catch {
|
|
@@ -1643,67 +1643,67 @@ function requirePdf() {
|
|
|
1643
1643
|
}
|
|
1644
1644
|
class Ha {
|
|
1645
1645
|
static get isLittleEndian() {
|
|
1646
|
-
return It(this, "isLittleEndian",
|
|
1646
|
+
return It(this, "isLittleEndian", Ri());
|
|
1647
1647
|
}
|
|
1648
1648
|
static get isEvalSupported() {
|
|
1649
|
-
return It(this, "isEvalSupported",
|
|
1649
|
+
return It(this, "isEvalSupported", hl());
|
|
1650
1650
|
}
|
|
1651
1651
|
static get isOffscreenCanvasSupported() {
|
|
1652
1652
|
return It(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
1655
|
t.FeatureTest = Ha;
|
|
1656
|
-
const Cl = [...Array(256).keys()].map((
|
|
1657
|
-
class
|
|
1658
|
-
static makeHexColor(
|
|
1659
|
-
return `#${Cl[
|
|
1656
|
+
const Cl = [...Array(256).keys()].map((pl) => pl.toString(16).padStart(2, "0"));
|
|
1657
|
+
class Al {
|
|
1658
|
+
static makeHexColor(Ni, _a, Dl) {
|
|
1659
|
+
return `#${Cl[Ni]}${Cl[_a]}${Cl[Dl]}`;
|
|
1660
1660
|
}
|
|
1661
|
-
static scaleMinMax(
|
|
1661
|
+
static scaleMinMax(Ni, _a) {
|
|
1662
1662
|
let Dl;
|
|
1663
|
-
|
|
1663
|
+
Ni[0] ? (Ni[0] < 0 && (Dl = _a[0], _a[0] = _a[1], _a[1] = Dl), _a[0] *= Ni[0], _a[1] *= Ni[0], Ni[3] < 0 && (Dl = _a[2], _a[2] = _a[3], _a[3] = Dl), _a[2] *= Ni[3], _a[3] *= Ni[3]) : (Dl = _a[0], _a[0] = _a[2], _a[2] = Dl, Dl = _a[1], _a[1] = _a[3], _a[3] = Dl, Ni[1] < 0 && (Dl = _a[2], _a[2] = _a[3], _a[3] = Dl), _a[2] *= Ni[1], _a[3] *= Ni[1], Ni[2] < 0 && (Dl = _a[0], _a[0] = _a[1], _a[1] = Dl), _a[0] *= Ni[2], _a[1] *= Ni[2]), _a[0] += Ni[4], _a[1] += Ni[4], _a[2] += Ni[5], _a[3] += Ni[5];
|
|
1664
1664
|
}
|
|
1665
|
-
static transform(
|
|
1666
|
-
return [
|
|
1665
|
+
static transform(Ni, _a) {
|
|
1666
|
+
return [Ni[0] * _a[0] + Ni[2] * _a[1], Ni[1] * _a[0] + Ni[3] * _a[1], Ni[0] * _a[2] + Ni[2] * _a[3], Ni[1] * _a[2] + Ni[3] * _a[3], Ni[0] * _a[4] + Ni[2] * _a[5] + Ni[4], Ni[1] * _a[4] + Ni[3] * _a[5] + Ni[5]];
|
|
1667
1667
|
}
|
|
1668
|
-
static applyTransform(
|
|
1669
|
-
const Dl =
|
|
1668
|
+
static applyTransform(Ni, _a) {
|
|
1669
|
+
const Dl = Ni[0] * _a[0] + Ni[1] * _a[2] + _a[4], Fl = Ni[0] * _a[1] + Ni[1] * _a[3] + _a[5];
|
|
1670
1670
|
return [Dl, Fl];
|
|
1671
1671
|
}
|
|
1672
|
-
static applyInverseTransform(
|
|
1673
|
-
const Dl =
|
|
1672
|
+
static applyInverseTransform(Ni, _a) {
|
|
1673
|
+
const Dl = _a[0] * _a[3] - _a[1] * _a[2], Fl = (Ni[0] * _a[3] - Ni[1] * _a[2] + _a[2] * _a[5] - _a[4] * _a[3]) / Dl, fg = (-Ni[0] * _a[1] + Ni[1] * _a[0] + _a[4] * _a[1] - _a[5] * _a[0]) / Dl;
|
|
1674
1674
|
return [Fl, fg];
|
|
1675
1675
|
}
|
|
1676
|
-
static getAxialAlignedBoundingBox(
|
|
1677
|
-
const Dl =
|
|
1676
|
+
static getAxialAlignedBoundingBox(Ni, _a) {
|
|
1677
|
+
const Dl = Al.applyTransform(Ni, _a), Fl = Al.applyTransform(Ni.slice(2, 4), _a), fg = Al.applyTransform([Ni[0], Ni[3]], _a), cg = Al.applyTransform([Ni[2], Ni[1]], _a);
|
|
1678
1678
|
return [Math.min(Dl[0], Fl[0], fg[0], cg[0]), Math.min(Dl[1], Fl[1], fg[1], cg[1]), Math.max(Dl[0], Fl[0], fg[0], cg[0]), Math.max(Dl[1], Fl[1], fg[1], cg[1])];
|
|
1679
1679
|
}
|
|
1680
|
-
static inverseTransform(
|
|
1681
|
-
const
|
|
1682
|
-
return [
|
|
1680
|
+
static inverseTransform(Ni) {
|
|
1681
|
+
const _a = Ni[0] * Ni[3] - Ni[1] * Ni[2];
|
|
1682
|
+
return [Ni[3] / _a, -Ni[1] / _a, -Ni[2] / _a, Ni[0] / _a, (Ni[2] * Ni[5] - Ni[4] * Ni[3]) / _a, (Ni[4] * Ni[1] - Ni[5] * Ni[0]) / _a];
|
|
1683
1683
|
}
|
|
1684
|
-
static apply3dTransform(
|
|
1685
|
-
return [
|
|
1684
|
+
static apply3dTransform(Ni, _a) {
|
|
1685
|
+
return [Ni[0] * _a[0] + Ni[1] * _a[1] + Ni[2] * _a[2], Ni[3] * _a[0] + Ni[4] * _a[1] + Ni[5] * _a[2], Ni[6] * _a[0] + Ni[7] * _a[1] + Ni[8] * _a[2]];
|
|
1686
1686
|
}
|
|
1687
|
-
static singularValueDecompose2dScale(
|
|
1688
|
-
const
|
|
1687
|
+
static singularValueDecompose2dScale(Ni) {
|
|
1688
|
+
const _a = [Ni[0], Ni[2], Ni[1], Ni[3]], Dl = Ni[0] * _a[0] + Ni[1] * _a[2], Fl = Ni[0] * _a[1] + Ni[1] * _a[3], fg = Ni[2] * _a[0] + Ni[3] * _a[2], cg = Ni[2] * _a[1] + Ni[3] * _a[3], im = (Dl + cg) / 2, um = Math.sqrt((Dl + cg) ** 2 - 4 * (Dl * cg - fg * Fl)) / 2, om = im + um || 1, Kg = im - um || 1;
|
|
1689
1689
|
return [Math.sqrt(om), Math.sqrt(Kg)];
|
|
1690
1690
|
}
|
|
1691
|
-
static normalizeRect(
|
|
1692
|
-
const
|
|
1693
|
-
return
|
|
1691
|
+
static normalizeRect(Ni) {
|
|
1692
|
+
const _a = Ni.slice(0);
|
|
1693
|
+
return Ni[0] > Ni[2] && (_a[0] = Ni[2], _a[2] = Ni[0]), Ni[1] > Ni[3] && (_a[1] = Ni[3], _a[3] = Ni[1]), _a;
|
|
1694
1694
|
}
|
|
1695
|
-
static intersect(
|
|
1696
|
-
const Dl = Math.max(Math.min(
|
|
1695
|
+
static intersect(Ni, _a) {
|
|
1696
|
+
const Dl = Math.max(Math.min(Ni[0], Ni[2]), Math.min(_a[0], _a[2])), Fl = Math.min(Math.max(Ni[0], Ni[2]), Math.max(_a[0], _a[2]));
|
|
1697
1697
|
if (Dl > Fl)
|
|
1698
1698
|
return null;
|
|
1699
|
-
const fg = Math.max(Math.min(
|
|
1699
|
+
const fg = Math.max(Math.min(Ni[1], Ni[3]), Math.min(_a[1], _a[3])), cg = Math.min(Math.max(Ni[1], Ni[3]), Math.max(_a[1], _a[3]));
|
|
1700
1700
|
return fg > cg ? null : [Dl, fg, Fl, cg];
|
|
1701
1701
|
}
|
|
1702
|
-
static bezierBoundingBox(
|
|
1702
|
+
static bezierBoundingBox(Ni, _a, Dl, Fl, fg, cg, im, um) {
|
|
1703
1703
|
const om = [], Kg = [[], []];
|
|
1704
1704
|
let lm, am, mm, Ug, vm, bm, wm, Fm;
|
|
1705
1705
|
for (let xm = 0; xm < 2; ++xm) {
|
|
1706
|
-
if (xm === 0 ? (am = 6 *
|
|
1706
|
+
if (xm === 0 ? (am = 6 * Ni - 12 * Dl + 6 * fg, lm = -3 * Ni + 9 * Dl - 9 * fg + 3 * im, mm = 3 * Dl - 3 * Ni) : (am = 6 * _a - 12 * Fl + 6 * cg, lm = -3 * _a + 9 * Fl - 9 * cg + 3 * um, mm = 3 * Fl - 3 * _a), Math.abs(lm) < 1e-12) {
|
|
1707
1707
|
if (Math.abs(am) < 1e-12)
|
|
1708
1708
|
continue;
|
|
1709
1709
|
Ug = -mm / am, 0 < Ug && Ug < 1 && om.push(Ug);
|
|
@@ -1714,81 +1714,81 @@ function requirePdf() {
|
|
|
1714
1714
|
let hm = om.length, Yg;
|
|
1715
1715
|
const fm = hm;
|
|
1716
1716
|
for (; hm--; )
|
|
1717
|
-
Ug = om[hm], Yg = 1 - Ug, Kg[0][hm] = Yg * Yg * Yg *
|
|
1718
|
-
return Kg[0][fm] =
|
|
1717
|
+
Ug = om[hm], Yg = 1 - Ug, Kg[0][hm] = Yg * Yg * Yg * Ni + 3 * Yg * Yg * Ug * Dl + 3 * Yg * Ug * Ug * fg + Ug * Ug * Ug * im, Kg[1][hm] = Yg * Yg * Yg * _a + 3 * Yg * Yg * Ug * Fl + 3 * Yg * Ug * Ug * cg + Ug * Ug * Ug * um;
|
|
1718
|
+
return Kg[0][fm] = Ni, Kg[1][fm] = _a, Kg[0][fm + 1] = im, Kg[1][fm + 1] = um, Kg[0].length = Kg[1].length = fm + 2, [Math.min(...Kg[0]), Math.min(...Kg[1]), Math.max(...Kg[0]), Math.max(...Kg[1])];
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
|
-
t.Util =
|
|
1722
|
-
const
|
|
1723
|
-
function wl(
|
|
1724
|
-
if (
|
|
1725
|
-
let
|
|
1726
|
-
if (
|
|
1721
|
+
t.Util = Al;
|
|
1722
|
+
const bl = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, 711, 710, 729, 733, 731, 730, 732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8226, 8224, 8225, 8230, 8212, 8211, 402, 8260, 8249, 8250, 8722, 8240, 8222, 8220, 8221, 8216, 8217, 8218, 8482, 64257, 64258, 321, 338, 352, 376, 381, 305, 322, 339, 353, 382, 0, 8364];
|
|
1723
|
+
function wl(pl) {
|
|
1724
|
+
if (pl[0] >= "\xEF") {
|
|
1725
|
+
let _a;
|
|
1726
|
+
if (pl[0] === "\xFE" && pl[1] === "\xFF" ? _a = "utf-16be" : pl[0] === "\xFF" && pl[1] === "\xFE" ? _a = "utf-16le" : pl[0] === "\xEF" && pl[1] === "\xBB" && pl[2] === "\xBF" && (_a = "utf-8"), _a)
|
|
1727
1727
|
try {
|
|
1728
|
-
const Dl = new TextDecoder(
|
|
1728
|
+
const Dl = new TextDecoder(_a, {
|
|
1729
1729
|
fatal: !0
|
|
1730
|
-
}), Fl = nr(
|
|
1730
|
+
}), Fl = nr(pl);
|
|
1731
1731
|
return Dl.decode(Fl);
|
|
1732
1732
|
} catch (Dl) {
|
|
1733
1733
|
dl(`stringToPDFString: "${Dl}".`);
|
|
1734
1734
|
}
|
|
1735
1735
|
}
|
|
1736
|
-
const
|
|
1737
|
-
for (let
|
|
1738
|
-
const Fl =
|
|
1739
|
-
|
|
1736
|
+
const Ni = [];
|
|
1737
|
+
for (let _a = 0, Dl = pl.length; _a < Dl; _a++) {
|
|
1738
|
+
const Fl = bl[pl.charCodeAt(_a)];
|
|
1739
|
+
Ni.push(Fl ? String.fromCharCode(Fl) : pl.charAt(_a));
|
|
1740
1740
|
}
|
|
1741
|
-
return
|
|
1741
|
+
return Ni.join("");
|
|
1742
1742
|
}
|
|
1743
|
-
function xl(
|
|
1744
|
-
return
|
|
1745
|
-
` ? "\\n" :
|
|
1743
|
+
function xl(pl) {
|
|
1744
|
+
return pl.replace(/([()\\\n\r])/g, (Ni) => Ni === `
|
|
1745
|
+
` ? "\\n" : Ni === "\r" ? "\\r" : `\\${Ni}`);
|
|
1746
1746
|
}
|
|
1747
|
-
function Rl(
|
|
1748
|
-
return /^[\x00-\x7F]*$/.test(
|
|
1747
|
+
function Rl(pl) {
|
|
1748
|
+
return /^[\x00-\x7F]*$/.test(pl);
|
|
1749
1749
|
}
|
|
1750
|
-
function Bl(
|
|
1751
|
-
const
|
|
1752
|
-
for (let
|
|
1753
|
-
const Fl =
|
|
1754
|
-
|
|
1750
|
+
function Bl(pl) {
|
|
1751
|
+
const Ni = ["\xFE\xFF"];
|
|
1752
|
+
for (let _a = 0, Dl = pl.length; _a < Dl; _a++) {
|
|
1753
|
+
const Fl = pl.charCodeAt(_a);
|
|
1754
|
+
Ni.push(String.fromCharCode(Fl >> 8 & 255), String.fromCharCode(Fl & 255));
|
|
1755
1755
|
}
|
|
1756
|
-
return
|
|
1756
|
+
return Ni.join("");
|
|
1757
1757
|
}
|
|
1758
|
-
function lg(
|
|
1759
|
-
return decodeURIComponent(escape(
|
|
1758
|
+
function lg(pl) {
|
|
1759
|
+
return decodeURIComponent(escape(pl));
|
|
1760
1760
|
}
|
|
1761
|
-
function Ol(
|
|
1762
|
-
return unescape(encodeURIComponent(
|
|
1761
|
+
function Ol(pl) {
|
|
1762
|
+
return unescape(encodeURIComponent(pl));
|
|
1763
1763
|
}
|
|
1764
|
-
function Pl(
|
|
1765
|
-
return typeof
|
|
1764
|
+
function Pl(pl) {
|
|
1765
|
+
return typeof pl == "object" && pl !== null && pl.byteLength !== void 0;
|
|
1766
1766
|
}
|
|
1767
|
-
function tm(
|
|
1768
|
-
if (
|
|
1767
|
+
function tm(pl, Ni) {
|
|
1768
|
+
if (pl.length !== Ni.length)
|
|
1769
1769
|
return !1;
|
|
1770
|
-
for (let
|
|
1771
|
-
if (
|
|
1770
|
+
for (let _a = 0, Dl = pl.length; _a < Dl; _a++)
|
|
1771
|
+
if (pl[_a] !== Ni[_a])
|
|
1772
1772
|
return !1;
|
|
1773
1773
|
return !0;
|
|
1774
1774
|
}
|
|
1775
|
-
function nm(
|
|
1776
|
-
return [
|
|
1775
|
+
function nm(pl = /* @__PURE__ */ new Date()) {
|
|
1776
|
+
return [pl.getUTCFullYear().toString(), (pl.getUTCMonth() + 1).toString().padStart(2, "0"), pl.getUTCDate().toString().padStart(2, "0"), pl.getUTCHours().toString().padStart(2, "0"), pl.getUTCMinutes().toString().padStart(2, "0"), pl.getUTCSeconds().toString().padStart(2, "0")].join("");
|
|
1777
1777
|
}
|
|
1778
1778
|
function sm() {
|
|
1779
|
-
const
|
|
1780
|
-
let
|
|
1781
|
-
return Object.defineProperty(
|
|
1779
|
+
const pl = /* @__PURE__ */ Object.create(null);
|
|
1780
|
+
let Ni = !1;
|
|
1781
|
+
return Object.defineProperty(pl, "settled", {
|
|
1782
1782
|
get() {
|
|
1783
|
-
return
|
|
1783
|
+
return Ni;
|
|
1784
1784
|
}
|
|
1785
|
-
}),
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
},
|
|
1789
|
-
|
|
1785
|
+
}), pl.promise = new Promise(function(_a, Dl) {
|
|
1786
|
+
pl.resolve = function(Fl) {
|
|
1787
|
+
Ni = !0, _a(Fl);
|
|
1788
|
+
}, pl.reject = function(Fl) {
|
|
1789
|
+
Ni = !0, Dl(Fl);
|
|
1790
1790
|
};
|
|
1791
|
-
}),
|
|
1791
|
+
}), pl;
|
|
1792
1792
|
}
|
|
1793
1793
|
},
|
|
1794
1794
|
/* 2 */
|
|
@@ -1976,7 +1976,7 @@ function requirePdf() {
|
|
|
1976
1976
|
this.destroyed = !0, await ((u = this._transport) == null ? void 0 : u.destroy()), this._transport = null, this._worker && (this._worker.destroy(), this._worker = null);
|
|
1977
1977
|
}
|
|
1978
1978
|
};
|
|
1979
|
-
e = new WeakMap(),
|
|
1979
|
+
e = new WeakMap(), ml(t, e, 0);
|
|
1980
1980
|
let PDFDocumentLoadingTask = t;
|
|
1981
1981
|
exports.PDFDocumentLoadingTask = PDFDocumentLoadingTask;
|
|
1982
1982
|
class PDFDataRangeTransport {
|
|
@@ -2231,10 +2231,10 @@ function requirePdf() {
|
|
|
2231
2231
|
lastChunk: !1,
|
|
2232
2232
|
separateAnnots: null
|
|
2233
2233
|
}, this._stats && this._stats.time("Page Request"), this._pumpOperatorList(ur));
|
|
2234
|
-
const Zn = (
|
|
2235
|
-
Is.renderTasks.delete(Xn), (this.cleanupAfterRender || Yn) && (this.pendingCleanup = !0), this._tryCleanup(),
|
|
2234
|
+
const Zn = (Oi) => {
|
|
2235
|
+
Is.renderTasks.delete(Xn), (this.cleanupAfterRender || Yn) && (this.pendingCleanup = !0), this._tryCleanup(), Oi ? (Xn.capability.reject(Oi), this._abortOperatorList({
|
|
2236
2236
|
intentState: Is,
|
|
2237
|
-
reason:
|
|
2237
|
+
reason: Oi instanceof Error ? Oi : new Error(Oi)
|
|
2238
2238
|
})) : Xn.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"));
|
|
2239
2239
|
}, Xn = new InternalRenderTask({
|
|
2240
2240
|
callback: Zn,
|
|
@@ -2257,13 +2257,13 @@ function requirePdf() {
|
|
|
2257
2257
|
});
|
|
2258
2258
|
(Is.renderTasks || (Is.renderTasks = /* @__PURE__ */ new Set())).add(Xn);
|
|
2259
2259
|
const Kn = Xn.task;
|
|
2260
|
-
return Promise.all([Is.displayReadyCapability.promise, p]).then(([
|
|
2260
|
+
return Promise.all([Is.displayReadyCapability.promise, p]).then(([Oi, dl]) => {
|
|
2261
2261
|
if (this.pendingCleanup) {
|
|
2262
2262
|
Zn();
|
|
2263
2263
|
return;
|
|
2264
2264
|
}
|
|
2265
2265
|
this._stats && this._stats.time("Rendering"), Xn.initializeGraphics({
|
|
2266
|
-
transparency:
|
|
2266
|
+
transparency: Oi,
|
|
2267
2267
|
optionalContentConfig: dl
|
|
2268
2268
|
}), Xn.operatorListChanged();
|
|
2269
2269
|
}).catch(Zn), Kn;
|
|
@@ -2629,17 +2629,17 @@ function requirePdf() {
|
|
|
2629
2629
|
return (0, _util.shadow)(this, "_setupFakeWorkerGlobal", loader());
|
|
2630
2630
|
}
|
|
2631
2631
|
};
|
|
2632
|
-
n = new WeakMap(),
|
|
2632
|
+
n = new WeakMap(), ml(_PDFWorker, n, /* @__PURE__ */ new WeakMap());
|
|
2633
2633
|
let PDFWorker = _PDFWorker;
|
|
2634
2634
|
exports.PDFWorker = PDFWorker, PDFWorker.getWorkerSrc = function() {
|
|
2635
2635
|
return (0, _display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead."), this.workerSrc;
|
|
2636
2636
|
};
|
|
2637
2637
|
class WorkerTransport {
|
|
2638
2638
|
constructor(u, a, pe, st) {
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2639
|
+
ml(this, s, null);
|
|
2640
|
+
ml(this, i, /* @__PURE__ */ new Map());
|
|
2641
|
+
ml(this, o, /* @__PURE__ */ new Map());
|
|
2642
|
+
ml(this, c, null);
|
|
2643
2643
|
this.messageHandler = u, this.loadingTask = a, this.commonObjs = new PDFObjects(), this.fontLoader = new _font_loader.FontLoader({
|
|
2644
2644
|
docId: a.docId,
|
|
2645
2645
|
onUnsupportedFeature: this._onUnsupportedFeature.bind(this),
|
|
@@ -2703,7 +2703,7 @@ function requirePdf() {
|
|
|
2703
2703
|
Gn(this, i).clear(), Gn(this, o).clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
|
|
2704
2704
|
const a = this.messageHandler.sendWithPromise("Terminate", null);
|
|
2705
2705
|
return u.push(a), Promise.all(u).then(() => {
|
|
2706
|
-
this.commonObjs.clear(), this.fontLoader.clear(),
|
|
2706
|
+
this.commonObjs.clear(), this.fontLoader.clear(), vl(this, c, null), this._getFieldObjectsPromise = null, this._hasJSActionsPromise = null, this._networkStream && this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")), this.messageHandler && (this.messageHandler.destroy(), this.messageHandler = null), this.destroyCapability.resolve();
|
|
2707
2707
|
}, this.destroyCapability.reject), this.destroyCapability.promise;
|
|
2708
2708
|
}
|
|
2709
2709
|
setupMessageHandler() {
|
|
@@ -2903,7 +2903,7 @@ function requirePdf() {
|
|
|
2903
2903
|
total: pe.total
|
|
2904
2904
|
});
|
|
2905
2905
|
}), u.on("DocStats", (pe) => {
|
|
2906
|
-
this.destroyed ||
|
|
2906
|
+
this.destroyed || vl(this, s, Object.freeze({
|
|
2907
2907
|
streamTypes: Object.freeze(pe.streamTypes),
|
|
2908
2908
|
fontTypes: Object.freeze(pe.fontTypes)
|
|
2909
2909
|
}));
|
|
@@ -3018,7 +3018,7 @@ function requirePdf() {
|
|
|
3018
3018
|
return this.messageHandler.sendWithPromise("GetPermissions", null);
|
|
3019
3019
|
}
|
|
3020
3020
|
getMetadata() {
|
|
3021
|
-
return Gn(this, c) ||
|
|
3021
|
+
return Gn(this, c) || vl(this, c, this.messageHandler.sendWithPromise("GetMetadata", null).then((u) => {
|
|
3022
3022
|
var a, pe;
|
|
3023
3023
|
return {
|
|
3024
3024
|
info: u[0],
|
|
@@ -3036,7 +3036,7 @@ function requirePdf() {
|
|
|
3036
3036
|
for (const a of Gn(this, i).values())
|
|
3037
3037
|
if (!a.cleanup())
|
|
3038
3038
|
throw new Error(`startCleanup: Page ${a.pageNumber} is currently rendering.`);
|
|
3039
|
-
this.commonObjs.clear(), u || this.fontLoader.clear(),
|
|
3039
|
+
this.commonObjs.clear(), u || this.fontLoader.clear(), vl(this, c, null), this._getFieldObjectsPromise = null, this._hasJSActionsPromise = null;
|
|
3040
3040
|
}
|
|
3041
3041
|
}
|
|
3042
3042
|
get loadingParams() {
|
|
@@ -3050,8 +3050,8 @@ function requirePdf() {
|
|
|
3050
3050
|
s = new WeakMap(), i = new WeakMap(), o = new WeakMap(), c = new WeakMap();
|
|
3051
3051
|
class PDFObjects {
|
|
3052
3052
|
constructor() {
|
|
3053
|
-
|
|
3054
|
-
|
|
3053
|
+
ml(this, l);
|
|
3054
|
+
ml(this, h, /* @__PURE__ */ Object.create(null));
|
|
3055
3055
|
}
|
|
3056
3056
|
get(u, a = null) {
|
|
3057
3057
|
if (a) {
|
|
@@ -3072,7 +3072,7 @@ function requirePdf() {
|
|
|
3072
3072
|
pe.data = a, pe.capability.resolve();
|
|
3073
3073
|
}
|
|
3074
3074
|
clear() {
|
|
3075
|
-
|
|
3075
|
+
vl(this, h, /* @__PURE__ */ Object.create(null));
|
|
3076
3076
|
}
|
|
3077
3077
|
}
|
|
3078
3078
|
h = new WeakMap(), l = new WeakSet(), Sm = function(u) {
|
|
@@ -3084,8 +3084,8 @@ function requirePdf() {
|
|
|
3084
3084
|
};
|
|
3085
3085
|
class RenderTask {
|
|
3086
3086
|
constructor(u) {
|
|
3087
|
-
|
|
3088
|
-
|
|
3087
|
+
ml(this, Ye, null);
|
|
3088
|
+
vl(this, Ye, u), this.onContinue = null;
|
|
3089
3089
|
}
|
|
3090
3090
|
get promise() {
|
|
3091
3091
|
return Gn(this, Ye).capability.promise;
|
|
@@ -3175,7 +3175,7 @@ function requirePdf() {
|
|
|
3175
3175
|
this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), this._canvas && Gn(Le, de).delete(this._canvas), this.callback())));
|
|
3176
3176
|
}
|
|
3177
3177
|
};
|
|
3178
|
-
de = new WeakMap(),
|
|
3178
|
+
de = new WeakMap(), ml(Le, de, /* @__PURE__ */ new WeakSet());
|
|
3179
3179
|
let InternalRenderTask = Le;
|
|
3180
3180
|
const version = "2.16.105";
|
|
3181
3181
|
exports.version = version;
|
|
@@ -3192,7 +3192,7 @@ function requirePdf() {
|
|
|
3192
3192
|
var n = r(1), s = r(6), i = r(10);
|
|
3193
3193
|
class o {
|
|
3194
3194
|
constructor() {
|
|
3195
|
-
|
|
3195
|
+
ml(this, h);
|
|
3196
3196
|
this._storage = /* @__PURE__ */ new Map(), this._modified = !1, this.onSetModified = null, this.onResetModified = null, this.onAnnotationEditor = null;
|
|
3197
3197
|
}
|
|
3198
3198
|
getValue(de, Le) {
|
|
@@ -3260,8 +3260,8 @@ function requirePdf() {
|
|
|
3260
3260
|
class c extends o {
|
|
3261
3261
|
constructor(Le) {
|
|
3262
3262
|
super();
|
|
3263
|
-
|
|
3264
|
-
|
|
3263
|
+
ml(this, b, null);
|
|
3264
|
+
vl(this, b, structuredClone(Le.serializable));
|
|
3265
3265
|
}
|
|
3266
3266
|
get print() {
|
|
3267
3267
|
(0, n.unreachable)("Should not call PrintAnnotationStorage.print");
|
|
@@ -3282,12 +3282,12 @@ function requirePdf() {
|
|
|
3282
3282
|
var n = r(7), s = r(1);
|
|
3283
3283
|
const de = class de {
|
|
3284
3284
|
constructor(E) {
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3285
|
+
ml(this, o, this.focusin.bind(this));
|
|
3286
|
+
ml(this, c, this.focusout.bind(this));
|
|
3287
|
+
ml(this, h, !1);
|
|
3288
|
+
ml(this, l, !1);
|
|
3289
|
+
ml(this, b, !1);
|
|
3290
|
+
ml(this, Ye, de._zIndex++);
|
|
3291
3291
|
this.constructor === de && (0, s.unreachable)("Cannot initialize AnnotationEditor."), this.parent = E.parent, this.id = E.id, this.width = this.height = null, this.pageIndex = E.parent.pageIndex, this.name = E.name, this.div = null;
|
|
3292
3292
|
const [u, a] = this.parent.viewportBaseDimensions;
|
|
3293
3293
|
this.x = E.x / u, this.y = E.y / a, this.rotation = this.parent.viewport.rotation, this.isAttachedToDOM = !1;
|
|
@@ -3302,7 +3302,7 @@ function requirePdf() {
|
|
|
3302
3302
|
this.div.style.zIndex = Gn(this, Ye);
|
|
3303
3303
|
}
|
|
3304
3304
|
focusin(E) {
|
|
3305
|
-
Gn(this, h) ?
|
|
3305
|
+
Gn(this, h) ? vl(this, h, !1) : this.parent.setSelected(this);
|
|
3306
3306
|
}
|
|
3307
3307
|
focusout(E) {
|
|
3308
3308
|
if (!this.isAttachedToDOM)
|
|
@@ -3361,7 +3361,7 @@ function requirePdf() {
|
|
|
3361
3361
|
E.preventDefault();
|
|
3362
3362
|
return;
|
|
3363
3363
|
}
|
|
3364
|
-
E.ctrlKey && !u || E.shiftKey || E.metaKey && u ? this.parent.toggleSelected(this) : this.parent.setSelected(this),
|
|
3364
|
+
E.ctrlKey && !u || E.shiftKey || E.metaKey && u ? this.parent.toggleSelected(this) : this.parent.setSelected(this), vl(this, h, !0);
|
|
3365
3365
|
}
|
|
3366
3366
|
getRect(E, u) {
|
|
3367
3367
|
const [a, pe] = this.parent.viewportBaseDimensions, [st, nt] = this.parent.pageDimensions, tt = st * E / a, N = nt * u / pe, P = this.x * st, p = this.y * nt, mt = this.width * st, kt = this.height * nt;
|
|
@@ -3399,10 +3399,10 @@ function requirePdf() {
|
|
|
3399
3399
|
return !1;
|
|
3400
3400
|
}
|
|
3401
3401
|
enableEditMode() {
|
|
3402
|
-
|
|
3402
|
+
vl(this, b, !0);
|
|
3403
3403
|
}
|
|
3404
3404
|
disableEditMode() {
|
|
3405
|
-
|
|
3405
|
+
vl(this, b, !1);
|
|
3406
3406
|
}
|
|
3407
3407
|
isInEditMode() {
|
|
3408
3408
|
return Gn(this, b);
|
|
@@ -3456,7 +3456,7 @@ function requirePdf() {
|
|
|
3456
3456
|
return Gn(this, l);
|
|
3457
3457
|
}
|
|
3458
3458
|
set isEditing(E) {
|
|
3459
|
-
|
|
3459
|
+
vl(this, l, E), E ? (this.parent.setSelected(this), this.parent.setActiveEditor(this)) : this.parent.setActiveEditor(null);
|
|
3460
3460
|
}
|
|
3461
3461
|
};
|
|
3462
3462
|
o = new WeakMap(), c = new WeakMap(), h = new WeakMap(), l = new WeakMap(), b = new WeakMap(), Ye = new WeakMap(), Tg(de, "_colorManager", new n.ColorManager()), Tg(de, "_zIndex", 1);
|
|
@@ -3466,21 +3466,21 @@ function requirePdf() {
|
|
|
3466
3466
|
/* 7 */
|
|
3467
3467
|
/***/
|
|
3468
3468
|
(e, t, r) => {
|
|
3469
|
-
var Le, E, u, a, pe, st, Ym, N, p, mt, kt, Fr, ur, Is, Si, Yn, Zn, Xn, Kn, As, Ti,
|
|
3469
|
+
var Le, E, u, a, pe, st, Ym, N, p, mt, kt, Fr, ur, Is, Si, Yn, Zn, Xn, Kn, As, Ti, Oi, dl, ln, Dt, ot, Zm, Bm, em, pm, Jm, Qm, Tm, gm, Cm;
|
|
3470
3470
|
Object.defineProperty(t, "__esModule", {
|
|
3471
3471
|
value: !0
|
|
3472
3472
|
}), t.KeyboardManager = t.CommandManager = t.ColorManager = t.AnnotationEditorUIManager = void 0, t.bindEvents = i, t.opacityToHex = o;
|
|
3473
3473
|
var n = r(1), s = r(8);
|
|
3474
3474
|
function i(Gr, nr, Un) {
|
|
3475
|
-
for (const
|
|
3476
|
-
nr.addEventListener(
|
|
3475
|
+
for (const ji of Un)
|
|
3476
|
+
nr.addEventListener(ji, Gr[ji].bind(Gr));
|
|
3477
3477
|
}
|
|
3478
3478
|
function o(Gr) {
|
|
3479
3479
|
return Math.round(Math.min(255, Math.max(1, 255 * Gr))).toString(16).padStart(2, "0");
|
|
3480
3480
|
}
|
|
3481
3481
|
class c {
|
|
3482
3482
|
constructor() {
|
|
3483
|
-
|
|
3483
|
+
ml(this, Le, 0);
|
|
3484
3484
|
}
|
|
3485
3485
|
getId() {
|
|
3486
3486
|
return `${n.AnnotationEditorPrefix}${km(this, Le)._++}`;
|
|
@@ -3489,43 +3489,43 @@ function requirePdf() {
|
|
|
3489
3489
|
Le = new WeakMap();
|
|
3490
3490
|
class h {
|
|
3491
3491
|
constructor(nr = 128) {
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3492
|
+
ml(this, E, []);
|
|
3493
|
+
ml(this, u, !1);
|
|
3494
|
+
ml(this, a);
|
|
3495
|
+
ml(this, pe, -1);
|
|
3496
|
+
vl(this, a, nr);
|
|
3497
3497
|
}
|
|
3498
3498
|
add({
|
|
3499
3499
|
cmd: nr,
|
|
3500
3500
|
undo: Un,
|
|
3501
|
-
mustExec:
|
|
3502
|
-
type:
|
|
3503
|
-
overwriteIfSameType:
|
|
3504
|
-
keepUndo:
|
|
3501
|
+
mustExec: ji,
|
|
3502
|
+
type: qs = NaN,
|
|
3503
|
+
overwriteIfSameType: Pi = !1,
|
|
3504
|
+
keepUndo: ki = !1
|
|
3505
3505
|
}) {
|
|
3506
|
-
if (
|
|
3506
|
+
if (ji && nr(), Gn(this, u))
|
|
3507
3507
|
return;
|
|
3508
|
-
const
|
|
3508
|
+
const Ri = {
|
|
3509
3509
|
cmd: nr,
|
|
3510
3510
|
undo: Un,
|
|
3511
|
-
type:
|
|
3511
|
+
type: qs
|
|
3512
3512
|
};
|
|
3513
3513
|
if (Gn(this, pe) === -1) {
|
|
3514
|
-
Gn(this, E).length > 0 && (Gn(this, E).length = 0),
|
|
3514
|
+
Gn(this, E).length > 0 && (Gn(this, E).length = 0), vl(this, pe, 0), Gn(this, E).push(Ri);
|
|
3515
3515
|
return;
|
|
3516
3516
|
}
|
|
3517
|
-
if (
|
|
3518
|
-
|
|
3517
|
+
if (Pi && Gn(this, E)[Gn(this, pe)].type === qs) {
|
|
3518
|
+
ki && (Ri.undo = Gn(this, E)[Gn(this, pe)].undo), Gn(this, E)[Gn(this, pe)] = Ri;
|
|
3519
3519
|
return;
|
|
3520
3520
|
}
|
|
3521
|
-
const
|
|
3522
|
-
|
|
3521
|
+
const hl = Gn(this, pe) + 1;
|
|
3522
|
+
hl === Gn(this, a) ? Gn(this, E).splice(0, 1) : (vl(this, pe, hl), hl < Gn(this, E).length && Gn(this, E).splice(hl)), Gn(this, E).push(Ri);
|
|
3523
3523
|
}
|
|
3524
3524
|
undo() {
|
|
3525
|
-
Gn(this, pe) !== -1 && (
|
|
3525
|
+
Gn(this, pe) !== -1 && (vl(this, u, !0), Gn(this, E)[Gn(this, pe)].undo(), vl(this, u, !1), vl(this, pe, Gn(this, pe) - 1));
|
|
3526
3526
|
}
|
|
3527
3527
|
redo() {
|
|
3528
|
-
Gn(this, pe) < Gn(this, E).length - 1 && (
|
|
3528
|
+
Gn(this, pe) < Gn(this, E).length - 1 && (vl(this, pe, Gn(this, pe) + 1), vl(this, u, !0), Gn(this, E)[Gn(this, pe)].cmd(), vl(this, u, !1));
|
|
3529
3529
|
}
|
|
3530
3530
|
hasSomethingToUndo() {
|
|
3531
3531
|
return Gn(this, pe) !== -1;
|
|
@@ -3534,19 +3534,19 @@ function requirePdf() {
|
|
|
3534
3534
|
return Gn(this, pe) < Gn(this, E).length - 1;
|
|
3535
3535
|
}
|
|
3536
3536
|
destroy() {
|
|
3537
|
-
|
|
3537
|
+
vl(this, E, null);
|
|
3538
3538
|
}
|
|
3539
3539
|
}
|
|
3540
3540
|
E = new WeakMap(), u = new WeakMap(), a = new WeakMap(), pe = new WeakMap(), t.CommandManager = h;
|
|
3541
3541
|
const tt = class tt {
|
|
3542
3542
|
constructor(nr) {
|
|
3543
|
-
|
|
3543
|
+
ml(this, st);
|
|
3544
3544
|
this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
|
|
3545
3545
|
const Un = tt.platform.isMac;
|
|
3546
|
-
for (const [
|
|
3547
|
-
for (const
|
|
3548
|
-
const
|
|
3549
|
-
Un &&
|
|
3546
|
+
for (const [ji, qs] of nr)
|
|
3547
|
+
for (const Pi of ji) {
|
|
3548
|
+
const ki = Pi.startsWith("mac+");
|
|
3549
|
+
Un && ki ? (this.callbacks.set(Pi.slice(4), qs), this.allKeys.add(Pi.split("+").at(-1))) : !Un && !ki && (this.callbacks.set(Pi, qs), this.allKeys.add(Pi.split("+").at(-1)));
|
|
3550
3550
|
}
|
|
3551
3551
|
}
|
|
3552
3552
|
static get platform() {
|
|
@@ -3559,8 +3559,8 @@ function requirePdf() {
|
|
|
3559
3559
|
exec(nr, Un) {
|
|
3560
3560
|
if (!this.allKeys.has(Un.key))
|
|
3561
3561
|
return;
|
|
3562
|
-
const
|
|
3563
|
-
|
|
3562
|
+
const ji = this.callbacks.get(gl(this, st, Ym).call(this, Un));
|
|
3563
|
+
ji && (ji.bind(nr)(), Un.stopPropagation(), Un.preventDefault());
|
|
3564
3564
|
}
|
|
3565
3565
|
};
|
|
3566
3566
|
st = new WeakSet(), Ym = function(nr) {
|
|
@@ -3572,10 +3572,10 @@ function requirePdf() {
|
|
|
3572
3572
|
t.KeyboardManager = l;
|
|
3573
3573
|
class b {
|
|
3574
3574
|
constructor() {
|
|
3575
|
-
|
|
3575
|
+
ml(this, N, null);
|
|
3576
3576
|
}
|
|
3577
3577
|
copy(nr) {
|
|
3578
|
-
nr && (Array.isArray(nr) ?
|
|
3578
|
+
nr && (Array.isArray(nr) ? vl(this, N, nr.map((Un) => Un.serialize())) : vl(this, N, [nr.serialize()]), vl(this, N, Gn(this, N).filter((Un) => !!Un)), Gn(this, N).length === 0 && vl(this, N, null));
|
|
3579
3579
|
}
|
|
3580
3580
|
paste() {
|
|
3581
3581
|
return Gn(this, N);
|
|
@@ -3584,7 +3584,7 @@ function requirePdf() {
|
|
|
3584
3584
|
return Gn(this, N) === null;
|
|
3585
3585
|
}
|
|
3586
3586
|
destroy() {
|
|
3587
|
-
|
|
3587
|
+
vl(this, N, null);
|
|
3588
3588
|
}
|
|
3589
3589
|
}
|
|
3590
3590
|
N = new WeakMap();
|
|
@@ -3597,9 +3597,9 @@ function requirePdf() {
|
|
|
3597
3597
|
const Un = (0, s.getRGB)(nr);
|
|
3598
3598
|
if (!window.matchMedia("(forced-colors: active)").matches)
|
|
3599
3599
|
return Un;
|
|
3600
|
-
for (const [
|
|
3601
|
-
if (
|
|
3602
|
-
return P._colorsMapping.get(
|
|
3600
|
+
for (const [ji, qs] of this._colors)
|
|
3601
|
+
if (qs.every((Pi, ki) => Pi === Un[ki]))
|
|
3602
|
+
return P._colorsMapping.get(ji);
|
|
3603
3603
|
return Un;
|
|
3604
3604
|
}
|
|
3605
3605
|
getHexCode(nr) {
|
|
@@ -3612,23 +3612,23 @@ function requirePdf() {
|
|
|
3612
3612
|
t.ColorManager = Ye;
|
|
3613
3613
|
const un = class un {
|
|
3614
3614
|
constructor(nr, Un) {
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3615
|
+
ml(this, ot);
|
|
3616
|
+
ml(this, p, null);
|
|
3617
|
+
ml(this, mt, /* @__PURE__ */ new Map());
|
|
3618
|
+
ml(this, kt, /* @__PURE__ */ new Map());
|
|
3619
|
+
ml(this, Fr, new b());
|
|
3620
|
+
ml(this, ur, new h());
|
|
3621
|
+
ml(this, Is, 0);
|
|
3622
|
+
ml(this, Si, null);
|
|
3623
|
+
ml(this, Yn, null);
|
|
3624
|
+
ml(this, Zn, new c());
|
|
3625
|
+
ml(this, Xn, !1);
|
|
3626
|
+
ml(this, Kn, n.AnnotationEditorType.NONE);
|
|
3627
|
+
ml(this, As, /* @__PURE__ */ new Set());
|
|
3628
|
+
ml(this, Ti, this.keydown.bind(this));
|
|
3629
|
+
ml(this, Oi, this.onEditingAction.bind(this));
|
|
3630
|
+
ml(this, dl, this.onPageChanging.bind(this));
|
|
3631
|
+
ml(this, ln, {
|
|
3632
3632
|
isEditing: !1,
|
|
3633
3633
|
isEmpty: !0,
|
|
3634
3634
|
hasEmptyClipboard: !0,
|
|
@@ -3636,19 +3636,19 @@ function requirePdf() {
|
|
|
3636
3636
|
hasSomethingToRedo: !1,
|
|
3637
3637
|
hasSelectedEditor: !1
|
|
3638
3638
|
});
|
|
3639
|
-
|
|
3640
|
-
|
|
3639
|
+
ml(this, Dt, null);
|
|
3640
|
+
vl(this, Dt, nr), vl(this, Yn, Un), Gn(this, Yn)._on("editingaction", Gn(this, Oi)), Gn(this, Yn)._on("pagechanging", Gn(this, dl));
|
|
3641
3641
|
}
|
|
3642
3642
|
destroy() {
|
|
3643
|
-
gl(this, ot, Bm).call(this), Gn(this, Yn)._off("editingaction", Gn(this,
|
|
3643
|
+
gl(this, ot, Bm).call(this), Gn(this, Yn)._off("editingaction", Gn(this, Oi)), Gn(this, Yn)._off("pagechanging", Gn(this, dl));
|
|
3644
3644
|
for (const nr of Gn(this, kt).values())
|
|
3645
3645
|
nr.destroy();
|
|
3646
|
-
Gn(this, kt).clear(), Gn(this, mt).clear(),
|
|
3646
|
+
Gn(this, kt).clear(), Gn(this, mt).clear(), vl(this, p, null), Gn(this, As).clear(), Gn(this, Fr).destroy(), Gn(this, ur).destroy();
|
|
3647
3647
|
}
|
|
3648
3648
|
onPageChanging({
|
|
3649
3649
|
pageNumber: nr
|
|
3650
3650
|
}) {
|
|
3651
|
-
|
|
3651
|
+
vl(this, Is, nr - 1);
|
|
3652
3652
|
}
|
|
3653
3653
|
focusMainContainer() {
|
|
3654
3654
|
Gn(this, Dt).focus();
|
|
@@ -3673,7 +3673,7 @@ function requirePdf() {
|
|
|
3673
3673
|
}));
|
|
3674
3674
|
}
|
|
3675
3675
|
registerEditorTypes(nr) {
|
|
3676
|
-
|
|
3676
|
+
vl(this, Si, nr);
|
|
3677
3677
|
for (const Un of Gn(this, Si))
|
|
3678
3678
|
gl(this, ot, pm).call(this, Un.defaultPropertiesToUpdate);
|
|
3679
3679
|
}
|
|
@@ -3687,7 +3687,7 @@ function requirePdf() {
|
|
|
3687
3687
|
Gn(this, kt).delete(nr.pageIndex);
|
|
3688
3688
|
}
|
|
3689
3689
|
updateMode(nr) {
|
|
3690
|
-
if (
|
|
3690
|
+
if (vl(this, Kn, nr), nr === n.AnnotationEditorType.NONE)
|
|
3691
3691
|
this.setEditingState(!1), gl(this, ot, Qm).call(this);
|
|
3692
3692
|
else {
|
|
3693
3693
|
this.setEditingState(!0), gl(this, ot, Jm).call(this);
|
|
@@ -3702,15 +3702,15 @@ function requirePdf() {
|
|
|
3702
3702
|
});
|
|
3703
3703
|
}
|
|
3704
3704
|
updateParams(nr, Un) {
|
|
3705
|
-
for (const
|
|
3706
|
-
|
|
3707
|
-
for (const
|
|
3708
|
-
|
|
3705
|
+
for (const ji of Gn(this, As))
|
|
3706
|
+
ji.updateParams(nr, Un);
|
|
3707
|
+
for (const ji of Gn(this, Si))
|
|
3708
|
+
ji.updateDefaultParams(nr, Un);
|
|
3709
3709
|
}
|
|
3710
3710
|
getEditors(nr) {
|
|
3711
3711
|
const Un = [];
|
|
3712
|
-
for (const
|
|
3713
|
-
|
|
3712
|
+
for (const ji of Gn(this, mt).values())
|
|
3713
|
+
ji.pageIndex === nr && Un.push(ji);
|
|
3714
3714
|
return Un;
|
|
3715
3715
|
}
|
|
3716
3716
|
getEditor(nr) {
|
|
@@ -3723,7 +3723,7 @@ function requirePdf() {
|
|
|
3723
3723
|
Gn(this, mt).delete(nr.id), this.unselect(nr);
|
|
3724
3724
|
}
|
|
3725
3725
|
setActiveEditor(nr) {
|
|
3726
|
-
Gn(this, p) !== nr && (
|
|
3726
|
+
Gn(this, p) !== nr && (vl(this, p, nr), nr && gl(this, ot, pm).call(this, nr.propertiesToUpdate));
|
|
3727
3727
|
}
|
|
3728
3728
|
toggleSelected(nr) {
|
|
3729
3729
|
if (Gn(this, As).has(nr)) {
|
|
@@ -3779,15 +3779,15 @@ function requirePdf() {
|
|
|
3779
3779
|
if (Gn(this, p) && Gn(this, p).commitOrRemove(), !this.hasSelection)
|
|
3780
3780
|
return;
|
|
3781
3781
|
const nr = [...Gn(this, As)], Un = () => {
|
|
3782
|
-
for (const
|
|
3783
|
-
|
|
3784
|
-
},
|
|
3785
|
-
for (const
|
|
3786
|
-
gl(this, ot, Tm).call(this,
|
|
3782
|
+
for (const qs of nr)
|
|
3783
|
+
qs.remove();
|
|
3784
|
+
}, ji = () => {
|
|
3785
|
+
for (const qs of nr)
|
|
3786
|
+
gl(this, ot, Tm).call(this, qs);
|
|
3787
3787
|
};
|
|
3788
3788
|
this.addCommands({
|
|
3789
3789
|
cmd: Un,
|
|
3790
|
-
undo:
|
|
3790
|
+
undo: ji,
|
|
3791
3791
|
mustExec: !0
|
|
3792
3792
|
});
|
|
3793
3793
|
}
|
|
@@ -3810,17 +3810,17 @@ function requirePdf() {
|
|
|
3810
3810
|
if (Gn(this, Fr).isEmpty())
|
|
3811
3811
|
return;
|
|
3812
3812
|
this.unselectAll();
|
|
3813
|
-
const nr = Gn(this, kt).get(Gn(this, Is)), Un = Gn(this, Fr).paste().map((
|
|
3814
|
-
for (const
|
|
3815
|
-
gl(this, ot, Tm).call(this,
|
|
3813
|
+
const nr = Gn(this, kt).get(Gn(this, Is)), Un = Gn(this, Fr).paste().map((Pi) => nr.deserialize(Pi)), ji = () => {
|
|
3814
|
+
for (const Pi of Un)
|
|
3815
|
+
gl(this, ot, Tm).call(this, Pi);
|
|
3816
3816
|
gl(this, ot, Cm).call(this, Un);
|
|
3817
|
-
},
|
|
3818
|
-
for (const
|
|
3819
|
-
|
|
3817
|
+
}, qs = () => {
|
|
3818
|
+
for (const Pi of Un)
|
|
3819
|
+
Pi.remove();
|
|
3820
3820
|
};
|
|
3821
3821
|
this.addCommands({
|
|
3822
|
-
cmd:
|
|
3823
|
-
undo:
|
|
3822
|
+
cmd: ji,
|
|
3823
|
+
undo: qs,
|
|
3824
3824
|
mustExec: !0
|
|
3825
3825
|
});
|
|
3826
3826
|
}
|
|
@@ -3852,12 +3852,12 @@ function requirePdf() {
|
|
|
3852
3852
|
return Gn(this, Kn);
|
|
3853
3853
|
}
|
|
3854
3854
|
};
|
|
3855
|
-
p = new WeakMap(), mt = new WeakMap(), kt = new WeakMap(), Fr = new WeakMap(), ur = new WeakMap(), Is = new WeakMap(), Si = new WeakMap(), Yn = new WeakMap(), Zn = new WeakMap(), Xn = new WeakMap(), Kn = new WeakMap(), As = new WeakMap(), Ti = new WeakMap(),
|
|
3855
|
+
p = new WeakMap(), mt = new WeakMap(), kt = new WeakMap(), Fr = new WeakMap(), ur = new WeakMap(), Is = new WeakMap(), Si = new WeakMap(), Yn = new WeakMap(), Zn = new WeakMap(), Xn = new WeakMap(), Kn = new WeakMap(), As = new WeakMap(), Ti = new WeakMap(), Oi = new WeakMap(), dl = new WeakMap(), ln = new WeakMap(), Dt = new WeakMap(), ot = new WeakSet(), Zm = function() {
|
|
3856
3856
|
Gn(this, Dt).addEventListener("keydown", Gn(this, Ti));
|
|
3857
3857
|
}, Bm = function() {
|
|
3858
3858
|
Gn(this, Dt).removeEventListener("keydown", Gn(this, Ti));
|
|
3859
3859
|
}, em = function(nr) {
|
|
3860
|
-
Object.entries(nr).some(([
|
|
3860
|
+
Object.entries(nr).some(([ji, qs]) => Gn(this, ln)[ji] !== qs) && Gn(this, Yn).dispatch("annotationeditorstateschanged", {
|
|
3861
3861
|
source: this,
|
|
3862
3862
|
details: Object.assign(Gn(this, ln), nr)
|
|
3863
3863
|
});
|
|
@@ -3868,13 +3868,13 @@ function requirePdf() {
|
|
|
3868
3868
|
});
|
|
3869
3869
|
}, Jm = function() {
|
|
3870
3870
|
if (!Gn(this, Xn)) {
|
|
3871
|
-
|
|
3871
|
+
vl(this, Xn, !0);
|
|
3872
3872
|
for (const nr of Gn(this, kt).values())
|
|
3873
3873
|
nr.enable();
|
|
3874
3874
|
}
|
|
3875
3875
|
}, Qm = function() {
|
|
3876
3876
|
if (this.unselectAll(), Gn(this, Xn)) {
|
|
3877
|
-
|
|
3877
|
+
vl(this, Xn, !1);
|
|
3878
3878
|
for (const nr of Gn(this, kt).values())
|
|
3879
3879
|
nr.disable();
|
|
3880
3880
|
}
|
|
@@ -3937,9 +3937,9 @@ function requirePdf() {
|
|
|
3937
3937
|
Ti.open("GET", Zn, !0), Xn && (Ti.responseType = "arraybuffer"), Ti.onreadystatechange = () => {
|
|
3938
3938
|
if (Ti.readyState === XMLHttpRequest.DONE) {
|
|
3939
3939
|
if (Ti.status === 200 || Ti.status === 0) {
|
|
3940
|
-
let
|
|
3941
|
-
if (Xn && Ti.response ?
|
|
3942
|
-
Kn(
|
|
3940
|
+
let Oi;
|
|
3941
|
+
if (Xn && Ti.response ? Oi = new Uint8Array(Ti.response) : !Xn && Ti.responseText && (Oi = (0, s.stringToBytes)(Ti.responseText)), Oi) {
|
|
3942
|
+
Kn(Oi);
|
|
3943
3943
|
return;
|
|
3944
3944
|
}
|
|
3945
3945
|
}
|
|
@@ -3975,10 +3975,10 @@ function requirePdf() {
|
|
|
3975
3975
|
scale: Kn,
|
|
3976
3976
|
rotation: As,
|
|
3977
3977
|
offsetX: Ti = 0,
|
|
3978
|
-
offsetY:
|
|
3978
|
+
offsetY: Oi = 0,
|
|
3979
3979
|
dontFlip: dl = !1
|
|
3980
3980
|
}) {
|
|
3981
|
-
this.viewBox = Xn, this.scale = Kn, this.rotation = As, this.offsetX = Ti, this.offsetY =
|
|
3981
|
+
this.viewBox = Xn, this.scale = Kn, this.rotation = As, this.offsetX = Ti, this.offsetY = Oi;
|
|
3982
3982
|
const ln = (Xn[2] + Xn[0]) / 2, Dt = (Xn[3] + Xn[1]) / 2;
|
|
3983
3983
|
let ot, Ur, It, Br;
|
|
3984
3984
|
switch (As %= 360, As < 0 && (As += 360), As) {
|
|
@@ -3999,14 +3999,14 @@ function requirePdf() {
|
|
|
3999
3999
|
}
|
|
4000
4000
|
dl && (It = -It, Br = -Br);
|
|
4001
4001
|
let Ar, me, St, Lt;
|
|
4002
|
-
ot === 0 ? (Ar = Math.abs(Dt - Xn[1]) * Kn + Ti, me = Math.abs(ln - Xn[0]) * Kn +
|
|
4002
|
+
ot === 0 ? (Ar = Math.abs(Dt - Xn[1]) * Kn + Ti, me = Math.abs(ln - Xn[0]) * Kn + Oi, St = Math.abs(Xn[3] - Xn[1]) * Kn, Lt = Math.abs(Xn[2] - Xn[0]) * Kn) : (Ar = Math.abs(ln - Xn[0]) * Kn + Ti, me = Math.abs(Dt - Xn[1]) * Kn + Oi, St = Math.abs(Xn[2] - Xn[0]) * Kn, Lt = Math.abs(Xn[3] - Xn[1]) * Kn), this.transform = [ot * Kn, Ur * Kn, It * Kn, Br * Kn, Ar - ot * Kn * ln - It * Kn * Dt, me - Ur * Kn * ln - Br * Kn * Dt], this.width = St, this.height = Lt;
|
|
4003
4003
|
}
|
|
4004
4004
|
clone({
|
|
4005
4005
|
scale: Xn = this.scale,
|
|
4006
4006
|
rotation: Kn = this.rotation,
|
|
4007
4007
|
offsetX: As = this.offsetX,
|
|
4008
4008
|
offsetY: Ti = this.offsetY,
|
|
4009
|
-
dontFlip:
|
|
4009
|
+
dontFlip: Oi = !1
|
|
4010
4010
|
} = {}) {
|
|
4011
4011
|
return new Le({
|
|
4012
4012
|
viewBox: this.viewBox.slice(),
|
|
@@ -4014,7 +4014,7 @@ function requirePdf() {
|
|
|
4014
4014
|
rotation: Kn,
|
|
4015
4015
|
offsetX: As,
|
|
4016
4016
|
offsetY: Ti,
|
|
4017
|
-
dontFlip:
|
|
4017
|
+
dontFlip: Oi
|
|
4018
4018
|
});
|
|
4019
4019
|
}
|
|
4020
4020
|
convertToViewportPoint(Xn, Kn) {
|
|
@@ -4055,13 +4055,13 @@ function requirePdf() {
|
|
|
4055
4055
|
if (u(Zn))
|
|
4056
4056
|
return (0, s.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), Xn;
|
|
4057
4057
|
const Kn = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/, As = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i, Ti = Kn.exec(Zn);
|
|
4058
|
-
let
|
|
4059
|
-
if (
|
|
4058
|
+
let Oi = As.exec(Ti[1]) || As.exec(Ti[2]) || As.exec(Ti[3]);
|
|
4059
|
+
if (Oi && (Oi = Oi[0], Oi.includes("%")))
|
|
4060
4060
|
try {
|
|
4061
|
-
|
|
4061
|
+
Oi = As.exec(decodeURIComponent(Oi))[0];
|
|
4062
4062
|
} catch {
|
|
4063
4063
|
}
|
|
4064
|
-
return
|
|
4064
|
+
return Oi || Xn;
|
|
4065
4065
|
}
|
|
4066
4066
|
class nt {
|
|
4067
4067
|
constructor() {
|
|
@@ -4106,8 +4106,8 @@ function requirePdf() {
|
|
|
4106
4106
|
function N(Zn, Xn = !1) {
|
|
4107
4107
|
return new Promise((Kn, As) => {
|
|
4108
4108
|
const Ti = document.createElement("script");
|
|
4109
|
-
Ti.src = Zn, Ti.onload = function(
|
|
4110
|
-
Xn && Ti.remove(), Kn(
|
|
4109
|
+
Ti.src = Zn, Ti.onload = function(Oi) {
|
|
4110
|
+
Xn && Ti.remove(), Kn(Oi);
|
|
4111
4111
|
}, Ti.onerror = function() {
|
|
4112
4112
|
As(new Error(`Cannot load script at: ${Ti.src}`));
|
|
4113
4113
|
}, (document.head || document.documentElement).append(Ti);
|
|
@@ -4128,8 +4128,8 @@ function requirePdf() {
|
|
|
4128
4128
|
const As = parseInt(Kn[1], 10);
|
|
4129
4129
|
let Ti = parseInt(Kn[2], 10);
|
|
4130
4130
|
Ti = Ti >= 1 && Ti <= 12 ? Ti - 1 : 0;
|
|
4131
|
-
let
|
|
4132
|
-
|
|
4131
|
+
let Oi = parseInt(Kn[3], 10);
|
|
4132
|
+
Oi = Oi >= 1 && Oi <= 31 ? Oi : 1;
|
|
4133
4133
|
let dl = parseInt(Kn[4], 10);
|
|
4134
4134
|
dl = dl >= 0 && dl <= 23 ? dl : 0;
|
|
4135
4135
|
let ln = parseInt(Kn[5], 10);
|
|
@@ -4140,7 +4140,7 @@ function requirePdf() {
|
|
|
4140
4140
|
let Ur = parseInt(Kn[8], 10);
|
|
4141
4141
|
Ur = Ur >= 0 && Ur <= 23 ? Ur : 0;
|
|
4142
4142
|
let It = parseInt(Kn[9], 10) || 0;
|
|
4143
|
-
return It = It >= 0 && It <= 59 ? It : 0, ot === "-" ? (dl += Ur, ln += It) : ot === "+" && (dl -= Ur, ln -= It), new Date(Date.UTC(As, Ti,
|
|
4143
|
+
return It = It >= 0 && It <= 59 ? It : 0, ot === "-" ? (dl += Ur, ln += It) : ot === "+" && (dl -= Ur, ln -= It), new Date(Date.UTC(As, Ti, Oi, dl, ln, Dt));
|
|
4144
4144
|
}
|
|
4145
4145
|
}
|
|
4146
4146
|
t.PDFDateString = mt;
|
|
@@ -4151,9 +4151,9 @@ function requirePdf() {
|
|
|
4151
4151
|
const {
|
|
4152
4152
|
width: As,
|
|
4153
4153
|
height: Ti
|
|
4154
|
-
} = Zn.attributes.style,
|
|
4154
|
+
} = Zn.attributes.style, Oi = [0, 0, parseInt(As), parseInt(Ti)];
|
|
4155
4155
|
return new Le({
|
|
4156
|
-
viewBox:
|
|
4156
|
+
viewBox: Oi,
|
|
4157
4157
|
scale: Xn,
|
|
4158
4158
|
rotation: Kn
|
|
4159
4159
|
});
|
|
@@ -4181,10 +4181,10 @@ function requirePdf() {
|
|
|
4181
4181
|
b: Kn,
|
|
4182
4182
|
c: As,
|
|
4183
4183
|
d: Ti,
|
|
4184
|
-
e:
|
|
4184
|
+
e: Oi,
|
|
4185
4185
|
f: dl
|
|
4186
4186
|
} = Zn.getTransform();
|
|
4187
|
-
return [Xn, Kn, As, Ti,
|
|
4187
|
+
return [Xn, Kn, As, Ti, Oi, dl];
|
|
4188
4188
|
}
|
|
4189
4189
|
function Si(Zn) {
|
|
4190
4190
|
const {
|
|
@@ -4192,10 +4192,10 @@ function requirePdf() {
|
|
|
4192
4192
|
b: Kn,
|
|
4193
4193
|
c: As,
|
|
4194
4194
|
d: Ti,
|
|
4195
|
-
e:
|
|
4195
|
+
e: Oi,
|
|
4196
4196
|
f: dl
|
|
4197
4197
|
} = Zn.getTransform().invertSelf();
|
|
4198
|
-
return [Xn, Kn, As, Ti,
|
|
4198
|
+
return [Xn, Kn, As, Ti, Oi, dl];
|
|
4199
4199
|
}
|
|
4200
4200
|
},
|
|
4201
4201
|
/* 9 */
|
|
@@ -4652,16 +4652,16 @@ function requirePdf() {
|
|
|
4652
4652
|
function pe(ln, Dt, ot, Ur, It, Br, Ar, me, St, Lt) {
|
|
4653
4653
|
const [zt, sr, un, Gr, nr, Un] = (0, n.getCurrentTransform)(ln);
|
|
4654
4654
|
if (sr === 0 && un === 0) {
|
|
4655
|
-
const
|
|
4656
|
-
return ln.setTransform(Math.sign(zt), 0, 0, Math.sign(Gr),
|
|
4655
|
+
const Pi = Ar * zt + nr, ki = Math.round(Pi), Ri = me * Gr + Un, hl = Math.round(Ri), Ha = (Ar + St) * zt + nr, Cl = Math.abs(Math.round(Ha) - ki) || 1, Al = (me + Lt) * Gr + Un, bl = Math.abs(Math.round(Al) - hl) || 1;
|
|
4656
|
+
return ln.setTransform(Math.sign(zt), 0, 0, Math.sign(Gr), ki, hl), ln.drawImage(Dt, ot, Ur, It, Br, 0, 0, Cl, bl), ln.setTransform(zt, sr, un, Gr, nr, Un), [Cl, bl];
|
|
4657
4657
|
}
|
|
4658
4658
|
if (zt === 0 && Gr === 0) {
|
|
4659
|
-
const
|
|
4660
|
-
return ln.setTransform(0, Math.sign(sr), Math.sign(un), 0,
|
|
4659
|
+
const Pi = me * un + nr, ki = Math.round(Pi), Ri = Ar * sr + Un, hl = Math.round(Ri), Ha = (me + Lt) * un + nr, Cl = Math.abs(Math.round(Ha) - ki) || 1, Al = (Ar + St) * sr + Un, bl = Math.abs(Math.round(Al) - hl) || 1;
|
|
4660
|
+
return ln.setTransform(0, Math.sign(sr), Math.sign(un), 0, ki, hl), ln.drawImage(Dt, ot, Ur, It, Br, 0, 0, bl, Cl), ln.setTransform(zt, sr, un, Gr, nr, Un), [bl, Cl];
|
|
4661
4661
|
}
|
|
4662
4662
|
ln.drawImage(Dt, ot, Ur, It, Br, Ar, me, St, Lt);
|
|
4663
|
-
const
|
|
4664
|
-
return [
|
|
4663
|
+
const ji = Math.hypot(zt, sr), qs = Math.hypot(un, Gr);
|
|
4664
|
+
return [ji * St, qs * Lt];
|
|
4665
4665
|
}
|
|
4666
4666
|
function st(ln) {
|
|
4667
4667
|
const {
|
|
@@ -4674,19 +4674,19 @@ function requirePdf() {
|
|
|
4674
4674
|
let Ar = new Uint8Array(Br * (ot + 1)), me, St, Lt;
|
|
4675
4675
|
const zt = Dt + 7 & -8;
|
|
4676
4676
|
let sr = new Uint8Array(zt * ot), un = 0;
|
|
4677
|
-
for (const
|
|
4678
|
-
let
|
|
4679
|
-
for (;
|
|
4680
|
-
sr[un++] =
|
|
4677
|
+
for (const qs of ln.data) {
|
|
4678
|
+
let Pi = 128;
|
|
4679
|
+
for (; Pi > 0; )
|
|
4680
|
+
sr[un++] = qs & Pi ? 0 : 255, Pi >>= 1;
|
|
4681
4681
|
}
|
|
4682
4682
|
let Gr = 0;
|
|
4683
4683
|
for (un = 0, sr[un] !== 0 && (Ar[0] = 1, ++Gr), St = 1; St < Dt; St++)
|
|
4684
4684
|
sr[un] !== sr[un + 1] && (Ar[St] = sr[un] ? 2 : 1, ++Gr), un++;
|
|
4685
4685
|
for (sr[un] !== 0 && (Ar[St] = 2, ++Gr), me = 1; me < ot; me++) {
|
|
4686
4686
|
un = me * zt, Lt = me * Br, sr[un - zt] !== sr[un] && (Ar[Lt] = sr[un] ? 1 : 8, ++Gr);
|
|
4687
|
-
let
|
|
4687
|
+
let qs = (sr[un] ? 4 : 0) + (sr[un - zt] ? 8 : 0);
|
|
4688
4688
|
for (St = 1; St < Dt; St++)
|
|
4689
|
-
|
|
4689
|
+
qs = (qs >> 2) + (sr[un + 1] ? 4 : 0) + (sr[un - zt + 1] ? 8 : 0), It[qs] && (Ar[Lt + St] = It[qs], ++Gr), un++;
|
|
4690
4690
|
if (sr[un - zt] !== sr[un] && (Ar[Lt + St] = sr[un] ? 2 : 4, ++Gr), Gr > Ur)
|
|
4691
4691
|
return null;
|
|
4692
4692
|
}
|
|
@@ -4696,27 +4696,27 @@ function requirePdf() {
|
|
|
4696
4696
|
return null;
|
|
4697
4697
|
const nr = new Int32Array([0, Br, -1, 0, -Br, 0, 0, 0, 1]), Un = new Path2D();
|
|
4698
4698
|
for (me = 0; Gr && me <= ot; me++) {
|
|
4699
|
-
let
|
|
4700
|
-
const
|
|
4701
|
-
for (;
|
|
4702
|
-
|
|
4703
|
-
if (
|
|
4699
|
+
let qs = me * Br;
|
|
4700
|
+
const Pi = qs + Dt;
|
|
4701
|
+
for (; qs < Pi && !Ar[qs]; )
|
|
4702
|
+
qs++;
|
|
4703
|
+
if (qs === Pi)
|
|
4704
4704
|
continue;
|
|
4705
|
-
Un.moveTo(
|
|
4706
|
-
const
|
|
4707
|
-
let
|
|
4705
|
+
Un.moveTo(qs % Br, me);
|
|
4706
|
+
const ki = qs;
|
|
4707
|
+
let Ri = Ar[qs];
|
|
4708
4708
|
do {
|
|
4709
|
-
const
|
|
4709
|
+
const hl = nr[Ri];
|
|
4710
4710
|
do
|
|
4711
|
-
|
|
4712
|
-
while (!Ar[
|
|
4713
|
-
const Ha = Ar[
|
|
4714
|
-
Ha !== 5 && Ha !== 10 ? (
|
|
4715
|
-
} while (
|
|
4711
|
+
qs += hl;
|
|
4712
|
+
while (!Ar[qs]);
|
|
4713
|
+
const Ha = Ar[qs];
|
|
4714
|
+
Ha !== 5 && Ha !== 10 ? (Ri = Ha, Ar[qs] = 0) : (Ri = Ha & 51 * Ri >> 4, Ar[qs] &= Ri >> 2 | Ri << 2), Un.lineTo(qs % Br, qs / Br | 0), Ar[qs] || --Gr;
|
|
4715
|
+
} while (ki !== qs);
|
|
4716
4716
|
--me;
|
|
4717
4717
|
}
|
|
4718
|
-
return sr = null, Ar = null, function(
|
|
4719
|
-
|
|
4718
|
+
return sr = null, Ar = null, function(qs) {
|
|
4719
|
+
qs.save(), qs.scale(1 / Dt, -1 / ot), qs.translate(0, -ot), qs.fill(Un), qs.beginPath(), qs.restore();
|
|
4720
4720
|
};
|
|
4721
4721
|
}
|
|
4722
4722
|
class nt {
|
|
@@ -4779,56 +4779,56 @@ function requirePdf() {
|
|
|
4779
4779
|
const Ur = Dt.height, It = Dt.width, Br = Ur % E, Ar = (Ur - Br) / E, me = Br === 0 ? Ar : Ar + 1, St = ln.createImageData(It, E);
|
|
4780
4780
|
let Lt = 0, zt;
|
|
4781
4781
|
const sr = Dt.data, un = St.data;
|
|
4782
|
-
let Gr, nr, Un,
|
|
4782
|
+
let Gr, nr, Un, ji, qs, Pi, ki, Ri;
|
|
4783
4783
|
if (ot)
|
|
4784
4784
|
switch (ot.length) {
|
|
4785
4785
|
case 1:
|
|
4786
|
-
|
|
4786
|
+
qs = ot[0], Pi = ot[0], ki = ot[0], Ri = ot[0];
|
|
4787
4787
|
break;
|
|
4788
4788
|
case 4:
|
|
4789
|
-
|
|
4789
|
+
qs = ot[0], Pi = ot[1], ki = ot[2], Ri = ot[3];
|
|
4790
4790
|
break;
|
|
4791
4791
|
}
|
|
4792
4792
|
if (Dt.kind === s.ImageKind.GRAYSCALE_1BPP) {
|
|
4793
|
-
const
|
|
4794
|
-
let
|
|
4795
|
-
for (
|
|
4793
|
+
const hl = sr.byteLength, Ha = new Uint32Array(un.buffer, 0, un.byteLength >> 2), Cl = Ha.length, Al = It + 7 >> 3;
|
|
4794
|
+
let bl = 4294967295, wl = s.FeatureTest.isLittleEndian ? 4278190080 : 255;
|
|
4795
|
+
for (Ri && Ri[0] === 255 && Ri[255] === 0 && ([bl, wl] = [wl, bl]), Gr = 0; Gr < me; Gr++) {
|
|
4796
4796
|
for (Un = Gr < Ar ? E : Br, zt = 0, nr = 0; nr < Un; nr++) {
|
|
4797
|
-
const xl =
|
|
4797
|
+
const xl = hl - Lt;
|
|
4798
4798
|
let Rl = 0;
|
|
4799
|
-
const Bl = xl >
|
|
4799
|
+
const Bl = xl > Al ? It : xl * 8 - 7, lg = Bl & -8;
|
|
4800
4800
|
let Ol = 0, Pl = 0;
|
|
4801
4801
|
for (; Rl < lg; Rl += 8)
|
|
4802
|
-
Pl = sr[Lt++], Ha[zt++] = Pl & 128 ?
|
|
4802
|
+
Pl = sr[Lt++], Ha[zt++] = Pl & 128 ? bl : wl, Ha[zt++] = Pl & 64 ? bl : wl, Ha[zt++] = Pl & 32 ? bl : wl, Ha[zt++] = Pl & 16 ? bl : wl, Ha[zt++] = Pl & 8 ? bl : wl, Ha[zt++] = Pl & 4 ? bl : wl, Ha[zt++] = Pl & 2 ? bl : wl, Ha[zt++] = Pl & 1 ? bl : wl;
|
|
4803
4803
|
for (; Rl < Bl; Rl++)
|
|
4804
|
-
Ol === 0 && (Pl = sr[Lt++], Ol = 128), Ha[zt++] = Pl & Ol ?
|
|
4804
|
+
Ol === 0 && (Pl = sr[Lt++], Ol = 128), Ha[zt++] = Pl & Ol ? bl : wl, Ol >>= 1;
|
|
4805
4805
|
}
|
|
4806
4806
|
for (; zt < Cl; )
|
|
4807
4807
|
Ha[zt++] = 0;
|
|
4808
4808
|
ln.putImageData(St, 0, Gr * E);
|
|
4809
4809
|
}
|
|
4810
4810
|
} else if (Dt.kind === s.ImageKind.RGBA_32BPP) {
|
|
4811
|
-
const
|
|
4812
|
-
for (nr = 0,
|
|
4813
|
-
if (un.set(sr.subarray(Lt, Lt +
|
|
4814
|
-
for (let Ha = 0; Ha <
|
|
4815
|
-
|
|
4811
|
+
const hl = !!(qs || Pi || ki);
|
|
4812
|
+
for (nr = 0, ji = It * E * 4, Gr = 0; Gr < Ar; Gr++) {
|
|
4813
|
+
if (un.set(sr.subarray(Lt, Lt + ji)), Lt += ji, hl)
|
|
4814
|
+
for (let Ha = 0; Ha < ji; Ha += 4)
|
|
4815
|
+
qs && (un[Ha + 0] = qs[un[Ha + 0]]), Pi && (un[Ha + 1] = Pi[un[Ha + 1]]), ki && (un[Ha + 2] = ki[un[Ha + 2]]);
|
|
4816
4816
|
ln.putImageData(St, 0, nr), nr += E;
|
|
4817
4817
|
}
|
|
4818
4818
|
if (Gr < me) {
|
|
4819
|
-
if (
|
|
4820
|
-
for (let Ha = 0; Ha <
|
|
4821
|
-
|
|
4819
|
+
if (ji = It * Br * 4, un.set(sr.subarray(Lt, Lt + ji)), hl)
|
|
4820
|
+
for (let Ha = 0; Ha < ji; Ha += 4)
|
|
4821
|
+
qs && (un[Ha + 0] = qs[un[Ha + 0]]), Pi && (un[Ha + 1] = Pi[un[Ha + 1]]), ki && (un[Ha + 2] = ki[un[Ha + 2]]);
|
|
4822
4822
|
ln.putImageData(St, 0, nr);
|
|
4823
4823
|
}
|
|
4824
4824
|
} else if (Dt.kind === s.ImageKind.RGB_24BPP) {
|
|
4825
|
-
const
|
|
4826
|
-
for (Un = E,
|
|
4827
|
-
for (Gr >= Ar && (Un = Br,
|
|
4825
|
+
const hl = !!(qs || Pi || ki);
|
|
4826
|
+
for (Un = E, ji = It * Un, Gr = 0; Gr < me; Gr++) {
|
|
4827
|
+
for (Gr >= Ar && (Un = Br, ji = It * Un), zt = 0, nr = ji; nr--; )
|
|
4828
4828
|
un[zt++] = sr[Lt++], un[zt++] = sr[Lt++], un[zt++] = sr[Lt++], un[zt++] = 255;
|
|
4829
|
-
if (
|
|
4829
|
+
if (hl)
|
|
4830
4830
|
for (let Ha = 0; Ha < zt; Ha += 4)
|
|
4831
|
-
|
|
4831
|
+
qs && (un[Ha + 0] = qs[un[Ha + 0]]), Pi && (un[Ha + 1] = Pi[un[Ha + 1]]), ki && (un[Ha + 2] = ki[un[Ha + 2]]);
|
|
4832
4832
|
ln.putImageData(St, 0, Gr * E);
|
|
4833
4833
|
}
|
|
4834
4834
|
} else
|
|
@@ -4896,10 +4896,10 @@ function requirePdf() {
|
|
|
4896
4896
|
const sr = !!Br, un = sr ? Br[0] : 0, Gr = sr ? Br[1] : 0, nr = sr ? Br[2] : 0;
|
|
4897
4897
|
let Un;
|
|
4898
4898
|
It === "Luminosity" ? Un = Fr : Un = kt;
|
|
4899
|
-
const
|
|
4900
|
-
for (let
|
|
4901
|
-
const
|
|
4902
|
-
sr && mt(
|
|
4899
|
+
const qs = Math.min(Ur, Math.ceil(1048576 / ot));
|
|
4900
|
+
for (let Pi = 0; Pi < Ur; Pi += qs) {
|
|
4901
|
+
const ki = Math.min(qs, Ur - Pi), Ri = ln.getImageData(me - Lt, Pi + (St - zt), ot, ki), hl = Dt.getImageData(me, Pi + St, ot, ki);
|
|
4902
|
+
sr && mt(Ri.data, un, Gr, nr), Un(Ri.data, hl.data, Ar), Dt.putImageData(hl, me, Pi + St);
|
|
4903
4903
|
}
|
|
4904
4904
|
}
|
|
4905
4905
|
function Is(ln, Dt, ot, Ur) {
|
|
@@ -4914,7 +4914,7 @@ function requirePdf() {
|
|
|
4914
4914
|
}
|
|
4915
4915
|
const Yn = ["butt", "round", "square"], Zn = ["miter", "round", "bevel"], Xn = {}, Kn = {}, dl = class dl {
|
|
4916
4916
|
constructor(Dt, ot, Ur, It, Br, Ar, me, St) {
|
|
4917
|
-
|
|
4917
|
+
ml(this, Ti);
|
|
4918
4918
|
this.ctx = Dt, this.current = new nt(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = ot, this.objs = Ur, this.canvasFactory = It, this.imageLayer = Br, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = [], this.optionalContentConfig = Ar, this.cachedCanvases = new a(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = me, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.backgroundColor = (St == null ? void 0 : St.background) || null, this.foregroundColor = (St == null ? void 0 : St.foreground) || null, this._cachedScaleForStroking = null, this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
|
|
4919
4919
|
}
|
|
4920
4920
|
getObject(Dt, ot = null) {
|
|
@@ -4936,10 +4936,10 @@ function requirePdf() {
|
|
|
4936
4936
|
if (this.ctx.fillStyle = me, sr = this.ctx.fillStyle, zt = typeof sr == "string" && /^#[0-9A-Fa-f]{6}$/.test(sr), St === "#000000" && Lt === "#ffffff" || St === Lt || !zt)
|
|
4937
4937
|
this.foregroundColor = this.backgroundColor = null;
|
|
4938
4938
|
else {
|
|
4939
|
-
const [un, Gr, nr] = (0, n.getRGB)(sr), Un = (
|
|
4940
|
-
this.selectColor = (
|
|
4941
|
-
const
|
|
4942
|
-
return Math.round(
|
|
4939
|
+
const [un, Gr, nr] = (0, n.getRGB)(sr), Un = (qs) => (qs /= 255, qs <= 0.03928 ? qs / 12.92 : ((qs + 0.055) / 1.055) ** 2.4), ji = Math.round(0.2126 * Un(un) + 0.7152 * Un(Gr) + 0.0722 * Un(nr));
|
|
4940
|
+
this.selectColor = (qs, Pi, ki) => {
|
|
4941
|
+
const Ri = 0.2126 * Un(qs) + 0.7152 * Un(Pi) + 0.0722 * Un(ki);
|
|
4942
|
+
return Math.round(Ri) === ji ? Lt : St;
|
|
4943
4943
|
};
|
|
4944
4944
|
}
|
|
4945
4945
|
}
|
|
@@ -4966,9 +4966,9 @@ function requirePdf() {
|
|
|
4966
4966
|
this[nr].apply(this, Br[me]);
|
|
4967
4967
|
else
|
|
4968
4968
|
for (const Un of Br[me]) {
|
|
4969
|
-
const
|
|
4970
|
-
if (!
|
|
4971
|
-
return
|
|
4969
|
+
const ji = Un.startsWith("g_") ? un : Gr;
|
|
4970
|
+
if (!ji.has(Un))
|
|
4971
|
+
return ji.get(Un, Ur), me;
|
|
4972
4972
|
}
|
|
4973
4973
|
if (me++, me === St)
|
|
4974
4974
|
return me;
|
|
@@ -5008,29 +5008,29 @@ function requirePdf() {
|
|
|
5008
5008
|
} = Dt, Br = this.current.fillColor, Ar = this.current.patternFill, me = (0, n.getCurrentTransform)(ot);
|
|
5009
5009
|
let St, Lt, zt, sr;
|
|
5010
5010
|
if ((Dt.bitmap || Dt.data) && Dt.count > 1) {
|
|
5011
|
-
const Cl = Dt.bitmap || Dt.data.buffer,
|
|
5012
|
-
Lt = JSON.stringify(Ar ?
|
|
5013
|
-
const
|
|
5014
|
-
if (
|
|
5011
|
+
const Cl = Dt.bitmap || Dt.data.buffer, Al = me.slice(0, 4);
|
|
5012
|
+
Lt = JSON.stringify(Ar ? Al : [Al, Br]), St = this._cachedBitmapsMap.get(Cl), St || (St = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(Cl, St));
|
|
5013
|
+
const bl = St.get(Lt);
|
|
5014
|
+
if (bl && !Ar) {
|
|
5015
5015
|
const wl = Math.round(Math.min(me[0], me[2]) + me[4]), xl = Math.round(Math.min(me[1], me[3]) + me[5]);
|
|
5016
5016
|
return {
|
|
5017
|
-
canvas:
|
|
5017
|
+
canvas: bl,
|
|
5018
5018
|
offsetX: wl,
|
|
5019
5019
|
offsetY: xl
|
|
5020
5020
|
};
|
|
5021
5021
|
}
|
|
5022
|
-
zt =
|
|
5022
|
+
zt = bl;
|
|
5023
5023
|
}
|
|
5024
5024
|
zt || (sr = this.cachedCanvases.getCanvas("maskCanvas", Ur, It), N(sr.context, Dt));
|
|
5025
5025
|
let un = s.Util.transform(me, [1 / Ur, 0, 0, -1 / It, 0, 0]);
|
|
5026
5026
|
un = s.Util.transform(un, [1, 0, 0, 1, 0, -It]);
|
|
5027
|
-
const Gr = s.Util.applyTransform([0, 0], un), nr = s.Util.applyTransform([Ur, It], un), Un = s.Util.normalizeRect([Gr[0], Gr[1], nr[0], nr[1]]),
|
|
5028
|
-
|
|
5029
|
-
const Ha = s.Util.transform((0, n.getCurrentTransformInverse)(
|
|
5030
|
-
return
|
|
5031
|
-
canvas:
|
|
5032
|
-
offsetX: Math.round(
|
|
5033
|
-
offsetY: Math.round(
|
|
5027
|
+
const Gr = s.Util.applyTransform([0, 0], un), nr = s.Util.applyTransform([Ur, It], un), Un = s.Util.normalizeRect([Gr[0], Gr[1], nr[0], nr[1]]), ji = Math.round(Un[2] - Un[0]) || 1, qs = Math.round(Un[3] - Un[1]) || 1, Pi = this.cachedCanvases.getCanvas("fillCanvas", ji, qs), ki = Pi.context, Ri = Math.min(Gr[0], nr[0]), hl = Math.min(Gr[1], nr[1]);
|
|
5028
|
+
ki.translate(-Ri, -hl), ki.transform(...un), zt || (zt = this._scaleImage(sr.canvas, (0, n.getCurrentTransformInverse)(ki)), zt = zt.img, St && Ar && St.set(Lt, zt)), ki.imageSmoothingEnabled = Si((0, n.getCurrentTransform)(ki), Dt.interpolate), pe(ki, zt, 0, 0, zt.width, zt.height, 0, 0, Ur, It), ki.globalCompositeOperation = "source-in";
|
|
5029
|
+
const Ha = s.Util.transform((0, n.getCurrentTransformInverse)(ki), [1, 0, 0, 1, -Ri, -hl]);
|
|
5030
|
+
return ki.fillStyle = Ar ? Br.getPattern(ot, this, Ha, i.PathType.FILL) : Br, ki.fillRect(0, 0, Ur, It), St && !Ar && (this.cachedCanvases.delete("fillCanvas"), St.set(Lt, Pi.canvas)), {
|
|
5031
|
+
canvas: Pi.canvas,
|
|
5032
|
+
offsetX: Math.round(Ri),
|
|
5033
|
+
offsetY: Math.round(hl)
|
|
5034
5034
|
};
|
|
5035
5035
|
}
|
|
5036
5036
|
setLineWidth(Dt) {
|
|
@@ -5144,8 +5144,8 @@ function requirePdf() {
|
|
|
5144
5144
|
switch (Dt[Gr] | 0) {
|
|
5145
5145
|
case s.OPS.rectangle:
|
|
5146
5146
|
Ar = ot[nr++], me = ot[nr++];
|
|
5147
|
-
const
|
|
5148
|
-
It.moveTo(Ar, me),
|
|
5147
|
+
const ji = ot[nr++], qs = ot[nr++], Pi = Ar + ji, ki = me + qs;
|
|
5148
|
+
It.moveTo(Ar, me), ji === 0 || qs === 0 ? It.lineTo(Pi, ki) : (It.lineTo(Pi, me), It.lineTo(Pi, ki), It.lineTo(Ar, ki)), sr || Br.updateRectMinMax(zt, [Ar, me, Pi, ki]), It.closePath();
|
|
5149
5149
|
break;
|
|
5150
5150
|
case s.OPS.moveTo:
|
|
5151
5151
|
Ar = ot[nr++], me = ot[nr++], It.moveTo(Ar, me), sr || Br.updatePathMinMax(zt, Ar, me);
|
|
@@ -5300,72 +5300,72 @@ function requirePdf() {
|
|
|
5300
5300
|
const It = ot.fontSize;
|
|
5301
5301
|
if (It === 0)
|
|
5302
5302
|
return;
|
|
5303
|
-
const Br = this.ctx, Ar = ot.fontSizeScale, me = ot.charSpacing, St = ot.wordSpacing, Lt = ot.fontDirection, zt = ot.textHScale * Lt, sr = Dt.length, un = Ur.vertical, Gr = un ? 1 : -1, nr = Ur.defaultVMetrics, Un = It * ot.fontMatrix[0],
|
|
5303
|
+
const Br = this.ctx, Ar = ot.fontSizeScale, me = ot.charSpacing, St = ot.wordSpacing, Lt = ot.fontDirection, zt = ot.textHScale * Lt, sr = Dt.length, un = Ur.vertical, Gr = un ? 1 : -1, nr = Ur.defaultVMetrics, Un = It * ot.fontMatrix[0], ji = ot.textRenderingMode === s.TextRenderingMode.FILL && !Ur.disableFontFace && !ot.patternFill;
|
|
5304
5304
|
Br.save(), Br.transform(...ot.textMatrix), Br.translate(ot.x, ot.y + ot.textRise), Lt > 0 ? Br.scale(zt, -1) : Br.scale(zt, 1);
|
|
5305
|
-
let
|
|
5305
|
+
let qs;
|
|
5306
5306
|
if (ot.patternFill) {
|
|
5307
5307
|
Br.save();
|
|
5308
5308
|
const Ha = ot.fillColor.getPattern(Br, this, (0, n.getCurrentTransformInverse)(Br), i.PathType.FILL);
|
|
5309
|
-
|
|
5309
|
+
qs = (0, n.getCurrentTransform)(Br), Br.restore(), Br.fillStyle = Ha;
|
|
5310
5310
|
}
|
|
5311
|
-
let
|
|
5312
|
-
const
|
|
5313
|
-
if (
|
|
5311
|
+
let Pi = ot.lineWidth;
|
|
5312
|
+
const ki = ot.textMatrixScale;
|
|
5313
|
+
if (ki === 0 || Pi === 0) {
|
|
5314
5314
|
const Ha = ot.textRenderingMode & s.TextRenderingMode.FILL_STROKE_MASK;
|
|
5315
|
-
(Ha === s.TextRenderingMode.STROKE || Ha === s.TextRenderingMode.FILL_STROKE) && (
|
|
5315
|
+
(Ha === s.TextRenderingMode.STROKE || Ha === s.TextRenderingMode.FILL_STROKE) && (Pi = this.getSinglePixelWidth());
|
|
5316
5316
|
} else
|
|
5317
|
-
|
|
5318
|
-
Ar !== 1 && (Br.scale(Ar, Ar),
|
|
5319
|
-
let
|
|
5320
|
-
for (
|
|
5321
|
-
const Ha = Dt[
|
|
5317
|
+
Pi /= ki;
|
|
5318
|
+
Ar !== 1 && (Br.scale(Ar, Ar), Pi /= Ar), Br.lineWidth = Pi;
|
|
5319
|
+
let Ri = 0, hl;
|
|
5320
|
+
for (hl = 0; hl < sr; ++hl) {
|
|
5321
|
+
const Ha = Dt[hl];
|
|
5322
5322
|
if (typeof Ha == "number") {
|
|
5323
|
-
|
|
5323
|
+
Ri += Gr * Ha * It / 1e3;
|
|
5324
5324
|
continue;
|
|
5325
5325
|
}
|
|
5326
5326
|
let Cl = !1;
|
|
5327
|
-
const
|
|
5327
|
+
const Al = (Ha.isSpace ? St : 0) + me, bl = Ha.fontChar, wl = Ha.accent;
|
|
5328
5328
|
let xl, Rl, Bl = Ha.width;
|
|
5329
5329
|
if (un) {
|
|
5330
5330
|
const Ol = Ha.vmetric || nr, Pl = -(Ha.vmetric ? Ol[1] : Bl * 0.5) * Un, tm = Ol[2] * Un;
|
|
5331
|
-
Bl = Ol ? -Ol[0] : Bl, xl = Pl / Ar, Rl = (
|
|
5331
|
+
Bl = Ol ? -Ol[0] : Bl, xl = Pl / Ar, Rl = (Ri + tm) / Ar;
|
|
5332
5332
|
} else
|
|
5333
|
-
xl =
|
|
5333
|
+
xl = Ri / Ar, Rl = 0;
|
|
5334
5334
|
if (Ur.remeasure && Bl > 0) {
|
|
5335
|
-
const Ol = Br.measureText(
|
|
5335
|
+
const Ol = Br.measureText(bl).width * 1e3 / It * Ar;
|
|
5336
5336
|
if (Bl < Ol && this.isFontSubpixelAAEnabled) {
|
|
5337
5337
|
const Pl = Bl / Ol;
|
|
5338
5338
|
Cl = !0, Br.save(), Br.scale(Pl, 1), xl /= Pl;
|
|
5339
5339
|
} else Bl !== Ol && (xl += (Bl - Ol) / 2e3 * It / Ar);
|
|
5340
5340
|
}
|
|
5341
5341
|
if (this.contentVisible && (Ha.isInFont || Ur.missingFile)) {
|
|
5342
|
-
if (
|
|
5343
|
-
Br.fillText(
|
|
5344
|
-
else if (this.paintChar(
|
|
5342
|
+
if (ji && !wl)
|
|
5343
|
+
Br.fillText(bl, xl, Rl);
|
|
5344
|
+
else if (this.paintChar(bl, xl, Rl, qs), wl) {
|
|
5345
5345
|
const Ol = xl + It * wl.offset.x / Ar, Pl = Rl - It * wl.offset.y / Ar;
|
|
5346
|
-
this.paintChar(wl.fontChar, Ol, Pl,
|
|
5346
|
+
this.paintChar(wl.fontChar, Ol, Pl, qs);
|
|
5347
5347
|
}
|
|
5348
5348
|
}
|
|
5349
5349
|
let lg;
|
|
5350
|
-
un ? lg = Bl * Un -
|
|
5350
|
+
un ? lg = Bl * Un - Al * Lt : lg = Bl * Un + Al * Lt, Ri += lg, Cl && Br.restore();
|
|
5351
5351
|
}
|
|
5352
|
-
un ? ot.y -=
|
|
5352
|
+
un ? ot.y -= Ri : ot.x += Ri * zt, Br.restore(), this.compose();
|
|
5353
5353
|
}
|
|
5354
5354
|
showType3Text(Dt) {
|
|
5355
5355
|
const ot = this.ctx, Ur = this.current, It = Ur.font, Br = Ur.fontSize, Ar = Ur.fontDirection, me = It.vertical ? 1 : -1, St = Ur.charSpacing, Lt = Ur.wordSpacing, zt = Ur.textHScale * Ar, sr = Ur.fontMatrix || s.FONT_IDENTITY_MATRIX, un = Dt.length, Gr = Ur.textRenderingMode === s.TextRenderingMode.INVISIBLE;
|
|
5356
|
-
let nr, Un,
|
|
5356
|
+
let nr, Un, ji, qs;
|
|
5357
5357
|
if (!(Gr || Br === 0)) {
|
|
5358
5358
|
for (this._cachedScaleForStroking = null, this._cachedGetSinglePixelWidth = null, ot.save(), ot.transform(...Ur.textMatrix), ot.translate(Ur.x, Ur.y), ot.scale(zt, Ar), nr = 0; nr < un; ++nr) {
|
|
5359
5359
|
if (Un = Dt[nr], typeof Un == "number") {
|
|
5360
|
-
|
|
5360
|
+
qs = me * Un * Br / 1e3, this.ctx.translate(qs, 0), Ur.x += qs * zt;
|
|
5361
5361
|
continue;
|
|
5362
5362
|
}
|
|
5363
|
-
const
|
|
5364
|
-
if (!
|
|
5363
|
+
const Pi = (Un.isSpace ? Lt : 0) + St, ki = It.charProcOperatorList[Un.operatorListId];
|
|
5364
|
+
if (!ki) {
|
|
5365
5365
|
(0, s.warn)(`Type3 character "${Un.operatorListId}" is not available.`);
|
|
5366
5366
|
continue;
|
|
5367
5367
|
}
|
|
5368
|
-
this.contentVisible && (this.processingType3 = Un, this.save(), ot.scale(Br, Br), ot.transform(...sr), this.executeOperatorList(
|
|
5368
|
+
this.contentVisible && (this.processingType3 = Un, this.save(), ot.scale(Br, Br), ot.transform(...sr), this.executeOperatorList(ki), this.restore()), ji = s.Util.applyTransform([Un.width, 0], sr)[0] * Br + Pi, ot.translate(ji, 0), Ur.x += ji * zt;
|
|
5369
5369
|
}
|
|
5370
5370
|
ot.restore(), this.processingType3 = null;
|
|
5371
5371
|
}
|
|
@@ -5790,22 +5790,22 @@ function requirePdf() {
|
|
|
5790
5790
|
const Yn = (kt[nt] + st.offsetX) * st.scaleX, Zn = (kt[nt + 1] + st.offsetY) * st.scaleY, Xn = (kt[tt] + st.offsetX) * st.scaleX, Kn = (kt[tt + 1] + st.offsetY) * st.scaleY, As = (kt[N] + st.offsetX) * st.scaleX, Ti = (kt[N + 1] + st.offsetY) * st.scaleY;
|
|
5791
5791
|
if (Zn >= Ti)
|
|
5792
5792
|
return;
|
|
5793
|
-
const
|
|
5794
|
-
let Lt, zt, sr, un, Gr, nr, Un,
|
|
5795
|
-
for (let
|
|
5796
|
-
if (
|
|
5793
|
+
const Oi = Fr[P], dl = Fr[P + 1], ln = Fr[P + 2], Dt = Fr[p], ot = Fr[p + 1], Ur = Fr[p + 2], It = Fr[mt], Br = Fr[mt + 1], Ar = Fr[mt + 2], me = Math.round(Zn), St = Math.round(Ti);
|
|
5794
|
+
let Lt, zt, sr, un, Gr, nr, Un, ji;
|
|
5795
|
+
for (let qs = me; qs <= St; qs++) {
|
|
5796
|
+
if (qs < Kn) {
|
|
5797
5797
|
let Ha;
|
|
5798
|
-
|
|
5798
|
+
qs < Zn ? Ha = 0 : Ha = (Zn - qs) / (Zn - Kn), Lt = Yn - (Yn - Xn) * Ha, zt = Oi - (Oi - Dt) * Ha, sr = dl - (dl - ot) * Ha, un = ln - (ln - Ur) * Ha;
|
|
5799
5799
|
} else {
|
|
5800
5800
|
let Ha;
|
|
5801
|
-
|
|
5801
|
+
qs > Ti ? Ha = 1 : Kn === Ti ? Ha = 0 : Ha = (Kn - qs) / (Kn - Ti), Lt = Xn - (Xn - As) * Ha, zt = Dt - (Dt - It) * Ha, sr = ot - (ot - Br) * Ha, un = Ur - (Ur - Ar) * Ha;
|
|
5802
5802
|
}
|
|
5803
|
-
let
|
|
5804
|
-
|
|
5805
|
-
const
|
|
5806
|
-
let
|
|
5807
|
-
for (let Ha =
|
|
5808
|
-
|
|
5803
|
+
let Pi;
|
|
5804
|
+
qs < Zn ? Pi = 0 : qs > Ti ? Pi = 1 : Pi = (Zn - qs) / (Zn - Ti), Gr = Yn - (Yn - As) * Pi, nr = Oi - (Oi - It) * Pi, Un = dl - (dl - Br) * Pi, ji = ln - (ln - Ar) * Pi;
|
|
5805
|
+
const ki = Math.round(Math.min(Lt, Gr)), Ri = Math.round(Math.max(Lt, Gr));
|
|
5806
|
+
let hl = Is * qs + ki * 4;
|
|
5807
|
+
for (let Ha = ki; Ha <= Ri; Ha++)
|
|
5808
|
+
Pi = (Lt - Ha) / (Lt - Gr), Pi < 0 ? Pi = 0 : Pi > 1 && (Pi = 1), ur[hl++] = zt - (zt - nr) * Pi | 0, ur[hl++] = sr - (sr - Un) * Pi | 0, ur[hl++] = un - (un - ji) * Pi | 0, ur[hl++] = 255;
|
|
5809
5809
|
}
|
|
5810
5810
|
}
|
|
5811
5811
|
function Ye(pe, st, nt) {
|
|
@@ -5840,7 +5840,7 @@ function requirePdf() {
|
|
|
5840
5840
|
offsetY: -kt,
|
|
5841
5841
|
scaleX: 1 / Yn,
|
|
5842
5842
|
scaleY: 1 / Zn
|
|
5843
|
-
}, Kn = Is + 4, As = Si + 4, Ti = tt.getCanvas("mesh", Kn, As, !1),
|
|
5843
|
+
}, Kn = Is + 4, As = Si + 4, Ti = tt.getCanvas("mesh", Kn, As, !1), Oi = Ti.context, dl = Oi.createImageData(Is, Si);
|
|
5844
5844
|
if (nt) {
|
|
5845
5845
|
const Dt = dl.data;
|
|
5846
5846
|
for (let ot = 0, Ur = Dt.length; ot < Ur; ot += 4)
|
|
@@ -5848,7 +5848,7 @@ function requirePdf() {
|
|
|
5848
5848
|
}
|
|
5849
5849
|
for (const Dt of this._figures)
|
|
5850
5850
|
Ye(dl, Dt, Xn);
|
|
5851
|
-
return
|
|
5851
|
+
return Oi.putImageData(dl, 2, 2), {
|
|
5852
5852
|
canvas: Ti.canvas,
|
|
5853
5853
|
offsetX: mt - 2 * Yn,
|
|
5854
5854
|
offsetY: kt - 2 * Zn,
|
|
@@ -5899,11 +5899,11 @@ function requirePdf() {
|
|
|
5899
5899
|
createPatternCanvas(st) {
|
|
5900
5900
|
const nt = this.operatorList, tt = this.bbox, N = this.xstep, P = this.ystep, p = this.paintType, mt = this.tilingType, kt = this.color, Fr = this.canvasGraphicsFactory;
|
|
5901
5901
|
(0, n.info)("TilingType: " + mt);
|
|
5902
|
-
const ur = tt[0], Is = tt[1], Si = tt[2], Yn = tt[3], Zn = n.Util.singularValueDecompose2dScale(this.matrix), Xn = n.Util.singularValueDecompose2dScale(this.baseTransform), Kn = [Zn[0] * Xn[0], Zn[1] * Xn[1]], As = this.getSizeAndScale(N, this.ctx.canvas.width, Kn[0]), Ti = this.getSizeAndScale(P, this.ctx.canvas.height, Kn[1]),
|
|
5902
|
+
const ur = tt[0], Is = tt[1], Si = tt[2], Yn = tt[3], Zn = n.Util.singularValueDecompose2dScale(this.matrix), Xn = n.Util.singularValueDecompose2dScale(this.baseTransform), Kn = [Zn[0] * Xn[0], Zn[1] * Xn[1]], As = this.getSizeAndScale(N, this.ctx.canvas.width, Kn[0]), Ti = this.getSizeAndScale(P, this.ctx.canvas.height, Kn[1]), Oi = st.cachedCanvases.getCanvas("pattern", As.size, Ti.size, !0), dl = Oi.context, ln = Fr.createCanvasGraphics(dl);
|
|
5903
5903
|
ln.groupLevel = st.groupLevel, this.setFillAndStrokeStyleToContext(ln, p, kt);
|
|
5904
5904
|
let Dt = ur, ot = Is, Ur = Si, It = Yn;
|
|
5905
5905
|
return ur < 0 && (Dt = 0, Ur += Math.abs(ur)), Is < 0 && (ot = 0, It += Math.abs(Is)), dl.translate(-(As.scale * Dt), -(Ti.scale * ot)), ln.transform(As.scale, 0, 0, Ti.scale, 0, 0), dl.save(), this.clipBbox(ln, Dt, ot, Ur, It), ln.baseTransform = (0, s.getCurrentTransform)(ln.ctx), ln.executeOperatorList(nt), ln.endDrawing(), {
|
|
5906
|
-
canvas:
|
|
5906
|
+
canvas: Oi.canvas,
|
|
5907
5907
|
scaleX: As.scale,
|
|
5908
5908
|
scaleY: Ti.scale,
|
|
5909
5909
|
offsetX: Dt,
|
|
@@ -6326,9 +6326,9 @@ function requirePdf() {
|
|
|
6326
6326
|
parsedData: h,
|
|
6327
6327
|
rawData: l
|
|
6328
6328
|
}) {
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6329
|
+
ml(this, i);
|
|
6330
|
+
ml(this, o);
|
|
6331
|
+
vl(this, i, h), vl(this, o, l);
|
|
6332
6332
|
}
|
|
6333
6333
|
getRaw() {
|
|
6334
6334
|
return Gn(this, o);
|
|
@@ -6356,26 +6356,26 @@ function requirePdf() {
|
|
|
6356
6356
|
const s = Symbol("INTERNAL");
|
|
6357
6357
|
class i {
|
|
6358
6358
|
constructor(u, a) {
|
|
6359
|
-
|
|
6359
|
+
ml(this, c, !0);
|
|
6360
6360
|
this.name = u, this.intent = a;
|
|
6361
6361
|
}
|
|
6362
6362
|
get visible() {
|
|
6363
6363
|
return Gn(this, c);
|
|
6364
6364
|
}
|
|
6365
6365
|
_setVisible(u, a) {
|
|
6366
|
-
u !== s && (0, n.unreachable)("Internal method `_setVisible` called."),
|
|
6366
|
+
u !== s && (0, n.unreachable)("Internal method `_setVisible` called."), vl(this, c, a);
|
|
6367
6367
|
}
|
|
6368
6368
|
}
|
|
6369
6369
|
c = new WeakMap();
|
|
6370
6370
|
class o {
|
|
6371
6371
|
constructor(u) {
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6372
|
+
ml(this, de);
|
|
6373
|
+
ml(this, h, !0);
|
|
6374
|
+
ml(this, l, /* @__PURE__ */ new Map());
|
|
6375
|
+
ml(this, b, null);
|
|
6376
|
+
ml(this, Ye, null);
|
|
6377
6377
|
if (this.name = null, this.creator = null, u !== null) {
|
|
6378
|
-
this.name = u.name, this.creator = u.creator,
|
|
6378
|
+
this.name = u.name, this.creator = u.creator, vl(this, Ye, u.order);
|
|
6379
6379
|
for (const a of u.groups)
|
|
6380
6380
|
Gn(this, l).set(a.id, new i(a.name, a.intent));
|
|
6381
6381
|
if (u.baseState === "OFF")
|
|
@@ -6385,7 +6385,7 @@ function requirePdf() {
|
|
|
6385
6385
|
Gn(this, l).get(a)._setVisible(s, !0);
|
|
6386
6386
|
for (const a of u.off)
|
|
6387
6387
|
Gn(this, l).get(a)._setVisible(s, !1);
|
|
6388
|
-
|
|
6388
|
+
vl(this, b, /* @__PURE__ */ new Map());
|
|
6389
6389
|
for (const [a, pe] of Gn(this, l))
|
|
6390
6390
|
Gn(this, b).set(a, pe.visible);
|
|
6391
6391
|
}
|
|
@@ -6442,7 +6442,7 @@ function requirePdf() {
|
|
|
6442
6442
|
(0, n.warn)(`Optional content group not found: ${u}`);
|
|
6443
6443
|
return;
|
|
6444
6444
|
}
|
|
6445
|
-
Gn(this, l).get(u)._setVisible(s, !!a),
|
|
6445
|
+
Gn(this, l).get(u)._setVisible(s, !!a), vl(this, h, null);
|
|
6446
6446
|
}
|
|
6447
6447
|
get hasInitialVisibility() {
|
|
6448
6448
|
if (Gn(this, h) !== null)
|
|
@@ -6450,9 +6450,9 @@ function requirePdf() {
|
|
|
6450
6450
|
for (const [u, a] of Gn(this, l)) {
|
|
6451
6451
|
const pe = Gn(this, b).get(u);
|
|
6452
6452
|
if (a.visible !== pe)
|
|
6453
|
-
return
|
|
6453
|
+
return vl(this, h, !1);
|
|
6454
6454
|
}
|
|
6455
|
-
return
|
|
6455
|
+
return vl(this, h, !0);
|
|
6456
6456
|
}
|
|
6457
6457
|
getOrder() {
|
|
6458
6458
|
return Gn(this, l).size ? Gn(this, Ye) ? Gn(this, Ye).slice() : [...Gn(this, l).keys()] : null;
|
|
@@ -6779,16 +6779,16 @@ function requirePdf() {
|
|
|
6779
6779
|
var n = r(7), s = r(1), i = r(23), o = r(24);
|
|
6780
6780
|
const N = class N {
|
|
6781
6781
|
constructor(p) {
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
N._initialized || (N._initialized = !0, i.FreeTextEditor.initialize(p.l10n), o.InkEditor.initialize(p.l10n), p.uiManager.registerEditorTypes([i.FreeTextEditor, o.InkEditor])),
|
|
6782
|
+
ml(this, a);
|
|
6783
|
+
ml(this, h);
|
|
6784
|
+
ml(this, l, !1);
|
|
6785
|
+
ml(this, b, this.pointerup.bind(this));
|
|
6786
|
+
ml(this, Ye, this.pointerdown.bind(this));
|
|
6787
|
+
ml(this, de, /* @__PURE__ */ new Map());
|
|
6788
|
+
ml(this, Le, !1);
|
|
6789
|
+
ml(this, E, !1);
|
|
6790
|
+
ml(this, u);
|
|
6791
|
+
N._initialized || (N._initialized = !0, i.FreeTextEditor.initialize(p.l10n), o.InkEditor.initialize(p.l10n), p.uiManager.registerEditorTypes([i.FreeTextEditor, o.InkEditor])), vl(this, u, p.uiManager), this.annotationStorage = p.annotationStorage, this.pageIndex = p.pageIndex, this.div = p.div, vl(this, h, p.accessibilityManager), Gn(this, u).addLayer(this);
|
|
6792
6792
|
}
|
|
6793
6793
|
updateToolbar(p) {
|
|
6794
6794
|
Gn(this, u).updateToolbar(p);
|
|
@@ -6916,8 +6916,8 @@ function requirePdf() {
|
|
|
6916
6916
|
pointerup(p) {
|
|
6917
6917
|
const mt = n.KeyboardManager.platform.isMac;
|
|
6918
6918
|
if (!(p.button !== 0 || p.ctrlKey && mt) && p.target === this.div && Gn(this, Le)) {
|
|
6919
|
-
if (
|
|
6920
|
-
|
|
6919
|
+
if (vl(this, Le, !1), !Gn(this, l)) {
|
|
6920
|
+
vl(this, l, !0);
|
|
6921
6921
|
return;
|
|
6922
6922
|
}
|
|
6923
6923
|
gl(this, a, Mm).call(this, p);
|
|
@@ -6927,9 +6927,9 @@ function requirePdf() {
|
|
|
6927
6927
|
const mt = n.KeyboardManager.platform.isMac;
|
|
6928
6928
|
if (p.button !== 0 || p.ctrlKey && mt || p.target !== this.div)
|
|
6929
6929
|
return;
|
|
6930
|
-
|
|
6930
|
+
vl(this, Le, !0);
|
|
6931
6931
|
const kt = Gn(this, u).getActive();
|
|
6932
|
-
|
|
6932
|
+
vl(this, l, !kt || kt.isEmpty());
|
|
6933
6933
|
}
|
|
6934
6934
|
drop(p) {
|
|
6935
6935
|
const mt = p.dataTransfer.getData("text/plain"), kt = Gn(this, u).getEditor(mt);
|
|
@@ -7002,10 +7002,10 @@ function requirePdf() {
|
|
|
7002
7002
|
});
|
|
7003
7003
|
return kt && this.add(kt), kt;
|
|
7004
7004
|
}, t0 = function() {
|
|
7005
|
-
|
|
7005
|
+
vl(this, E, !0);
|
|
7006
7006
|
for (const p of Gn(this, de).values())
|
|
7007
7007
|
p.isEmpty() && p.remove();
|
|
7008
|
-
|
|
7008
|
+
vl(this, E, !1);
|
|
7009
7009
|
}, Tg(N, "_initialized", !1);
|
|
7010
7010
|
let c = N;
|
|
7011
7011
|
t.AnnotationEditorLayer = c;
|
|
@@ -7024,15 +7024,15 @@ function requirePdf() {
|
|
|
7024
7024
|
...P,
|
|
7025
7025
|
name: "freeTextEditor"
|
|
7026
7026
|
});
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7027
|
+
ml(this, E);
|
|
7028
|
+
ml(this, c, this.editorDivBlur.bind(this));
|
|
7029
|
+
ml(this, h, this.editorDivFocus.bind(this));
|
|
7030
|
+
ml(this, l, this.editorDivKeydown.bind(this));
|
|
7031
|
+
ml(this, b);
|
|
7032
|
+
ml(this, Ye, "");
|
|
7033
|
+
ml(this, de, !1);
|
|
7034
|
+
ml(this, Le);
|
|
7035
|
+
vl(this, b, P.color || nt._defaultColor || i.AnnotationEditor._defaultLineColor), vl(this, Le, P.fontSize || nt._defaultFontSize);
|
|
7036
7036
|
}
|
|
7037
7037
|
static initialize(P) {
|
|
7038
7038
|
this._l10nPromise = new Map(["free_text_default_content", "editor_free_text_aria_label"].map((mt) => [mt, P.get(mt)]));
|
|
@@ -7090,7 +7090,7 @@ function requirePdf() {
|
|
|
7090
7090
|
this.isEditing = !1, this.parent.setEditingState(!0), super.remove();
|
|
7091
7091
|
}
|
|
7092
7092
|
commit() {
|
|
7093
|
-
super.commit(), Gn(this, de) || (
|
|
7093
|
+
super.commit(), Gn(this, de) || (vl(this, de, !0), this.parent.addUndoableEditor(this)), this.disableEditMode(), vl(this, Ye, gl(this, E, s0).call(this).trimEnd()), gl(this, E, Lm).call(this);
|
|
7094
7094
|
}
|
|
7095
7095
|
shouldGetKeyboardEvents() {
|
|
7096
7096
|
return this.isInEditMode();
|
|
@@ -7148,7 +7148,7 @@ function requirePdf() {
|
|
|
7148
7148
|
}
|
|
7149
7149
|
static deserialize(P, p) {
|
|
7150
7150
|
const mt = super.deserialize(P, p);
|
|
7151
|
-
return
|
|
7151
|
+
return vl(mt, Le, P.fontSize), vl(mt, b, n.Util.makeHexColor(...P.color)), vl(mt, Ye, P.value), mt;
|
|
7152
7152
|
}
|
|
7153
7153
|
serialize() {
|
|
7154
7154
|
if (this.isEmpty())
|
|
@@ -7167,7 +7167,7 @@ function requirePdf() {
|
|
|
7167
7167
|
};
|
|
7168
7168
|
c = new WeakMap(), h = new WeakMap(), l = new WeakMap(), b = new WeakMap(), Ye = new WeakMap(), de = new WeakMap(), Le = new WeakMap(), E = new WeakSet(), r0 = function(P) {
|
|
7169
7169
|
const p = (kt) => {
|
|
7170
|
-
this.editorDiv.style.fontSize = `calc(${kt}px * var(--scale-factor))`, this.translate(0, -(kt - Gn(this, Le)) * this.parent.scaleFactor),
|
|
7170
|
+
this.editorDiv.style.fontSize = `calc(${kt}px * var(--scale-factor))`, this.translate(0, -(kt - Gn(this, Le)) * this.parent.scaleFactor), vl(this, Le, kt), gl(this, E, Lm).call(this);
|
|
7171
7171
|
}, mt = Gn(this, Le);
|
|
7172
7172
|
this.parent.addCommands({
|
|
7173
7173
|
cmd: () => {
|
|
@@ -7185,10 +7185,10 @@ function requirePdf() {
|
|
|
7185
7185
|
const p = Gn(this, b);
|
|
7186
7186
|
this.parent.addCommands({
|
|
7187
7187
|
cmd: () => {
|
|
7188
|
-
|
|
7188
|
+
vl(this, b, P), this.editorDiv.style.color = P;
|
|
7189
7189
|
},
|
|
7190
7190
|
undo: () => {
|
|
7191
|
-
|
|
7191
|
+
vl(this, b, p), this.editorDiv.style.color = p;
|
|
7192
7192
|
},
|
|
7193
7193
|
mustExec: !0,
|
|
7194
7194
|
type: n.AnnotationEditorParamsType.FREETEXT_COLOR,
|
|
@@ -7232,21 +7232,21 @@ function requirePdf() {
|
|
|
7232
7232
|
...Gr,
|
|
7233
7233
|
name: "inkEditor"
|
|
7234
7234
|
});
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7235
|
+
ml(this, p);
|
|
7236
|
+
ml(this, l, 0);
|
|
7237
|
+
ml(this, b, 0);
|
|
7238
|
+
ml(this, Ye, 0);
|
|
7239
|
+
ml(this, de, this.canvasPointermove.bind(this));
|
|
7240
|
+
ml(this, Le, this.canvasPointerleave.bind(this));
|
|
7241
|
+
ml(this, E, this.canvasPointerup.bind(this));
|
|
7242
|
+
ml(this, u, this.canvasPointerdown.bind(this));
|
|
7243
|
+
ml(this, a, !1);
|
|
7244
|
+
ml(this, pe, !1);
|
|
7245
|
+
ml(this, st, null);
|
|
7246
|
+
ml(this, nt, null);
|
|
7247
|
+
ml(this, tt, 0);
|
|
7248
|
+
ml(this, N, 0);
|
|
7249
|
+
ml(this, P, null);
|
|
7250
7250
|
this.color = Gr.color || null, this.thickness = Gr.thickness || null, this.opacity = Gr.opacity || null, this.paths = [], this.bezierPath2D = [], this.currentPath = [], this.scaleFactor = 1, this.translationX = this.translationY = 0, this.x = 0, this.y = 0;
|
|
7251
7251
|
}
|
|
7252
7252
|
static initialize(Gr) {
|
|
@@ -7288,7 +7288,7 @@ function requirePdf() {
|
|
|
7288
7288
|
super.rebuild(), this.div !== null && (this.canvas || (gl(this, p, ym).call(this), gl(this, p, Am).call(this)), this.isAttachedToDOM || (this.parent.add(this), gl(this, p, cm).call(this)), gl(this, p, dm).call(this));
|
|
7289
7289
|
}
|
|
7290
7290
|
remove() {
|
|
7291
|
-
this.canvas !== null && (this.isEmpty() || this.commit(), this.canvas.width = this.canvas.height = 0, this.canvas.remove(), this.canvas = null, Gn(this, nt).disconnect(),
|
|
7291
|
+
this.canvas !== null && (this.isEmpty() || this.commit(), this.canvas.width = this.canvas.height = 0, this.canvas.remove(), this.canvas = null, Gn(this, nt).disconnect(), vl(this, nt, null), super.remove());
|
|
7292
7292
|
}
|
|
7293
7293
|
enableEditMode() {
|
|
7294
7294
|
Gn(this, a) || this.canvas === null || (super.enableEditMode(), this.div.draggable = !1, this.canvas.addEventListener("pointerdown", Gn(this, u)), this.canvas.addEventListener("pointerup", Gn(this, E)));
|
|
@@ -7303,7 +7303,7 @@ function requirePdf() {
|
|
|
7303
7303
|
return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0;
|
|
7304
7304
|
}
|
|
7305
7305
|
commit() {
|
|
7306
|
-
Gn(this, a) || (super.commit(), this.isEditing = !1, this.disableEditMode(), this.setInForeground(),
|
|
7306
|
+
Gn(this, a) || (super.commit(), this.isEditing = !1, this.disableEditMode(), this.setInForeground(), vl(this, a, !0), this.div.classList.add("disabled"), gl(this, p, dm).call(this, !0), this.parent.addInkEditorIfNeeded(!0), this.parent.moveEditorInDOM(this), this.div.focus());
|
|
7307
7307
|
}
|
|
7308
7308
|
focusin(Gr) {
|
|
7309
7309
|
super.focusin(Gr), this.enableEditMode();
|
|
@@ -7324,47 +7324,47 @@ function requirePdf() {
|
|
|
7324
7324
|
if (this.div)
|
|
7325
7325
|
return this.div;
|
|
7326
7326
|
let Gr, nr;
|
|
7327
|
-
this.width && (Gr = this.x, nr = this.y), super.render(), zt._l10nPromise.get("editor_ink_aria_label").then((
|
|
7328
|
-
var
|
|
7329
|
-
return (
|
|
7327
|
+
this.width && (Gr = this.x, nr = this.y), super.render(), zt._l10nPromise.get("editor_ink_aria_label").then((ki) => {
|
|
7328
|
+
var Ri;
|
|
7329
|
+
return (Ri = this.div) == null ? void 0 : Ri.setAttribute("aria-label", ki);
|
|
7330
7330
|
});
|
|
7331
|
-
const [Un,
|
|
7332
|
-
if (this.setAt(Un,
|
|
7333
|
-
const [
|
|
7334
|
-
this.setAt(Gr *
|
|
7331
|
+
const [Un, ji, qs, Pi] = gl(this, p, u0).call(this);
|
|
7332
|
+
if (this.setAt(Un, ji, 0, 0), this.setDims(qs, Pi), gl(this, p, ym).call(this), this.width) {
|
|
7333
|
+
const [ki, Ri] = this.parent.viewportBaseDimensions;
|
|
7334
|
+
this.setAt(Gr * ki, nr * Ri, this.width * ki, this.height * Ri), vl(this, pe, !0), gl(this, p, cm).call(this), this.setDims(this.width * ki, this.height * Ri), gl(this, p, rm).call(this), gl(this, p, zm).call(this), this.div.classList.add("disabled");
|
|
7335
7335
|
} else
|
|
7336
7336
|
this.div.classList.add("editing"), this.enableEditMode();
|
|
7337
7337
|
return gl(this, p, Am).call(this), this.div;
|
|
7338
7338
|
}
|
|
7339
7339
|
setDimensions(Gr, nr) {
|
|
7340
|
-
const Un = Math.round(Gr),
|
|
7341
|
-
if (Gn(this, tt) === Un && Gn(this, N) ===
|
|
7340
|
+
const Un = Math.round(Gr), ji = Math.round(nr);
|
|
7341
|
+
if (Gn(this, tt) === Un && Gn(this, N) === ji)
|
|
7342
7342
|
return;
|
|
7343
|
-
|
|
7344
|
-
const [
|
|
7345
|
-
this.width = Gr /
|
|
7343
|
+
vl(this, tt, Un), vl(this, N, ji), this.canvas.style.visibility = "hidden", Gn(this, l) && Math.abs(Gn(this, l) - Gr / nr) > 0.01 && (nr = Math.ceil(Gr / Gn(this, l)), this.setDims(Gr, nr));
|
|
7344
|
+
const [qs, Pi] = this.parent.viewportBaseDimensions;
|
|
7345
|
+
this.width = Gr / qs, this.height = nr / Pi, Gn(this, a) && gl(this, p, jm).call(this, Gr, nr), gl(this, p, cm).call(this), gl(this, p, rm).call(this), this.canvas.style.visibility = "visible";
|
|
7346
7346
|
}
|
|
7347
7347
|
static deserialize(Gr, nr) {
|
|
7348
|
-
var Cl,
|
|
7348
|
+
var Cl, Al;
|
|
7349
7349
|
const Un = super.deserialize(Gr, nr);
|
|
7350
7350
|
Un.thickness = Gr.thickness, Un.color = n.Util.makeHexColor(...Gr.color), Un.opacity = Gr.opacity;
|
|
7351
|
-
const [
|
|
7352
|
-
|
|
7351
|
+
const [ji, qs] = nr.pageDimensions, Pi = Un.width * ji, ki = Un.height * qs, Ri = nr.scaleFactor, hl = Gr.thickness / 2;
|
|
7352
|
+
vl(Un, l, Pi / ki), vl(Un, a, !0), vl(Un, tt, Math.round(Pi)), vl(Un, N, Math.round(ki));
|
|
7353
7353
|
for (const {
|
|
7354
|
-
bezier:
|
|
7354
|
+
bezier: bl
|
|
7355
7355
|
} of Gr.paths) {
|
|
7356
7356
|
const wl = [];
|
|
7357
7357
|
Un.paths.push(wl);
|
|
7358
|
-
let xl =
|
|
7359
|
-
for (let lg = 2, Ol =
|
|
7360
|
-
const Pl =
|
|
7361
|
-
wl.push([[xl, Rl], [Pl, tm], [nm, sm], [
|
|
7358
|
+
let xl = Ri * (bl[0] - hl), Rl = Ri * (ki - bl[1] - hl);
|
|
7359
|
+
for (let lg = 2, Ol = bl.length; lg < Ol; lg += 6) {
|
|
7360
|
+
const Pl = Ri * (bl[lg] - hl), tm = Ri * (ki - bl[lg + 1] - hl), nm = Ri * (bl[lg + 2] - hl), sm = Ri * (ki - bl[lg + 3] - hl), pl = Ri * (bl[lg + 4] - hl), Ni = Ri * (ki - bl[lg + 5] - hl);
|
|
7361
|
+
wl.push([[xl, Rl], [Pl, tm], [nm, sm], [pl, Ni]]), xl = pl, Rl = Ni;
|
|
7362
7362
|
}
|
|
7363
7363
|
const Bl = gl(this, Dt, $m).call(this, wl);
|
|
7364
7364
|
Un.bezierPath2D.push(Bl);
|
|
7365
7365
|
}
|
|
7366
7366
|
const Ha = gl(Cl = Un, p, Um).call(Cl);
|
|
7367
|
-
return
|
|
7367
|
+
return vl(Un, Ye, Math.max(c, Ha[2] - Ha[0])), vl(Un, b, Math.max(c, Ha[3] - Ha[1])), gl(Al = Un, p, jm).call(Al, Pi, ki), Un;
|
|
7368
7368
|
}
|
|
7369
7369
|
serialize() {
|
|
7370
7370
|
if (this.isEmpty())
|
|
@@ -7444,34 +7444,34 @@ function requirePdf() {
|
|
|
7444
7444
|
}, Im = function() {
|
|
7445
7445
|
this.ctx.lineWidth = this.thickness * this.parent.scaleFactor / this.scaleFactor, this.ctx.lineCap = "round", this.ctx.lineJoin = "round", this.ctx.miterLimit = 10, this.ctx.strokeStyle = `${this.color}${(0, o.opacityToHex)(this.opacity)}`;
|
|
7446
7446
|
}, l0 = function(Gr, nr) {
|
|
7447
|
-
this.isEditing = !0, Gn(this, pe) || (
|
|
7448
|
-
Gn(this, P) && (Gn(this, st) && (this.isEmpty() ? (this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)) : gl(this, p, rm).call(this), this.ctx.lineTo(...Gn(this, st)),
|
|
7447
|
+
this.isEditing = !0, Gn(this, pe) || (vl(this, pe, !0), gl(this, p, cm).call(this), this.thickness || (this.thickness = zt._defaultThickness), this.color || (this.color = zt._defaultColor || s.AnnotationEditor._defaultLineColor), this.opacity ?? (this.opacity = zt._defaultOpacity)), this.currentPath.push([Gr, nr]), vl(this, st, null), gl(this, p, Im).call(this), this.ctx.beginPath(), this.ctx.moveTo(Gr, nr), vl(this, P, () => {
|
|
7448
|
+
Gn(this, P) && (Gn(this, st) && (this.isEmpty() ? (this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)) : gl(this, p, rm).call(this), this.ctx.lineTo(...Gn(this, st)), vl(this, st, null), this.ctx.stroke()), window.requestAnimationFrame(Gn(this, P)));
|
|
7449
7449
|
}), window.requestAnimationFrame(Gn(this, P));
|
|
7450
7450
|
}, c0 = function(Gr, nr) {
|
|
7451
|
-
const [Un,
|
|
7452
|
-
Gr === Un && nr ===
|
|
7451
|
+
const [Un, ji] = this.currentPath.at(-1);
|
|
7452
|
+
Gr === Un && nr === ji || (this.currentPath.push([Gr, nr]), vl(this, st, [Gr, nr]));
|
|
7453
7453
|
}, d0 = function(Gr, nr) {
|
|
7454
|
-
var
|
|
7455
|
-
this.ctx.closePath(),
|
|
7456
|
-
const [Un,
|
|
7457
|
-
(Gr !== Un || nr !==
|
|
7458
|
-
let
|
|
7454
|
+
var hl;
|
|
7455
|
+
this.ctx.closePath(), vl(this, P, null), Gr = Math.min(Math.max(Gr, 0), this.canvas.width), nr = Math.min(Math.max(nr, 0), this.canvas.height);
|
|
7456
|
+
const [Un, ji] = this.currentPath.at(-1);
|
|
7457
|
+
(Gr !== Un || nr !== ji) && this.currentPath.push([Gr, nr]);
|
|
7458
|
+
let qs;
|
|
7459
7459
|
if (this.currentPath.length !== 1)
|
|
7460
|
-
|
|
7460
|
+
qs = (0, i.fitCurve)(this.currentPath, 30, null);
|
|
7461
7461
|
else {
|
|
7462
7462
|
const Ha = [Gr, nr];
|
|
7463
|
-
|
|
7463
|
+
qs = [[Ha, Ha.slice(), Ha.slice(), Ha]];
|
|
7464
7464
|
}
|
|
7465
|
-
const
|
|
7465
|
+
const Pi = gl(hl = zt, Dt, $m).call(hl, qs);
|
|
7466
7466
|
this.currentPath.length = 0;
|
|
7467
|
-
const
|
|
7468
|
-
this.paths.push(
|
|
7469
|
-
},
|
|
7467
|
+
const ki = () => {
|
|
7468
|
+
this.paths.push(qs), this.bezierPath2D.push(Pi), this.rebuild();
|
|
7469
|
+
}, Ri = () => {
|
|
7470
7470
|
this.paths.pop(), this.bezierPath2D.pop(), this.paths.length === 0 ? this.remove() : (this.canvas || (gl(this, p, ym).call(this), gl(this, p, Am).call(this)), gl(this, p, dm).call(this));
|
|
7471
7471
|
};
|
|
7472
7472
|
this.parent.addCommands({
|
|
7473
|
-
cmd:
|
|
7474
|
-
undo:
|
|
7473
|
+
cmd: ki,
|
|
7474
|
+
undo: Ri,
|
|
7475
7475
|
mustExec: !0
|
|
7476
7476
|
});
|
|
7477
7477
|
}, rm = function() {
|
|
@@ -7495,7 +7495,7 @@ function requirePdf() {
|
|
|
7495
7495
|
return (nr = this.canvas) == null ? void 0 : nr.setAttribute("aria-label", Gr);
|
|
7496
7496
|
}), this.div.append(this.canvas), this.ctx = this.canvas.getContext("2d");
|
|
7497
7497
|
}, Am = function() {
|
|
7498
|
-
|
|
7498
|
+
vl(this, nt, new ResizeObserver((Gr) => {
|
|
7499
7499
|
const nr = Gr[0].contentRect;
|
|
7500
7500
|
nr.width && nr.height && this.setDimensions(nr.width, nr.height);
|
|
7501
7501
|
})), Gn(this, nt).observe(this.div);
|
|
@@ -7505,56 +7505,56 @@ function requirePdf() {
|
|
|
7505
7505
|
const [Gr, nr] = this.parent.viewportBaseDimensions;
|
|
7506
7506
|
this.canvas.width = Math.ceil(this.width * Gr), this.canvas.height = Math.ceil(this.height * nr), gl(this, p, Em).call(this);
|
|
7507
7507
|
}, jm = function(Gr, nr) {
|
|
7508
|
-
const Un = gl(this, p, Dm).call(this),
|
|
7509
|
-
this.scaleFactor = Math.min(
|
|
7508
|
+
const Un = gl(this, p, Dm).call(this), ji = (Gr - Un) / Gn(this, Ye), qs = (nr - Un) / Gn(this, b);
|
|
7509
|
+
this.scaleFactor = Math.min(ji, qs);
|
|
7510
7510
|
}, Em = function() {
|
|
7511
7511
|
const Gr = gl(this, p, Dm).call(this) / 2;
|
|
7512
7512
|
this.ctx.setTransform(this.scaleFactor, 0, 0, this.scaleFactor, this.translationX * this.scaleFactor + Gr, this.translationY * this.scaleFactor + Gr);
|
|
7513
7513
|
}, Dt = new WeakSet(), $m = function(Gr) {
|
|
7514
7514
|
const nr = new Path2D();
|
|
7515
|
-
for (let Un = 0,
|
|
7516
|
-
const [
|
|
7517
|
-
Un === 0 && nr.moveTo(...
|
|
7515
|
+
for (let Un = 0, ji = Gr.length; Un < ji; Un++) {
|
|
7516
|
+
const [qs, Pi, ki, Ri] = Gr[Un];
|
|
7517
|
+
Un === 0 && nr.moveTo(...qs), nr.bezierCurveTo(Pi[0], Pi[1], ki[0], ki[1], Ri[0], Ri[1]);
|
|
7518
7518
|
}
|
|
7519
7519
|
return nr;
|
|
7520
|
-
}, h0 = function(Gr, nr, Un,
|
|
7521
|
-
const
|
|
7522
|
-
let
|
|
7520
|
+
}, h0 = function(Gr, nr, Un, ji) {
|
|
7521
|
+
const Pi = [], ki = this.thickness / 2;
|
|
7522
|
+
let Ri, hl;
|
|
7523
7523
|
for (const Ha of this.paths) {
|
|
7524
|
-
|
|
7525
|
-
for (let Cl = 0,
|
|
7526
|
-
const [
|
|
7527
|
-
Cl === 0 && (
|
|
7524
|
+
Ri = [], hl = [];
|
|
7525
|
+
for (let Cl = 0, Al = Ha.length; Cl < Al; Cl++) {
|
|
7526
|
+
const [bl, wl, xl, Rl] = Ha[Cl], Bl = Gr * (bl[0] + nr) + ki, lg = ji - Gr * (bl[1] + Un) - ki, Ol = Gr * (wl[0] + nr) + ki, Pl = ji - Gr * (wl[1] + Un) - ki, tm = Gr * (xl[0] + nr) + ki, nm = ji - Gr * (xl[1] + Un) - ki, sm = Gr * (Rl[0] + nr) + ki, pl = ji - Gr * (Rl[1] + Un) - ki;
|
|
7527
|
+
Cl === 0 && (Ri.push(Bl, lg), hl.push(Bl, lg)), Ri.push(Ol, Pl, tm, nm, sm, pl), gl(this, p, f0).call(this, Bl, lg, Ol, Pl, tm, nm, sm, pl, 4, hl);
|
|
7528
7528
|
}
|
|
7529
|
-
|
|
7530
|
-
bezier:
|
|
7531
|
-
points:
|
|
7529
|
+
Pi.push({
|
|
7530
|
+
bezier: Ri,
|
|
7531
|
+
points: hl
|
|
7532
7532
|
});
|
|
7533
7533
|
}
|
|
7534
|
-
return
|
|
7535
|
-
}, f0 = function(Gr, nr, Un,
|
|
7536
|
-
if (gl(this, p, p0).call(this, Gr, nr, Un,
|
|
7537
|
-
Ha.push(
|
|
7534
|
+
return Pi;
|
|
7535
|
+
}, f0 = function(Gr, nr, Un, ji, qs, Pi, ki, Ri, hl, Ha) {
|
|
7536
|
+
if (gl(this, p, p0).call(this, Gr, nr, Un, ji, qs, Pi, ki, Ri)) {
|
|
7537
|
+
Ha.push(ki, Ri);
|
|
7538
7538
|
return;
|
|
7539
7539
|
}
|
|
7540
|
-
for (let Cl = 1; Cl <
|
|
7541
|
-
const
|
|
7542
|
-
let wl =
|
|
7543
|
-
const lg =
|
|
7544
|
-
wl =
|
|
7540
|
+
for (let Cl = 1; Cl < hl - 1; Cl++) {
|
|
7541
|
+
const Al = Cl / hl, bl = 1 - Al;
|
|
7542
|
+
let wl = Al * Gr + bl * Un, xl = Al * nr + bl * ji, Rl = Al * Un + bl * qs, Bl = Al * ji + bl * Pi;
|
|
7543
|
+
const lg = Al * qs + bl * ki, Ol = Al * Pi + bl * Ri;
|
|
7544
|
+
wl = Al * wl + bl * Rl, xl = Al * xl + bl * Bl, Rl = Al * Rl + bl * lg, Bl = Al * Bl + bl * Ol, wl = Al * wl + bl * Rl, xl = Al * xl + bl * Bl, Ha.push(wl, xl);
|
|
7545
7545
|
}
|
|
7546
|
-
Ha.push(
|
|
7547
|
-
}, p0 = function(Gr, nr, Un,
|
|
7548
|
-
const Ha = (3 * Un - 2 * Gr -
|
|
7549
|
-
return Math.max(Ha,
|
|
7546
|
+
Ha.push(ki, Ri);
|
|
7547
|
+
}, p0 = function(Gr, nr, Un, ji, qs, Pi, ki, Ri) {
|
|
7548
|
+
const Ha = (3 * Un - 2 * Gr - ki) ** 2, Cl = (3 * ji - 2 * nr - Ri) ** 2, Al = (3 * qs - Gr - 2 * ki) ** 2, bl = (3 * Pi - nr - 2 * Ri) ** 2;
|
|
7549
|
+
return Math.max(Ha, Al) + Math.max(Cl, bl) <= 10;
|
|
7550
7550
|
}, Um = function() {
|
|
7551
|
-
let Gr = 1 / 0, nr = -1 / 0, Un = 1 / 0,
|
|
7552
|
-
for (const
|
|
7553
|
-
for (const [
|
|
7554
|
-
const Ha = n.Util.bezierBoundingBox(...
|
|
7555
|
-
Gr = Math.min(Gr, Ha[0]), Un = Math.min(Un, Ha[1]), nr = Math.max(nr, Ha[2]),
|
|
7551
|
+
let Gr = 1 / 0, nr = -1 / 0, Un = 1 / 0, ji = -1 / 0;
|
|
7552
|
+
for (const qs of this.paths)
|
|
7553
|
+
for (const [Pi, ki, Ri, hl] of qs) {
|
|
7554
|
+
const Ha = n.Util.bezierBoundingBox(...Pi, ...ki, ...Ri, ...hl);
|
|
7555
|
+
Gr = Math.min(Gr, Ha[0]), Un = Math.min(Un, Ha[1]), nr = Math.max(nr, Ha[2]), ji = Math.max(ji, Ha[3]);
|
|
7556
7556
|
}
|
|
7557
|
-
return [Gr, Un, nr,
|
|
7557
|
+
return [Gr, Un, nr, ji];
|
|
7558
7558
|
}, Dm = function() {
|
|
7559
7559
|
return Gn(this, a) ? Math.ceil(this.thickness * this.parent.scaleFactor) : 0;
|
|
7560
7560
|
}, dm = function(Gr = !1) {
|
|
@@ -7565,19 +7565,19 @@ function requirePdf() {
|
|
|
7565
7565
|
return;
|
|
7566
7566
|
}
|
|
7567
7567
|
const nr = gl(this, p, Um).call(this), Un = gl(this, p, Dm).call(this);
|
|
7568
|
-
|
|
7569
|
-
const
|
|
7570
|
-
this.width =
|
|
7571
|
-
const
|
|
7572
|
-
this.translationX = -nr[0], this.translationY = -nr[1], gl(this, p, cm).call(this), gl(this, p, rm).call(this),
|
|
7568
|
+
vl(this, Ye, Math.max(c, nr[2] - nr[0])), vl(this, b, Math.max(c, nr[3] - nr[1]));
|
|
7569
|
+
const ji = Math.ceil(Un + Gn(this, Ye) * this.scaleFactor), qs = Math.ceil(Un + Gn(this, b) * this.scaleFactor), [Pi, ki] = this.parent.viewportBaseDimensions;
|
|
7570
|
+
this.width = ji / Pi, this.height = qs / ki, vl(this, l, ji / qs), gl(this, p, zm).call(this);
|
|
7571
|
+
const Ri = this.translationX, hl = this.translationY;
|
|
7572
|
+
this.translationX = -nr[0], this.translationY = -nr[1], gl(this, p, cm).call(this), gl(this, p, rm).call(this), vl(this, tt, ji), vl(this, N, qs), this.setDims(ji, qs);
|
|
7573
7573
|
const Ha = Gr ? Un / this.scaleFactor / 2 : 0;
|
|
7574
|
-
this.translate(
|
|
7574
|
+
this.translate(Ri - this.translationX - Ha, hl - this.translationY - Ha);
|
|
7575
7575
|
}, zm = function() {
|
|
7576
7576
|
const {
|
|
7577
7577
|
style: Gr
|
|
7578
7578
|
} = this.div;
|
|
7579
7579
|
Gn(this, l) >= 1 ? (Gr.minHeight = `${c}px`, Gr.minWidth = `${Math.round(Gn(this, l) * c)}px`) : (Gr.minWidth = `${c}px`, Gr.minHeight = `${Math.round(c / Gn(this, l))}px`);
|
|
7580
|
-
},
|
|
7580
|
+
}, ml(zt, Dt), Tg(zt, "_defaultColor", null), Tg(zt, "_defaultOpacity", 1), Tg(zt, "_defaultThickness", 1), Tg(zt, "_l10nPromise"), Tg(zt, "_type", "ink");
|
|
7581
7581
|
let h = zt;
|
|
7582
7582
|
t.InkEditor = h;
|
|
7583
7583
|
},
|
|
@@ -7634,12 +7634,12 @@ function requirePdf() {
|
|
|
7634
7634
|
}), [tt, N, P];
|
|
7635
7635
|
}
|
|
7636
7636
|
function s(E, u, a, pe) {
|
|
7637
|
-
var st, nt, tt, N, P, p, mt, kt, Fr, ur, Is, Si, Yn, Zn, Xn, Kn, As, Ti = E[0],
|
|
7638
|
-
for (st = [Ti, null, null,
|
|
7637
|
+
var st, nt, tt, N, P, p, mt, kt, Fr, ur, Is, Si, Yn, Zn, Xn, Kn, As, Ti = E[0], Oi = E[E.length - 1];
|
|
7638
|
+
for (st = [Ti, null, null, Oi], nt = de.zeros_Xx2x2(u.length), Yn = 0, Zn = u.length; Yn < Zn; Yn++)
|
|
7639
7639
|
Kn = u[Yn], As = 1 - Kn, tt = nt[Yn], tt[0] = de.mulItems(a, 3 * Kn * (As * As)), tt[1] = de.mulItems(pe, 3 * As * (Kn * Kn));
|
|
7640
7640
|
for (N = [[0, 0], [0, 0]], P = [0, 0], Yn = 0, Zn = E.length; Yn < Zn; Yn++)
|
|
7641
|
-
Kn = u[Yn], tt = nt[Yn], N[0][0] += de.dot(tt[0], tt[0]), N[0][1] += de.dot(tt[0], tt[1]), N[1][0] += de.dot(tt[0], tt[1]), N[1][1] += de.dot(tt[1], tt[1]), Xn = de.subtract(E[Yn], Le.q([Ti, Ti,
|
|
7642
|
-
return p = N[0][0] * N[1][1] - N[1][0] * N[0][1], mt = N[0][0] * P[1] - N[1][0] * P[0], kt = P[0] * N[1][1] - P[1] * N[0][1], Fr = p === 0 ? 0 : kt / p, ur = p === 0 ? 0 : mt / p, Si = de.vectorLen(de.subtract(Ti,
|
|
7641
|
+
Kn = u[Yn], tt = nt[Yn], N[0][0] += de.dot(tt[0], tt[0]), N[0][1] += de.dot(tt[0], tt[1]), N[1][0] += de.dot(tt[0], tt[1]), N[1][1] += de.dot(tt[1], tt[1]), Xn = de.subtract(E[Yn], Le.q([Ti, Ti, Oi, Oi], Kn)), P[0] += de.dot(tt[0], Xn), P[1] += de.dot(tt[1], Xn);
|
|
7642
|
+
return p = N[0][0] * N[1][1] - N[1][0] * N[0][1], mt = N[0][0] * P[1] - N[1][0] * P[0], kt = P[0] * N[1][1] - P[1] * N[0][1], Fr = p === 0 ? 0 : kt / p, ur = p === 0 ? 0 : mt / p, Si = de.vectorLen(de.subtract(Ti, Oi)), Is = 1e-6 * Si, Fr < Is || ur < Is ? (st[1] = de.addArrays(Ti, de.mulItems(a, Si / 3)), st[2] = de.addArrays(Oi, de.mulItems(pe, Si / 3))) : (st[1] = de.addArrays(Ti, de.mulItems(a, Fr)), st[2] = de.addArrays(Oi, de.mulItems(pe, ur))), st;
|
|
7643
7643
|
}
|
|
7644
7644
|
function i(E, u, a) {
|
|
7645
7645
|
return a.map((pe, st) => o(E, u[st], pe));
|
|
@@ -7796,7 +7796,7 @@ function requirePdf() {
|
|
|
7796
7796
|
case n.AnnotationType.STRIKEOUT:
|
|
7797
7797
|
return new Ti(me);
|
|
7798
7798
|
case n.AnnotationType.STAMP:
|
|
7799
|
-
return new
|
|
7799
|
+
return new Oi(me);
|
|
7800
7800
|
case n.AnnotationType.FILEATTACHMENT:
|
|
7801
7801
|
return new dl(me);
|
|
7802
7802
|
default:
|
|
@@ -7816,18 +7816,18 @@ function requirePdf() {
|
|
|
7816
7816
|
const St = this.data, Lt = this.page, zt = this.viewport, sr = document.createElement("section"), {
|
|
7817
7817
|
width: un,
|
|
7818
7818
|
height: Gr
|
|
7819
|
-
} = Ye(St.rect), [nr, Un,
|
|
7819
|
+
} = Ye(St.rect), [nr, Un, ji, qs] = zt.viewBox, Pi = ji - nr, ki = qs - Un;
|
|
7820
7820
|
sr.setAttribute("data-annotation-id", St.id);
|
|
7821
|
-
const
|
|
7821
|
+
const Ri = n.Util.normalizeRect([St.rect[0], Lt.view[3] - St.rect[1] + Lt.view[1], St.rect[2], Lt.view[3] - St.rect[3] + Lt.view[1]]);
|
|
7822
7822
|
if (!me && St.borderStyle.width > 0) {
|
|
7823
7823
|
sr.style.borderWidth = `${St.borderStyle.width}px`;
|
|
7824
7824
|
const Ha = St.borderStyle.horizontalCornerRadius, Cl = St.borderStyle.verticalCornerRadius;
|
|
7825
7825
|
if (Ha > 0 || Cl > 0) {
|
|
7826
|
-
const
|
|
7827
|
-
sr.style.borderRadius =
|
|
7826
|
+
const bl = `calc(${Ha}px * var(--scale-factor)) / calc(${Cl}px * var(--scale-factor))`;
|
|
7827
|
+
sr.style.borderRadius = bl;
|
|
7828
7828
|
} else if (this instanceof nt) {
|
|
7829
|
-
const
|
|
7830
|
-
sr.style.borderRadius =
|
|
7829
|
+
const bl = `calc(${un}px * var(--scale-factor)) / calc(${Gr}px * var(--scale-factor))`;
|
|
7830
|
+
sr.style.borderRadius = bl;
|
|
7831
7831
|
}
|
|
7832
7832
|
switch (St.borderStyle.style) {
|
|
7833
7833
|
case n.AnnotationBorderStyleType.SOLID:
|
|
@@ -7846,22 +7846,22 @@ function requirePdf() {
|
|
|
7846
7846
|
sr.style.borderBottomStyle = "solid";
|
|
7847
7847
|
break;
|
|
7848
7848
|
}
|
|
7849
|
-
const
|
|
7850
|
-
|
|
7849
|
+
const Al = St.borderColor || null;
|
|
7850
|
+
Al ? sr.style.borderColor = n.Util.makeHexColor(Al[0] | 0, Al[1] | 0, Al[2] | 0) : sr.style.borderWidth = 0;
|
|
7851
7851
|
}
|
|
7852
|
-
sr.style.left = `${100 * (
|
|
7852
|
+
sr.style.left = `${100 * (Ri[0] - nr) / Pi}%`, sr.style.top = `${100 * (Ri[1] - Un) / ki}%`;
|
|
7853
7853
|
const {
|
|
7854
|
-
rotation:
|
|
7854
|
+
rotation: hl
|
|
7855
7855
|
} = St;
|
|
7856
|
-
return St.hasOwnCanvas ||
|
|
7856
|
+
return St.hasOwnCanvas || hl === 0 ? (sr.style.width = `${100 * un / Pi}%`, sr.style.height = `${100 * Gr / ki}%`) : this.setRotation(hl, sr), sr;
|
|
7857
7857
|
}
|
|
7858
7858
|
setRotation(me, St = this.container) {
|
|
7859
7859
|
const [Lt, zt, sr, un] = this.viewport.viewBox, Gr = sr - Lt, nr = un - zt, {
|
|
7860
7860
|
width: Un,
|
|
7861
|
-
height:
|
|
7861
|
+
height: ji
|
|
7862
7862
|
} = Ye(this.data.rect);
|
|
7863
|
-
let
|
|
7864
|
-
me % 180 === 0 ? (
|
|
7863
|
+
let qs, Pi;
|
|
7864
|
+
me % 180 === 0 ? (qs = 100 * Un / Gr, Pi = 100 * ji / nr) : (qs = 100 * ji / Gr, Pi = 100 * Un / nr), St.style.width = `${qs}%`, St.style.height = `${Pi}%`, St.setAttribute("data-main-rotation", (360 - me) % 360);
|
|
7865
7865
|
}
|
|
7866
7866
|
get _commonActions() {
|
|
7867
7867
|
const me = (St, Lt, zt) => {
|
|
@@ -8081,7 +8081,7 @@ function requirePdf() {
|
|
|
8081
8081
|
return;
|
|
8082
8082
|
}
|
|
8083
8083
|
me.onclick = () => {
|
|
8084
|
-
var
|
|
8084
|
+
var ji;
|
|
8085
8085
|
Lt && Lt();
|
|
8086
8086
|
const {
|
|
8087
8087
|
fields: zt,
|
|
@@ -8089,62 +8089,62 @@ function requirePdf() {
|
|
|
8089
8089
|
include: un
|
|
8090
8090
|
} = St, Gr = [];
|
|
8091
8091
|
if (zt.length !== 0 || sr.length !== 0) {
|
|
8092
|
-
const
|
|
8093
|
-
for (const
|
|
8094
|
-
const
|
|
8092
|
+
const qs = new Set(sr);
|
|
8093
|
+
for (const Pi of zt) {
|
|
8094
|
+
const ki = this._fieldObjects[Pi] || [];
|
|
8095
8095
|
for (const {
|
|
8096
|
-
id:
|
|
8097
|
-
} of
|
|
8098
|
-
|
|
8096
|
+
id: Ri
|
|
8097
|
+
} of ki)
|
|
8098
|
+
qs.add(Ri);
|
|
8099
8099
|
}
|
|
8100
|
-
for (const
|
|
8101
|
-
for (const
|
|
8102
|
-
|
|
8100
|
+
for (const Pi of Object.values(this._fieldObjects))
|
|
8101
|
+
for (const ki of Pi)
|
|
8102
|
+
qs.has(ki.id) === un && Gr.push(ki);
|
|
8103
8103
|
} else
|
|
8104
|
-
for (const
|
|
8105
|
-
Gr.push(...
|
|
8104
|
+
for (const qs of Object.values(this._fieldObjects))
|
|
8105
|
+
Gr.push(...qs);
|
|
8106
8106
|
const nr = this.annotationStorage, Un = [];
|
|
8107
|
-
for (const
|
|
8107
|
+
for (const qs of Gr) {
|
|
8108
8108
|
const {
|
|
8109
|
-
id:
|
|
8110
|
-
} =
|
|
8111
|
-
switch (Un.push(
|
|
8109
|
+
id: Pi
|
|
8110
|
+
} = qs;
|
|
8111
|
+
switch (Un.push(Pi), qs.type) {
|
|
8112
8112
|
case "text": {
|
|
8113
|
-
const
|
|
8114
|
-
nr.setValue(
|
|
8115
|
-
value:
|
|
8113
|
+
const Ri = qs.defaultValue || "";
|
|
8114
|
+
nr.setValue(Pi, {
|
|
8115
|
+
value: Ri
|
|
8116
8116
|
});
|
|
8117
8117
|
break;
|
|
8118
8118
|
}
|
|
8119
8119
|
case "checkbox":
|
|
8120
8120
|
case "radiobutton": {
|
|
8121
|
-
const
|
|
8122
|
-
nr.setValue(
|
|
8123
|
-
value:
|
|
8121
|
+
const Ri = qs.defaultValue === qs.exportValues;
|
|
8122
|
+
nr.setValue(Pi, {
|
|
8123
|
+
value: Ri
|
|
8124
8124
|
});
|
|
8125
8125
|
break;
|
|
8126
8126
|
}
|
|
8127
8127
|
case "combobox":
|
|
8128
8128
|
case "listbox": {
|
|
8129
|
-
const
|
|
8130
|
-
nr.setValue(
|
|
8131
|
-
value:
|
|
8129
|
+
const Ri = qs.defaultValue || "";
|
|
8130
|
+
nr.setValue(Pi, {
|
|
8131
|
+
value: Ri
|
|
8132
8132
|
});
|
|
8133
8133
|
break;
|
|
8134
8134
|
}
|
|
8135
8135
|
default:
|
|
8136
8136
|
continue;
|
|
8137
8137
|
}
|
|
8138
|
-
const
|
|
8139
|
-
if (
|
|
8140
|
-
if (!b.has(
|
|
8141
|
-
(0, n.warn)(`_bindResetFormAction - element not allowed: ${
|
|
8138
|
+
const ki = document.querySelector(`[data-element-id="${Pi}"]`);
|
|
8139
|
+
if (ki) {
|
|
8140
|
+
if (!b.has(ki)) {
|
|
8141
|
+
(0, n.warn)(`_bindResetFormAction - element not allowed: ${Pi}`);
|
|
8142
8142
|
continue;
|
|
8143
8143
|
}
|
|
8144
8144
|
} else continue;
|
|
8145
|
-
|
|
8145
|
+
ki.dispatchEvent(new Event("resetform"));
|
|
8146
8146
|
}
|
|
8147
|
-
return this.enableScripting && ((
|
|
8147
|
+
return this.enableScripting && ((ji = this.linkService.eventBus) == null || ji.dispatch("dispatcheventinsandbox", {
|
|
8148
8148
|
source: this,
|
|
8149
8149
|
detail: {
|
|
8150
8150
|
id: "app",
|
|
@@ -8267,55 +8267,55 @@ function requirePdf() {
|
|
|
8267
8267
|
formattedValue: null,
|
|
8268
8268
|
valueOnFocus: ""
|
|
8269
8269
|
};
|
|
8270
|
-
this.data.multiLine ? (Lt = document.createElement("textarea"), Lt.textContent = un, this.data.doNotScroll && (Lt.style.overflowY = "hidden")) : (Lt = document.createElement("input"), Lt.type = "text", Lt.setAttribute("value", un), this.data.doNotScroll && (Lt.style.overflowX = "hidden")), b.add(Lt), Lt.setAttribute("data-element-id", St), Lt.disabled = this.data.readOnly, Lt.name = this.data.fieldName, Lt.tabIndex = h, this._setRequired(Lt, this.data.required), Gr && (Lt.maxLength = Gr), Lt.addEventListener("input", (
|
|
8270
|
+
this.data.multiLine ? (Lt = document.createElement("textarea"), Lt.textContent = un, this.data.doNotScroll && (Lt.style.overflowY = "hidden")) : (Lt = document.createElement("input"), Lt.type = "text", Lt.setAttribute("value", un), this.data.doNotScroll && (Lt.style.overflowX = "hidden")), b.add(Lt), Lt.setAttribute("data-element-id", St), Lt.disabled = this.data.readOnly, Lt.name = this.data.fieldName, Lt.tabIndex = h, this._setRequired(Lt, this.data.required), Gr && (Lt.maxLength = Gr), Lt.addEventListener("input", (ji) => {
|
|
8271
8271
|
me.setValue(St, {
|
|
8272
|
-
value:
|
|
8273
|
-
}), this.setPropertyOnSiblings(Lt, "value",
|
|
8274
|
-
}), Lt.addEventListener("resetform", (
|
|
8275
|
-
const
|
|
8276
|
-
Lt.value = nr.userValue =
|
|
8272
|
+
value: ji.target.value
|
|
8273
|
+
}), this.setPropertyOnSiblings(Lt, "value", ji.target.value, "value");
|
|
8274
|
+
}), Lt.addEventListener("resetform", (ji) => {
|
|
8275
|
+
const qs = this.data.defaultFieldValue ?? "";
|
|
8276
|
+
Lt.value = nr.userValue = qs, nr.formattedValue = null;
|
|
8277
8277
|
});
|
|
8278
|
-
let Un = (
|
|
8278
|
+
let Un = (ji) => {
|
|
8279
8279
|
const {
|
|
8280
|
-
formattedValue:
|
|
8280
|
+
formattedValue: qs
|
|
8281
8281
|
} = nr;
|
|
8282
|
-
|
|
8282
|
+
qs != null && (ji.target.value = qs), ji.target.scrollLeft = 0;
|
|
8283
8283
|
};
|
|
8284
8284
|
if (this.enableScripting && this.hasJSActions) {
|
|
8285
|
-
Lt.addEventListener("focus", (
|
|
8286
|
-
nr.userValue && (
|
|
8287
|
-
}), Lt.addEventListener("updatefromsandbox", (
|
|
8288
|
-
const
|
|
8289
|
-
value(
|
|
8290
|
-
nr.userValue =
|
|
8285
|
+
Lt.addEventListener("focus", (qs) => {
|
|
8286
|
+
nr.userValue && (qs.target.value = nr.userValue), nr.valueOnFocus = qs.target.value;
|
|
8287
|
+
}), Lt.addEventListener("updatefromsandbox", (qs) => {
|
|
8288
|
+
const Pi = {
|
|
8289
|
+
value(ki) {
|
|
8290
|
+
nr.userValue = ki.detail.value ?? "", me.setValue(St, {
|
|
8291
8291
|
value: nr.userValue.toString()
|
|
8292
|
-
}),
|
|
8292
|
+
}), ki.target.value = nr.userValue;
|
|
8293
8293
|
},
|
|
8294
|
-
formattedValue(
|
|
8294
|
+
formattedValue(ki) {
|
|
8295
8295
|
const {
|
|
8296
|
-
formattedValue:
|
|
8297
|
-
} =
|
|
8298
|
-
nr.formattedValue =
|
|
8299
|
-
formattedValue:
|
|
8296
|
+
formattedValue: Ri
|
|
8297
|
+
} = ki.detail;
|
|
8298
|
+
nr.formattedValue = Ri, Ri != null && ki.target !== document.activeElement && (ki.target.value = Ri), me.setValue(St, {
|
|
8299
|
+
formattedValue: Ri
|
|
8300
8300
|
});
|
|
8301
8301
|
},
|
|
8302
|
-
selRange(
|
|
8303
|
-
|
|
8302
|
+
selRange(ki) {
|
|
8303
|
+
ki.target.setSelectionRange(...ki.detail.selRange);
|
|
8304
8304
|
},
|
|
8305
|
-
charLimit: (
|
|
8305
|
+
charLimit: (ki) => {
|
|
8306
8306
|
var Cl;
|
|
8307
8307
|
const {
|
|
8308
|
-
charLimit:
|
|
8309
|
-
} =
|
|
8310
|
-
target:
|
|
8311
|
-
} =
|
|
8312
|
-
if (
|
|
8313
|
-
|
|
8308
|
+
charLimit: Ri
|
|
8309
|
+
} = ki.detail, {
|
|
8310
|
+
target: hl
|
|
8311
|
+
} = ki;
|
|
8312
|
+
if (Ri === 0) {
|
|
8313
|
+
hl.removeAttribute("maxLength");
|
|
8314
8314
|
return;
|
|
8315
8315
|
}
|
|
8316
|
-
|
|
8316
|
+
hl.setAttribute("maxLength", Ri);
|
|
8317
8317
|
let Ha = nr.userValue;
|
|
8318
|
-
!Ha || Ha.length <=
|
|
8318
|
+
!Ha || Ha.length <= Ri || (Ha = Ha.slice(0, Ri), hl.value = nr.userValue = Ha, me.setValue(St, {
|
|
8319
8319
|
value: Ha
|
|
8320
8320
|
}), (Cl = this.linkService.eventBus) == null || Cl.dispatch("dispatcheventinsandbox", {
|
|
8321
8321
|
source: this,
|
|
@@ -8325,98 +8325,98 @@ function requirePdf() {
|
|
|
8325
8325
|
value: Ha,
|
|
8326
8326
|
willCommit: !0,
|
|
8327
8327
|
commitKey: 1,
|
|
8328
|
-
selStart:
|
|
8329
|
-
selEnd:
|
|
8328
|
+
selStart: hl.selectionStart,
|
|
8329
|
+
selEnd: hl.selectionEnd
|
|
8330
8330
|
}
|
|
8331
8331
|
}));
|
|
8332
8332
|
}
|
|
8333
8333
|
};
|
|
8334
|
-
this._dispatchEventFromSandbox(
|
|
8335
|
-
}), Lt.addEventListener("keydown", (
|
|
8336
|
-
var
|
|
8337
|
-
let
|
|
8338
|
-
if (
|
|
8334
|
+
this._dispatchEventFromSandbox(Pi, qs);
|
|
8335
|
+
}), Lt.addEventListener("keydown", (qs) => {
|
|
8336
|
+
var Ri;
|
|
8337
|
+
let Pi = -1;
|
|
8338
|
+
if (qs.key === "Escape" ? Pi = 0 : qs.key === "Enter" ? Pi = 2 : qs.key === "Tab" && (Pi = 3), Pi === -1)
|
|
8339
8339
|
return;
|
|
8340
8340
|
const {
|
|
8341
|
-
value:
|
|
8342
|
-
} =
|
|
8343
|
-
nr.valueOnFocus !==
|
|
8341
|
+
value: ki
|
|
8342
|
+
} = qs.target;
|
|
8343
|
+
nr.valueOnFocus !== ki && (nr.userValue = ki, (Ri = this.linkService.eventBus) == null || Ri.dispatch("dispatcheventinsandbox", {
|
|
8344
8344
|
source: this,
|
|
8345
8345
|
detail: {
|
|
8346
8346
|
id: St,
|
|
8347
8347
|
name: "Keystroke",
|
|
8348
|
-
value:
|
|
8348
|
+
value: ki,
|
|
8349
8349
|
willCommit: !0,
|
|
8350
|
-
commitKey:
|
|
8351
|
-
selStart:
|
|
8352
|
-
selEnd:
|
|
8350
|
+
commitKey: Pi,
|
|
8351
|
+
selStart: qs.target.selectionStart,
|
|
8352
|
+
selEnd: qs.target.selectionEnd
|
|
8353
8353
|
}
|
|
8354
8354
|
}));
|
|
8355
8355
|
});
|
|
8356
|
-
const
|
|
8357
|
-
Un = null, Lt.addEventListener("blur", (
|
|
8358
|
-
var
|
|
8356
|
+
const ji = Un;
|
|
8357
|
+
Un = null, Lt.addEventListener("blur", (qs) => {
|
|
8358
|
+
var ki;
|
|
8359
8359
|
const {
|
|
8360
|
-
value:
|
|
8361
|
-
} =
|
|
8362
|
-
nr.userValue =
|
|
8360
|
+
value: Pi
|
|
8361
|
+
} = qs.target;
|
|
8362
|
+
nr.userValue = Pi, this._mouseState.isDown && nr.valueOnFocus !== Pi && ((ki = this.linkService.eventBus) == null || ki.dispatch("dispatcheventinsandbox", {
|
|
8363
8363
|
source: this,
|
|
8364
8364
|
detail: {
|
|
8365
8365
|
id: St,
|
|
8366
8366
|
name: "Keystroke",
|
|
8367
|
-
value:
|
|
8367
|
+
value: Pi,
|
|
8368
8368
|
willCommit: !0,
|
|
8369
8369
|
commitKey: 1,
|
|
8370
|
-
selStart:
|
|
8371
|
-
selEnd:
|
|
8370
|
+
selStart: qs.target.selectionStart,
|
|
8371
|
+
selEnd: qs.target.selectionEnd
|
|
8372
8372
|
}
|
|
8373
|
-
})),
|
|
8374
|
-
}), (zt = this.data.actions) != null && zt.Keystroke && Lt.addEventListener("beforeinput", (
|
|
8375
|
-
var
|
|
8373
|
+
})), ji(qs);
|
|
8374
|
+
}), (zt = this.data.actions) != null && zt.Keystroke && Lt.addEventListener("beforeinput", (qs) => {
|
|
8375
|
+
var bl;
|
|
8376
8376
|
const {
|
|
8377
|
-
data:
|
|
8378
|
-
target:
|
|
8379
|
-
} =
|
|
8380
|
-
value:
|
|
8381
|
-
selectionStart:
|
|
8377
|
+
data: Pi,
|
|
8378
|
+
target: ki
|
|
8379
|
+
} = qs, {
|
|
8380
|
+
value: Ri,
|
|
8381
|
+
selectionStart: hl,
|
|
8382
8382
|
selectionEnd: Ha
|
|
8383
|
-
} =
|
|
8384
|
-
let Cl =
|
|
8385
|
-
switch (
|
|
8383
|
+
} = ki;
|
|
8384
|
+
let Cl = hl, Al = Ha;
|
|
8385
|
+
switch (qs.inputType) {
|
|
8386
8386
|
case "deleteWordBackward": {
|
|
8387
|
-
const wl =
|
|
8387
|
+
const wl = Ri.substring(0, hl).match(/\w*[^\w]*$/);
|
|
8388
8388
|
wl && (Cl -= wl[0].length);
|
|
8389
8389
|
break;
|
|
8390
8390
|
}
|
|
8391
8391
|
case "deleteWordForward": {
|
|
8392
|
-
const wl =
|
|
8393
|
-
wl && (
|
|
8392
|
+
const wl = Ri.substring(hl).match(/^[^\w]*\w*/);
|
|
8393
|
+
wl && (Al += wl[0].length);
|
|
8394
8394
|
break;
|
|
8395
8395
|
}
|
|
8396
8396
|
case "deleteContentBackward":
|
|
8397
|
-
|
|
8397
|
+
hl === Ha && (Cl -= 1);
|
|
8398
8398
|
break;
|
|
8399
8399
|
case "deleteContentForward":
|
|
8400
|
-
|
|
8400
|
+
hl === Ha && (Al += 1);
|
|
8401
8401
|
break;
|
|
8402
8402
|
}
|
|
8403
|
-
|
|
8403
|
+
qs.preventDefault(), (bl = this.linkService.eventBus) == null || bl.dispatch("dispatcheventinsandbox", {
|
|
8404
8404
|
source: this,
|
|
8405
8405
|
detail: {
|
|
8406
8406
|
id: St,
|
|
8407
8407
|
name: "Keystroke",
|
|
8408
|
-
value:
|
|
8409
|
-
change:
|
|
8408
|
+
value: Ri,
|
|
8409
|
+
change: Pi || "",
|
|
8410
8410
|
willCommit: !1,
|
|
8411
8411
|
selStart: Cl,
|
|
8412
|
-
selEnd:
|
|
8412
|
+
selEnd: Al
|
|
8413
8413
|
}
|
|
8414
8414
|
});
|
|
8415
|
-
}), this._setEventListeners(Lt, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (
|
|
8415
|
+
}), this._setEventListeners(Lt, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (qs) => qs.target.value);
|
|
8416
8416
|
}
|
|
8417
8417
|
if (Un && Lt.addEventListener("blur", Un), this.data.comb) {
|
|
8418
|
-
const
|
|
8419
|
-
Lt.classList.add("comb"), Lt.style.letterSpacing = `calc(${
|
|
8418
|
+
const qs = (this.data.rect[2] - this.data.rect[0]) / Gr;
|
|
8419
|
+
Lt.classList.add("comb"), Lt.style.letterSpacing = `calc(${qs}px * var(--scale-factor) - 1ch)`;
|
|
8420
8420
|
}
|
|
8421
8421
|
} else
|
|
8422
8422
|
Lt = document.createElement("div"), Lt.textContent = this.data.fieldValue, Lt.style.verticalAlign = "middle", Lt.style.display = "table-cell";
|
|
@@ -8444,9 +8444,9 @@ function requirePdf() {
|
|
|
8444
8444
|
checked: nr
|
|
8445
8445
|
} = un.target;
|
|
8446
8446
|
for (const Un of this._getElementsByName(Gr, Lt)) {
|
|
8447
|
-
const
|
|
8448
|
-
Un.domElement && (Un.domElement.checked =
|
|
8449
|
-
value:
|
|
8447
|
+
const ji = nr && Un.exportValue === St.exportValue;
|
|
8448
|
+
Un.domElement && (Un.domElement.checked = ji), me.setValue(Un.id, {
|
|
8449
|
+
value: ji
|
|
8450
8450
|
});
|
|
8451
8451
|
}
|
|
8452
8452
|
me.setValue(Lt, {
|
|
@@ -8503,11 +8503,11 @@ function requirePdf() {
|
|
|
8503
8503
|
sr.addEventListener("updatefromsandbox", (Gr) => {
|
|
8504
8504
|
const nr = {
|
|
8505
8505
|
value: (Un) => {
|
|
8506
|
-
const
|
|
8507
|
-
for (const
|
|
8508
|
-
const
|
|
8509
|
-
|
|
8510
|
-
value:
|
|
8506
|
+
const ji = un === Un.detail.value;
|
|
8507
|
+
for (const qs of this._getElementsByName(Un.target.name)) {
|
|
8508
|
+
const Pi = ji && qs.id === Lt;
|
|
8509
|
+
qs.domElement && (qs.domElement.checked = Pi), me.setValue(qs.id, {
|
|
8510
|
+
value: Pi
|
|
8511
8511
|
});
|
|
8512
8512
|
}
|
|
8513
8513
|
}
|
|
@@ -8547,13 +8547,13 @@ function requirePdf() {
|
|
|
8547
8547
|
b.add(zt), zt.setAttribute("data-element-id", St), zt.disabled = this.data.readOnly, this._setRequired(zt, this.data.required), zt.name = this.data.fieldName, zt.tabIndex = h;
|
|
8548
8548
|
let sr = this.data.combo && this.data.options.length > 0;
|
|
8549
8549
|
this.data.combo || (zt.size = this.data.options.length, this.data.multiSelect && (zt.multiple = !0)), zt.addEventListener("resetform", (Un) => {
|
|
8550
|
-
const
|
|
8551
|
-
for (const
|
|
8552
|
-
|
|
8550
|
+
const ji = this.data.defaultFieldValue;
|
|
8551
|
+
for (const qs of zt.options)
|
|
8552
|
+
qs.selected = qs.value === ji;
|
|
8553
8553
|
});
|
|
8554
8554
|
for (const Un of this.data.options) {
|
|
8555
|
-
const
|
|
8556
|
-
|
|
8555
|
+
const ji = document.createElement("option");
|
|
8556
|
+
ji.textContent = Un.displayValue, ji.value = Un.exportValue, Lt.value.includes(Un.exportValue) && (ji.setAttribute("selected", !0), sr = !1), zt.append(ji);
|
|
8557
8557
|
}
|
|
8558
8558
|
let un = null;
|
|
8559
8559
|
if (sr) {
|
|
@@ -8562,38 +8562,38 @@ function requirePdf() {
|
|
|
8562
8562
|
Un.remove(), zt.removeEventListener("input", un), un = null;
|
|
8563
8563
|
}, zt.addEventListener("input", un);
|
|
8564
8564
|
}
|
|
8565
|
-
const Gr = (Un,
|
|
8566
|
-
const
|
|
8567
|
-
return Un.target.multiple ? Array.prototype.filter.call(
|
|
8565
|
+
const Gr = (Un, ji) => {
|
|
8566
|
+
const qs = ji ? "value" : "textContent", Pi = Un.target.options;
|
|
8567
|
+
return Un.target.multiple ? Array.prototype.filter.call(Pi, (ki) => ki.selected).map((ki) => ki[qs]) : Pi.selectedIndex === -1 ? null : Pi[Pi.selectedIndex][qs];
|
|
8568
8568
|
}, nr = (Un) => {
|
|
8569
|
-
const
|
|
8570
|
-
return Array.prototype.map.call(
|
|
8571
|
-
displayValue:
|
|
8572
|
-
exportValue:
|
|
8569
|
+
const ji = Un.target.options;
|
|
8570
|
+
return Array.prototype.map.call(ji, (qs) => ({
|
|
8571
|
+
displayValue: qs.textContent,
|
|
8572
|
+
exportValue: qs.value
|
|
8573
8573
|
}));
|
|
8574
8574
|
};
|
|
8575
8575
|
return this.enableScripting && this.hasJSActions ? (zt.addEventListener("updatefromsandbox", (Un) => {
|
|
8576
|
-
const
|
|
8577
|
-
value(
|
|
8576
|
+
const ji = {
|
|
8577
|
+
value(qs) {
|
|
8578
8578
|
un == null || un();
|
|
8579
|
-
const
|
|
8580
|
-
for (const
|
|
8581
|
-
|
|
8579
|
+
const Pi = qs.detail.value, ki = new Set(Array.isArray(Pi) ? Pi : [Pi]);
|
|
8580
|
+
for (const Ri of zt.options)
|
|
8581
|
+
Ri.selected = ki.has(Ri.value);
|
|
8582
8582
|
me.setValue(St, {
|
|
8583
|
-
value: Gr(
|
|
8583
|
+
value: Gr(qs, !0)
|
|
8584
8584
|
});
|
|
8585
8585
|
},
|
|
8586
|
-
multipleSelection(
|
|
8586
|
+
multipleSelection(qs) {
|
|
8587
8587
|
zt.multiple = !0;
|
|
8588
8588
|
},
|
|
8589
|
-
remove(
|
|
8590
|
-
const
|
|
8591
|
-
|
|
8592
|
-
value: Gr(
|
|
8593
|
-
items: nr(
|
|
8589
|
+
remove(qs) {
|
|
8590
|
+
const Pi = zt.options, ki = qs.detail.remove;
|
|
8591
|
+
Pi[ki].selected = !1, zt.remove(ki), Pi.length > 0 && Array.prototype.findIndex.call(Pi, (hl) => hl.selected) === -1 && (Pi[0].selected = !0), me.setValue(St, {
|
|
8592
|
+
value: Gr(qs, !0),
|
|
8593
|
+
items: nr(qs)
|
|
8594
8594
|
});
|
|
8595
8595
|
},
|
|
8596
|
-
clear(
|
|
8596
|
+
clear(qs) {
|
|
8597
8597
|
for (; zt.length !== 0; )
|
|
8598
8598
|
zt.remove(0);
|
|
8599
8599
|
me.setValue(St, {
|
|
@@ -8601,60 +8601,60 @@ function requirePdf() {
|
|
|
8601
8601
|
items: []
|
|
8602
8602
|
});
|
|
8603
8603
|
},
|
|
8604
|
-
insert(
|
|
8604
|
+
insert(qs) {
|
|
8605
8605
|
const {
|
|
8606
|
-
index:
|
|
8607
|
-
displayValue:
|
|
8608
|
-
exportValue:
|
|
8609
|
-
} =
|
|
8610
|
-
Ha.textContent =
|
|
8611
|
-
value: Gr(
|
|
8612
|
-
items: nr(
|
|
8606
|
+
index: Pi,
|
|
8607
|
+
displayValue: ki,
|
|
8608
|
+
exportValue: Ri
|
|
8609
|
+
} = qs.detail.insert, hl = zt.children[Pi], Ha = document.createElement("option");
|
|
8610
|
+
Ha.textContent = ki, Ha.value = Ri, hl ? hl.before(Ha) : zt.append(Ha), me.setValue(St, {
|
|
8611
|
+
value: Gr(qs, !0),
|
|
8612
|
+
items: nr(qs)
|
|
8613
8613
|
});
|
|
8614
8614
|
},
|
|
8615
|
-
items(
|
|
8615
|
+
items(qs) {
|
|
8616
8616
|
const {
|
|
8617
|
-
items:
|
|
8618
|
-
} =
|
|
8617
|
+
items: Pi
|
|
8618
|
+
} = qs.detail;
|
|
8619
8619
|
for (; zt.length !== 0; )
|
|
8620
8620
|
zt.remove(0);
|
|
8621
|
-
for (const
|
|
8621
|
+
for (const ki of Pi) {
|
|
8622
8622
|
const {
|
|
8623
|
-
displayValue:
|
|
8624
|
-
exportValue:
|
|
8625
|
-
} =
|
|
8626
|
-
Ha.textContent =
|
|
8623
|
+
displayValue: Ri,
|
|
8624
|
+
exportValue: hl
|
|
8625
|
+
} = ki, Ha = document.createElement("option");
|
|
8626
|
+
Ha.textContent = Ri, Ha.value = hl, zt.append(Ha);
|
|
8627
8627
|
}
|
|
8628
8628
|
zt.options.length > 0 && (zt.options[0].selected = !0), me.setValue(St, {
|
|
8629
|
-
value: Gr(
|
|
8630
|
-
items: nr(
|
|
8629
|
+
value: Gr(qs, !0),
|
|
8630
|
+
items: nr(qs)
|
|
8631
8631
|
});
|
|
8632
8632
|
},
|
|
8633
|
-
indices(
|
|
8634
|
-
const
|
|
8635
|
-
for (const
|
|
8636
|
-
|
|
8633
|
+
indices(qs) {
|
|
8634
|
+
const Pi = new Set(qs.detail.indices);
|
|
8635
|
+
for (const ki of qs.target.options)
|
|
8636
|
+
ki.selected = Pi.has(ki.index);
|
|
8637
8637
|
me.setValue(St, {
|
|
8638
|
-
value: Gr(
|
|
8638
|
+
value: Gr(qs, !0)
|
|
8639
8639
|
});
|
|
8640
8640
|
},
|
|
8641
|
-
editable(
|
|
8642
|
-
|
|
8641
|
+
editable(qs) {
|
|
8642
|
+
qs.target.disabled = !qs.detail.editable;
|
|
8643
8643
|
}
|
|
8644
8644
|
};
|
|
8645
|
-
this._dispatchEventFromSandbox(
|
|
8645
|
+
this._dispatchEventFromSandbox(ji, Un);
|
|
8646
8646
|
}), zt.addEventListener("input", (Un) => {
|
|
8647
|
-
var
|
|
8648
|
-
const
|
|
8647
|
+
var Pi;
|
|
8648
|
+
const ji = Gr(Un, !0), qs = Gr(Un, !1);
|
|
8649
8649
|
me.setValue(St, {
|
|
8650
|
-
value:
|
|
8651
|
-
}), (
|
|
8650
|
+
value: ji
|
|
8651
|
+
}), (Pi = this.linkService.eventBus) == null || Pi.dispatch("dispatcheventinsandbox", {
|
|
8652
8652
|
source: this,
|
|
8653
8653
|
detail: {
|
|
8654
8654
|
id: St,
|
|
8655
8655
|
name: "Keystroke",
|
|
8656
|
-
value:
|
|
8657
|
-
changeEx:
|
|
8656
|
+
value: qs,
|
|
8657
|
+
changeEx: ji,
|
|
8658
8658
|
willCommit: !0,
|
|
8659
8659
|
commitKey: 1,
|
|
8660
8660
|
keyDown: !1
|
|
@@ -8690,8 +8690,8 @@ function requirePdf() {
|
|
|
8690
8690
|
modificationDate: this.data.modificationDate,
|
|
8691
8691
|
contentsObj: this.data.contentsObj,
|
|
8692
8692
|
richText: this.data.richText
|
|
8693
|
-
}), sr = this.page, un = n.Util.normalizeRect([this.data.parentRect[0], sr.view[3] - this.data.parentRect[1] + sr.view[1], this.data.parentRect[2], sr.view[3] - this.data.parentRect[3] + sr.view[1]]), Gr = un[0] + this.data.parentRect[2] - this.data.parentRect[0], nr = un[1], [Un,
|
|
8694
|
-
return this.container.style.left = `${100 * (Gr - Un) /
|
|
8693
|
+
}), sr = this.page, un = n.Util.normalizeRect([this.data.parentRect[0], sr.view[3] - this.data.parentRect[1] + sr.view[1], this.data.parentRect[2], sr.view[3] - this.data.parentRect[3] + sr.view[1]]), Gr = un[0] + this.data.parentRect[2] - this.data.parentRect[0], nr = un[1], [Un, ji, qs, Pi] = this.viewport.viewBox, ki = qs - Un, Ri = Pi - ji;
|
|
8694
|
+
return this.container.style.left = `${100 * (Gr - Un) / ki}%`, this.container.style.top = `${100 * (nr - ji) / Ri}%`, this.container.append(zt.render()), this.container;
|
|
8695
8695
|
}
|
|
8696
8696
|
}
|
|
8697
8697
|
class p {
|
|
@@ -8706,8 +8706,8 @@ function requirePdf() {
|
|
|
8706
8706
|
Lt.className = "popup";
|
|
8707
8707
|
const zt = this.color;
|
|
8708
8708
|
if (zt) {
|
|
8709
|
-
const Un = 0.7 * (255 - zt[0]) + zt[0],
|
|
8710
|
-
Lt.style.backgroundColor = n.Util.makeHexColor(Un | 0,
|
|
8709
|
+
const Un = 0.7 * (255 - zt[0]) + zt[0], ji = 0.7 * (255 - zt[1]) + zt[1], qs = 0.7 * (255 - zt[2]) + zt[2];
|
|
8710
|
+
Lt.style.backgroundColor = n.Util.makeHexColor(Un | 0, ji | 0, qs | 0);
|
|
8711
8711
|
}
|
|
8712
8712
|
const sr = document.createElement("h1");
|
|
8713
8713
|
sr.dir = this.titleObj.dir, sr.textContent = this.titleObj.str, Lt.append(sr);
|
|
@@ -8894,8 +8894,8 @@ function requirePdf() {
|
|
|
8894
8894
|
for (const sr of me.inkLists) {
|
|
8895
8895
|
let un = [];
|
|
8896
8896
|
for (const nr of sr) {
|
|
8897
|
-
const Un = nr.x - me.rect[0],
|
|
8898
|
-
un.push(`${Un},${
|
|
8897
|
+
const Un = nr.x - me.rect[0], ji = me.rect[3] - nr.y;
|
|
8898
|
+
un.push(`${Un},${ji}`);
|
|
8899
8899
|
}
|
|
8900
8900
|
un = un.join(" ");
|
|
8901
8901
|
const Gr = this.svgFactory.createElement(this.svgElementName);
|
|
@@ -8960,7 +8960,7 @@ function requirePdf() {
|
|
|
8960
8960
|
return this.data.hasPopup || this._createPopup(null, this.data), this.quadrilaterals ? this._renderQuadrilaterals("strikeoutAnnotation") : (this.container.className = "strikeoutAnnotation", this.container);
|
|
8961
8961
|
}
|
|
8962
8962
|
}
|
|
8963
|
-
class
|
|
8963
|
+
class Oi extends Le {
|
|
8964
8964
|
constructor(me) {
|
|
8965
8965
|
var Lt, zt, sr;
|
|
8966
8966
|
const St = !!(me.data.hasPopup || (Lt = me.data.titleObj) != null && Lt.str || (zt = me.data.contentsObj) != null && zt.str || (sr = me.data.richText) != null && sr.str);
|
|
@@ -9014,13 +9014,13 @@ function requirePdf() {
|
|
|
9014
9014
|
for (const Un of St) {
|
|
9015
9015
|
if (Un.annotationType !== n.AnnotationType.POPUP) {
|
|
9016
9016
|
const {
|
|
9017
|
-
width:
|
|
9018
|
-
height:
|
|
9017
|
+
width: qs,
|
|
9018
|
+
height: Pi
|
|
9019
9019
|
} = Ye(Un.rect);
|
|
9020
|
-
if (
|
|
9020
|
+
if (qs <= 0 || Pi <= 0)
|
|
9021
9021
|
continue;
|
|
9022
9022
|
}
|
|
9023
|
-
const
|
|
9023
|
+
const ji = de.create({
|
|
9024
9024
|
data: Un,
|
|
9025
9025
|
layer: Lt,
|
|
9026
9026
|
page: me.page,
|
|
@@ -9038,13 +9038,13 @@ function requirePdf() {
|
|
|
9038
9038
|
isDown: !1
|
|
9039
9039
|
}
|
|
9040
9040
|
});
|
|
9041
|
-
if (
|
|
9042
|
-
const
|
|
9043
|
-
if (Un.hidden && (
|
|
9044
|
-
for (const
|
|
9045
|
-
|
|
9041
|
+
if (ji.isRenderable) {
|
|
9042
|
+
const qs = ji.render();
|
|
9043
|
+
if (Un.hidden && (qs.style.visibility = "hidden"), Array.isArray(qs))
|
|
9044
|
+
for (const Pi of qs)
|
|
9045
|
+
Pi.style.zIndex = un++, gl(Gr = Br, Dt, Wm).call(Gr, Pi, Un.id, Lt, sr);
|
|
9046
9046
|
else
|
|
9047
|
-
|
|
9047
|
+
qs.style.zIndex = un++, ji instanceof P ? Lt.prepend(qs) : gl(nr = Br, Dt, Wm).call(nr, qs, Un.id, Lt, sr);
|
|
9048
9048
|
}
|
|
9049
9049
|
}
|
|
9050
9050
|
gl(this, Dt, Hm).call(this, Lt, me.annotationCanvasMap);
|
|
@@ -9083,7 +9083,7 @@ function requirePdf() {
|
|
|
9083
9083
|
}
|
|
9084
9084
|
St.clear();
|
|
9085
9085
|
}
|
|
9086
|
-
},
|
|
9086
|
+
}, ml(Br, Dt);
|
|
9087
9087
|
let ln = Br;
|
|
9088
9088
|
t.AnnotationLayer = ln;
|
|
9089
9089
|
},
|
|
@@ -9359,15 +9359,15 @@ function requirePdf() {
|
|
|
9359
9359
|
if (Xn && (ur.vertical ? mt.canvasWidth = tt.height * nt._viewport.scale : mt.canvasWidth = tt.width * nt._viewport.scale), nt._textDivProperties.set(p, mt), nt._textContentStream && nt._layoutText(p), nt._enhanceTextSelection && mt.hasText) {
|
|
9360
9360
|
let Kn = 1, As = 0;
|
|
9361
9361
|
Fr !== 0 && (Kn = Math.cos(Fr), As = Math.sin(Fr));
|
|
9362
|
-
const Ti = (ur.vertical ? tt.height : tt.width) * nt._viewport.scale,
|
|
9362
|
+
const Ti = (ur.vertical ? tt.height : tt.width) * nt._viewport.scale, Oi = Is;
|
|
9363
9363
|
let dl, ln;
|
|
9364
|
-
Fr !== 0 ? (dl = [Kn, As, -As, Kn, Yn, Zn], ln = n.Util.getAxialAlignedBoundingBox([0, 0, Ti,
|
|
9364
|
+
Fr !== 0 ? (dl = [Kn, As, -As, Kn, Yn, Zn], ln = n.Util.getAxialAlignedBoundingBox([0, 0, Ti, Oi], dl)) : ln = [Yn, Zn, Yn + Ti, Zn + Oi], nt._bounds.push({
|
|
9365
9365
|
left: ln[0],
|
|
9366
9366
|
top: ln[1],
|
|
9367
9367
|
right: ln[2],
|
|
9368
9368
|
bottom: ln[3],
|
|
9369
9369
|
div: p,
|
|
9370
|
-
size: [Ti,
|
|
9370
|
+
size: [Ti, Oi],
|
|
9371
9371
|
m: dl
|
|
9372
9372
|
});
|
|
9373
9373
|
}
|
|
@@ -9403,8 +9403,8 @@ function requirePdf() {
|
|
|
9403
9403
|
}
|
|
9404
9404
|
const Fr = P[p], ur = tt[p], Is = ur.m, Si = Is[0], Yn = Is[1], Zn = [[0, 0], [0, ur.size[1]], [ur.size[0], 0], ur.size], Xn = new Float64Array(64);
|
|
9405
9405
|
for (let As = 0, Ti = Zn.length; As < Ti; As++) {
|
|
9406
|
-
const
|
|
9407
|
-
Xn[As + 0] = Si && (Fr.left -
|
|
9406
|
+
const Oi = n.Util.applyTransform(Zn[As], Is);
|
|
9407
|
+
Xn[As + 0] = Si && (Fr.left - Oi[0]) / Si, Xn[As + 4] = Yn && (Fr.top - Oi[1]) / Yn, Xn[As + 8] = Si && (Fr.right - Oi[0]) / Si, Xn[As + 12] = Yn && (Fr.bottom - Oi[1]) / Yn, Xn[As + 16] = Yn && (Fr.left - Oi[0]) / -Yn, Xn[As + 20] = Si && (Fr.top - Oi[1]) / Si, Xn[As + 24] = Yn && (Fr.right - Oi[0]) / -Yn, Xn[As + 28] = Si && (Fr.bottom - Oi[1]) / Si, Xn[As + 32] = Si && (Fr.left - Oi[0]) / -Si, Xn[As + 36] = Yn && (Fr.top - Oi[1]) / -Yn, Xn[As + 40] = Si && (Fr.right - Oi[0]) / -Si, Xn[As + 44] = Yn && (Fr.bottom - Oi[1]) / -Yn, Xn[As + 48] = Yn && (Fr.left - Oi[0]) / Yn, Xn[As + 52] = Si && (Fr.top - Oi[1]) / -Si, Xn[As + 56] = Yn && (Fr.right - Oi[0]) / Yn, Xn[As + 60] = Si && (Fr.bottom - Oi[1]) / -Si;
|
|
9408
9408
|
}
|
|
9409
9409
|
const Kn = 1 + Math.min(Math.abs(Si), Math.abs(Yn));
|
|
9410
9410
|
kt.paddingLeft = Le(Xn, 32, 16) / Kn, kt.paddingTop = Le(Xn, 48, 16) / Kn, kt.paddingRight = Le(Xn, 0, 16) / Kn, kt.paddingBottom = Le(Xn, 16, 16) / Kn, nt._textDivProperties.set(mt, kt);
|
|
@@ -9706,8 +9706,8 @@ function requirePdf() {
|
|
|
9706
9706
|
function mt(Yn, Zn, Xn) {
|
|
9707
9707
|
let Kn = -1;
|
|
9708
9708
|
for (let As = Zn; As < Xn; As++) {
|
|
9709
|
-
const Ti = (Kn ^ Yn[As]) & 255,
|
|
9710
|
-
Kn = Kn >>> 8 ^
|
|
9709
|
+
const Ti = (Kn ^ Yn[As]) & 255, Oi = p[Ti];
|
|
9710
|
+
Kn = Kn >>> 8 ^ Oi;
|
|
9711
9711
|
}
|
|
9712
9712
|
return Kn ^ -1;
|
|
9713
9713
|
}
|
|
@@ -9715,8 +9715,8 @@ function requirePdf() {
|
|
|
9715
9715
|
let As = Kn;
|
|
9716
9716
|
const Ti = Zn.length;
|
|
9717
9717
|
Xn[As] = Ti >> 24 & 255, Xn[As + 1] = Ti >> 16 & 255, Xn[As + 2] = Ti >> 8 & 255, Xn[As + 3] = Ti & 255, As += 4, Xn[As] = Yn.charCodeAt(0) & 255, Xn[As + 1] = Yn.charCodeAt(1) & 255, Xn[As + 2] = Yn.charCodeAt(2) & 255, Xn[As + 3] = Yn.charCodeAt(3) & 255, As += 4, Xn.set(Zn, As), As += Zn.length;
|
|
9718
|
-
const
|
|
9719
|
-
Xn[As] =
|
|
9718
|
+
const Oi = mt(Xn, Kn + 4, As);
|
|
9719
|
+
Xn[As] = Oi >> 24 & 255, Xn[As + 1] = Oi >> 16 & 255, Xn[As + 2] = Oi >> 8 & 255, Xn[As + 3] = Oi & 255;
|
|
9720
9720
|
}
|
|
9721
9721
|
function Fr(Yn, Zn, Xn) {
|
|
9722
9722
|
let Kn = 1, As = 0;
|
|
@@ -9744,26 +9744,26 @@ function requirePdf() {
|
|
|
9744
9744
|
const Xn = 65535, Kn = Math.ceil(Zn / Xn), As = new Uint8Array(2 + Zn + Kn * 5 + 4);
|
|
9745
9745
|
let Ti = 0;
|
|
9746
9746
|
As[Ti++] = 120, As[Ti++] = 156;
|
|
9747
|
-
let
|
|
9747
|
+
let Oi = 0;
|
|
9748
9748
|
for (; Zn > Xn; )
|
|
9749
|
-
As[Ti++] = 0, As[Ti++] = 255, As[Ti++] = 255, As[Ti++] = 0, As[Ti++] = 0, As.set(Yn.subarray(
|
|
9750
|
-
As[Ti++] = 1, As[Ti++] = Zn & 255, As[Ti++] = Zn >> 8 & 255, As[Ti++] = ~Zn & 65535 & 255, As[Ti++] = (~Zn & 65535) >> 8 & 255, As.set(Yn.subarray(
|
|
9749
|
+
As[Ti++] = 0, As[Ti++] = 255, As[Ti++] = 255, As[Ti++] = 0, As[Ti++] = 0, As.set(Yn.subarray(Oi, Oi + Xn), Ti), Ti += Xn, Oi += Xn, Zn -= Xn;
|
|
9750
|
+
As[Ti++] = 1, As[Ti++] = Zn & 255, As[Ti++] = Zn >> 8 & 255, As[Ti++] = ~Zn & 65535 & 255, As[Ti++] = (~Zn & 65535) >> 8 & 255, As.set(Yn.subarray(Oi), Ti), Ti += Yn.length - Oi;
|
|
9751
9751
|
const dl = Fr(Yn, 0, Yn.length);
|
|
9752
9752
|
return As[Ti++] = dl >> 24 & 255, As[Ti++] = dl >> 16 & 255, As[Ti++] = dl >> 8 & 255, As[Ti++] = dl & 255, As;
|
|
9753
9753
|
}
|
|
9754
9754
|
function Si(Yn, Zn, Xn, Kn) {
|
|
9755
9755
|
const As = Yn.width, Ti = Yn.height;
|
|
9756
|
-
let
|
|
9756
|
+
let Oi, dl, ln;
|
|
9757
9757
|
const Dt = Yn.data;
|
|
9758
9758
|
switch (Zn) {
|
|
9759
9759
|
case s.ImageKind.GRAYSCALE_1BPP:
|
|
9760
|
-
dl = 0,
|
|
9760
|
+
dl = 0, Oi = 1, ln = As + 7 >> 3;
|
|
9761
9761
|
break;
|
|
9762
9762
|
case s.ImageKind.RGB_24BPP:
|
|
9763
|
-
dl = 2,
|
|
9763
|
+
dl = 2, Oi = 8, ln = As * 3;
|
|
9764
9764
|
break;
|
|
9765
9765
|
case s.ImageKind.RGBA_32BPP:
|
|
9766
|
-
dl = 6,
|
|
9766
|
+
dl = 6, Oi = 8, ln = As * 4;
|
|
9767
9767
|
break;
|
|
9768
9768
|
default:
|
|
9769
9769
|
throw new Error("invalid format");
|
|
@@ -9780,7 +9780,7 @@ function requirePdf() {
|
|
|
9780
9780
|
ot[Ur++] ^= 255;
|
|
9781
9781
|
}
|
|
9782
9782
|
}
|
|
9783
|
-
const Br = new Uint8Array([As >> 24 & 255, As >> 16 & 255, As >> 8 & 255, As & 255, Ti >> 24 & 255, Ti >> 16 & 255, Ti >> 8 & 255, Ti & 255,
|
|
9783
|
+
const Br = new Uint8Array([As >> 24 & 255, As >> 16 & 255, As >> 8 & 255, As & 255, Ti >> 24 & 255, Ti >> 16 & 255, Ti >> 8 & 255, Ti & 255, Oi, dl, 0, 0, 0]), Ar = ur(ot), me = N.length + P * 3 + Br.length + Ar.length, St = new Uint8Array(me);
|
|
9784
9784
|
let Lt = 0;
|
|
9785
9785
|
return St.set(N, Lt), Lt += N.length, kt("IHDR", Br, St, Lt), Lt += P + Br.length, kt("IDATA", Ar, St, Lt), Lt += P + Ar.length, kt("IEND", new Uint8Array(0), St, Lt), de(St, "image/png", Xn);
|
|
9786
9786
|
}
|
|
@@ -10065,8 +10065,8 @@ function requirePdf() {
|
|
|
10065
10065
|
const dl = 1 / (P.textMatrixScale || 1);
|
|
10066
10066
|
this._setStrokeAttributes(P.tspan, dl);
|
|
10067
10067
|
}
|
|
10068
|
-
let
|
|
10069
|
-
P.textRise !== 0 && (
|
|
10068
|
+
let Oi = P.textMatrix;
|
|
10069
|
+
P.textRise !== 0 && (Oi = Oi.slice(), Oi[5] += P.textRise), P.txtElement.setAttributeNS(null, "transform", `${pe(Oi)} scale(${a(Si)}, -1)`), P.txtElement.setAttributeNS(h, "xml:space", "preserve"), P.txtElement.append(P.tspan), P.txtgrp.append(P.txtElement), this._ensureTransformGroup().append(P.txtElement);
|
|
10070
10070
|
}
|
|
10071
10071
|
setLeadingMoveText(N, P) {
|
|
10072
10072
|
this.setLeading(-P), this.moveText(N, P);
|
|
@@ -10131,9 +10131,9 @@ function requirePdf() {
|
|
|
10131
10131
|
return N[0] === "TilingPattern" ? this._makeTilingPattern(N) : this._makeShadingPattern(N);
|
|
10132
10132
|
}
|
|
10133
10133
|
_makeTilingPattern(N) {
|
|
10134
|
-
const P = N[1], p = N[2], mt = N[3] || s.IDENTITY_MATRIX, [kt, Fr, ur, Is] = N[4], Si = N[5], Yn = N[6], Zn = N[7], Xn = `shading${tt++}`, [Kn, As, Ti,
|
|
10134
|
+
const P = N[1], p = N[2], mt = N[3] || s.IDENTITY_MATRIX, [kt, Fr, ur, Is] = N[4], Si = N[5], Yn = N[6], Zn = N[7], Xn = `shading${tt++}`, [Kn, As, Ti, Oi] = s.Util.normalizeRect([...s.Util.applyTransform([kt, Fr], mt), ...s.Util.applyTransform([ur, Is], mt)]), [dl, ln] = s.Util.singularValueDecompose2dScale(mt), Dt = Si * dl, ot = Yn * ln, Ur = this.svgFactory.createElement("svg:pattern");
|
|
10135
10135
|
Ur.setAttributeNS(null, "id", Xn), Ur.setAttributeNS(null, "patternUnits", "userSpaceOnUse"), Ur.setAttributeNS(null, "width", Dt), Ur.setAttributeNS(null, "height", ot), Ur.setAttributeNS(null, "x", `${Kn}`), Ur.setAttributeNS(null, "y", `${As}`);
|
|
10136
|
-
const It = this.svg, Br = this.transformMatrix, Ar = this.current.fillColor, me = this.current.strokeColor, St = this.svgFactory.create(Ti - Kn,
|
|
10136
|
+
const It = this.svg, Br = this.transformMatrix, Ar = this.current.fillColor, me = this.current.strokeColor, St = this.svgFactory.create(Ti - Kn, Oi - As);
|
|
10137
10137
|
if (this.svg = St, this.transformMatrix = mt, Zn === 2) {
|
|
10138
10138
|
const Lt = s.Util.makeHexColor(...P);
|
|
10139
10139
|
this.current.fillColor = Lt, this.current.strokeColor = Lt;
|
|
@@ -12452,8 +12452,8 @@ var Yl = (e, t, r) => {
|
|
|
12452
12452
|
case "remove_node": {
|
|
12453
12453
|
var {
|
|
12454
12454
|
path: Ti
|
|
12455
|
-
} = r,
|
|
12456
|
-
if (dl.children.splice(
|
|
12455
|
+
} = r, Oi = Ti[Ti.length - 1], dl = L.parent(e, Ti);
|
|
12456
|
+
if (dl.children.splice(Oi, 1), t)
|
|
12457
12457
|
for (var [ln, Dt] of A.points(t)) {
|
|
12458
12458
|
var ot = ce.transform(ln, r);
|
|
12459
12459
|
if (t != null && ot != null)
|
|
@@ -12488,21 +12488,21 @@ var Yl = (e, t, r) => {
|
|
|
12488
12488
|
}
|
|
12489
12489
|
case "set_node": {
|
|
12490
12490
|
var {
|
|
12491
|
-
path:
|
|
12492
|
-
properties:
|
|
12493
|
-
newProperties:
|
|
12491
|
+
path: ji,
|
|
12492
|
+
properties: qs,
|
|
12493
|
+
newProperties: Pi
|
|
12494
12494
|
} = r;
|
|
12495
|
-
if (
|
|
12495
|
+
if (ji.length === 0)
|
|
12496
12496
|
throw new Error("Cannot set properties on the root node!");
|
|
12497
|
-
var
|
|
12498
|
-
for (var
|
|
12499
|
-
if (
|
|
12500
|
-
throw new Error('Cannot set the "'.concat(
|
|
12501
|
-
var
|
|
12502
|
-
|
|
12497
|
+
var ki = L.get(e, ji);
|
|
12498
|
+
for (var Ri in Pi) {
|
|
12499
|
+
if (Ri === "children" || Ri === "text")
|
|
12500
|
+
throw new Error('Cannot set the "'.concat(Ri, '" property of nodes!'));
|
|
12501
|
+
var hl = Pi[Ri];
|
|
12502
|
+
hl == null ? delete ki[Ri] : ki[Ri] = hl;
|
|
12503
12503
|
}
|
|
12504
|
-
for (var Ha in
|
|
12505
|
-
|
|
12504
|
+
for (var Ha in qs)
|
|
12505
|
+
Pi.hasOwnProperty(Ha) || delete ki[Ha];
|
|
12506
12506
|
break;
|
|
12507
12507
|
}
|
|
12508
12508
|
case "set_selection": {
|
|
@@ -12517,14 +12517,14 @@ var Yl = (e, t, r) => {
|
|
|
12517
12517
|
throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(ze.stringify(Cl), " when there is no current selection."));
|
|
12518
12518
|
t = Or({}, Cl);
|
|
12519
12519
|
}
|
|
12520
|
-
for (var
|
|
12521
|
-
var
|
|
12522
|
-
if (
|
|
12523
|
-
if (
|
|
12524
|
-
throw new Error('Cannot remove the "'.concat(
|
|
12525
|
-
delete t[
|
|
12520
|
+
for (var Al in Cl) {
|
|
12521
|
+
var bl = Cl[Al];
|
|
12522
|
+
if (bl == null) {
|
|
12523
|
+
if (Al === "anchor" || Al === "focus")
|
|
12524
|
+
throw new Error('Cannot remove the "'.concat(Al, '" selection property'));
|
|
12525
|
+
delete t[Al];
|
|
12526
12526
|
} else
|
|
12527
|
-
t[
|
|
12527
|
+
t[Al] = bl;
|
|
12528
12528
|
}
|
|
12529
12529
|
}
|
|
12530
12530
|
break;
|
|
@@ -12544,14 +12544,14 @@ var Yl = (e, t, r) => {
|
|
|
12544
12544
|
text: nm
|
|
12545
12545
|
});
|
|
12546
12546
|
} else {
|
|
12547
|
-
var sm = Bl.children.slice(0, xl),
|
|
12547
|
+
var sm = Bl.children.slice(0, xl), pl = Bl.children.slice(xl);
|
|
12548
12548
|
Bl.children = sm, Pl = Or(Or({}, Rl), {}, {
|
|
12549
|
-
children:
|
|
12549
|
+
children: pl
|
|
12550
12550
|
});
|
|
12551
12551
|
}
|
|
12552
12552
|
if (lg.children.splice(Ol + 1, 0, Pl), t)
|
|
12553
|
-
for (var [
|
|
12554
|
-
t[
|
|
12553
|
+
for (var [Ni, _a] of A.points(t))
|
|
12554
|
+
t[_a] = ce.transform(Ni, r);
|
|
12555
12555
|
break;
|
|
12556
12556
|
}
|
|
12557
12557
|
}
|
|
@@ -14782,9 +14782,9 @@ var If = (e, t) => {
|
|
|
14782
14782
|
return d.pathRef(e, un);
|
|
14783
14783
|
}), Kn = d.pointRef(e, pe), As = d.pointRef(e, st), Ti = "";
|
|
14784
14784
|
if (!P && !p) {
|
|
14785
|
-
var
|
|
14785
|
+
var Oi = Kn.current, [dl] = d.leaf(e, Oi), {
|
|
14786
14786
|
path: ln
|
|
14787
|
-
} =
|
|
14787
|
+
} = Oi, {
|
|
14788
14788
|
offset: Dt
|
|
14789
14789
|
} = pe, ot = dl.text.slice(Dt);
|
|
14790
14790
|
ot.length > 0 && (e.apply({
|
|
@@ -14891,7 +14891,7 @@ var If = (e, t) => {
|
|
|
14891
14891
|
match: (ot) => U.isText(ot) || d.isInline(e, ot),
|
|
14892
14892
|
mode: "highest",
|
|
14893
14893
|
voids: s
|
|
14894
|
-
}), [, Xn] = Zn, Kn = d.isStart(e, i, Xn), As = d.isEnd(e, i, Xn), Ti = d.pathRef(e, a && !ur.length ? C.next(E) : E),
|
|
14894
|
+
}), [, Xn] = Zn, Kn = d.isStart(e, i, Xn), As = d.isEnd(e, i, Xn), Ti = d.pathRef(e, a && !ur.length ? C.next(E) : E), Oi = d.pathRef(e, As ? C.next(Xn) : Xn);
|
|
14895
14895
|
j.splitNodes(e, {
|
|
14896
14896
|
at: i,
|
|
14897
14897
|
match: (ot) => Si ? K.isElement(ot) && d.isBlock(e, ot) : U.isText(ot) || d.isInline(e, ot),
|
|
@@ -14916,19 +14916,19 @@ var If = (e, t) => {
|
|
|
14916
14916
|
voids: s,
|
|
14917
14917
|
batchDirty: o
|
|
14918
14918
|
}), j.insertNodes(e, ur, {
|
|
14919
|
-
at:
|
|
14919
|
+
at: Oi.current,
|
|
14920
14920
|
match: (ot) => U.isText(ot) || d.isInline(e, ot),
|
|
14921
14921
|
mode: "highest",
|
|
14922
14922
|
voids: s,
|
|
14923
14923
|
batchDirty: o
|
|
14924
14924
|
}), !r.at) {
|
|
14925
14925
|
var ln;
|
|
14926
|
-
if (ur.length > 0 &&
|
|
14926
|
+
if (ur.length > 0 && Oi.current ? ln = C.previous(Oi.current) : Fr.length > 0 && Ti.current ? ln = C.previous(Ti.current) : dl.current && (ln = C.previous(dl.current)), ln) {
|
|
14927
14927
|
var Dt = d.end(e, ln);
|
|
14928
14928
|
j.select(e, Dt);
|
|
14929
14929
|
}
|
|
14930
14930
|
}
|
|
14931
|
-
dl.unref(), Ti.unref(),
|
|
14931
|
+
dl.unref(), Ti.unref(), Oi.unref();
|
|
14932
14932
|
}
|
|
14933
14933
|
}
|
|
14934
14934
|
});
|
|
@@ -16319,14 +16319,14 @@ const Od = /* @__PURE__ */ Qa(Fd), zu = (e) => typeof e == "object" && e != null
|
|
|
16319
16319
|
let Si = c === "start" || c === "nearest" ? N - kt : c === "end" ? p + ur : N + nt / 2 - kt + ur, Yn = h === "center" ? mt + tt / 2 - Is + Fr : h === "end" ? P + Fr : mt - Is;
|
|
16320
16320
|
const Zn = [];
|
|
16321
16321
|
for (let Xn = 0; Xn < Le.length; Xn++) {
|
|
16322
|
-
const Kn = Le[Xn], { height: As, width: Ti, top:
|
|
16323
|
-
if (o === "if-needed" && N >= 0 && mt >= 0 && p <= a && P <= u && (Kn === de && !Jr(Kn) || N >=
|
|
16322
|
+
const Kn = Le[Xn], { height: As, width: Ti, top: Oi, right: dl, bottom: ln, left: Dt } = Kn.getBoundingClientRect();
|
|
16323
|
+
if (o === "if-needed" && N >= 0 && mt >= 0 && p <= a && P <= u && (Kn === de && !Jr(Kn) || N >= Oi && p <= ln && mt >= Dt && P <= dl)) return Zn;
|
|
16324
16324
|
const ot = getComputedStyle(Kn), Ur = parseInt(ot.borderLeftWidth, 10), It = parseInt(ot.borderTopWidth, 10), Br = parseInt(ot.borderRightWidth, 10), Ar = parseInt(ot.borderBottomWidth, 10);
|
|
16325
16325
|
let me = 0, St = 0;
|
|
16326
16326
|
const Lt = "offsetWidth" in Kn ? Kn.offsetWidth - Kn.clientWidth - Ur - Br : 0, zt = "offsetHeight" in Kn ? Kn.offsetHeight - Kn.clientHeight - It - Ar : 0, sr = "offsetWidth" in Kn ? Kn.offsetWidth === 0 ? 0 : Ti / Kn.offsetWidth : 0, un = "offsetHeight" in Kn ? Kn.offsetHeight === 0 ? 0 : As / Kn.offsetHeight : 0;
|
|
16327
16327
|
if (de === Kn) me = c === "start" ? Si : c === "end" ? Si - a : c === "nearest" ? Qr(st, st + a, a, It, Ar, st + Si, st + Si + nt, nt) : Si - a / 2, St = h === "start" ? Yn : h === "center" ? Yn - u / 2 : h === "end" ? Yn - u : Qr(pe, pe + u, u, Ur, Br, pe + Yn, pe + Yn + tt, tt), me = Math.max(0, me + st), St = Math.max(0, St + pe);
|
|
16328
16328
|
else {
|
|
16329
|
-
me = c === "start" ? Si -
|
|
16329
|
+
me = c === "start" ? Si - Oi - It : c === "end" ? Si - ln + Ar + zt : c === "nearest" ? Qr(Oi, ln, As, It, Ar + zt, Si, Si + nt, nt) : Si - (Oi + As / 2) + zt / 2, St = h === "start" ? Yn - Dt - Ur : h === "center" ? Yn - (Dt + Ti / 2) + Lt / 2 : h === "end" ? Yn - dl + Br + Lt : Qr(Dt, dl, Ti, Ur, Br + Lt, Yn, Yn + tt, tt);
|
|
16330
16330
|
const { scrollLeft: Gr, scrollTop: nr } = Kn;
|
|
16331
16331
|
me = un === 0 ? 0 : Math.max(0, Math.min(nr + me / un, Kn.scrollHeight - As / un + zt)), St = sr === 0 ? 0 : Math.max(0, Math.min(Gr + St / sr, Kn.scrollWidth - Ti / sr + Lt)), Si += nr - me, Yn += Gr - St;
|
|
16332
16332
|
}
|
|
@@ -17198,11 +17198,11 @@ var F = {
|
|
|
17198
17198
|
})) {
|
|
17199
17199
|
var As = F.toSlateNode(e, Kn), {
|
|
17200
17200
|
path: Ti,
|
|
17201
|
-
offset:
|
|
17201
|
+
offset: Oi
|
|
17202
17202
|
} = d.start(e, F.findPath(e, As));
|
|
17203
|
-
return Kn.querySelector("[data-slate-leaf]") || (
|
|
17203
|
+
return Kn.querySelector("[data-slate-leaf]") || (Oi = c), {
|
|
17204
17204
|
path: Ti,
|
|
17205
|
-
offset:
|
|
17205
|
+
offset: Oi
|
|
17206
17206
|
};
|
|
17207
17207
|
}
|
|
17208
17208
|
}
|
|
@@ -17604,8 +17604,8 @@ function Ph(e) {
|
|
|
17604
17604
|
return;
|
|
17605
17605
|
}
|
|
17606
17606
|
Si && r(), r.flush(), n.flush(), b();
|
|
17607
|
-
var
|
|
17608
|
-
At.delete(t),
|
|
17607
|
+
var Oi = At.get(t);
|
|
17608
|
+
At.delete(t), Oi !== void 0 && (t.marks = Oi, t.onChange());
|
|
17609
17609
|
}, Le = (Is) => {
|
|
17610
17610
|
i && clearTimeout(i), i = setTimeout(() => {
|
|
17611
17611
|
Ht.set(t, !1), de();
|
|
@@ -17624,7 +17624,7 @@ function Ph(e) {
|
|
|
17624
17624
|
}, a = (Is, Si) => {
|
|
17625
17625
|
var Yn, Zn = (Yn = Ze.get(t)) !== null && Yn !== void 0 ? Yn : [];
|
|
17626
17626
|
Ze.set(t, Zn);
|
|
17627
|
-
var Xn = L.leaf(t, Is), Kn = Zn.findIndex((
|
|
17627
|
+
var Xn = L.leaf(t, Is), Kn = Zn.findIndex((Oi) => C.equals(Oi.path, Is));
|
|
17628
17628
|
if (Kn < 0) {
|
|
17629
17629
|
var As = wo(Xn.text, Si);
|
|
17630
17630
|
As && Zn.push({
|
|
@@ -17667,7 +17667,7 @@ function Ph(e) {
|
|
|
17667
17667
|
exactMatch: !1,
|
|
17668
17668
|
suppressThrow: !0
|
|
17669
17669
|
})), Zn = (Si = Zn) !== null && Si !== void 0 ? Si : t.selection, !!Zn) {
|
|
17670
|
-
var
|
|
17670
|
+
var Oi = !0;
|
|
17671
17671
|
if (Yn.startsWith("delete")) {
|
|
17672
17672
|
if (A.isExpanded(Zn)) {
|
|
17673
17673
|
var [dl, ln] = A.edges(Zn), Dt = L.leaf(t, dl.path);
|
|
@@ -17687,8 +17687,8 @@ function Ph(e) {
|
|
|
17687
17687
|
start: It.offset,
|
|
17688
17688
|
end: Br.offset
|
|
17689
17689
|
}, Lt = Ze.get(t), zt = Lt == null ? void 0 : Lt.find((wl) => C.equals(wl.path, me)), sr = zt ? [zt.diff, St] : [St], un = bo(Ar.text, ...sr);
|
|
17690
|
-
if (un.length === 0 && (
|
|
17691
|
-
if (
|
|
17690
|
+
if (un.length === 0 && (Oi = !1), A.isExpanded(Zn)) {
|
|
17691
|
+
if (Oi && C.equals(Zn.anchor.path, Zn.focus.path)) {
|
|
17692
17692
|
var Gr = {
|
|
17693
17693
|
path: Zn.anchor.path,
|
|
17694
17694
|
offset: It.offset
|
|
@@ -17718,9 +17718,9 @@ function Ph(e) {
|
|
|
17718
17718
|
var {
|
|
17719
17719
|
anchor: Un
|
|
17720
17720
|
} = Zn;
|
|
17721
|
-
if (
|
|
17722
|
-
var
|
|
17723
|
-
if (Un.offset <
|
|
17721
|
+
if (Oi && A.isCollapsed(Zn)) {
|
|
17722
|
+
var ji = L.leaf(t, Un.path);
|
|
17723
|
+
if (Un.offset < ji.text.length)
|
|
17724
17724
|
return a(Un.path, {
|
|
17725
17725
|
text: "",
|
|
17726
17726
|
start: Un.offset,
|
|
@@ -17732,13 +17732,13 @@ function Ph(e) {
|
|
|
17732
17732
|
});
|
|
17733
17733
|
}
|
|
17734
17734
|
case "deleteContentBackward": {
|
|
17735
|
-
var
|
|
17736
|
-
anchor:
|
|
17737
|
-
} = Zn,
|
|
17738
|
-
return
|
|
17735
|
+
var qs, {
|
|
17736
|
+
anchor: Pi
|
|
17737
|
+
} = Zn, ki = Ma(Kn) ? Kn.isCollapsed : !!((qs = Kn) !== null && qs !== void 0 && qs.collapsed);
|
|
17738
|
+
return Oi && ki && A.isCollapsed(Zn) && Pi.offset > 0 ? a(Pi.path, {
|
|
17739
17739
|
text: "",
|
|
17740
|
-
start:
|
|
17741
|
-
end:
|
|
17740
|
+
start: Pi.offset - 1,
|
|
17741
|
+
end: Pi.offset
|
|
17742
17742
|
}) : pe(() => d.deleteBackward(t), {
|
|
17743
17743
|
at: Zn
|
|
17744
17744
|
});
|
|
@@ -17809,11 +17809,11 @@ function Ph(e) {
|
|
|
17809
17809
|
return pe(() => F.insertData(t, Xn), {
|
|
17810
17810
|
at: Zn
|
|
17811
17811
|
});
|
|
17812
|
-
var
|
|
17813
|
-
if (gt.get(t) && (
|
|
17812
|
+
var Ri = Xn ?? "";
|
|
17813
|
+
if (gt.get(t) && (Ri = Ri.replace("\uFEFF", "")), Yn === "insertText" && /.*\n.*\n$/.test(Ri) && (Ri = Ri.slice(0, -1)), Ri.includes(`
|
|
17814
17814
|
`))
|
|
17815
17815
|
return pe(() => {
|
|
17816
|
-
var wl =
|
|
17816
|
+
var wl = Ri.split(`
|
|
17817
17817
|
`);
|
|
17818
17818
|
wl.forEach((xl, Rl) => {
|
|
17819
17819
|
xl && d.insertText(t, xl), Rl !== wl.length - 1 && d.insertSoftBreak(t);
|
|
@@ -17822,23 +17822,23 @@ function Ph(e) {
|
|
|
17822
17822
|
at: Zn
|
|
17823
17823
|
});
|
|
17824
17824
|
if (C.equals(Zn.anchor.path, Zn.focus.path)) {
|
|
17825
|
-
var [
|
|
17826
|
-
start:
|
|
17825
|
+
var [hl, Ha] = A.edges(Zn), Cl = {
|
|
17826
|
+
start: hl.offset,
|
|
17827
17827
|
end: Ha.offset,
|
|
17828
|
-
text:
|
|
17828
|
+
text: Ri
|
|
17829
17829
|
};
|
|
17830
|
-
if (
|
|
17831
|
-
var
|
|
17832
|
-
|
|
17833
|
-
} else Yn === "insertText" ? l === null ? l = Cl : l && A.isCollapsed(Zn) && l.end + l.text.length ===
|
|
17834
|
-
text: l.text +
|
|
17830
|
+
if (Ri && l && Yn === "insertCompositionText") {
|
|
17831
|
+
var Al = l.start + l.text.search(/\S|$/), bl = Cl.start + Cl.text.search(/\S|$/);
|
|
17832
|
+
bl === Al + 1 && Cl.end === l.start + l.text.length ? (Cl.start -= 1, l = null, Fr()) : l = !1;
|
|
17833
|
+
} else Yn === "insertText" ? l === null ? l = Cl : l && A.isCollapsed(Zn) && l.end + l.text.length === hl.offset ? l = nn(nn({}, l), {}, {
|
|
17834
|
+
text: l.text + Ri
|
|
17835
17835
|
}) : l = !1 : l = !1;
|
|
17836
|
-
if (
|
|
17837
|
-
a(
|
|
17836
|
+
if (Oi) {
|
|
17837
|
+
a(hl.path, Cl);
|
|
17838
17838
|
return;
|
|
17839
17839
|
}
|
|
17840
17840
|
}
|
|
17841
|
-
return pe(() => d.insertText(t,
|
|
17841
|
+
return pe(() => d.insertText(t, Ri), {
|
|
17842
17842
|
at: Zn
|
|
17843
17843
|
});
|
|
17844
17844
|
}
|
|
@@ -18507,11 +18507,11 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
18507
18507
|
focusNode: Gr
|
|
18508
18508
|
} = sr, nr = F.hasEditableTarget(a, un) || F.isTargetInsideNonReadonlyVoid(a, un), Un = F.hasTarget(a, Gr);
|
|
18509
18509
|
if (nr && Un) {
|
|
18510
|
-
var
|
|
18510
|
+
var ji = F.toSlateRange(a, sr, {
|
|
18511
18511
|
exactMatch: !1,
|
|
18512
18512
|
suppressThrow: !0
|
|
18513
18513
|
});
|
|
18514
|
-
|
|
18514
|
+
ji && (!F.isComposing(a) && !(me != null && me.hasPendingChanges()) && !(me != null && me.isFlushing()) ? j.select(a, ji) : me == null || me.handleUserSelect(ji));
|
|
18515
18515
|
}
|
|
18516
18516
|
c && (!nr || !Un) && j.deselect(a);
|
|
18517
18517
|
}
|
|
@@ -18530,14 +18530,14 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
18530
18530
|
var zt = (nr) => {
|
|
18531
18531
|
var Un = Lt.type !== "None";
|
|
18532
18532
|
if (!(!me && !Un)) {
|
|
18533
|
-
var
|
|
18533
|
+
var ji = Lt.focusNode, qs;
|
|
18534
18534
|
if (lr && Lt.rangeCount > 1) {
|
|
18535
|
-
var
|
|
18536
|
-
|
|
18535
|
+
var Pi = Lt.getRangeAt(0), ki = Lt.getRangeAt(Lt.rangeCount - 1);
|
|
18536
|
+
Pi.startContainer === ji ? qs = ki.endContainer : qs = Pi.startContainer;
|
|
18537
18537
|
} else
|
|
18538
|
-
|
|
18539
|
-
var
|
|
18540
|
-
if (
|
|
18538
|
+
qs = Lt.anchorNode;
|
|
18539
|
+
var Ri = hn.get(a), hl = !1;
|
|
18540
|
+
if (Ri.contains(qs) && Ri.contains(ji) && (hl = !0), Un && hl && me && !nr) {
|
|
18541
18541
|
var Ha = F.toSlateRange(a, Lt, {
|
|
18542
18542
|
exactMatch: !0,
|
|
18543
18543
|
// domSelection is not necessarily a valid Slate range
|
|
@@ -18546,7 +18546,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
18546
18546
|
});
|
|
18547
18547
|
if (Ha && A.equals(Ha, me)) {
|
|
18548
18548
|
var Cl;
|
|
18549
|
-
if (!ur.hasMarkPlaceholder || (Cl =
|
|
18549
|
+
if (!ur.hasMarkPlaceholder || (Cl = qs) !== null && Cl !== void 0 && (Cl = Cl.parentElement) !== null && Cl !== void 0 && Cl.hasAttribute("data-slate-mark-placeholder"))
|
|
18550
18550
|
return;
|
|
18551
18551
|
}
|
|
18552
18552
|
}
|
|
@@ -18558,8 +18558,8 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
18558
18558
|
return;
|
|
18559
18559
|
}
|
|
18560
18560
|
ur.isUpdatingSelection = !0;
|
|
18561
|
-
var
|
|
18562
|
-
return
|
|
18561
|
+
var Al = me && F.toDOMRange(a, me);
|
|
18562
|
+
return Al ? (F.isComposing(a) && !Ue ? Lt.collapseToEnd() : A.isBackward(me) ? Lt.setBaseAndExtent(Al.endContainer, Al.endOffset, Al.startContainer, Al.startOffset) : Lt.setBaseAndExtent(Al.startContainer, Al.startOffset, Al.endContainer, Al.endOffset), Ye(a, Al)) : Lt.removeAllRanges(), Al;
|
|
18563
18563
|
}
|
|
18564
18564
|
};
|
|
18565
18565
|
Lt.rangeCount <= 1 && zt();
|
|
@@ -18574,8 +18574,8 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
18574
18574
|
if (sr) {
|
|
18575
18575
|
var nr = (Un) => {
|
|
18576
18576
|
try {
|
|
18577
|
-
var
|
|
18578
|
-
|
|
18577
|
+
var ji = F.toDOMNode(a, a);
|
|
18578
|
+
ji.focus(), zt(Un);
|
|
18579
18579
|
} catch {
|
|
18580
18580
|
}
|
|
18581
18581
|
};
|
|
@@ -18613,27 +18613,27 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
18613
18613
|
} = It, nr = It.dataTransfer || It.data || void 0, Un = Gr === "insertCompositionText" || Gr === "deleteCompositionText";
|
|
18614
18614
|
if (Un && F.isComposing(a))
|
|
18615
18615
|
return;
|
|
18616
|
-
var
|
|
18616
|
+
var ji = !1;
|
|
18617
18617
|
if (Gr === "insertText" && un && A.isCollapsed(un) && // Only use native character insertion for single characters a-z or space for now.
|
|
18618
18618
|
// Long-press events (hold a + press 4 = ä) to choose a special character otherwise
|
|
18619
18619
|
// causes duplicate inserts.
|
|
18620
18620
|
It.data && It.data.length === 1 && /[a-z ]/i.test(It.data) && // Chrome has issues correctly editing the start of nodes: https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
|
|
18621
18621
|
// When there is an inline element, e.g. a link, and you select
|
|
18622
18622
|
// right after it (the start of the next node).
|
|
18623
|
-
un.anchor.offset !== 0 && (
|
|
18624
|
-
var
|
|
18625
|
-
anchor:
|
|
18626
|
-
} = un, [
|
|
18627
|
-
if (
|
|
18628
|
-
var
|
|
18629
|
-
|
|
18623
|
+
un.anchor.offset !== 0 && (ji = !0, a.marks && (ji = !1), !fr.get(a))) {
|
|
18624
|
+
var qs, Pi, {
|
|
18625
|
+
anchor: ki
|
|
18626
|
+
} = un, [Ri, hl] = F.toDOMPoint(a, ki), Ha = (qs = Ri.parentElement) === null || qs === void 0 ? void 0 : qs.closest("a"), Cl = F.getWindow(a);
|
|
18627
|
+
if (ji && Ha && F.hasDOMNode(a, Ha)) {
|
|
18628
|
+
var Al, bl = Cl == null ? void 0 : Cl.document.createTreeWalker(Ha, NodeFilter.SHOW_TEXT).lastChild();
|
|
18629
|
+
bl === Ri && ((Al = bl.textContent) === null || Al === void 0 ? void 0 : Al.length) === hl && (ji = !1);
|
|
18630
18630
|
}
|
|
18631
|
-
if (
|
|
18631
|
+
if (ji && Ri.parentElement && (Cl == null || (Pi = Cl.getComputedStyle(Ri.parentElement)) === null || Pi === void 0 ? void 0 : Pi.whiteSpace) === "pre") {
|
|
18632
18632
|
var wl = d.above(a, {
|
|
18633
|
-
at:
|
|
18633
|
+
at: ki.path,
|
|
18634
18634
|
match: (Pl) => K.isElement(Pl) && d.isBlock(a, Pl)
|
|
18635
18635
|
});
|
|
18636
|
-
wl && L.string(wl[0]).includes(" ") && (
|
|
18636
|
+
wl && L.string(wl[0]).includes(" ") && (ji = !1);
|
|
18637
18637
|
}
|
|
18638
18638
|
}
|
|
18639
18639
|
if ((!Gr.startsWith("delete") || Gr.startsWith("deleteBy")) && !fr.get(a)) {
|
|
@@ -18644,7 +18644,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
18644
18644
|
suppressThrow: !1
|
|
18645
18645
|
});
|
|
18646
18646
|
if (!un || !A.equals(un, Rl)) {
|
|
18647
|
-
|
|
18647
|
+
ji = !1;
|
|
18648
18648
|
var Bl = !Un && a.selection && d.rangeRef(a, a.selection);
|
|
18649
18649
|
j.select(a, Rl), Bl && $r.set(a, Bl);
|
|
18650
18650
|
}
|
|
@@ -18652,7 +18652,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
18652
18652
|
}
|
|
18653
18653
|
if (Un)
|
|
18654
18654
|
return;
|
|
18655
|
-
if (
|
|
18655
|
+
if (ji || It.preventDefault(), un && A.isExpanded(un) && Gr.startsWith("delete")) {
|
|
18656
18656
|
var lg = Gr.endsWith("Backward") ? "backward" : "forward";
|
|
18657
18657
|
d.deleteFragment(a, {
|
|
18658
18658
|
direction: lg
|
|
@@ -18732,7 +18732,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
18732
18732
|
case "insertFromYank":
|
|
18733
18733
|
case "insertReplacementText":
|
|
18734
18734
|
case "insertText": {
|
|
18735
|
-
Gr === "insertFromComposition" && F.isComposing(a) && (st(!1), Ht.set(a, !1)), (nr == null ? void 0 : nr.constructor.name) === "DataTransfer" ? F.insertData(a, nr) : typeof nr == "string" && (
|
|
18735
|
+
Gr === "insertFromComposition" && F.isComposing(a) && (st(!1), Ht.set(a, !1)), (nr == null ? void 0 : nr.constructor.name) === "DataTransfer" ? F.insertData(a, nr) : typeof nr == "string" && (ji ? tt.current.push(() => d.insertText(a, nr)) : d.insertText(a, nr));
|
|
18736
18736
|
break;
|
|
18737
18737
|
}
|
|
18738
18738
|
}
|
|
@@ -18760,13 +18760,13 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
18760
18760
|
P(void 0);
|
|
18761
18761
|
}, [As]);
|
|
18762
18762
|
if (As) {
|
|
18763
|
-
var
|
|
18763
|
+
var Oi = d.start(a, []);
|
|
18764
18764
|
Kn.push({
|
|
18765
18765
|
[pr]: !0,
|
|
18766
18766
|
placeholder: o,
|
|
18767
18767
|
onPlaceholderResize: Ti,
|
|
18768
|
-
anchor:
|
|
18769
|
-
focus:
|
|
18768
|
+
anchor: Oi,
|
|
18769
|
+
focus: Oi
|
|
18770
18770
|
});
|
|
18771
18771
|
}
|
|
18772
18772
|
var {
|
|
@@ -18906,7 +18906,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
18906
18906
|
var me = Ar;
|
|
18907
18907
|
if (!(K.isElement(Br) && d.isBlock(a, Br))) {
|
|
18908
18908
|
var St, Lt = d.above(a, {
|
|
18909
|
-
match: (
|
|
18909
|
+
match: (ji) => K.isElement(ji) && d.isBlock(a, ji),
|
|
18910
18910
|
at: Ar
|
|
18911
18911
|
});
|
|
18912
18912
|
me = (St = Lt == null ? void 0 : Lt[1]) !== null && St !== void 0 ? St : Ar.slice(0, 1);
|
|
@@ -22015,13 +22015,13 @@ function pv(e, t, r) {
|
|
|
22015
22015
|
for (var zt in Lt) me[zt] = zt === "className" ? Vt(me[zt], Lt[zt]) : zt === "style" ? Qe(Qe({}, me[zt]), Lt[zt]) : Lt[zt];
|
|
22016
22016
|
}
|
|
22017
22017
|
return It.className && (me.className = Vt(me.className, It.className)), me;
|
|
22018
|
-
}(kt, p, As),
|
|
22019
|
-
for (var ln in Ti) Ti[ln] === void 0 || ln[0] === "$" || ln === "as" || ln === "theme" && Ti.theme === As || (ln === "forwardedAs" ? dl.as = Ti.forwardedAs : Kn && !Kn(ln,
|
|
22018
|
+
}(kt, p, As), Oi = Ti.as || Yn, dl = {};
|
|
22019
|
+
for (var ln in Ti) Ti[ln] === void 0 || ln[0] === "$" || ln === "as" || ln === "theme" && Ti.theme === As || (ln === "forwardedAs" ? dl.as = Ti.forwardedAs : Kn && !Kn(ln, Oi) || (dl[ln] = Ti[ln]));
|
|
22020
22020
|
var Dt = function(Ur, It) {
|
|
22021
22021
|
var Br = js(), Ar = Ur.generateAndInjectStyles(It, Br.styleSheet, Br.stylis);
|
|
22022
22022
|
return Ar;
|
|
22023
22023
|
}(Fr, Ti), ot = Vt(Is, Si);
|
|
22024
|
-
return Dt && (ot += " " + Dt), Ti.className && (ot += " " + Ti.className), dl[Ba(
|
|
22024
|
+
return Dt && (ot += " " + Dt), Ti.className && (ot += " " + Ti.className), dl[Ba(Oi) && !Ga.has(Oi) ? "class" : "className"] = ot, mt && (dl.ref = mt), createElement(Oi, dl);
|
|
22025
22025
|
}(nt, tt, N);
|
|
22026
22026
|
}
|
|
22027
22027
|
st.displayName = Ye;
|
|
@@ -23104,7 +23104,7 @@ const Fv = ut.div`
|
|
|
23104
23104
|
}, [t, r, h, l, Le]), Ti = () => pe.length === 0 ? /* @__PURE__ */ Y.jsxs(Sv, { theme: h, children: [
|
|
23105
23105
|
/* @__PURE__ */ Y.jsx("h3", { children: "\u6682\u65E0\u5185\u5BB9" }),
|
|
23106
23106
|
/* @__PURE__ */ Y.jsx("p", { children: "\u8BF7\u6DFB\u52A0\u4E00\u4E9B\u5185\u5BB9\u6765\u5F00\u59CB" })
|
|
23107
|
-
] }) : t ? /* @__PURE__ */ Y.jsx("div", { style: { height: Yn, position: "relative" }, children: Zn.map(As) }) : pe.map(As),
|
|
23107
|
+
] }) : t ? /* @__PURE__ */ Y.jsx("div", { style: { height: Yn, position: "relative" }, children: Zn.map(As) }) : pe.map(As), Oi = () => !kt && !o ? null : /* @__PURE__ */ Y.jsx(kv, { theme: h, children: o ? "\u52A0\u8F7D\u66F4\u591A\u5185\u5BB9..." : "\u52A0\u8F7D\u4E2D..." });
|
|
23108
23108
|
return /* @__PURE__ */ Y.jsx(
|
|
23109
23109
|
Fv,
|
|
23110
23110
|
{
|
|
@@ -23128,7 +23128,7 @@ const Fv = ut.div`
|
|
|
23128
23128
|
onScroll: Xn,
|
|
23129
23129
|
children: [
|
|
23130
23130
|
Ti(),
|
|
23131
|
-
|
|
23131
|
+
Oi()
|
|
23132
23132
|
]
|
|
23133
23133
|
}
|
|
23134
23134
|
)
|
|
@@ -23467,16 +23467,16 @@ const Fv = ut.div`
|
|
|
23467
23467
|
console.log("\u5F00\u59CB\u5E94\u7528\u6807\u6CE8...");
|
|
23468
23468
|
const Is = (Fr = u.current) == null ? void 0 : Fr.querySelectorAll(".md-annotation");
|
|
23469
23469
|
console.log("\u79FB\u9664\u73B0\u6709\u6807\u6CE8\u6570\u91CF:", (Is == null ? void 0 : Is.length) || 0), Is == null || Is.forEach((Ti) => {
|
|
23470
|
-
const
|
|
23471
|
-
|
|
23470
|
+
const Oi = Ti.parentNode;
|
|
23471
|
+
Oi && Oi.replaceChild(document.createTextNode(Ti.textContent || ""), Ti);
|
|
23472
23472
|
});
|
|
23473
23473
|
const Si = document.createTreeWalker(
|
|
23474
23474
|
u.current,
|
|
23475
23475
|
NodeFilter.SHOW_TEXT,
|
|
23476
23476
|
{
|
|
23477
23477
|
acceptNode: (Ti) => {
|
|
23478
|
-
var
|
|
23479
|
-
return (
|
|
23478
|
+
var Oi;
|
|
23479
|
+
return (Oi = Ti.parentElement) != null && Oi.closest("pre") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
23480
23480
|
}
|
|
23481
23481
|
}
|
|
23482
23482
|
), Yn = [];
|
|
@@ -23484,9 +23484,9 @@ const Fv = ut.div`
|
|
|
23484
23484
|
for (; Zn = Si.nextNode(); )
|
|
23485
23485
|
Yn.push(Zn);
|
|
23486
23486
|
if (console.log("\u627E\u5230\u6587\u672C\u8282\u70B9\u6570\u91CF:", Yn.length), Yn.length > 0) {
|
|
23487
|
-
const Ti = Yn[0],
|
|
23488
|
-
if (console.log("\u7B2C\u4E00\u4E2A\u6587\u672C\u8282\u70B9\u5185\u5BB9:",
|
|
23489
|
-
const dl =
|
|
23487
|
+
const Ti = Yn[0], Oi = Ti.textContent || "";
|
|
23488
|
+
if (console.log("\u7B2C\u4E00\u4E2A\u6587\u672C\u8282\u70B9\u5185\u5BB9:", Oi), Oi.length > 10) {
|
|
23489
|
+
const dl = Oi.slice(0, 10), ln = Oi.slice(10), Dt = document.createElement("span");
|
|
23490
23490
|
Dt.className = "md-annotation", Dt.style.backgroundColor = "#FF0000", Dt.textContent = dl;
|
|
23491
23491
|
const ot = document.createDocumentFragment();
|
|
23492
23492
|
ot.appendChild(Dt), ln && ot.appendChild(document.createTextNode(ln)), (ur = Ti.parentNode) == null || ur.replaceChild(ot, Ti), console.log("\u6210\u529F\u5E94\u7528\u6D4B\u8BD5\u6807\u6CE8:", dl);
|
|
@@ -23495,9 +23495,9 @@ const Fv = ut.div`
|
|
|
23495
23495
|
console.log("\u5F00\u59CB\u5E94\u7528\u771F\u6B63\u6807\u6CE8...");
|
|
23496
23496
|
let Xn = 0;
|
|
23497
23497
|
const Kn = Yn.map((Ti) => {
|
|
23498
|
-
var
|
|
23498
|
+
var Oi;
|
|
23499
23499
|
const dl = Xn;
|
|
23500
|
-
return Xn += ((
|
|
23500
|
+
return Xn += ((Oi = Ti.textContent) == null ? void 0 : Oi.length) || 0, {
|
|
23501
23501
|
node: Ti,
|
|
23502
23502
|
start: dl,
|
|
23503
23503
|
end: Xn,
|
|
@@ -23505,16 +23505,16 @@ const Fv = ut.div`
|
|
|
23505
23505
|
};
|
|
23506
23506
|
});
|
|
23507
23507
|
console.log("\u6587\u672C\u8282\u70B9\u4F4D\u7F6E:", Kn), console.log("\u603B\u6587\u672C\u957F\u5EA6:", Xn);
|
|
23508
|
-
const As = [...P].sort((Ti,
|
|
23508
|
+
const As = [...P].sort((Ti, Oi) => Oi.start - Ti.start);
|
|
23509
23509
|
console.log("\u6392\u5E8F\u540E\u7684\u6807\u6CE8:", As), As.forEach((Ti) => {
|
|
23510
|
-
const { start:
|
|
23510
|
+
const { start: Oi, end: dl, color: ln } = Ti;
|
|
23511
23511
|
console.log("\u5904\u7406\u6807\u6CE8:", { annotation: Ti, nodePositions: Kn });
|
|
23512
23512
|
const Dt = Kn.filter(
|
|
23513
|
-
(ot) =>
|
|
23513
|
+
(ot) => Oi < ot.end && dl > ot.start
|
|
23514
23514
|
);
|
|
23515
23515
|
console.log("\u76F8\u5173\u8282\u70B9\u6570\u91CF:", Dt.length), Dt.forEach(({ node: ot, start: Ur }) => {
|
|
23516
23516
|
var It, Br, Ar, me, St, Lt;
|
|
23517
|
-
const zt = Math.max(0,
|
|
23517
|
+
const zt = Math.max(0, Oi - Ur), sr = Math.min(((It = ot.textContent) == null ? void 0 : It.length) || 0, dl - Ur);
|
|
23518
23518
|
if (console.log("\u672C\u5730\u4F4D\u7F6E:", { localStart: zt, localEnd: sr, nodeTextLength: (Br = ot.textContent) == null ? void 0 : Br.length }), zt >= sr) {
|
|
23519
23519
|
console.log("\u672C\u5730\u4F4D\u7F6E\u65E0\u6548\uFF0C\u8DF3\u8FC7");
|
|
23520
23520
|
return;
|
|
@@ -23523,8 +23523,8 @@ const Fv = ut.div`
|
|
|
23523
23523
|
console.log("\u5206\u5272\u6587\u672C:", { before: un, annotatedText: Gr, after: nr });
|
|
23524
23524
|
const Un = document.createElement("span");
|
|
23525
23525
|
Un.className = "md-annotation", Un.style.backgroundColor = ln || "#FFE599", Un.textContent = Gr;
|
|
23526
|
-
const
|
|
23527
|
-
un &&
|
|
23526
|
+
const ji = document.createDocumentFragment();
|
|
23527
|
+
un && ji.appendChild(document.createTextNode(un)), ji.appendChild(Un), nr && ji.appendChild(document.createTextNode(nr)), (Lt = ot.parentNode) == null || Lt.replaceChild(ji, ot), console.log("\u6210\u529F\u5E94\u7528\u6807\u6CE8:", Gr);
|
|
23528
23528
|
});
|
|
23529
23529
|
});
|
|
23530
23530
|
};
|
|
@@ -23917,7 +23917,7 @@ const ZoomOut = createLucideIcon("ZoomOut", [
|
|
|
23917
23917
|
shadow: "md",
|
|
23918
23918
|
lineHeight: "md"
|
|
23919
23919
|
}
|
|
23920
|
-
}, Header = ({
|
|
23920
|
+
}, Header = React.memo(({
|
|
23921
23921
|
fileName: e = "\u672A\u77E5\u6587\u4EF6",
|
|
23922
23922
|
currentPage: t = 1,
|
|
23923
23923
|
totalPage: r = 0,
|
|
@@ -23944,7 +23944,7 @@ const ZoomOut = createLucideIcon("ZoomOut", [
|
|
|
23944
23944
|
className: a
|
|
23945
23945
|
}) => {
|
|
23946
23946
|
const pe = (s == null ? void 0 : s.theme) || defaultTheme$2;
|
|
23947
|
-
return /* @__PURE__ */ React.createElement(HeaderContainer, { $theme: pe, className: a }, /* @__PURE__ */ React.createElement(FileInfo, { $theme: pe }, /* @__PURE__ */ React.createElement(FileName, { $theme: pe }, e)), /* @__PURE__ */ React.createElement(ToolBar, { $theme: pe }, n.navigation && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
23947
|
+
return console.log("Header\u7EC4\u4EF6\u6E32\u67D3 - currentPage:", t, "totalPage:", r), /* @__PURE__ */ React.createElement(HeaderContainer, { $theme: pe, className: a }, /* @__PURE__ */ React.createElement(FileInfo, { $theme: pe }, /* @__PURE__ */ React.createElement(FileName, { $theme: pe }, e)), /* @__PURE__ */ React.createElement(ToolBar, { $theme: pe }, n.navigation && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
23948
23948
|
ToolButton,
|
|
23949
23949
|
{
|
|
23950
23950
|
$theme: pe,
|
|
@@ -24022,7 +24022,7 @@ const ZoomOut = createLucideIcon("ZoomOut", [
|
|
|
24022
24022
|
},
|
|
24023
24023
|
/* @__PURE__ */ React.createElement(X, { size: 16 })
|
|
24024
24024
|
)));
|
|
24025
|
-
}, ensurePDFWorkerRegistered = () => {
|
|
24025
|
+
}), ensurePDFWorkerRegistered = () => {
|
|
24026
24026
|
try {
|
|
24027
24027
|
if (pdfExports.GlobalWorkerOptions.workerSrc)
|
|
24028
24028
|
return;
|
|
@@ -24482,7 +24482,7 @@ const ErrorContainer$1 = dt.div`
|
|
|
24482
24482
|
}, [c]), Ti = useCallback(() => {
|
|
24483
24483
|
const Lt = Math.min(3, Fr + 0.1);
|
|
24484
24484
|
ur(Lt), As("zoom:change", { scale: Lt });
|
|
24485
|
-
}, [Fr, As]),
|
|
24485
|
+
}, [Fr, As]), Oi = useCallback(() => {
|
|
24486
24486
|
const Lt = Math.max(0.3, Fr - 0.1);
|
|
24487
24487
|
ur(Lt), As("zoom:change", { scale: Lt });
|
|
24488
24488
|
}, [Fr, As]), dl = useCallback(() => {
|
|
@@ -24653,7 +24653,7 @@ const ErrorContainer$1 = dt.div`
|
|
|
24653
24653
|
},
|
|
24654
24654
|
onZoomIn: St.zoom ? Ti : () => {
|
|
24655
24655
|
},
|
|
24656
|
-
onZoomOut: St.zoom ?
|
|
24656
|
+
onZoomOut: St.zoom ? Oi : () => {
|
|
24657
24657
|
},
|
|
24658
24658
|
onAnnotationToggle: St.annotation ? Dt : () => {
|
|
24659
24659
|
},
|
|
@@ -26574,126 +26574,126 @@ const ErrorContainer = dt.div`
|
|
|
26574
26574
|
headerClass: a,
|
|
26575
26575
|
contentClass: pe
|
|
26576
26576
|
}) => {
|
|
26577
|
-
const [st, nt] = useState(!0), [tt, N] = useState("\u6B63\u5728\u52A0\u8F7D\u6587\u6863..."), [P, p] = useState(null), [mt, kt] = useState(n), [Fr, ur] = useState(s || 0), [Is, Si] = useState(1), [Yn, Zn] = useState(null), [Xn, Kn] = useState(""), As = useRef({}), Ti = useRef({}),
|
|
26578
|
-
const
|
|
26579
|
-
return `${
|
|
26580
|
-
}, []),
|
|
26581
|
-
var
|
|
26582
|
-
console.log(`\u68C0\u67E5\u9875\u9762 ${
|
|
26583
|
-
const
|
|
26584
|
-
if (
|
|
26585
|
-
return console.log(`\u4F7F\u7528\u5355\u4E2A\u9875\u9762\u7F13\u5B58: ${
|
|
26586
|
-
const
|
|
26587
|
-
if (console.log(`\u68C0\u67E5chunk\u7F13\u5B58: ${
|
|
26588
|
-
if (
|
|
26589
|
-
return console.log(`\u4F7F\u7528chunk\u7F13\u5B58: ${
|
|
26590
|
-
console.log(`\u9875\u9762 ${
|
|
26591
|
-
}
|
|
26592
|
-
return console.log(`\u9875\u9762 ${
|
|
26593
|
-
}, [h,
|
|
26594
|
-
var
|
|
26577
|
+
const [st, nt] = useState(!0), [tt, N] = useState("\u6B63\u5728\u52A0\u8F7D\u6587\u6863..."), [P, p] = useState(null), [mt, kt] = useState(n), [Fr, ur] = useState(s || 0), [Is, Si] = useState(1), [Yn, Zn] = useState(null), [Xn, Kn] = useState(""), As = useRef({}), Ti = useRef({}), Oi = useRef(null), dl = useRef(null), ln = useRef(n), Dt = (de == null ? void 0 : de.theme) || defaultTheme, ot = useCallback((ki, Ri) => {
|
|
26578
|
+
const hl = Math.floor((ki - 1) / Ri) * Ri + 1;
|
|
26579
|
+
return `${hl}-${hl + Ri - 1}`;
|
|
26580
|
+
}, []), Ur = useCallback(async (ki) => {
|
|
26581
|
+
var Ri;
|
|
26582
|
+
console.log(`\u68C0\u67E5\u9875\u9762 ${ki} \u662F\u5426\u5728\u7F13\u5B58\u4E2D`);
|
|
26583
|
+
const hl = As.current[ki];
|
|
26584
|
+
if (hl && Date.now() - hl.timestamp < CACHE_EXPIRY_TIME)
|
|
26585
|
+
return console.log(`\u4F7F\u7528\u5355\u4E2A\u9875\u9762\u7F13\u5B58: ${ki}`), hl.pdfDocument ? (console.log(`\u76F4\u63A5\u8FD4\u56DE\u7F13\u5B58\u7684PDF\u6587\u6863: ${ki}`), hl.pdfDocument) : null;
|
|
26586
|
+
const Ha = ot(ki, h), Cl = Ti.current[Ha];
|
|
26587
|
+
if (console.log(`\u68C0\u67E5chunk\u7F13\u5B58: ${Ha}, \u5B58\u5728: ${!!Cl}, \u5305\u542B\u9875\u9762: ${((Ri = Cl == null ? void 0 : Cl.pages) == null ? void 0 : Ri.join(", ")) || "\u65E0"}`), Cl && Date.now() - Cl.timestamp < CACHE_EXPIRY_TIME) {
|
|
26588
|
+
if (Cl.pages.includes(ki))
|
|
26589
|
+
return console.log(`\u4F7F\u7528chunk\u7F13\u5B58: ${ki} (chunk: ${Ha})`), Cl.pdfDocument ? (console.log(`\u76F4\u63A5\u8FD4\u56DE\u7F13\u5B58\u7684PDF\u6587\u6863: ${ki}`), Cl.pdfDocument) : null;
|
|
26590
|
+
console.log(`\u9875\u9762 ${ki} \u4E0D\u5728chunk ${Ha} \u4E2D\uFF0Cchunk\u5305\u542B: ${Cl.pages.join(", ")}`);
|
|
26591
|
+
}
|
|
26592
|
+
return console.log(`\u9875\u9762 ${ki} \u4E0D\u5728\u4EFB\u4F55\u7F13\u5B58\u4E2D\uFF0C\u9700\u8981\u91CD\u65B0\u8BF7\u6C42`), null;
|
|
26593
|
+
}, [h, ot]), It = useCallback(async (ki) => {
|
|
26594
|
+
var Ri;
|
|
26595
26595
|
try {
|
|
26596
|
-
const
|
|
26597
|
-
console.log(`\u8BF7\u6C42chunk\u6570\u636E: ${
|
|
26598
|
-
const
|
|
26596
|
+
const hl = Math.floor((ki - 1) / h) * h + 1, Ha = ot(ki, h);
|
|
26597
|
+
console.log(`\u8BF7\u6C42chunk\u6570\u636E: ${hl} (\u5305\u542B\u9875\u9762 ${hl}-${hl + h - 1})`);
|
|
26598
|
+
const Cl = {
|
|
26599
26599
|
"Content-Type": "application/json"
|
|
26600
26600
|
};
|
|
26601
|
-
b && (
|
|
26602
|
-
const
|
|
26601
|
+
b && (Cl.Authorization = b);
|
|
26602
|
+
const Al = await axios.post(
|
|
26603
26603
|
l,
|
|
26604
26604
|
{
|
|
26605
26605
|
convertedFilePath: e,
|
|
26606
|
-
pageNo:
|
|
26606
|
+
pageNo: hl,
|
|
26607
26607
|
// 使用chunk的起始页
|
|
26608
26608
|
pageSize: h
|
|
26609
26609
|
},
|
|
26610
26610
|
{
|
|
26611
|
-
headers:
|
|
26611
|
+
headers: Cl,
|
|
26612
26612
|
responseType: "arraybuffer"
|
|
26613
26613
|
}
|
|
26614
|
-
),
|
|
26615
|
-
return Ti.current[
|
|
26616
|
-
data:
|
|
26617
|
-
pages:
|
|
26614
|
+
), bl = Array.from({ length: h }, (wl, xl) => hl + xl);
|
|
26615
|
+
return Ti.current[Ha] = {
|
|
26616
|
+
data: Al.data,
|
|
26617
|
+
pages: bl,
|
|
26618
26618
|
timestamp: Date.now(),
|
|
26619
26619
|
totalPages: s || Fr
|
|
26620
26620
|
// 优先使用用户传入的总页数
|
|
26621
|
-
}, console.log(`\u7F13\u5B58chunk\u6570\u636E: ${
|
|
26622
|
-
} catch (
|
|
26623
|
-
throw console.error("\u83B7\u53D6stream\u6570\u636E\u5931\u8D25:",
|
|
26621
|
+
}, console.log(`\u7F13\u5B58chunk\u6570\u636E: ${Ha}, \u5305\u542B\u9875\u9762: ${bl.join(", ")}, \u8BF7\u6C42\u7684\u9875\u9762: ${ki}`), console.log("\u5F53\u524D\u6240\u6709\u7F13\u5B58:", Object.keys(Ti.current)), Al.data;
|
|
26622
|
+
} catch (hl) {
|
|
26623
|
+
throw console.error("\u83B7\u53D6stream\u6570\u636E\u5931\u8D25:", hl), new Error(`\u8BF7\u6C42\u5931\u8D25: ${((Ri = hl.response) == null ? void 0 : Ri.status) || "\u7F51\u7EDC\u9519\u8BEF"}`);
|
|
26624
26624
|
}
|
|
26625
|
-
}, [l, e, h, b,
|
|
26626
|
-
var
|
|
26627
|
-
if (
|
|
26625
|
+
}, [l, e, h, b, ot, s, Fr]), Br = useCallback(async (ki, Ri = !1) => {
|
|
26626
|
+
var hl;
|
|
26627
|
+
if (ki)
|
|
26628
26628
|
try {
|
|
26629
|
-
|
|
26630
|
-
const
|
|
26631
|
-
if (
|
|
26632
|
-
return console.log(`\u4F7F\u7528\u7F13\u5B58\u7684PDF\u6587\u6863: ${
|
|
26633
|
-
const
|
|
26629
|
+
Ri ? (nt(!0), N("\u6B63\u5728\u52A0\u8F7D\u6587\u6863...")) : (nt(!0), N(`\u6B63\u5728\u52A0\u8F7D\u7B2C ${ki} \u9875...`)), p(null), console.log(`\u5F00\u59CB\u52A0\u8F7D\u9875\u9762: ${ki}, \u521D\u59CB\u52A0\u8F7D: ${Ri}`);
|
|
26630
|
+
const Ha = await Ur(ki);
|
|
26631
|
+
if (Ha)
|
|
26632
|
+
return console.log(`\u4F7F\u7528\u7F13\u5B58\u7684PDF\u6587\u6863: ${ki}`), Zn(Ha), nt(!1), N(""), console.log(`\u9875\u9762 ${ki} \u52A0\u8F7D\u5B8C\u6210\uFF08\u4F7F\u7528\u7F13\u5B58\uFF09`), Ha;
|
|
26633
|
+
const Cl = await It(ki), Al = await parseFile(Cl, {
|
|
26634
26634
|
fileName: t || "Stream\u6587\u6863",
|
|
26635
26635
|
fileType: "pdf",
|
|
26636
26636
|
token: b
|
|
26637
26637
|
});
|
|
26638
|
-
if (
|
|
26639
|
-
throw new Error(
|
|
26640
|
-
if (
|
|
26638
|
+
if (Al.error)
|
|
26639
|
+
throw new Error(Al.error);
|
|
26640
|
+
if (Al.type !== "pdf" || !((hl = Al.content) != null && hl.document))
|
|
26641
26641
|
throw new Error("\u89E3\u6790\u7ED3\u679C\u4E0D\u662F\u6709\u6548\u7684PDF\u6587\u6863");
|
|
26642
|
-
const
|
|
26643
|
-
console.log("\u8BBE\u7F6EPDF\u6587\u6863:",
|
|
26644
|
-
const
|
|
26645
|
-
return Ti.current[
|
|
26646
|
-
} catch (
|
|
26647
|
-
throw console.error("PDF\u52A0\u8F7D\u5931\u8D25:",
|
|
26642
|
+
const bl = Al.content.document;
|
|
26643
|
+
console.log("\u8BBE\u7F6EPDF\u6587\u6863:", bl), console.log("PDF\u6587\u6863\u7C7B\u578B:", typeof bl), console.log("PDF\u6587\u6863\u65B9\u6CD5:", bl ? Object.getOwnPropertyNames(Object.getPrototypeOf(bl)) : "\u65E0\u6587\u6863"), console.log("PDF\u6587\u6863\u9875\u6570:", bl ? bl.numPages : "\u65E0\u9875\u6570"), console.log("\u5F53\u524D\u8BF7\u6C42\u7684\u9875\u9762:", ki), console.log("PDF\u6587\u6863\u5305\u542B\u7684\u9875\u9762\u8303\u56F4:", bl ? `1-${bl.numPages}` : "\u65E0\u9875\u6570"), Zn(bl);
|
|
26644
|
+
const wl = ot(ki, h);
|
|
26645
|
+
return Ti.current[wl] && (Ti.current[wl].pdfDocument = bl, console.log(`\u7F13\u5B58PDF\u6587\u6863\u5230chunk: ${wl}`)), nt(!1), N(""), console.log(`\u9875\u9762 ${ki} \u52A0\u8F7D\u5B8C\u6210`), bl;
|
|
26646
|
+
} catch (Ha) {
|
|
26647
|
+
throw console.error("PDF\u52A0\u8F7D\u5931\u8D25:", Ha), p(Ha.message || "PDF\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"), nt(!1), N(""), Ha;
|
|
26648
26648
|
}
|
|
26649
|
-
}, [
|
|
26650
|
-
const
|
|
26651
|
-
if (
|
|
26652
|
-
return !!
|
|
26653
|
-
const
|
|
26654
|
-
return
|
|
26655
|
-
}, [h,
|
|
26649
|
+
}, [It, t, b, Fr, Ur, ot, h]), Ar = useCallback((ki) => {
|
|
26650
|
+
const Ri = As.current[ki];
|
|
26651
|
+
if (Ri && Date.now() - Ri.timestamp < CACHE_EXPIRY_TIME)
|
|
26652
|
+
return !!Ri.pdfDocument;
|
|
26653
|
+
const hl = ot(ki, h), Ha = Ti.current[hl];
|
|
26654
|
+
return Ha && Date.now() - Ha.timestamp < CACHE_EXPIRY_TIME ? Ha.pages.includes(ki) && !!Ha.pdfDocument : !1;
|
|
26655
|
+
}, [h, ot]), me = useCallback(() => {
|
|
26656
26656
|
console.log("\u68C0\u67E5markdown\u5185\u5BB9\u662F\u5426\u5728\u7F13\u5B58\u4E2D");
|
|
26657
|
-
const
|
|
26658
|
-
return
|
|
26659
|
-
}, []),
|
|
26660
|
-
var
|
|
26657
|
+
const ki = Oi.current;
|
|
26658
|
+
return ki && Date.now() - ki.timestamp < CACHE_EXPIRY_TIME ? (console.log("\u4F7F\u7528markdown\u5185\u5BB9\u7F13\u5B58"), ki.data) : (console.log("markdown\u5185\u5BB9\u4E0D\u5728\u7F13\u5B58\u4E2D\uFF0C\u9700\u8981\u91CD\u65B0\u8BF7\u6C42"), null);
|
|
26659
|
+
}, []), St = useCallback(async () => {
|
|
26660
|
+
var ki;
|
|
26661
26661
|
try {
|
|
26662
26662
|
console.log("\u8BF7\u6C42\u5B8C\u6574markdown\u6570\u636E");
|
|
26663
|
-
const
|
|
26663
|
+
const Ri = {
|
|
26664
26664
|
"Content-Type": "application/json"
|
|
26665
26665
|
};
|
|
26666
|
-
b && (
|
|
26667
|
-
const
|
|
26666
|
+
b && (Ri.Authorization = b);
|
|
26667
|
+
const hl = {
|
|
26668
26668
|
convertedFilePath: e
|
|
26669
26669
|
// 不传pageNo和pageSize,获取完整文章
|
|
26670
26670
|
};
|
|
26671
|
-
console.log("\u53D1\u9001markdown\u8BF7\u6C42:",
|
|
26672
|
-
const
|
|
26673
|
-
headers:
|
|
26671
|
+
console.log("\u53D1\u9001markdown\u8BF7\u6C42:", hl);
|
|
26672
|
+
const Ha = await axios.post(l, hl, {
|
|
26673
|
+
headers: Ri,
|
|
26674
26674
|
responseType: "text"
|
|
26675
26675
|
// markdown返回文本
|
|
26676
26676
|
});
|
|
26677
|
-
return console.log("markdown\u54CD\u5E94\u72B6\u6001:",
|
|
26678
|
-
} catch (
|
|
26679
|
-
throw console.error("\u83B7\u53D6markdown\u6570\u636E\u5931\u8D25:",
|
|
26677
|
+
return console.log("markdown\u54CD\u5E94\u72B6\u6001:", Ha.status), console.log("markdown\u54CD\u5E94\u6570\u636E\u957F\u5EA6:", ((ki = Ha.data) == null ? void 0 : ki.length) || 0), Ha.data;
|
|
26678
|
+
} catch (Ri) {
|
|
26679
|
+
throw console.error("\u83B7\u53D6markdown\u6570\u636E\u5931\u8D25:", Ri), new Error(`\u83B7\u53D6markdown\u6570\u636E\u5931\u8D25: ${Ri.message}`);
|
|
26680
26680
|
}
|
|
26681
|
-
}, [e, b, l]),
|
|
26681
|
+
}, [e, b, l]), Lt = useCallback(async () => {
|
|
26682
26682
|
try {
|
|
26683
26683
|
nt(!0), N("\u6B63\u5728\u52A0\u8F7Dmarkdown\u6587\u6863..."), p(null), console.log("\u5F00\u59CB\u52A0\u8F7D\u5B8C\u6574markdown\u6587\u6863");
|
|
26684
|
-
const
|
|
26685
|
-
if (
|
|
26686
|
-
return console.log("\u4F7F\u7528\u7F13\u5B58\u7684markdown\u5185\u5BB9"), Kn(
|
|
26687
|
-
const
|
|
26688
|
-
return
|
|
26689
|
-
data:
|
|
26684
|
+
const ki = me();
|
|
26685
|
+
if (ki)
|
|
26686
|
+
return console.log("\u4F7F\u7528\u7F13\u5B58\u7684markdown\u5185\u5BB9"), Kn(ki), nt(!1), N(""), ki;
|
|
26687
|
+
const Ri = await St();
|
|
26688
|
+
return Oi.current = {
|
|
26689
|
+
data: Ri,
|
|
26690
26690
|
timestamp: Date.now()
|
|
26691
|
-
}, Kn(
|
|
26692
|
-
} catch (
|
|
26693
|
-
throw console.error("markdown\u52A0\u8F7D\u5931\u8D25:",
|
|
26691
|
+
}, Kn(Ri), nt(!1), N(""), console.log("\u5B8C\u6574markdown\u6587\u6863\u52A0\u8F7D\u5B8C\u6210"), Ri;
|
|
26692
|
+
} catch (ki) {
|
|
26693
|
+
throw console.error("markdown\u52A0\u8F7D\u5931\u8D25:", ki), p(ki.message || "markdown\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"), nt(!1), N(""), ki;
|
|
26694
26694
|
}
|
|
26695
|
-
}, [
|
|
26696
|
-
if (
|
|
26695
|
+
}, [St, me]), zt = useCallback(async (ki) => {
|
|
26696
|
+
if (ki !== ln.current) {
|
|
26697
26697
|
if (st) {
|
|
26698
26698
|
console.log("\u9875\u9762\u6B63\u5728\u52A0\u8F7D\u4E2D\uFF0C\u5FFD\u7565\u7FFB\u9875\u8BF7\u6C42");
|
|
26699
26699
|
return;
|
|
@@ -26702,71 +26702,79 @@ const ErrorContainer = dt.div`
|
|
|
26702
26702
|
console.log("Markdown\u6587\u4EF6\u4E0D\u652F\u6301\u7FFB\u9875\uFF0C\u4F7F\u7528\u65E0\u9650\u6EDA\u52A8");
|
|
26703
26703
|
return;
|
|
26704
26704
|
}
|
|
26705
|
-
console.log("\u9875\u9762\u53D8\u5316:",
|
|
26705
|
+
console.log("\u9875\u9762\u53D8\u5316:", ki, "\u5F53\u524D\u9875:", ln.current), console.log(`\u9875\u9762 ${ki} \u662F\u5426\u5728\u7F13\u5B58\u4E2D:`, Ar(ki)), ln.current = ki, kt(ki);
|
|
26706
26706
|
try {
|
|
26707
|
-
await
|
|
26708
|
-
} catch (
|
|
26709
|
-
console.error("\u9875\u9762\u52A0\u8F7D\u5931\u8D25:",
|
|
26707
|
+
await Br(ki, !1), Ye("pageChange", { pageNumber: ki, totalPages: Fr });
|
|
26708
|
+
} catch (Ri) {
|
|
26709
|
+
console.error("\u9875\u9762\u52A0\u8F7D\u5931\u8D25:", Ri);
|
|
26710
|
+
const hl = ln.current;
|
|
26711
|
+
kt(hl);
|
|
26710
26712
|
}
|
|
26711
26713
|
}
|
|
26712
|
-
}, [
|
|
26713
|
-
|
|
26714
|
-
|
|
26715
|
-
|
|
26714
|
+
}, [Br, Fr, Ye, Ar, st, r]);
|
|
26715
|
+
useEffect(() => {
|
|
26716
|
+
ln.current = mt, console.log("\u5F53\u524D\u9875\u72B6\u6001\u66F4\u65B0:", mt);
|
|
26717
|
+
}, [mt]);
|
|
26718
|
+
const sr = useCallback((ki) => {
|
|
26719
|
+
Si(ki), Ye("zoomChange", { scale: ki });
|
|
26716
26720
|
}, [Ye]), un = useCallback(() => {
|
|
26717
|
-
|
|
26718
|
-
|
|
26719
|
-
|
|
26720
|
-
|
|
26721
|
-
|
|
26722
|
-
|
|
26723
|
-
|
|
26724
|
-
}, [
|
|
26725
|
-
|
|
26726
|
-
|
|
26727
|
-
|
|
26728
|
-
|
|
26729
|
-
|
|
26730
|
-
|
|
26731
|
-
|
|
26732
|
-
|
|
26733
|
-
|
|
26734
|
-
|
|
26735
|
-
|
|
26721
|
+
Ye("viewer:close");
|
|
26722
|
+
}, [Ye]), Gr = useCallback(() => {
|
|
26723
|
+
const ki = Math.min(3, Is + 0.1);
|
|
26724
|
+
sr(ki);
|
|
26725
|
+
}, [Is, sr]), nr = useCallback(() => {
|
|
26726
|
+
const ki = Math.max(0.3, Is - 0.1);
|
|
26727
|
+
sr(ki);
|
|
26728
|
+
}, [Is, sr]), Un = useCallback(() => {
|
|
26729
|
+
const ki = ln.current - 1;
|
|
26730
|
+
ki >= 1 && zt(ki);
|
|
26731
|
+
}, [zt]), ji = useCallback(() => {
|
|
26732
|
+
const ki = ln.current + 1;
|
|
26733
|
+
Fr && ki <= Fr && zt(ki);
|
|
26734
|
+
}, [Fr, zt]), qs = useCallback(() => {
|
|
26735
|
+
const ki = Date.now();
|
|
26736
|
+
Object.keys(As.current).forEach((Ri) => {
|
|
26737
|
+
const hl = As.current[parseInt(Ri)];
|
|
26738
|
+
ki - hl.timestamp > CACHE_EXPIRY_TIME && (delete As.current[parseInt(Ri)], console.log(`\u6E05\u7406\u8FC7\u671F\u9875\u9762\u7F13\u5B58: ${Ri}`));
|
|
26739
|
+
}), Object.keys(Ti.current).forEach((Ri) => {
|
|
26740
|
+
const hl = Ti.current[Ri];
|
|
26741
|
+
ki - hl.timestamp > CACHE_EXPIRY_TIME && (delete Ti.current[Ri], console.log(`\u6E05\u7406\u8FC7\u671Fchunk\u7F13\u5B58: ${Ri}`));
|
|
26742
|
+
}), Oi.current && ki - Oi.current.timestamp > CACHE_EXPIRY_TIME && (Oi.current = null, console.log("\u6E05\u7406\u8FC7\u671Fmarkdown\u5185\u5BB9\u7F13\u5B58"));
|
|
26743
|
+
}, []), Pi = useCallback(() => {
|
|
26736
26744
|
if (t) return t;
|
|
26737
26745
|
try {
|
|
26738
|
-
const
|
|
26739
|
-
return decodeURIComponent(
|
|
26746
|
+
const ki = new URL(e);
|
|
26747
|
+
return decodeURIComponent(ki.pathname.split("/").pop() || "") || "Stream\u6587\u6863";
|
|
26740
26748
|
} catch {
|
|
26741
|
-
const
|
|
26742
|
-
return decodeURIComponent(
|
|
26749
|
+
const ki = e.split("/");
|
|
26750
|
+
return decodeURIComponent(ki[ki.length - 1]) || "Stream\u6587\u6863";
|
|
26743
26751
|
}
|
|
26744
26752
|
}, [e, t]);
|
|
26745
26753
|
return useEffect(() => {
|
|
26746
|
-
const
|
|
26747
|
-
return () => clearInterval(
|
|
26748
|
-
}, [
|
|
26749
|
-
As.current = {}, Ti.current = {},
|
|
26754
|
+
const ki = setInterval(qs, CACHE_EXPIRY_TIME);
|
|
26755
|
+
return () => clearInterval(ki);
|
|
26756
|
+
}, [qs]), useEffect(() => () => {
|
|
26757
|
+
As.current = {}, Ti.current = {}, Oi.current = null, console.log("\u7EC4\u4EF6\u5378\u8F7D\uFF0C\u6E05\u7406\u6240\u6709\u7F13\u5B58");
|
|
26750
26758
|
}, []), useEffect(() => {
|
|
26751
26759
|
n && (async () => {
|
|
26752
26760
|
try {
|
|
26753
|
-
console.log("\u5F00\u59CB\u521D\u59CB\u52A0\u8F7D\uFF0C\u6587\u4EF6\u7C7B\u578B:", r, "\u521D\u59CB\u5757/\u9875:", n), r === "markdown" ? (await
|
|
26761
|
+
console.log("\u5F00\u59CB\u521D\u59CB\u52A0\u8F7D\uFF0C\u6587\u4EF6\u7C7B\u578B:", r, "\u521D\u59CB\u5757/\u9875:", n), r === "markdown" ? (await Lt(), kt(n), Ye("pageChange", { pageNumber: n, totalPages: Fr })) : (await Br(n, !0), kt(n), setTimeout(() => {
|
|
26754
26762
|
Ye("pageChange", { pageNumber: n, totalPages: Fr });
|
|
26755
26763
|
}, 0));
|
|
26756
|
-
} catch (
|
|
26757
|
-
console.error("\u521D\u59CB\u52A0\u8F7D\u5931\u8D25:",
|
|
26764
|
+
} catch (Ri) {
|
|
26765
|
+
console.error("\u521D\u59CB\u52A0\u8F7D\u5931\u8D25:", Ri);
|
|
26758
26766
|
}
|
|
26759
26767
|
})();
|
|
26760
|
-
}, [n, r,
|
|
26768
|
+
}, [n, r, Br, Lt, Ye, Fr]), P ? /* @__PURE__ */ React.createElement(ReaderContainer, { $theme: Dt, className: u }, E != null && E.ErrorComponent ? /* @__PURE__ */ React.createElement(
|
|
26761
26769
|
E.ErrorComponent,
|
|
26762
26770
|
{
|
|
26763
26771
|
error: P,
|
|
26764
|
-
theme:
|
|
26772
|
+
theme: Dt
|
|
26765
26773
|
}
|
|
26766
|
-
) : /* @__PURE__ */ React.createElement(ErrorContainer, { $theme:
|
|
26774
|
+
) : /* @__PURE__ */ React.createElement(ErrorContainer, { $theme: Dt }, /* @__PURE__ */ React.createElement("div", null, "\u52A0\u8F7D\u5931\u8D25"), /* @__PURE__ */ React.createElement("div", { style: { fontSize: "12px", marginTop: "8px" } }, P))) : st ? /* @__PURE__ */ React.createElement(ReaderContainer, { $theme: Dt, className: u }, /* @__PURE__ */ React.createElement(
|
|
26767
26775
|
Header,
|
|
26768
26776
|
{
|
|
26769
|
-
fileName:
|
|
26777
|
+
fileName: Pi(),
|
|
26770
26778
|
currentPage: mt,
|
|
26771
26779
|
totalPage: Fr,
|
|
26772
26780
|
scale: Is,
|
|
@@ -26785,25 +26793,25 @@ const ErrorContainer = dt.div`
|
|
|
26785
26793
|
},
|
|
26786
26794
|
onDownload: () => {
|
|
26787
26795
|
},
|
|
26788
|
-
onClose:
|
|
26796
|
+
onClose: un,
|
|
26789
26797
|
className: a
|
|
26790
26798
|
}
|
|
26791
26799
|
), E != null && E.LoadingComponent ? /* @__PURE__ */ React.createElement(
|
|
26792
26800
|
E.LoadingComponent,
|
|
26793
26801
|
{
|
|
26794
26802
|
status: tt,
|
|
26795
|
-
theme:
|
|
26803
|
+
theme: Dt
|
|
26796
26804
|
}
|
|
26797
26805
|
) : /* @__PURE__ */ React.createElement(
|
|
26798
26806
|
DefaultLoadingComponent,
|
|
26799
26807
|
{
|
|
26800
26808
|
status: tt,
|
|
26801
|
-
theme:
|
|
26809
|
+
theme: Dt
|
|
26802
26810
|
}
|
|
26803
|
-
)) : /* @__PURE__ */ React.createElement(ReaderContainer, { $theme:
|
|
26811
|
+
)) : /* @__PURE__ */ React.createElement(ReaderContainer, { $theme: Dt, className: u }, /* @__PURE__ */ React.createElement(
|
|
26804
26812
|
Header,
|
|
26805
26813
|
{
|
|
26806
|
-
fileName:
|
|
26814
|
+
fileName: Pi(),
|
|
26807
26815
|
currentPage: mt,
|
|
26808
26816
|
totalPage: Fr,
|
|
26809
26817
|
scale: Is,
|
|
@@ -26814,15 +26822,15 @@ const ErrorContainer = dt.div`
|
|
|
26814
26822
|
navigation: r !== "markdown" ? Le.navigation : !1
|
|
26815
26823
|
},
|
|
26816
26824
|
styles: de,
|
|
26817
|
-
onPrevPage:
|
|
26818
|
-
onNextPage:
|
|
26819
|
-
onZoomIn:
|
|
26820
|
-
onZoomOut:
|
|
26825
|
+
onPrevPage: Un,
|
|
26826
|
+
onNextPage: ji,
|
|
26827
|
+
onZoomIn: Gr,
|
|
26828
|
+
onZoomOut: nr,
|
|
26821
26829
|
onAnnotationToggle: () => {
|
|
26822
26830
|
},
|
|
26823
26831
|
onDownload: () => {
|
|
26824
26832
|
},
|
|
26825
|
-
onClose:
|
|
26833
|
+
onClose: un,
|
|
26826
26834
|
className: a
|
|
26827
26835
|
}
|
|
26828
26836
|
), r === "markdown" ? (
|
|
@@ -26845,7 +26853,7 @@ const ErrorContainer = dt.div`
|
|
|
26845
26853
|
data: {
|
|
26846
26854
|
content: { text: Xn },
|
|
26847
26855
|
// 使用text字段,符合Markdownit的期望
|
|
26848
|
-
...
|
|
26856
|
+
...Pi() && { fileName: Pi() },
|
|
26849
26857
|
...r && { fileType: r },
|
|
26850
26858
|
...Fr && { totalPages: Fr }
|
|
26851
26859
|
},
|
|
@@ -26853,8 +26861,8 @@ const ErrorContainer = dt.div`
|
|
|
26853
26861
|
totalPage: Fr,
|
|
26854
26862
|
currentPage: mt,
|
|
26855
26863
|
scale: Is,
|
|
26856
|
-
eventsEmit: (
|
|
26857
|
-
console.log("Fviewer\u4E8B\u4EF6:",
|
|
26864
|
+
eventsEmit: (ki, Ri) => {
|
|
26865
|
+
console.log("Fviewer\u4E8B\u4EF6:", ki, Ri), Ye(ki === "md_annotation_add" ? "md_annotation_add" : ki, Ri);
|
|
26858
26866
|
},
|
|
26859
26867
|
styles: de,
|
|
26860
26868
|
tools: Le,
|
|
@@ -26872,7 +26880,7 @@ const ErrorContainer = dt.div`
|
|
|
26872
26880
|
data: {
|
|
26873
26881
|
content: { document: Yn },
|
|
26874
26882
|
// 修复:包装成期望的数据结构
|
|
26875
|
-
...
|
|
26883
|
+
...Pi() && { fileName: Pi() },
|
|
26876
26884
|
...r && { fileType: r },
|
|
26877
26885
|
...Fr && { totalPages: Fr },
|
|
26878
26886
|
// 添加PDF起始页信息,用于分页PDF的页码映射
|