svg-path-commander 1.0.4 → 1.0.5
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/README.md +4 -4
- package/dist/svg-path-commander.es5.js +82 -95
- package/dist/svg-path-commander.es5.min.js +2 -2
- package/dist/svg-path-commander.esm.js +70 -83
- package/dist/svg-path-commander.esm.min.js +2 -2
- package/dist/svg-path-commander.js +70 -83
- package/dist/svg-path-commander.min.js +2 -2
- package/package.json +1 -1
- package/src/convert/pathToAbsolute.js +3 -10
- package/src/convert/pathToCurve.js +4 -4
- package/src/parser/pathParser.js +0 -1
- package/src/process/arcToCubic.js +2 -2
- package/src/process/fixArc.js +0 -1
- package/src/process/lineToCubic.js +0 -3
- package/src/svg-path-commander.js +0 -1
- package/src/util/isAbsoluteArray.js +1 -1
- package/src/util/isCurveArray.js +1 -1
- package/src/util/isNormalizedArray.js +1 -1
- package/src/util/isRelativeArray.js +1 -1
- package/src/util/segmentArcFactory.js +1 -1
- package/src/util/segmentCubicFactory.js +1 -1
- package/src/util/segmentLineFactory.js +1 -1
- package/src/util/segmentQuadFactory.js +1 -1
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# SVGPathCommander
|
|
2
2
|
[](https://coveralls.io/github/thednp/svg-path-commander)
|
|
3
|
+
[](https://github.com/thednp/svg-path-commander/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/svg-path-commander)
|
|
5
|
+
[](http://npm-stat.com/charts.html?svg-path-commander)
|
|
6
|
+
[](https://www.jsdelivr.com/package/npm/svg-path-commander)
|
|
3
7
|

|
|
4
8
|

|
|
5
|
-
[](https://github.com/thednp/svg-path-commander/actions/workflows/ci.yml)
|
|
6
9
|
|
|
7
10
|

|
|
8
11
|
|
|
9
12
|
A modern set of ES6+ JavaScript tools for manipulating the `d` (description) attribute for *SVGPathElement* items. The library is implementing modern JavaScript API to produce reusable path strings with lossless quality. In addition, you also have a powerful tool to convert other SVG shapes like `<circle>` or `<rect>` to `<path>`.
|
|
10
13
|
|
|
11
|
-
[](https://www.npmjs.com/package/svg-path-commander)
|
|
12
|
-
[](http://npm-stat.com/charts.html?svg-path-commander)
|
|
13
|
-
[](https://www.jsdelivr.com/package/npm/svg-path-commander)
|
|
14
14
|
|
|
15
15
|
While you may find familiar tools inside, this library brings ***new additions***:
|
|
16
16
|
* the build in `getBBox`, `getPointAtLength` and `getTotalLength` are more reliable and much more accurate than the native methods, not to mention their world class performance ratings;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SVGPathCommander v1.0.
|
|
2
|
+
* SVGPathCommander v1.0.5 (http://thednp.github.io/svg-path-commander)
|
|
3
3
|
* Copyright 2022 © thednp
|
|
4
4
|
* Licensed under MIT (https://github.com/thednp/svg-path-commander/blob/master/LICENSE)
|
|
5
5
|
*/
|
|
@@ -357,7 +357,6 @@
|
|
|
357
357
|
*/
|
|
358
358
|
function PathParser(pathString) {
|
|
359
359
|
/** @type {SVGPath.pathArray} */
|
|
360
|
-
// @ts-ignore
|
|
361
360
|
this.segments = [];
|
|
362
361
|
/** @type {string} */
|
|
363
362
|
this.pathValue = pathString;
|
|
@@ -420,7 +419,7 @@
|
|
|
420
419
|
*/
|
|
421
420
|
function isAbsoluteArray(path) {
|
|
422
421
|
return isPathArray(path)
|
|
423
|
-
//
|
|
422
|
+
// `isPathArray` also checks if it's `Array`
|
|
424
423
|
&& path.every(function (ref) {
|
|
425
424
|
var x = ref[0];
|
|
426
425
|
|
|
@@ -438,7 +437,7 @@
|
|
|
438
437
|
function pathToAbsolute(pathInput) {
|
|
439
438
|
/* istanbul ignore else */
|
|
440
439
|
if (isAbsoluteArray(pathInput)) {
|
|
441
|
-
//
|
|
440
|
+
// `isAbsoluteArray` checks if it's `pathArray`
|
|
442
441
|
return clonePath(pathInput);
|
|
443
442
|
}
|
|
444
443
|
|
|
@@ -446,14 +445,13 @@
|
|
|
446
445
|
var x = 0; var y = 0;
|
|
447
446
|
var mx = 0; var my = 0;
|
|
448
447
|
|
|
449
|
-
//
|
|
448
|
+
// the `absoluteSegment[]` is for sure an `absolutePath`
|
|
450
449
|
return path.map(function (segment) {
|
|
451
450
|
var assign, assign$1, assign$2;
|
|
452
451
|
|
|
453
452
|
var values = segment.slice(1).map(Number);
|
|
454
453
|
var pathCommand = segment[0];
|
|
455
454
|
/** @type {SVGPath.absoluteCommand} */
|
|
456
|
-
// @ts-ignore
|
|
457
455
|
var absCommand = pathCommand.toUpperCase();
|
|
458
456
|
|
|
459
457
|
if (pathCommand === 'M') {
|
|
@@ -463,7 +461,6 @@
|
|
|
463
461
|
return ['M', x, y];
|
|
464
462
|
}
|
|
465
463
|
/** @type {SVGPath.absoluteSegment} */
|
|
466
|
-
// @ts-ignore
|
|
467
464
|
var absoluteSegment = [];
|
|
468
465
|
|
|
469
466
|
if (pathCommand !== absCommand) {
|
|
@@ -483,12 +480,11 @@
|
|
|
483
480
|
// use brakets for `eslint: no-case-declaration`
|
|
484
481
|
// https://stackoverflow.com/a/50753272/803358
|
|
485
482
|
var absValues = values.map(function (n, j) { return n + (j % 2 ? y : x); });
|
|
486
|
-
//
|
|
483
|
+
// for n, l, c, s, q, t
|
|
487
484
|
absoluteSegment = [absCommand ].concat( absValues);
|
|
488
485
|
}
|
|
489
486
|
}
|
|
490
487
|
} else {
|
|
491
|
-
// @ts-ignore
|
|
492
488
|
absoluteSegment = [absCommand ].concat( values);
|
|
493
489
|
}
|
|
494
490
|
|
|
@@ -499,17 +495,13 @@
|
|
|
499
495
|
y = my;
|
|
500
496
|
break;
|
|
501
497
|
case 'H':
|
|
502
|
-
// @ts-ignore
|
|
503
498
|
(assign$1 = absoluteSegment, x = assign$1[1]);
|
|
504
499
|
break;
|
|
505
500
|
case 'V':
|
|
506
|
-
// @ts-ignore
|
|
507
501
|
(assign$2 = absoluteSegment, y = assign$2[1]);
|
|
508
502
|
break;
|
|
509
503
|
default:
|
|
510
|
-
// @ts-ignore
|
|
511
504
|
x = absoluteSegment[segLength - 2];
|
|
512
|
-
// @ts-ignore
|
|
513
505
|
y = absoluteSegment[segLength - 1];
|
|
514
506
|
|
|
515
507
|
if (absCommand === 'M') {
|
|
@@ -530,7 +522,7 @@
|
|
|
530
522
|
*/
|
|
531
523
|
function isRelativeArray(path) {
|
|
532
524
|
return isPathArray(path)
|
|
533
|
-
//
|
|
525
|
+
// `isPathArray` checks if it's `Array`
|
|
534
526
|
&& path.slice(1).every(function (ref) {
|
|
535
527
|
var pc = ref[0];
|
|
536
528
|
|
|
@@ -637,13 +629,45 @@
|
|
|
637
629
|
while (segment.length) {
|
|
638
630
|
// if created multiple C:s, their original seg is saved
|
|
639
631
|
allPathCommands[i] = 'A';
|
|
640
|
-
// @ts-ignore
|
|
641
632
|
path.splice(ni += 1, 0, ['C' ].concat( segment.splice(0, 6)));
|
|
642
633
|
}
|
|
643
634
|
path.splice(i, 1);
|
|
644
635
|
}
|
|
645
636
|
}
|
|
646
637
|
|
|
638
|
+
/**
|
|
639
|
+
* Iterates an array to check if it's a `pathArray`
|
|
640
|
+
* with all segments are in non-shorthand notation
|
|
641
|
+
* with absolute values.
|
|
642
|
+
*
|
|
643
|
+
* @param {string | SVGPath.pathArray} path the `pathArray` to be checked
|
|
644
|
+
* @returns {boolean} iteration result
|
|
645
|
+
*/
|
|
646
|
+
function isNormalizedArray(path) {
|
|
647
|
+
// `isAbsoluteArray` also checks if it's `Array`
|
|
648
|
+
return isAbsoluteArray(path) && path.every(function (ref) {
|
|
649
|
+
var pc = ref[0];
|
|
650
|
+
|
|
651
|
+
return 'ACLMQZ'.includes(pc);
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Iterates an array to check if it's a `pathArray`
|
|
657
|
+
* with all C (cubic bezier) segments.
|
|
658
|
+
*
|
|
659
|
+
* @param {string | SVGPath.pathArray} path the `Array` to be checked
|
|
660
|
+
* @returns {boolean} iteration result
|
|
661
|
+
*/
|
|
662
|
+
function isCurveArray(path) {
|
|
663
|
+
// `isPathArray` also checks if it's `Array`
|
|
664
|
+
return isNormalizedArray(path) && path.every(function (ref) {
|
|
665
|
+
var pc = ref[0];
|
|
666
|
+
|
|
667
|
+
return 'MC'.includes(pc);
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
|
|
647
671
|
/**
|
|
648
672
|
* Normalizes a single segment of a `pathArray` object.
|
|
649
673
|
*
|
|
@@ -692,23 +716,6 @@
|
|
|
692
716
|
return result;
|
|
693
717
|
}
|
|
694
718
|
|
|
695
|
-
/**
|
|
696
|
-
* Iterates an array to check if it's a `pathArray`
|
|
697
|
-
* with all segments are in non-shorthand notation
|
|
698
|
-
* with absolute values.
|
|
699
|
-
*
|
|
700
|
-
* @param {string | SVGPath.pathArray} path the `pathArray` to be checked
|
|
701
|
-
* @returns {boolean} iteration result
|
|
702
|
-
*/
|
|
703
|
-
function isNormalizedArray(path) {
|
|
704
|
-
// @ts-ignore -- `isAbsoluteArray` also checks if it's `Array`
|
|
705
|
-
return isAbsoluteArray(path) && path.every(function (ref) {
|
|
706
|
-
var pc = ref[0];
|
|
707
|
-
|
|
708
|
-
return 'ACLMQZ'.includes(pc);
|
|
709
|
-
});
|
|
710
|
-
}
|
|
711
|
-
|
|
712
719
|
/**
|
|
713
720
|
* @type {SVGPath.parserParams}
|
|
714
721
|
*/
|
|
@@ -757,55 +764,6 @@
|
|
|
757
764
|
return path;
|
|
758
765
|
}
|
|
759
766
|
|
|
760
|
-
/**
|
|
761
|
-
* Checks a `pathArray` for an unnecessary `Z` segment
|
|
762
|
-
* and returns a new `pathArray` without it.
|
|
763
|
-
*
|
|
764
|
-
* The `pathInput` must be a single path, without
|
|
765
|
-
* sub-paths. For multi-path `<path>` elements,
|
|
766
|
-
* use `splitPath` first and apply this utility on each
|
|
767
|
-
* sub-path separately.
|
|
768
|
-
*
|
|
769
|
-
* @param {SVGPath.pathArray | string} pathInput the `pathArray` source
|
|
770
|
-
* @return {SVGPath.pathArray} a fixed `pathArray`
|
|
771
|
-
*/
|
|
772
|
-
function fixPath(pathInput) {
|
|
773
|
-
var pathArray = parsePathString(pathInput);
|
|
774
|
-
var normalArray = normalizePath(pathArray);
|
|
775
|
-
var length = pathArray.length;
|
|
776
|
-
var isClosed = normalArray.slice(-1)[0][0] === 'Z';
|
|
777
|
-
var segBeforeZ = isClosed ? length - 2 : length - 1;
|
|
778
|
-
|
|
779
|
-
var ref = normalArray[0].slice(1);
|
|
780
|
-
var mx = ref[0];
|
|
781
|
-
var my = ref[1];
|
|
782
|
-
var ref$1 = normalArray[segBeforeZ].slice(-2);
|
|
783
|
-
var x = ref$1[0];
|
|
784
|
-
var y = ref$1[1];
|
|
785
|
-
|
|
786
|
-
/* istanbul ignore else */
|
|
787
|
-
if (isClosed && mx === x && my === y) {
|
|
788
|
-
return pathArray.slice(0, -1);
|
|
789
|
-
}
|
|
790
|
-
return pathArray;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
/**
|
|
794
|
-
* Iterates an array to check if it's a `pathArray`
|
|
795
|
-
* with all C (cubic bezier) segments.
|
|
796
|
-
*
|
|
797
|
-
* @param {string | SVGPath.pathArray} path the `Array` to be checked
|
|
798
|
-
* @returns {boolean} iteration result
|
|
799
|
-
*/
|
|
800
|
-
function isCurveArray(path) {
|
|
801
|
-
// @ts-ignore -- `isPathArray` also checks if it's `Array`
|
|
802
|
-
return isNormalizedArray(path) && path.every(function (ref) {
|
|
803
|
-
var pc = ref[0];
|
|
804
|
-
|
|
805
|
-
return 'MC'.includes(pc);
|
|
806
|
-
});
|
|
807
|
-
}
|
|
808
|
-
|
|
809
767
|
/**
|
|
810
768
|
* Returns an {x,y} vector rotated by a given
|
|
811
769
|
* angle in radian.
|
|
@@ -882,9 +840,9 @@
|
|
|
882
840
|
cx = ((k * rx * y) / ry) + ((x1 + x2) / 2);
|
|
883
841
|
cy = ((k * -ry * x) / rx) + ((y1 + y2) / 2);
|
|
884
842
|
// eslint-disable-next-line no-bitwise -- Impossible to satisfy no-bitwise
|
|
885
|
-
f1 =
|
|
843
|
+
f1 = Math.asin((((y1 - cy) / ry) * (Math.pow( 10, 9 )) >> 0) / (Math.pow( 10, 9 )));
|
|
886
844
|
// eslint-disable-next-line no-bitwise -- Impossible to satisfy no-bitwise
|
|
887
|
-
f2 =
|
|
845
|
+
f2 = Math.asin((((y2 - cy) / ry) * (Math.pow( 10, 9 )) >> 0) / (Math.pow( 10, 9 )));
|
|
888
846
|
|
|
889
847
|
f1 = x1 < cx ? Math.PI - f1 : f1;
|
|
890
848
|
f2 = x2 < cx ? Math.PI - f2 : f2;
|
|
@@ -1006,7 +964,7 @@
|
|
|
1006
964
|
|
|
1007
965
|
/* istanbul ignore else */
|
|
1008
966
|
if (typeof distance === 'number') {
|
|
1009
|
-
if (distance
|
|
967
|
+
if (distance <= 0) {
|
|
1010
968
|
point = { x: x1, y: y1 };
|
|
1011
969
|
} else if (distance >= length) {
|
|
1012
970
|
point = { x: x2, y: y2 };
|
|
@@ -1053,13 +1011,10 @@
|
|
|
1053
1011
|
var p5 = midPoint(p3, p4, t);
|
|
1054
1012
|
var p6 = midPoint(p4, p5, t);
|
|
1055
1013
|
var seg1 = p0.concat( p2, p4, p6, [t]);
|
|
1056
|
-
// @ts-ignore
|
|
1057
1014
|
var cp1 = segmentLineFactory.apply(void 0, seg1).point;
|
|
1058
1015
|
var seg2 = p6.concat( p5, p3, p1, [0]);
|
|
1059
|
-
// @ts-ignore
|
|
1060
1016
|
var cp2 = segmentLineFactory.apply(void 0, seg2).point;
|
|
1061
1017
|
|
|
1062
|
-
// @ts-ignore
|
|
1063
1018
|
return [cp1.x, cp1.y, cp2.x, cp2.y, x2, y2];
|
|
1064
1019
|
}
|
|
1065
1020
|
|
|
@@ -1122,11 +1077,12 @@
|
|
|
1122
1077
|
|
|
1123
1078
|
/* istanbul ignore else */
|
|
1124
1079
|
if (isCurveArray(pathInput)) {
|
|
1125
|
-
//
|
|
1080
|
+
// `isCurveArray` checks if it's `pathArray`
|
|
1126
1081
|
return clonePath(pathInput);
|
|
1127
1082
|
}
|
|
1128
1083
|
|
|
1129
|
-
|
|
1084
|
+
// const path = fixPath(normalizePath(pathInput));
|
|
1085
|
+
var path = normalizePath(pathInput);
|
|
1130
1086
|
var params = Object.assign({}, paramsParser);
|
|
1131
1087
|
var allPathCommands = [];
|
|
1132
1088
|
var pathCommand = ''; // ts-lint
|
|
@@ -1149,7 +1105,6 @@
|
|
|
1149
1105
|
params.y2 = +(segment[seglen - 3]) || params.y1;
|
|
1150
1106
|
}
|
|
1151
1107
|
|
|
1152
|
-
// @ts-ignore
|
|
1153
1108
|
return path;
|
|
1154
1109
|
}
|
|
1155
1110
|
|
|
@@ -2686,7 +2641,7 @@
|
|
|
2686
2641
|
var POINT = { x: 0, y: 0 };
|
|
2687
2642
|
var POINTS = [{ x: x, y: y }];
|
|
2688
2643
|
|
|
2689
|
-
if (distanceIsNumber && distance
|
|
2644
|
+
if (distanceIsNumber && distance <= 0) {
|
|
2690
2645
|
POINT = { x: x, y: y };
|
|
2691
2646
|
}
|
|
2692
2647
|
|
|
@@ -2784,7 +2739,7 @@
|
|
|
2784
2739
|
var POINT = { x: 0, y: 0 };
|
|
2785
2740
|
var POINTS = [{ x: x, y: y }];
|
|
2786
2741
|
|
|
2787
|
-
if (distanceIsNumber && distance
|
|
2742
|
+
if (distanceIsNumber && distance <= 0) {
|
|
2788
2743
|
POINT = { x: x, y: y };
|
|
2789
2744
|
}
|
|
2790
2745
|
|
|
@@ -2878,7 +2833,7 @@
|
|
|
2878
2833
|
var POINT = { x: 0, y: 0 };
|
|
2879
2834
|
var POINTS = [{ x: x, y: y }];
|
|
2880
2835
|
|
|
2881
|
-
if (distanceIsNumber && distance
|
|
2836
|
+
if (distanceIsNumber && distance <= 0) {
|
|
2882
2837
|
POINT = { x: x, y: y };
|
|
2883
2838
|
}
|
|
2884
2839
|
|
|
@@ -3230,7 +3185,6 @@
|
|
|
3230
3185
|
var split = splitPath(segments);
|
|
3231
3186
|
var subPath = split.length > 1 ? split : 0;
|
|
3232
3187
|
|
|
3233
|
-
// @ts-ignore
|
|
3234
3188
|
var absoluteMultiPath = subPath && clonePath(subPath).map(function (x, i) {
|
|
3235
3189
|
if (onlySubpath) {
|
|
3236
3190
|
return i ? reversePath(x) : parsePathString(x);
|
|
@@ -3829,6 +3783,39 @@
|
|
|
3829
3783
|
return [['M' ].concat( rotatedCurve[0].slice(0, 2)) ].concat( rotatedCurve.map(function (x) { return ['C' ].concat( x.slice(2)); }));
|
|
3830
3784
|
}
|
|
3831
3785
|
|
|
3786
|
+
/**
|
|
3787
|
+
* Checks a `pathArray` for an unnecessary `Z` segment
|
|
3788
|
+
* and returns a new `pathArray` without it.
|
|
3789
|
+
*
|
|
3790
|
+
* The `pathInput` must be a single path, without
|
|
3791
|
+
* sub-paths. For multi-path `<path>` elements,
|
|
3792
|
+
* use `splitPath` first and apply this utility on each
|
|
3793
|
+
* sub-path separately.
|
|
3794
|
+
*
|
|
3795
|
+
* @param {SVGPath.pathArray | string} pathInput the `pathArray` source
|
|
3796
|
+
* @return {SVGPath.pathArray} a fixed `pathArray`
|
|
3797
|
+
*/
|
|
3798
|
+
function fixPath(pathInput) {
|
|
3799
|
+
var pathArray = parsePathString(pathInput);
|
|
3800
|
+
var normalArray = normalizePath(pathArray);
|
|
3801
|
+
var length = pathArray.length;
|
|
3802
|
+
var isClosed = normalArray.slice(-1)[0][0] === 'Z';
|
|
3803
|
+
var segBeforeZ = isClosed ? length - 2 : length - 1;
|
|
3804
|
+
|
|
3805
|
+
var ref = normalArray[0].slice(1);
|
|
3806
|
+
var mx = ref[0];
|
|
3807
|
+
var my = ref[1];
|
|
3808
|
+
var ref$1 = normalArray[segBeforeZ].slice(-2);
|
|
3809
|
+
var x = ref$1[0];
|
|
3810
|
+
var y = ref$1[1];
|
|
3811
|
+
|
|
3812
|
+
/* istanbul ignore else */
|
|
3813
|
+
if (isClosed && mx === x && my === y) {
|
|
3814
|
+
return pathArray.slice(0, -1);
|
|
3815
|
+
}
|
|
3816
|
+
return pathArray;
|
|
3817
|
+
}
|
|
3818
|
+
|
|
3832
3819
|
/**
|
|
3833
3820
|
* @interface
|
|
3834
3821
|
*/
|
|
@@ -3870,7 +3857,7 @@
|
|
|
3870
3857
|
options: defaultOptions,
|
|
3871
3858
|
};
|
|
3872
3859
|
|
|
3873
|
-
var version = "1.0.
|
|
3860
|
+
var version = "1.0.5";
|
|
3874
3861
|
|
|
3875
3862
|
/**
|
|
3876
3863
|
* A global namespace for library version.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// SVGPathCommander v1.0.
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).SVGPathCommander=e()}(this,(function(){"use strict";var t={origin:[0,0,0],round:4},e={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function r(t){for(var r=t.pathValue[t.segmentStart],n=r.toLowerCase(),a=t.data;a.length>=e[n]&&("m"===n&&a.length>2?(t.segments.push([r].concat(a.splice(0,2))),n="l",r="m"===r?"l":"L"):t.segments.push([r].concat(a.splice(0,e[n]))),e[n]););}var n="SVGPathCommander error";function a(t){var e=t.index,r=t.pathValue,a=r.charCodeAt(e);return 48===a?(t.param=0,void(t.index+=1)):49===a?(t.param=1,void(t.index+=1)):void(t.err=n+': invalid Arc flag "'+r[e]+'", expecting 0 or 1 at index '+e)}function i(t){return t>=48&&t<=57}function o(t){var e,r=t.max,a=t.pathValue,o=t.index,u=o,c=!1,s=!1,m=!1,f=!1;if(u>=r)t.err=n+": Invalid path value at index "+u+', "pathValue" is missing param';else if(43!==(e=a.charCodeAt(u))&&45!==e||(u+=1,e=a.charCodeAt(u)),i(e)||46===e){if(46!==e){if(c=48===e,u+=1,e=a.charCodeAt(u),c&&u<r&&e&&i(e))return void(t.err=n+": Invalid path value at index "+o+', "'+a[o]+'" illegal number');for(;u<r&&i(a.charCodeAt(u));)u+=1,s=!0;e=a.charCodeAt(u)}if(46===e){for(f=!0,u+=1;i(a.charCodeAt(u));)u+=1,m=!0;e=a.charCodeAt(u)}if(101===e||69===e){if(f&&!s&&!m)return void(t.err=n+": Invalid path value at index "+u+', "'+a[u]+'" invalid float exponent');if(u+=1,43!==(e=a.charCodeAt(u))&&45!==e||(u+=1),!(u<r&&i(a.charCodeAt(u))))return void(t.err=n+": Invalid path value at index "+u+', "'+a[u]+'" invalid integer exponent');for(;u<r&&i(a.charCodeAt(u));)u+=1}t.index=u,t.param=+t.pathValue.slice(o,u)}else t.err=n+": Invalid path value at index "+u+', "'+a[u]+'" is not a number'}function u(t){for(var e,r=t.pathValue,n=t.max;t.index<n&&(10===(e=r.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function c(t){return t>=48&&t<=57||43===t||45===t||46===t}function s(t){var i=t.max,s=t.pathValue,m=t.index,f=s.charCodeAt(m),h=e[s[m].toLowerCase()];if(t.segmentStart=m,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(f))if(t.index+=1,u(t),t.data=[],h){for(;;){for(var l=h;l>0;l-=1){if(97!=(32|f)||3!==l&&4!==l?o(t):a(t),t.err.length)return;t.data.push(t.param),u(t),t.index<i&&44===s.charCodeAt(t.index)&&(t.index+=1,u(t))}if(t.index>=t.max)break;if(!c(s.charCodeAt(t.index)))break}r(t)}else r(t);else t.err=n+': Invalid path value "'+s[m]+'" is not a path command'}function m(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}function f(t){this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}function h(t){return Array.isArray(t)&&t.every((function(t){var r=t[0].toLowerCase();return e[r]===t.length-1&&"achlmqstvz".includes(r)}))}function l(t){if(h(t))return m(t);var e=new f(t);for(u(e);e.index<e.max&&!e.err.length;)s(e);return e.err?e.err:e.segments}function p(t){return h(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function y(t){if(p(t))return m(t);var e=l(t),r=0,n=0,a=0,i=0;return e.map((function(t){var e,o=t.slice(1).map(Number),u=t[0],c=u.toUpperCase();if("M"===u)return r=(e=o)[0],n=e[1],a=r,i=n,["M",r,n];var s=[];if(u!==c)switch(c){case"A":s=[c,o[0],o[1],o[2],o[3],o[4],o[5]+r,o[6]+n];break;case"V":s=[c,o[0]+n];break;case"H":s=[c,o[0]+r];break;default:var m=o.map((function(t,e){return t+(e%2?n:r)}));s=[c].concat(m)}else s=[c].concat(o);var f=s.length;switch(c){case"Z":r=a,n=i;break;case"H":r=s[1];break;case"V":n=s[1];break;default:r=s[f-2],n=s[f-1],"M"===c&&(a=r,i=n)}return s}))}function v(t){return h(t)&&t.slice(1).every((function(t){var e=t[0];return e===e.toLowerCase()}))}function x(t){if(v(t))return m(t);var e=l(t),r=0,n=0,a=0,i=0;return e.map((function(t){var e,o=t.slice(1).map(Number),u=t[0],c=u.toLowerCase();if("M"===u)return r=(e=o)[0],n=e[1],a=r,i=n,["M",r,n];var s=[];if(u!==c)switch(c){case"a":s=[c,o[0],o[1],o[2],o[3],o[4],o[5]-r,o[6]-n];break;case"v":s=[c,o[0]-n];break;case"h":s=[c,o[0]-r];break;default:var m=o.map((function(t,e){return t-(e%2?n:r)}));s=[c].concat(m)}else"m"===u&&(a=o[0]+r,i=o[1]+n),s=[c].concat(o);var f=s.length;switch(c){case"z":r=a,n=i;break;case"h":r+=s[1];break;case"v":n+=s[1];break;default:r+=s[f-2],n+=s[f-1]}return s}))}function g(t,e,r){if(t[r].length>7){t[r].shift();for(var n=t[r],a=r;n.length;)e[r]="A",t.splice(a+=1,0,["C"].concat(n.splice(0,6)));t.splice(r,1)}}function d(t,e){var r=t[0],n=e.x1,a=e.y1,i=e.x2,o=e.y2,u=t.slice(1).map(Number),c=t;if("TQ".includes(r)||(e.qx=null,e.qy=null),"H"===r)c=["L",t[1],a];else if("V"===r)c=["L",n,t[1]];else if("S"===r){var s=2*n-i,m=2*a-o;e.x1=s,e.y1=m,c=["C",s,m].concat(u)}else if("T"===r){var f=2*n-e.qx,h=2*a-e.qy;e.qx=f,e.qy=h,c=["Q",f,h].concat(u)}else if("Q"===r){var l=u[0],p=u[1];e.qx=l,e.qy=p}return c}function M(t){return p(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}var b={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function w(t){if(M(t))return m(t);for(var e=y(t),r=Object.assign({},b),n=[],a=e.length,i="",o=0;o<a;o+=1){i=e[o][0],n[o]=i,e[o]=d(e[o],r);var u=e[o],c=u.length;r.x1=+u[c-2],r.y1=+u[c-1],r.x2=+u[c-4]||r.x1,r.y2=+u[c-3]||r.y1}return e}function N(t){var e=l(t),r=w(e),n=e.length,a="Z"===r.slice(-1)[0][0],i=a?n-2:n-1,o=r[0].slice(1),u=o[0],c=o[1],s=r[i].slice(-2),m=s[0],f=s[1];return a&&u===m&&c===f?e.slice(0,-1):e}function A(t){return M(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}function C(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function S(t,e,r,n,a,i,o,u,c,s){var m,f,h,l,p,y,v=t,x=e,g=r,d=n,M=u,b=c,w=120*Math.PI/180,N=Math.PI/180*(+a||0),A=[];if(s)h=(m=s)[0],l=m[1],p=m[2],y=m[3];else{v=(f=C(v,x,-N)).x,x=f.y;var k=(v-(M=(f=C(M,b,-N)).x))/2,P=(x-(b=f.y))/2,T=k*k/(g*g)+P*P/(d*d);T>1&&(g*=T=Math.sqrt(T),d*=T);var j=g*g,q=d*d,I=(i===o?-1:1)*Math.sqrt(Math.abs((j*q-j*P*P-q*k*k)/(j*P*P+q*k*k)));p=I*g*P/d+(v+M)/2,y=I*-d*k/g+(x+b)/2,h=(Math.asin((x-y)/d)*Math.pow(10,9)>>0)/Math.pow(10,9),l=(Math.asin((b-y)/d)*Math.pow(10,9)>>0)/Math.pow(10,9),h=v<p?Math.PI-h:h,l=M<p?Math.PI-l:l,h<0&&(h=2*Math.PI+h),l<0&&(l=2*Math.PI+l),o&&h>l&&(h-=2*Math.PI),!o&&l>h&&(l-=2*Math.PI)}var O=l-h;if(Math.abs(O)>w){var V=l,L=M,E=b;l=h+w*(o&&l>h?1:-1),A=S(M=p+g*Math.cos(l),b=y+d*Math.sin(l),g,d,a,0,o,L,E,[l,V,p,y])}O=l-h;var z=Math.cos(h),Z=Math.sin(h),Q=Math.cos(l),D=Math.sin(l),F=Math.tan(O/4),H=4/3*g*F,X=4/3*d*F,Y=[v,x],B=[v+H*Z,x-X*z],R=[M+H*D,b-X*Q],G=[M,b];if(B[0]=2*Y[0]-B[0],B[1]=2*Y[1]-B[1],s)return B.concat(R,G,A);for(var J=[],U=0,K=(A=B.concat(R,G,A)).length;U<K;U+=1)J[U]=U%2?C(A[U-1],A[U],N).y:C(A[U],A[U+1],N).x;return J}function k(t,e,r,n,a,i){return[1/3*t+2/3*r,1/3*e+2/3*n,1/3*a+2/3*r,1/3*i+2/3*n,a,i]}function P(t,e,r){var n=t[0],a=t[1];return[n+(e[0]-n)*r,a+(e[1]-a)*r]}function T(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function j(t,e,r,n,a){var i=T([t,e],[r,n]),o={x:0,y:0};if("number"==typeof a)if(0===a)o={x:t,y:e};else if(a>=i)o={x:r,y:n};else{var u=P([t,e],[r,n],a/i);o={x:u[0],y:u[1]}}return{length:i,point:o,min:{x:Math.min(t,r),y:Math.min(e,n)},max:{x:Math.max(t,r),y:Math.max(e,n)}}}function q(t,e,r,n){var a=.5,i=[t,e],o=[r,n],u=P(i,o,a),c=P(o,u,a),s=P(u,c,a),m=P(c,s,a),f=P(s,m,a),h=i.concat(u,s,f,[a]),l=j.apply(void 0,h).point,p=f.concat(m,c,o,[0]),y=j.apply(void 0,p).point;return[l.x,l.y,y.x,y.y,r,n]}function I(t,e){var r,n=t[0],a=t.slice(1).map(Number),i=a[0],o=a[1],u=e.x1,c=e.y1,s=e.x,m=e.y;switch("TQ".includes(n)||(e.qx=null,e.qy=null),n){case"M":return e.x=i,e.y=o,t;case"A":return r=[u,c].concat(a),["C"].concat(S.apply(void 0,r));case"Q":return e.qx=i,e.qy=o,r=[u,c].concat(a),["C"].concat(k.apply(void 0,r));case"L":return["C"].concat(q(u,c,i,o));case"Z":return["C"].concat(q(u,c,s,m))}return t}function O(t){if(A(t))return m(t);for(var e=N(w(t)),r=Object.assign({},b),n=[],a="",i=e.length,o=0;o<i;o+=1){a=e[o][0],n[o]=a,e[o]=I(e[o],r),g(e,n,o),i=e.length;var u=e[o],c=u.length;r.x1=+u[c-2],r.y1=+u[c-1],r.x2=+u[c-4]||r.x1,r.y2=+u[c-3]||r.y1}return e}function V(e,r){var n=t.round;if("off"===r||"off"===n)return m(e);var a="number"==typeof(n=r>=0?r:n)&&n>=1?Math.pow(10,n):1;return e.map((function(t){var e=t.slice(1).map(Number).map((function(t){return n?Math.round(t*a)/a:Math.round(t)}));return[t[0]].concat(e)}))}function L(t,e){return V(t,e).map((function(t){return t[0]+t.slice(1).join(" ")})).join("")}function E(t){var e=y(t),r="Z"===e.slice(-1)[0][0],n=w(e).map((function(t,r){var n=t.slice(-2).map(Number),a=n[0],i=n[1];return{seg:e[r],n:t,c:e[r][0],x:a,y:i}})).map((function(t,e,n){var a=t.seg,i=t.n,o=e&&n[e-1],u=n[e+1],c=t.c,s=n.length,m=e?n[e-1].x:n[s-1].x,f=e?n[e-1].y:n[s-1].y,h=[];switch(c){case"M":h=r?["Z"]:[c,m,f];break;case"A":h=[c].concat(a.slice(1,-3),[1===a[5]?0:1],[m],[f]);break;case"C":h=u&&"S"===u.c?["S",a[1],a[2],m,f]:[c,a[3],a[4],a[1],a[2],m,f];break;case"S":h=!o||!"CS".includes(o.c)||u&&"S"===u.c?[c,i[1],i[2],m,f]:["C",i[3],i[4],i[1],i[2],m,f];break;case"Q":h=u&&"T"===u.c?["T",m,f]:[c].concat(a.slice(1,-2),[m],[f]);break;case"T":h=!o||!"QT".includes(o.c)||u&&"T"===u.c?[c,m,f]:["Q",i[1],i[2],m,f];break;case"Z":h=["M",m,f];break;case"H":h=[c,m];break;case"V":h=[c,f];break;default:h=[c].concat(a.slice(1,-2),[m],[f])}return h}));return r?n.reverse():[n[0]].concat(n.slice(1).reverse())}function z(t){var e,r=[],n=-1;return t.forEach((function(t){"M"===t[0]?(e=[t],n+=1):e=e.concat([t]),r[n]=e})),r}function Z(t,e,r,n){var a=t[0],i=function(t){return Math.round(t*Math.pow(10,4))/Math.pow(10,4)},o=t.slice(1).map((function(t){return+t})),u=e.slice(1).map((function(t){return+t})),c=r.x1,s=r.y1,m=r.x2,f=r.y2,h=r.x,l=r.y,p=t,y=u.slice(-2),v=y[0],x=y[1];if("TQ".includes(a)||(r.qx=null,r.qy=null),["V","H","S","T","Z"].includes(a))p=[a].concat(o);else if("L"===a)i(h)===i(v)?p=["V",x]:i(l)===i(x)&&(p=["H",v]);else if("C"===a){var g=u[0],d=u[1];"CS".includes(n)&&(i(g)===i(2*c-m)&&i(d)===i(2*s-f)||i(c)===i(2*m-h)&&i(s)===i(2*f-l))&&(p=["S"].concat(u.slice(-4))),r.x1=g,r.y1=d}else if("Q"===a){var M=u[0],b=u[1];r.qx=M,r.qy=b,"QT".includes(n)&&(i(M)===i(2*c-m)&&i(b)===i(2*s-f)||i(c)===i(2*m-h)&&i(s)===i(2*f-l))&&(p=["T"].concat(u.slice(-2)))}return p}function Q(t,e){for(var r,n=y(t),a=w(n),i=Object.assign({},b),o=[],u=n.length,c="",s="",m=0,f=0,h=0,l=0,p=0;p<u;p+=1){c=n[p][0],o[p]=c,p&&(s=o[p-1]),n[p]=Z(n[p],a[p],i,s);var v=n[p],g=v.length;switch(i.x1=+v[g-2],i.y1=+v[g-1],i.x2=+v[g-4]||i.x1,i.y2=+v[g-3]||i.y1,c){case"Z":m=h,f=l;break;case"H":m=v[1];break;case"V":f=v[1];break;default:m=(r=v.slice(-2).map(Number))[0],f=r[1],"M"===c&&(h=m,l=f)}i.x=m,i.y=f}var d=V(n,e),M=V(x(n),e);return d.map((function(t,e){return e?t.join("").length<M[e].join("").length?t:M[e]:t}))}function D(t){var e=new $,r=Array.from(t);if(!r.every((function(t){return!Number.isNaN(t)})))throw TypeError('CSSMatrix: "'+t+'" must only have numbers.');if(16===r.length){var n=r[0],a=r[1],i=r[2],o=r[3],u=r[4],c=r[5],s=r[6],m=r[7],f=r[8],h=r[9],l=r[10],p=r[11],y=r[12],v=r[13],x=r[14],g=r[15];e.m11=n,e.a=n,e.m21=u,e.c=u,e.m31=f,e.m41=y,e.e=y,e.m12=a,e.b=a,e.m22=c,e.d=c,e.m32=h,e.m42=v,e.f=v,e.m13=i,e.m23=s,e.m33=l,e.m43=x,e.m14=o,e.m24=m,e.m34=p,e.m44=g}else{if(6!==r.length)throw new TypeError("CSSMatrix: expecting an Array of 6/16 values.");var d=r[0],M=r[1],b=r[2],w=r[3],N=r[4],A=r[5];e.m11=d,e.a=d,e.m12=M,e.b=M,e.m21=b,e.c=b,e.m22=w,e.d=w,e.m41=N,e.e=N,e.m42=A,e.f=A}return e}function F(t){var e=Object.keys(new $);if("object"==typeof t&&e.every((function(e){return e in t})))return D([t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44]);throw TypeError('CSSMatrix: "'+JSON.stringify(t)+'" is not a DOMMatrix / CSSMatrix / JSON compatible object.')}function H(t){if("string"!=typeof t)throw TypeError('CSSMatrix: "'+t+'" is not a string.');var e=String(t).replace(/\s/g,""),r=new $,n='CSSMatrix: invalid transform string "'+t+'"';return e.split(")").filter((function(t){return t})).forEach((function(t){var e=t.split("("),a=e[0],i=e[1];if(!i)throw TypeError(n);var o=i.split(",").map((function(t){return t.includes("rad")?parseFloat(t)*(180/Math.PI):parseFloat(t)})),u=o[0],c=o[1],s=o[2],m=o[3],f=[u,c,s],h=[u,c,s,m];if("perspective"===a&&u&&[c,s].every((function(t){return void 0===t})))r.m34=-1/u;else if(a.includes("matrix")&&[6,16].includes(o.length)&&o.every((function(t){return!Number.isNaN(+t)}))){var l=o.map((function(t){return Math.abs(t)<1e-6?0:t}));r=r.multiply(D(l))}else if("translate3d"===a&&f.every((function(t){return!Number.isNaN(+t)})))r=r.translate(u,c,s);else if("translate"===a&&u&&void 0===s)r=r.translate(u,c||0,0);else if("rotate3d"===a&&h.every((function(t){return!Number.isNaN(+t)}))&&m)r=r.rotateAxisAngle(u,c,s,m);else if("rotate"===a&&u&&[c,s].every((function(t){return void 0===t})))r=r.rotate(0,0,u);else if("scale3d"===a&&f.every((function(t){return!Number.isNaN(+t)}))&&f.some((function(t){return 1!==t})))r=r.scale(u,c,s);else if("scale"!==a||Number.isNaN(u)||1===u||void 0!==s)if("skew"===a&&(u||!Number.isNaN(u)&&c)&&void 0===s)r=r.skew(u,c||0);else{if(!(/[XYZ]/.test(a)&&u&&[c,s].every((function(t){return void 0===t}))&&["translate","rotate","scale","skew"].some((function(t){return a.includes(t)}))))throw TypeError(n);if(["skewX","skewY"].includes(a))r=r[a](u);else{var p=a.replace(/[XYZ]/,""),y=a.replace(p,""),v=["X","Y","Z"].indexOf(y),x="scale"===p?1:0,g=[0===v?u:x,1===v?u:x,2===v?u:x];r=r[p].apply(r,g)}}else{var d=Number.isNaN(+c)?u:c;r=r.scale(u,d,1)}})),r}function X(t,e){return e?[t.a,t.b,t.c,t.d,t.e,t.f]:[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44]}function Y(t,e,r){var n=new $;return n.m41=t,n.e=t,n.m42=e,n.f=e,n.m43=r,n}function B(t,e,r){var n=new $,a=Math.PI/180,i=t*a,o=e*a,u=r*a,c=Math.cos(i),s=-Math.sin(i),m=Math.cos(o),f=-Math.sin(o),h=Math.cos(u),l=-Math.sin(u),p=m*h,y=-m*l;n.m11=p,n.a=p,n.m12=y,n.b=y,n.m13=f;var v=s*f*h+c*l;n.m21=v,n.c=v;var x=c*h-s*f*l;return n.m22=x,n.d=x,n.m23=-s*m,n.m31=s*l-c*f*h,n.m32=s*h+c*f*l,n.m33=c*m,n}function R(t,e,r,n){var a=new $,i=Math.sqrt(t*t+e*e+r*r);if(0===i)return a;var o=t/i,u=e/i,c=r/i,s=n*(Math.PI/360),m=Math.sin(s),f=Math.cos(s),h=m*m,l=o*o,p=u*u,y=c*c,v=1-2*(p+y)*h;a.m11=v,a.a=v;var x=2*(o*u*h+c*m*f);a.m12=x,a.b=x,a.m13=2*(o*c*h-u*m*f);var g=2*(u*o*h-c*m*f);a.m21=g,a.c=g;var d=1-2*(y+l)*h;return a.m22=d,a.d=d,a.m23=2*(u*c*h+o*m*f),a.m31=2*(c*o*h+u*m*f),a.m32=2*(c*u*h-o*m*f),a.m33=1-2*(l+p)*h,a}function G(t,e,r){var n=new $;return n.m11=t,n.a=t,n.m22=e,n.d=e,n.m33=r,n}function J(t,e){var r=new $;if(t){var n=t*Math.PI/180,a=Math.tan(n);r.m21=a,r.c=a}if(e){var i=e*Math.PI/180,o=Math.tan(i);r.m12=o,r.b=o}return r}function U(t){return J(t,0)}function K(t){return J(0,t)}function W(t,e){return D([e.m11*t.m11+e.m12*t.m21+e.m13*t.m31+e.m14*t.m41,e.m11*t.m12+e.m12*t.m22+e.m13*t.m32+e.m14*t.m42,e.m11*t.m13+e.m12*t.m23+e.m13*t.m33+e.m14*t.m43,e.m11*t.m14+e.m12*t.m24+e.m13*t.m34+e.m14*t.m44,e.m21*t.m11+e.m22*t.m21+e.m23*t.m31+e.m24*t.m41,e.m21*t.m12+e.m22*t.m22+e.m23*t.m32+e.m24*t.m42,e.m21*t.m13+e.m22*t.m23+e.m23*t.m33+e.m24*t.m43,e.m21*t.m14+e.m22*t.m24+e.m23*t.m34+e.m24*t.m44,e.m31*t.m11+e.m32*t.m21+e.m33*t.m31+e.m34*t.m41,e.m31*t.m12+e.m32*t.m22+e.m33*t.m32+e.m34*t.m42,e.m31*t.m13+e.m32*t.m23+e.m33*t.m33+e.m34*t.m43,e.m31*t.m14+e.m32*t.m24+e.m33*t.m34+e.m34*t.m44,e.m41*t.m11+e.m42*t.m21+e.m43*t.m31+e.m44*t.m41,e.m41*t.m12+e.m42*t.m22+e.m43*t.m32+e.m44*t.m42,e.m41*t.m13+e.m42*t.m23+e.m43*t.m33+e.m44*t.m43,e.m41*t.m14+e.m42*t.m24+e.m43*t.m34+e.m44*t.m44])}var $=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=this;if(r.a=1,r.b=0,r.c=0,r.d=1,r.e=0,r.f=0,r.m11=1,r.m12=0,r.m13=0,r.m14=0,r.m21=0,r.m22=1,r.m23=0,r.m24=0,r.m31=0,r.m32=0,r.m33=1,r.m34=0,r.m41=0,r.m42=0,r.m43=0,r.m44=1,t.length){var n=[16,6].some((function(e){return e===t.length}))?t:t[0];return r.setMatrixValue(n)}return r},_={isIdentity:{configurable:!0},is2D:{configurable:!0}};_.isIdentity.get=function(){var t=this;return 1===t.m11&&0===t.m12&&0===t.m13&&0===t.m14&&0===t.m21&&1===t.m22&&0===t.m23&&0===t.m24&&0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m41&&0===t.m42&&0===t.m43&&1===t.m44},_.is2D.get=function(){var t=this;return 0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m43&&1===t.m44},$.prototype.setMatrixValue=function(t){return"string"==typeof t&&t.length&&"none"!==t?H(t):[Array,Float64Array,Float32Array].some((function(e){return t instanceof e}))?D(t):[$,DOMMatrix,Object].some((function(e){return t instanceof e}))?F(t):this},$.prototype.toFloat32Array=function(t){return Float32Array.from(X(this,t))},$.prototype.toFloat64Array=function(t){return Float64Array.from(X(this,t))},$.prototype.toString=function(){var t=this.is2D;return(t?"matrix":"matrix3d")+"("+this.toFloat64Array(t).join(", ")+")"},$.prototype.toJSON=function(){var t=this,e=t.is2D,r=t.isIdentity;return Object.assign({},t,{is2D:e,isIdentity:r})},$.prototype.multiply=function(t){return W(this,t)},$.prototype.translate=function(t,e,r){var n=e,a=r;return void 0===n&&(n=0),void 0===a&&(a=0),W(this,Y(t,n,a))},$.prototype.scale=function(t,e,r){var n=e,a=r;return void 0===n&&(n=t),void 0===a&&(a=1),W(this,G(t,n,a))},$.prototype.rotate=function(t,e,r){var n=t,a=e||0,i=r||0;return"number"==typeof t&&void 0===e&&void 0===r&&(i=n,n=0,a=0),W(this,B(n,a,i))},$.prototype.rotateAxisAngle=function(t,e,r,n){if([t,e,r,n].some((function(t){return Number.isNaN(+t)})))throw new TypeError("CSSMatrix: expecting 4 values");return W(this,R(t,e,r,n))},$.prototype.skewX=function(t){return W(this,U(t))},$.prototype.skewY=function(t){return W(this,K(t))},$.prototype.skew=function(t,e){return W(this,J(t,e))},$.prototype.transformPoint=function(t){var e=this,r=e.m11*t.x+e.m21*t.y+e.m31*t.z+e.m41*t.w,n=e.m12*t.x+e.m22*t.y+e.m32*t.z+e.m42*t.w,a=e.m13*t.x+e.m23*t.y+e.m33*t.z+e.m43*t.w,i=e.m14*t.x+e.m24*t.y+e.m34*t.z+e.m44*t.w;return t instanceof DOMPoint?new DOMPoint(r,n,a,i):{x:r,y:n,z:a,w:i}},Object.defineProperties($.prototype,_),Object.assign($,{Translate:Y,Rotate:B,RotateAxisAngle:R,Scale:G,SkewX:U,SkewY:K,Skew:J,Multiply:W,fromArray:D,fromMatrix:F,fromString:H,toArray:X});function tt(t,e,r){var n=r[0],a=r[1],i=r[2],o=function(t,e){var r,n=Y.apply(void 0,e);return r=e,n.m44=r[3],[(n=t.multiply(n)).m41,n.m42,n.m43,n.m44]}(t,e.concat([0],[1])),u=o[0],c=o[1]-a,s=o[2]-i;return[(u-n)*(Math.abs(i)/Math.abs(s)||1)+n,c*(Math.abs(i)/Math.abs(s)||1)+a]}function et(e,r){var n,a,i,o,u,c,s=0,f=0,h=y(e),l=r&&Object.keys(r);if(!r||!l.length)return m(h);var p=w(h);if(!r.origin){var v=t.origin;Object.assign(r,{origin:v})}var x=function(t){var e=new $,r=t.origin,n=r[0],a=r[1],i=t.translate,o=t.rotate,u=t.skew,c=t.scale;return Array.isArray(i)&&i.every((function(t){return!Number.isNaN(+t)}))&&i.some((function(t){return 0!==t}))?e=e.translate.apply(e,i):"number"!=typeof i||Number.isNaN(i)||(e=e.translate(i)),(o||u||c)&&(e=e.translate(n,a),Array.isArray(o)&&o.every((function(t){return!Number.isNaN(+t)}))&&o.some((function(t){return 0!==t}))?e=e.rotate.apply(e,o):"number"!=typeof o||Number.isNaN(o)||(e=e.rotate(o)),Array.isArray(u)&&u.every((function(t){return!Number.isNaN(+t)}))&&u.some((function(t){return 0!==t}))?(e=u[0]?e.skewX(u[0]):e,e=u[1]?e.skewY(u[1]):e):"number"!=typeof u||Number.isNaN(u)||(e=e.skewX(u)),Array.isArray(c)&&c.every((function(t){return!Number.isNaN(+t)}))&&c.some((function(t){return 1!==t}))?e=e.scale.apply(e,c):"number"!=typeof c||Number.isNaN(c)||(e=e.scale(c)),e=e.translate(-n,-a)),e}(r),d=r.origin,M=Object.assign({},b),N=[],A=0,C="",S=[],k=[];if(!x.isIdentity){for(n=0,i=h.length;n<i;n+=1){N=h[n],h[n]&&(C=N[0]),k[n]=C,"A"===C&&(N=I(p[n],M),h[n]=I(p[n],M),g(h,k,n),p[n]=I(p[n],M),g(p,k,n),i=Math.max(h.length,p.length)),A=(N=p[n]).length,M.x1=+N[A-2],M.y1=+N[A-1],M.x2=+N[A-4]||M.x1,M.y2=+N[A-3]||M.y1;var P={s:h[n],c:h[n][0],x:M.x1,y:M.y1};S=S.concat([P])}return S.map((function(t){var e,r;switch(C=t.c,N=t.s,C){case"L":case"H":case"V":return e=tt(x,[t.x,t.y],d),u=e[0],c=e[1],s!==u&&f!==c?N=["L",u,c]:f===c?N=["H",u]:s===u&&(N=["V",c]),s=u,f=c,N;default:for(a=1,o=N.length;a<o;a+=2)r=tt(x,[+N[a],+N[a+1]],d),s=r[0],f=r[1],N[a]=s,N[a+1]=f;return N}}))}return m(h)}function rt(t,e){var r=t.x,n=t.y,a=e.x,i=e.y,o=r*a+n*i,u=Math.sqrt((Math.pow(r,2)+Math.pow(n,2))*(Math.pow(a,2)+Math.pow(i,2)));return(r*i-n*a<0?-1:1)*Math.acos(o/u)}function nt(t,e,r,n,a,i,o,u,c,s){var m=Math.abs,f=Math.sin,h=Math.cos,l=Math.sqrt,p=Math.PI,y=m(r),v=m(n),x=(a%360+360)%360*(p/180);if(t===u&&e===c)return{x:t,y:e};if(0===y||0===v)return j(t,e,u,c,s).point;var g=(t-u)/2,d=(e-c)/2,M={x:h(x)*g+f(x)*d,y:-f(x)*g+h(x)*d},b=Math.pow(M.x,2)/Math.pow(y,2)+Math.pow(M.y,2)/Math.pow(v,2);b>1&&(y*=l(b),v*=l(b));var w=(Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(M.y,2)-Math.pow(v,2)*Math.pow(M.x,2))/(Math.pow(y,2)*Math.pow(M.y,2)+Math.pow(v,2)*Math.pow(M.x,2)),N=(i!==o?1:-1)*l(w=w<0?0:w),A=N*(y*M.y/v),C=N*(-v*M.x/y),S=h(x)*A-f(x)*C+(t+u)/2,k=f(x)*A+h(x)*C+(e+c)/2,P={x:(M.x-A)/y,y:(M.y-C)/v},T=rt({x:1,y:0},P),q=rt(P,{x:(-M.x-A)/y,y:(-M.y-C)/v});!o&&q>0?q-=2*p:o&&q<0&&(q+=2*p);var I=T+(q%=2*p)*s,O=y*h(I),V=v*f(I);return{x:h(x)*O-f(x)*V+S,y:f(x)*O+h(x)*V+k}}function at(t,e,r,n,a,i,o,u,c,s){var m,f="number"==typeof s,h=t,l=e,p=0,y=[h,l,p],v=[h,l],x={x:0,y:0},g=[{x:h,y:l}];f&&0===s&&(x={x:h,y:l});for(var d=0;d<=300;d+=1){if(h=(m=nt(t,e,r,n,a,i,o,u,c,d/300)).x,l=m.y,g=g.concat([{x:h,y:l}]),p+=T(v,[h,l]),v=[h,l],f&&p>s&&s>y[2]){var M=(p-s)/(p-y[2]);x={x:v[0]*(1-M)+y[0]*M,y:v[1]*(1-M)+y[1]*M}}y=[h,l,p]}return f&&s>=p&&(x={x:u,y:c}),{length:p,point:x,min:{x:Math.min.apply(Math,g.map((function(t){return t.x}))),y:Math.min.apply(Math,g.map((function(t){return t.y})))},max:{x:Math.max.apply(Math,g.map((function(t){return t.x}))),y:Math.max.apply(Math,g.map((function(t){return t.y})))}}}function it(t,e,r,n,a,i,o,u,c){var s=1-c;return{x:Math.pow(s,3)*t+3*Math.pow(s,2)*c*r+3*s*Math.pow(c,2)*a+Math.pow(c,3)*o,y:Math.pow(s,3)*e+3*Math.pow(s,2)*c*n+3*s*Math.pow(c,2)*i+Math.pow(c,3)*u}}function ot(t,e,r,n,a,i,o,u,c){var s,m="number"==typeof c,f=t,h=e,l=0,p=[f,h,l],y=[f,h],v={x:0,y:0},x=[{x:f,y:h}];m&&0===c&&(v={x:f,y:h});for(var g=0;g<=300;g+=1){if(f=(s=it(t,e,r,n,a,i,o,u,g/300)).x,h=s.y,x=x.concat([{x:f,y:h}]),l+=T(y,[f,h]),y=[f,h],m&&l>c&&c>p[2]){var d=(l-c)/(l-p[2]);v={x:y[0]*(1-d)+p[0]*d,y:y[1]*(1-d)+p[1]*d}}p=[f,h,l]}return m&&c>=l&&(v={x:o,y:u}),{length:l,point:v,min:{x:Math.min.apply(Math,x.map((function(t){return t.x}))),y:Math.min.apply(Math,x.map((function(t){return t.y})))},max:{x:Math.max.apply(Math,x.map((function(t){return t.x}))),y:Math.max.apply(Math,x.map((function(t){return t.y})))}}}function ut(t,e,r,n,a,i,o){var u=1-o;return{x:Math.pow(u,2)*t+2*u*o*r+Math.pow(o,2)*a,y:Math.pow(u,2)*e+2*u*o*n+Math.pow(o,2)*i}}function ct(t,e,r,n,a,i,o){var u,c="number"==typeof o,s=t,m=e,f=0,h=[s,m,f],l=[s,m],p={x:0,y:0},y=[{x:s,y:m}];c&&0===o&&(p={x:s,y:m});for(var v=0;v<=300;v+=1){if(s=(u=ut(t,e,r,n,a,i,v/300)).x,m=u.y,y=y.concat([{x:s,y:m}]),f+=T(l,[s,m]),l=[s,m],c&&f>o&&o>h[2]){var x=(f-o)/(f-h[2]);p={x:l[0]*(1-x)+h[0]*x,y:l[1]*(1-x)+h[1]*x}}h=[s,m,f]}return c&&o>=f&&(p={x:a,y:i}),{length:f,point:p,min:{x:Math.min.apply(Math,y.map((function(t){return t.x}))),y:Math.min.apply(Math,y.map((function(t){return t.y})))},max:{x:Math.max.apply(Math,y.map((function(t){return t.x}))),y:Math.max.apply(Math,y.map((function(t){return t.y})))}}}function st(t,e){for(var r,n,a,i,o,u,c,s,m,f,h=w(t),l="number"==typeof e,p=[],y=0,v=0,x=0,g=0,d=[],M=[],b=0,N={x:0,y:0},A=N,C=N,S=N,k=0,P=0,T=h.length;P<T;P+=1)p=(s="M"===(m=(f=h[P])[0]))?p:[y,v].concat(f.slice(1)),s?(A=N={x:x=(r=f)[1],y:g=r[2]},b=0,l&&e<.001&&(S=N)):"L"===m?(b=(n=j.apply(void 0,p.concat([(e||0)-k]))).length,N=n.min,A=n.max,C=n.point):"A"===m?(b=(a=at.apply(void 0,p.concat([(e||0)-k]))).length,N=a.min,A=a.max,C=a.point):"C"===m?(b=(i=ot.apply(void 0,p.concat([(e||0)-k]))).length,N=i.min,A=i.max,C=i.point):"Q"===m?(b=(o=ct.apply(void 0,p.concat([(e||0)-k]))).length,N=o.min,A=o.max,C=o.point):"Z"===m&&(p=[y,v,x,g],b=(u=j.apply(void 0,p.concat([(e||0)-k]))).length,N=u.min,A=u.max,C=u.point),l&&k<e&&k+b>=e&&(S=C),M=M.concat([A]),d=d.concat([N]),k+=b,y=(c="Z"!==m?f.slice(-2):[x,g])[0],v=c[1];return l&&e>=k&&(S={x:y,y:v}),{length:k,point:S,min:{x:Math.min.apply(Math,d.map((function(t){return t.x}))),y:Math.min.apply(Math,d.map((function(t){return t.y})))},max:{x:Math.max.apply(Math,M.map((function(t){return t.x}))),y:Math.max.apply(Math,M.map((function(t){return t.y})))}}}function mt(t){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var e=st(t),r=e.min,n=r.x,a=r.y,i=e.max,o=i.x,u=i.y,c=o-n,s=u-a;return{width:c,height:s,x:n,y:a,x2:o,y2:u,cx:n+c/2,cy:a+s/2,cz:Math.max(c,s)+Math.min(c,s)/2}}function ft(t){return st(t).length}function ht(t,e){return st(t,e).point}Object.assign($,{Version:"1.0.3"});var lt=function(e,r){var a=r||{},i=void 0===e;if(i||!e.length)throw TypeError(n+': "pathValue" is '+(i?"undefined":"empty"));var o=l(e);if("string"==typeof o)throw TypeError(o);this.segments=o;var u,c,s=this.getBBox(),m=s.width,f=s.height,h=s.cx,p=s.cy,y=s.cz,v=a.round,x=a.origin;if("auto"===v){var g=(""+Math.floor(Math.max(m,f))).length;u=g>=4?0:4-g}else u=Number.isInteger(v)||"off"===v?v:t.round;if(Array.isArray(x)&&x.length>=2){var d=x.map(Number),M=d[0],b=d[1],w=d[2];c=[Number.isNaN(M)?h:M,Number.isNaN(b)?p:b,Number.isNaN(w)?y:w]}else c=[h,p,y];return this.round=u,this.origin=c,this};function pt(t,e,r,n,a,i,o,u){return 3*((u-e)*(r+a)-(o-t)*(n+i)+n*(t-a)-r*(e-i)+u*(a+t/3)-o*(i+e/3))/20}function yt(t){var e=0,r=0,n=0;return O(t).map((function(t){var a,i;switch(t[0]){case"M":return e=(a=t)[1],r=a[2],0;default:return n=pt.apply(void 0,[e,r].concat(t.slice(1))),i=t.slice(-2),e=i[0],r=i[1],n}})).reduce((function(t,e){return t+e}),0)}function vt(t,e){var r=l(t);if("string"==typeof r)throw TypeError(r);var n=[].concat(r),a=ft(n),i=n.length-1,o=0,u=0,c=r[0],s=c.slice(-2),m={x:s[0],y:s[1]};if(i<=0||!e||!Number.isFinite(e))return{segment:c,index:0,length:u,point:m,lengthAtSegment:o};if(e>=a)return u=a-(o=ft(n=r.slice(0,-1))),{segment:r[i],index:i,length:u,lengthAtSegment:o};for(var f=[];i>0;)c=n[i],u=a-(o=ft(n=n.slice(0,-1))),a=o,f.push({segment:c,index:i,length:u,lengthAtSegment:o}),i-=1;return f.find((function(t){return t.lengthAtSegment<=e}))}function xt(t,e){for(var r,n,a,i,o=l(t),u=w(o),c=ft(o),s=function(t){var r=t.x-e.x,n=t.y-e.y;return r*r+n*n},m=8,f=0,h=0,p=1/0,y=0;y<=c;y+=m)(f=s(r=ht(u,y)))<p&&(n=r,h=y,p=f);m/=2;for(var v=0,x=0,g=0,d=0;m>.5;)g=s(a=ht(u,v=h-m)),d=s(i=ht(u,x=h+m)),v>=0&&g<p?(n=a,h=v,p=g):x<=c&&d<p?(n=i,h=x,p=d):m/=2;var M=vt(o,h);return{closest:n,distance:Math.sqrt(p),segment:M}}function gt(t){if("string"!=typeof t)return!1;var e=new f(t);for(u(e);e.index<e.max&&!e.err.length;)s(e);return!e.err.length&&"mM".includes(e.segments[0][0])}lt.prototype.getBBox=function(){return mt(this.segments)},lt.prototype.getTotalLength=function(){return ft(this.segments)},lt.prototype.getPointAtLength=function(t){return ht(this.segments,t)},lt.prototype.toAbsolute=function(){var t=this.segments;return this.segments=y(t),this},lt.prototype.toRelative=function(){var t=this.segments;return this.segments=x(t),this},lt.prototype.toCurve=function(){var t=this.segments;return this.segments=O(t),this},lt.prototype.reverse=function(t){this.toAbsolute();var e=this.segments,r=z(e),n=r.length>1?r:0,a=n&&m(n).map((function(e,r){return t?r?E(e):l(e):E(e)})),i=[];return i=n?a.flat(1):t?e:E(e),this.segments=m(i),this},lt.prototype.normalize=function(){var t=this.segments;return this.segments=w(t),this},lt.prototype.optimize=function(){var t=this.segments;return this.segments=Q(t,this.round),this},lt.prototype.transform=function(t){if(!t||"object"!=typeof t||"object"==typeof t&&!["translate","rotate","skew","scale"].some((function(e){return e in t})))return this;var e={};Object.keys(t).forEach((function(r){e[r]=Array.isArray(t[r])?[].concat(t[r]):Number(t[r])}));var r=this.segments,n=this.origin,a=n[0],i=n[1],o=n[2],u=e.origin;if(Array.isArray(u)&&u.length>=2){var c=u.map(Number),s=c[0],m=c[1],f=c[2];e.origin=[Number.isNaN(s)?a:s,Number.isNaN(m)?i:m,f||o]}else e.origin=[a,i,o];return this.segments=et(r,e),this},lt.prototype.flipX=function(){return this.transform({rotate:[0,180,0]}),this},lt.prototype.flipY=function(){return this.transform({rotate:[180,0,0]}),this},lt.prototype.toString=function(){return L(this.segments,this.round)};var dt={line:["x1","y1","x2","y2"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],rect:["width","height","x","y","rx","ry"],polygon:["points"],polyline:["points"],glyph:["d"]};var Mt={CSSMatrix:$,parsePathString:l,isPathArray:h,isCurveArray:A,isAbsoluteArray:p,isRelativeArray:v,isNormalizedArray:M,isValidPath:gt,pathToAbsolute:y,pathToRelative:x,pathToCurve:O,pathToString:L,getDrawDirection:function(t){return yt(O(t))>=0},getPathArea:yt,getPathBBox:mt,pathLengthFactory:st,getTotalLength:ft,getPointAtLength:ht,getClosestPoint:function(t,e){return xt(t,e).closest},getSegmentOfPoint:function(t,e){return xt(t,e).segment},getPropertiesAtPoint:xt,getPropertiesAtLength:vt,getSegmentAtLength:function(t,e){return vt(t,e).segment},isPointInStroke:function(t,e){var r=xt(t,e).distance;return Math.abs(r)<.001},clonePath:m,splitPath:z,fixPath:N,roundPath:V,optimizePath:Q,reverseCurve:function(t){var e=t.slice(1).map((function(e,r,n){return r?n[r-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))})).map((function(t){return t.map((function(e,r){return t[t.length-r-2*(1-r%2)]}))})).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map((function(t){return["C"].concat(t.slice(2))})))},reversePath:E,normalizePath:w,transformPath:et,shapeToPath:function(e,r){var a=Object.keys(dt),i=e.tagName;if(i&&!a.some((function(t){return i===t})))throw TypeError(n+': "'+i+'" is not SVGElement');var o=document.createElementNS("http://www.w3.org/2000/svg","path"),u=i||e.type,c={};c.type=u;var s,m=dt[u];i?(m.forEach((function(t){c[t]=e.getAttribute(t)})),Object.values(e.attributes).forEach((function(t){var e=t.name,r=t.value;m.includes(e)||o.setAttribute(e,r)}))):(Object.assign(c,e),Object.keys(c).forEach((function(t){m.includes(t)||"type"===t||o.setAttribute(t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()})),c[t])})));var f,h,l,p,y=t.round;return"circle"===u?s=L((h=(f=c).cx,l=f.cy,p=f.r,[["M",h-p,l],["a",p,p,0,1,0,2*p,0],["a",p,p,0,1,0,-2*p,0]]),y):"ellipse"===u?s=L(function(t){var e=t.cx,r=t.cy,n=t.rx,a=t.ry;return[["M",e-n,r],["a",n,a,0,1,0,2*n,0],["a",n,a,0,1,0,-2*n,0]]}(c),y):["polyline","polygon"].includes(u)?s=L(function(t){for(var e=[],r=(t.points||"").trim().split(/[\s|,]/).map(Number),n=0;n<r.length;)e.push([n?"L":"M",r[n],r[n+1]]),n+=2;return"polygon"===t.type?e.concat([["z"]]):e}(c),y):"rect"===u?s=L(function(t){var e=+t.x||0,r=+t.y||0,n=+t.width,a=+t.height,i=+t.rx,o=+t.ry;return i||o?(i=i||o,o=o||i,2*i>n&&(i-=(2*i-n)/2),2*o>a&&(o-=(2*o-a)/2),[["M",e+i,r],["h",n-2*i],["s",i,0,i,o],["v",a-2*o],["s",0,o,-i,o],["h",2*i-n],["s",-i,0,-i,-o],["v",2*o-a],["s",0,-o,i,-o]]):[["M",e,r],["h",n],["v",a],["H",e],["Z"]]}(c),y):"line"===u?s=L(function(t){return[["M",t.x1,t.y1],["L",t.x2,t.y2]]}(c),y):"glyph"===u&&(s=i?e.getAttribute("d"):e.d),!!gt(s)&&(o.setAttribute("d",s),r&&i&&(e.before(o,e),e.remove()),o)},options:t};return Object.assign(lt,Mt,{Version:"1.0.4"}),lt}));
|
|
1
|
+
// SVGPathCommander v1.0.5 | thednp © 2022 | MIT-License
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).SVGPathCommander=e()}(this,(function(){"use strict";var t={origin:[0,0,0],round:4},e={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function r(t){for(var r=t.pathValue[t.segmentStart],n=r.toLowerCase(),a=t.data;a.length>=e[n]&&("m"===n&&a.length>2?(t.segments.push([r].concat(a.splice(0,2))),n="l",r="m"===r?"l":"L"):t.segments.push([r].concat(a.splice(0,e[n]))),e[n]););}var n="SVGPathCommander error";function a(t){var e=t.index,r=t.pathValue,a=r.charCodeAt(e);return 48===a?(t.param=0,void(t.index+=1)):49===a?(t.param=1,void(t.index+=1)):void(t.err=n+': invalid Arc flag "'+r[e]+'", expecting 0 or 1 at index '+e)}function i(t){return t>=48&&t<=57}function o(t){var e,r=t.max,a=t.pathValue,o=t.index,u=o,c=!1,s=!1,m=!1,f=!1;if(u>=r)t.err=n+": Invalid path value at index "+u+', "pathValue" is missing param';else if(43!==(e=a.charCodeAt(u))&&45!==e||(u+=1,e=a.charCodeAt(u)),i(e)||46===e){if(46!==e){if(c=48===e,u+=1,e=a.charCodeAt(u),c&&u<r&&e&&i(e))return void(t.err=n+": Invalid path value at index "+o+', "'+a[o]+'" illegal number');for(;u<r&&i(a.charCodeAt(u));)u+=1,s=!0;e=a.charCodeAt(u)}if(46===e){for(f=!0,u+=1;i(a.charCodeAt(u));)u+=1,m=!0;e=a.charCodeAt(u)}if(101===e||69===e){if(f&&!s&&!m)return void(t.err=n+": Invalid path value at index "+u+', "'+a[u]+'" invalid float exponent');if(u+=1,43!==(e=a.charCodeAt(u))&&45!==e||(u+=1),!(u<r&&i(a.charCodeAt(u))))return void(t.err=n+": Invalid path value at index "+u+', "'+a[u]+'" invalid integer exponent');for(;u<r&&i(a.charCodeAt(u));)u+=1}t.index=u,t.param=+t.pathValue.slice(o,u)}else t.err=n+": Invalid path value at index "+u+', "'+a[u]+'" is not a number'}function u(t){for(var e,r=t.pathValue,n=t.max;t.index<n&&(10===(e=r.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function c(t){return t>=48&&t<=57||43===t||45===t||46===t}function s(t){var i=t.max,s=t.pathValue,m=t.index,f=s.charCodeAt(m),h=e[s[m].toLowerCase()];if(t.segmentStart=m,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(f))if(t.index+=1,u(t),t.data=[],h){for(;;){for(var l=h;l>0;l-=1){if(97!=(32|f)||3!==l&&4!==l?o(t):a(t),t.err.length)return;t.data.push(t.param),u(t),t.index<i&&44===s.charCodeAt(t.index)&&(t.index+=1,u(t))}if(t.index>=t.max)break;if(!c(s.charCodeAt(t.index)))break}r(t)}else r(t);else t.err=n+': Invalid path value "'+s[m]+'" is not a path command'}function m(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}function f(t){this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}function h(t){return Array.isArray(t)&&t.every((function(t){var r=t[0].toLowerCase();return e[r]===t.length-1&&"achlmqstvz".includes(r)}))}function l(t){if(h(t))return m(t);var e=new f(t);for(u(e);e.index<e.max&&!e.err.length;)s(e);return e.err?e.err:e.segments}function p(t){return h(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function y(t){if(p(t))return m(t);var e=l(t),r=0,n=0,a=0,i=0;return e.map((function(t){var e,o=t.slice(1).map(Number),u=t[0],c=u.toUpperCase();if("M"===u)return r=(e=o)[0],n=e[1],a=r,i=n,["M",r,n];var s=[];if(u!==c)switch(c){case"A":s=[c,o[0],o[1],o[2],o[3],o[4],o[5]+r,o[6]+n];break;case"V":s=[c,o[0]+n];break;case"H":s=[c,o[0]+r];break;default:var m=o.map((function(t,e){return t+(e%2?n:r)}));s=[c].concat(m)}else s=[c].concat(o);var f=s.length;switch(c){case"Z":r=a,n=i;break;case"H":r=s[1];break;case"V":n=s[1];break;default:r=s[f-2],n=s[f-1],"M"===c&&(a=r,i=n)}return s}))}function v(t){return h(t)&&t.slice(1).every((function(t){var e=t[0];return e===e.toLowerCase()}))}function x(t){if(v(t))return m(t);var e=l(t),r=0,n=0,a=0,i=0;return e.map((function(t){var e,o=t.slice(1).map(Number),u=t[0],c=u.toLowerCase();if("M"===u)return r=(e=o)[0],n=e[1],a=r,i=n,["M",r,n];var s=[];if(u!==c)switch(c){case"a":s=[c,o[0],o[1],o[2],o[3],o[4],o[5]-r,o[6]-n];break;case"v":s=[c,o[0]-n];break;case"h":s=[c,o[0]-r];break;default:var m=o.map((function(t,e){return t-(e%2?n:r)}));s=[c].concat(m)}else"m"===u&&(a=o[0]+r,i=o[1]+n),s=[c].concat(o);var f=s.length;switch(c){case"z":r=a,n=i;break;case"h":r+=s[1];break;case"v":n+=s[1];break;default:r+=s[f-2],n+=s[f-1]}return s}))}function g(t,e,r){if(t[r].length>7){t[r].shift();for(var n=t[r],a=r;n.length;)e[r]="A",t.splice(a+=1,0,["C"].concat(n.splice(0,6)));t.splice(r,1)}}function d(t){return p(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function M(t){return d(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}function b(t,e){var r=t[0],n=e.x1,a=e.y1,i=e.x2,o=e.y2,u=t.slice(1).map(Number),c=t;if("TQ".includes(r)||(e.qx=null,e.qy=null),"H"===r)c=["L",t[1],a];else if("V"===r)c=["L",n,t[1]];else if("S"===r){var s=2*n-i,m=2*a-o;e.x1=s,e.y1=m,c=["C",s,m].concat(u)}else if("T"===r){var f=2*n-e.qx,h=2*a-e.qy;e.qx=f,e.qy=h,c=["Q",f,h].concat(u)}else if("Q"===r){var l=u[0],p=u[1];e.qx=l,e.qy=p}return c}var w={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function N(t){if(d(t))return m(t);for(var e=y(t),r=Object.assign({},w),n=[],a=e.length,i="",o=0;o<a;o+=1){i=e[o][0],n[o]=i,e[o]=b(e[o],r);var u=e[o],c=u.length;r.x1=+u[c-2],r.y1=+u[c-1],r.x2=+u[c-4]||r.x1,r.y2=+u[c-3]||r.y1}return e}function A(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function C(t,e,r,n,a,i,o,u,c,s){var m,f,h,l,p,y,v=t,x=e,g=r,d=n,M=u,b=c,w=120*Math.PI/180,N=Math.PI/180*(+a||0),S=[];if(s)h=(m=s)[0],l=m[1],p=m[2],y=m[3];else{v=(f=A(v,x,-N)).x,x=f.y;var k=(v-(M=(f=A(M,b,-N)).x))/2,P=(x-(b=f.y))/2,T=k*k/(g*g)+P*P/(d*d);T>1&&(g*=T=Math.sqrt(T),d*=T);var j=g*g,q=d*d,I=(i===o?-1:1)*Math.sqrt(Math.abs((j*q-j*P*P-q*k*k)/(j*P*P+q*k*k)));p=I*g*P/d+(v+M)/2,y=I*-d*k/g+(x+b)/2,h=Math.asin(((x-y)/d*Math.pow(10,9)>>0)/Math.pow(10,9)),l=Math.asin(((b-y)/d*Math.pow(10,9)>>0)/Math.pow(10,9)),h=v<p?Math.PI-h:h,l=M<p?Math.PI-l:l,h<0&&(h=2*Math.PI+h),l<0&&(l=2*Math.PI+l),o&&h>l&&(h-=2*Math.PI),!o&&l>h&&(l-=2*Math.PI)}var O=l-h;if(Math.abs(O)>w){var V=l,L=M,E=b;l=h+w*(o&&l>h?1:-1),S=C(M=p+g*Math.cos(l),b=y+d*Math.sin(l),g,d,a,0,o,L,E,[l,V,p,y])}O=l-h;var z=Math.cos(h),Z=Math.sin(h),Q=Math.cos(l),D=Math.sin(l),F=Math.tan(O/4),H=4/3*g*F,X=4/3*d*F,Y=[v,x],B=[v+H*Z,x-X*z],R=[M+H*D,b-X*Q],G=[M,b];if(B[0]=2*Y[0]-B[0],B[1]=2*Y[1]-B[1],s)return B.concat(R,G,S);for(var J=[],U=0,K=(S=B.concat(R,G,S)).length;U<K;U+=1)J[U]=U%2?A(S[U-1],S[U],N).y:A(S[U],S[U+1],N).x;return J}function S(t,e,r,n,a,i){return[1/3*t+2/3*r,1/3*e+2/3*n,1/3*a+2/3*r,1/3*i+2/3*n,a,i]}function k(t,e,r){var n=t[0],a=t[1];return[n+(e[0]-n)*r,a+(e[1]-a)*r]}function P(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function T(t,e,r,n,a){var i=P([t,e],[r,n]),o={x:0,y:0};if("number"==typeof a)if(a<=0)o={x:t,y:e};else if(a>=i)o={x:r,y:n};else{var u=k([t,e],[r,n],a/i);o={x:u[0],y:u[1]}}return{length:i,point:o,min:{x:Math.min(t,r),y:Math.min(e,n)},max:{x:Math.max(t,r),y:Math.max(e,n)}}}function j(t,e,r,n){var a=.5,i=[t,e],o=[r,n],u=k(i,o,a),c=k(o,u,a),s=k(u,c,a),m=k(c,s,a),f=k(s,m,a),h=i.concat(u,s,f,[a]),l=T.apply(void 0,h).point,p=f.concat(m,c,o,[0]),y=T.apply(void 0,p).point;return[l.x,l.y,y.x,y.y,r,n]}function q(t,e){var r,n=t[0],a=t.slice(1).map(Number),i=a[0],o=a[1],u=e.x1,c=e.y1,s=e.x,m=e.y;switch("TQ".includes(n)||(e.qx=null,e.qy=null),n){case"M":return e.x=i,e.y=o,t;case"A":return r=[u,c].concat(a),["C"].concat(C.apply(void 0,r));case"Q":return e.qx=i,e.qy=o,r=[u,c].concat(a),["C"].concat(S.apply(void 0,r));case"L":return["C"].concat(j(u,c,i,o));case"Z":return["C"].concat(j(u,c,s,m))}return t}function I(t){if(M(t))return m(t);for(var e=N(t),r=Object.assign({},w),n=[],a="",i=e.length,o=0;o<i;o+=1){a=e[o][0],n[o]=a,e[o]=q(e[o],r),g(e,n,o),i=e.length;var u=e[o],c=u.length;r.x1=+u[c-2],r.y1=+u[c-1],r.x2=+u[c-4]||r.x1,r.y2=+u[c-3]||r.y1}return e}function O(e,r){var n=t.round;if("off"===r||"off"===n)return m(e);var a="number"==typeof(n=r>=0?r:n)&&n>=1?Math.pow(10,n):1;return e.map((function(t){var e=t.slice(1).map(Number).map((function(t){return n?Math.round(t*a)/a:Math.round(t)}));return[t[0]].concat(e)}))}function V(t,e){return O(t,e).map((function(t){return t[0]+t.slice(1).join(" ")})).join("")}function L(t){var e=y(t),r="Z"===e.slice(-1)[0][0],n=N(e).map((function(t,r){var n=t.slice(-2).map(Number),a=n[0],i=n[1];return{seg:e[r],n:t,c:e[r][0],x:a,y:i}})).map((function(t,e,n){var a=t.seg,i=t.n,o=e&&n[e-1],u=n[e+1],c=t.c,s=n.length,m=e?n[e-1].x:n[s-1].x,f=e?n[e-1].y:n[s-1].y,h=[];switch(c){case"M":h=r?["Z"]:[c,m,f];break;case"A":h=[c].concat(a.slice(1,-3),[1===a[5]?0:1],[m],[f]);break;case"C":h=u&&"S"===u.c?["S",a[1],a[2],m,f]:[c,a[3],a[4],a[1],a[2],m,f];break;case"S":h=!o||!"CS".includes(o.c)||u&&"S"===u.c?[c,i[1],i[2],m,f]:["C",i[3],i[4],i[1],i[2],m,f];break;case"Q":h=u&&"T"===u.c?["T",m,f]:[c].concat(a.slice(1,-2),[m],[f]);break;case"T":h=!o||!"QT".includes(o.c)||u&&"T"===u.c?[c,m,f]:["Q",i[1],i[2],m,f];break;case"Z":h=["M",m,f];break;case"H":h=[c,m];break;case"V":h=[c,f];break;default:h=[c].concat(a.slice(1,-2),[m],[f])}return h}));return r?n.reverse():[n[0]].concat(n.slice(1).reverse())}function E(t){var e,r=[],n=-1;return t.forEach((function(t){"M"===t[0]?(e=[t],n+=1):e=e.concat([t]),r[n]=e})),r}function z(t,e,r,n){var a=t[0],i=function(t){return Math.round(t*Math.pow(10,4))/Math.pow(10,4)},o=t.slice(1).map((function(t){return+t})),u=e.slice(1).map((function(t){return+t})),c=r.x1,s=r.y1,m=r.x2,f=r.y2,h=r.x,l=r.y,p=t,y=u.slice(-2),v=y[0],x=y[1];if("TQ".includes(a)||(r.qx=null,r.qy=null),["V","H","S","T","Z"].includes(a))p=[a].concat(o);else if("L"===a)i(h)===i(v)?p=["V",x]:i(l)===i(x)&&(p=["H",v]);else if("C"===a){var g=u[0],d=u[1];"CS".includes(n)&&(i(g)===i(2*c-m)&&i(d)===i(2*s-f)||i(c)===i(2*m-h)&&i(s)===i(2*f-l))&&(p=["S"].concat(u.slice(-4))),r.x1=g,r.y1=d}else if("Q"===a){var M=u[0],b=u[1];r.qx=M,r.qy=b,"QT".includes(n)&&(i(M)===i(2*c-m)&&i(b)===i(2*s-f)||i(c)===i(2*m-h)&&i(s)===i(2*f-l))&&(p=["T"].concat(u.slice(-2)))}return p}function Z(t,e){for(var r,n=y(t),a=N(n),i=Object.assign({},w),o=[],u=n.length,c="",s="",m=0,f=0,h=0,l=0,p=0;p<u;p+=1){c=n[p][0],o[p]=c,p&&(s=o[p-1]),n[p]=z(n[p],a[p],i,s);var v=n[p],g=v.length;switch(i.x1=+v[g-2],i.y1=+v[g-1],i.x2=+v[g-4]||i.x1,i.y2=+v[g-3]||i.y1,c){case"Z":m=h,f=l;break;case"H":m=v[1];break;case"V":f=v[1];break;default:m=(r=v.slice(-2).map(Number))[0],f=r[1],"M"===c&&(h=m,l=f)}i.x=m,i.y=f}var d=O(n,e),M=O(x(n),e);return d.map((function(t,e){return e?t.join("").length<M[e].join("").length?t:M[e]:t}))}function Q(t){var e=new W,r=Array.from(t);if(!r.every((function(t){return!Number.isNaN(t)})))throw TypeError('CSSMatrix: "'+t+'" must only have numbers.');if(16===r.length){var n=r[0],a=r[1],i=r[2],o=r[3],u=r[4],c=r[5],s=r[6],m=r[7],f=r[8],h=r[9],l=r[10],p=r[11],y=r[12],v=r[13],x=r[14],g=r[15];e.m11=n,e.a=n,e.m21=u,e.c=u,e.m31=f,e.m41=y,e.e=y,e.m12=a,e.b=a,e.m22=c,e.d=c,e.m32=h,e.m42=v,e.f=v,e.m13=i,e.m23=s,e.m33=l,e.m43=x,e.m14=o,e.m24=m,e.m34=p,e.m44=g}else{if(6!==r.length)throw new TypeError("CSSMatrix: expecting an Array of 6/16 values.");var d=r[0],M=r[1],b=r[2],w=r[3],N=r[4],A=r[5];e.m11=d,e.a=d,e.m12=M,e.b=M,e.m21=b,e.c=b,e.m22=w,e.d=w,e.m41=N,e.e=N,e.m42=A,e.f=A}return e}function D(t){var e=Object.keys(new W);if("object"==typeof t&&e.every((function(e){return e in t})))return Q([t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44]);throw TypeError('CSSMatrix: "'+JSON.stringify(t)+'" is not a DOMMatrix / CSSMatrix / JSON compatible object.')}function F(t){if("string"!=typeof t)throw TypeError('CSSMatrix: "'+t+'" is not a string.');var e=String(t).replace(/\s/g,""),r=new W,n='CSSMatrix: invalid transform string "'+t+'"';return e.split(")").filter((function(t){return t})).forEach((function(t){var e=t.split("("),a=e[0],i=e[1];if(!i)throw TypeError(n);var o=i.split(",").map((function(t){return t.includes("rad")?parseFloat(t)*(180/Math.PI):parseFloat(t)})),u=o[0],c=o[1],s=o[2],m=o[3],f=[u,c,s],h=[u,c,s,m];if("perspective"===a&&u&&[c,s].every((function(t){return void 0===t})))r.m34=-1/u;else if(a.includes("matrix")&&[6,16].includes(o.length)&&o.every((function(t){return!Number.isNaN(+t)}))){var l=o.map((function(t){return Math.abs(t)<1e-6?0:t}));r=r.multiply(Q(l))}else if("translate3d"===a&&f.every((function(t){return!Number.isNaN(+t)})))r=r.translate(u,c,s);else if("translate"===a&&u&&void 0===s)r=r.translate(u,c||0,0);else if("rotate3d"===a&&h.every((function(t){return!Number.isNaN(+t)}))&&m)r=r.rotateAxisAngle(u,c,s,m);else if("rotate"===a&&u&&[c,s].every((function(t){return void 0===t})))r=r.rotate(0,0,u);else if("scale3d"===a&&f.every((function(t){return!Number.isNaN(+t)}))&&f.some((function(t){return 1!==t})))r=r.scale(u,c,s);else if("scale"!==a||Number.isNaN(u)||1===u||void 0!==s)if("skew"===a&&(u||!Number.isNaN(u)&&c)&&void 0===s)r=r.skew(u,c||0);else{if(!(/[XYZ]/.test(a)&&u&&[c,s].every((function(t){return void 0===t}))&&["translate","rotate","scale","skew"].some((function(t){return a.includes(t)}))))throw TypeError(n);if(["skewX","skewY"].includes(a))r=r[a](u);else{var p=a.replace(/[XYZ]/,""),y=a.replace(p,""),v=["X","Y","Z"].indexOf(y),x="scale"===p?1:0,g=[0===v?u:x,1===v?u:x,2===v?u:x];r=r[p].apply(r,g)}}else{var d=Number.isNaN(+c)?u:c;r=r.scale(u,d,1)}})),r}function H(t,e){return e?[t.a,t.b,t.c,t.d,t.e,t.f]:[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44]}function X(t,e,r){var n=new W;return n.m41=t,n.e=t,n.m42=e,n.f=e,n.m43=r,n}function Y(t,e,r){var n=new W,a=Math.PI/180,i=t*a,o=e*a,u=r*a,c=Math.cos(i),s=-Math.sin(i),m=Math.cos(o),f=-Math.sin(o),h=Math.cos(u),l=-Math.sin(u),p=m*h,y=-m*l;n.m11=p,n.a=p,n.m12=y,n.b=y,n.m13=f;var v=s*f*h+c*l;n.m21=v,n.c=v;var x=c*h-s*f*l;return n.m22=x,n.d=x,n.m23=-s*m,n.m31=s*l-c*f*h,n.m32=s*h+c*f*l,n.m33=c*m,n}function B(t,e,r,n){var a=new W,i=Math.sqrt(t*t+e*e+r*r);if(0===i)return a;var o=t/i,u=e/i,c=r/i,s=n*(Math.PI/360),m=Math.sin(s),f=Math.cos(s),h=m*m,l=o*o,p=u*u,y=c*c,v=1-2*(p+y)*h;a.m11=v,a.a=v;var x=2*(o*u*h+c*m*f);a.m12=x,a.b=x,a.m13=2*(o*c*h-u*m*f);var g=2*(u*o*h-c*m*f);a.m21=g,a.c=g;var d=1-2*(y+l)*h;return a.m22=d,a.d=d,a.m23=2*(u*c*h+o*m*f),a.m31=2*(c*o*h+u*m*f),a.m32=2*(c*u*h-o*m*f),a.m33=1-2*(l+p)*h,a}function R(t,e,r){var n=new W;return n.m11=t,n.a=t,n.m22=e,n.d=e,n.m33=r,n}function G(t,e){var r=new W;if(t){var n=t*Math.PI/180,a=Math.tan(n);r.m21=a,r.c=a}if(e){var i=e*Math.PI/180,o=Math.tan(i);r.m12=o,r.b=o}return r}function J(t){return G(t,0)}function U(t){return G(0,t)}function K(t,e){return Q([e.m11*t.m11+e.m12*t.m21+e.m13*t.m31+e.m14*t.m41,e.m11*t.m12+e.m12*t.m22+e.m13*t.m32+e.m14*t.m42,e.m11*t.m13+e.m12*t.m23+e.m13*t.m33+e.m14*t.m43,e.m11*t.m14+e.m12*t.m24+e.m13*t.m34+e.m14*t.m44,e.m21*t.m11+e.m22*t.m21+e.m23*t.m31+e.m24*t.m41,e.m21*t.m12+e.m22*t.m22+e.m23*t.m32+e.m24*t.m42,e.m21*t.m13+e.m22*t.m23+e.m23*t.m33+e.m24*t.m43,e.m21*t.m14+e.m22*t.m24+e.m23*t.m34+e.m24*t.m44,e.m31*t.m11+e.m32*t.m21+e.m33*t.m31+e.m34*t.m41,e.m31*t.m12+e.m32*t.m22+e.m33*t.m32+e.m34*t.m42,e.m31*t.m13+e.m32*t.m23+e.m33*t.m33+e.m34*t.m43,e.m31*t.m14+e.m32*t.m24+e.m33*t.m34+e.m34*t.m44,e.m41*t.m11+e.m42*t.m21+e.m43*t.m31+e.m44*t.m41,e.m41*t.m12+e.m42*t.m22+e.m43*t.m32+e.m44*t.m42,e.m41*t.m13+e.m42*t.m23+e.m43*t.m33+e.m44*t.m43,e.m41*t.m14+e.m42*t.m24+e.m43*t.m34+e.m44*t.m44])}var W=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=this;if(r.a=1,r.b=0,r.c=0,r.d=1,r.e=0,r.f=0,r.m11=1,r.m12=0,r.m13=0,r.m14=0,r.m21=0,r.m22=1,r.m23=0,r.m24=0,r.m31=0,r.m32=0,r.m33=1,r.m34=0,r.m41=0,r.m42=0,r.m43=0,r.m44=1,t.length){var n=[16,6].some((function(e){return e===t.length}))?t:t[0];return r.setMatrixValue(n)}return r},$={isIdentity:{configurable:!0},is2D:{configurable:!0}};$.isIdentity.get=function(){var t=this;return 1===t.m11&&0===t.m12&&0===t.m13&&0===t.m14&&0===t.m21&&1===t.m22&&0===t.m23&&0===t.m24&&0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m41&&0===t.m42&&0===t.m43&&1===t.m44},$.is2D.get=function(){var t=this;return 0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m43&&1===t.m44},W.prototype.setMatrixValue=function(t){return"string"==typeof t&&t.length&&"none"!==t?F(t):[Array,Float64Array,Float32Array].some((function(e){return t instanceof e}))?Q(t):[W,DOMMatrix,Object].some((function(e){return t instanceof e}))?D(t):this},W.prototype.toFloat32Array=function(t){return Float32Array.from(H(this,t))},W.prototype.toFloat64Array=function(t){return Float64Array.from(H(this,t))},W.prototype.toString=function(){var t=this.is2D;return(t?"matrix":"matrix3d")+"("+this.toFloat64Array(t).join(", ")+")"},W.prototype.toJSON=function(){var t=this,e=t.is2D,r=t.isIdentity;return Object.assign({},t,{is2D:e,isIdentity:r})},W.prototype.multiply=function(t){return K(this,t)},W.prototype.translate=function(t,e,r){var n=e,a=r;return void 0===n&&(n=0),void 0===a&&(a=0),K(this,X(t,n,a))},W.prototype.scale=function(t,e,r){var n=e,a=r;return void 0===n&&(n=t),void 0===a&&(a=1),K(this,R(t,n,a))},W.prototype.rotate=function(t,e,r){var n=t,a=e||0,i=r||0;return"number"==typeof t&&void 0===e&&void 0===r&&(i=n,n=0,a=0),K(this,Y(n,a,i))},W.prototype.rotateAxisAngle=function(t,e,r,n){if([t,e,r,n].some((function(t){return Number.isNaN(+t)})))throw new TypeError("CSSMatrix: expecting 4 values");return K(this,B(t,e,r,n))},W.prototype.skewX=function(t){return K(this,J(t))},W.prototype.skewY=function(t){return K(this,U(t))},W.prototype.skew=function(t,e){return K(this,G(t,e))},W.prototype.transformPoint=function(t){var e=this,r=e.m11*t.x+e.m21*t.y+e.m31*t.z+e.m41*t.w,n=e.m12*t.x+e.m22*t.y+e.m32*t.z+e.m42*t.w,a=e.m13*t.x+e.m23*t.y+e.m33*t.z+e.m43*t.w,i=e.m14*t.x+e.m24*t.y+e.m34*t.z+e.m44*t.w;return t instanceof DOMPoint?new DOMPoint(r,n,a,i):{x:r,y:n,z:a,w:i}},Object.defineProperties(W.prototype,$),Object.assign(W,{Translate:X,Rotate:Y,RotateAxisAngle:B,Scale:R,SkewX:J,SkewY:U,Skew:G,Multiply:K,fromArray:Q,fromMatrix:D,fromString:F,toArray:H});function _(t,e,r){var n=r[0],a=r[1],i=r[2],o=function(t,e){var r,n=X.apply(void 0,e);return r=e,n.m44=r[3],[(n=t.multiply(n)).m41,n.m42,n.m43,n.m44]}(t,e.concat([0],[1])),u=o[0],c=o[1]-a,s=o[2]-i;return[(u-n)*(Math.abs(i)/Math.abs(s)||1)+n,c*(Math.abs(i)/Math.abs(s)||1)+a]}function tt(e,r){var n,a,i,o,u,c,s=0,f=0,h=y(e),l=r&&Object.keys(r);if(!r||!l.length)return m(h);var p=N(h);if(!r.origin){var v=t.origin;Object.assign(r,{origin:v})}var x=function(t){var e=new W,r=t.origin,n=r[0],a=r[1],i=t.translate,o=t.rotate,u=t.skew,c=t.scale;return Array.isArray(i)&&i.every((function(t){return!Number.isNaN(+t)}))&&i.some((function(t){return 0!==t}))?e=e.translate.apply(e,i):"number"!=typeof i||Number.isNaN(i)||(e=e.translate(i)),(o||u||c)&&(e=e.translate(n,a),Array.isArray(o)&&o.every((function(t){return!Number.isNaN(+t)}))&&o.some((function(t){return 0!==t}))?e=e.rotate.apply(e,o):"number"!=typeof o||Number.isNaN(o)||(e=e.rotate(o)),Array.isArray(u)&&u.every((function(t){return!Number.isNaN(+t)}))&&u.some((function(t){return 0!==t}))?(e=u[0]?e.skewX(u[0]):e,e=u[1]?e.skewY(u[1]):e):"number"!=typeof u||Number.isNaN(u)||(e=e.skewX(u)),Array.isArray(c)&&c.every((function(t){return!Number.isNaN(+t)}))&&c.some((function(t){return 1!==t}))?e=e.scale.apply(e,c):"number"!=typeof c||Number.isNaN(c)||(e=e.scale(c)),e=e.translate(-n,-a)),e}(r),d=r.origin,M=Object.assign({},w),b=[],A=0,C="",S=[],k=[];if(!x.isIdentity){for(n=0,i=h.length;n<i;n+=1){b=h[n],h[n]&&(C=b[0]),k[n]=C,"A"===C&&(b=q(p[n],M),h[n]=q(p[n],M),g(h,k,n),p[n]=q(p[n],M),g(p,k,n),i=Math.max(h.length,p.length)),A=(b=p[n]).length,M.x1=+b[A-2],M.y1=+b[A-1],M.x2=+b[A-4]||M.x1,M.y2=+b[A-3]||M.y1;var P={s:h[n],c:h[n][0],x:M.x1,y:M.y1};S=S.concat([P])}return S.map((function(t){var e,r;switch(C=t.c,b=t.s,C){case"L":case"H":case"V":return e=_(x,[t.x,t.y],d),u=e[0],c=e[1],s!==u&&f!==c?b=["L",u,c]:f===c?b=["H",u]:s===u&&(b=["V",c]),s=u,f=c,b;default:for(a=1,o=b.length;a<o;a+=2)r=_(x,[+b[a],+b[a+1]],d),s=r[0],f=r[1],b[a]=s,b[a+1]=f;return b}}))}return m(h)}function et(t,e){var r=t.x,n=t.y,a=e.x,i=e.y,o=r*a+n*i,u=Math.sqrt((Math.pow(r,2)+Math.pow(n,2))*(Math.pow(a,2)+Math.pow(i,2)));return(r*i-n*a<0?-1:1)*Math.acos(o/u)}function rt(t,e,r,n,a,i,o,u,c,s){var m=Math.abs,f=Math.sin,h=Math.cos,l=Math.sqrt,p=Math.PI,y=m(r),v=m(n),x=(a%360+360)%360*(p/180);if(t===u&&e===c)return{x:t,y:e};if(0===y||0===v)return T(t,e,u,c,s).point;var g=(t-u)/2,d=(e-c)/2,M={x:h(x)*g+f(x)*d,y:-f(x)*g+h(x)*d},b=Math.pow(M.x,2)/Math.pow(y,2)+Math.pow(M.y,2)/Math.pow(v,2);b>1&&(y*=l(b),v*=l(b));var w=(Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(M.y,2)-Math.pow(v,2)*Math.pow(M.x,2))/(Math.pow(y,2)*Math.pow(M.y,2)+Math.pow(v,2)*Math.pow(M.x,2)),N=(i!==o?1:-1)*l(w=w<0?0:w),A=N*(y*M.y/v),C=N*(-v*M.x/y),S=h(x)*A-f(x)*C+(t+u)/2,k=f(x)*A+h(x)*C+(e+c)/2,P={x:(M.x-A)/y,y:(M.y-C)/v},j=et({x:1,y:0},P),q=et(P,{x:(-M.x-A)/y,y:(-M.y-C)/v});!o&&q>0?q-=2*p:o&&q<0&&(q+=2*p);var I=j+(q%=2*p)*s,O=y*h(I),V=v*f(I);return{x:h(x)*O-f(x)*V+S,y:f(x)*O+h(x)*V+k}}function nt(t,e,r,n,a,i,o,u,c,s){var m,f="number"==typeof s,h=t,l=e,p=0,y=[h,l,p],v=[h,l],x={x:0,y:0},g=[{x:h,y:l}];f&&s<=0&&(x={x:h,y:l});for(var d=0;d<=300;d+=1){if(h=(m=rt(t,e,r,n,a,i,o,u,c,d/300)).x,l=m.y,g=g.concat([{x:h,y:l}]),p+=P(v,[h,l]),v=[h,l],f&&p>s&&s>y[2]){var M=(p-s)/(p-y[2]);x={x:v[0]*(1-M)+y[0]*M,y:v[1]*(1-M)+y[1]*M}}y=[h,l,p]}return f&&s>=p&&(x={x:u,y:c}),{length:p,point:x,min:{x:Math.min.apply(Math,g.map((function(t){return t.x}))),y:Math.min.apply(Math,g.map((function(t){return t.y})))},max:{x:Math.max.apply(Math,g.map((function(t){return t.x}))),y:Math.max.apply(Math,g.map((function(t){return t.y})))}}}function at(t,e,r,n,a,i,o,u,c){var s=1-c;return{x:Math.pow(s,3)*t+3*Math.pow(s,2)*c*r+3*s*Math.pow(c,2)*a+Math.pow(c,3)*o,y:Math.pow(s,3)*e+3*Math.pow(s,2)*c*n+3*s*Math.pow(c,2)*i+Math.pow(c,3)*u}}function it(t,e,r,n,a,i,o,u,c){var s,m="number"==typeof c,f=t,h=e,l=0,p=[f,h,l],y=[f,h],v={x:0,y:0},x=[{x:f,y:h}];m&&c<=0&&(v={x:f,y:h});for(var g=0;g<=300;g+=1){if(f=(s=at(t,e,r,n,a,i,o,u,g/300)).x,h=s.y,x=x.concat([{x:f,y:h}]),l+=P(y,[f,h]),y=[f,h],m&&l>c&&c>p[2]){var d=(l-c)/(l-p[2]);v={x:y[0]*(1-d)+p[0]*d,y:y[1]*(1-d)+p[1]*d}}p=[f,h,l]}return m&&c>=l&&(v={x:o,y:u}),{length:l,point:v,min:{x:Math.min.apply(Math,x.map((function(t){return t.x}))),y:Math.min.apply(Math,x.map((function(t){return t.y})))},max:{x:Math.max.apply(Math,x.map((function(t){return t.x}))),y:Math.max.apply(Math,x.map((function(t){return t.y})))}}}function ot(t,e,r,n,a,i,o){var u=1-o;return{x:Math.pow(u,2)*t+2*u*o*r+Math.pow(o,2)*a,y:Math.pow(u,2)*e+2*u*o*n+Math.pow(o,2)*i}}function ut(t,e,r,n,a,i,o){var u,c="number"==typeof o,s=t,m=e,f=0,h=[s,m,f],l=[s,m],p={x:0,y:0},y=[{x:s,y:m}];c&&o<=0&&(p={x:s,y:m});for(var v=0;v<=300;v+=1){if(s=(u=ot(t,e,r,n,a,i,v/300)).x,m=u.y,y=y.concat([{x:s,y:m}]),f+=P(l,[s,m]),l=[s,m],c&&f>o&&o>h[2]){var x=(f-o)/(f-h[2]);p={x:l[0]*(1-x)+h[0]*x,y:l[1]*(1-x)+h[1]*x}}h=[s,m,f]}return c&&o>=f&&(p={x:a,y:i}),{length:f,point:p,min:{x:Math.min.apply(Math,y.map((function(t){return t.x}))),y:Math.min.apply(Math,y.map((function(t){return t.y})))},max:{x:Math.max.apply(Math,y.map((function(t){return t.x}))),y:Math.max.apply(Math,y.map((function(t){return t.y})))}}}function ct(t,e){for(var r,n,a,i,o,u,c,s,m,f,h=N(t),l="number"==typeof e,p=[],y=0,v=0,x=0,g=0,d=[],M=[],b=0,w={x:0,y:0},A=w,C=w,S=w,k=0,P=0,j=h.length;P<j;P+=1)p=(s="M"===(m=(f=h[P])[0]))?p:[y,v].concat(f.slice(1)),s?(A=w={x:x=(r=f)[1],y:g=r[2]},b=0,l&&e<.001&&(S=w)):"L"===m?(b=(n=T.apply(void 0,p.concat([(e||0)-k]))).length,w=n.min,A=n.max,C=n.point):"A"===m?(b=(a=nt.apply(void 0,p.concat([(e||0)-k]))).length,w=a.min,A=a.max,C=a.point):"C"===m?(b=(i=it.apply(void 0,p.concat([(e||0)-k]))).length,w=i.min,A=i.max,C=i.point):"Q"===m?(b=(o=ut.apply(void 0,p.concat([(e||0)-k]))).length,w=o.min,A=o.max,C=o.point):"Z"===m&&(p=[y,v,x,g],b=(u=T.apply(void 0,p.concat([(e||0)-k]))).length,w=u.min,A=u.max,C=u.point),l&&k<e&&k+b>=e&&(S=C),M=M.concat([A]),d=d.concat([w]),k+=b,y=(c="Z"!==m?f.slice(-2):[x,g])[0],v=c[1];return l&&e>=k&&(S={x:y,y:v}),{length:k,point:S,min:{x:Math.min.apply(Math,d.map((function(t){return t.x}))),y:Math.min.apply(Math,d.map((function(t){return t.y})))},max:{x:Math.max.apply(Math,M.map((function(t){return t.x}))),y:Math.max.apply(Math,M.map((function(t){return t.y})))}}}function st(t){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var e=ct(t),r=e.min,n=r.x,a=r.y,i=e.max,o=i.x,u=i.y,c=o-n,s=u-a;return{width:c,height:s,x:n,y:a,x2:o,y2:u,cx:n+c/2,cy:a+s/2,cz:Math.max(c,s)+Math.min(c,s)/2}}function mt(t){return ct(t).length}function ft(t,e){return ct(t,e).point}Object.assign(W,{Version:"1.0.3"});var ht=function(e,r){var a=r||{},i=void 0===e;if(i||!e.length)throw TypeError(n+': "pathValue" is '+(i?"undefined":"empty"));var o=l(e);if("string"==typeof o)throw TypeError(o);this.segments=o;var u,c,s=this.getBBox(),m=s.width,f=s.height,h=s.cx,p=s.cy,y=s.cz,v=a.round,x=a.origin;if("auto"===v){var g=(""+Math.floor(Math.max(m,f))).length;u=g>=4?0:4-g}else u=Number.isInteger(v)||"off"===v?v:t.round;if(Array.isArray(x)&&x.length>=2){var d=x.map(Number),M=d[0],b=d[1],w=d[2];c=[Number.isNaN(M)?h:M,Number.isNaN(b)?p:b,Number.isNaN(w)?y:w]}else c=[h,p,y];return this.round=u,this.origin=c,this};function lt(t,e,r,n,a,i,o,u){return 3*((u-e)*(r+a)-(o-t)*(n+i)+n*(t-a)-r*(e-i)+u*(a+t/3)-o*(i+e/3))/20}function pt(t){var e=0,r=0,n=0;return I(t).map((function(t){var a,i;switch(t[0]){case"M":return e=(a=t)[1],r=a[2],0;default:return n=lt.apply(void 0,[e,r].concat(t.slice(1))),i=t.slice(-2),e=i[0],r=i[1],n}})).reduce((function(t,e){return t+e}),0)}function yt(t,e){var r=l(t);if("string"==typeof r)throw TypeError(r);var n=[].concat(r),a=mt(n),i=n.length-1,o=0,u=0,c=r[0],s=c.slice(-2),m={x:s[0],y:s[1]};if(i<=0||!e||!Number.isFinite(e))return{segment:c,index:0,length:u,point:m,lengthAtSegment:o};if(e>=a)return u=a-(o=mt(n=r.slice(0,-1))),{segment:r[i],index:i,length:u,lengthAtSegment:o};for(var f=[];i>0;)c=n[i],u=a-(o=mt(n=n.slice(0,-1))),a=o,f.push({segment:c,index:i,length:u,lengthAtSegment:o}),i-=1;return f.find((function(t){return t.lengthAtSegment<=e}))}function vt(t,e){for(var r,n,a,i,o=l(t),u=N(o),c=mt(o),s=function(t){var r=t.x-e.x,n=t.y-e.y;return r*r+n*n},m=8,f=0,h=0,p=1/0,y=0;y<=c;y+=m)(f=s(r=ft(u,y)))<p&&(n=r,h=y,p=f);m/=2;for(var v=0,x=0,g=0,d=0;m>.5;)g=s(a=ft(u,v=h-m)),d=s(i=ft(u,x=h+m)),v>=0&&g<p?(n=a,h=v,p=g):x<=c&&d<p?(n=i,h=x,p=d):m/=2;var M=yt(o,h);return{closest:n,distance:Math.sqrt(p),segment:M}}function xt(t){if("string"!=typeof t)return!1;var e=new f(t);for(u(e);e.index<e.max&&!e.err.length;)s(e);return!e.err.length&&"mM".includes(e.segments[0][0])}ht.prototype.getBBox=function(){return st(this.segments)},ht.prototype.getTotalLength=function(){return mt(this.segments)},ht.prototype.getPointAtLength=function(t){return ft(this.segments,t)},ht.prototype.toAbsolute=function(){var t=this.segments;return this.segments=y(t),this},ht.prototype.toRelative=function(){var t=this.segments;return this.segments=x(t),this},ht.prototype.toCurve=function(){var t=this.segments;return this.segments=I(t),this},ht.prototype.reverse=function(t){this.toAbsolute();var e=this.segments,r=E(e),n=r.length>1?r:0,a=n&&m(n).map((function(e,r){return t?r?L(e):l(e):L(e)})),i=[];return i=n?a.flat(1):t?e:L(e),this.segments=m(i),this},ht.prototype.normalize=function(){var t=this.segments;return this.segments=N(t),this},ht.prototype.optimize=function(){var t=this.segments;return this.segments=Z(t,this.round),this},ht.prototype.transform=function(t){if(!t||"object"!=typeof t||"object"==typeof t&&!["translate","rotate","skew","scale"].some((function(e){return e in t})))return this;var e={};Object.keys(t).forEach((function(r){e[r]=Array.isArray(t[r])?[].concat(t[r]):Number(t[r])}));var r=this.segments,n=this.origin,a=n[0],i=n[1],o=n[2],u=e.origin;if(Array.isArray(u)&&u.length>=2){var c=u.map(Number),s=c[0],m=c[1],f=c[2];e.origin=[Number.isNaN(s)?a:s,Number.isNaN(m)?i:m,f||o]}else e.origin=[a,i,o];return this.segments=tt(r,e),this},ht.prototype.flipX=function(){return this.transform({rotate:[0,180,0]}),this},ht.prototype.flipY=function(){return this.transform({rotate:[180,0,0]}),this},ht.prototype.toString=function(){return V(this.segments,this.round)};var gt={line:["x1","y1","x2","y2"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],rect:["width","height","x","y","rx","ry"],polygon:["points"],polyline:["points"],glyph:["d"]};var dt={CSSMatrix:W,parsePathString:l,isPathArray:h,isCurveArray:M,isAbsoluteArray:p,isRelativeArray:v,isNormalizedArray:d,isValidPath:xt,pathToAbsolute:y,pathToRelative:x,pathToCurve:I,pathToString:V,getDrawDirection:function(t){return pt(I(t))>=0},getPathArea:pt,getPathBBox:st,pathLengthFactory:ct,getTotalLength:mt,getPointAtLength:ft,getClosestPoint:function(t,e){return vt(t,e).closest},getSegmentOfPoint:function(t,e){return vt(t,e).segment},getPropertiesAtPoint:vt,getPropertiesAtLength:yt,getSegmentAtLength:function(t,e){return yt(t,e).segment},isPointInStroke:function(t,e){var r=vt(t,e).distance;return Math.abs(r)<.001},clonePath:m,splitPath:E,fixPath:function(t){var e=l(t),r=N(e),n=e.length,a="Z"===r.slice(-1)[0][0],i=a?n-2:n-1,o=r[0].slice(1),u=o[0],c=o[1],s=r[i].slice(-2),m=s[0],f=s[1];return a&&u===m&&c===f?e.slice(0,-1):e},roundPath:O,optimizePath:Z,reverseCurve:function(t){var e=t.slice(1).map((function(e,r,n){return r?n[r-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))})).map((function(t){return t.map((function(e,r){return t[t.length-r-2*(1-r%2)]}))})).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map((function(t){return["C"].concat(t.slice(2))})))},reversePath:L,normalizePath:N,transformPath:tt,shapeToPath:function(e,r){var a=Object.keys(gt),i=e.tagName;if(i&&!a.some((function(t){return i===t})))throw TypeError(n+': "'+i+'" is not SVGElement');var o=document.createElementNS("http://www.w3.org/2000/svg","path"),u=i||e.type,c={};c.type=u;var s,m=gt[u];i?(m.forEach((function(t){c[t]=e.getAttribute(t)})),Object.values(e.attributes).forEach((function(t){var e=t.name,r=t.value;m.includes(e)||o.setAttribute(e,r)}))):(Object.assign(c,e),Object.keys(c).forEach((function(t){m.includes(t)||"type"===t||o.setAttribute(t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()})),c[t])})));var f,h,l,p,y=t.round;return"circle"===u?s=V((h=(f=c).cx,l=f.cy,p=f.r,[["M",h-p,l],["a",p,p,0,1,0,2*p,0],["a",p,p,0,1,0,-2*p,0]]),y):"ellipse"===u?s=V(function(t){var e=t.cx,r=t.cy,n=t.rx,a=t.ry;return[["M",e-n,r],["a",n,a,0,1,0,2*n,0],["a",n,a,0,1,0,-2*n,0]]}(c),y):["polyline","polygon"].includes(u)?s=V(function(t){for(var e=[],r=(t.points||"").trim().split(/[\s|,]/).map(Number),n=0;n<r.length;)e.push([n?"L":"M",r[n],r[n+1]]),n+=2;return"polygon"===t.type?e.concat([["z"]]):e}(c),y):"rect"===u?s=V(function(t){var e=+t.x||0,r=+t.y||0,n=+t.width,a=+t.height,i=+t.rx,o=+t.ry;return i||o?(i=i||o,o=o||i,2*i>n&&(i-=(2*i-n)/2),2*o>a&&(o-=(2*o-a)/2),[["M",e+i,r],["h",n-2*i],["s",i,0,i,o],["v",a-2*o],["s",0,o,-i,o],["h",2*i-n],["s",-i,0,-i,-o],["v",2*o-a],["s",0,-o,i,-o]]):[["M",e,r],["h",n],["v",a],["H",e],["Z"]]}(c),y):"line"===u?s=V(function(t){return[["M",t.x1,t.y1],["L",t.x2,t.y2]]}(c),y):"glyph"===u&&(s=i?e.getAttribute("d"):e.d),!!xt(s)&&(o.setAttribute("d",s),r&&i&&(e.before(o,e),e.remove()),o)},options:t};return Object.assign(ht,dt,{Version:"1.0.5"}),ht}));
|