Program
Program
"use strict";
function e(e, t) {
if (!e) {
throw function() {
return [Link],
return e
constructor() {
this.data_ = null
set data(t) {
this.data_ = t
valueExists(e) {
getValue(t) {
const i = this.data_[t];
return e(void 0 !== i, "Could not find value for " + t),
getString(t) {
const i = [Link](t);
getStringF(e, ...t) {
const i = [Link](e);
substituteString(t, ...i) {
"$$" === t)
return "$";
))
}
getSubstitutedStringPieces(t, ...i) {
if ()
arg: null
};
return null == n ? {
value: "",
arg: t
}:{
value: [Link](),
arg: t
))
getBoolean(t) {
const i = [Link](t);
getInteger(t) {
const i = [Link](t);
overrideValues(t) {
for (const e in t)
this.data_[e] = t[e]
resetForTesting(e=null) {
this.data_ = e
isInitialized() {
[Link](window, {
loadTimeData: t
});
, n = ([Link]("Win"),
-1 !== [Link]("MacIntel") && [Link],
[Link]("Android"),
i ? "metaKey" : "ctrlKey");
function o(e, t) {
e = [Link];
return "Tab" !== t && ([Link] || "INPUT" === [Link] || "TEXTAREA" ===
[Link])
function a(e, t, i) {
if ([Link] >= "0" && [Link] <= "9" && !([Link] || s(e) || [Link]))
return !0;
return !1
}(e) && "Enter" !== [Link] && "Backspace" !== [Link] : i && "Escape" !== [Link] &&
!function(e) {
switch ([Link]) {
case "PageUp":
case "PageDown":
case "ArrowUp":
case "ArrowDown":
case "ArrowLeft":
case "ArrowRight":
return !0;
default:
return !1
}
}(e)
function s(e) {
return e[n]
class r {
constructor(e) {
this.element_ = void 0,
this.pinchStartEvent_ = void 0,
this.swipeStartEvent_ = void 0,
this.lastTouchTouchesCount_ = void 0,
this.lastEvent_ = void 0,
this.accumulatedWheelScale_ = void 0,
this.wheelEndTimeout_ = void 0,
this.eventTarget_ = void 0,
this.element_ = e,
this.element_.addEventListener("touchstart", this.onTouchStart_.bind(this), {
passive: !0
});
const t = this.onTouch_.bind(this);
this.element_.addEventListener("touchmove", t, {
passive: !0
}),
this.element_.addEventListener("touchend", t, {
passive: !0
}),
this.element_.addEventListener("touchcancel", t, {
passive: !0
}),
this.element_.addEventListener("wheel", this.onWheel_.bind(this), {
passive: !1
}),
this.pinchStartEvent_ = null,
this.swipeStartEvent_ = null,
this.lastTouchTouchesCount_ = 0,
this.lastEvent_ = null,
this.accumulatedWheelScale_ = null,
this.wheelEndTimeout_ = null,
getEventTarget() {
return this.eventTarget_
wasTwoFingerTouch() {
}
notify_(e, t) {
this.eventTarget_.dispatchEvent(new CustomEvent(e,{
detail: t
}))
onTouchStart_(e) {
this.lastTouchTouchesCount_ = [Link],
[Link]() ? (this.lastEvent_ = e,
this.pinchStartEvent_ = e,
this.notify_("pinchstart", {
center: r.center_(e)
onTouch_(e) {
if (this.pinchStartEvent_) {
const t = this.lastEvent_;
, i = r.center_(t);
this.lastEvent_ = null,
void this.notify_("pinchend", {
startScaleRatio: e,
center: i
})
}
const i = r.pinchScaleRatio_(e, t)
, n = r.pinchScaleRatio_(e, this.pinchStartEvent_)
, o = r.center_(e);
this.notify_("pinchupdate", {
scaleRatio: i,
startScaleRatio: n,
center: o
}),
this.lastEvent_ = e
} else if (this.swipeStartEvent_) {
,i={
x: this.swipeStartEvent_.touches[0].clientX,
y: this.swipeStartEvent_.touches[0].clientY
};
center: i
}),
center: i
}),
this.swipeStartEvent_ = null)
onWheel_(e) {
if (![Link]) {
let t = "";
return [Link] > 0 ? t = "down" : [Link] < 0 ? t = "up" : [Link] > 0 ? t = "left" :
[Link] < 0 && (t = "right"),
void this.notify_("wheel", {
center: {
x: [Link],
y: [Link]
},
direction: t
})
[Link]();
,n={
x: [Link],
y: [Link]
};
this.notify_("pinchstart", {
center: n
})),
this.accumulatedWheelScale_ *= i,
this.notify_("pinchupdate", {
scaleRatio: i,
startScaleRatio: this.accumulatedWheelScale_,
center: n
}),
this.wheelEndTimeout_ = null);
const o = {
startScaleRatio: this.accumulatedWheelScale_,
center: n
};
this.notify_("pinchend", o),
this.wheelEndTimeout_ = null,
this.accumulatedWheelScale_ = null
), 100)
handleContextMenuEvent_(e) {
static pinchScaleRatio_(e, t) {
const i = r.distance_(t)
, n = r.distance_(e);
static distance_(e) {
const t = [Link][0]
, i = [Link][1]
, n = [Link] - [Link]
, o = [Link] - [Link];
return [Link](n * n + o * o)
static panDistance_(e, t) {
const i = [Link][0]
, n = [Link][0];
return {
x: [Link] - [Link],
y: [Link] - [Link]
static center_(e) {
const t = [Link][0]
, i = [Link][1];
return {
x: ([Link] + [Link]) / 2,
y: ([Link] + [Link]) / 2
}
}
function l(e) {
for (const n of e) {
var i;
const e = [Link]()
if ([Link]) {
return [Link]("\n")
let h;
function d(e, t) {
let i;
class c {
recordValue(e, t) {
var i;
null === (i = this.plugin_) || void 0 === i || [Link]({
type: "metricsRecordValue",
metric: e,
value: t
})
recordTime(e, t) {
var i;
type: "metricsRecordTime",
metricName: e,
metricValue: t
})
recordUserAction(e) {
var t;
type: "metricsRecordUserAction",
metricName: e
})
constructor(e) {
this.plugin_ = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
[Link] = void 0,
this.plugin_ = e
let g = function(e) {
e[e.DUAL_PAGE = 1] = "DUAL_PAGE",
}({})
, u = function(e) {
e[[Link] = 1] = "DISCRETE",
e
}({});
class p {
[Link] = p;
var _ = function(e) {
e[[Link] = 1] = "CoverPage",
e[[Link] = 2] = "RightPageInPair",
e[[Link] = 3] = "LeftPageInPair",
e[[Link] = 4] = "LastSinglePage",
}(_ || {});
class v extends p {
constructor(e, t, i) {
super(),
this.coverPageEnabled_ = !1,
this.isRTL_ = !0,
this.pageCount_ = 0,
this.coverPageEnabled_ = e,
this.isRTL_ = t,
this.pageCount_ = i
getLayoutType() {
return g.DUAL_PAGE
}
getAnnotationOverlayBufferCount() {
return [Link]
getSkeletalPageBufferCount() {
return [Link]
getPageType(e) {
const t = this.coverPageEnabled_;
getPageSet(e) {
switch ([Link](e)) {
case _.CoverPage:
case _.LastSinglePage:
return [e];
case _.LeftPageInPair:
case _.RightPageInPair:
return [e - 1, e];
case _.InvalidPage:
return null;
default:
}
getShadowsForPage(e) {
switch ([Link](e)) {
case _.CoverPage:
case _.LastSinglePage:
case _.LeftPageInPair:
case _.RightPageInPair:
return [Link];
default:
getNumberOfPagesInPageSet() {
return [Link]
isCoverPageEnabled() {
return this.coverPageEnabled_
[Link] = 4,
[Link] = 10,
[Link] = 2,
[Link] = {
top: 3,
bottom: 7,
left: 5,
right: 5
},
[Link] = v;
class m extends p {
getLayoutType() {
return g.SINGLE_PAGE
getAnnotationOverlayBufferCount() {
return [Link]
getSkeletalPageBufferCount() {
return [Link]
getPageSet(e) {
return [e]
getShadowsForPage() {
return [Link]
getNumberOfPagesInPageSet() {
return [Link]
[Link] = 2,
[Link] = 5,
[Link] = 1,
[Link] = {
top: 3,
bottom: 7,
left: 5,
right: 5
},
[Link] = m;
let f = function(e) {
e[[Link] = 1] = "INKING",
e[[Link] = 2] = "ERASING",
e[[Link] = 3] = "HIGHLIGHTING",
e[e.ADDING_FREE_TEXT = 4] = "ADDING_FREE_TEXT",
}({});
class y {
constructor(e, t, i) {
[Link] = e => {
this.enableFreeFormHighlight_(this.viewport_.getPageAtYScreenCoordinate_([Link]))) :
this.highlightModePluginPointerEvents_ = [e]
[Link] = e => {
[Link] = () => {
this.highlightModePluginPointerEvents_ = []
[Link] = e => {
const t = this.viewport_.pluginToFrameCoordinate({
x: [Link],
y: [Link]
})
, i = new PointerEvent([Link],{
pointerType: [Link],
pointerId: [Link],
isPrimary: [Link],
clientX: t.x,
clientY: t.y,
altKey: [Link],
button: [Link],
ctrlKey: [Link],
metaKey: [Link],
shiftKey: [Link],
view: window
});
switch ([Link]) {
case "pointerdown":
this.annotationMode_ === [Link] &&
[Link](i);
break;
case "pointermove":
break;
case "pointerup":
this.plugin_ = e,
this.pdfFreeFormHighlighterEnabled_ = t,
this.supportCrossProcessPointerEventHandling_ = i,
this.annotationMode_ = [Link],
this.metrics_ = [Link](),
this.freeFormAttributes_ = null,
this.highlightModePluginPointerEvents_ = [],
this.pdfViewerUIEventCallback_ = function() {}
this.pdfContentViewUIEventCallback_ = function() {}
this.pluginControllerMessageCallback_ = function() {}
,
this.pointerEventSubscribeCallback_ = function() {}
this.pointerEventUnsubscribeCallback_ = function() {}
initializeAnnotationManager(e, t) {
this.viewport_ = e,
this.overlayController_.initialize(e, t)
activateOverlays_(e, t, i) {
this.pluginControllerMessageCallback_({
type: "addInkStroke",
inkPageNumber: e,
inkStrokeData: t
}),
[Link]()
)),
this.pluginControllerMessageCallback_({
type: "eraserEvent",
eventType: e,
event: {
x: [Link],
y: [Link] - this.viewport_.embedTopOffset
})
));
const n = [Link]();
this.overlayController_.setInkReadyListener(( () => {
this.pluginControllerMessageCallback_({
type: "inkInitialized",
inkInitializeTime: [Link]() - n
})
)),
this.overlayController_.setTouchScrollUpdatedListener((e => {
this.pdfViewerUIEventCallback_("set-touch-draw-mode", {
isTouchDrawEnabled: !e
}),
[Link](e, !0)
)),
enableFreeFormHighlight_(t) {
!this.pdfFreeFormHighlighterEnabled_)
return;
if (-1 === t)
return;
const i = this.freeFormAttributes_
, n = this.highlightModePluginPointerEvents_[0];
this.overlayController_.setAnnotationMode([Link], t),
this.overlayController_.dispatchPointerEvents(this.highlightModePluginPointerEvents_,
t),
this.highlightModePluginPointerEvents_ = [])
disableFreeFormHighlight() {
this.highlightModePluginPointerEvents_ = [])
enterInkingMode(e, t) {
this.overlayController_.overlaysActivated ?
(this.overlayController_.setAnnotationMode([Link]),
exitInkingMode() {
this.overlayController_.overlaysActivated &&
this.overlayController_.deactivateOverlays(),
this.overlayController_.setInkListener(null)
}
enterHighlightMode(t=!0) {
this.overlayController_.setAnnotationMode([Link]),
this.supportCrossProcessPointerEventHandling_ ? this.pointerEventSubscribeCallback_() :
(this.plugin_.addEventListener("pointerdown", [Link]),
this.plugin_.addEventListener("pointermove",
[Link]),
this.plugin_.addEventListener("pointerup", [Link])))
exitHighlightMode() {
this.overlayController_.overlaysActivated &&
this.overlayController_.deactivateOverlays(),
this.overlayController_.setInkListener(null),
this.freeFormAttributes_ = null,
this.highlightModePluginPointerEvents_ = [],
this.supportCrossProcessPointerEventHandling_ ?
this.pointerEventUnsubscribeCallback_() : (this.plugin_.removeEventListener("pointerdown",
[Link]),
this.plugin_.removeEventListener("pointermove",
[Link]),
this.plugin_.removeEventListener("pointerup",
[Link]))
annotationModeChanged(e) {
const t = this.annotationMode_;
if (this.annotationMode_ = [Link],
t === this.annotationMode_) {
let t = null;
this.freeFormAttributes_ = [Link]),
} else
[Link]([Link])));
const i = {
type: "setAnnotationConfiguration",
annotationMode: this.annotationMode_
};
this.pluginControllerMessageCallback_(i)
updateTouchScrollState(e, t) {
this.pluginControllerMessageCallback_({
type: "updateTouchScrollState",
isTouchScrollEnabled: e,
isAutoTriggered: t
})
}
touchDrawModeChange(e, t) {
e ? this.overlayController_.disableTouchScroll() :
this.overlayController_.enableTouchScroll(),
[Link](!e, t)
viewportChanged() {
this.overlayController_.viewportChanged()
onBlur() {
colorSchemeChange(e) {
this.overlayController_.highContrastModeChanged([Link], [Link])
documentDimensionUpdate() {
this.overlayController_.overlaysActivated &&
this.overlayController_.documentDimensionsChanged()
setPdfViewerUIEventCallback(e) {
this.pdfViewerUIEventCallback_ = e
setPdfContentViewUIEventCallback(e) {
this.pdfContentViewUIEventCallback_ = e
setPluginControllerCallback(e) {
this.pluginControllerMessageCallback_ = e
setPointerEventSubscribeCallback(e) {
this.pointerEventSubscribeCallback_ = e
setPointerEventUnsubscribeCallback(e) {
this.pointerEventUnsubscribeCallback_ = e
inkStrokeAdded(e) {
this.overlayController_.removeWetInk([Link], [Link],
[Link]),
this.pdfViewerUIEventCallback_("ink-stroke-dried", {
success: [Link],
numberOfStrokes: [Link]
})
enableFreeFormHighlight(e) {
this.enableFreeFormHighlight_(t)
setShiftKeyPressed(e) {
this.overlayController_.setShiftKeyPressed(e)
deactivateOverlays() {
this.overlayController_.overlaysActivated &&
(this.overlayController_.deactivateOverlays(),
this.overlayController_.setInkListener(null))
handleCreateHighlight(e, t, i, n) {
this.pluginControllerMessageCallback_({
type: "createHighlightFromSelection",
a: e,
r: t,
g: i,
b: n
})
handleChangeHighlightColor(e, t, i, n) {
this.pluginControllerMessageCallback_({
type: "changeHighlightColor",
a: e,
r: t,
g: i,
b: n
})
handleDeleteHighlight() {
this.pluginControllerMessageCallback_({
type: "deleteHighlight"
})
}
HandleTextOnlyHighlightToggle(e) {
this.pluginControllerMessageCallback_({
type: "setTextOnlyHighlightEnabled",
isEnabled: [Link]
})
handleFreeTextEvent(e) {
switch ([Link]) {
case "freeTextAdded":
this.pdfContentViewUIEventCallback_("free-text-dried", {
pageNumber: [Link],
freeTextId: [Link],
success: [Link]
});
break;
case "setFreeTextFont":
this.pdfContentViewUIEventCallback_("set-free-text-font", {
fontFamily: [Link]
});
break;
case "showEditableFreeText":
this.pdfContentViewUIEventCallback_("show-editable-free-text", e);
break;
case "showNewFreeTextAt":
this.pdfContentViewUIEventCallback_("show-add-free-text-box", {
pageNumber: [Link],
left: [Link],
top: [Link],
isRotated: !0
});
break;
case "showAddFreeTextBox":
if (-1 === t)
throw new Error(`Point not on any PDF Page. Point coordinates: ${e.x}, ${e.y}`);
this.pdfContentViewUIEventCallback_("show-add-free-text-box", {
pageNumber: t,
});
break
case "freeTextEditsSaved":
this.pdfContentViewUIEventCallback_("free-text-dried", {
pageNumber: [Link],
freeTextId: [Link],
success: [Link]
});
break;
default:
throw new Error(`Unknown free text event: ${[Link]}`)
handleFreeTextUIEvent(e, t) {
switch (e) {
case "create-free-text-annotation":
this.pluginControllerMessageCallback_({
type: "createFreeTextAnnotation",
...t
});
break;
case "update-free-text-annotation":
this.pluginControllerMessageCallback_({
type: "updateFreeTextAnnotation",
...t
});
break;
case "delete-free-text-annotation":
this.pluginControllerMessageCallback_({
type: "deleteFreeTextAnnotation",
...t
});
break;
case "free-text-pointer-event":
this.pluginControllerMessageCallback_({
type: "pointerEvent",
...t
});
break;
default:
get annotationMode() {
return this.annotationMode_
class w {
constructor(e, t, i) {
this.viewport_ = e,
this.plugin_ = t,
this.window_ = i,
this.mousemoveCallback_ = null,
this.timerId_ = null,
this.scrollVelocity_ = null,
this.lastFrameTime_ = 0,
this.isScrollingEnabled_ = !1
startDragScrollTimer_() {
this.lastFrameTime_ = [Link]())
}
stopDragScrollTimer() {
this.timerId_ = null,
this.lastFrameTime_ = 0)
dragScrollPage_() {
const e = this.viewport_.position
, t = [Link]()
, i = (t - this.lastFrameTime_) / w.DRAG_TIMER_INTERVAL_MS_;
e.y += this.scrollVelocity_.y * i,
e.x += this.scrollVelocity_.x * i,
this.viewport_.position = e,
this.lastFrameTime_ = t
calculateVelocity_(e) {
const t = this.viewport_.frameToPluginViewportCoord({
x: [Link],
y: [Link]
})
, i = this.viewport_.getPluginRectInFrame();
x: n,
y: o
onMousemove(e) {
this.scrollVelocity_ = this.calculateVelocity_(e),
handlePointerEventFromPlugin(e) {
return;
const t = [Link]
, i = this.viewport_.pluginToFrameCoordinate({
x: [Link],
y: [Link]
});
[Link]({
clientX: i.x,
clientY: i.y,
type: "mousemove"
})
setEnableScrolling(e) {
e ? (this.mousemoveCallback_ || (this.mousemoveCallback_ =
[Link](this)),
this.isScrollingEnabled_ = e
function b(e, t, i, n, o, a) {
const s = E(n.y / o, i)
, r = (n.y + [Link] - a) / o;
let l = [Link] - 1;
l = T(C(e, n, o), t, a, o, i)
return [s, l]
function E(e, t) {
if (e < 0)
return 0;
let i = 0
, n = [Link] - 1;
for (; n >= i; ) {
let a = 0;
return o;
a>e?n=o-1:i=o+1
return [Link] - 1
function C(e, t, i) {
return {
x: t.x / i,
y: t.y / i,
width: [Link] / i,
height: [Link] / i
function P(e, t, i, n, o, a) {
return {
}
function I(e, t, i, n, o, a) {
if (!s)
return {
horizontal: !1,
vertical: !1
};
const r = [Link]()
return [Link] > [Link] && !l ? [Link] += n : [Link] > [Link] && !h && ([Link] += n),
function S(e, t) {
return e ? {
height: [Link]([Link] * t)
} : null
function T(e, t, i, n, o) {
, s = E([Link](a), o);
function k(e, t) {
, n = [Link](e.y, t.y)
function M(e, t) {
let[i,n,o,a] = [1 / 0, 1 / 0, 0, 0];
for (const s of e) {
i = [Link](i, e),
n = [Link](n, r),
o = [Link](o, e + l),
a = [Link](a, r + h)
return {
x: i,
y: n,
width: o - i,
height: a - n
}
w.DRAG_TIMER_INTERVAL_MS_ = 100,
w.MAX_DRAG_SCROLL_DISTANCE_ = 100,
w.MIN_DRAG_SCROLL_DISTANCE_ = 5,
w.SCROLL_EXTRAPOLATION_DISTANCE_ = 1;
class A {
constructor(e, t, i, n, o, a, s) {
this.window_ = void 0,
this.sizer_ = void 0,
this.scrollbarWidth_ = void 0,
this.firstPageSeparator_ = void 0,
this.embedTopOffset_ = void 0,
this.pageDimensions_ = void 0,
this.rotations_ = void 0,
this.layoutBehavior_ = void 0,
this.zoom_ = void 0,
this.scrollType_ = void 0,
this.updateLayoutContainerCallback_ = void 0,
this.renderLayoutContainerCallback_ = void 0,
this.updatePluginEmbedCallback_ = void 0,
this.documentDimensions_ = void 0,
this.position_ = void 0,
this.pdfOOPIFScrollbarEnabled_ = void 0,
this.viewportChangedCallbacks_ = void 0,
this.window_ = e,
this.sizer_ = t,
this.scrollbarWidth_ = i,
this.firstPageSeparator_ = n,
this.embedTopOffset_ = o,
this.layoutBehavior_ = a,
this.zoom_ = 1,
this.scrollType_ = [Link],
this.updateLayoutContainerCallback_ = function() {}
this.renderLayoutContainerCallback_ = function() {}
this.updatePluginEmbedCallback_ = function() {}
this.documentDimensions_ = null,
this.pageDimensions_ = [],
this.rotations_ = 0,
this.position_ = {
x: 0,
y: 0
},
this.pdfOOPIFScrollbarEnabled_ = s,
this.viewportChangedCallbacks_ = []
get size() {
return P({
width: this.window_.innerWidth,
height: this.window_.innerHeight
}, this.documentDimensions_, [Link](), [Link], this.embedTopOffset_
+ this.firstPageSeparator_, [Link])
documentNeedsScrollbars(e) {
const t = [Link];
return I({
width: this.window_.innerWidth,
height: this.window_.innerHeight
updateViewport() {
this.viewportChangedCallbacks_.forEach((function(e) {
e()
))
getZoom() {
return this.zoom_
setRenderLayoutContainerCallback(e) {
this.renderLayoutContainerCallback_ = e
setUpdateLayoutContainerCallback(e) {
this.updateLayoutContainerCallback_ = e
setUpdatePluginEmbedCallback(e) {
this.updatePluginEmbedCallback_ = e
get pageCount() {
return this.pageDimensions_.length
getClockwiseRotations() {
return this.rotations_
isPdfOopifScrollbarEnabled() {
return this.pdfOOPIFScrollbarEnabled_
setClockwiseRotations(e) {
getDocumentDimensions() {
return {
width: this.documentDimensions_.width,
height: this.documentDimensions_.height
getVisiblePageRange() {
getPageScreenRect(e) {
if (!this.documentDimensions_)
return {
x: 0,
y: 0,
width: 0,
height: 0
};
const t = this.pageDimensions_[e]
, i = [Link](e)
, n = t.x + this.layoutBehavior_.getShadowsForPage(e).left
, o = [Link]();
return {
x: n * o + [Link]() - [Link].x,
width: [Link] * o,
height: [Link] * o
getRenderedPageScreenRect(e) {
const t = [Link](e);
return {
x: [Link](t.x),
y: [Link](t.y),
width: [Link]([Link]),
height: [Link]([Link])
}
}
getPageLayoutRect(e) {
if (!this.documentDimensions_)
return {
x: 0,
y: 0,
width: 0,
height: 0
};
const t = [Link](e)
, i = [Link]();
return {
x: t.x * i,
y: t.y * i,
width: [Link] * i,
height: [Link] * i
getRenderedPageLayoutRect(e) {
const t = [Link](e);
return {
x: [Link](t.x),
y: [Link](t.y),
width: [Link]([Link]),
height: [Link]([Link])
}
getLayoutContainerRect() {
return function(e, t, i, n) {
o = [Link]([Link](o, 0));
return {
x: o,
y: n,
width: [Link],
height: [Link]
findPageForPoint(e, t) {
const i = [Link]();
const i = [Link](n);
if (e >= i.x && e <= i.x + [Link] && t >= i.y && t <= i.y + [Link])
return n
return -1
addViewportChangedCallback(e) {
this.viewportChangedCallbacks_.push(e)
removeViewportChangedCallback(e) {
get position() {
return this.position_
getGutterWidth() {
getPageInsetDimensions(e) {
return function(e, t, i) {
const n = [Link](e);
return {
x: t.x + [Link],
y: t.y + [Link],
getMostVisiblePage() {
const e = this.getViewportRect_()
, t = this.getPageAtY_([Link](e.y))
, i = this.getLastPageInViewport_(e);
let o = e
, a = 0;
if (e <= 0)
continue;
const t = k(n[s], i) / e;
t > a && (o = s,
a = t)
return o
}(t, i, e, this.pageDimensions_)
getFirstVisiblePage() {
const e = this.getViewportRect_();
return this.getPageAtY_([Link](e.y))
getViewportRect_() {
getViewportRectWithZoom_() {
getPageAtY_(e) {
return E(e, this.pageDimensions_)
getPluginRectInFrame() {
return {
x: 0,
y: [Link],
width: [Link],
getPageAtYScreenCoordinate_(e) {
getLastPageInViewport_(e) {
set scrollType(e) {
this.scrollType_ = e
get scrollType() {
return this.scrollType_
set embedTopOffset(e) {
this.embedTopOffset_ = e
}
set position(e) {
this.position_ = e
get embedTopOffset() {
return this.embedTopOffset_
get layoutBehavior() {
return this.layoutBehavior_
set layoutBehavior(e) {
this.layoutBehavior_ = e
get documentDimensions() {
return this.documentDimensions_
set documentDimensions(e) {
this.documentDimensions_ = e
get scrollbarWidth() {
return this.scrollbarWidth_
get firstPageSeparator() {
return this.firstPageSeparator_
get zoom() {
return this.zoom_
}
set zoom(e) {
this.zoom_ = e
class D extends A {
constructor(e, t, i, n, o, a, s, r) {
super(e, t, i, n, o, s, r),
this.pdfFastScrollAsIsZoomEnabled_ = void 0,
this.isFullscreen_ = void 0,
[Link] = () => {
const e = [Link]()
, t = M([Link](e), this.pageDimensions_)
, i = [Link];
[Link]("--page-scale", [Link]()),
[Link]("--y-clip-start", [Link](t.y).toString()),
this.pdfFastScrollAsIsZoomEnabled_ = a,
this.isFullscreen_ = !1
setSize(e, t) {
this.pdfFastScrollAsIsZoomEnabled_ ? this.updatePluginEmbedCallback_(e, t) :
(this.sizer_.[Link] = e + "px",
this.sizer_.[Link] = t + "px")
updateViewport_() {
this.viewportChangedCallbacks_.forEach((e => {
e()
))
setDocumentDimensions(e) {
[Link] = e,
this.pageDimensions_ = [Link];
const t = [Link];
setLayoutBehavior(e) {
[Link] = e
handleToggleFullscreen(e) {
[Link]("fullscreen-mode", e),
this.isFullscreen_ = e,
[Link]([Link])) :
([Link]([Link]),
[Link] = [Link])
goToNextPage() {
const e = [Link]();
[Link]([Link](e + [Link](),
this.pageDimensions_.length - [Link]()))
goToPreviousPage() {
const e = [Link]();
[Link]([Link](0, e - [Link]()))
scrollToPage(e) {
return;
const t = [Link](e)
, s = [Link]
, r = [Link]
,l={
x: i * s + (o * s - [Link]) / 2,
y: n * s + (a * s - [Link]) / 2
};
[Link] = {
x: l.x,
y: [Link](l.y, 0)
},
[Link]()
contentSizeChanged_() {
if (![Link]())
return;
set zoom(e) {
[Link] = e,
this.contentSizeChanged_()
get zoom() {
return [Link]
get sizer() {
return this.sizer_
get firstPageSeperator() {
return this.firstPageSeparator_
get pageDimensions() {
return [Link]
getZoom() {
return [Link]
pluginToFrameCoordinate(e) {
return {
x: e.x,
y: e.y
frameToPluginViewportCoord(e) {
return {
x: e.x,
y: e.y
get position() {
return {
x: this.window_.scrollX,
y: this.window_.scrollY
set position(e) {
this.window_.scrollTo({
left: e.x,
top: e.y
})
get isFullscreen() {
return this.isFullscreen_
}
!function(e) {
const t = e;
function i(e, i) {
if ([Link] > 0) {
if ("getScriptHash"in i[0].[Link])
return [Link] = d,
[Link] = h
[Link] = i)
}(Error);
const t = {
errorInfo: e,
type: "contentViewError"
};
[Link](t),
[Link] = e
));
const L = [Link]("embed")
, F = [Link]("pdfoopifscrollbarenabled")
, N = [Link]("pdfshiftstraightlineinkingenabled")
, O = [Link]("pdfpreviewenabled")
, R = [Link]("pdfLoadUIAfterRenderEnabled")
, H = [Link]("pdfscrollingonmainthread")
, V = [Link]("pdfscrollingwithrequestanimationframe")
, G = [Link]("pdffastscrollenabled")
, K = +[Link]["first-page-separator"].value;
let U = !1;
const z = G ? [Link]("layout-container") :
[Link]("sizer")
, B = [Link]("internal-document-container");
let X, $ = L, W = !1;
[Link]("no-compositor-scroll"));
constructor(e, t, i, n, o, a, s) {
this.window_ = e,
this.plugin_ = i,
this.pdfAnnotationManager_ = null,
this.pdfAnnotationManagerResolver_ = null,
this.documentContainer_ = n,
this.pdfViewerUIEventCallback_ = function() {}
this.pdfContentUIEventCallback_ = function() {}
,
this.pdfOOPIFScrollbarEnabled_ = a,
this.pdfFastScrollAsIsZoomEnabled_ = o;
const r = new m;
const t = [Link]("div");
[Link] = "hidden",
[Link] = "scroll",
[Link] = "50px",
[Link] = "50px",
[Link] = "absolute",
[Link](t);
return [Link](t),
}(this.pdfFastScrollAsIsZoomEnabled_),s,0,this.pdfFastScrollAsIsZoomEnabled_,r,[Link]
crollbarEnabled_),
)),
this.isZoomInProgress_ = !1
}
setPdfViewerUIEventCallback(e) {
this.pdfViewerUIEventCallback_ = e
setPdfContentViewUIEventCallback(e) {
this.pdfContentUIEventCallback_ = e
getViewportSize_() {
return P({
width: [Link],
height: [Link]
setLayoutBehavior(e, t, i) {
let n;
switch (e) {
case g.SINGLE_PAGE:
n = new m;
break;
case g.DUAL_PAGE:
n = new v(t,i,this.viewport_.[Link])
this.viewport_.setLayoutBehavior(n)
setDocumentDimensions(e) {
this.pdfOOPIFScrollbarEnabled_ && this.viewport_.setDocumentDimensions(e)
updatePluginEmbed_(e, t) {
this.plugin_.setAttribute("height", t),
this.plugin_.setAttribute("width", e)
updateSize(e, t) {
handleToggleFullscreen(e) {
this.viewport_.handleToggleFullscreen(e)
handleOnWheel(e) {
!0)
handleOnSwipe(e) {
!0)
updateViewport(e) {
this.viewport_.zoom = e,
this.viewport_.updateViewport()
handleViewRecovery(e) {
[Link] && ([Link] &&
[Link](g.DUAL_PAGE, !1, !1),
this.viewport_.setClockwiseRotations([Link]))
get viewport() {
return this.viewport_
scrollTo(e) {
this.viewport_.position = e
initializeAnnotationManager() {
const e = [Link]("pdfFreeFormHighlighterEnabled");
this.pdfAnnotationManagerResolver_(),
this.pdfAnnotationManager_.setPluginControllerCallback((e =>
this.plugin_.postMessage(e))),
this.pdfAnnotationManager_.initializeAnnotationManager(this.viewport_,
this.documentContainer_)
async handleAnnotationEvent(e, t) {
e) {
case "annotation-mode-changed":
[Link] !== f.ADDING_FREE_TEXT && [Link] !==
f.ADDING_FREE_TEXT || this.pdfContentUIEventCallback_("toggle-free-text-mode", {}),
[Link] = [Link],
this.pdfAnnotationManager_.annotationModeChanged(t);
break;
case "text-only-highlight-toggled":
this.pdfAnnotationManager_.HandleTextOnlyHighlightToggle(t);
break;
case "touch-draw-mode-changed":
this.pdfAnnotationManager_.touchDrawModeChange([Link],
[Link]);
break;
case "deactivateOverlays":
this.pdfAnnotationManager_.deactivateOverlays();
break;
case "inkStrokesAdded":
this.pdfAnnotationManager_.inkStrokeAdded(t);
case "enable-free-form-highlight":
this.pdfAnnotationManager_.enableFreeFormHighlight(t);
break;
case "colorSchemeChanged":
this.pdfAnnotationManager_.colorSchemeChange(t);
break;
case "createHighlightFromSelection":
break;
case "changeHighlightColor":
this.pdfAnnotationManager_.handleChangeHighlightColor(t.a, t.r, t.g, t.b);
break;
case "deleteHighlight":
this.pdfAnnotationManager_.handleDeleteHighlight();
break;
case "documentDimensions":
this.pdfAnnotationManager_.documentDimensionUpdate();
break;
case "pointerEvent":
this.pdfAnnotationManager_.handlePointerEventFromPlugin(t);
break;
case "onBlur":
this.pdfAnnotationManager_.onBlur();
break;
case "viewportChanged":
this.viewport_.updateViewport();
break;
case "freeTextAdded":
case "setFreeTextFont":
case "showEditableFreeText":
case "showNewFreeTextAt":
case "showAddFreeTextBox":
case "freeTextEditsSaved":
this.pdfAnnotationManager_.handleFreeTextEvent({
type: e,
...t
});
break;
case "create-free-text-annotation":
case "update-free-text-annotation":
case "delete-free-text-annotation":
case "free-text-pointer-event":
this.pdfAnnotationManager_.handleFreeTextUIEvent(e, t);
break;
case "keyDown":
case "keyUp":
break;
default:
enableViewportScrolling(t) {
e(this.pdfOOPIFScrollbarEnabled_),
this.viewportScroller_.setEnableScrolling(t)
getScrollOffset() {
return this.viewport_.position
set zoomInProgress(e) {
this.isZoomInProgress_ = e
}
get zoomInProgress() {
return this.isZoomInProgress_
set renderIteration(e) {
this.renderIteration_ = e
get renderIteration() {
return this.renderIteration_
get isFullscreen() {
return this.viewport_.isFullscreen
get annotationMode() {
return this.pdfAnnotationManager_.annotationMode
(window,z,L,B,G,F,K);
ae(e, t)
)),
[Link] = Y,
[Link]("focus", (e => {
[Link]({
type: "focusChange",
focus: !0,
timestamp: [Link]()
})
)),
[Link]("blur", (e => {
[Link]({
type: "focusChange",
focus: !1,
timestamp: [Link]()
})
)),
[Link]("focusin", (e => {
)),
let j = [Link];
[Link] = {
HISTOGRAM_LOG: "histogram-log",
HISTOGRAM_LINEAR: "histogram-linear"
}),
[Link]({
type: "connect",
token: [Link]
}, j, [x.port2]);
const J = [Link]("#pdf-content-view-root");
let Q, ee = !1;
let ie;
F || ([Link] = {
pdfOOPIFScrollbarEnabled: F
},
ie());
const oe = [];
function ae(e, t) {
bubbles: !1,
detail: {
eventName: e,
eventData: t
});
ee ? [Link](i) : (_e(),
[Link]([Link]))
}
[Link]("pdf-content-view-event", (e => {
var t;
switch ([Link]) {
case "pdf-content-view-loaded":
const e = [Link]();
ae([Link], [Link])
break;
case "form-field-event":
he({
type: "formFieldEvent",
eventData: [Link]
});
break;
case "form-document-event":
[Link]({
type: "formDocumentEvent",
eventData: [Link]
});
break;
case "page-level-form-field-appearance-stream-request":
[Link]({
type: "pageLevelFormFieldAppearanceRequest",
requestId: [Link],
dataList: [Link],
scale: [Link],
pageIndex: [Link]
});
break;
case "get-free-text-font":
[Link]({
type: "getFreeTextFont",
text: [Link]
});
break;
case "create-free-text-annotation":
case "update-free-text-annotation":
case "delete-free-text-annotation":
case "free-text-pointer-event":
[Link]([Link], [Link]);
break;
default:
throw new Error(`Unhandled content-view message: ${null === (t = [Link]) || void 0 ===
t ? void 0 : [Link]}`)
));
let se = !1
, re = !1;
[Link]("message", (t => {
switch ([Link]) {
case "formFocusChange":
se = [Link];
break;
case "setCaretModeEnabled":
re = [Link];
break;
case "setFormData":
case "appendFormFields":
const e = [Link]();
return ae([Link], {
formData: [Link],
config: [Link],
startTime: e,
shouldInitializeFormController: !W
}),
void (W || (W = !0,
X(),
pe("has-form-data", {})))
case "removeFormFields":
return e(W),
void ae([Link], {
pageIndex: [Link],
removedFieldIds: [Link]
});
case "documentDimensions":
F && ([Link]([Link]),
[Link]([Link], [Link]));
break;
case "onFieldAppearanceGenerated":
case "viewRecoveryInfo":
type: "pdfLoaderMessage",
data: [Link]
}, j),
[Link]([Link]);
break;
case "inkStrokesAdded":
case "enable-free-form-highlight":
case "colorSchemeChanged":
case "createHighlightFromSelection":
case "changeHighlightColor":
case "deleteHighlight":
case "freeTextAdded":
case "showEditableFreeText":
case "showNewFreeTextAt":
case "showAddFreeTextBox":
case "freeTextEditsSaved":
if (F)
return void [Link]([Link], [Link]);
break;
case "setIsSelecting":
if (F) {
const e = [Link];
break;
case "renderIterationMessage":
if (F)
W && ae("updateZoomInProgress", {
type: "updateZoomInProgress",
isZoomInProgress: !1
})));
break;
case "firstRenderComplete":
return Q(),
type: "pdfLoaderMessage",
data: [Link]
}, j));
case "loadProgress":
case "getPassword":
case "navigateToDestination":
R && [Link]({
type: "pdfLoaderMessage",
data: [Link]
}, j)
[Link]([Link])
));
let le = !1;
if ([Link] = i => {
switch ([Link]) {
case "layoutUpdate":
return e(W),
case "setLayout":
if (!F)
break;
break;
case "setPDFFullscreenMode":
F && [Link]([Link]);
break;
case "subscribePointerEvents":
[Link]("pointermove", ge),
[Link]("pointermove", ge),
case "restoreFocusToElement":
case "stopScrolling":
if (!F)
break;
W && ae("updateZoomInProgress", {
type: "updateZoomInProgress",
isZoomInProgress: !0
})),
le = !0,
void [Link]([Link]);
case "viewport":
if (!F) {
[Link]([Link]);
break
[Link] = [Link],
le = !1,
[Link]([Link]);
const e = [Link]();
[Link]({
x: [Link],
y: [Link] + K
});
const t = [Link]();
e.x === t.x && e.y === t.y && [Link](new Event("scroll"))
case "syncScrollToRemote":
if (!F)
return;
le || [Link]({
x: [Link].x,
y: [Link].y
});
const e = [Link]();
type: "ackScrollToRemote",
x: e.x,
y: e.y,
scrollSuppressed: le
})
case "updateSize":
case "updateZoomInProgress":
return e(W),
case "loadTimeDataInfo":
void ie();
case "initAnnotationManager":
return e(F),
U = !0,
case "annotationEvent":
case "documentFocus":
[Link]([Link])
F) {
if (V) {
let e = !1;
[Link]("scroll", ( () => {
e || ([Link](( () => {
const t = [Link]();
[Link]({
type: "syncScrollFromRemote",
x: t.x,
y: t.y
}),
e = !1
)),
e = !0)
), {
passive: !0
})
} else
[Link]("scroll", ( () => {
const e = [Link]();
[Link]({
type: "syncScrollFromRemote",
x: e.x,
y: e.y
})
));
[Link]("resize", ( () => {
pe("resize", {})
}
))
function he(e) {
[Link](e)
function de(e) {
const t = e;
[Link]({
type: "gesture",
gesture: {
type: [Link],
detail: [Link]
})
[Link] = function(t) {
switch ([Link]) {
case "updateFormFields":
ae([Link], t)
));
break;
case "updateFormFieldOnKeyStroke":
case "doDefaultAction":
e(W),
ae([Link], t);
break;
case "setFormFieldFocus":
ae([Link], t);
break;
case "setPluginFocus":
break;
case "setFreeTextFont":
F && [Link]([Link], t)
return {
type: "returnSyncMessage"
[Link]().addEventListener(e, de);
function ge(e) {
[Link]({
type: "pointerEvent",
detail: {
type: [Link],
pointerId: [Link],
pointerType: [Link],
isPrimary: [Link],
clientX: [Link],
clientY: [Link],
altKey: [Link],
button: [Link],
ctrlKey: [Link],
metaKey: [Link],
shiftKey: [Link]
})
function ue(e) {
function pe(e, t) {
[Link]({
type: e,
eventData: t
})
await ne,
await te;
const e = [Link]("content-view-script-template");
e && [Link]([Link])
}
[Link]("keydown", (e => {
[Link]();
switch ([Link]) {
case "Escape":
break;
case "PageDown":
case "PageUp":
ue(e) || re || [Link]();
break;
case "ArrowDown":
case "ArrowLeft":
case "ArrowRight":
case "ArrowUp":
se || ue(e) || re || [Link]();
break;
case "Tab":
se && ([Link](),
he({
type: "keyDown",
eventData: {
keyCode: [Link],
code: [Link],
key: [Link],
shiftKey: [Link],
ctrlKey: [Link],
altKey: [Link],
metaKey: [Link]
}));
break;
case "s":
[Link](),
R && [Link]({
type: "pdfLoaderMessage",
data: {
type: "saveTriggered"
}, j);
break
return;
case "a":
[Link]();
break
}
return;
case "y":
he({
type: "redoAction",
eventData: {}
});
break
return;
case "z":
he({
type: "undoAction",
eventData: {}
});
break
return;
case "Shift":
if ([Link] || !N)
return;
if (F)
code: [Link],
key: [Link],
shiftKey: [Link],
ctrlKey: [Link],
altKey: [Link],
metaKey: [Link]
});
break;
default:
if (s(e))
break;
return
[Link]({
type: "sendKeyEvent",
keyEvent: {
keyCode: [Link],
code: [Link],
key: [Link],
shiftKey: [Link],
ctrlKey: [Link],
altKey: [Link],
metaKey: [Link]
})
}
)),
code: [Link],
key: [Link],
shiftKey: [Link],
ctrlKey: [Link],
altKey: [Link],
metaKey: [Link]
}) : [Link]({
type: "sendKeyEvent",
keyEvent: {
keyCode: [Link],
code: [Link],
key: [Link],
shiftKey: [Link],
ctrlKey: [Link],
altKey: [Link],
metaKey: [Link]
}))
)),
[Link]("keypress", (e => {
se || re || [Link]()
}
))
)();