@annotorious/plugin-segment-anything 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { m as R, c as r, a as k, q as C, F as T, g as H, W, b as O, v as V } from "./get-image-bounds-B6EA1Dbn.js";
1
+ import { m as R, c as r, a as k, q as C, F as T, g as H, W, b as O, v as V } from "./get-image-bounds-uVAZj3ys.js";
2
2
  const L = (s, a, d = {}) => {
3
3
  if (!Number.isFinite(a))
4
4
  throw new TypeError("Expected `wait` to be a finite number");
@@ -1,4 +1,4 @@
1
- import { c as ie, a as Fe, d as Be, q as Oe, F as Ae, f as He, s as Me, g as Le, m as Ie, W as ze, b as ke, v as Ne } from "../get-image-bounds-B6EA1Dbn.js";
1
+ import { c as ie, a as Fe, d as Be, q as Oe, F as Ae, f as He, s as Me, g as Le, m as Ie, W as ze, b as ke, v as Ne } from "../get-image-bounds-uVAZj3ys.js";
2
2
  const Ue = (W) => {
3
3
  const C = ie.imread(W), e = new ie.Mat(), t = new ie.MatVector(), n = new ie.Mat();
4
4
  ie.cvtColor(C, e, ie.COLOR_RGBA2GRAY);
@@ -1366,14 +1366,14 @@ function Ve() {
1366
1366
  */
1367
1367
  multiply(i) {
1368
1368
  let r = this.values, a = i.values;
1369
- var s = r[0 * 3 + 0], o = r[0 * 3 + 1], l = r[0 * 3 + 2], h = r[1 * 3 + 0], d = r[1 * 3 + 1], f = r[1 * 3 + 2], v = r[2 * 3 + 0], w = r[2 * 3 + 1], T = r[2 * 3 + 2], x = a[0 * 3 + 0], E = a[0 * 3 + 1], P = a[0 * 3 + 2], I = a[1 * 3 + 0], B = a[1 * 3 + 1], k = a[1 * 3 + 2], V = a[2 * 3 + 0], j = a[2 * 3 + 1], Z = a[2 * 3 + 2];
1369
+ var s = r[0 * 3 + 0], o = r[0 * 3 + 1], l = r[0 * 3 + 2], h = r[1 * 3 + 0], d = r[1 * 3 + 1], f = r[1 * 3 + 2], v = r[2 * 3 + 0], w = r[2 * 3 + 1], T = r[2 * 3 + 2], x = a[0 * 3 + 0], E = a[0 * 3 + 1], P = a[0 * 3 + 2], z = a[1 * 3 + 0], B = a[1 * 3 + 1], k = a[1 * 3 + 2], V = a[2 * 3 + 0], j = a[2 * 3 + 1], Z = a[2 * 3 + 2];
1370
1370
  return new t([
1371
1371
  x * s + E * h + P * v,
1372
1372
  x * o + E * d + P * w,
1373
1373
  x * l + E * f + P * T,
1374
- I * s + B * h + k * v,
1375
- I * o + B * d + k * w,
1376
- I * l + B * f + k * T,
1374
+ z * s + B * h + k * v,
1375
+ z * o + B * d + k * w,
1376
+ z * l + B * f + k * T,
1377
1377
  V * s + j * h + Z * v,
1378
1378
  V * o + j * d + Z * w,
1379
1379
  V * l + j * f + Z * T
@@ -1581,7 +1581,7 @@ function Ve() {
1581
1581
  P(g, y);
1582
1582
  },
1583
1583
  dblclick: function(y) {
1584
- I(g, y);
1584
+ z(g, y);
1585
1585
  },
1586
1586
  keydown: function(y) {
1587
1587
  B(g, y);
@@ -2372,23 +2372,23 @@ function Ve() {
2372
2372
  }
2373
2373
  }
2374
2374
  e.MouseTracker.gesturePointVelocityTracker = /* @__PURE__ */ function() {
2375
- var p = [], c = 0, g = 0, y = function(Y, L) {
2376
- return Y.hash.toString() + L.type + L.id.toString();
2375
+ var p = [], c = 0, g = 0, y = function(Y, I) {
2376
+ return Y.hash.toString() + I.type + I.id.toString();
2377
2377
  }, S = function() {
2378
- var Y, L = p.length, se, re, ue = e.now(), Pe, Re, Ce;
2379
- for (Pe = ue - g, g = ue, Y = 0; Y < L; Y++)
2378
+ var Y, I = p.length, se, re, ue = e.now(), Pe, Re, Ce;
2379
+ for (Pe = ue - g, g = ue, Y = 0; Y < I; Y++)
2380
2380
  se = p[Y], re = se.gPoint, re.direction = Math.atan2(re.currentPos.y - se.lastPos.y, re.currentPos.x - se.lastPos.x), Re = se.lastPos.distanceTo(re.currentPos), se.lastPos = re.currentPos, Ce = 1e3 * Re / (Pe + 1), re.speed = 0.75 * Ce + 0.25 * re.speed;
2381
- }, D = function(Y, L) {
2382
- var se = y(Y, L);
2381
+ }, D = function(Y, I) {
2382
+ var se = y(Y, I);
2383
2383
  p.push(
2384
2384
  {
2385
2385
  guid: se,
2386
- gPoint: L,
2387
- lastPos: L.currentPos
2386
+ gPoint: I,
2387
+ lastPos: I.currentPos
2388
2388
  }
2389
2389
  ), p.length === 1 && (g = e.now(), c = window.setInterval(S, 50));
2390
- }, M = function(Y, L) {
2391
- var se = y(Y, L), re, ue = p.length;
2390
+ }, M = function(Y, I) {
2391
+ var se = y(Y, I), re, ue = p.length;
2392
2392
  for (re = 0; re < ue; re++)
2393
2393
  if (p[re].guid === se) {
2394
2394
  p.splice(re, 1), ue--, ue === 0 && window.clearInterval(c);
@@ -2655,7 +2655,7 @@ function Ve() {
2655
2655
  };
2656
2656
  m(p, g), g.preventDefault && !g.defaultPrevented && e.cancelEvent(c), g.stopPropagation && e.stopEvent(c);
2657
2657
  }
2658
- function I(p, c) {
2658
+ function z(p, c) {
2659
2659
  var g = {
2660
2660
  originalEvent: c,
2661
2661
  eventType: "dblclick",
@@ -2767,7 +2767,7 @@ function Ve() {
2767
2767
  }, p.contextMenuHandler(g)), (g && g.preventDefault || y.preventDefault && !y.defaultPrevented) && e.cancelEvent(c), y.stopPropagation && e.stopEvent(c);
2768
2768
  }
2769
2769
  function O(p, c) {
2770
- z(p, c, c);
2770
+ L(p, c, c);
2771
2771
  }
2772
2772
  function A(p, c) {
2773
2773
  var g = {
@@ -2783,9 +2783,9 @@ function Ve() {
2783
2783
  deltaX: 0,
2784
2784
  deltaZ: 0
2785
2785
  };
2786
- e.MouseTracker.wheelEventName === "mousewheel" ? g.deltaY = -c.wheelDelta / e.DEFAULT_SETTINGS.pixelsPerWheelLine : g.deltaY = c.detail, z(p, g, c);
2786
+ e.MouseTracker.wheelEventName === "mousewheel" ? g.deltaY = -c.wheelDelta / e.DEFAULT_SETTINGS.pixelsPerWheelLine : g.deltaY = c.detail, L(p, g, c);
2787
2787
  }
2788
- function z(p, c, g) {
2788
+ function L(p, c, g) {
2789
2789
  var y = 0, S, D = null;
2790
2790
  y = c.deltaY ? c.deltaY < 0 ? 1 : -1 : 0, S = {
2791
2791
  originalEvent: c,
@@ -3200,7 +3200,7 @@ function Ve() {
3200
3200
  ) : D.contacts === 2 && p.pinchHandler && g.type === "touch" && (S.pinchGPoints = D.asArray(), S.lastPinchDist = S.currentPinchDist = S.pinchGPoints[0].currentPos.distanceTo(S.pinchGPoints[1].currentPos), S.lastPinchCenter = S.currentPinchCenter = E(S.pinchGPoints[0].currentPos, S.pinchGPoints[1].currentPos))) : (c.shouldCapture = !1, c.shouldReleaseCapture = !1);
3201
3201
  }
3202
3202
  function X(p, c, g, y) {
3203
- var S = t[p.hash], D = p.getActivePointersListByType(g.type), M, Y, L, se = !1, re;
3203
+ var S = t[p.hash], D = p.getActivePointersListByType(g.type), M, Y, I, se = !1, re;
3204
3204
  if (typeof c.originalEvent.buttons < "u" ? D.buttons = c.originalEvent.buttons : y === 0 ? D.buttons ^= -2 : y === 1 ? D.buttons ^= -5 : y === 2 ? D.buttons ^= -3 : y === 3 ? D.buttons ^= -9 : y === 4 ? D.buttons ^= -17 : y === 5 && (D.buttons ^= -33), c.shouldCapture = !1, y !== 0) {
3205
3205
  c.shouldReleaseCapture = !1, p.nonPrimaryReleaseHandler && !c.preventGesture && !c.defaultPrevented && (c.preventDefault = !0, p.nonPrimaryReleaseHandler(
3206
3206
  {
@@ -3216,40 +3216,40 @@ function Ve() {
3216
3216
  ));
3217
3217
  return;
3218
3218
  }
3219
- L = D.getById(g.id), L ? (D.removeContact(), L.captured && (se = !0), L.lastPos = L.currentPos, L.lastTime = L.currentTime, L.currentPos = g.currentPos, L.currentTime = g.currentTime, L.insideElement || he(p, D, L), M = L.currentPos, Y = L.currentTime) : (g.captured = !1, g.insideElementPressed = !1, g.insideElement = !0, ce(D, g), L = g), !c.preventGesture && !c.defaultPrevented && (se ? (c.shouldReleaseCapture = !0, c.preventDefault = !0, (p.dragHandler || p.dragEndHandler || p.pinchHandler) && e.MouseTracker.gesturePointVelocityTracker.removePoint(p, L), D.contacts === 0 ? (p.releaseHandler && M && p.releaseHandler(
3219
+ I = D.getById(g.id), I ? (D.removeContact(), I.captured && (se = !0), I.lastPos = I.currentPos, I.lastTime = I.currentTime, I.currentPos = g.currentPos, I.currentTime = g.currentTime, I.insideElement || he(p, D, I), M = I.currentPos, Y = I.currentTime) : (g.captured = !1, g.insideElementPressed = !1, g.insideElement = !0, ce(D, g), I = g), !c.preventGesture && !c.defaultPrevented && (se ? (c.shouldReleaseCapture = !0, c.preventDefault = !0, (p.dragHandler || p.dragEndHandler || p.pinchHandler) && e.MouseTracker.gesturePointVelocityTracker.removePoint(p, I), D.contacts === 0 ? (p.releaseHandler && M && p.releaseHandler(
3220
3220
  {
3221
3221
  eventSource: p,
3222
- pointerType: L.type,
3222
+ pointerType: I.type,
3223
3223
  position: x(M, p.element),
3224
3224
  buttons: D.buttons,
3225
- insideElementPressed: L.insideElementPressed,
3226
- insideElementReleased: L.insideElement,
3227
- isTouchEvent: L.type === "touch",
3225
+ insideElementPressed: I.insideElementPressed,
3226
+ insideElementReleased: I.insideElement,
3227
+ isTouchEvent: I.type === "touch",
3228
3228
  originalEvent: c.originalEvent,
3229
3229
  userData: p.userData
3230
3230
  }
3231
3231
  ), p.dragEndHandler && S.sentDragEvent && p.dragEndHandler(
3232
3232
  {
3233
3233
  eventSource: p,
3234
- pointerType: L.type,
3235
- position: x(L.currentPos, p.element),
3236
- speed: L.speed,
3237
- direction: L.direction,
3234
+ pointerType: I.type,
3235
+ position: x(I.currentPos, p.element),
3236
+ speed: I.speed,
3237
+ direction: I.direction,
3238
3238
  shift: c.originalEvent.shiftKey,
3239
- isTouchEvent: L.type === "touch",
3239
+ isTouchEvent: I.type === "touch",
3240
3240
  originalEvent: c.originalEvent,
3241
3241
  userData: p.userData
3242
3242
  }
3243
- ), S.sentDragEvent = !1, (p.clickHandler || p.dblClickHandler) && L.insideElement && (re = Y - L.contactTime <= p.clickTimeThreshold && L.contactPos.distanceTo(M) <= p.clickDistThreshold, p.clickHandler && p.clickHandler(
3243
+ ), S.sentDragEvent = !1, (p.clickHandler || p.dblClickHandler) && I.insideElement && (re = Y - I.contactTime <= p.clickTimeThreshold && I.contactPos.distanceTo(M) <= p.clickDistThreshold, p.clickHandler && p.clickHandler(
3244
3244
  {
3245
3245
  eventSource: p,
3246
- pointerType: L.type,
3247
- position: x(L.currentPos, p.element),
3246
+ pointerType: I.type,
3247
+ position: x(I.currentPos, p.element),
3248
3248
  quick: re,
3249
3249
  shift: c.originalEvent.shiftKey,
3250
- isTouchEvent: L.type === "touch",
3250
+ isTouchEvent: I.type === "touch",
3251
3251
  originalEvent: c.originalEvent,
3252
- originalTarget: L.originalTarget,
3252
+ originalTarget: I.originalTarget,
3253
3253
  userData: p.userData
3254
3254
  }
3255
3255
  ), p.dblClickHandler && re && (D.clicks++, D.clicks === 1 ? (S.lastClickPos = M, S.dblClickTimeOut = setTimeout(function() {
@@ -3257,22 +3257,22 @@ function Ve() {
3257
3257
  }, p.dblClickTimeThreshold)) : D.clicks === 2 && (clearTimeout(S.dblClickTimeOut), D.clicks = 0, S.lastClickPos.distanceTo(M) <= p.dblClickDistThreshold && p.dblClickHandler(
3258
3258
  {
3259
3259
  eventSource: p,
3260
- pointerType: L.type,
3261
- position: x(L.currentPos, p.element),
3260
+ pointerType: I.type,
3261
+ position: x(I.currentPos, p.element),
3262
3262
  shift: c.originalEvent.shiftKey,
3263
- isTouchEvent: L.type === "touch",
3263
+ isTouchEvent: I.type === "touch",
3264
3264
  originalEvent: c.originalEvent,
3265
3265
  userData: p.userData
3266
3266
  }
3267
- ), S.lastClickPos = null)))) : D.contacts === 2 && p.pinchHandler && L.type === "touch" && (S.pinchGPoints = D.asArray(), S.lastPinchDist = S.currentPinchDist = S.pinchGPoints[0].currentPos.distanceTo(S.pinchGPoints[1].currentPos), S.lastPinchCenter = S.currentPinchCenter = E(S.pinchGPoints[0].currentPos, S.pinchGPoints[1].currentPos))) : (c.shouldReleaseCapture = !1, p.releaseHandler && M && (p.releaseHandler(
3267
+ ), S.lastClickPos = null)))) : D.contacts === 2 && p.pinchHandler && I.type === "touch" && (S.pinchGPoints = D.asArray(), S.lastPinchDist = S.currentPinchDist = S.pinchGPoints[0].currentPos.distanceTo(S.pinchGPoints[1].currentPos), S.lastPinchCenter = S.currentPinchCenter = E(S.pinchGPoints[0].currentPos, S.pinchGPoints[1].currentPos))) : (c.shouldReleaseCapture = !1, p.releaseHandler && M && (p.releaseHandler(
3268
3268
  {
3269
3269
  eventSource: p,
3270
- pointerType: L.type,
3270
+ pointerType: I.type,
3271
3271
  position: x(M, p.element),
3272
3272
  buttons: D.buttons,
3273
- insideElementPressed: L.insideElementPressed,
3274
- insideElementReleased: L.insideElement,
3275
- isTouchEvent: L.type === "touch",
3273
+ insideElementPressed: I.insideElementPressed,
3274
+ insideElementReleased: I.insideElement,
3275
+ isTouchEvent: I.type === "touch",
3276
3276
  originalEvent: c.originalEvent,
3277
3277
  userData: p.userData
3278
3278
  }
@@ -3729,7 +3729,7 @@ function Ve() {
3729
3729
  keyDownHandler: e.delegate(this, x),
3730
3730
  keyHandler: e.delegate(this, E),
3731
3731
  clickHandler: e.delegate(this, P),
3732
- dblClickHandler: e.delegate(this, I),
3732
+ dblClickHandler: e.delegate(this, z),
3733
3733
  dragHandler: e.delegate(this, B),
3734
3734
  dragEndHandler: e.delegate(this, k),
3735
3735
  enterHandler: e.delegate(this, V),
@@ -3739,7 +3739,7 @@ function Ve() {
3739
3739
  nonPrimaryPressHandler: e.delegate(this, O),
3740
3740
  nonPrimaryReleaseHandler: e.delegate(this, A),
3741
3741
  scrollHandler: e.delegate(this, $),
3742
- pinchHandler: e.delegate(this, z),
3742
+ pinchHandler: e.delegate(this, L),
3743
3743
  focusHandler: e.delegate(this, q),
3744
3744
  blurHandler: e.delegate(this, J)
3745
3745
  }), this.outerTracker = new e.MouseTracker({
@@ -5058,7 +5058,7 @@ function Ve() {
5058
5058
  m.zoomToRefPoint ? this.viewport.pointFromPixel(u.position, !0) : null
5059
5059
  ), this.viewport.applyConstraints()), m.dblClickDragToZoom && (t[this.hash].draggingToZoom === !0 ? (t[this.hash].lastClickTime = null, t[this.hash].draggingToZoom = !1) : t[this.hash].lastClickTime = e.now()));
5060
5060
  }
5061
- function I(u) {
5061
+ function z(u) {
5062
5062
  var m, _ = {
5063
5063
  tracker: u.eventSource,
5064
5064
  position: u.position,
@@ -5196,7 +5196,7 @@ function Ve() {
5196
5196
  originalEvent: u.originalEvent
5197
5197
  });
5198
5198
  }
5199
- function z(u) {
5199
+ function L(u) {
5200
5200
  var m, _, b, F, H = {
5201
5201
  tracker: u.eventSource,
5202
5202
  pointerType: u.pointerType,
@@ -6669,8 +6669,8 @@ function Ve() {
6669
6669
  var l = null;
6670
6670
  return this.levels.length > 0 && a >= this.minLevel && a <= this.maxLevel && (l = this.levels[a].url), l;
6671
6671
  }
6672
- var h = "0", d = Math.pow(0.5, this.maxLevel - a), f, v, w, T, x, E, P, I, B, k, V, j, Z, K, O, A;
6673
- return this.levelSizes ? (f = this.levelSizes[a].width, v = this.levelSizes[a].height) : (f = Math.ceil(this.width * d), v = Math.ceil(this.height * d)), w = this.getTileWidth(a), T = this.getTileHeight(a), x = Math.round(w / d), E = Math.round(T / d), this.version === 1 ? O = "native." + this.tileFormat : O = "default." + this.tileFormat, f < w && v < T ? (this.version === 2 && f === this.width ? j = "full" : this.version === 3 && f === this.width && v === this.height ? j = "max" : this.version === 3 ? j = f + "," + v : j = f + ",", P = "full") : (I = s * x, B = o * E, k = Math.min(x, this.width - I), V = Math.min(E, this.height - B), s === 0 && o === 0 && k === this.width && V === this.height ? P = "full" : P = [I, B, k, V].join(","), Z = Math.min(w, f - s * w), K = Math.min(T, v - o * T), this.version === 2 && Z === this.width ? j = "full" : this.version === 3 && Z === this.width && K === this.height ? j = "max" : this.version === 3 ? j = Z + "," + K : j = Z + ","), A = [this._id, P, j, h, O].join("/"), A;
6672
+ var h = "0", d = Math.pow(0.5, this.maxLevel - a), f, v, w, T, x, E, P, z, B, k, V, j, Z, K, O, A;
6673
+ return this.levelSizes ? (f = this.levelSizes[a].width, v = this.levelSizes[a].height) : (f = Math.ceil(this.width * d), v = Math.ceil(this.height * d)), w = this.getTileWidth(a), T = this.getTileHeight(a), x = Math.round(w / d), E = Math.round(T / d), this.version === 1 ? O = "native." + this.tileFormat : O = "default." + this.tileFormat, f < w && v < T ? (this.version === 2 && f === this.width ? j = "full" : this.version === 3 && f === this.width && v === this.height ? j = "max" : this.version === 3 ? j = f + "," + v : j = f + ",", P = "full") : (z = s * x, B = o * E, k = Math.min(x, this.width - z), V = Math.min(E, this.height - B), s === 0 && o === 0 && k === this.width && V === this.height ? P = "full" : P = [z, B, k, V].join(","), Z = Math.min(w, f - s * w), K = Math.min(T, v - o * T), this.version === 2 && Z === this.width ? j = "full" : this.version === 3 && Z === this.width && K === this.height ? j = "max" : this.version === 3 ? j = Z + "," + K : j = Z + ","), A = [this._id, P, j, h, O].join("/"), A;
6674
6674
  },
6675
6675
  __testonly__: {
6676
6676
  canBeTiled: t,
@@ -7531,16 +7531,16 @@ function Ve() {
7531
7531
  this.containsPoint(f, n) && i.push(f);
7532
7532
  for (var v = this._getSegments(), w = t._getSegments(), T = 0; T < v.length; T++)
7533
7533
  for (var x = v[T], E = 0; E < w.length; E++) {
7534
- var P = w[E], I = B(
7534
+ var P = w[E], z = B(
7535
7535
  x[0],
7536
7536
  x[1],
7537
7537
  P[0],
7538
7538
  P[1]
7539
7539
  );
7540
- I && i.push(I);
7540
+ z && i.push(z);
7541
7541
  }
7542
- function B(A, z, q, J) {
7543
- var $ = z.minus(A), ne = J.minus(q), te = -ne.x * $.y + $.x * ne.y;
7542
+ function B(A, L, q, J) {
7543
+ var $ = L.minus(A), ne = J.minus(q), te = -ne.x * $.y + $.x * ne.y;
7544
7544
  if (te === 0)
7545
7545
  return null;
7546
7546
  var oe = ($.x * (A.y - q.y) - $.y * (A.x - q.x)) / te, ae = (ne.x * (A.y - q.y) - ne.y * (A.x - q.x)) / te;
@@ -7717,17 +7717,17 @@ function Ve() {
7717
7717
  }
7718
7718
  }
7719
7719
  function a(d, f, v) {
7720
- var w, T, x, E, P, I;
7720
+ var w, T, x, E, P, z;
7721
7721
  for (d.scroll === "horizontal" ? w = d.panelWidth : w = d.panelHeight, T = Math.ceil(f / w) + 5, x = Math.ceil((Math.abs(v) + f) / w) + 1, T = x - T, T = T < 0 ? 0 : T, P = T; P < x && P < d.panels.length; P++)
7722
- if (I = d.panels[P], !I.activePanel) {
7722
+ if (z = d.panels[P], !z.activePanel) {
7723
7723
  var B, k = d.viewer.tileSources[P];
7724
7724
  k.referenceStripThumbnailUrl ? B = {
7725
7725
  type: "image",
7726
7726
  url: k.referenceStripThumbnailUrl
7727
7727
  } : B = k, E = new e.Viewer({
7728
- id: I.id,
7728
+ id: z.id,
7729
7729
  tileSources: [B],
7730
- element: I,
7730
+ element: z,
7731
7731
  navigatorSizeRatio: d.sizeRatio,
7732
7732
  showNavigator: !1,
7733
7733
  mouseNavEnabled: !1,
@@ -7740,7 +7740,7 @@ function Ve() {
7740
7740
  ajaxHeaders: d.viewer.ajaxHeaders,
7741
7741
  drawer: "canvas"
7742
7742
  //always use canvas for the reference strip
7743
- }), e.setElementPointerEventsNone(E.canvas), e.setElementPointerEventsNone(E.container), E.innerTracker.setTracking(!1), E.outerTracker.setTracking(!1), d.miniViewers[I.id] = E, I.activePanel = !0;
7743
+ }), e.setElementPointerEventsNone(E.canvas), e.setElementPointerEventsNone(E.container), E.innerTracker.setTracking(!1), E.outerTracker.setTracking(!1), d.miniViewers[z.id] = E, z.activePanel = !0;
7744
7744
  }
7745
7745
  }
7746
7746
  function s(d) {
@@ -8737,9 +8737,9 @@ function Ve() {
8737
8737
  var P = !1;
8738
8738
  if (l._clip) {
8739
8739
  this._saveContext(f);
8740
- var I = l.imageToViewportRectangle(l._clip, !0);
8741
- I = I.rotate(-l.getRotation(!0), l._getRotationPoint(!0));
8742
- var B = this.viewportToDrawerRectangle(I);
8740
+ var z = l.imageToViewportRectangle(l._clip, !0);
8741
+ z = z.rotate(-l.getRotation(!0), l._getRotationPoint(!0));
8742
+ var B = this.viewportToDrawerRectangle(z);
8743
8743
  v && (B = B.times(v)), w && (B = B.translate(w)), this._setClip(B, f), P = !0;
8744
8744
  }
8745
8745
  if (l._croppingPolygons) {
@@ -8747,8 +8747,8 @@ function Ve() {
8747
8747
  P || this._saveContext(f);
8748
8748
  try {
8749
8749
  var V = l._croppingPolygons.map(function(A) {
8750
- return A.map(function(z) {
8751
- var q = l.imageToViewportCoordinates(z.x, z.y, !0).rotate(-l.getRotation(!0), l._getRotationPoint(!0)), J = k.viewportCoordToDrawerCoord(q);
8750
+ return A.map(function(L) {
8751
+ var q = l.imageToViewportCoordinates(L.x, L.y, !0).rotate(-l.getRotation(!0), l._getRotationPoint(!0)), J = k.viewportCoordToDrawerCoord(q);
8752
8752
  return v && (J = J.times(v)), w && (J = J.plus(w)), J;
8753
8753
  });
8754
8754
  });
@@ -8761,8 +8761,8 @@ function Ve() {
8761
8761
  if (l._hasOpaqueTile = !1, l.placeholderFillStyle && l._hasOpaqueTile === !1) {
8762
8762
  let A = this.viewportToDrawerRectangle(l.getBoundsNoRotate(!0));
8763
8763
  v && (A = A.times(v)), w && (A = A.translate(w));
8764
- let z = null;
8765
- typeof l.placeholderFillStyle == "function" ? z = l.placeholderFillStyle(l, this.context) : z = l.placeholderFillStyle, this._drawRectangle(A, z, f);
8764
+ let L = null;
8765
+ typeof l.placeholderFillStyle == "function" ? L = l.placeholderFillStyle(l, this.context) : L = l.placeholderFillStyle, this._drawRectangle(A, L, f);
8766
8766
  }
8767
8767
  var j = s(l.subPixelRoundingForTransparency), Z = !1;
8768
8768
  if (j === e.SUBPIXEL_ROUNDING_OCCURRENCES.ALWAYS)
@@ -8881,12 +8881,12 @@ function Ve() {
8881
8881
  E.x,
8882
8882
  E.y
8883
8883
  )), this._raiseTileDrawingEvent(d, h, l, P);
8884
- var I, B;
8885
- l.sourceBounds ? (I = Math.min(l.sourceBounds.width, P.canvas.width), B = Math.min(l.sourceBounds.height, P.canvas.height)) : (I = P.canvas.width, B = P.canvas.height), h.translate(x.x + E.x / 2, 0), l.flipped && h.scale(-1, 1), h.drawImage(
8884
+ var z, B;
8885
+ l.sourceBounds ? (z = Math.min(l.sourceBounds.width, P.canvas.width), B = Math.min(l.sourceBounds.height, P.canvas.height)) : (z = P.canvas.width, B = P.canvas.height), h.translate(x.x + E.x / 2, 0), l.flipped && h.scale(-1, 1), h.drawImage(
8886
8886
  P.canvas,
8887
8887
  0,
8888
8888
  0,
8889
- I,
8889
+ z,
8890
8890
  B,
8891
8891
  -E.x / 2,
8892
8892
  x.y,
@@ -8990,8 +8990,8 @@ function Ve() {
8990
8990
  h = v.scale || 1, d = v.translate;
8991
8991
  var T = d instanceof e.Point ? d : new e.Point(0, 0), x = 0, E = 0;
8992
8992
  if (d) {
8993
- var P = this.sketchCanvas.width - this.canvas.width, I = this.sketchCanvas.height - this.canvas.height;
8994
- x = Math.round(P / 2), E = Math.round(I / 2);
8993
+ var P = this.sketchCanvas.width - this.canvas.width, z = this.sketchCanvas.height - this.canvas.height;
8994
+ x = Math.round(P / 2), E = Math.round(z / 2);
8995
8995
  }
8996
8996
  this.context.drawImage(
8997
8997
  this.sketchCanvas,
@@ -9246,11 +9246,11 @@ function Ve() {
9246
9246
  let x = w.getTilesToDraw();
9247
9247
  if (w.placeholderFillStyle && w._hasOpaqueTile === !1 && this._drawPlaceholder(w), x.length === 0 || w.getOpacity() === 0)
9248
9248
  return;
9249
- let E = x[0], P = w.compositeOperation || this.viewer.compositeOperation || w._clip || w._croppingPolygons || w.debugMode, I = P || w.opacity < 1 || E.hasTransparency;
9250
- P && (v && this._outputContext.drawImage(this._renderingCanvas, 0, 0), r.bindFramebuffer(r.FRAMEBUFFER, null), r.clear(r.COLOR_BUFFER_BIT)), r.useProgram(this._firstPass.shaderProgram), I ? (r.bindFramebuffer(r.FRAMEBUFFER, this._glFrameBuffer), r.clear(r.COLOR_BUFFER_BIT)) : r.bindFramebuffer(r.FRAMEBUFFER, null);
9249
+ let E = x[0], P = w.compositeOperation || this.viewer.compositeOperation || w._clip || w._croppingPolygons || w.debugMode, z = P || w.opacity < 1 || E.hasTransparency;
9250
+ P && (v && this._outputContext.drawImage(this._renderingCanvas, 0, 0), r.bindFramebuffer(r.FRAMEBUFFER, null), r.clear(r.COLOR_BUFFER_BIT)), r.useProgram(this._firstPass.shaderProgram), z ? (r.bindFramebuffer(r.FRAMEBUFFER, this._glFrameBuffer), r.clear(r.COLOR_BUFFER_BIT)) : r.bindFramebuffer(r.FRAMEBUFFER, null);
9251
9251
  let B = f, k = w.getRotation(!0);
9252
9252
  if (k % 360 !== 0) {
9253
- let A = e.Mat3.makeRotation(-k * Math.PI / 180), z = w.getBoundsNoRotate(!0).getCenter(), q = e.Mat3.makeTranslation(z.x, z.y), J = e.Mat3.makeTranslation(-z.x, -z.y), $ = q.multiply(A).multiply(J);
9253
+ let A = e.Mat3.makeRotation(-k * Math.PI / 180), L = w.getBoundsNoRotate(!0).getCenter(), q = e.Mat3.makeTranslation(L.x, L.y), J = e.Mat3.makeTranslation(-L.x, -L.y), $ = q.multiply(A).multiply(J);
9254
9254
  B = f.multiply($);
9255
9255
  }
9256
9256
  let V = this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS);
@@ -9259,8 +9259,8 @@ function Ve() {
9259
9259
  if too many contexts have been created and not released, or there is another problem with the graphics card.`);
9260
9260
  let j = new Float32Array(V * 12), Z = new Array(V), K = new Array(V), O = new Array(V);
9261
9261
  for (let A = 0; A < x.length; A++) {
9262
- let z = x[A].tile, q = A % V, J = q + 1, $ = z.getCanvasContext(), ne = $ ? this._TextureMap.get($.canvas) : null;
9263
- if (ne || (this._tileReadyHandler({ tile: z, tiledImage: w }), ne = $ ? this._TextureMap.get($.canvas) : null), ne && this._getTileData(z, w, ne, B, q, j, Z, K, O), J === V || A === x.length - 1) {
9262
+ let L = x[A].tile, q = A % V, J = q + 1, $ = L.getCanvasContext(), ne = $ ? this._TextureMap.get($.canvas) : null;
9263
+ if (ne || (this._tileReadyHandler({ tile: L, tiledImage: w }), ne = $ ? this._TextureMap.get($.canvas) : null), ne && this._getTileData(L, w, ne, B, q, j, Z, K, O), J === V || A === x.length - 1) {
9264
9264
  for (let te = 0; te <= J; te++)
9265
9265
  r.activeTexture(r.TEXTURE0 + te), r.bindTexture(r.TEXTURE_2D, Z[te]);
9266
9266
  r.bindBuffer(r.ARRAY_BUFFER, this._firstPass.bufferTexturePosition), r.bufferData(r.ARRAY_BUFFER, j, r.DYNAMIC_DRAW), K.forEach((te, oe) => {
@@ -9268,7 +9268,7 @@ function Ve() {
9268
9268
  }), r.uniform1fv(this._firstPass.uOpacities, new Float32Array(O)), r.bindBuffer(r.ARRAY_BUFFER, this._firstPass.bufferOutputPosition), r.vertexAttribPointer(this._firstPass.aOutputPosition, 2, r.FLOAT, !1, 0, 0), r.bindBuffer(r.ARRAY_BUFFER, this._firstPass.bufferTexturePosition), r.vertexAttribPointer(this._firstPass.aTexturePosition, 2, r.FLOAT, !1, 0, 0), r.bindBuffer(r.ARRAY_BUFFER, this._firstPass.bufferIndex), r.vertexAttribPointer(this._firstPass.aIndex, 1, r.FLOAT, !1, 0, 0), r.drawArrays(r.TRIANGLES, 0, 6 * J);
9269
9269
  }
9270
9270
  }
9271
- I && (r.useProgram(this._secondPass.shaderProgram), r.bindFramebuffer(r.FRAMEBUFFER, null), r.activeTexture(r.TEXTURE0), r.bindTexture(r.TEXTURE_2D, this._renderToTexture), this._gl.uniform1f(this._secondPass.uOpacityMultiplier, w.opacity), r.bindBuffer(r.ARRAY_BUFFER, this._secondPass.bufferTexturePosition), r.vertexAttribPointer(this._secondPass.aTexturePosition, 2, r.FLOAT, !1, 0, 0), r.bindBuffer(r.ARRAY_BUFFER, this._secondPass.bufferOutputPosition), r.vertexAttribPointer(this._secondPass.aOutputPosition, 2, r.FLOAT, !1, 0, 0), r.drawArrays(r.TRIANGLES, 0, 6)), v = !0, P && (this._applyContext2dPipeline(w, x, T), v = !1, r.bindFramebuffer(r.FRAMEBUFFER, null), r.clear(r.COLOR_BUFFER_BIT)), T === 0 && this._raiseTiledImageDrawnEvent(w, x.map((A) => A.tile));
9271
+ z && (r.useProgram(this._secondPass.shaderProgram), r.bindFramebuffer(r.FRAMEBUFFER, null), r.activeTexture(r.TEXTURE0), r.bindTexture(r.TEXTURE_2D, this._renderToTexture), this._gl.uniform1f(this._secondPass.uOpacityMultiplier, w.opacity), r.bindBuffer(r.ARRAY_BUFFER, this._secondPass.bufferTexturePosition), r.vertexAttribPointer(this._secondPass.aTexturePosition, 2, r.FLOAT, !1, 0, 0), r.bindBuffer(r.ARRAY_BUFFER, this._secondPass.bufferOutputPosition), r.vertexAttribPointer(this._secondPass.aOutputPosition, 2, r.FLOAT, !1, 0, 0), r.drawArrays(r.TRIANGLES, 0, 6)), v = !0, P && (this._applyContext2dPipeline(w, x, T), v = !1, r.bindFramebuffer(r.FRAMEBUFFER, null), r.clear(r.COLOR_BUFFER_BIT)), T === 0 && this._raiseTiledImageDrawnEvent(w, x.map((A) => A.tile));
9272
9272
  }
9273
9273
  }), v && this._outputContext.drawImage(this._renderingCanvas, 0, 0);
9274
9274
  }
@@ -9314,7 +9314,7 @@ function Ve() {
9314
9314
  _getTileData(i, r, a, s, o, l, h, d, f) {
9315
9315
  let v = a.texture, w = a.position;
9316
9316
  l.set(w, o * 12);
9317
- let T = this._calculateOverlapFraction(i, r), x = i.positionedBounds.width * T.x, E = i.positionedBounds.height * T.y, P = i.positionedBounds.x + (i.x === 0 ? 0 : x), I = i.positionedBounds.y + (i.y === 0 ? 0 : E), B = i.positionedBounds.x + i.positionedBounds.width - (i.isRightMost ? 0 : x), k = i.positionedBounds.y + i.positionedBounds.height - (i.isBottomMost ? 0 : E), V = B - P, j = k - I, Z = new e.Mat3([
9317
+ let T = this._calculateOverlapFraction(i, r), x = i.positionedBounds.width * T.x, E = i.positionedBounds.height * T.y, P = i.positionedBounds.x + (i.x === 0 ? 0 : x), z = i.positionedBounds.y + (i.y === 0 ? 0 : E), B = i.positionedBounds.x + i.positionedBounds.width - (i.isRightMost ? 0 : x), k = i.positionedBounds.y + i.positionedBounds.height - (i.isBottomMost ? 0 : E), V = B - P, j = k - z, Z = new e.Mat3([
9318
9318
  V,
9319
9319
  0,
9320
9320
  0,
@@ -9322,12 +9322,12 @@ function Ve() {
9322
9322
  j,
9323
9323
  0,
9324
9324
  P,
9325
- I,
9325
+ z,
9326
9326
  1
9327
9327
  ]);
9328
9328
  if (i.flipped) {
9329
- let O = e.Mat3.makeTranslation(0.5, 0), A = e.Mat3.makeTranslation(-0.5, 0), z = O.multiply(e.Mat3.makeScaling(-1, 1)).multiply(A);
9330
- Z = Z.multiply(z);
9329
+ let O = e.Mat3.makeTranslation(0.5, 0), A = e.Mat3.makeTranslation(-0.5, 0), L = O.multiply(e.Mat3.makeScaling(-1, 1)).multiply(A);
9330
+ Z = Z.multiply(L);
9331
9331
  }
9332
9332
  let K = s.multiply(Z);
9333
9333
  f[o] = i.opacity, h[o] = v, d[o] = K.values;
@@ -9507,8 +9507,8 @@ function Ve() {
9507
9507
  if (!this._TextureMap.get(o)) {
9508
9508
  let h = this._gl, d = h.createTexture(), f, v = a.source.tileOverlap, w, T;
9509
9509
  if (r.sourceBounds ? (w = Math.min(r.sourceBounds.width, o.width) / o.width, T = Math.min(r.sourceBounds.height, o.height) / o.height) : (w = 1, T = 1), v > 0) {
9510
- let E = this._calculateOverlapFraction(r, a), P = (r.x === 0 ? 0 : E.x) * w, I = (r.y === 0 ? 0 : E.y) * T, B = (r.isRightMost ? 1 : 1 - E.x) * w, k = (r.isBottomMost ? 1 : 1 - E.y) * T;
9511
- f = this._makeQuadVertexBuffer(P, B, I, k);
9510
+ let E = this._calculateOverlapFraction(r, a), P = (r.x === 0 ? 0 : E.x) * w, z = (r.y === 0 ? 0 : E.y) * T, B = (r.isRightMost ? 1 : 1 - E.x) * w, k = (r.isBottomMost ? 1 : 1 - E.y) * T;
9511
+ f = this._makeQuadVertexBuffer(P, B, z, k);
9512
9512
  } else w === 1 && T === 1 ? f = this._unitQuad : f = this._makeQuadVertexBuffer(0, w, 0, T);
9513
9513
  let x = {
9514
9514
  texture: d,
@@ -11695,7 +11695,7 @@ function Ve() {
11695
11695
  r
11696
11696
  );
11697
11697
  r = E.bestTiles;
11698
- var P = E.updatedTiles.filter((V) => V.loaded), I = /* @__PURE__ */ function(V, j, Z) {
11698
+ var P = E.updatedTiles.filter((V) => V.loaded), z = /* @__PURE__ */ function(V, j, Z) {
11699
11699
  return function(K) {
11700
11700
  return {
11701
11701
  tile: K,
@@ -11705,7 +11705,7 @@ function Ve() {
11705
11705
  };
11706
11706
  };
11707
11707
  }(k, T, s);
11708
- if (this._tilesToDraw[k] = P.map(I), this._providesCoverage(this.coverage, k))
11708
+ if (this._tilesToDraw[k] = P.map(z), this._providesCoverage(this.coverage, k))
11709
11709
  break;
11710
11710
  }
11711
11711
  return r && r.length > 0 ? (r.forEach(function(B) {
@@ -11796,17 +11796,17 @@ function Ve() {
11796
11796
  var h = this._getCornerTiles(t, o, l), d = h.topLeft, f = h.bottomRight, v = this.source.getNumTiles(t), w = this.viewport.pixelFromPoint(this.viewport.getCenter());
11797
11797
  this.getFlip() && (f.x += 1, this.wrapHorizontal || (f.x = Math.min(f.x, v.x - 1)));
11798
11798
  for (var T = Math.max(0, (f.x - d.x) * (f.y - d.y)), x = new Array(T), E = 0, P = d.x; P <= f.x; P++)
11799
- for (var I = d.y; I <= f.y; I++) {
11799
+ for (var z = d.y; z <= f.y; z++) {
11800
11800
  var B;
11801
11801
  if (this.getFlip()) {
11802
11802
  var k = (v.x + P % v.x) % v.x;
11803
11803
  B = P + v.x - k - k - 1;
11804
11804
  } else
11805
11805
  B = P;
11806
- if (r.intersection(this.getTileBounds(t, B, I)) !== null) {
11806
+ if (r.intersection(this.getTileBounds(t, B, z)) !== null) {
11807
11807
  var V = this._updateTile(
11808
11808
  B,
11809
- I,
11809
+ z,
11810
11810
  t,
11811
11811
  i,
11812
11812
  w,
@@ -12580,24 +12580,24 @@ const qe = /* @__PURE__ */ Be(je), Ze = (W, C = [255, 255, 255, 255], e = [0, 0,
12580
12580
  const { viewer: e } = W;
12581
12581
  let t = !1, n = "add";
12582
12582
  const i = We(), r = et(), a = Qe(W.viewer, C), s = $e(W.viewer), o = (O) => {
12583
- const { isSAMReady: A, sam: z } = r;
12584
- if (!z || !A) return;
12585
- const q = e.drawer.canvas, J = q.width / (z.currentScale * q.offsetWidth), $ = q.height / (z.currentScale * q.offsetHeight), ne = O.x * J + z.currentBounds.x, te = O.y * $ + z.currentBounds.y;
12583
+ const { isSAMReady: A, sam: L } = r;
12584
+ if (!L || !A) return;
12585
+ const q = e.drawer.canvas, J = q.width / (L.currentScale * q.offsetWidth), $ = q.height / (L.currentScale * q.offsetHeight), ne = O.x * J + L.currentBounds.x, te = O.y * $ + L.currentBounds.y;
12586
12586
  return { x: ne, y: te };
12587
12587
  }, l = (O) => {
12588
12588
  var q;
12589
12589
  if (!r.isSAMReady || !r.isOSDReady || !!((q = r.sam) != null && q.currentPrompt)) return;
12590
- const z = { x: O.offsetX, y: O.offsetY };
12591
- r.lastPointerPos = z, r.isAnimationInProgress || w(z);
12590
+ const L = { x: O.offsetX, y: O.offsetY };
12591
+ r.lastPointerPos = L, r.isAnimationInProgress || w(L);
12592
12592
  }, h = (O) => {
12593
12593
  var ne, te, oe, ae;
12594
- const A = { x: O.offsetX, y: O.offsetY }, z = o(A);
12595
- if (!z) return;
12594
+ const A = { x: O.offsetX, y: O.offsetY }, L = o(A);
12595
+ if (!L) return;
12596
12596
  O.shiftKey || n === "remove" ? r.sam.currentPrompt = {
12597
12597
  include: ((ne = r.sam.currentPrompt) == null ? void 0 : ne.include) || [],
12598
- exclude: [...((te = r.sam.currentPrompt) == null ? void 0 : te.exclude) || [], z]
12598
+ exclude: [...((te = r.sam.currentPrompt) == null ? void 0 : te.exclude) || [], L]
12599
12599
  } : r.sam.currentPrompt = {
12600
- include: [...((oe = r.sam.currentPrompt) == null ? void 0 : oe.include) || [], z],
12600
+ include: [...((oe = r.sam.currentPrompt) == null ? void 0 : oe.include) || [], L],
12601
12601
  exclude: ((ae = r.sam.currentPrompt) == null ? void 0 : ae.exclude) || []
12602
12602
  };
12603
12603
  const { currentPrompt: q, currentBounds: J, currentScale: $ } = r.sam;
@@ -12618,14 +12618,14 @@ const qe = /* @__PURE__ */ Be(je), Ze = (W, C = [255, 255, 255, 255], e = [0, 0,
12618
12618
  r.isAnimationInProgress = !0, i.emit("animationStart"), r.sam = void 0, a.clear(), s.clear();
12619
12619
  }, x = () => {
12620
12620
  if (r.isAnimationInProgress = !1, i.emit("animationStart"), !r.isOSDReady || !t) return;
12621
- const { canvas: O, bounds: A, scale: z } = Ke(e.drawer.canvas);
12621
+ const { canvas: O, bounds: A, scale: L } = Ke(e.drawer.canvas);
12622
12622
  r.sam = {
12623
12623
  // The current 1024 x 1024 SAM working canvas
12624
12624
  currentCanvas: O,
12625
12625
  // The bbox of the resized & padded viewport on the working canvas
12626
12626
  currentBounds: A,
12627
12627
  // The current SAM scale (longer image dimension / 1024)
12628
- currentScale: z,
12628
+ currentScale: L,
12629
12629
  // New annotation ID for the current shape
12630
12630
  currentAnnotationId: Ne()
12631
12631
  }, r.isSAMReady && v();
@@ -12638,7 +12638,7 @@ const qe = /* @__PURE__ */ Be(je), Ze = (W, C = [255, 255, 255, 255], e = [0, 0,
12638
12638
  }, P = () => {
12639
12639
  var O, A;
12640
12640
  (O = e.element) == null || O.removeEventListener("pointermove", l), (A = e.element) == null || A.removeEventListener("pointerdown", f), e == null || e.removeHandler("animation-start", T), e == null || e.removeHandler("animation-finish", x), e == null || e.removeHandler("canvas-click", d);
12641
- }, I = (O) => n = O, B = () => {
12641
+ }, z = (O) => n = O, B = () => {
12642
12642
  var O;
12643
12643
  t = !0, (O = r.sam) != null && O.currentPrompt && i.emit("promptChanged", void 0), r.sam = void 0, a.show(), s.show(), E(), x();
12644
12644
  }, k = () => {
@@ -12655,27 +12655,30 @@ const qe = /* @__PURE__ */ Be(je), Ze = (W, C = [255, 255, 255, 255], e = [0, 0,
12655
12655
  if (A === "init_success")
12656
12656
  r.isSAMReady = !0, i.emit("initialized"), t && v();
12657
12657
  else if (A === "encode_success") {
12658
- const { viewportVersion: z } = O.data;
12659
- z < r.viewportVersion ? console.log("[a9s-sam] Stale encoding - discarding") : (i.emit("encodingFinished"), r.lastPointerPos && w(r.lastPointerPos));
12658
+ const { viewportVersion: L } = O.data;
12659
+ L < r.viewportVersion ? console.log("[a9s-sam] Stale encoding - discarding") : (i.emit("encodingFinished"), r.lastPointerPos && w(r.lastPointerPos));
12660
12660
  } else if (A === "decode_preview_success") {
12661
12661
  if (r.sam && !r.isAnimationInProgress) {
12662
- const { result: z, viewportVersion: q } = O.data;
12663
- q === r.viewportVersion ? a.render(z, r.sam.currentBounds) : console.log("[a9s-sam] Stale preview - discarding");
12662
+ const { result: L, viewportVersion: q } = O.data;
12663
+ q === r.viewportVersion ? a.render(L, r.sam.currentBounds) : console.log("[a9s-sam] Stale preview - discarding");
12664
12664
  }
12665
12665
  } else if (A === "decode_success") {
12666
12666
  if (a.clear(), r.sam) {
12667
- const z = Xe(O.data.result, r.sam, W.getUser(), e), { store: q } = W.state;
12668
- q.getAnnotation(r.sam.currentAnnotationId) ? q.updateAnnotation(r.sam.currentAnnotationId, z) : q.addAnnotation(z);
12667
+ const L = Xe(O.data.result, r.sam, W.getUser(), e), { store: q } = W.state;
12668
+ q.getAnnotation(r.sam.currentAnnotationId) ? q.updateAnnotation(r.sam.currentAnnotationId, L) : q.addAnnotation(L);
12669
12669
  }
12670
+ } else if (A === "init_error") {
12671
+ const { error: L } = O.data;
12672
+ i.emit("initError", L);
12670
12673
  } else if (A === "encode_error") {
12671
- const { viewportVersion: z } = O.data;
12672
- z === r.viewportVersion && setTimeout(() => v(), 100);
12674
+ const { viewportVersion: L } = O.data;
12675
+ L === r.viewportVersion && setTimeout(() => v(), 100);
12673
12676
  }
12674
12677
  }, K.postMessage({ type: "init" }), {
12675
12678
  destroy: Z,
12676
12679
  reset: j,
12677
12680
  restart: V,
12678
- setQueryMode: I,
12681
+ setQueryMode: z,
12679
12682
  start: B,
12680
12683
  stop: k,
12681
12684
  on: (O, A) => i.on(O, A)