@inweb/viewer-three 26.3.3 → 26.4.0

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.
@@ -39,7 +39,7 @@
39
39
  }
40
40
  const {handler: handler, thisArg: thisArg} = command;
41
41
  const result = handler.apply(thisArg, [ viewer, ...args ]);
42
- viewer === null || viewer === void 0 ? void 0 : viewer.emit({
42
+ viewer === null || viewer === undefined ? undefined : viewer.emit({
43
43
  type: "command",
44
44
  data: id,
45
45
  args: args
@@ -484,7 +484,7 @@
484
484
  hasRequiredGlobal = 1;
485
485
  (function (exports) {
486
486
  Object.defineProperty(exports, "__esModule", { value: true });
487
- exports._registerNode = exports.Konva = exports.glob = void 0;
487
+ exports._registerNode = exports.Konva = exports.glob = undefined;
488
488
  const PI_OVER_180 = Math.PI / 180;
489
489
  function detectBrowser() {
490
490
  return (typeof window !== 'undefined' &&
@@ -500,7 +500,7 @@
500
500
  : {};
501
501
  exports.Konva = {
502
502
  _global: exports.glob,
503
- version: '9.3.20',
503
+ version: '9.3.18',
504
504
  isBrowser: detectBrowser(),
505
505
  isUnminified: /param/.test(function (param) { }.toString()),
506
506
  dblClickWindow: 400,
@@ -532,7 +532,7 @@
532
532
  },
533
533
  isTransforming() {
534
534
  var _a;
535
- return (_a = exports.Konva['Transformer']) === null || _a === void 0 ? void 0 : _a.isTransforming();
535
+ return (_a = exports.Konva['Transformer']) === null || _a === undefined ? undefined : _a.isTransforming();
536
536
  },
537
537
  isDragReady() {
538
538
  return !!exports.Konva['DD'].node;
@@ -561,7 +561,7 @@
561
561
  hasRequiredUtil = 1;
562
562
  (function (exports) {
563
563
  Object.defineProperty(exports, "__esModule", { value: true });
564
- exports.Util = exports.Transform = void 0;
564
+ exports.Util = exports.Transform = undefined;
565
565
  const Global_1 = requireGlobal();
566
566
  class Transform {
567
567
  constructor(m = [1, 0, 0, 1, 0, 0]) {
@@ -1579,7 +1579,7 @@
1579
1579
  hasRequiredFactory = 1;
1580
1580
  (function (exports) {
1581
1581
  Object.defineProperty(exports, "__esModule", { value: true });
1582
- exports.Factory = void 0;
1582
+ exports.Factory = undefined;
1583
1583
  const Util_1 = requireUtil();
1584
1584
  const Validators_1 = requireValidators();
1585
1585
  const GET = 'get';
@@ -1717,7 +1717,7 @@
1717
1717
  if (hasRequiredContext) return Context;
1718
1718
  hasRequiredContext = 1;
1719
1719
  Object.defineProperty(Context, "__esModule", { value: true });
1720
- Context.HitContext = Context.SceneContext = Context.Context = void 0;
1720
+ Context.HitContext = Context.SceneContext = Context.Context = undefined;
1721
1721
  const Util_1 = requireUtil();
1722
1722
  const Global_1 = requireGlobal();
1723
1723
  function simplifyArray(arr) {
@@ -2206,7 +2206,7 @@
2206
2206
  }
2207
2207
  _applyShadow(shape) {
2208
2208
  var _a, _b, _c;
2209
- const color = (_a = shape.getShadowRGBA()) !== null && _a !== void 0 ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== void 0 ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {
2209
+ const color = (_a = shape.getShadowRGBA()) !== null && _a !== undefined ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== undefined ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== undefined ? _c : {
2210
2210
  x: 0,
2211
2211
  y: 0,
2212
2212
  }, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;
@@ -2265,10 +2265,12 @@
2265
2265
  if (hasRequiredCanvas) return Canvas;
2266
2266
  hasRequiredCanvas = 1;
2267
2267
  Object.defineProperty(Canvas, "__esModule", { value: true });
2268
- Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas = void 0;
2268
+ Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas = undefined;
2269
2269
  const Util_1 = requireUtil();
2270
2270
  const Context_1 = requireContext();
2271
2271
  const Global_1 = requireGlobal();
2272
+ const Factory_1 = requireFactory();
2273
+ const Validators_1 = requireValidators();
2272
2274
  let _pixelRatio;
2273
2275
  function getDevicePixelRatio() {
2274
2276
  if (_pixelRatio) {
@@ -2357,6 +2359,7 @@
2357
2359
  }
2358
2360
  };
2359
2361
  Canvas.Canvas = Canvas$1;
2362
+ Factory_1.Factory.addGetterSetter(Canvas$1, 'pixelRatio', undefined, (0, Validators_1.getNumberValidator)());
2360
2363
  class SceneCanvas extends Canvas$1 {
2361
2364
  constructor(config = { width: 0, height: 0, willReadFrequently: false }) {
2362
2365
  super(config);
@@ -2388,7 +2391,7 @@
2388
2391
  hasRequiredDragAndDrop = 1;
2389
2392
  (function (exports) {
2390
2393
  Object.defineProperty(exports, "__esModule", { value: true });
2391
- exports.DD = void 0;
2394
+ exports.DD = undefined;
2392
2395
  const Global_1 = requireGlobal();
2393
2396
  const Util_1 = requireUtil();
2394
2397
  exports.DD = {
@@ -2509,7 +2512,7 @@
2509
2512
  if (hasRequiredNode) return Node;
2510
2513
  hasRequiredNode = 1;
2511
2514
  Object.defineProperty(Node, "__esModule", { value: true });
2512
- Node.Node = void 0;
2515
+ Node.Node = undefined;
2513
2516
  const Util_1 = requireUtil();
2514
2517
  const Factory_1 = requireFactory();
2515
2518
  const Canvas_1 = requireCanvas();
@@ -3414,7 +3417,7 @@
3414
3417
  var _a, _b;
3415
3418
  const m = this._cache.get(TRANSFORM) || new Util_1.Transform();
3416
3419
  m.reset();
3417
- const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== void 0 ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== void 0 ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;
3420
+ const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== undefined ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== undefined ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;
3418
3421
  if (x !== 0 || y !== 0) {
3419
3422
  m.translate(x, y);
3420
3423
  }
@@ -3616,7 +3619,7 @@
3616
3619
  _requestDraw() {
3617
3620
  if (Global_1.Konva.autoDrawEnabled) {
3618
3621
  const drawNode = this.getLayer() || this.getStage();
3619
- drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();
3622
+ drawNode === null || drawNode === undefined ? undefined : drawNode.batchDraw();
3620
3623
  }
3621
3624
  }
3622
3625
  _setAttr(key, val) {
@@ -3677,13 +3680,13 @@
3677
3680
  }
3678
3681
  _getProtoListeners(eventType) {
3679
3682
  var _a, _b, _c;
3680
- const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== void 0 ? _a : {};
3681
- let events = allListeners === null || allListeners === void 0 ? void 0 : allListeners[eventType];
3683
+ const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== undefined ? _a : {};
3684
+ let events = allListeners === null || allListeners === undefined ? undefined : allListeners[eventType];
3682
3685
  if (events === undefined) {
3683
3686
  events = [];
3684
3687
  let obj = Object.getPrototypeOf(this);
3685
3688
  while (obj) {
3686
- const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === void 0 ? void 0 : _b[eventType]) !== null && _c !== void 0 ? _c : [];
3689
+ const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === undefined ? undefined : _b[eventType]) !== null && _c !== undefined ? _c : [];
3687
3690
  events.push(...hierarchyEvents);
3688
3691
  obj = Object.getPrototypeOf(obj);
3689
3692
  }
@@ -3949,7 +3952,7 @@
3949
3952
  if (hasRequiredContainer) return Container;
3950
3953
  hasRequiredContainer = 1;
3951
3954
  Object.defineProperty(Container, "__esModule", { value: true });
3952
- Container.Container = void 0;
3955
+ Container.Container = undefined;
3953
3956
  const Factory_1 = requireFactory();
3954
3957
  const Node_1 = requireNode();
3955
3958
  const Validators_1 = requireValidators();
@@ -4106,13 +4109,13 @@
4106
4109
  if (this.isCached()) {
4107
4110
  return;
4108
4111
  }
4109
- (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (node) {
4112
+ (_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (node) {
4110
4113
  node._clearSelfAndDescendantCache(attr);
4111
4114
  });
4112
4115
  }
4113
4116
  _setChildrenIndices() {
4114
4117
  var _a;
4115
- (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child, n) {
4118
+ (_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (child, n) {
4116
4119
  child.index = n;
4117
4120
  });
4118
4121
  this._requestDraw();
@@ -4183,7 +4186,7 @@
4183
4186
  context.save();
4184
4187
  context._applyGlobalCompositeOperation(this);
4185
4188
  }
4186
- (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
4189
+ (_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (child) {
4187
4190
  child[drawMethod](canvas, top, bufferCanvas);
4188
4191
  });
4189
4192
  if (hasComposition) {
@@ -4205,7 +4208,7 @@
4205
4208
  height: 0,
4206
4209
  };
4207
4210
  const that = this;
4208
- (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
4211
+ (_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (child) {
4209
4212
  if (!child.visible()) {
4210
4213
  return;
4211
4214
  }
@@ -4337,7 +4340,7 @@
4337
4340
  hasRequiredStage = 1;
4338
4341
  (function (exports) {
4339
4342
  Object.defineProperty(exports, "__esModule", { value: true });
4340
- exports.Stage = exports.stages = void 0;
4343
+ exports.Stage = exports.stages = undefined;
4341
4344
  const Util_1 = requireUtil();
4342
4345
  const Factory_1 = requireFactory();
4343
4346
  const Container_1 = requireContainer();
@@ -5054,7 +5057,7 @@
5054
5057
  hasRequiredShape = 1;
5055
5058
  (function (exports) {
5056
5059
  Object.defineProperty(exports, "__esModule", { value: true });
5057
- exports.Shape = exports.shapes = void 0;
5060
+ exports.Shape = exports.shapes = undefined;
5058
5061
  const Global_1 = requireGlobal();
5059
5062
  const Util_1 = requireUtil();
5060
5063
  const Factory_1 = requireFactory();
@@ -5287,7 +5290,7 @@
5287
5290
  }
5288
5291
  _useBufferCanvas(forceFill) {
5289
5292
  var _a;
5290
- const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== void 0 ? _a : true;
5293
+ const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== undefined ? _a : true;
5291
5294
  if (!perfectDrawEnabled) {
5292
5295
  return false;
5293
5296
  }
@@ -5607,7 +5610,7 @@
5607
5610
  if (hasRequiredLayer) return Layer;
5608
5611
  hasRequiredLayer = 1;
5609
5612
  Object.defineProperty(Layer, "__esModule", { value: true });
5610
- Layer.Layer = void 0;
5613
+ Layer.Layer = undefined;
5611
5614
  const Util_1 = requireUtil();
5612
5615
  const Container_1 = requireContainer();
5613
5616
  const Node_1 = requireNode();
@@ -5925,7 +5928,7 @@
5925
5928
  if (hasRequiredFastLayer) return FastLayer;
5926
5929
  hasRequiredFastLayer = 1;
5927
5930
  Object.defineProperty(FastLayer, "__esModule", { value: true });
5928
- FastLayer.FastLayer = void 0;
5931
+ FastLayer.FastLayer = undefined;
5929
5932
  const Util_1 = requireUtil();
5930
5933
  const Layer_1 = requireLayer();
5931
5934
  const Global_1 = requireGlobal();
@@ -5950,7 +5953,7 @@
5950
5953
  if (hasRequiredGroup) return Group$1;
5951
5954
  hasRequiredGroup = 1;
5952
5955
  Object.defineProperty(Group$1, "__esModule", { value: true });
5953
- Group$1.Group = void 0;
5956
+ Group$1.Group = undefined;
5954
5957
  const Util_1 = requireUtil();
5955
5958
  const Container_1 = requireContainer();
5956
5959
  const Global_1 = requireGlobal();
@@ -5976,7 +5979,7 @@
5976
5979
  if (hasRequiredAnimation) return Animation;
5977
5980
  hasRequiredAnimation = 1;
5978
5981
  Object.defineProperty(Animation, "__esModule", { value: true });
5979
- Animation.Animation = void 0;
5982
+ Animation.Animation = undefined;
5980
5983
  const Global_1 = requireGlobal();
5981
5984
  const Util_1 = requireUtil();
5982
5985
  const now = (function () {
@@ -6132,7 +6135,7 @@
6132
6135
  hasRequiredTween = 1;
6133
6136
  (function (exports) {
6134
6137
  Object.defineProperty(exports, "__esModule", { value: true });
6135
- exports.Easings = exports.Tween = void 0;
6138
+ exports.Easings = exports.Tween = undefined;
6136
6139
  const Util_1 = requireUtil();
6137
6140
  const Animation_1 = requireAnimation();
6138
6141
  const Node_1 = requireNode();
@@ -6665,7 +6668,7 @@
6665
6668
  hasRequired_CoreInternals = 1;
6666
6669
  (function (exports) {
6667
6670
  Object.defineProperty(exports, "__esModule", { value: true });
6668
- exports.Konva = void 0;
6671
+ exports.Konva = undefined;
6669
6672
  const Global_1 = requireGlobal();
6670
6673
  const Util_1 = requireUtil();
6671
6674
  const Node_1 = requireNode();
@@ -6712,7 +6715,7 @@
6712
6715
  if (hasRequiredArc) return Arc;
6713
6716
  hasRequiredArc = 1;
6714
6717
  Object.defineProperty(Arc, "__esModule", { value: true });
6715
- Arc.Arc = void 0;
6718
+ Arc.Arc = undefined;
6716
6719
  const Factory_1 = requireFactory();
6717
6720
  const Shape_1 = requireShape();
6718
6721
  const Global_1 = requireGlobal();
@@ -6763,12 +6766,7 @@
6763
6766
  Arc.Arc = Arc$1;
6764
6767
  Arc$1.prototype._centroid = true;
6765
6768
  Arc$1.prototype.className = 'Arc';
6766
- Arc$1.prototype._attrsAffectingSize = [
6767
- 'innerRadius',
6768
- 'outerRadius',
6769
- 'angle',
6770
- 'clockwise',
6771
- ];
6769
+ Arc$1.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];
6772
6770
  (0, Global_2._registerNode)(Arc$1);
6773
6771
  Factory_1.Factory.addGetterSetter(Arc$1, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());
6774
6772
  Factory_1.Factory.addGetterSetter(Arc$1, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());
@@ -6787,7 +6785,7 @@
6787
6785
  if (hasRequiredLine) return Line$1;
6788
6786
  hasRequiredLine = 1;
6789
6787
  Object.defineProperty(Line$1, "__esModule", { value: true });
6790
- Line$1.Line = void 0;
6788
+ Line$1.Line = undefined;
6791
6789
  const Factory_1 = requireFactory();
6792
6790
  const Global_1 = requireGlobal();
6793
6791
  const Shape_1 = requireShape();
@@ -6958,7 +6956,7 @@
6958
6956
  hasRequiredBezierFunctions = 1;
6959
6957
  (function (exports) {
6960
6958
  Object.defineProperty(exports, "__esModule", { value: true });
6961
- exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = void 0;
6959
+ exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = undefined;
6962
6960
  exports.tValues = [
6963
6961
  [],
6964
6962
  [],
@@ -7756,7 +7754,7 @@
7756
7754
  if (hasRequiredPath) return Path;
7757
7755
  hasRequiredPath = 1;
7758
7756
  Object.defineProperty(Path, "__esModule", { value: true });
7759
- Path.Path = void 0;
7757
+ Path.Path = undefined;
7760
7758
  const Factory_1 = requireFactory();
7761
7759
  const Shape_1 = requireShape();
7762
7760
  const Global_1 = requireGlobal();
@@ -7939,8 +7937,8 @@
7939
7937
  return null;
7940
7938
  }
7941
7939
  static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {
7942
- fromX = fromX !== null && fromX !== void 0 ? fromX : P1x;
7943
- fromY = fromY !== null && fromY !== void 0 ? fromY : P1y;
7940
+ fromX = fromX !== null && fromX !== undefined ? fromX : P1x;
7941
+ fromY = fromY !== null && fromY !== undefined ? fromY : P1y;
7944
7942
  const len = this.getLineLength(P1x, P1y, P2x, P2y);
7945
7943
  if (len < 1e-10) {
7946
7944
  return { x: P1x, y: P1y };
@@ -8369,7 +8367,7 @@
8369
8367
  if (hasRequiredArrow) return Arrow;
8370
8368
  hasRequiredArrow = 1;
8371
8369
  Object.defineProperty(Arrow, "__esModule", { value: true });
8372
- Arrow.Arrow = void 0;
8370
+ Arrow.Arrow = undefined;
8373
8371
  const Factory_1 = requireFactory();
8374
8372
  const Line_1 = requireLine();
8375
8373
  const Validators_1 = requireValidators();
@@ -8481,7 +8479,7 @@
8481
8479
  if (hasRequiredCircle) return Circle;
8482
8480
  hasRequiredCircle = 1;
8483
8481
  Object.defineProperty(Circle, "__esModule", { value: true });
8484
- Circle.Circle = void 0;
8482
+ Circle.Circle = undefined;
8485
8483
  const Factory_1 = requireFactory();
8486
8484
  const Shape_1 = requireShape();
8487
8485
  const Validators_1 = requireValidators();
@@ -8527,7 +8525,7 @@
8527
8525
  if (hasRequiredEllipse) return Ellipse;
8528
8526
  hasRequiredEllipse = 1;
8529
8527
  Object.defineProperty(Ellipse, "__esModule", { value: true });
8530
- Ellipse.Ellipse = void 0;
8528
+ Ellipse.Ellipse = undefined;
8531
8529
  const Factory_1 = requireFactory();
8532
8530
  const Shape_1 = requireShape();
8533
8531
  const Validators_1 = requireValidators();
@@ -8577,7 +8575,7 @@
8577
8575
  if (hasRequiredImage) return Image$1;
8578
8576
  hasRequiredImage = 1;
8579
8577
  Object.defineProperty(Image$1, "__esModule", { value: true });
8580
- Image$1.Image = void 0;
8578
+ Image$1.Image = undefined;
8581
8579
  const Util_1 = requireUtil();
8582
8580
  const Factory_1 = requireFactory();
8583
8581
  const Shape_1 = requireShape();
@@ -8586,11 +8584,7 @@
8586
8584
  class Image extends Shape_1.Shape {
8587
8585
  constructor(attrs) {
8588
8586
  super(attrs);
8589
- this._loadListener = () => {
8590
- this._requestDraw();
8591
- };
8592
- this.on('imageChange.konva', (props) => {
8593
- this._removeImageLoad(props.oldVal);
8587
+ this.on('imageChange.konva', () => {
8594
8588
  this._setImageLoad();
8595
8589
  });
8596
8590
  this._setImageLoad();
@@ -8604,19 +8598,11 @@
8604
8598
  return;
8605
8599
  }
8606
8600
  if (image && image['addEventListener']) {
8607
- image['addEventListener']('load', this._loadListener);
8608
- }
8609
- }
8610
- _removeImageLoad(image) {
8611
- if (image && image['removeEventListener']) {
8612
- image['removeEventListener']('load', this._loadListener);
8601
+ image['addEventListener']('load', () => {
8602
+ this._requestDraw();
8603
+ });
8613
8604
  }
8614
8605
  }
8615
- destroy() {
8616
- this._removeImageLoad(this.image());
8617
- super.destroy();
8618
- return this;
8619
- }
8620
8606
  _useBufferCanvas() {
8621
8607
  const hasCornerRadius = !!this.cornerRadius();
8622
8608
  const hasShadow = this.hasShadow();
@@ -8680,11 +8666,11 @@
8680
8666
  }
8681
8667
  getWidth() {
8682
8668
  var _a, _b;
8683
- return (_a = this.attrs.width) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.width;
8669
+ return (_a = this.attrs.width) !== null && _a !== undefined ? _a : (_b = this.image()) === null || _b === undefined ? undefined : _b.width;
8684
8670
  }
8685
8671
  getHeight() {
8686
8672
  var _a, _b;
8687
- return (_a = this.attrs.height) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.height;
8673
+ return (_a = this.attrs.height) !== null && _a !== undefined ? _a : (_b = this.image()) === null || _b === undefined ? undefined : _b.height;
8688
8674
  }
8689
8675
  static fromURL(url, callback, onError = null) {
8690
8676
  const img = Util_1.Util.createImageElement();
@@ -8720,7 +8706,7 @@
8720
8706
  if (hasRequiredLabel) return Label;
8721
8707
  hasRequiredLabel = 1;
8722
8708
  Object.defineProperty(Label, "__esModule", { value: true });
8723
- Label.Tag = Label.Label = void 0;
8709
+ Label.Tag = Label.Label = undefined;
8724
8710
  const Factory_1 = requireFactory();
8725
8711
  const Shape_1 = requireShape();
8726
8712
  const Group_1 = requireGroup();
@@ -8907,7 +8893,7 @@
8907
8893
  if (hasRequiredRect) return Rect;
8908
8894
  hasRequiredRect = 1;
8909
8895
  Object.defineProperty(Rect, "__esModule", { value: true });
8910
- Rect.Rect = void 0;
8896
+ Rect.Rect = undefined;
8911
8897
  const Factory_1 = requireFactory();
8912
8898
  const Shape_1 = requireShape();
8913
8899
  const Global_1 = requireGlobal();
@@ -8942,7 +8928,7 @@
8942
8928
  if (hasRequiredRegularPolygon) return RegularPolygon;
8943
8929
  hasRequiredRegularPolygon = 1;
8944
8930
  Object.defineProperty(RegularPolygon, "__esModule", { value: true });
8945
- RegularPolygon.RegularPolygon = void 0;
8931
+ RegularPolygon.RegularPolygon = undefined;
8946
8932
  const Factory_1 = requireFactory();
8947
8933
  const Shape_1 = requireShape();
8948
8934
  const Validators_1 = requireValidators();
@@ -9020,7 +9006,7 @@
9020
9006
  if (hasRequiredRing) return Ring;
9021
9007
  hasRequiredRing = 1;
9022
9008
  Object.defineProperty(Ring, "__esModule", { value: true });
9023
- Ring.Ring = void 0;
9009
+ Ring.Ring = undefined;
9024
9010
  const Factory_1 = requireFactory();
9025
9011
  const Shape_1 = requireShape();
9026
9012
  const Validators_1 = requireValidators();
@@ -9066,7 +9052,7 @@
9066
9052
  if (hasRequiredSprite) return Sprite$1;
9067
9053
  hasRequiredSprite = 1;
9068
9054
  Object.defineProperty(Sprite$1, "__esModule", { value: true });
9069
- Sprite$1.Sprite = void 0;
9055
+ Sprite$1.Sprite = undefined;
9070
9056
  const Factory_1 = requireFactory();
9071
9057
  const Shape_1 = requireShape();
9072
9058
  const Animation_1 = requireAnimation();
@@ -9187,7 +9173,7 @@
9187
9173
  if (hasRequiredStar) return Star;
9188
9174
  hasRequiredStar = 1;
9189
9175
  Object.defineProperty(Star, "__esModule", { value: true });
9190
- Star.Star = void 0;
9176
+ Star.Star = undefined;
9191
9177
  const Factory_1 = requireFactory();
9192
9178
  const Shape_1 = requireShape();
9193
9179
  const Validators_1 = requireValidators();
@@ -9238,7 +9224,7 @@
9238
9224
  if (hasRequiredText) return Text;
9239
9225
  hasRequiredText = 1;
9240
9226
  Object.defineProperty(Text, "__esModule", { value: true });
9241
- Text.Text = void 0;
9227
+ Text.Text = undefined;
9242
9228
  Text.stringToArray = stringToArray;
9243
9229
  const Util_1 = requireUtil();
9244
9230
  const Factory_1 = requireFactory();
@@ -9484,17 +9470,17 @@
9484
9470
  _context.restore();
9485
9471
  const scaleFactor = fontSize / 100;
9486
9472
  return {
9487
- actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !== void 0 ? _a : 71.58203125 * scaleFactor,
9488
- actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !== void 0 ? _b : 0,
9489
- actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== void 0 ? _c : -7.421875 * scaleFactor,
9490
- actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== void 0 ? _d : 75.732421875 * scaleFactor,
9491
- alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !== void 0 ? _e : 0,
9492
- emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== void 0 ? _f : 100 * scaleFactor,
9493
- emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== void 0 ? _g : -20 * scaleFactor,
9494
- fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== void 0 ? _h : 91 * scaleFactor,
9495
- fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== void 0 ? _j : 21 * scaleFactor,
9496
- hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== void 0 ? _k : 72.80000305175781 * scaleFactor,
9497
- ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== void 0 ? _l : -21 * scaleFactor,
9473
+ actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !== undefined ? _a : 71.58203125 * scaleFactor,
9474
+ actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !== undefined ? _b : 0,
9475
+ actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== undefined ? _c : -7.421875 * scaleFactor,
9476
+ actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== undefined ? _d : 75.732421875 * scaleFactor,
9477
+ alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !== undefined ? _e : 0,
9478
+ emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== undefined ? _f : 100 * scaleFactor,
9479
+ emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== undefined ? _g : -20 * scaleFactor,
9480
+ fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== undefined ? _h : 91 * scaleFactor,
9481
+ fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== undefined ? _j : 21 * scaleFactor,
9482
+ hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== undefined ? _k : 72.80000305175781 * scaleFactor,
9483
+ ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== undefined ? _l : -21 * scaleFactor,
9498
9484
  width: metrics.width,
9499
9485
  height: fontSize,
9500
9486
  };
@@ -9538,14 +9524,8 @@
9538
9524
  while (line.length > 0) {
9539
9525
  let low = 0, high = stringToArray(line).length, match = '', matchWidth = 0;
9540
9526
  while (low < high) {
9541
- const mid = (low + high) >>> 1, lineArray = stringToArray(line), substr = lineArray.slice(0, mid + 1).join(''), substrWidth = this._getTextWidth(substr);
9542
- const shouldConsiderEllipsis = shouldAddEllipsis &&
9543
- fixedHeight &&
9544
- currentHeightPx + lineHeightPx > maxHeightPx;
9545
- const effectiveWidth = shouldConsiderEllipsis
9546
- ? substrWidth + additionalWidth
9547
- : substrWidth;
9548
- if (effectiveWidth <= maxWidth) {
9527
+ const mid = (low + high) >>> 1, lineArray = stringToArray(line), substr = lineArray.slice(0, mid + 1).join(''), substrWidth = this._getTextWidth(substr) + additionalWidth;
9528
+ if (substrWidth <= maxWidth) {
9549
9529
  low = mid + 1;
9550
9530
  match = substr;
9551
9531
  matchWidth = substrWidth;
@@ -9692,7 +9672,7 @@
9692
9672
  if (hasRequiredTextPath) return TextPath;
9693
9673
  hasRequiredTextPath = 1;
9694
9674
  Object.defineProperty(TextPath, "__esModule", { value: true });
9695
- TextPath.TextPath = void 0;
9675
+ TextPath.TextPath = undefined;
9696
9676
  const Util_1 = requireUtil();
9697
9677
  const Factory_1 = requireFactory();
9698
9678
  const Shape_1 = requireShape();
@@ -9942,7 +9922,7 @@
9942
9922
  if (hasRequiredTransformer) return Transformer;
9943
9923
  hasRequiredTransformer = 1;
9944
9924
  Object.defineProperty(Transformer, "__esModule", { value: true });
9945
- Transformer.Transformer = void 0;
9925
+ Transformer.Transformer = undefined;
9946
9926
  const Util_1 = requireUtil();
9947
9927
  const Factory_1 = requireFactory();
9948
9928
  const Node_1 = requireNode();
@@ -10139,12 +10119,10 @@
10139
10119
  this.update();
10140
10120
  }
10141
10121
  };
10142
- if (node._attrsAffectingSize.length) {
10143
- const additionalEvents = node._attrsAffectingSize
10144
- .map((prop) => prop + 'Change.' + this._getEventNamespace())
10145
- .join(' ');
10146
- node.on(additionalEvents, onChange);
10147
- }
10122
+ const additionalEvents = node._attrsAffectingSize
10123
+ .map((prop) => prop + 'Change.' + this._getEventNamespace())
10124
+ .join(' ');
10125
+ node.on(additionalEvents, onChange);
10148
10126
  node.on(TRANSFORM_CHANGE_STR.map((e) => e + `.${this._getEventNamespace()}`).join(' '), onChange);
10149
10127
  node.on(`absoluteTransformChange.${this._getEventNamespace()}`, onChange);
10150
10128
  this._proxyDrag(node);
@@ -10619,12 +10597,12 @@
10619
10597
  const node = this.getNode();
10620
10598
  activeTransformersCount--;
10621
10599
  this._fire('transformend', { evt: e, target: node });
10622
- (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
10600
+ (_a = this.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
10623
10601
  if (node) {
10624
10602
  this._nodes.forEach((target) => {
10625
10603
  var _a;
10626
10604
  target._fire('transformend', { evt: e, target });
10627
- (_a = target.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
10605
+ (_a = target.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
10628
10606
  });
10629
10607
  }
10630
10608
  this._movingAnchorName = null;
@@ -10737,7 +10715,7 @@
10737
10715
  .multiply(localTransform);
10738
10716
  const attrs = newLocalTransform.decompose();
10739
10717
  node.setAttrs(attrs);
10740
- (_a = node.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
10718
+ (_a = node.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
10741
10719
  });
10742
10720
  this.rotation(Util_1.Util._getRotation(newAttrs.rotation));
10743
10721
  this._nodes.forEach((node) => {
@@ -10852,7 +10830,7 @@
10852
10830
  styleFunc(node);
10853
10831
  });
10854
10832
  }
10855
- (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
10833
+ (_a = this.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
10856
10834
  }
10857
10835
  isTransforming() {
10858
10836
  return this._transforming;
@@ -10959,7 +10937,7 @@
10959
10937
  if (hasRequiredWedge) return Wedge;
10960
10938
  hasRequiredWedge = 1;
10961
10939
  Object.defineProperty(Wedge, "__esModule", { value: true });
10962
- Wedge.Wedge = void 0;
10940
+ Wedge.Wedge = undefined;
10963
10941
  const Factory_1 = requireFactory();
10964
10942
  const Shape_1 = requireShape();
10965
10943
  const Global_1 = requireGlobal();
@@ -11010,7 +10988,7 @@
11010
10988
  if (hasRequiredBlur) return Blur;
11011
10989
  hasRequiredBlur = 1;
11012
10990
  Object.defineProperty(Blur, "__esModule", { value: true });
11013
- Blur.Blur = void 0;
10991
+ Blur.Blur = undefined;
11014
10992
  const Factory_1 = requireFactory();
11015
10993
  const Node_1 = requireNode();
11016
10994
  const Validators_1 = requireValidators();
@@ -11258,7 +11236,7 @@
11258
11236
  if (hasRequiredBrighten) return Brighten;
11259
11237
  hasRequiredBrighten = 1;
11260
11238
  Object.defineProperty(Brighten, "__esModule", { value: true });
11261
- Brighten.Brighten = void 0;
11239
+ Brighten.Brighten = undefined;
11262
11240
  const Factory_1 = requireFactory();
11263
11241
  const Node_1 = requireNode();
11264
11242
  const Validators_1 = requireValidators();
@@ -11283,7 +11261,7 @@
11283
11261
  if (hasRequiredContrast) return Contrast;
11284
11262
  hasRequiredContrast = 1;
11285
11263
  Object.defineProperty(Contrast, "__esModule", { value: true });
11286
- Contrast.Contrast = void 0;
11264
+ Contrast.Contrast = undefined;
11287
11265
  const Factory_1 = requireFactory();
11288
11266
  const Node_1 = requireNode();
11289
11267
  const Validators_1 = requireValidators();
@@ -11331,7 +11309,7 @@
11331
11309
  if (hasRequiredEmboss) return Emboss;
11332
11310
  hasRequiredEmboss = 1;
11333
11311
  Object.defineProperty(Emboss, "__esModule", { value: true });
11334
- Emboss.Emboss = void 0;
11312
+ Emboss.Emboss = undefined;
11335
11313
  const Factory_1 = requireFactory();
11336
11314
  const Node_1 = requireNode();
11337
11315
  const Util_1 = requireUtil();
@@ -11447,7 +11425,7 @@
11447
11425
  if (hasRequiredEnhance) return Enhance;
11448
11426
  hasRequiredEnhance = 1;
11449
11427
  Object.defineProperty(Enhance, "__esModule", { value: true });
11450
- Enhance.Enhance = void 0;
11428
+ Enhance.Enhance = undefined;
11451
11429
  const Factory_1 = requireFactory();
11452
11430
  const Node_1 = requireNode();
11453
11431
  const Validators_1 = requireValidators();
@@ -11544,7 +11522,7 @@
11544
11522
  if (hasRequiredGrayscale) return Grayscale;
11545
11523
  hasRequiredGrayscale = 1;
11546
11524
  Object.defineProperty(Grayscale, "__esModule", { value: true });
11547
- Grayscale.Grayscale = void 0;
11525
+ Grayscale.Grayscale = undefined;
11548
11526
  const Grayscale$1 = function (imageData) {
11549
11527
  const data = imageData.data, len = data.length;
11550
11528
  for (let i = 0; i < len; i += 4) {
@@ -11566,7 +11544,7 @@
11566
11544
  if (hasRequiredHSL) return HSL;
11567
11545
  hasRequiredHSL = 1;
11568
11546
  Object.defineProperty(HSL, "__esModule", { value: true });
11569
- HSL.HSL = void 0;
11547
+ HSL.HSL = undefined;
11570
11548
  const Factory_1 = requireFactory();
11571
11549
  const Node_1 = requireNode();
11572
11550
  const Validators_1 = requireValidators();
@@ -11603,7 +11581,7 @@
11603
11581
  if (hasRequiredHSV) return HSV;
11604
11582
  hasRequiredHSV = 1;
11605
11583
  Object.defineProperty(HSV, "__esModule", { value: true });
11606
- HSV.HSV = void 0;
11584
+ HSV.HSV = undefined;
11607
11585
  const Factory_1 = requireFactory();
11608
11586
  const Node_1 = requireNode();
11609
11587
  const Validators_1 = requireValidators();
@@ -11640,7 +11618,7 @@
11640
11618
  if (hasRequiredInvert) return Invert;
11641
11619
  hasRequiredInvert = 1;
11642
11620
  Object.defineProperty(Invert, "__esModule", { value: true });
11643
- Invert.Invert = void 0;
11621
+ Invert.Invert = undefined;
11644
11622
  const Invert$1 = function (imageData) {
11645
11623
  const data = imageData.data, len = data.length;
11646
11624
  for (let i = 0; i < len; i += 4) {
@@ -11661,7 +11639,7 @@
11661
11639
  if (hasRequiredKaleidoscope) return Kaleidoscope;
11662
11640
  hasRequiredKaleidoscope = 1;
11663
11641
  Object.defineProperty(Kaleidoscope, "__esModule", { value: true });
11664
- Kaleidoscope.Kaleidoscope = void 0;
11642
+ Kaleidoscope.Kaleidoscope = undefined;
11665
11643
  const Factory_1 = requireFactory();
11666
11644
  const Node_1 = requireNode();
11667
11645
  const Util_1 = requireUtil();
@@ -11807,7 +11785,7 @@
11807
11785
  if (hasRequiredMask) return Mask;
11808
11786
  hasRequiredMask = 1;
11809
11787
  Object.defineProperty(Mask, "__esModule", { value: true });
11810
- Mask.Mask = void 0;
11788
+ Mask.Mask = undefined;
11811
11789
  const Factory_1 = requireFactory();
11812
11790
  const Node_1 = requireNode();
11813
11791
  const Validators_1 = requireValidators();
@@ -11961,7 +11939,7 @@
11961
11939
  if (hasRequiredNoise) return Noise;
11962
11940
  hasRequiredNoise = 1;
11963
11941
  Object.defineProperty(Noise, "__esModule", { value: true });
11964
- Noise.Noise = void 0;
11942
+ Noise.Noise = undefined;
11965
11943
  const Factory_1 = requireFactory();
11966
11944
  const Node_1 = requireNode();
11967
11945
  const Validators_1 = requireValidators();
@@ -11986,7 +11964,7 @@
11986
11964
  if (hasRequiredPixelate) return Pixelate;
11987
11965
  hasRequiredPixelate = 1;
11988
11966
  Object.defineProperty(Pixelate, "__esModule", { value: true });
11989
- Pixelate.Pixelate = void 0;
11967
+ Pixelate.Pixelate = undefined;
11990
11968
  const Factory_1 = requireFactory();
11991
11969
  const Util_1 = requireUtil();
11992
11970
  const Node_1 = requireNode();
@@ -12059,7 +12037,7 @@
12059
12037
  if (hasRequiredPosterize) return Posterize;
12060
12038
  hasRequiredPosterize = 1;
12061
12039
  Object.defineProperty(Posterize, "__esModule", { value: true });
12062
- Posterize.Posterize = void 0;
12040
+ Posterize.Posterize = undefined;
12063
12041
  const Factory_1 = requireFactory();
12064
12042
  const Node_1 = requireNode();
12065
12043
  const Validators_1 = requireValidators();
@@ -12082,7 +12060,7 @@
12082
12060
  if (hasRequiredRGB) return RGB;
12083
12061
  hasRequiredRGB = 1;
12084
12062
  Object.defineProperty(RGB, "__esModule", { value: true });
12085
- RGB.RGB = void 0;
12063
+ RGB.RGB = undefined;
12086
12064
  const Factory_1 = requireFactory();
12087
12065
  const Node_1 = requireNode();
12088
12066
  const Validators_1 = requireValidators();
@@ -12133,7 +12111,7 @@
12133
12111
  if (hasRequiredRGBA) return RGBA;
12134
12112
  hasRequiredRGBA = 1;
12135
12113
  Object.defineProperty(RGBA, "__esModule", { value: true });
12136
- RGBA.RGBA = void 0;
12114
+ RGBA.RGBA = undefined;
12137
12115
  const Factory_1 = requireFactory();
12138
12116
  const Node_1 = requireNode();
12139
12117
  const Validators_1 = requireValidators();
@@ -12195,7 +12173,7 @@
12195
12173
  if (hasRequiredSepia) return Sepia;
12196
12174
  hasRequiredSepia = 1;
12197
12175
  Object.defineProperty(Sepia, "__esModule", { value: true });
12198
- Sepia.Sepia = void 0;
12176
+ Sepia.Sepia = undefined;
12199
12177
  const Sepia$1 = function (imageData) {
12200
12178
  const data = imageData.data, nPixels = data.length;
12201
12179
  for (let i = 0; i < nPixels; i += 4) {
@@ -12219,7 +12197,7 @@
12219
12197
  if (hasRequiredSolarize) return Solarize;
12220
12198
  hasRequiredSolarize = 1;
12221
12199
  Object.defineProperty(Solarize, "__esModule", { value: true });
12222
- Solarize.Solarize = void 0;
12200
+ Solarize.Solarize = undefined;
12223
12201
  const Solarize$1 = function (imageData) {
12224
12202
  const data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4;
12225
12203
  let y = h;
@@ -12258,7 +12236,7 @@
12258
12236
  if (hasRequiredThreshold) return Threshold;
12259
12237
  hasRequiredThreshold = 1;
12260
12238
  Object.defineProperty(Threshold, "__esModule", { value: true });
12261
- Threshold.Threshold = void 0;
12239
+ Threshold.Threshold = undefined;
12262
12240
  const Factory_1 = requireFactory();
12263
12241
  const Node_1 = requireNode();
12264
12242
  const Validators_1 = requireValidators();
@@ -12279,7 +12257,7 @@
12279
12257
  if (hasRequired_FullInternals) return _FullInternals;
12280
12258
  hasRequired_FullInternals = 1;
12281
12259
  Object.defineProperty(_FullInternals, "__esModule", { value: true });
12282
- _FullInternals.Konva = void 0;
12260
+ _FullInternals.Konva = undefined;
12283
12261
  const _CoreInternals_1 = require_CoreInternals();
12284
12262
  const Arc_1 = requireArc();
12285
12263
  const Arrow_1 = requireArrow();
@@ -12449,8 +12427,8 @@
12449
12427
  const konvaPoints = [];
12450
12428
  params.points.forEach((point => konvaPoints.push(point.x, point.y)));
12451
12429
  this._ref = new Konva.Line({
12452
- stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
12453
- strokeWidth: (_b = params.width) !== null && _b !== void 0 ? _b : 4,
12430
+ stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
12431
+ strokeWidth: (_b = params.width) !== null && _b !== undefined ? _b : 4,
12454
12432
  globalCompositeOperation: "source-over",
12455
12433
  lineCap: "round",
12456
12434
  lineJoin: "round",
@@ -12557,12 +12535,12 @@
12557
12535
  x: params.position.x,
12558
12536
  y: params.position.y,
12559
12537
  text: params.text,
12560
- fontSize: (_a = params.fontSize) !== null && _a !== void 0 ? _a : 34,
12538
+ fontSize: (_a = params.fontSize) !== null && _a !== undefined ? _a : 34,
12561
12539
  fontFamily: this.TEXT_FONT_FAMILY,
12562
- fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
12540
+ fill: (_b = params.color) !== null && _b !== undefined ? _b : "#ff0000",
12563
12541
  align: "left",
12564
12542
  draggable: true,
12565
- rotation: (_c = params.rotation) !== null && _c !== void 0 ? _c : 0
12543
+ rotation: (_c = params.rotation) !== null && _c !== undefined ? _c : 0
12566
12544
  });
12567
12545
  this._ref.width(this._ref.getTextWidth());
12568
12546
  this._ref.on("transform", (e => {
@@ -12660,15 +12638,15 @@
12660
12638
  y: 0
12661
12639
  };
12662
12640
  this._ref = new Konva.Rect({
12663
- stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
12664
- strokeWidth: (_b = params.lineWidth) !== null && _b !== void 0 ? _b : 4,
12641
+ stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
12642
+ strokeWidth: (_b = params.lineWidth) !== null && _b !== undefined ? _b : 4,
12665
12643
  globalCompositeOperation: "source-over",
12666
12644
  lineCap: "round",
12667
12645
  lineJoin: "round",
12668
12646
  x: params.position.x,
12669
12647
  y: params.position.y,
12670
- width: (_c = params.width) !== null && _c !== void 0 ? _c : 200,
12671
- height: (_d = params.height) !== null && _d !== void 0 ? _d : 200,
12648
+ width: (_c = params.width) !== null && _c !== undefined ? _c : 200,
12649
+ height: (_d = params.height) !== null && _d !== undefined ? _d : 200,
12672
12650
  draggable: true,
12673
12651
  strokeScaleEnabled: false
12674
12652
  });
@@ -12778,8 +12756,8 @@
12778
12756
  y: 25
12779
12757
  };
12780
12758
  this._ref = new Konva.Ellipse({
12781
- stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
12782
- strokeWidth: (_b = params.lineWidth) !== null && _b !== void 0 ? _b : 4,
12759
+ stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
12760
+ strokeWidth: (_b = params.lineWidth) !== null && _b !== undefined ? _b : 4,
12783
12761
  globalCompositeOperation: "source-over",
12784
12762
  lineCap: "round",
12785
12763
  lineJoin: "round",
@@ -12908,8 +12886,8 @@
12908
12886
  y: 100
12909
12887
  };
12910
12888
  this._ref = new Konva.Arrow({
12911
- stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
12912
- fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
12889
+ stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
12890
+ fill: (_b = params.color) !== null && _b !== undefined ? _b : "#ff0000",
12913
12891
  strokeWidth: 4,
12914
12892
  globalCompositeOperation: "source-over",
12915
12893
  lineCap: "round",
@@ -13049,8 +13027,8 @@
13049
13027
  x: params.position.x,
13050
13028
  y: params.position.y,
13051
13029
  image: this._canvasImage,
13052
- width: (_a = params.width) !== null && _a !== void 0 ? _a : 0,
13053
- height: (_b = params.height) !== null && _b !== void 0 ? _b : 0,
13030
+ width: (_a = params.width) !== null && _a !== undefined ? _a : 0,
13031
+ height: (_b = params.height) !== null && _b !== undefined ? _b : 0,
13054
13032
  draggable: true
13055
13033
  });
13056
13034
  this._ref.on("transform", (e => {
@@ -13160,10 +13138,10 @@
13160
13138
  this._ref = new Konva.Shape({
13161
13139
  x: params.position.x,
13162
13140
  y: params.position.y,
13163
- width: (_a = params.width) !== null && _a !== void 0 ? _a : 200,
13164
- height: (_b = params.height) !== null && _b !== void 0 ? _b : 200,
13165
- stroke: (_c = params.color) !== null && _c !== void 0 ? _c : "#ff0000",
13166
- strokeWidth: (_d = params.lineWidth) !== null && _d !== void 0 ? _d : 4,
13141
+ width: (_a = params.width) !== null && _a !== undefined ? _a : 200,
13142
+ height: (_b = params.height) !== null && _b !== undefined ? _b : 200,
13143
+ stroke: (_c = params.color) !== null && _c !== undefined ? _c : "#ff0000",
13144
+ strokeWidth: (_d = params.lineWidth) !== null && _d !== undefined ? _d : 4,
13167
13145
  draggable: true,
13168
13146
  strokeScaleEnabled: false,
13169
13147
  globalCompositeOperation: "source-over",
@@ -13412,9 +13390,9 @@
13412
13390
  initialize(container, containerEvents, viewer, worldTransformer) {
13413
13391
  if (!Konva) throw new Error('Markup error: Konva is not initialized. Forgot to add <script src="https://unpkg.com/konva@9/konva.min.js"><\/script> to your page?');
13414
13392
  this._viewer = viewer;
13415
- this._worldTransformer = worldTransformer !== null && worldTransformer !== void 0 ? worldTransformer : new WorldTransform;
13393
+ this._worldTransformer = worldTransformer !== null && worldTransformer !== undefined ? worldTransformer : new WorldTransform;
13416
13394
  this._container = container;
13417
- this._containerEvents = containerEvents !== null && containerEvents !== void 0 ? containerEvents : [];
13395
+ this._containerEvents = containerEvents !== null && containerEvents !== undefined ? containerEvents : [];
13418
13396
  this._markupContainer = document.createElement("div");
13419
13397
  this._markupContainer.id = "markup-container";
13420
13398
  this._markupContainer.style.position = "absolute";
@@ -13442,9 +13420,9 @@
13442
13420
  this._viewer.removeEventListener("changeactivedragger", this.changeActiveDragger);
13443
13421
  }
13444
13422
  this.destroyKonva();
13445
- (_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
13423
+ (_a = this._resizeObserver) === null || _a === undefined ? undefined : _a.disconnect();
13446
13424
  this._resizeObserver = undefined;
13447
- (_b = this._markupContainer) === null || _b === void 0 ? void 0 : _b.remove();
13425
+ (_b = this._markupContainer) === null || _b === undefined ? undefined : _b.remove();
13448
13426
  this._markupContainer = undefined;
13449
13427
  this._container = undefined;
13450
13428
  this._viewer = undefined;
@@ -13476,14 +13454,14 @@
13476
13454
  const hexColor = new MarkupColor(r, g, b).asHex();
13477
13455
  this.getObjects().filter((obj => {
13478
13456
  var _a;
13479
- return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor);
13457
+ return (_a = obj.setColor) === null || _a === undefined ? undefined : _a.call(obj, hexColor);
13480
13458
  }));
13481
13459
  }
13482
13460
  colorizeSelectedMarkups(r, g, b) {
13483
13461
  const hexColor = new MarkupColor(r, g, b).asHex();
13484
13462
  this.getSelectedObjects().filter((obj => {
13485
13463
  var _a;
13486
- return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor);
13464
+ return (_a = obj.setColor) === null || _a === undefined ? undefined : _a.call(obj, hexColor);
13487
13465
  }));
13488
13466
  }
13489
13467
  setViewpoint(viewpoint) {
@@ -13499,13 +13477,13 @@
13499
13477
  x: 0,
13500
13478
  y: 0
13501
13479
  });
13502
- const markupColor = ((_a = viewpoint.custom_fields) === null || _a === void 0 ? void 0 : _a.markup_color) || {
13480
+ const markupColor = ((_a = viewpoint.custom_fields) === null || _a === undefined ? undefined : _a.markup_color) || {
13503
13481
  r: 255,
13504
13482
  g: 0,
13505
13483
  b: 0
13506
13484
  };
13507
13485
  this.setMarkupColor(markupColor.r, markupColor.g, markupColor.b);
13508
- (_b = viewpoint.lines) === null || _b === void 0 ? void 0 : _b.forEach((line => {
13486
+ (_b = viewpoint.lines) === null || _b === undefined ? undefined : _b.forEach((line => {
13509
13487
  const linePoints = [];
13510
13488
  line.points.forEach((point => {
13511
13489
  const screenPoint = this._worldTransformer.worldToScreen(point);
@@ -13514,28 +13492,28 @@
13514
13492
  }));
13515
13493
  this.addLine(linePoints, line.color, line.type, line.width, line.id);
13516
13494
  }));
13517
- (_c = viewpoint.texts) === null || _c === void 0 ? void 0 : _c.forEach((text => {
13495
+ (_c = viewpoint.texts) === null || _c === undefined ? undefined : _c.forEach((text => {
13518
13496
  const screenPoint = this._worldTransformer.worldToScreen(text.position);
13519
13497
  this.addText(text.text, screenPoint, text.angle, text.color, text.text_size, text.font_size, text.id);
13520
13498
  }));
13521
- (_d = viewpoint.rectangles) === null || _d === void 0 ? void 0 : _d.forEach((rect => {
13499
+ (_d = viewpoint.rectangles) === null || _d === undefined ? undefined : _d.forEach((rect => {
13522
13500
  const screenPoint = this._worldTransformer.worldToScreen(rect.position);
13523
13501
  this.addRectangle(screenPoint, rect.width, rect.height, rect.line_width, rect.color, rect.id);
13524
13502
  }));
13525
- (_e = viewpoint.ellipses) === null || _e === void 0 ? void 0 : _e.forEach((ellipse => {
13503
+ (_e = viewpoint.ellipses) === null || _e === undefined ? undefined : _e.forEach((ellipse => {
13526
13504
  const screenPoint = this._worldTransformer.worldToScreen(ellipse.position);
13527
13505
  this.addEllipse(screenPoint, ellipse.radius, ellipse.line_width, ellipse.color, ellipse.id);
13528
13506
  }));
13529
- (_f = viewpoint.arrows) === null || _f === void 0 ? void 0 : _f.forEach((arrow => {
13507
+ (_f = viewpoint.arrows) === null || _f === undefined ? undefined : _f.forEach((arrow => {
13530
13508
  const startPoint = this._worldTransformer.worldToScreen(arrow.start);
13531
13509
  const endPoint = this._worldTransformer.worldToScreen(arrow.end);
13532
13510
  this.addArrow(startPoint, endPoint, arrow.color, arrow.id);
13533
13511
  }));
13534
- (_g = viewpoint.clouds) === null || _g === void 0 ? void 0 : _g.forEach((cloud => {
13512
+ (_g = viewpoint.clouds) === null || _g === undefined ? undefined : _g.forEach((cloud => {
13535
13513
  const screenPoint = this._worldTransformer.worldToScreen(cloud.position);
13536
13514
  this.addCloud(screenPoint, cloud.width, cloud.height, cloud.line_width, cloud.color, cloud.id);
13537
13515
  }));
13538
- (_h = viewpoint.images) === null || _h === void 0 ? void 0 : _h.forEach((image => {
13516
+ (_h = viewpoint.images) === null || _h === undefined ? undefined : _h.forEach((image => {
13539
13517
  const screenPoint = this._worldTransformer.worldToScreen(image.position);
13540
13518
  this.addImage(screenPoint, image.src, image.width, image.height, image.id);
13541
13519
  }));
@@ -13829,7 +13807,7 @@
13829
13807
  this.removeTextInput();
13830
13808
  this.removeImageInput();
13831
13809
  this.clearOverlay();
13832
- (_a = this._konvaStage) === null || _a === void 0 ? void 0 : _a.destroy();
13810
+ (_a = this._konvaStage) === null || _a === undefined ? undefined : _a.destroy();
13833
13811
  this._groupImages = undefined;
13834
13812
  this._groupGeometry = undefined;
13835
13813
  this._groupTexts = undefined;
@@ -14079,7 +14057,7 @@
14079
14057
  }
14080
14058
  removeTextInput() {
14081
14059
  var _a;
14082
- (_a = this._textInputRef) === null || _a === void 0 ? void 0 : _a.remove();
14060
+ (_a = this._textInputRef) === null || _a === undefined ? undefined : _a.remove();
14083
14061
  this._textInputRef = null;
14084
14062
  this._textInputPos = null;
14085
14063
  this._textInputAngle = 0;
@@ -14122,14 +14100,14 @@
14122
14100
  }
14123
14101
  removeImageInput() {
14124
14102
  var _a;
14125
- (_a = this._imageInputRef) === null || _a === void 0 ? void 0 : _a.remove();
14103
+ (_a = this._imageInputRef) === null || _a === undefined ? undefined : _a.remove();
14126
14104
  this._imageInputRef = null;
14127
14105
  this._imageInputPos = null;
14128
14106
  }
14129
14107
  addText(text, position, angle, color, textSize, fontSize, id) {
14130
14108
  var _a;
14131
14109
  if (!text) return;
14132
- (_a = this.getSelectedObjects().at(0)) === null || _a === void 0 ? void 0 : _a.delete();
14110
+ (_a = this.getSelectedObjects().at(0)) === null || _a === undefined ? undefined : _a.delete();
14133
14111
  this.clearSelected();
14134
14112
  this.removeTextInput();
14135
14113
  const tolerance = 1e-6;
@@ -14204,7 +14182,7 @@
14204
14182
  addImage(position, src, width, height, id) {
14205
14183
  var _a;
14206
14184
  if (!position || !src) return;
14207
- (_a = this.getSelectedObjects().at(0)) === null || _a === void 0 ? void 0 : _a.delete();
14185
+ (_a = this.getSelectedObjects().at(0)) === null || _a === undefined ? undefined : _a.delete();
14208
14186
  this.clearSelected();
14209
14187
  this.removeImageInput();
14210
14188
  const konvaImage = new KonvaImage({
@@ -57010,7 +56988,7 @@ void main() {
57010
56988
  // acknowledge and accept the above terms.
57011
56989
  ///////////////////////////////////////////////////////////////////////////////
57012
56990
  function getModels(viewer) {
57013
- return viewer.models.map((model) => { var _a; return ((_a = model.userData) === null || _a === void 0 ? void 0 : _a.handle) || ""; }).filter((handle) => handle);
56991
+ return viewer.models.map((model) => { var _a; return ((_a = model.userData) === null || _a === undefined ? undefined : _a.handle) || ""; }).filter((handle) => handle);
57014
56992
  }
57015
56993
 
57016
56994
  ///////////////////////////////////////////////////////////////////////////////
@@ -57036,7 +57014,7 @@ void main() {
57036
57014
  // acknowledge and accept the above terms.
57037
57015
  ///////////////////////////////////////////////////////////////////////////////
57038
57016
  function getSelected(viewer) {
57039
- return viewer.selected.map((object) => { var _a; return (_a = object.userData) === null || _a === void 0 ? void 0 : _a.handle; }).filter((handle) => handle);
57017
+ return viewer.selected.map((object) => { var _a; return (_a = object.userData) === null || _a === undefined ? undefined : _a.handle; }).filter((handle) => handle);
57040
57018
  }
57041
57019
 
57042
57020
  ///////////////////////////////////////////////////////////////////////////////
@@ -57382,7 +57360,7 @@ void main() {
57382
57360
  const objects = [];
57383
57361
  viewer.scene.traverseVisible((child) => {
57384
57362
  var _a;
57385
- if (handleSet.has((_a = child.userData) === null || _a === void 0 ? void 0 : _a.handle))
57363
+ if (handleSet.has((_a = child.userData) === null || _a === undefined ? undefined : _a.handle))
57386
57364
  objects.push(child);
57387
57365
  });
57388
57366
  const selection = viewer.getComponent("SelectionComponent");
@@ -57475,7 +57453,7 @@ void main() {
57475
57453
  const objects = [];
57476
57454
  viewer.scene.traverseVisible((child) => {
57477
57455
  var _a;
57478
- if (handleSet.has((_a = child.userData) === null || _a === void 0 ? void 0 : _a.handle))
57456
+ if (handleSet.has((_a = child.userData) === null || _a === undefined ? undefined : _a.handle))
57479
57457
  objects.push(child);
57480
57458
  });
57481
57459
  const extents = objects.reduce((result, object) => result.expandByObject(object), new Box3());
@@ -63021,7 +62999,7 @@ void main() {
63021
62999
  .replace(this.resourcePath, "")
63022
63000
  .replace(/^(\.?\/)/, "");
63023
63001
  const dataURL = this.dataURLs.get(key);
63024
- return dataURL !== null && dataURL !== void 0 ? dataURL : url;
63002
+ return dataURL !== null && dataURL !== undefined ? dataURL : url;
63025
63003
  });
63026
63004
  }
63027
63005
  dispose() {
@@ -63202,7 +63180,7 @@ void main() {
63202
63180
  this.renderer.autoClear = false;
63203
63181
  this.renderer.render(this.helpers, this.camera);
63204
63182
  this.renderer.clippingPlanes = clippingPlanes;
63205
- (_b = (_a = this._activeDragger) === null || _a === void 0 ? void 0 : _a.updatePreview) === null || _b === void 0 ? void 0 : _b.call(_a);
63183
+ (_b = (_a = this._activeDragger) === null || _a === undefined ? undefined : _a.updatePreview) === null || _b === undefined ? undefined : _b.call(_a);
63206
63184
  const deltaTime = (time - this.renderTime) / 1000;
63207
63185
  this.renderTime = time;
63208
63186
  this.emitEvent({ type: "render", time, deltaTime });
@@ -63470,7 +63448,7 @@ void main() {
63470
63448
  newDragger = draggers.createDragger(name, this);
63471
63449
  if (newDragger) {
63472
63450
  this._activeDragger = newDragger;
63473
- (_b = (_a = this._activeDragger).initialize) === null || _b === void 0 ? void 0 : _b.call(_a);
63451
+ (_b = (_a = this._activeDragger).initialize) === null || _b === undefined ? undefined : _b.call(_a);
63474
63452
  }
63475
63453
  }
63476
63454
  const canvas = this.canvas;
@@ -63567,7 +63545,7 @@ void main() {
63567
63545
  }
63568
63546
  };
63569
63547
  const setClippingPlanes = (clipping_planes) => {
63570
- clipping_planes === null || clipping_planes === void 0 ? void 0 : clipping_planes.forEach((clipping_plane) => {
63548
+ clipping_planes === null || clipping_planes === undefined ? undefined : clipping_planes.forEach((clipping_plane) => {
63571
63549
  const plane = new Plane();
63572
63550
  plane.setFromNormalAndCoplanarPoint(getVector3FromPoint3d(clipping_plane.direction), getVector3FromPoint3d(clipping_plane.location));
63573
63551
  this.renderer.clippingPlanes.push(plane);
@@ -63577,7 +63555,7 @@ void main() {
63577
63555
  if (selection)
63578
63556
  this.setSelected(selection.map((component) => component.handle));
63579
63557
  };
63580
- const draggerName = (_a = this._activeDragger) === null || _a === void 0 ? void 0 : _a.name;
63558
+ const draggerName = (_a = this._activeDragger) === null || _a === undefined ? undefined : _a.name;
63581
63559
  this.setActiveDragger();
63582
63560
  this.clearSlices();
63583
63561
  this.clearOverlay();
@@ -63589,7 +63567,7 @@ void main() {
63589
63567
  setClippingPlanes(viewpoint.clipping_planes);
63590
63568
  setSelection(viewpoint.selection);
63591
63569
  this._markup.setViewpoint(viewpoint);
63592
- this.target = getVector3FromPoint3d((_c = (_b = viewpoint.custom_fields) === null || _b === void 0 ? void 0 : _b.camera_target) !== null && _c !== void 0 ? _c : this.target);
63570
+ this.target = getVector3FromPoint3d((_c = (_b = viewpoint.custom_fields) === null || _b === undefined ? undefined : _b.camera_target) !== null && _c !== undefined ? _c : this.target);
63593
63571
  this.setActiveDragger(draggerName);
63594
63572
  this.emitEvent({ type: "drawviewpoint", data: viewpoint });
63595
63573
  this.update();