@mlightcad/common 1.4.30 → 1.4.32
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/LICENSE +21 -21
- package/README.md +132 -132
- package/dist/common.js +140 -134
- package/dist/common.umd.cjs +1 -1
- package/lib/AcCmColor.d.ts +2 -1
- package/lib/AcCmColor.d.ts.map +1 -1
- package/lib/AcCmColor.js +9 -3
- package/lib/AcCmColor.js.map +1 -1
- package/lib/AcCmTransparency.d.ts +4 -3
- package/lib/AcCmTransparency.d.ts.map +1 -1
- package/lib/AcCmTransparency.js +26 -10
- package/lib/AcCmTransparency.js.map +1 -1
- package/package.json +1 -1
package/dist/common.js
CHANGED
|
@@ -4,15 +4,15 @@ function W(r, e) {
|
|
|
4
4
|
if (typeof s != "string" && !Array.isArray(s)) {
|
|
5
5
|
for (const o in s)
|
|
6
6
|
if (o !== "default" && !(o in r)) {
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const l = Object.getOwnPropertyDescriptor(s, o);
|
|
8
|
+
l && Object.defineProperty(r, o, l.get ? l : { enumerable: !0, get: () => s[o] });
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }));
|
|
13
13
|
}
|
|
14
|
-
var
|
|
15
|
-
const
|
|
14
|
+
var i = /* @__PURE__ */ ((r) => (r[r.ByColor = 1] = "ByColor", r[r.ByACI = 2] = "ByACI", r[r.ByLayer = 3] = "ByLayer", r[r.ByBlock = 4] = "ByBlock", r[r.None = 0] = "None", r))(i || {});
|
|
15
|
+
const $ = {
|
|
16
16
|
aliceblue: 15792383,
|
|
17
17
|
antiquewhite: 16444375,
|
|
18
18
|
aqua: 65535,
|
|
@@ -427,10 +427,10 @@ class b {
|
|
|
427
427
|
return s;
|
|
428
428
|
}
|
|
429
429
|
static getColorByName(e) {
|
|
430
|
-
return
|
|
430
|
+
return $[e.toLowerCase()];
|
|
431
431
|
}
|
|
432
432
|
static getNameByColor(e) {
|
|
433
|
-
for (const [t, s] of Object.entries(
|
|
433
|
+
for (const [t, s] of Object.entries($))
|
|
434
434
|
if (s === e)
|
|
435
435
|
return t;
|
|
436
436
|
}
|
|
@@ -440,8 +440,8 @@ class b {
|
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
class B {
|
|
443
|
-
constructor(e =
|
|
444
|
-
this._colorMethod = e, this._colorMethod ==
|
|
443
|
+
constructor(e = i.ByLayer, t) {
|
|
444
|
+
this._colorMethod = e, this._colorMethod == i.ByColor && t == null ? this._value = 16777215 : this._colorMethod == i.ByACI ? t == null ? this._value = 8 : t === 0 ? this._colorMethod = i.ByBlock : t === 256 ? this._colorMethod = i.ByLayer : this._value = Math.max(0, Math.min(t, 256)) : this._value = t;
|
|
445
445
|
}
|
|
446
446
|
get colorMethod() {
|
|
447
447
|
return this._colorMethod;
|
|
@@ -463,40 +463,40 @@ class B {
|
|
|
463
463
|
}
|
|
464
464
|
get RGB() {
|
|
465
465
|
switch (this._colorMethod) {
|
|
466
|
-
case
|
|
467
|
-
case
|
|
468
|
-
case
|
|
466
|
+
case i.ByColor:
|
|
467
|
+
case i.ByBlock:
|
|
468
|
+
case i.ByLayer:
|
|
469
469
|
return this._value;
|
|
470
|
-
case
|
|
470
|
+
case i.ByACI:
|
|
471
471
|
return this._value ? b.getColorByIndex(this._value) : this._value;
|
|
472
472
|
default:
|
|
473
473
|
return;
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
476
|
setRGB(e, t, s) {
|
|
477
|
-
const o = Math.max(0, Math.min(255, Math.round(e))),
|
|
478
|
-
return this._value = o << 16 |
|
|
477
|
+
const o = Math.max(0, Math.min(255, Math.round(e))), l = Math.max(0, Math.min(255, Math.round(t))), n = Math.max(0, Math.min(255, Math.round(s)));
|
|
478
|
+
return this._value = o << 16 | l << 8 | n, this._colorMethod = i.ByColor, this;
|
|
479
479
|
}
|
|
480
480
|
setRGBValue(e) {
|
|
481
|
-
return e == null || !Number.isFinite(e) ? this : (this._value = e & 16777215, this._colorMethod =
|
|
481
|
+
return e == null || !Number.isFinite(e) ? this : (this._value = e & 16777215, this._colorMethod = i.ByColor, this);
|
|
482
482
|
}
|
|
483
483
|
setRGBFromCss(e) {
|
|
484
484
|
if (!e) return this;
|
|
485
485
|
const t = e.trim().toLowerCase();
|
|
486
486
|
if (t.startsWith("#")) {
|
|
487
|
-
let
|
|
487
|
+
let l = 0, n = 0, c = 0;
|
|
488
488
|
if (t.length === 7)
|
|
489
|
-
|
|
489
|
+
l = parseInt(t.substr(1, 2), 16), n = parseInt(t.substr(3, 2), 16), c = parseInt(t.substr(5, 2), 16);
|
|
490
490
|
else if (t.length === 4)
|
|
491
|
-
|
|
491
|
+
l = parseInt(t[1] + t[1], 16), n = parseInt(t[2] + t[2], 16), c = parseInt(t[3] + t[3], 16);
|
|
492
492
|
else
|
|
493
493
|
return this;
|
|
494
|
-
return this.setRGB(
|
|
494
|
+
return this.setRGB(l, n, c);
|
|
495
495
|
}
|
|
496
496
|
const s = t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
|
|
497
497
|
if (s) {
|
|
498
|
-
const
|
|
499
|
-
return this.setRGB(
|
|
498
|
+
const l = parseInt(s[1], 10), n = parseInt(s[2], 10), c = parseInt(s[3], 10);
|
|
499
|
+
return this.setRGB(l, n, c);
|
|
500
500
|
}
|
|
501
501
|
const o = b.getColorByName(e);
|
|
502
502
|
return o !== void 0 ? this.setRGBValue(o) : this;
|
|
@@ -519,46 +519,46 @@ class B {
|
|
|
519
519
|
return `rgba(${t >> 16 & 255},${t >> 8 & 255},${t & 255},${e})`;
|
|
520
520
|
}
|
|
521
521
|
get colorIndex() {
|
|
522
|
-
return this._colorMethod ===
|
|
522
|
+
return this._colorMethod === i.ByACI ? this._value : this._colorMethod === i.ByLayer ? 256 : this._colorMethod === i.ByBlock ? 0 : void 0;
|
|
523
523
|
}
|
|
524
524
|
set colorIndex(e) {
|
|
525
525
|
if (e == null) return;
|
|
526
526
|
const t = Math.max(0, Math.min(256, Math.round(e)));
|
|
527
|
-
t === 0 ? (this._colorMethod =
|
|
527
|
+
t === 0 ? (this._colorMethod = i.ByBlock, this._value = void 0) : t === 256 ? (this._colorMethod = i.ByLayer, this._value = void 0) : (this._colorMethod = i.ByACI, this._value = t);
|
|
528
528
|
}
|
|
529
529
|
get isByColor() {
|
|
530
|
-
return this._colorMethod ===
|
|
530
|
+
return this._colorMethod === i.ByColor;
|
|
531
531
|
}
|
|
532
532
|
get isByACI() {
|
|
533
|
-
return this._colorMethod ===
|
|
533
|
+
return this._colorMethod === i.ByACI;
|
|
534
534
|
}
|
|
535
535
|
get isForeground() {
|
|
536
|
-
return this._colorMethod ===
|
|
536
|
+
return this._colorMethod === i.ByACI && this._value === 7;
|
|
537
537
|
}
|
|
538
538
|
setForeground() {
|
|
539
|
-
return this._colorMethod =
|
|
539
|
+
return this._colorMethod = i.ByACI, this._value = 7, this;
|
|
540
540
|
}
|
|
541
541
|
get isByLayer() {
|
|
542
|
-
return this._colorMethod ===
|
|
542
|
+
return this._colorMethod === i.ByLayer;
|
|
543
543
|
}
|
|
544
544
|
setByLayer(e) {
|
|
545
|
-
return this._colorMethod =
|
|
545
|
+
return this._colorMethod = i.ByLayer, e == null ? this._value = 256 : this._value = e, this;
|
|
546
546
|
}
|
|
547
547
|
get isByBlock() {
|
|
548
|
-
return this._colorMethod ===
|
|
548
|
+
return this._colorMethod === i.ByBlock;
|
|
549
549
|
}
|
|
550
550
|
setByBlock(e) {
|
|
551
|
-
return this._colorMethod =
|
|
551
|
+
return this._colorMethod = i.ByBlock, e == null ? this._value = 0 : this._value = e, this;
|
|
552
552
|
}
|
|
553
553
|
get colorName() {
|
|
554
554
|
switch (this._colorMethod) {
|
|
555
|
-
case
|
|
555
|
+
case i.ByLayer:
|
|
556
556
|
return "ByLayer";
|
|
557
|
-
case
|
|
557
|
+
case i.ByBlock:
|
|
558
558
|
return "ByBlock";
|
|
559
|
-
case
|
|
559
|
+
case i.ByColor:
|
|
560
560
|
return this._value ? b.getNameByColor(this._value) : "";
|
|
561
|
-
case
|
|
561
|
+
case i.ByACI:
|
|
562
562
|
return this._value ? b.getNameByIndex(this._value) : "";
|
|
563
563
|
default:
|
|
564
564
|
return;
|
|
@@ -567,7 +567,7 @@ class B {
|
|
|
567
567
|
set colorName(e) {
|
|
568
568
|
if (!e) return;
|
|
569
569
|
const t = b.getColorByName(e);
|
|
570
|
-
t !== void 0 && (this._value = t, this._colorMethod =
|
|
570
|
+
t !== void 0 && (this._value = t, this._colorMethod = i.ByColor);
|
|
571
571
|
}
|
|
572
572
|
clone() {
|
|
573
573
|
const e = new B();
|
|
@@ -581,14 +581,16 @@ class B {
|
|
|
581
581
|
}
|
|
582
582
|
toString() {
|
|
583
583
|
switch (this._colorMethod) {
|
|
584
|
-
case
|
|
584
|
+
case i.None:
|
|
585
|
+
return "None";
|
|
586
|
+
case i.ByLayer:
|
|
585
587
|
return "ByLayer";
|
|
586
|
-
case
|
|
588
|
+
case i.ByBlock:
|
|
587
589
|
return "ByBlock";
|
|
588
|
-
case
|
|
590
|
+
case i.ByACI:
|
|
589
591
|
return this._value !== void 0 ? String(this._value) : "";
|
|
590
|
-
case
|
|
591
|
-
return this._value ?
|
|
592
|
+
case i.ByColor:
|
|
593
|
+
return this._value ? `RGB:${this.red},${this.green},${this.blue}` : "";
|
|
592
594
|
default:
|
|
593
595
|
return "";
|
|
594
596
|
}
|
|
@@ -596,36 +598,38 @@ class B {
|
|
|
596
598
|
static fromString(e) {
|
|
597
599
|
if (!e) return;
|
|
598
600
|
const t = e.trim();
|
|
601
|
+
if (/^none$/i.test(t))
|
|
602
|
+
return new B(i.None);
|
|
599
603
|
if (/^bylayer$/i.test(t))
|
|
600
|
-
return new B(
|
|
604
|
+
return new B(i.ByLayer);
|
|
601
605
|
if (/^byblock$/i.test(t))
|
|
602
|
-
return new B(
|
|
606
|
+
return new B(i.ByBlock);
|
|
603
607
|
const s = t.match(
|
|
604
608
|
/^rgb\s*:\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})$/i
|
|
605
609
|
);
|
|
606
610
|
if (s) {
|
|
607
|
-
const
|
|
608
|
-
return v.setRGB(
|
|
611
|
+
const l = Number(s[1]), n = Number(s[2]), c = Number(s[3]), v = new B(i.ByColor);
|
|
612
|
+
return v.setRGB(l, n, c), v;
|
|
609
613
|
}
|
|
610
614
|
if (/^\d{1,3},\d{1,3},\d{1,3}$/.test(t)) {
|
|
611
|
-
const [
|
|
612
|
-
return v.setRGB(
|
|
615
|
+
const [l, n, c] = t.split(",").map(Number), v = new B(i.ByColor);
|
|
616
|
+
return v.setRGB(l, n, c), v;
|
|
613
617
|
}
|
|
614
618
|
if (/^\d+$/.test(t)) {
|
|
615
|
-
const
|
|
616
|
-
return new B(
|
|
619
|
+
const l = parseInt(t, 10);
|
|
620
|
+
return new B(i.ByACI, l);
|
|
617
621
|
}
|
|
618
622
|
if (/^book\$/i.test(t)) {
|
|
619
|
-
const
|
|
620
|
-
return
|
|
623
|
+
const l = t.substring(t.indexOf("$") + 1), n = b.getColorByName(l);
|
|
624
|
+
return n != null ? new B(i.ByColor, n) : void 0;
|
|
621
625
|
}
|
|
622
626
|
const o = b.getColorByName(t);
|
|
623
627
|
if (o != null)
|
|
624
|
-
return new B(
|
|
628
|
+
return new B(i.ByColor, o);
|
|
625
629
|
}
|
|
626
630
|
}
|
|
627
631
|
class oe {
|
|
628
|
-
constructor(e =
|
|
632
|
+
constructor(e = i.ByColor, t = 0) {
|
|
629
633
|
this._colorMethod = e, this._value = t;
|
|
630
634
|
}
|
|
631
635
|
get colorMethd() {
|
|
@@ -635,49 +639,49 @@ class oe {
|
|
|
635
639
|
return this._value >> 16 & 255;
|
|
636
640
|
}
|
|
637
641
|
set red(e) {
|
|
638
|
-
this._colorMethod =
|
|
642
|
+
this._colorMethod = i.ByColor, this._value = this._value & 65535 | (e & 255) << 16;
|
|
639
643
|
}
|
|
640
644
|
get green() {
|
|
641
645
|
return this._value >> 8 & 255;
|
|
642
646
|
}
|
|
643
647
|
set green(e) {
|
|
644
|
-
this._colorMethod =
|
|
648
|
+
this._colorMethod = i.ByColor, this._value = this._value & 16711935 | (e & 255) << 8;
|
|
645
649
|
}
|
|
646
650
|
get blue() {
|
|
647
651
|
return this._value & 255;
|
|
648
652
|
}
|
|
649
653
|
set blue(e) {
|
|
650
|
-
this._colorMethod =
|
|
654
|
+
this._colorMethod = i.ByColor, this._value = this._value & 16776960 | e & 255;
|
|
651
655
|
}
|
|
652
656
|
setRGB(e, t, s) {
|
|
653
|
-
this._colorMethod =
|
|
657
|
+
this._colorMethod = i.ByColor, this._value = (e & 255) << 16 | (t & 255) << 8 | s & 255;
|
|
654
658
|
}
|
|
655
659
|
get colorIndex() {
|
|
656
660
|
return this._value;
|
|
657
661
|
}
|
|
658
662
|
set colorIndex(e) {
|
|
659
|
-
this._colorMethod =
|
|
663
|
+
this._colorMethod = i.ByACI, this._value = e;
|
|
660
664
|
}
|
|
661
665
|
get layerIndex() {
|
|
662
666
|
return this._value;
|
|
663
667
|
}
|
|
664
668
|
set layerIndex(e) {
|
|
665
|
-
this._colorMethod =
|
|
669
|
+
this._colorMethod = i.ByLayer, this._value = e;
|
|
666
670
|
}
|
|
667
671
|
isByColor() {
|
|
668
|
-
return this._colorMethod ===
|
|
672
|
+
return this._colorMethod === i.ByColor;
|
|
669
673
|
}
|
|
670
674
|
isByLayer() {
|
|
671
|
-
return this._colorMethod ===
|
|
675
|
+
return this._colorMethod === i.ByLayer;
|
|
672
676
|
}
|
|
673
677
|
isByBlock() {
|
|
674
|
-
return this._colorMethod ===
|
|
678
|
+
return this._colorMethod === i.ByBlock;
|
|
675
679
|
}
|
|
676
680
|
isByACI() {
|
|
677
|
-
return this._colorMethod ===
|
|
681
|
+
return this._colorMethod === i.ByACI;
|
|
678
682
|
}
|
|
679
683
|
isNone() {
|
|
680
|
-
return this._colorMethod ===
|
|
684
|
+
return this._colorMethod === i.None;
|
|
681
685
|
}
|
|
682
686
|
get rawValue() {
|
|
683
687
|
return this._value;
|
|
@@ -727,8 +731,8 @@ class ne {
|
|
|
727
731
|
if (this._listeners === void 0) return;
|
|
728
732
|
const o = this._listeners[e];
|
|
729
733
|
if (o !== void 0) {
|
|
730
|
-
const
|
|
731
|
-
|
|
734
|
+
const l = o.indexOf(t);
|
|
735
|
+
l !== -1 && o.splice(l, 1);
|
|
732
736
|
}
|
|
733
737
|
}
|
|
734
738
|
dispatchEvent(e) {
|
|
@@ -737,8 +741,8 @@ class ne {
|
|
|
737
741
|
if (s !== void 0) {
|
|
738
742
|
e.target = this;
|
|
739
743
|
const o = s.slice(0);
|
|
740
|
-
for (let
|
|
741
|
-
o[
|
|
744
|
+
for (let l = 0, n = o.length; l < n; l++)
|
|
745
|
+
o[l].call(this, e);
|
|
742
746
|
}
|
|
743
747
|
}
|
|
744
748
|
}
|
|
@@ -790,7 +794,7 @@ function Z(r, e) {
|
|
|
790
794
|
function J(r) {
|
|
791
795
|
return r == null ? !0 : Array.isArray(r) || typeof r == "string" ? r.length === 0 : r instanceof Map || r instanceof Set ? r.size === 0 : typeof r == "object" ? Object.keys(r).length === 0 : !1;
|
|
792
796
|
}
|
|
793
|
-
function
|
|
797
|
+
function E(r, e) {
|
|
794
798
|
if (r === e)
|
|
795
799
|
return !0;
|
|
796
800
|
if (r == null || e == null)
|
|
@@ -805,7 +809,7 @@ function I(r, e) {
|
|
|
805
809
|
if (r.length !== e.length)
|
|
806
810
|
return !1;
|
|
807
811
|
for (let o = 0; o < r.length; o++)
|
|
808
|
-
if (!
|
|
812
|
+
if (!E(r[o], e[o]))
|
|
809
813
|
return !1;
|
|
810
814
|
return !0;
|
|
811
815
|
}
|
|
@@ -816,7 +820,7 @@ function I(r, e) {
|
|
|
816
820
|
if (!Object.prototype.hasOwnProperty.call(
|
|
817
821
|
e,
|
|
818
822
|
o
|
|
819
|
-
) || !
|
|
823
|
+
) || !E(
|
|
820
824
|
r[o],
|
|
821
825
|
e[o]
|
|
822
826
|
))
|
|
@@ -827,7 +831,7 @@ var X = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : ty
|
|
|
827
831
|
function Q(r) {
|
|
828
832
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
829
833
|
}
|
|
830
|
-
var
|
|
834
|
+
var V = { exports: {} };
|
|
831
835
|
(function(r) {
|
|
832
836
|
(function(e, t) {
|
|
833
837
|
r.exports ? r.exports = t() : e.log = t();
|
|
@@ -839,7 +843,7 @@ var D = { exports: {} };
|
|
|
839
843
|
"info",
|
|
840
844
|
"warn",
|
|
841
845
|
"error"
|
|
842
|
-
],
|
|
846
|
+
], l = {}, n = null;
|
|
843
847
|
function c(h, d) {
|
|
844
848
|
var a = h[d];
|
|
845
849
|
if (typeof a.bind == "function")
|
|
@@ -866,16 +870,16 @@ var D = { exports: {} };
|
|
|
866
870
|
if (this.log = this.debug, typeof console === t && h < this.levels.SILENT)
|
|
867
871
|
return "No console available for logging";
|
|
868
872
|
}
|
|
869
|
-
function
|
|
873
|
+
function N(h) {
|
|
870
874
|
return function() {
|
|
871
875
|
typeof console !== t && (m.call(this), this[h].apply(this, arguments));
|
|
872
876
|
};
|
|
873
877
|
}
|
|
874
878
|
function f(h, d, a) {
|
|
875
|
-
return w(h) ||
|
|
879
|
+
return w(h) || N.apply(this, arguments);
|
|
876
880
|
}
|
|
877
881
|
function S(h, d) {
|
|
878
|
-
var a = this,
|
|
882
|
+
var a = this, I, x, L, p = "loglevel";
|
|
879
883
|
typeof h == "string" ? p += ":" + h : typeof h == "symbol" && (p = void 0);
|
|
880
884
|
function z(u) {
|
|
881
885
|
var g = (o[u] || "silent").toUpperCase();
|
|
@@ -900,9 +904,9 @@ var D = { exports: {} };
|
|
|
900
904
|
}
|
|
901
905
|
if (typeof u === t)
|
|
902
906
|
try {
|
|
903
|
-
var g = window.document.cookie, A = encodeURIComponent(p),
|
|
904
|
-
|
|
905
|
-
g.slice(
|
|
907
|
+
var g = window.document.cookie, A = encodeURIComponent(p), G = g.indexOf(A + "=");
|
|
908
|
+
G !== -1 && (u = /^([^;]+)/.exec(
|
|
909
|
+
g.slice(G + A.length + 1)
|
|
906
910
|
)[1]);
|
|
907
911
|
} catch {
|
|
908
912
|
}
|
|
@@ -935,11 +939,11 @@ var D = { exports: {} };
|
|
|
935
939
|
ERROR: 4,
|
|
936
940
|
SILENT: 5
|
|
937
941
|
}, a.methodFactory = d || f, a.getLevel = function() {
|
|
938
|
-
return L ??
|
|
942
|
+
return L ?? x ?? I;
|
|
939
943
|
}, a.setLevel = function(u, g) {
|
|
940
944
|
return L = M(u), g !== !1 && z(L), m.call(a);
|
|
941
945
|
}, a.setDefaultLevel = function(u) {
|
|
942
|
-
|
|
946
|
+
x = M(u), P() || a.setLevel(u, !1);
|
|
943
947
|
}, a.resetLevel = function() {
|
|
944
948
|
L = null, H(), m.call(a);
|
|
945
949
|
}, a.enableAll = function(u) {
|
|
@@ -947,34 +951,34 @@ var D = { exports: {} };
|
|
|
947
951
|
}, a.disableAll = function(u) {
|
|
948
952
|
a.setLevel(a.levels.SILENT, u);
|
|
949
953
|
}, a.rebuild = function() {
|
|
950
|
-
if (
|
|
951
|
-
for (var u in
|
|
952
|
-
|
|
953
|
-
},
|
|
954
|
-
|
|
954
|
+
if (n !== a && (I = M(n.getLevel())), m.call(a), n === a)
|
|
955
|
+
for (var u in l)
|
|
956
|
+
l[u].rebuild();
|
|
957
|
+
}, I = M(
|
|
958
|
+
n ? n.getLevel() : "WARN"
|
|
955
959
|
);
|
|
956
960
|
var T = P();
|
|
957
961
|
T != null && (L = M(T)), m.call(a);
|
|
958
962
|
}
|
|
959
|
-
|
|
963
|
+
n = new S(), n.getLogger = function(d) {
|
|
960
964
|
if (typeof d != "symbol" && typeof d != "string" || d === "")
|
|
961
965
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
962
|
-
var a =
|
|
963
|
-
return a || (a =
|
|
966
|
+
var a = l[d];
|
|
967
|
+
return a || (a = l[d] = new S(
|
|
964
968
|
d,
|
|
965
|
-
|
|
969
|
+
n.methodFactory
|
|
966
970
|
)), a;
|
|
967
971
|
};
|
|
968
972
|
var j = typeof window !== t ? window.log : void 0;
|
|
969
|
-
return
|
|
970
|
-
return typeof window !== t && window.log ===
|
|
971
|
-
},
|
|
972
|
-
return
|
|
973
|
-
},
|
|
973
|
+
return n.noConflict = function() {
|
|
974
|
+
return typeof window !== t && window.log === n && (window.log = j), n;
|
|
975
|
+
}, n.getLoggers = function() {
|
|
976
|
+
return l;
|
|
977
|
+
}, n.default = n, n;
|
|
974
978
|
});
|
|
975
|
-
})(
|
|
976
|
-
var
|
|
977
|
-
const ee = /* @__PURE__ */ Q(
|
|
979
|
+
})(V);
|
|
980
|
+
var D = V.exports;
|
|
981
|
+
const ee = /* @__PURE__ */ Q(D), te = /* @__PURE__ */ W({ __proto__: null, default: ee }, [D]), le = !0, O = te;
|
|
978
982
|
O.setLevel("debug");
|
|
979
983
|
const ae = (r) => {
|
|
980
984
|
try {
|
|
@@ -983,7 +987,7 @@ const ae = (r) => {
|
|
|
983
987
|
O.setLevel("error"), O.error(e);
|
|
984
988
|
}
|
|
985
989
|
};
|
|
986
|
-
class
|
|
990
|
+
class q {
|
|
987
991
|
constructor(e, t) {
|
|
988
992
|
this.events = {
|
|
989
993
|
attrChanged: new F(),
|
|
@@ -999,12 +1003,12 @@ class V {
|
|
|
999
1003
|
if (e == null) return this;
|
|
1000
1004
|
let o;
|
|
1001
1005
|
typeof e == "object" ? (o = e, s = t) : (o = {}, o[e] = t), s || (s = {});
|
|
1002
|
-
const
|
|
1006
|
+
const l = s.unset, n = s.silent, c = [], v = this._changing;
|
|
1003
1007
|
this._changing = !0, v || (this._previousAttributes = C(this.attributes), this.changed = {});
|
|
1004
|
-
const w = this.attributes, m = this.changed,
|
|
1008
|
+
const w = this.attributes, m = this.changed, N = this._previousAttributes;
|
|
1005
1009
|
for (const f in o)
|
|
1006
|
-
t = o[f],
|
|
1007
|
-
if (!
|
|
1010
|
+
t = o[f], E(w[f], t) || c.push(f), E(N[f], t) ? delete m[f] : m[f] = t, l ? delete w[f] : w[f] = t;
|
|
1011
|
+
if (!n) {
|
|
1008
1012
|
c.length && (this._pending = s);
|
|
1009
1013
|
for (let f = 0; f < c.length; f++)
|
|
1010
1014
|
this.events.attrChanged.dispatch({
|
|
@@ -1015,7 +1019,7 @@ class V {
|
|
|
1015
1019
|
});
|
|
1016
1020
|
}
|
|
1017
1021
|
if (v) return this;
|
|
1018
|
-
if (!
|
|
1022
|
+
if (!n)
|
|
1019
1023
|
for (; this._pending; )
|
|
1020
1024
|
s = this._pending, this._pending = !1, this.events.modelChanged.dispatch({
|
|
1021
1025
|
object: this,
|
|
@@ -1033,8 +1037,8 @@ class V {
|
|
|
1033
1037
|
if (!e) return this.hasChanged() ? C(this.changed) : {};
|
|
1034
1038
|
const t = this._changing ? this._previousAttributes : this.attributes, s = {};
|
|
1035
1039
|
for (const o in e) {
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1040
|
+
const l = e[o];
|
|
1041
|
+
E(t[o], l) || (s[o] = l);
|
|
1038
1042
|
}
|
|
1039
1043
|
return s;
|
|
1040
1044
|
}
|
|
@@ -1046,7 +1050,7 @@ class V {
|
|
|
1046
1050
|
}
|
|
1047
1051
|
clone() {
|
|
1048
1052
|
const e = C(this.attributes);
|
|
1049
|
-
return new
|
|
1053
|
+
return new q(e);
|
|
1050
1054
|
}
|
|
1051
1055
|
}
|
|
1052
1056
|
class k {
|
|
@@ -1079,8 +1083,8 @@ class k {
|
|
|
1079
1083
|
class he {
|
|
1080
1084
|
static formatBytes(e, t = 2) {
|
|
1081
1085
|
if (e === 0) return "0 B";
|
|
1082
|
-
const s = 1024, o = Math.max(0, t),
|
|
1083
|
-
return `${parseFloat(c.toFixed(o))} ${
|
|
1086
|
+
const s = 1024, o = Math.max(0, t), l = ["B", "KB", "MB", "GB", "TB"], n = Math.floor(Math.log(e) / Math.log(s)), c = e / Math.pow(s, n);
|
|
1087
|
+
return `${parseFloat(c.toFixed(o))} ${l[n]}`;
|
|
1084
1088
|
}
|
|
1085
1089
|
}
|
|
1086
1090
|
var y = /* @__PURE__ */ ((r) => (r[r.ByLayer = 0] = "ByLayer", r[r.ByBlock = 1] = "ByBlock", r[r.ByAlpha = 2] = "ByAlpha", r[r.ErrorValue = 3] = "ErrorValue", r))(y || {});
|
|
@@ -1143,24 +1147,26 @@ class _ {
|
|
|
1143
1147
|
return this.isByLayer ? "ByLayer" : this.isByBlock ? "ByBlock" : this._alpha.toString();
|
|
1144
1148
|
}
|
|
1145
1149
|
static fromString(e) {
|
|
1146
|
-
const t = e.trim();
|
|
1147
|
-
if (
|
|
1148
|
-
const
|
|
1149
|
-
return
|
|
1150
|
+
const t = e.trim(), s = t.toLowerCase();
|
|
1151
|
+
if (s === "" || s === "." || s === "use current" || s === "bylayer") {
|
|
1152
|
+
const n = new _();
|
|
1153
|
+
return n._method = y.ByLayer, n;
|
|
1154
|
+
}
|
|
1155
|
+
if (s === "byblock") {
|
|
1156
|
+
const n = new _();
|
|
1157
|
+
return n._method = y.ByBlock, n;
|
|
1150
1158
|
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1159
|
+
const o = Number(t);
|
|
1160
|
+
if (Number.isInteger(o) && o >= 0 && o <= 255) {
|
|
1161
|
+
const n = new _();
|
|
1162
|
+
return o <= 90 ? n.percentage = o : n.alpha = o, n;
|
|
1154
1163
|
}
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1157
|
-
return new _(s);
|
|
1158
|
-
const o = new _();
|
|
1159
|
-
return o._method = y.ErrorValue, o;
|
|
1164
|
+
const l = new _();
|
|
1165
|
+
return l._method = y.ErrorValue, l;
|
|
1160
1166
|
}
|
|
1161
1167
|
static deserialize(e) {
|
|
1162
|
-
const t = e >>> 24 & 255, s = e & 255, o =
|
|
1163
|
-
return
|
|
1168
|
+
const t = e >>> 24 & 255, s = e & 255, o = t >= y.ByLayer && t <= y.ErrorValue ? t : y.ErrorValue, l = new _();
|
|
1169
|
+
return l._method = o, l._alpha = _.clampAlpha(s), l;
|
|
1164
1170
|
}
|
|
1165
1171
|
}
|
|
1166
1172
|
class ue {
|
|
@@ -1201,15 +1207,15 @@ class ce {
|
|
|
1201
1207
|
const t = this.tasks.length;
|
|
1202
1208
|
let s = e;
|
|
1203
1209
|
for (let o = 0; o < t; o++) {
|
|
1204
|
-
const
|
|
1210
|
+
const l = this.tasks[o];
|
|
1205
1211
|
try {
|
|
1206
1212
|
s = await this.scheduleTask(async () => {
|
|
1207
|
-
const
|
|
1208
|
-
return this.onProgress((o + 1) / t,
|
|
1213
|
+
const n = await l.run(s);
|
|
1214
|
+
return this.onProgress((o + 1) / t, l), n;
|
|
1209
1215
|
});
|
|
1210
|
-
} catch (
|
|
1211
|
-
if (this.onError({ error:
|
|
1212
|
-
return Promise.reject(
|
|
1216
|
+
} catch (n) {
|
|
1217
|
+
if (this.onError({ error: n, taskIndex: o, task: l }))
|
|
1218
|
+
return Promise.reject(n);
|
|
1213
1219
|
}
|
|
1214
1220
|
}
|
|
1215
1221
|
this.onComplete(s);
|
|
@@ -1243,9 +1249,9 @@ class re {
|
|
|
1243
1249
|
}
|
|
1244
1250
|
getHandler(e) {
|
|
1245
1251
|
for (let t = 0, s = this.handlers.length; t < s; t += 2) {
|
|
1246
|
-
const o = this.handlers[t],
|
|
1252
|
+
const o = this.handlers[t], l = this.handlers[t + 1];
|
|
1247
1253
|
if (o.global && (o.lastIndex = 0), o.test(e))
|
|
1248
|
-
return
|
|
1254
|
+
return l;
|
|
1249
1255
|
}
|
|
1250
1256
|
return null;
|
|
1251
1257
|
}
|
|
@@ -1280,7 +1286,7 @@ class de {
|
|
|
1280
1286
|
}
|
|
1281
1287
|
export {
|
|
1282
1288
|
B as AcCmColor,
|
|
1283
|
-
|
|
1289
|
+
i as AcCmColorMethod,
|
|
1284
1290
|
b as AcCmColorUtil,
|
|
1285
1291
|
oe as AcCmEntityColor,
|
|
1286
1292
|
ie as AcCmErrors,
|
|
@@ -1288,7 +1294,7 @@ export {
|
|
|
1288
1294
|
F as AcCmEventManager,
|
|
1289
1295
|
de as AcCmLoader,
|
|
1290
1296
|
re as AcCmLoadingManager,
|
|
1291
|
-
|
|
1297
|
+
q as AcCmObject,
|
|
1292
1298
|
k as AcCmPerformanceCollector,
|
|
1293
1299
|
ue as AcCmTask,
|
|
1294
1300
|
ce as AcCmTaskScheduler,
|
|
@@ -1302,7 +1308,7 @@ export {
|
|
|
1302
1308
|
Y as defaults,
|
|
1303
1309
|
Z as has,
|
|
1304
1310
|
J as isEmpty,
|
|
1305
|
-
|
|
1311
|
+
E as isEqual,
|
|
1306
1312
|
O as log,
|
|
1307
1313
|
ae as setLogLevel
|
|
1308
1314
|
};
|