our-medical
Version:
medical image vue component
939 lines (938 loc) • 466 kB
JavaScript
import './style.css';
var cf = Object.defineProperty;
var uf = (n, t, i) => t in n ? cf(n, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[t] = i;
var W = (n, t, i) => uf(n, typeof t != "symbol" ? t + "" : t, i);
import { defineComponent as Go, ref as qt, reactive as En, computed as pn, onMounted as zo, onBeforeUnmount as Ws, createElementBlock as Zn, openBlock as cn, Fragment as hs, createElementVNode as ff, createBlock as df, toDisplayString as ps, Teleport as hf, createCommentVNode as pf, normalizeStyle as ms, renderList as mf, normalizeClass as gf, nextTick as ei, watch as te, unref as ee, createVNode as St, onUpdated as vf, onActivated as yf, onUnmounted as Pf, getCurrentInstance as If } from "vue";
import * as _t from "@cornerstonejs/tools";
import { CrosshairsTool as fi, ZoomTool as Qe, PanTool as tn, LengthTool as Li, AngleTool as Ni, drawing as H, utilities as q, segmentation as nt, cursors as Ct, Enums as U, BaseTool as on, AnnotationTool as Gs, annotation as V, ScaleOverlayTool as wf, ToolGroupManager as en, WindowLevelTool as Cf, AnnotationDisplayTool as Df, TrackballRotateTool as io, SynchronizerManager as Dt, synchronizers as xf, StackScrollMouseWheelTool as gs, state as _f, addTool as Sf } from "@cornerstonejs/tools";
import * as kt from "@cornerstonejs/core";
import { utilities as G, Enums as z, cache as ft, VolumeViewport as ie, metaData as we, getRenderingEngine as Oe, getEnabledElement as at, eventTarget as ut, StackViewport as vs, EVENTS as he, imageLoadPoolManager as Ef, triggerEvent as dt, getRenderingEngines as Tf, getEnabledElementByIds as Af, RenderingEngine as Ho, ImageVolume as Of, volumeLoader as ys, setVolumesForViewports as Mf } from "@cornerstonejs/core";
import { merge as Ri, clone as oo, forIn as ro, cloneDeep as ne, isNumber as Ps, round as de, isNil as Ot, debounce as zs, flatten as bf } from "lodash";
import Lf from "@kitware/vtk.js/Filters/General/ImageMarchingSquares";
import { vec2 as $t, vec3 as st, quat as Is, mat4 as un, mat3 as ws } from "gl-matrix";
import { calculateSUVScalingFactors as Nf } from "@cornerstonejs/calculate-suv";
import dn from "@cornerstonejs/dicom-image-loader";
import { api as Rf } from "dicomweb-client";
import Hs from "@kitware/vtk.js/Imaging";
import $s from "@kitware/vtk.js/Common/Core/DataArray";
import Xf from "@kitware/vtk.js/Common/DataModel/ImageData";
import qs from "@kitware/vtk.js/Common/DataModel/PolyData";
import Zs from "@kitware/vtk.js/Rendering/Core/Actor";
import js from "@kitware/vtk.js/Rendering/Core/Mapper";
import "@kitware/vtk.js/Rendering/Core/Property";
import ke from "@kitware/vtk.js/Common/Core/Math";
import Uf from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps";
import { cornerstoneStreamingImageVolumeLoader as Bf } from "@cornerstonejs/streaming-image-volume-loader";
import kf from "dicom-parser";
import Cs from "@kitware/vtk.js/Interaction/Widgets/OrientationMarkerWidget";
import Yf from "@kitware/vtk.js/IO/XML/XMLPolyDataReader";
import Ff from "@kitware/vtk.js/Common/Core/ImageHelper";
import Vf from "@kitware/vtk.js/Filters/General/ImageCropFilter";
const Wf = ["onClick"], Gf = /* @__PURE__ */ Go({
__name: "AxisSelect",
props: {
select: { type: String, required: !0 },
color: { type: String },
i18n: { type: String, required: !0 },
prefixMark: { type: String },
list: { type: Array, required: !0 },
onUpdateSelect: { type: Function }
},
emits: { "update:select": (n) => n || !0 },
setup(n, { emit: t }) {
const i = n, o = t, s = qt(), l = qt(), c = qt(!1), u = En({ x: 0, y: 0 }), d = pn(() => ({ left: u.x + "px", top: u.y + "px" })), m = pn(() => {
for (const P of i.list)
if (P.key === i.select)
return P.text;
return i.i18n === "en" ? "Viewport" : "视口";
});
zo(() => {
document.addEventListener("click", p);
}), Ws(() => {
document.removeEventListener("click", p);
});
function p(P) {
var w;
P.target !== l.value && !((w = s.value) != null && w.contains(P.target)) && (c.value = !1);
}
async function g(P) {
c.value ? c.value = !1 : (c.value = !0, ei(() => {
const I = P.target.parentElement, { offsetHeight: D, offsetWidth: E } = I, { offsetX: S, offsetY: T } = P;
s.value.style.width = I.offsetWidth + "px";
const O = s.value.offsetWidth;
u.x = P.clientX - S + E - O - 5, u.y = P.clientY - T + D;
}));
}
function v(P) {
P.disabled || (o("update:select", P.key), i.onUpdateSelect && i.onUpdateSelect(P.key), c.value = !1);
}
return (P, w) => (cn(), Zn(hs, null, [
ff("div", {
class: "title",
ref_key: "titleNode",
ref: l,
onClick: g
}, ps(`${n.prefixMark ? n.prefixMark + " - " : ""}${m.value}`), 513),
(cn(), df(hf, { to: "body" }, [
c.value ? (cn(), Zn("ul", {
key: 0,
class: "list frosted-glass",
ref_key: "listNode",
ref: s,
style: ms(d.value),
onMouseleave: w[0] || (w[0] = (I) => c.value = !1)
}, [
(cn(!0), Zn(hs, null, mf(n.list, (I) => (cn(), Zn("li", {
class: gf([I.key === n.select ? "select" : "", I.disabled ? "disabled" : ""]),
key: I.key,
style: ms({ background: n.color && I.key === n.select ? n.color : void 0 }),
onClick: (D) => v(I)
}, ps(I.text), 15, Wf))), 128))
], 36)) : pf("", !0)
]))
], 64));
}
}), $o = (n, t) => {
const i = n.__vccOpts || n;
for (const [o, s] of t)
i[o] = s;
return i;
}, zf = /* @__PURE__ */ $o(Gf, [["__scopeId", "data-v-8f8e987b"]]);
var it = /* @__PURE__ */ ((n) => (n.CONTOUR_DATA_MODIFIED = "contour_data_modified", n.VOI_MODIFIED_FROM_TOOL = "voi_modified_from_tool", n.ORIGIN_MODIFIED_FROM_DRAG = "origin_modified_from_drag", n.ORIGIN_DRAG_END = "origin_drag_end", n.SHOT_MODIFIED_FROM_DRAG = "shot_modified_from_drag", n.SHOT_REMOVED_FROM_DRAG = "shot_removed_from_drag", n.NEW_SHOT_FROM_DRAG = "new_shot_from_drag", n.CURR_SHOT_ID_MODIFIED = "current_shot_id_modified", n.CURR_FRAME_VERTICE_INFO_MODIFIED = "current_frame_vertice_infor_modified", n.FRAME_VERTICE_MOVED = "frame_vertice_moved", n.FRAME_MOVED = "frame_moved", n.FRAME_DRAG_END = "frame_drag_end", n.NAIL_MODIFIED_FROM_DRAG = "nail_modified_from_drag", n.NEW_NAIL_FROM_DRAG = "new_nail_from_drag", n.CURR_NAIL_MODIFIED = "current_nail_modified", n.IMAGE_CENTER_MODIFIED = "image_center_modified", n.IMAGE_CENTER_DRAG_END = "image_center_drag_end", n.IMGAE_CENTER_REMOVED_FROM_DRAG = "image_center_removed_from_drag", n.COUCH_MODIFIED_FROM_DRAG = "couch_modified_from_drag", n.COUCH_DRAG_END = "couch_drag_end", n.FIDUCIAL_MODIFIED_FROM_DRAG = "fiducial_modified_from_drag", n.FIDUCIAL_REMOVED_FROM_DRAG = "fiducial_removed_from_drag", n.NEW_FIDUCIAL_FROM_DRAG = "new_fiducial_from_drag", n.DOSE_PT_MODIFIED_FROM_DRAG = "dose_point_modified_from_drag", n.DOSE_PT_REMOVED_FROM_DRAG = "dose_point_removed_from_drag", n.DOSE_PT_UPDATE_DOSE = "dose_point_update_dose", n.NEW_DOSE_PT_FROM_DRAG = "new_dose_point_from_drag", n.VIEWPORT_VOLUMES_SETTED = "viewport_reference_volumes_setted", n.ACCESS_3D = "access_to_3d_display", n.Exit_3D = "exit_3d_display", n.DOSE_DRAWED = "dose_path_draw_end", n.VOLUME_TRANSFORM = "volume_transform", n))(it || {}), qe = /* @__PURE__ */ ((n) => (n.C = "core", n.S = "south", n.N = "north", n))(qe || {}), se = /* @__PURE__ */ ((n) => (n.Primary = "P", n.Secondary = "S", n.SideBySide = "P&S", n.Fusion = "P+S", n))(se || {}), Xi = /* @__PURE__ */ ((n) => (n.Horizontal = "horizontal", n.Vertical = "vertical", n))(Xi || {}), b = /* @__PURE__ */ ((n) => (n.AdvanceBrush = "AdvanceBrush", n.ContourDelete = "ContourDelete", n.Draggable = "Draggable", n.DraggableDisplay = "DraggableDisplay", n.DoseDisplay = "DoseDisplay", n.ManualRegistration = "ManualRegistration", n.MeasuringScale = "MeasuringScale", n.OrientationMark = "OrientationMark", n.SimplePencil = "SimplePencil", n.SliceInfo = "SliceInfo", n.WWWC = "WWWC", n))(b || {}), yt = /* @__PURE__ */ ((n) => (n.P = "primary", n.S = "secondary", n))(yt || {}), gn = /* @__PURE__ */ ((n) => (n.A = "absolute", n.R = "relative", n))(gn || {}), qo = /* @__PURE__ */ ((n) => (n.F = "fill", n.L = "line", n))(qo || {});
const Zo = "#efefef", Js = "00080060", Te = "our-medial-rendering-engin " + G.uuidv4(), Hf = "0020000E", Ks = "00080018", jo = "segmentation", ve = "cornerstoneStreamingImageVolume", Fe = {
[z.OrientationAxis.AXIAL]: { en: "Axial", zh: "轴状位" },
[z.OrientationAxis.SAGITTAL]: { en: "Sagittal", zh: "矢状位" },
[z.OrientationAxis.CORONAL]: { en: "Coronal", zh: "冠状位" },
[z.ViewportType.VOLUME_3D]: { en: "3D", zh: "三 维" }
};
Object.freeze(Fe);
const di = [
"DoseDisplay",
"DraggableDisplay",
"MeasuringScale",
"OrientationMark",
"SliceInfo"
/* SliceInfo */
];
Object.freeze(di);
const Gt = 4, Jo = 0.2, Ko = 0.4, Se = {
fullIn: [
"M382 828H204c-4.4 0-8-3.6-8-8V665c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v195c0 17.7 14.3 32 32 32h218c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM884 657h-48c-4.4 0-8 3.6-8 8v155c0 4.4-3.6 8-8 8H642c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h218c17.7 0 32-14.3 32-32V665c0-4.4-3.6-8-8-8zM642 196h178c4.4 0 8 3.6 8 8v155c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V164c0-17.7-14.3-32-32-32H642c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zM140 367h48c4.4 0 8-3.6 8-8V204c0-4.4 3.6-8 8-8h178c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H164c-17.7 0-32 14.3-32 32v195c0 4.4 3.6 8 8 8z"
],
fullOut: [
"M358 657c17.7 0 32 14.3 32 32v195c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V729c0-4.4-3.6-8-8-8H140c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h218z m526 0c4.4 0 8 3.6 8 8v48c0 4.4-3.6 8-8 8H706c-4.4 0-8 3.6-8 8v155c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V689c0-17.7 14.3-32 32-32h218zM690 132c4.4 0 8 3.6 8 8v155c0 4.4 3.6 8 8 8h178c4.4 0 8 3.6 8 8v48c0 4.4-3.6 8-8 8H666c-17.7 0-32-14.3-32-32V140c0-4.4 3.6-8 8-8h48z m-308 0c4.4 0 8 3.6 8 8v195c0 17.7-14.3 32-32 32H140c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h178c4.4 0 8-3.6 8-8V140c0-4.4 3.6-8 8-8h48z"
],
pointer: [
"M836.54 429.526667l-498.833333-288-91.946667-53.086667c-10-5.78-18.553333-2.1-21.76-0.246667A21.333333 21.333333 0 0 0 213.333333 106.666667v682.666666a21.333333 21.333333 0 0 0 36.113334 15.386667l154.666666-148.586667 130.38 225.826667A53.333333 53.333333 0 0 0 607.333333 901.486667l129.333334-74.666667a53.333333 53.333333 0 0 0 19.526666-72.86L625.8 528.133333l206-59.64a21.333333 21.333333 0 0 0 4.733333-38.966666z"
],
reset: [
"M921.728 654.4a428.352 428.352 0 1 0-647.04 203.264c3.2 2.24 7.488 1.856 10.24-0.896l43.2-43.2a8 8 0 0 0-1.28-12.352 352.256 352.256 0 1 1 462.592-67.968l-70.4-69.76a8 8 0 0 0-13.632 4.608l-27.904 219.776a8 8 0 0 0 9.024 8.96l219.52-29.952a8 8 0 0 0 4.48-13.632l-67.008-66.368a431.36 431.36 0 0 0 78.208-132.48z"
],
[Ni.toolName]: [
"M968 736.96h-315.84c11.52-202.56-82.24-304.96-153.28-352.64l132.8-147.84c20.8-23.04 18.88-58.24-4.16-079.04-23.04-20.8-58.56-18.88-79.04 4.16L14.4 755.52c-14.72 16.32-18.56 40-9.6 60.16 8.96 20.16 29.12 33.28 51.2 33.28h912c31.04 0 56-24.96 56-56s-24.96-56-56-56z m-544.32-269.12c45.76 25.92 127.68 96.64 116.16 269.12H181.76l241.92-269.12z"
],
[Li.toolName]: [
"M964.693333 300.8L725.333333 59.306667a42.666667 42.666667 0 0 0-30.293333-12.373334 42.666667 42.666667 0 0 0-29.866667 12.373334L59.306667 663.04a42.666667 42.666667 0 0 0 0 60.16l241.493333 241.493333a42.666667 42.666667 0 0 0 30.293333 12.373334 42.666667 42.666667 0 0 0 29.866667-12.373334l120.746667-120.746666 362.24-362.24 120.746666-120.746667a42.666667 42.666667 0 0 0 0-60.16z m-151.04 90.453333l-30.293333-30.293333a42.666667 42.666667 0 0 0-60.16 0 42.666667 42.666667 0 0 0 0 60.586667l30.293333 30.293333L692.906667 512l-90.453334-90.453333a42.666667 42.666667 0 0 0-60.16 60.16l90.453334 90.453333-60.586667 60.586667-29.866667-30.293334a42.666667 42.666667 0 1 0-60.586666 60.586667l30.293333 29.866667-60.16 60.586666-90.88-90.453333a42.666667 42.666667 0 0 0-60.16 0 42.666667 42.666667 0 0 0 0 60.16l90.453333 90.453333-60.16 60.586667-181.333333-181.333333L692.906667 149.76l181.333333 181.333333z"
],
[tn.toolName]: [
"M510.7 896.2c-15.3 0-28.7-11.3-31.4-26.6-0.7-4-0.6-7.9 0.1-11.7 1.7-43.3 0.6-444.5-0.6-710.7-0.1-17.5 14-31.7 31.5-31.8h0.1c17.4 0 31.6 14.1 31.7 31.5 0 0 0.8 179.3 1.3 358.7 0.2 89.7 0.3 179.4 0.2 246.8-0.3 141-0.3 141-30.2 143.7-0.9 0.1-1.8 0.1-2.7 0.1z",
"M510.7 896.2c-15.3 0-28.7-11.3-31.4-26.6-0.7-4-0.6-7.9 0.1-11.7 1.7-43.3 0.6-444.5-0.6-710.7-0.1-17.5 14-31.7 31.5-31.8h0.1c17.4 0 31.6 14.1 31.7 31.5 0 0 0.8 179.3 1.3 358.7 0.2 89.7 0.3 179.4 0.2 246.8-0.3 141-0.3 141-30.2 143.7-0.9 0.1-1.8 0.1-2.7 0.1z",
"M330.2 538.2h-65.5c-141-0.3-141-0.3-143.7-30.2-1.5-16.4 10.3-31.3 26.5-34.1 4-0.7 8-0.6 11.7 0.1 43.3 1.8 444.4 0.6 710.7-0.6h0.1c17.4 0 31.6 14.1 31.7 31.5 0.1 17.5-14 31.7-31.5 31.8 0 0-179.3 0.8-358.7 1.3-63 0.1-126 0.2-181.3 0.2zM614.8 250c-8.1 0-16.2-3.1-22.4-9.3L512 160.4l-80.4 80.4c-12.4 12.4-32.4 12.4-44.8 0-12.4-12.4-12.4-32.4 0-44.8L489.6 93.2c12.4-12.4 32.4-12.4 44.8 0L637.2 196c12.4 12.4 12.4 32.4 0 44.8-6.2 6.1-14.3 9.2-22.4 9.2zM512 920.5c-8.1 0-16.2-3.1-22.4-9.3L386.8 808.4c-12.4-12.4-12.4-32.4 0-44.8 12.4-12.4 32.4-12.4 44.8 0L512 844l80.4-80.4c12.4-12.4 32.4-12.4 44.8 0 12.4 12.4 12.4 32.4 0 44.8L534.4 911.2c-6.2 6.2-14.3 9.3-22.4 9.3z",
"M795.8 636.6c-8.1 0-16.2-3.1-22.4-9.3-12.4-12.4-12.4-32.4 0-44.8l80.4-80.4-80.4-80.4c-12.4-12.4-12.4-32.4 0-44.8 12.4-12.4 32.4-12.4 44.8 0L921 479.8c12.4 12.4 12.4 32.4 0 44.8L818.2 627.4c-6.2 6.1-14.3 9.2-22.4 9.2zM228.2 636.6c-8.1 0-16.2-3.1-22.4-9.3L103 524.6c-12.4-12.4-12.4-32.4 0-44.8L205.8 377c12.4-12.4 32.4-12.4 44.8 0 12.4 12.4 12.4 32.4 0 44.8l-80.4 80.4 80.4 80.4c12.4 12.4 12.4 32.4 0 44.8-6.2 6.1-14.3 9.2-22.4 9.2z"
],
WWWC: [
"M512 142.849636c49.823744 0 98.131965 9.747516 143.585504 28.972526 43.924636 18.579149 83.382979 45.184734 117.277915 79.080887 33.894936 33.894936 60.501738 73.353279 79.080887 117.277915 19.22501 45.452323 28.972526 93.76176 28.972526 143.585504s-9.747516 98.131965-28.972526 143.585504c-18.579149 43.924636-45.184734 83.382979-79.080887 117.277916-33.894936 33.894936-73.353279 60.501738-117.277915 79.080887-45.452323 19.22501-93.76176 28.972526-143.585504 28.972526s-98.131965-9.747516-143.585504-28.972526c-43.924636-18.579149-83.382979-45.184734-117.277915-79.080887-33.894936-33.894936-60.501738-73.353279-79.080887-117.277916-19.22501-45.452323-28.972526-93.76176-28.972526-143.585504s9.747516-98.131965 28.972526-143.585504c18.579149-43.924636 45.184734-83.382979 79.080887-117.277915s73.353279-60.501738 117.277915-79.080887c45.453539-19.223794 93.762976-28.972526 143.585504-28.972526m0-44.821057c-228.501035 0-413.736673 185.236855-413.736673 413.736673S283.500182 925.503142 512 925.503142s413.736673-185.236855 413.736673-413.736674S740.501035 98.028579 512 98.028579z",
"M488.542228 115.289247h44.821057v780.948238h-44.821057z",
"M661.647598 143.001675l31.693413 31.69463-166.01671 166.015493-31.692197-31.693413zM767.461782 217.801147l31.693414 31.693414L527.326734 521.323023l-31.693414-31.693413zM850.471354 319.054166l31.693413 31.693414-353.25318 353.25318-31.693414-31.693413zM891.520631 458.61733l31.692197 31.693414-401.358277 401.358277-31.693414-31.693414z"
],
[Qe.toolName]: [
"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z",
"M921 867L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"
],
[fi.toolName]: [
"M62.016 474.016h900v76H62.016v-76zM474.016 62.016h76v900h-76V62.016z"
]
};
Object.freeze(Se);
const re = {
full: "viewport-container-full",
halfL: "viewport-container-half-left",
halfR: "viewport-container-half-right",
on: "viewport-container-on"
};
Object.freeze(re);
const Ui = [
[0, 1, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, null, 0, 0, 1],
//sagittal
[1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, null, 0, 1],
//coronal
[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, null, 1]
//axial
], go = {
SimplePencil: {
iconContent: `
<g xmlns="http://www.w3.org/2000/svg" transform="scale(0.04116214)">
<path style="fill: {{color}};" d="m 503.46668,777.41329 a 17.03253,17.03253 0 0 1 -12.15147,-5.08587 a 17.064088,17.064088 0 1 1 24.13227,24.13226 l -48.60587,48.60587 47.83787,48.52053 a 17.0496,17.0496 0 0 1 -12.15147,29.04747 z m -230.4,-145.92 H 102.40001 A 17.06667,17.06667 0 0 1 85.33335,614.42662 V 546.15996 H 17.06668 a 17.06667,17.06667 0 1 1 0,-34.13334 H 74.78615 L 1.80908,366.05542 a 17.06667,17.06667 0 0 1 0,-15.27466 L 172.39041,9.61809 a 16.896,16.896 0 0 1 10.82027,-8.99413 16.9472,16.9472 0 0 1 11.81013,1.00693 l 0.85334,0.42667 a 17.03253,17.03253 0 0 1 7.18506,7.50933 l 170.5984,341.17973 a 17.06667,17.06667 0 0 1 0,15.27467 l -72.97706,145.9712 h 57.71946 a 17.06667,17.06667 0 1 1 0,34.13333 h -68.26666 v 68.26667 a 17.06667,17.06667 0 0 1 -17.06667,17.1008 z m -153.6,-34.13333 h 136.53333 v -51.2 H 119.46668 Z m -6.51947,-85.33334 h 149.57227 l 76.8,-153.6 L 204.80001,89.38769 v 126.8224 c 8.78934,2.7648 16.5376,7.4752 23.15947,14.11413 a 58.5728,58.5728 0 0 1 17.80053,42.78614 c 0,16.57173 -6.2976,31.21493 -18.21013,42.3424 -10.30827,11.09333 -24.9344,17.39093 -41.5232,17.39093 a 58.5728,58.5728 0 0 1 -42.78613,-17.80053 c -11.24694,-11.22987 -16.9472,-25.344 -16.9472,-41.9328 0,-16.36694 5.56373,-30.6176 16.55466,-42.35947 8.46507,-7.95307 17.69814,-13.07307 27.81867,-15.5648 V 89.40476 L 36.14721,358.42662 Z m 73.07947,-264.53333 c -7.64587,0 -13.70453,2.33813 -19.06347,7.35573 -4.1984,4.5568 -6.53653,10.61547 -6.53653,18.24427 0,7.40693 2.2016,13.056 6.94613,17.78347 5.3248,5.3248 11.264,7.81653 18.65387,7.81653 7.2704,0 12.62933,-2.26987 17.39093,-7.38987 5.9392,-5.59786 8.20907,-10.9568 8.20907,-18.21013 a 24.91733,24.91733 0 0 0 -7.79947,-18.65387 c -4.31786,-4.31786 -9.59146,-6.53653 -16.55466,-6.94613 z"/>
</g>
`,
iconSize: 32,
viewBox: { x: 32, y: 32 },
mousePoint: { x: 8, y: 8 },
mousePointerGroupString: '<path stroke="{{color}}" d="M8 16L8 0"></path><path stroke="{{color}}" d="M16 8L0 8"></path>'
},
Fiducial: {
iconContent: `
<g xmlns="http://www.w3.org/2000/svg" transform="translate(0,0)">
<path style="fill:RED;fill-rule:evenodd;stroke-width:0.279359;fill-opacity:1" d="m 0,-4 a 4,4 0 0 1 -4,4 4,4 0 0 1 -4,-4 4,4 0 0 1 4,-4 4,4 0 0 1 4,4 z"/>
</g>
`,
iconSize: 32,
viewBox: { x: 16, y: 16 },
mousePoint: { x: 8, y: 8 },
mousePointerGroupString: ""
},
Nail: {
iconContent: "",
iconSize: 32,
viewBox: { x: 16, y: 16 },
mousePoint: { x: 8, y: 8 },
mousePointerGroupString: '<path stroke="{{color}}" d="M8 16L8 0"></path><path stroke="{{color}}" d="M16 8L0 8"></path>'
},
ContourDelete: {
iconContent: `
<g xmlns="http://www.w3.org/2000/svg" transform="scale(0.04116214)">
<path style="fill: {{color}};" d="m 503.46668,777.41329 a 17.03253,17.03253 0 0 1 -12.15147,-5.08587 l -47.6672,-48.34986 -47.58186,47.58186 a 17.064088,17.064088 0 1 1 -24.13227,-24.13226 l 47.58187,-47.58187 -48.34987,-47.6672 a 17.06667,17.06667 0 1 1 23.9616,-24.30293 l 48.52053,47.83786 48.60587,-48.60586 a 17.064088,17.064088 0 1 1 24.13227,24.13226 l -48.60587,48.60587 47.83787,48.52053 a 17.0496,17.0496 0 0 1 -12.15147,29.04747 z m -230.4,-145.92 H 102.40001 A 17.06667,17.06667 0 0 1 85.33335,614.42662 V 546.15996 H 17.06668 a 17.06667,17.06667 0 1 1 0,-34.13334 H 74.78615 L 1.80908,366.05542 a 17.06667,17.06667 0 0 1 0,-15.27466 L 172.39041,9.61809 a 16.896,16.896 0 0 1 10.82027,-8.99413 16.9472,16.9472 0 0 1 11.81013,1.00693 l 0.85334,0.42667 a 17.03253,17.03253 0 0 1 7.18506,7.50933 l 170.5984,341.17973 a 17.06667,17.06667 0 0 1 0,15.27467 l -72.97706,145.9712 h 57.71946 a 17.06667,17.06667 0 1 1 0,34.13333 h -68.26666 v 68.26667 a 17.06667,17.06667 0 0 1 -17.06667,17.1008 z m -153.6,-34.13333 h 136.53333 v -51.2 H 119.46668 Z m -6.51947,-85.33334 h 149.57227 l 76.8,-153.6 L 204.80001,89.38769 v 126.8224 c 8.78934,2.7648 16.5376,7.4752 23.15947,14.11413 a 58.5728,58.5728 0 0 1 17.80053,42.78614 c 0,16.57173 -6.2976,31.21493 -18.21013,42.3424 -10.30827,11.09333 -24.9344,17.39093 -41.5232,17.39093 a 58.5728,58.5728 0 0 1 -42.78613,-17.80053 c -11.24694,-11.22987 -16.9472,-25.344 -16.9472,-41.9328 0,-16.36694 5.56373,-30.6176 16.55466,-42.35947 8.46507,-7.95307 17.69814,-13.07307 27.81867,-15.5648 V 89.40476 L 36.14721,358.42662 Z m 73.07947,-264.53333 c -7.64587,0 -13.70453,2.33813 -19.06347,7.35573 -4.1984,4.5568 -6.53653,10.61547 -6.53653,18.24427 0,7.40693 2.2016,13.056 6.94613,17.78347 5.3248,5.3248 11.264,7.81653 18.65387,7.81653 7.2704,0 12.62933,-2.26987 17.39093,-7.38987 5.9392,-5.59786 8.20907,-10.9568 8.20907,-18.21013 a 24.91733,24.91733 0 0 0 -7.79947,-18.65387 c -4.31786,-4.31786 -9.59146,-6.53653 -16.55466,-6.94613 z"/>
</g>
`,
iconSize: 32,
viewBox: { x: 32, y: 32 },
mousePoint: { x: 8, y: 8 },
mousePointerGroupString: '<path stroke="{{color}}" d="M8 16L8 0"></path><path stroke="{{color}}" d="M16 8L0 8"></path>'
},
ContourDeleteDisabled: {
iconContent: `
<g xmlns="http://www.w3.org/2000/svg" transform="scale(0.04116214)">
<path style="fill: {{color}};" d="m 503.46668,777.41329 a 17.03253,17.03253 0 0 1 -12.15147,-5.08587 l -47.6672,-48.34986 -47.58186,47.58186 a 17.064088,17.064088 0 1 1 -24.13227,-24.13226 l 47.58187,-47.58187 -48.34987,-47.6672 a 17.06667,17.06667 0 1 1 23.9616,-24.30293 l 48.52053,47.83786 48.60587,-48.60586 a 17.064088,17.064088 0 1 1 24.13227,24.13226 l -48.60587,48.60587 47.83787,48.52053 a 17.0496,17.0496 0 0 1 -12.15147,29.04747 z m -230.4,-145.92 H 102.40001 A 17.06667,17.06667 0 0 1 85.33335,614.42662 V 546.15996 H 17.06668 a 17.06667,17.06667 0 1 1 0,-34.13334 H 74.78615 L 1.80908,366.05542 a 17.06667,17.06667 0 0 1 0,-15.27466 L 172.39041,9.61809 a 16.896,16.896 0 0 1 10.82027,-8.99413 16.9472,16.9472 0 0 1 11.81013,1.00693 l 0.85334,0.42667 a 17.03253,17.03253 0 0 1 7.18506,7.50933 l 170.5984,341.17973 a 17.06667,17.06667 0 0 1 0,15.27467 l -72.97706,145.9712 h 57.71946 a 17.06667,17.06667 0 1 1 0,34.13333 h -68.26666 v 68.26667 a 17.06667,17.06667 0 0 1 -17.06667,17.1008 z m -153.6,-34.13333 h 136.53333 v -51.2 H 119.46668 Z m -6.51947,-85.33334 h 149.57227 l 76.8,-153.6 L 204.80001,89.38769 v 126.8224 c 8.78934,2.7648 16.5376,7.4752 23.15947,14.11413 a 58.5728,58.5728 0 0 1 17.80053,42.78614 c 0,16.57173 -6.2976,31.21493 -18.21013,42.3424 -10.30827,11.09333 -24.9344,17.39093 -41.5232,17.39093 a 58.5728,58.5728 0 0 1 -42.78613,-17.80053 c -11.24694,-11.22987 -16.9472,-25.344 -16.9472,-41.9328 0,-16.36694 5.56373,-30.6176 16.55466,-42.35947 8.46507,-7.95307 17.69814,-13.07307 27.81867,-15.5648 V 89.40476 L 36.14721,358.42662 Z m 73.07947,-264.53333 c -7.64587,0 -13.70453,2.33813 -19.06347,7.35573 -4.1984,4.5568 -6.53653,10.61547 -6.53653,18.24427 0,7.40693 2.2016,13.056 6.94613,17.78347 5.3248,5.3248 11.264,7.81653 18.65387,7.81653 7.2704,0 12.62933,-2.26987 17.39093,-7.38987 5.9392,-5.59786 8.20907,-10.9568 8.20907,-18.21013 a 24.91733,24.91733 0 0 0 -7.79947,-18.65387 c -4.31786,-4.31786 -9.59146,-6.53653 -16.55466,-6.94613 z"/>
<line stroke="{{color}}" stroke-width="60" fill="none" x1="32" y1="727.93518" x2="489" y2="49.064789" stroke-linejoin="undefined" stroke-linecap="undefined"/>
<circle stroke-width="30" cy="728" cx="32" stroke="{{color}}" fill="none" r="15"/>
<circle stroke-width="30" cy="49" cx="489" stroke="{{color}}" fill="none" r="15"/>
</g>
`,
iconSize: 32,
viewBox: { x: 32, y: 32 },
mousePoint: { x: 8, y: 8 },
mousePointerGroupString: '<path stroke="{{color}}" d="M8 16L8 0"></path><path stroke="{{color}}" d="M16 8L0 8"></path>'
}
}, J0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
AXIS_AXES: Ui,
AxisLayout: Xi,
AxisNameI18n: Fe,
CUSTOM_CURSOR: go,
DOSE_DISPLAY_TYPES: qo,
DOSE_LEGENDS: gn,
DOSE_OPACITY_IN_3D: Ko,
Events: it,
FRAME_PT_R: Gt,
Grid: qe,
HeaderIconPaths: Se,
Layout: se,
MODALITY: Js,
RENDERING_ENGINE_ID: Te,
SEGMENTATION_PREFIX: jo,
SERIES_INSTANCE_UID: Hf,
SOP_INSTANCE_UID: Ks,
STREAMING_LOADER_NAME: ve,
TEXT_WHITE_IN_VIEWPORT: Zo,
TOOL_GROUP_TYPE: yt,
ToolsName: b,
ToolsOrder: di,
VOLUME_OPACITY_IN_3D: Jo,
ViewportContainerGridAreaClassName: re
}, Symbol.toStringTag, { value: "Module" }));
function j(n) {
const [t, i] = n.split("|");
return { medicalComponentId: t, seriesType: i };
}
function Y(...n) {
return n.length ? n.join("|") : "";
}
function ht(n) {
return n.split("|");
}
function Xt(n) {
const t = n.getDefaultActor();
return t == null ? void 0 : t.uid.startsWith(ve);
}
const vn = /* @__PURE__ */ new Map();
function Qs(n) {
const { medicalComponentId: t, seriesType: i } = j(n);
let o = vn.get(t);
o || (o = { primary: null, secondary: null }, vn.set(t, o));
const s = {
[z.OrientationAxis.AXIAL]: qt(),
[z.OrientationAxis.SAGITTAL]: qt(),
[z.OrientationAxis.CORONAL]: qt()
};
return Reflect.set(o, i, s), s;
}
function $f(n) {
const { medicalComponentId: t, seriesType: i } = j(n), o = vn.get(t);
return o ? Reflect.get(o, i) : null;
}
function qf(n) {
const t = vn.get(n);
return t || null;
}
function ta(n) {
const { medicalComponentId: t, seriesType: i } = j(n), o = vn.get(t);
o && Reflect.set(o, i, null);
}
const hi = /* @__PURE__ */ new Map();
function ea(n) {
const { medicalComponentId: t, seriesType: i } = j(n);
let o = hi.get(t);
o || (o = { primary: null, secondary: null }, hi.set(t, o));
const s = En({
core: z.OrientationAxis.AXIAL,
south: z.OrientationAxis.SAGITTAL,
north: z.OrientationAxis.CORONAL
});
return Reflect.set(o, i, s), s;
}
function Zf(n) {
const { medicalComponentId: t, seriesType: i } = j(n), o = hi.get(t);
return o ? Reflect.get(o, i) : null;
}
function Qo(n) {
const t = hi.get(n);
return t || null;
}
const pi = /* @__PURE__ */ new Map();
function na(n) {
const { medicalComponentId: t, seriesType: i } = j(n);
let o = pi.get(t);
o || (o = { primary: null, secondary: null }, pi.set(t, o));
const s = En({ core: !1, south: !1, north: !1 });
return Reflect.set(o, i, s), s;
}
function jf(n) {
const { medicalComponentId: t, seriesType: i } = j(n), o = pi.get(t);
return o ? Reflect.get(o, i) : null;
}
function ia(n) {
const t = pi.get(n);
return t || null;
}
const vo = /* @__PURE__ */ new Map();
function oa(n, t) {
const { medicalComponentId: i, seriesType: o } = j(n);
let s = vo.get(i);
return s || (s = { primary: null, secondary: null }, vo.set(i, s)), Reflect.set(s, o, t), t;
}
function Ee(n) {
const { medicalComponentId: t, seriesType: i } = j(n), o = Tn(t);
return o && i ? o[i] : null;
}
function Tn(n) {
const t = vo.get(n);
return t && (t.primary || t.secondary) ? t : null;
}
const yo = /* @__PURE__ */ new Map();
function tr(n) {
let t = yo.get(n);
return t || (t = En({ componentId: null, initOrientation: null, visible: !1 }), yo.set(n, t)), t;
}
function An(n) {
const { medicalComponentId: t } = j(n);
return yo.get(t);
}
const ra = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
deleteAxisElementRef: ta,
get3DViewState: An,
getAxisElementRef: $f,
getAxisFullScreen: jf,
getAxisOrientation: Zf,
getAxixViewportIds: Ee,
getComponentAxisElementRef: qf,
getComponentAxisFullScreen: ia,
getComponentAxisOrientation: Qo,
getComponentViewportIds: Tn,
init3DViewState: tr,
initAxisElementRef: Qs,
initAxisFullScreen: na,
initAxisOrientation: ea,
setAxisViewportIds: oa
}, Symbol.toStringTag, { value: "Module" })), sa = {};
function Jf(n, t) {
if (Kf(t))
Reflect.set(sa, n, t);
else
throw TypeError("Input parameter type error.");
}
function aa(n) {
return Reflect.get(sa, n);
}
function Kf(n) {
return Array.isArray(n) ? !(isNaN(n[0].hu) || isNaN(n[0].ed)) : !1;
}
const Qf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
getElectronDensity: aa,
setElectronDensity: Jf
}, Symbol.toStringTag, { value: "Module" }));
function td(n) {
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
}
var Bi = {}, la = { exports: {} };
(function(n) {
(function() {
var t = {};
t.version = "6.4.2.2", t.use_lines = !0, t.use_xyz = !1;
var i = !1;
n.exports ? (n.exports = t, i = !0) : typeof document < "u" ? window.ClipperLib = t : self.ClipperLib = t;
var o;
if (i) {
var s = "chrome";
o = "Netscape";
} else {
var s = navigator.userAgent.toString().toLowerCase();
o = navigator.appName;
}
var l = {};
s.indexOf("chrome") != -1 && s.indexOf("chromium") == -1 ? l.chrome = 1 : l.chrome = 0, s.indexOf("chromium") != -1 ? l.chromium = 1 : l.chromium = 0, s.indexOf("safari") != -1 && s.indexOf("chrome") == -1 && s.indexOf("chromium") == -1 ? l.safari = 1 : l.safari = 0, s.indexOf("firefox") != -1 ? l.firefox = 1 : l.firefox = 0, s.indexOf("firefox/17") != -1 ? l.firefox17 = 1 : l.firefox17 = 0, s.indexOf("firefox/15") != -1 ? l.firefox15 = 1 : l.firefox15 = 0, s.indexOf("firefox/3") != -1 ? l.firefox3 = 1 : l.firefox3 = 0, s.indexOf("opera") != -1 ? l.opera = 1 : l.opera = 0, s.indexOf("msie 10") != -1 ? l.msie10 = 1 : l.msie10 = 0, s.indexOf("msie 9") != -1 ? l.msie9 = 1 : l.msie9 = 0, s.indexOf("msie 8") != -1 ? l.msie8 = 1 : l.msie8 = 0, s.indexOf("msie 7") != -1 ? l.msie7 = 1 : l.msie7 = 0, s.indexOf("msie ") != -1 ? l.msie = 1 : l.msie = 0, t.biginteger_used = null;
var c;
function u(e, r, a) {
t.biginteger_used = 1, e != null && (typeof e == "number" && typeof r > "u" ? this.fromInt(e) : typeof e == "number" ? this.fromNumber(e, r, a) : r == null && typeof e != "string" ? this.fromString(e, 256) : this.fromString(e, r));
}
function d() {
return new u(null, void 0, void 0);
}
function m(e, r, a, f, h, y) {
for (; --y >= 0; ) {
var C = r * this[e++] + a[f] + h;
h = Math.floor(C / 67108864), a[f++] = C & 67108863;
}
return h;
}
function p(e, r, a, f, h, y) {
for (var C = r & 32767, x = r >> 15; --y >= 0; ) {
var _ = this[e] & 32767, A = this[e++] >> 15, B = x * _ + A * C;
_ = C * _ + ((B & 32767) << 15) + a[f] + (h & 1073741823), h = (_ >>> 30) + (B >>> 15) + x * A + (h >>> 30), a[f++] = _ & 1073741823;
}
return h;
}
function g(e, r, a, f, h, y) {
for (var C = r & 16383, x = r >> 14; --y >= 0; ) {
var _ = this[e] & 16383, A = this[e++] >> 14, B = x * _ + A * C;
_ = C * _ + ((B & 16383) << 14) + a[f] + h, h = (_ >> 28) + (B >> 14) + x * A, a[f++] = _ & 268435455;
}
return h;
}
o == "Microsoft Internet Explorer" ? (u.prototype.am = p, c = 30) : o != "Netscape" ? (u.prototype.am = m, c = 26) : (u.prototype.am = g, c = 28), u.prototype.DB = c, u.prototype.DM = (1 << c) - 1, u.prototype.DV = 1 << c;
var v = 52;
u.prototype.FV = Math.pow(2, v), u.prototype.F1 = v - c, u.prototype.F2 = 2 * c - v;
var P = "0123456789abcdefghijklmnopqrstuvwxyz", w = new Array(), I, D;
for (I = 48, D = 0; D <= 9; ++D) w[I++] = D;
for (I = 97, D = 10; D < 36; ++D) w[I++] = D;
for (I = 65, D = 10; D < 36; ++D) w[I++] = D;
function E(e) {
return P.charAt(e);
}
function S(e, r) {
var a = w[e.charCodeAt(r)];
return a ?? -1;
}
function T(e) {
for (var r = this.t - 1; r >= 0; --r) e[r] = this[r];
e.t = this.t, e.s = this.s;
}
function O(e) {
this.t = 1, this.s = e < 0 ? -1 : 0, e > 0 ? this[0] = e : e < -1 ? this[0] = e + this.DV : this.t = 0;
}
function L(e) {
var r = d();
return r.fromInt(e), r;
}
function M(e, r) {
var a;
if (r == 16) a = 4;
else if (r == 8) a = 3;
else if (r == 256) a = 8;
else if (r == 2) a = 1;
else if (r == 32) a = 5;
else if (r == 4) a = 2;
else {
this.fromRadix(e, r);
return;
}
this.t = 0, this.s = 0;
for (var f = e.length, h = !1, y = 0; --f >= 0; ) {
var C = a == 8 ? e[f] & 255 : S(e, f);
if (C < 0) {
e.charAt(f) == "-" && (h = !0);
continue;
}
h = !1, y == 0 ? this[this.t++] = C : y + a > this.DB ? (this[this.t - 1] |= (C & (1 << this.DB - y) - 1) << y, this[this.t++] = C >> this.DB - y) : this[this.t - 1] |= C << y, y += a, y >= this.DB && (y -= this.DB);
}
a == 8 && e[0] & 128 && (this.s = -1, y > 0 && (this[this.t - 1] |= (1 << this.DB - y) - 1 << y)), this.clamp(), h && u.ZERO.subTo(this, this);
}
function N() {
for (var e = this.s & this.DM; this.t > 0 && this[this.t - 1] == e; ) --this.t;
}
function k(e) {
if (this.s < 0) return "-" + this.negate().toString(e);
var r;
if (e == 16) r = 4;
else if (e == 8) r = 3;
else if (e == 2) r = 1;
else if (e == 32) r = 5;
else if (e == 4) r = 2;
else return this.toRadix(e);
var a = (1 << r) - 1, f, h = !1, y = "", C = this.t, x = this.DB - C * this.DB % r;
if (C-- > 0)
for (x < this.DB && (f = this[C] >> x) > 0 && (h = !0, y = E(f)); C >= 0; )
x < r ? (f = (this[C] & (1 << x) - 1) << r - x, f |= this[--C] >> (x += this.DB - r)) : (f = this[C] >> (x -= r) & a, x <= 0 && (x += this.DB, --C)), f > 0 && (h = !0), h && (y += E(f));
return h ? y : "0";
}
function $() {
var e = d();
return u.ZERO.subTo(this, e), e;
}
function Z() {
return this.s < 0 ? this.negate() : this;
}
function J(e) {
var r = this.s - e.s;
if (r != 0) return r;
var a = this.t;
if (r = a - e.t, r != 0) return this.s < 0 ? -r : r;
for (; --a >= 0; )
if ((r = this[a] - e[a]) != 0) return r;
return 0;
}
function et(e) {
var r = 1, a;
return (a = e >>> 16) != 0 && (e = a, r += 16), (a = e >> 8) != 0 && (e = a, r += 8), (a = e >> 4) != 0 && (e = a, r += 4), (a = e >> 2) != 0 && (e = a, r += 2), (a = e >> 1) != 0 && (e = a, r += 1), r;
}
function tt() {
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + et(this[this.t - 1] ^ this.s & this.DM);
}
function lt(e, r) {
var a;
for (a = this.t - 1; a >= 0; --a) r[a + e] = this[a];
for (a = e - 1; a >= 0; --a) r[a] = 0;
r.t = this.t + e, r.s = this.s;
}
function Pt(e, r) {
for (var a = e; a < this.t; ++a) r[a - e] = this[a];
r.t = Math.max(this.t - e, 0), r.s = this.s;
}
function xt(e, r) {
var a = e % this.DB, f = this.DB - a, h = (1 << f) - 1, y = Math.floor(e / this.DB), C = this.s << a & this.DM, x;
for (x = this.t - 1; x >= 0; --x)
r[x + y + 1] = this[x] >> f | C, C = (this[x] & h) << a;
for (x = y - 1; x >= 0; --x) r[x] = 0;
r[y] = C, r.t = this.t + y + 1, r.s = this.s, r.clamp();
}
function ue(e, r) {
r.s = this.s;
var a = Math.floor(e / this.DB);
if (a >= this.t) {
r.t = 0;
return;
}
var f = e % this.DB, h = this.DB - f, y = (1 << f) - 1;
r[0] = this[a] >> f;
for (var C = a + 1; C < this.t; ++C)
r[C - a - 1] |= (this[C] & y) << h, r[C - a] = this[C] >> f;
f > 0 && (r[this.t - a - 1] |= (this.s & y) << h), r.t = this.t - a, r.clamp();
}
function Ut(e, r) {
for (var a = 0, f = 0, h = Math.min(e.t, this.t); a < h; )
f += this[a] - e[a], r[a++] = f & this.DM, f >>= this.DB;
if (e.t < this.t) {
for (f -= e.s; a < this.t; )
f += this[a], r[a++] = f & this.DM, f >>= this.DB;
f += this.s;
} else {
for (f += this.s; a < e.t; )
f -= e[a], r[a++] = f & this.DM, f >>= this.DB;
f -= e.s;
}
r.s = f < 0 ? -1 : 0, f < -1 ? r[a++] = this.DV + f : f > 0 && (r[a++] = f), r.t = a, r.clamp();
}
function as(e, r) {
var a = this.abs(), f = e.abs(), h = a.t;
for (r.t = h + f.t; --h >= 0; ) r[h] = 0;
for (h = 0; h < f.t; ++h) r[h + a.t] = a.am(0, f[h], r, h, 0, a.t);
r.s = 0, r.clamp(), this.s != e.s && u.ZERO.subTo(r, r);
}
function Gn(e) {
for (var r = this.abs(), a = e.t = 2 * r.t; --a >= 0; ) e[a] = 0;
for (a = 0; a < r.t - 1; ++a) {
var f = r.am(a, r[a], e, 2 * a, 0, 1);
(e[a + r.t] += r.am(a + 1, 2 * r[a], e, 2 * a + 1, f, r.t - a - 1)) >= r.DV && (e[a + r.t] -= r.DV, e[a + r.t + 1] = 1);
}
e.t > 0 && (e[e.t - 1] += r.am(a, r[a], e, 2 * a, 0, 1)), e.s = 0, e.clamp();
}
function to(e, r, a) {
var f = e.abs();
if (!(f.t <= 0)) {
var h = this.abs();
if (h.t < f.t) {
r != null && r.fromInt(0), a != null && this.copyTo(a);
return;
}
a == null && (a = d());
var y = d(), C = this.s, x = e.s, _ = this.DB - et(f[f.t - 1]);
_ > 0 ? (f.lShiftTo(_, y), h.lShiftTo(_, a)) : (f.copyTo(y), h.copyTo(a));
var A = y.t, B = y[A - 1];
if (B != 0) {
var R = B * (1 << this.F1) + (A > 1 ? y[A - 2] >> this.F2 : 0), F = this.FV / R, K = (1 << this.F1) / R, rt = 1 << this.F2, ct = a.t, wt = ct - A, Bt = r ?? d();
for (y.dlShiftTo(wt, Bt), a.compareTo(Bt) >= 0 && (a[a.t++] = 1, a.subTo(Bt, a)), u.ONE.dlShiftTo(A, Bt), Bt.subTo(y, y); y.t < A; ) y[y.t++] = 0;
for (; --wt >= 0; ) {
var oe = a[--ct] == B ? this.DM : Math.floor(a[ct] * F + (a[ct - 1] + rt) * K);
if ((a[ct] += y.am(0, oe, a, wt, 0, A)) < oe)
for (y.dlShiftTo(wt, Bt), a.subTo(Bt, a); a[ct] < --oe; ) a.subTo(Bt, a);
}
r != null && (a.drShiftTo(A, r), C != x && u.ZERO.subTo(r, r)), a.t = A, a.clamp(), _ > 0 && a.rShiftTo(_, a), C < 0 && u.ZERO.subTo(a, a);
}
}
}
function eo(e) {
var r = d();
return this.abs().divRemTo(e, null, r), this.s < 0 && r.compareTo(u.ZERO) > 0 && e.subTo(r, r), r;
}
function fe(e) {
this.m = e;
}
function zn(e) {
return e.s < 0 || e.compareTo(this.m) >= 0 ? e.mod(this.m) : e;
}
function Hn(e) {
return e;
}
function ls(e) {
e.divRemTo(this.m, null, e);
}
function $n(e, r, a) {
e.multiplyTo(r, a), this.reduce(a);
}
function qn(e, r) {
e.squareTo(r), this.reduce(r);
}
fe.prototype.convert = zn, fe.prototype.revert = Hn, fe.prototype.reduce = ls, fe.prototype.mulTo = $n, fe.prototype.sqrTo = qn;
function Ht() {
if (this.t < 1) return 0;
var e = this[0];
if (!(e & 1)) return 0;
var r = e & 3;
return r = r * (2 - (e & 15) * r) & 15, r = r * (2 - (e & 255) * r) & 255, r = r * (2 - ((e & 65535) * r & 65535)) & 65535, r = r * (2 - e * r % this.DV) % this.DV, r > 0 ? this.DV - r : -r;
}
function De(e) {
this.m = e, this.mp = e.invDigit(), this.mpl = this.mp & 32767, this.mph = this.mp >> 15, this.um = (1 << e.DB - 15) - 1, this.mt2 = 2 * e.t;
}
function Gc(e) {
var r = d();
return e.abs().dlShiftTo(this.m.t, r), r.divRemTo(this.m, null, r), e.s < 0 && r.compareTo(u.ZERO) > 0 && this.m.subTo(r, r), r;
}
function zc(e) {
var r = d();
return e.copyTo(r), this.reduce(r), r;
}
function Hc(e) {
for (; e.t <= this.mt2; )
e[e.t++] = 0;
for (var r = 0; r < this.m.t; ++r) {
var a = e[r] & 32767, f = a * this.mpl + ((a * this.mph + (e[r] >> 15) * this.mpl & this.um) << 15) & e.DM;
for (a = r + this.m.t, e[a] += this.m.am(0, f, e, r, 0, this.m.t); e[a] >= e.DV; )
e[a] -= e.DV, e[++a]++;
}
e.clamp(), e.drShiftTo(this.m.t, e), e.compareTo(this.m) >= 0 && e.subTo(this.m, e);
}
function $c(e, r) {
e.squareTo(r), this.reduce(r);
}
function qc(e, r, a) {
e.multiplyTo(r, a), this.reduce(a);
}
De.prototype.convert = Gc, De.prototype.revert = zc, De.prototype.reduce = Hc, De.prototype.mulTo = qc, De.prototype.sqrTo = $c;
function Zc() {
return (this.t > 0 ? this[0] & 1 : this.s) == 0;
}
function jc(e, r) {
if (e > 4294967295 || e < 1) return u.ONE;
var a = d(), f = d(), h = r.convert(this), y = et(e) - 1;
for (h.copyTo(a); --y >= 0; )
if (r.sqrTo(a, f), (e & 1 << y) > 0) r.mulTo(f, h, a);
else {
var C = a;
a = f, f = C;
}
return r.revert(a);
}
function Jc(e, r) {
var a;
return e < 256 || r.isEven() ? a = new fe(r) : a = new De(r), this.exp(e, a);
}
u.prototype.copyTo = T, u.prototype.fromInt = O, u.prototype.fromString = M, u.prototype.clamp = N, u.prototype.dlShiftTo = lt, u.prototype.drShiftTo = Pt, u.prototype.lShiftTo = xt, u.prototype.rShiftTo = ue, u.prototype.subTo = Ut, u.prototype.multiplyTo = as, u.prototype.squareTo = Gn, u.prototype.divRemTo = to, u.prototype.invDigit = Ht, u.prototype.isEven = Zc, u.prototype.exp = jc, u.prototype.toString = k, u.prototype.negate = $, u.prototype.abs = Z, u.prototype.compareTo = J, u.prototype.bitLength = tt, u.prototype.mod = eo, u.prototype.modPowInt = Jc, u.ZERO = L(0), u.ONE = L(1);
function Kc() {
var e = d();
return this.copyTo(e), e;
}
function Qc() {
if (this.s < 0) {
if (this.t == 1) return this[0] - this.DV;
if (this.t == 0) return -1;
} else {
if (this.t == 1) return this[0];
if (this.t == 0) return 0;
}
return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
}
function tu() {
return this.t == 0 ? this.s : this[0] << 24 >> 24;
}
function eu() {
return this.t == 0 ? this.s : this[0] << 16 >> 16;
}
function nu(e) {
return Math.floor(Math.LN2 * this.DB / Math.log(e));
}
function iu() {
return this.s < 0 ? -1 : this.t <= 0 || this.t == 1 && this[0] <= 0 ? 0 : 1;
}
function ou(e) {
if (e == null && (e = 10), this.signum() == 0 || e < 2 || e > 36) return "0";
var r = this.chunkSize(e), a = Math.pow(e, r), f = L(a), h = d(), y = d(), C = "";
for (this.divRemTo(f, h, y); h.signum() > 0; )
C = (a + y.intValue()).toString(e).substr(1) + C, h.divRemTo(f, h, y);
return y.intValue().toString(e) + C;
}
function ru(e, r) {
this.fromInt(0), r == null && (r = 10);
for (var a = this.chunkSize(r), f = Math.pow(r, a), h = !1, y = 0, C = 0, x = 0; x < e.length; ++x) {
var _ = S(e, x);
if (_ < 0) {
e.charAt(x) == "-" && this.signum() == 0 && (h = !0);
continue;
}
C = r * C + _, ++y >= a && (this.dMultiply(f), this.dAddOffset(C, 0), y = 0, C = 0);
}
y > 0 && (this.dMultiply(Math.pow(r, y)), this.dAddOffset(C, 0)), h && u.ZERO.subTo(this, this);
}
function su(e, r, a) {
if (typeof r == "number")
if (e < 2) this.fromInt(1);
else
for (this.fromNumber(e, a), this.testBit(e - 1) || this.bitwiseTo(u.ONE.shiftLeft(e - 1), no, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(r); )
this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(u.ONE.shiftLeft(e - 1), this);
else {
var f = new Array(), h = e & 7;
f.length = (e >> 3) + 1, r.nextBytes(f), h > 0 ? f[0] &= (1 << h) - 1 : f[0] = 0, this.fromString(f, 256);
}
}
function au() {
var e = this.t, r = new Array();
r[0] = this.s;
var a = this.DB - e * this.DB % 8, f, h = 0;
if (e-- > 0)
for (a < this.DB && (f = this[e] >> a) != (this.s & this.DM) >> a && (r[h++] = f | this.s << this.DB - a); e >= 0; )
a < 8 ? (f = (this[e] & (1 << a) - 1) << 8 - a, f |= this[--e] >> (a += this.DB - 8)) : (f = this[e] >> (a -= 8) & 255, a <= 0 && (a += this.DB, --e)), f & 128 && (f |= -256), h == 0 && (this.s & 128) != (f & 128) && ++h, (h > 0 || f != this.s) && (r[h++] = f);
return r;
}
function lu(e) {
return this.compareTo(e) == 0;
}
function cu(e) {
return this.compareTo(e) < 0 ? this : e;
}
function uu(e) {
return this.compareTo(e) > 0 ? this : e;
}
function fu(e, r, a) {
var f, h, y = Math.min(e.t, this.t);
for (f = 0; f < y; ++f) a[f] = r(this[f], e[f]);
if (e.t < this.t) {
for (h = e.s & this.DM, f = y; f < this.t; ++f) a[f] = r(this[f], h);
a.t = this.t;
} else {
for (h = this.s & this.DM, f = y; f < e.t; ++f) a[f] = r(h, e[f]);
a.t = e.t;
}
a.s = r(this.s, e.s), a.clamp();
}
function du(e, r) {
return e & r;
}
function hu(e) {
var r = d();
return this.bitwiseTo(e, du, r), r;
}
function no(e, r) {
return e | r;
}
function pu(e) {
var r = d();
return this.bitwiseTo(e, no, r), r;
}
function cs(e, r) {
return e ^ r;
}
function mu(e) {
var r = d();
return this.bitwiseTo(e, cs, r), r;
}
function us(e, r) {
return e & ~r;
}
function gu(e) {
var r = d();
return this.bitwiseTo(e, us, r), r;
}
function vu() {
for (var e = d(), r = 0; r < this.t; ++r) e[r] = this.DM & ~this[r];
return e.t = this.t, e.s = ~this.s, e;
}
function yu(e) {
var r = d();
return e < 0 ? this.rShiftTo(-e, r) : this.lShiftTo(e, r), r;
}
function Pu(e) {
var r = d();
return e < 0 ? this.lShiftTo(-e, r) : this.rShiftTo(e, r), r;
}
function Iu(e) {
if (e == 0) return -1;
var r = 0;
return e & 65535 || (e >>= 16, r += 16), e & 255 || (e >>= 8, r += 8), e & 15 || (e >>= 4, r += 4), e & 3 || (e >>= 2, r += 2), e & 1 || ++r, r;
}
function wu() {
for (var e = 0; e < this.t; ++e)
if (this[e] != 0) return e * this.DB + Iu(this[e]);
return this.s < 0 ? this.t * this.DB : -1;
}
function Cu(e) {
for (var r = 0; e != 0; )
e &= e - 1, ++r;
return r;
}
function Du() {
for (var e = 0, r = this.s & this.DM, a = 0; a < this.t; ++a) e += Cu(this[a] ^ r);
return e;
}
function xu(e) {
var r = Math.floor(e / this.DB);
return r >= this.t ? this.s != 0 : (this[r] & 1 << e % this.DB) != 0;
}
function _u(e, r) {
var a = u.ONE.shiftLeft(e);
return this.bitwiseTo(a, r, a), a;
}
function Su(e) {
return this.changeBit(e, no);
}
function Eu(e) {
return this.changeBit(e, us);
}
function Tu(e) {
return this.changeBit(e, cs);
}
function Au(e, r) {
for (var a = 0, f = 0, h = Math.min(e.t, this.t); a < h; )
f += this[a] + e[a], r[a++] = f & this.DM, f >>= this.DB;
if (e.t < this.t) {
for (f += e.s; a < this.t; )
f += this[a], r[a++] = f & this.DM, f >>= this.DB;
f += this.s;
} else {
for (f += this.s; a < e.t; )
f += e[a], r[a++] = f & this.DM, f >>= this.DB;
f += e.s;
}
r.s = f < 0 ? -1 : 0, f > 0 ? r[a++] = f : f < -1 && (r[a++] = this.DV + f), r.t = a, r.clamp();
}
function Ou(e) {
var r = d();
return this.addTo(e, r), r;
}
function Mu(e) {
var r = d();
return this.subTo(e, r), r;
}
function bu(e) {
var r = d();
return this.multiplyTo(e, r), r;
}
function Lu() {
var e = d();
return this.squareTo(e), e;
}
function Nu(e) {
var r = d();
return this.divRemTo(e, r, null), r;
}
function Ru(e) {
var r = d();
return this.divRemTo(e, null, r), r;
}
function Xu(e) {
var r = d(), a = d();
return this.divRemTo(e, r, a), new Array(r, a);
}
function Uu(e) {
this[this.t] = this.am(0, e - 1, this, 0, 0, this.t), ++this.t, this.clamp();
}
function Bu(e, r) {
if (e != 0) {
for (; this.t <= r; ) this[this.t++] = 0;
for (this[r] += e; this[r] >= this.DV; )
this[r] -= this.DV, ++r >= this.t && (this[this.t++] = 0), ++this[r];
}
}
function ln() {
}
function fs(e) {
return e;
}
function ku(e, r, a) {
e.multiplyTo(r, a);
}
function Yu(e, r) {
e.squareTo(r);
}
ln.prototype.convert = fs, ln.prototype.revert = fs, ln.prototype.mulTo = ku, ln.prototype.sqrTo = Yu;
function Fu(e) {
return this.exp(e, new ln());
}
function Vu(e, r, a) {
var f = Math.min(this.t + e.t, r);
for (a.s = 0, a.t = f; f > 0; ) a[--f] = 0;
var h;
for (h = a.t - this.t; f < h; ++f) a[f + this.t] = this.am(0, e[f], a, f, 0, this.t);
for (h = Math.min(e.t, r); f < h; ++f) this.am(0, e[f], a, f, 0, r - f);
a.clamp();
}
function Wu(e, r, a) {
--r;
var f = a.t = this.t + e.t - r;
for (a.s = 0; --f >= 0; ) a[f] = 0;
for (f = Math.max(r - this.t, 0); f < e.t; ++f)
a[this.t + f - r] = this.am(r - f, e[f], a, 0, 0, this.t + f - r);
a.clamp(), a.drShiftTo(1, a);
}
function Xe(e) {
this.r2 = d(), this.q3 = d(), u.ONE.dlShiftTo(2 * e.t, this.r2), this.mu = this.r2.divide(e), this.m = e;
}
function Gu(e) {
if (e.s < 0 || e.t > 2 * this.m.t) return e.mod(this.m);
if (e.compareTo(this.m) < 0) return e;
var r = d();
return e.copyTo(r), this.reduce(r), r;
}
function zu(e) {
return e;
}
function Hu(e) {