@labelbee/lb-annotation 1.8.0-alpha.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +203 -0
- package/dist/index.js +2 -2
- package/es/index.js +2 -2
- package/package.json +4 -3
- package/es/.DS_Store +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
Copyright 2018-2023 OpenMMLab. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Apache License
|
|
4
|
+
Version 2.0, January 2004
|
|
5
|
+
http://www.apache.org/licenses/
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
12
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
13
|
+
|
|
14
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
15
|
+
the copyright owner that is granting the License.
|
|
16
|
+
|
|
17
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
18
|
+
other entities that control, are controlled by, or are under common
|
|
19
|
+
control with that entity. For the purposes of this definition,
|
|
20
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
21
|
+
direction or management of such entity, whether by contract or
|
|
22
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
23
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
24
|
+
|
|
25
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
26
|
+
exercising permissions granted by this License.
|
|
27
|
+
|
|
28
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
29
|
+
including but not limited to software source code, documentation
|
|
30
|
+
source, and configuration files.
|
|
31
|
+
|
|
32
|
+
"Object" form shall mean any form resulting from mechanical
|
|
33
|
+
transformation or translation of a Source form, including but
|
|
34
|
+
not limited to compiled object code, generated documentation,
|
|
35
|
+
and conversions to other media types.
|
|
36
|
+
|
|
37
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
38
|
+
Object form, made available under the License, as indicated by a
|
|
39
|
+
copyright notice that is included in or attached to the work
|
|
40
|
+
(an example is provided in the Appendix below).
|
|
41
|
+
|
|
42
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
43
|
+
form, that is based on (or derived from) the Work and for which the
|
|
44
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
45
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
46
|
+
of this License, Derivative Works shall not include works that remain
|
|
47
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
48
|
+
the Work and Derivative Works thereof.
|
|
49
|
+
|
|
50
|
+
"Contribution" shall mean any work of authorship, including
|
|
51
|
+
the original version of the Work and any modifications or additions
|
|
52
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
53
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
54
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
55
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
56
|
+
means any form of electronic, verbal, or written communication sent
|
|
57
|
+
to the Licensor or its representatives, including but not limited to
|
|
58
|
+
communication on electronic mailing lists, source code control systems,
|
|
59
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
60
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
61
|
+
excluding communication that is conspicuously marked or otherwise
|
|
62
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
63
|
+
|
|
64
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
65
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
66
|
+
subsequently incorporated within the Work.
|
|
67
|
+
|
|
68
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
69
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
70
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
71
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
72
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
73
|
+
Work and such Derivative Works in Source or Object form.
|
|
74
|
+
|
|
75
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
76
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
77
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
78
|
+
(except as stated in this section) patent license to make, have made,
|
|
79
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
80
|
+
where such license applies only to those patent claims licensable
|
|
81
|
+
by such Contributor that are necessarily infringed by their
|
|
82
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
83
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
84
|
+
institute patent litigation against any entity (including a
|
|
85
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
86
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
87
|
+
or contributory patent infringement, then any patent licenses
|
|
88
|
+
granted to You under this License for that Work shall terminate
|
|
89
|
+
as of the date such litigation is filed.
|
|
90
|
+
|
|
91
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
92
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
93
|
+
modifications, and in Source or Object form, provided that You
|
|
94
|
+
meet the following conditions:
|
|
95
|
+
|
|
96
|
+
(a) You must give any other recipients of the Work or
|
|
97
|
+
Derivative Works a copy of this License; and
|
|
98
|
+
|
|
99
|
+
(b) You must cause any modified files to carry prominent notices
|
|
100
|
+
stating that You changed the files; and
|
|
101
|
+
|
|
102
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
103
|
+
that You distribute, all copyright, patent, trademark, and
|
|
104
|
+
attribution notices from the Source form of the Work,
|
|
105
|
+
excluding those notices that do not pertain to any part of
|
|
106
|
+
the Derivative Works; and
|
|
107
|
+
|
|
108
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
109
|
+
distribution, then any Derivative Works that You distribute must
|
|
110
|
+
include a readable copy of the attribution notices contained
|
|
111
|
+
within such NOTICE file, excluding those notices that do not
|
|
112
|
+
pertain to any part of the Derivative Works, in at least one
|
|
113
|
+
of the following places: within a NOTICE text file distributed
|
|
114
|
+
as part of the Derivative Works; within the Source form or
|
|
115
|
+
documentation, if provided along with the Derivative Works; or,
|
|
116
|
+
within a display generated by the Derivative Works, if and
|
|
117
|
+
wherever such third-party notices normally appear. The contents
|
|
118
|
+
of the NOTICE file are for informational purposes only and
|
|
119
|
+
do not modify the License. You may add Your own attribution
|
|
120
|
+
notices within Derivative Works that You distribute, alongside
|
|
121
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
122
|
+
that such additional attribution notices cannot be construed
|
|
123
|
+
as modifying the License.
|
|
124
|
+
|
|
125
|
+
You may add Your own copyright statement to Your modifications and
|
|
126
|
+
may provide additional or different license terms and conditions
|
|
127
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
128
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
129
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
130
|
+
the conditions stated in this License.
|
|
131
|
+
|
|
132
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
133
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
134
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
135
|
+
this License, without any additional terms or conditions.
|
|
136
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
137
|
+
the terms of any separate license agreement you may have executed
|
|
138
|
+
with Licensor regarding such Contributions.
|
|
139
|
+
|
|
140
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
141
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
142
|
+
except as required for reasonable and customary use in describing the
|
|
143
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
144
|
+
|
|
145
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
146
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
147
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
148
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
149
|
+
implied, including, without limitation, any warranties or conditions
|
|
150
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
151
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
152
|
+
appropriateness of using or redistributing the Work and assume any
|
|
153
|
+
risks associated with Your exercise of permissions under this License.
|
|
154
|
+
|
|
155
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
156
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
157
|
+
unless required by applicable law (such as deliberate and grossly
|
|
158
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
159
|
+
liable to You for damages, including any direct, indirect, special,
|
|
160
|
+
incidental, or consequential damages of any character arising as a
|
|
161
|
+
result of this License or out of the use or inability to use the
|
|
162
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
163
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
164
|
+
other commercial damages or losses), even if such Contributor
|
|
165
|
+
has been advised of the possibility of such damages.
|
|
166
|
+
|
|
167
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
168
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
169
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
170
|
+
or other liability obligations and/or rights consistent with this
|
|
171
|
+
License. However, in accepting such obligations, You may act only
|
|
172
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
173
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
174
|
+
defend, and hold each Contributor harmless for any liability
|
|
175
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
176
|
+
of your accepting any such warranty or additional liability.
|
|
177
|
+
|
|
178
|
+
END OF TERMS AND CONDITIONS
|
|
179
|
+
|
|
180
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
181
|
+
|
|
182
|
+
To apply the Apache License to your work, attach the following
|
|
183
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
184
|
+
replaced with your own identifying information. (Don't include
|
|
185
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
186
|
+
comment syntax for the file format. We also recommend that a
|
|
187
|
+
file or class name and description of purpose be included on the
|
|
188
|
+
same "printed page" as the copyright notice for easier
|
|
189
|
+
identification within third-party archives.
|
|
190
|
+
|
|
191
|
+
Copyright 2018-2023 OpenMMLab.
|
|
192
|
+
|
|
193
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
+
you may not use this file except in compliance with the License.
|
|
195
|
+
You may obtain a copy of the License at
|
|
196
|
+
|
|
197
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
+
|
|
199
|
+
Unless required by applicable law or agreed to in writing, software
|
|
200
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
+
See the License for the specific language governing permissions and
|
|
203
|
+
limitations under the License.
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";/*!
|
|
2
|
-
* sense-annotation v1.8.0
|
|
2
|
+
* sense-annotation v1.8.0
|
|
3
3
|
* (c) 2020-2022
|
|
4
4
|
* Released under the Apache-2.0 License.
|
|
5
|
-
*/Object.defineProperty(exports,"__esModule",{value:!0});var turf=require("@turf/turf"),_=require("lodash"),lbUtils=require("@labelbee/lb-utils"),rgba=require("color-rgba");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var ___default=_interopDefaultLegacy(_),rgba__default=_interopDefaultLegacy(rgba);const editStepWidth=320;var EPointCloudName;(function(r){r.PointCloud="pointCloudTool"})(EPointCloudName||(EPointCloudName={}));var EVideoToolName;(function(r){r.VideoTextTool="videoTextTool",r.VideoTagTool="videoTagTool",r.VideoClipTool="videoClipTool"})(EVideoToolName||(EVideoToolName={}));var EToolType;(function(r){r[r.Rect=0]="Rect",r[r.Tag=1]="Tag"})(EToolType||(EToolType={}));var EToolName;(function(r){r.Rect="rectTool",r.Tag="tagTool",r.Point="pointTool",r.PointMarker="pointMarkerTool",r.Segmentation="segmentationTool",r.Filter="filterTool",r.Text="textTool",r.Polygon="polygonTool",r.Line="lineTool",r.LineMarker="lineMarkerTool",r.Empty="emptyTool",r.FolderTag="folderTagTool",r.RectTrack="rectTrackTool",r.Face="faceTool",r.ClientAttribute="clientAttributeTool",r.OCRRelation="OCRRelationTool"})(EToolName||(EToolName={}));var ECheckModel;(function(r){r.Check="check"})(ECheckModel||(ECheckModel={}));var ERectPattern;(function(r){r[r.nothing=0]="nothing",r[r.RectBG=1]="RectBG",r[r.showOrder=2]="showOrder"})(ERectPattern||(ERectPattern={}));const TOOL_NAME={[EToolName.Rect]:"\u62C9\u6846",[EToolName.Tag]:"\u6807\u7B7E",[EToolName.Point]:"\u6807\u70B9",[EToolName.PointMarker]:"\u5217\u8868\u6807\u70B9",[EToolName.Segmentation]:"\u524D\u666F\u5206\u5272",[EToolName.Filter]:"\u7B5B\u9009",[EToolName.Text]:"\u6587\u672C",[EToolName.Polygon]:"\u591A\u8FB9\u5F62",[EToolName.Line]:"\u7EBF\u6761",[EToolName.LineMarker]:"\u5217\u8868\u7EBF\u6761",[EToolName.FolderTag]:"\u6587\u4EF6\u5939\u6807\u7B7E",[EToolName.RectTrack]:"\u62C9\u6846\u8DDF\u8E2A",[EToolName.Face]:"\u4EBA\u8138106\u5DE5\u5177",[EToolName.ClientAttribute]:"\u5BA2\u6237\u7AEF\u5C5E\u6027\u5DE5\u5177",[EToolName.OCRRelation]:"OCR\u5173\u8054\u5173\u7CFB\u5DE5\u5177",[EVideoToolName.VideoTextTool]:"\u89C6\u9891\u6587\u672C",[EVideoToolName.VideoTagTool]:"\u89C6\u9891\u6807\u7B7E",[EVideoToolName.VideoClipTool]:"\u89C6\u9891\u622A\u53D6",[EPointCloudName.PointCloud]:"\u70B9\u4E91"};var EDependPattern;(function(r){r[r.noDepend=1]="noDepend",r[r.dependOrigin=2]="dependOrigin",r[r.dependShape=3]="dependShape",r[r.dependLine=4]="dependLine",r[r.dependPolygon=5]="dependPolygon",r[r.dependPreShape=101]="dependPreShape",r[r.dependPreLine=102]="dependPreLine",r[r.dependPrePolygon=103]="dependPrePolygon"})(EDependPattern||(EDependPattern={}));var EFilterToolOperation;(function(r){r.lc="leftClick",r.rc="rightClick",r.clc="ctrlLeftClick",r.crc="ctrlRightClick"})(EFilterToolOperation||(EFilterToolOperation={}));const OPERATION_LIST={leftClick:"\u9F20\u6807\u5DE6\u952E",rightClick:"\u9F20\u6807\u53F3\u952E",ctrlLeftClick:"ctrl + \u9F20\u6807\u5DE6\u952E",ctrlRightClick:"ctrl + \u9F20\u6807\u53F3\u952E"};var EAnnotationMode;(function(r){r[r.Normal=1]="Normal",r[r.Modify=2]="Modify"})(EAnnotationMode||(EAnnotationMode={}));var ELineTypes;(function(r){r[r.Line=0]="Line",r[r.Curve=1]="Curve"})(ELineTypes||(ELineTypes={}));var ELineColor;(function(r){r[r.SingleColor=0]="SingleColor",r[r.MultiColor=1]="MultiColor"})(ELineColor||(ELineColor={}));var ESelectedType;(function(r){r[r.Form=1]="Form",r[r.Json=2]="Json"})(ESelectedType||(ESelectedType={}));var EDragTarget$1;(function(r){r[r.Point=0]="Point",r[r.Line=1]="Line",r[r.Plane=2]="Plane"})(EDragTarget$1||(EDragTarget$1={}));var EDrawPointPattern;(function(r){r[r.None=0]="None",r[r.Drawing=1]="Drawing",r[r.Edit=2]="Edit"})(EDrawPointPattern||(EDrawPointPattern={}));var EPageOperator$1;(function(r){r[r.Backward=0]="Backward",r[r.Forward=1]="Forward",r[r.JumpSkip=2]="JumpSkip",r[r.None=3]="None"})(EPageOperator$1||(EPageOperator$1={}));var EAuditStatus;(function(r){r[r.Wait=0]="Wait",r[r.Pass=1]="Pass",r[r.Fail=2]="Fail",r[r.Loading=3]="Loading"})(EAuditStatus||(EAuditStatus={}));var ETextType;(function(r){r[r.AnyString=0]="AnyString",r[r.Order=1]="Order",r[r.EnglishOnly=2]="EnglishOnly",r[r.NumberOnly=3]="NumberOnly",r[r.CustomFormat=4]="CustomFormat"})(ETextType||(ETextType={}));const TEXT_TYPE={0:"\u4EFB\u610F\u5B57\u7B26",1:"\u5E8F\u53F7",2:"\u4EC5\u82F1\u6587",3:"\u4EC5\u6570\u5B57"},TEXT_ATTRIBUTE_MAX_LENGTH=1e3,TEXT_ATTRIBUTE_LINE_HEIGHT=16,DEFAULT_TEXT_MAX_WIDTH=300,DEFAULT_FONT="normal normal 500 14px Arial";var EThumbnailOption;(function(r){r[r.ImgList=1e3]="ImgList",r[r.TrackPrediction=1001]="TrackPrediction",r[r.ImgSearch=1002]="ImgSearch"})(EThumbnailOption||(EThumbnailOption={}));const CLIENT_TOOL_HEAD_TYPE={[EPointCloudName.PointCloud]:"sensebeepc",[EToolName.ClientAttribute]:"sensebeepc-EnumAttributeTool",[EToolName.Face]:"sensebeepc-FacePointsLabellingTool",[EToolName.OCRRelation]:"sensebeepc-OCRRelationTool"},CLIENT_TOOL_NAME={[EPointCloudName.PointCloud]:"\u70B9\u4E91\u5BA2\u6237\u7AEF",[EToolName.ClientAttribute]:"\u5BA2\u6237\u7AEF\u5C5E\u6027\u5DE5\u5177",[EToolName.Face]:"\u4EBA\u8138106\u70B9\u5DE5\u5177",[EToolName.OCRRelation]:"OCR\u5173\u8054\u5173\u7CFB\u5DE5\u5177"},SEGMENT_NUMBER$2=16,edgeAdsorptionScope=10;var EPolygonPattern;(function(r){r[r.Normal=0]="Normal",r[r.Rect=1]="Rect"})(EPolygonPattern||(EPolygonPattern={}));var tool=Object.freeze({__proto__:null,editStepWidth,get EPointCloudName(){return EPointCloudName},get EVideoToolName(){return EVideoToolName},get EToolType(){return EToolType},get EToolName(){return EToolName},get ECheckModel(){return ECheckModel},get ERectPattern(){return ERectPattern},TOOL_NAME,get EDependPattern(){return EDependPattern},get EFilterToolOperation(){return EFilterToolOperation},OPERATION_LIST,get EAnnotationMode(){return EAnnotationMode},get ELineTypes(){return ELineTypes},get ELineColor(){return ELineColor},get ESelectedType(){return ESelectedType},get EDragTarget(){return EDragTarget$1},get EDrawPointPattern(){return EDrawPointPattern},get EPageOperator(){return EPageOperator$1},get EAuditStatus(){return EAuditStatus},get ETextType(){return ETextType},TEXT_TYPE,TEXT_ATTRIBUTE_MAX_LENGTH,TEXT_ATTRIBUTE_LINE_HEIGHT,DEFAULT_TEXT_MAX_WIDTH,DEFAULT_FONT,get EThumbnailOption(){return EThumbnailOption},CLIENT_TOOL_HEAD_TYPE,CLIENT_TOOL_NAME,SEGMENT_NUMBER:SEGMENT_NUMBER$2,edgeAdsorptionScope,get EPolygonPattern(){return EPolygonPattern}}),__defProp$g=Object.defineProperty,__defProps$d=Object.defineProperties,__getOwnPropDescs$d=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$g=Object.getOwnPropertySymbols,__hasOwnProp$g=Object.prototype.hasOwnProperty,__propIsEnum$g=Object.prototype.propertyIsEnumerable,__defNormalProp$g=(r,t,e)=>t in r?__defProp$g(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,__spreadValues$g=(r,t)=>{for(var e in t||(t={}))__hasOwnProp$g.call(t,e)&&__defNormalProp$g(r,e,t[e]);if(__getOwnPropSymbols$g)for(var e of __getOwnPropSymbols$g(t))__propIsEnum$g.call(t,e)&&__defNormalProp$g(r,e,t[e]);return r},__spreadProps$d=(r,t)=>__defProps$d(r,__getOwnPropDescs$d(t));function createSmoothCurvePoints(r,t
|
|
5
|
+
*/Object.defineProperty(exports,"__esModule",{value:!0});var turf=require("@turf/turf"),_=require("lodash"),lbUtils=require("@labelbee/lb-utils"),rgba=require("color-rgba");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var ___default=_interopDefaultLegacy(_),rgba__default=_interopDefaultLegacy(rgba);const editStepWidth=320;var EPointCloudName;(function(r){r.PointCloud="pointCloudTool"})(EPointCloudName||(EPointCloudName={}));var EVideoToolName;(function(r){r.VideoTextTool="videoTextTool",r.VideoTagTool="videoTagTool",r.VideoClipTool="videoClipTool"})(EVideoToolName||(EVideoToolName={}));var EToolType;(function(r){r[r.Rect=0]="Rect",r[r.Tag=1]="Tag"})(EToolType||(EToolType={}));var EToolName;(function(r){r.Rect="rectTool",r.Tag="tagTool",r.Point="pointTool",r.PointMarker="pointMarkerTool",r.Segmentation="segmentationTool",r.Filter="filterTool",r.Text="textTool",r.Polygon="polygonTool",r.Line="lineTool",r.LineMarker="lineMarkerTool",r.Empty="emptyTool",r.FolderTag="folderTagTool",r.RectTrack="rectTrackTool",r.Face="faceTool",r.ClientAttribute="clientAttributeTool",r.OCRRelation="OCRRelationTool"})(EToolName||(EToolName={}));var ECheckModel;(function(r){r.Check="check"})(ECheckModel||(ECheckModel={}));var ERectPattern;(function(r){r[r.nothing=0]="nothing",r[r.RectBG=1]="RectBG",r[r.showOrder=2]="showOrder"})(ERectPattern||(ERectPattern={}));const TOOL_NAME={[EToolName.Rect]:"\u62C9\u6846",[EToolName.Tag]:"\u6807\u7B7E",[EToolName.Point]:"\u6807\u70B9",[EToolName.PointMarker]:"\u5217\u8868\u6807\u70B9",[EToolName.Segmentation]:"\u524D\u666F\u5206\u5272",[EToolName.Filter]:"\u7B5B\u9009",[EToolName.Text]:"\u6587\u672C",[EToolName.Polygon]:"\u591A\u8FB9\u5F62",[EToolName.Line]:"\u7EBF\u6761",[EToolName.LineMarker]:"\u5217\u8868\u7EBF\u6761",[EToolName.FolderTag]:"\u6587\u4EF6\u5939\u6807\u7B7E",[EToolName.RectTrack]:"\u62C9\u6846\u8DDF\u8E2A",[EToolName.Face]:"\u4EBA\u8138106\u5DE5\u5177",[EToolName.ClientAttribute]:"\u5BA2\u6237\u7AEF\u5C5E\u6027\u5DE5\u5177",[EToolName.OCRRelation]:"OCR\u5173\u8054\u5173\u7CFB\u5DE5\u5177",[EVideoToolName.VideoTextTool]:"\u89C6\u9891\u6587\u672C",[EVideoToolName.VideoTagTool]:"\u89C6\u9891\u6807\u7B7E",[EVideoToolName.VideoClipTool]:"\u89C6\u9891\u622A\u53D6",[EPointCloudName.PointCloud]:"\u70B9\u4E91"};var EDependPattern;(function(r){r[r.noDepend=1]="noDepend",r[r.dependOrigin=2]="dependOrigin",r[r.dependShape=3]="dependShape",r[r.dependLine=4]="dependLine",r[r.dependPolygon=5]="dependPolygon",r[r.dependPreShape=101]="dependPreShape",r[r.dependPreLine=102]="dependPreLine",r[r.dependPrePolygon=103]="dependPrePolygon"})(EDependPattern||(EDependPattern={}));var EFilterToolOperation;(function(r){r.lc="leftClick",r.rc="rightClick",r.clc="ctrlLeftClick",r.crc="ctrlRightClick"})(EFilterToolOperation||(EFilterToolOperation={}));const OPERATION_LIST={leftClick:"\u9F20\u6807\u5DE6\u952E",rightClick:"\u9F20\u6807\u53F3\u952E",ctrlLeftClick:"ctrl + \u9F20\u6807\u5DE6\u952E",ctrlRightClick:"ctrl + \u9F20\u6807\u53F3\u952E"};var EAnnotationMode;(function(r){r[r.Normal=1]="Normal",r[r.Modify=2]="Modify"})(EAnnotationMode||(EAnnotationMode={}));var ELineTypes;(function(r){r[r.Line=0]="Line",r[r.Curve=1]="Curve"})(ELineTypes||(ELineTypes={}));var ELineColor;(function(r){r[r.SingleColor=0]="SingleColor",r[r.MultiColor=1]="MultiColor"})(ELineColor||(ELineColor={}));var ESelectedType;(function(r){r[r.Form=1]="Form",r[r.Json=2]="Json"})(ESelectedType||(ESelectedType={}));var EDragTarget$1;(function(r){r[r.Point=0]="Point",r[r.Line=1]="Line",r[r.Plane=2]="Plane"})(EDragTarget$1||(EDragTarget$1={}));var EDrawPointPattern;(function(r){r[r.None=0]="None",r[r.Drawing=1]="Drawing",r[r.Edit=2]="Edit"})(EDrawPointPattern||(EDrawPointPattern={}));var EPageOperator$1;(function(r){r[r.Backward=0]="Backward",r[r.Forward=1]="Forward",r[r.JumpSkip=2]="JumpSkip",r[r.None=3]="None"})(EPageOperator$1||(EPageOperator$1={}));var EAuditStatus;(function(r){r[r.Wait=0]="Wait",r[r.Pass=1]="Pass",r[r.Fail=2]="Fail",r[r.Loading=3]="Loading"})(EAuditStatus||(EAuditStatus={}));var ETextType;(function(r){r[r.AnyString=0]="AnyString",r[r.Order=1]="Order",r[r.EnglishOnly=2]="EnglishOnly",r[r.NumberOnly=3]="NumberOnly",r[r.CustomFormat=4]="CustomFormat"})(ETextType||(ETextType={}));const TEXT_TYPE={0:"\u4EFB\u610F\u5B57\u7B26",1:"\u5E8F\u53F7",2:"\u4EC5\u82F1\u6587",3:"\u4EC5\u6570\u5B57"},TEXT_ATTRIBUTE_MAX_LENGTH=1e3,TEXT_ATTRIBUTE_LINE_HEIGHT=16,DEFAULT_TEXT_MAX_WIDTH=300,DEFAULT_FONT="normal normal 500 14px Arial";var EThumbnailOption;(function(r){r[r.ImgList=1e3]="ImgList",r[r.TrackPrediction=1001]="TrackPrediction",r[r.ImgSearch=1002]="ImgSearch"})(EThumbnailOption||(EThumbnailOption={}));const CLIENT_TOOL_HEAD_TYPE={[EPointCloudName.PointCloud]:"sensebeepc",[EToolName.ClientAttribute]:"sensebeepc-EnumAttributeTool",[EToolName.Face]:"sensebeepc-FacePointsLabellingTool",[EToolName.OCRRelation]:"sensebeepc-OCRRelationTool"},CLIENT_TOOL_NAME={[EPointCloudName.PointCloud]:"\u70B9\u4E91\u5BA2\u6237\u7AEF",[EToolName.ClientAttribute]:"\u5BA2\u6237\u7AEF\u5C5E\u6027\u5DE5\u5177",[EToolName.Face]:"\u4EBA\u8138106\u70B9\u5DE5\u5177",[EToolName.OCRRelation]:"OCR\u5173\u8054\u5173\u7CFB\u5DE5\u5177"},SEGMENT_NUMBER$2=16,edgeAdsorptionScope=10;var EPolygonPattern;(function(r){r[r.Normal=0]="Normal",r[r.Rect=1]="Rect"})(EPolygonPattern||(EPolygonPattern={}));var tool=Object.freeze({__proto__:null,editStepWidth,get EPointCloudName(){return EPointCloudName},get EVideoToolName(){return EVideoToolName},get EToolType(){return EToolType},get EToolName(){return EToolName},get ECheckModel(){return ECheckModel},get ERectPattern(){return ERectPattern},TOOL_NAME,get EDependPattern(){return EDependPattern},get EFilterToolOperation(){return EFilterToolOperation},OPERATION_LIST,get EAnnotationMode(){return EAnnotationMode},get ELineTypes(){return ELineTypes},get ELineColor(){return ELineColor},get ESelectedType(){return ESelectedType},get EDragTarget(){return EDragTarget$1},get EDrawPointPattern(){return EDrawPointPattern},get EPageOperator(){return EPageOperator$1},get EAuditStatus(){return EAuditStatus},get ETextType(){return ETextType},TEXT_TYPE,TEXT_ATTRIBUTE_MAX_LENGTH,TEXT_ATTRIBUTE_LINE_HEIGHT,DEFAULT_TEXT_MAX_WIDTH,DEFAULT_FONT,get EThumbnailOption(){return EThumbnailOption},CLIENT_TOOL_HEAD_TYPE,CLIENT_TOOL_NAME,SEGMENT_NUMBER:SEGMENT_NUMBER$2,edgeAdsorptionScope,get EPolygonPattern(){return EPolygonPattern}}),__defProp$g=Object.defineProperty,__defProps$d=Object.defineProperties,__getOwnPropDescs$d=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$g=Object.getOwnPropertySymbols,__hasOwnProp$g=Object.prototype.hasOwnProperty,__propIsEnum$g=Object.prototype.propertyIsEnumerable,__defNormalProp$g=(r,t,e)=>t in r?__defProp$g(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,__spreadValues$g=(r,t)=>{for(var e in t||(t={}))__hasOwnProp$g.call(t,e)&&__defNormalProp$g(r,e,t[e]);if(__getOwnPropSymbols$g)for(var e of __getOwnPropSymbols$g(t))__propIsEnum$g.call(t,e)&&__defNormalProp$g(r,e,t[e]);return r},__spreadProps$d=(r,t)=>__defProps$d(r,__getOwnPropDescs$d(t));function createSmoothCurvePoints(r,t,e,i=16){if(r.length<4)return r;const s=[],n=r.slice(0);let o,a,l,h,c,u,d,g,v,f,b,p,x;for(e?(n.unshift(r[r.length-1]),n.unshift(r[r.length-2]),n.unshift(r[r.length-1]),n.unshift(r[r.length-2]),n.push(r[0]),n.push(r[1])):(n.unshift(r[1]),n.unshift(r[0]),n.push(r[r.length-2]),n.push(r[r.length-1])),x=2;x<n.length-4;x+=2)for(l=(n[x+2]-n[x-2])*t,h=(n[x+4]-n[x-0])*t,c=(n[x+3]-n[x-1])*t,u=(n[x+5]-n[x+1])*t,p=0;p<=i;p++)b=p/i,d=2*Math.pow(b,3)-3*Math.pow(b,2)+1,g=-(2*Math.pow(b,3))+3*Math.pow(b,2),v=Math.pow(b,3)-2*Math.pow(b,2)+b,f=Math.pow(b,3)-Math.pow(b,2),o=d*n[x]+g*n[x+2]+v*l+f*h,a=d*n[x+1]+g*n[x+3]+v*c+f*u,s.push(o),s.push(a);const y=[];for(let m=0;m<s.length-1;m+=2)y.push({x:s[m],y:s[m+1]});if(e)for(let m=0;m<i+1;m++){const I=y.shift();y.push(I)}return y}const createSmoothCurvePointsFromPointList=(r,t=16)=>createSmoothCurvePoints(r.reduce((e,i)=>[...e,i.x,i.y],[]),.5,!1,t);function isInPolygon(r,t,e=ELineTypes.Line){let i=0,s,n,o,a;t=[...t],e===ELineTypes.Curve&&(t=createSmoothCurvePoints(t.reduce((h,c)=>[...h,c.x,c.y],[]),.5,!0,SEGMENT_NUMBER$2)),[o]=t;const l=t.length;for(s=1;s<=l;s++)a=t[s%l],r.x>Math.min(o.x,a.x)&&r.x<=Math.max(o.x,a.x)&&r.y<=Math.max(o.y,a.y)&&o.x!==a.x&&(n=(r.x-o.x)*(a.y-o.y)/(a.x-o.x)+o.y,(o.y===a.y||r.y<=n)&&i++),o=a;return i%2!=0}function getPolygonPointUnderZoom(r,t=1){return r.map(e=>__spreadProps$d(__spreadValues$g({},e),{x:e.x*t,y:e.y*t}))}var __pow$1=Math.pow;class Vector{static add(t,e){return{x:t.x+e.x,y:t.y+e.y}}static getVector(t,e){return{x:e.x-t.x,y:e.y-t.y}}static len(t){return Math.sqrt(__pow$1(t.x,2)+__pow$1(t.y,2))}static dotProduct(t,e){return t.x*e.x+t.y+e.y}}class Trigonometric{static tanAPlusB(t,e){return(t+e)/(1-t*e)}static sinAPlusB(t,e,i,s){return s*t+e*i}static cosAPlusB(t,e,i,s){return e*s-t*i}}const _MathUtils=class{static getRotate(r){return r+90>=360?r+90-360:r+90}static getLineLength(r,t){return Math.sqrt(Math.pow(t.y-r.y,2)+Math.pow(t.x-r.x,2))}static getTextArea(r,t,e=DEFAULT_TEXT_MAX_WIDTH,i=DEFAULT_FONT,s){if(typeof t!="string")return{width:0,height:0};const n=r.getContext("2d");n.font=i;let o=0;typeof s=="undefined"&&(s=r&&parseInt(window.getComputedStyle(r).lineHeight,10)||parseInt(window.getComputedStyle(document.body).lineHeight,10));const a=r&&parseInt(window.getComputedStyle(r).fontSize,10)||parseInt(window.getComputedStyle(document.body).fontSize,10)||0,l=t.split(`
|
|
6
6
|
`);let h=0;for(let c=0;c<l.length;c++){const u=l[c].split("");let d="";for(let g=0;g<u.length;g++){const v=d+u[g],b=n.measureText(v).width;b>e&&g>0?(d=u[g],o+=s,h=e):(d=v,b>h&&(h=b))}c!==l.length-1&&(o+=s)}return{width:h,height:o+a,lineHeight:s,fontHeight:a}}static getLineCenterPoint(r){const[t,e]=r,i=Vector.getVector(t,e);return{x:t.x+i.x/2,y:t.y+i.y/2}}static getPerpendicularLine(r){if(r.length!==2)return;const[t,e]=r,i={x:e.x+e.y-t.y,y:e.y-(e.x-t.x)};return[e,i]}static getPerpendicularFootOfLine(r,t){if(r.length!==2)return r;const e=this.getPerpendicularLine(r);if(!e)return r;const[i,s]=e;return this.getFootOfPerpendicular(t,i,s).footPoint}static getQuadrangleFromTriangle(r){if(r.length!==3)return r;const[t,e,i]=r,s={x:i.x+t.x-e.x,y:i.y+t.y-e.y};return[t,e,i,s]}static getRectPerpendicularOffset(r,t,e){const[i,s]=e,n=this.getFootOfPerpendicular(r,i,s).footPoint,o=this.getFootOfPerpendicular(t,i,s).footPoint,a={x:n.x-o.x,y:n.y-o.y},l=Vector.add(t,a);return Vector.getVector(r,l)}static getArrayIndex(r,t){return r<0?t+r:r>=t?r-t:r}static getPointListFromPointOffset(r,t,e){const i=this.getArrayIndex(t-1,r.length),s=this.getArrayIndex(t+1,r.length),n=this.getArrayIndex(t-2,r.length),o=[...r];o[t]=Vector.add(o[t],e);const a=this.getFootOfPerpendicular(o[t],o[n],o[i]).footPoint,l=this.getFootOfPerpendicular(o[t],o[s],o[n]).footPoint;return o[i]=a,o[s]=l,o}static getRectCenterPoint(r){const[t,,e]=r;return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}static rotateRectPointList(r=5,t){const e=this.getRectCenterPoint(t),{PI:i}=Math,s=Math.sin(r*i/180),n=Math.cos(r*i/180);return t.map(o=>{const a=Vector.getVector(e,o),l=Vector.len(a),h=a.y/l,c=a.x/l;return{x:l*Trigonometric.cosAPlusB(h,c,s,n)+e.x,y:l*Trigonometric.sinAPlusB(h,c,s,n)+e.y}})}static getRectangleByRightAngle(r,t){if(t.length!==2)return t;const e=_MathUtils.getPerpendicularFootOfLine(t,r);return _MathUtils.getQuadrangleFromTriangle([...t,e])}};let MathUtils=_MathUtils;MathUtils.isInRange=(r,t)=>{const e=Math.min(...t),i=Math.max(...t),s=o=>o<=i&&o>=e;return(Array.isArray(r)?r:[r]).every(o=>s(o))},MathUtils.withinRange=(r,t)=>{const e=Math.min(...t),i=Math.max(...t);return r>i?i:r<e?e:r},MathUtils.calcViewportBoundaries=(r,t=!1,e=SEGMENT_NUMBER$2,i=1)=>{if(!r)return{top:0,bottom:0,left:0,right:0};const s=20/i,n=[],o=[];let a=r;t&&(a=createSmoothCurvePointsFromPointList(r,e)),a.forEach(({x:v,y:f})=>{n.push(v),o.push(f)});let l=Math.min(...n),h=Math.max(...n),c=Math.min(...o),u=Math.max(...o);const d=h-l,g=u-c;if(d<s){const v=(s-d)/2;l-=v,h+=v}if(g<s){const v=(s-g)/2;c-=v,u+=v}return{top:c,bottom:u,left:l,right:h}},MathUtils.getFootOfPerpendicular=(r,t,e,i=!1)=>{let s={x:0,y:0};const n=t.x-e.x,o=t.y-e.y;if(Math.abs(n)<1e-8&&Math.abs(o)<1e-8)return s=t,s;let a=(r.x-t.x)*(t.x-e.x)+(r.y-t.y)*(t.y-e.y);a/=n*n+o*o,s.x=t.x+a*n,s.y=t.y+a*o;const l=_MathUtils.getLineLength(r,s),h=2,c=Math.min(t.x,e.x),u=Math.max(t.x,e.x),d=Math.min(t.y,e.y),g=Math.max(t.y,e.y),v=!(_MathUtils.isInRange(r.x,[c,u])||_MathUtils.isInRange(r.y,[d,g])),f=r.x>u+h||r.x<c-h||r.y>g+h||r.y<d-h;return(i?v:f)?{footPoint:s,length:Infinity}:{footPoint:s,length:l}};const headerHeight=61,tipsHeight=40,footerHeight=40,sidebarWidth=240;var EStepType;(function(r){r[r.ANNOTATION=1]="ANNOTATION",r[r.QUALITY_INSPECTION=2]="QUALITY_INSPECTION",r[r.PRE_ANNOTATION=3]="PRE_ANNOTATION",r[r.MANUAL_CORRECTION=4]="MANUAL_CORRECTION"})(EStepType||(EStepType={}));const ANNOTATION_MAX_SIZE=1e3;var EPageOperator;(function(r){r[r.Backward=0]="Backward",r[r.Forward=1]="Forward",r[r.JumpSkip=2]="JumpSkip",r[r.None=3]="None"})(EPageOperator||(EPageOperator={}));var EDragStatus;(function(r){r[r.Start=0]="Start",r[r.Stop=1]="Stop",r[r.Wait=2]="Wait",r[r.Move=3]="Move"})(EDragStatus||(EDragStatus={}));var EDragTarget;(function(r){r[r.Point=0]="Point",r[r.Line=1]="Line",r[r.Plane=2]="Plane"})(EDragTarget||(EDragTarget={}));var ESortDirection;(function(r){r[r.ascend=0]="ascend",r[r.descend=1]="descend"})(ESortDirection||(ESortDirection={}));var EGrowthMode;(function(r){r[r.Intelligence=0]="Intelligence",r[r.Linear=1]="Linear"})(EGrowthMode||(EGrowthMode={}));var ELang;(function(r){r.Zh="zh_CN",r.US="en_US"})(ELang||(ELang={}));var ERotateDirection;(function(r){r[r.Clockwise=0]="Clockwise",r[r.Anticlockwise=1]="Anticlockwise"})(ERotateDirection||(ERotateDirection={}));const DEFAULT_TEXT_OFFSET={offsetX:-10,offsetY:-10},DEFAULT_TEXT_SHADOW={shadowColor:"rgba(0,0,0,0.6)",shadowOffsetX:0,shadowOffsetY:2,shadowBlur:4},TEXT_ATTRIBUTE_OFFSET$1={x:8,y:26};var annotation=Object.freeze({__proto__:null,headerHeight,tipsHeight,footerHeight,sidebarWidth,get EStepType(){return EStepType},ANNOTATION_MAX_SIZE,get EPageOperator(){return EPageOperator},get EDragStatus(){return EDragStatus},get EDragTarget(){return EDragTarget},get ESortDirection(){return ESortDirection},get EGrowthMode(){return EGrowthMode},get ELang(){return ELang},get ERotateDirection(){return ERotateDirection},DEFAULT_TEXT_OFFSET,DEFAULT_TEXT_SHADOW,TEXT_ATTRIBUTE_OFFSET:TEXT_ATTRIBUTE_OFFSET$1}),__defProp$f=Object.defineProperty,__defProps$c=Object.defineProperties,__getOwnPropDescs$c=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$f=Object.getOwnPropertySymbols,__hasOwnProp$f=Object.prototype.hasOwnProperty,__propIsEnum$f=Object.prototype.propertyIsEnumerable,__defNormalProp$f=(r,t,e)=>t in r?__defProp$f(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,__spreadValues$f=(r,t)=>{for(var e in t||(t={}))__hasOwnProp$f.call(t,e)&&__defNormalProp$f(r,e,t[e]);if(__getOwnPropSymbols$f)for(var e of __getOwnPropSymbols$f(t))__propIsEnum$f.call(t,e)&&__defNormalProp$f(r,e,t[e]);return r},__spreadProps$c=(r,t)=>__defProps$c(r,__getOwnPropDescs$c(t));class RectUtils{static composeResult(t,e,i,s,n){try{const o=JSON.parse(t),a=CommonToolUtils.getCurrentStepInfo(e,s),{dataSourceStep:l}=a,h=`step_${a.step}`;if(Object.assign(o,n),o[h]){const c=o[h];return c.result?(c.result=i,JSON.stringify(o)):JSON.stringify(__spreadProps$c(__spreadValues$f({},o),{[h]:__spreadProps$c(__spreadValues$f({},o[h]),{result:i})}))}return JSON.stringify(__spreadProps$c(__spreadValues$f({},o),{[h]:{dataSourceStep:l,toolName:a.tool,result:i}}))}catch(o){return t}}static changeCoordinateByRotate(t,e,i){const{x:s,y:n,width:o,height:a}=t,l=AxisUtils.changeCoordinateByRotate({x:s,y:n},e,i);switch(e%360){case 90:return __spreadProps$c(__spreadValues$f({},t),{x:l.x-a,y:l.y,width:a,height:o});case 180:return __spreadProps$c(__spreadValues$f({},t),{x:l.x-o,y:l.y-a});case 270:return __spreadProps$c(__spreadValues$f({},t),{x:l.x,y:l.y-o,width:a,height:o});default:return t}}static translateRect2Points(t){const{x:e,y:i,width:s,height:n}=t;return[{x:e,y:i},{x:e+s,y:i},{x:e+s,y:i+n},{x:e,y:i+n}]}static translatePoints2Rect(t,e){if(t.length!==4)return;const{x:i,y:s}=t[0],n=t[1].x-t[0].x,o=t[2].y-t[1].y;return __spreadProps$c(__spreadValues$f({},e),{x:i,y:s,width:n,height:o})}static getRectPointList(t,e=1){return[{x:t.x*e,y:t.y*e},{x:(t.x+t.width)*e,y:t.y*e},{x:(t.x+t.width)*e,y:(t.y+t.height)*e},{x:t.x*e,y:(t.y+t.height)*e}]}static getRectEdgeList(t,e=1){const i=this.getRectPointList(t,e),s=i.length;return i.map((n,o)=>({begin:n,end:i[(o+1)%s]}))}static isInRect(t,e,i=0,s=1){return t.x>=e.x*s-i&&t.x<=(e.x+e.width)*s+i&&t.y>=e.y*s-i&&t.y<=(e.y+e.height)*s+i}static getRectUnderZoom(t,e=1){const{x:i,y:s,width:n,height:o}=t;return __spreadProps$c(__spreadValues$f({},t),{x:i*e,y:s*e,width:n*e,height:o*e})}static isRectNotInPolygon(t,e){return this.getRectPointList(t).some(s=>!isInPolygon(s,e))}}function uuid(r=8,t=62){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=[];let s;if(t=t||e.length,r)for(s=0;s<r;s++)i[s]=e[0|Math.random()*t];else{let n;for(i[8]=i[13]=i[18]=i[23]="-",i[14]="4",s=0;s<36;s++)i[s]||(n=0|Math.random()*16,i[s]=e[s===19?n&3|8:n])}return i.join("")}var __defProp$e=Object.defineProperty,__getOwnPropSymbols$e=Object.getOwnPropertySymbols,__hasOwnProp$e=Object.prototype.hasOwnProperty,__propIsEnum$e=Object.prototype.propertyIsEnumerable,__defNormalProp$e=(r,t,e)=>t in r?__defProp$e(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,__spreadValues$e=(r,t)=>{for(var e in t||(t={}))__hasOwnProp$e.call(t,e)&&__defNormalProp$e(r,e,t[e]);if(__getOwnPropSymbols$e)for(var e of __getOwnPropSymbols$e(t))__propIsEnum$e.call(t,e)&&__defNormalProp$e(r,e,t[e]);return r};class TagUtil{static getTagKeyName(t,e){var i,s;if(!!e)return(s=(i=e.find(n=>n.value===t))==null?void 0:i.key)!=null?s:""}static getTagName([t="",e=""],i){if(!!i){for(const s of i)if(s.value===t){if(!s.subSelected)return console.error("\u6807\u7B7E\u89E3\u6790\u9519\u8BEF",t,e),"";for(const n of s.subSelected)if(n.value===e)return n.key}}}static getTagNameList(t,e){return Object.keys(t).length<=0?[]:Object.entries(t).reduce((i,s)=>{const[n,o]=s;if(o&&o.length>0){const a=o.split(";"),l={keyName:this.getTagKeyName(n,e),value:a.map(h=>this.getTagName([n,h],e))};return[...i,l]}return i},[]).filter(i=>i)}static getTagnameListWithoutConfig(t){return Object.keys(t).length<=0?[]:Object.entries(t).reduce((e,i)=>{const[s,n]=i,o=n.split(";"),a={keyName:s,value:o};return[...e,a]},[]).filter(e=>e)}static judgeResultIsInInputList(t,e,i){return!t||!e||!i?!1:i.filter(n=>{if(n.value===t&&n.subSelected){const o=e==null?void 0:e.split(";");return(n==null?void 0:n.subSelected.filter(a=>o.indexOf(a.value)>-1).length)>0}return!1}).length>0}static getDefaultResultByConfig(t){return t.reduce((e,i)=>(i.subSelected&&i.subSelected.forEach(s=>{var n;if(s.isDefault){const o=(n=e[i.value])!=null?n:"";let a=[];o.length>0&&(a=o.split(";")),a.push(s.value),e[i.value]=a.join(";")}}),e),{})}static getDefaultTagResult(t,e){const i=this.getDefaultResultByConfig(t);return e.length>0?e.map(s=>({id:uuid(),sourceID:s.id,result:__spreadValues$e({},i)})):[{id:uuid(),sourceID:"",result:__spreadValues$e({},i)}]}}var canvasEdit0='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#ccc"/></g></g></svg>',canvasEdit1='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#ff2323"/></g></g></svg>',canvasEdit2='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#ffe232"/></g></g></svg>',canvasEdit3='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#01ff30"/></g></g></svg>',canvasEdit4='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#00ffea"/></g></g></svg>',canvasEdit5='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#0282fa"/></g></g></svg>',canvasEdit6='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#800cf9"/></g></g></svg>',canvasEdit7='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#ff88f7"/></g></g></svg>',canvasEdit8='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#994217"/></g></g></svg>',baseEditLan='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#1f0bf9"/></g></g></svg>',baseEditQing='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#3fe"/></g></g></svg>',baseEditLv='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#33fe33"/></g></g></svg>',baseEditHuang='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#fdff37"/></g></g></svg>',baseEditFen='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#f70efa"/></g></g></svg>',INVALID_ICON='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#f33"/></g></g></svg>';const NULL_ICON=canvasEdit0,HEADER_HEIGHT=61,TAB_HEIGHT=80,SEARCH_HEIGHT=62,PADDING=20,TABLE_ROW_HEIGHT=55,PAGINATION_HEIGHT=55,TIPS_HEIGHT=40,FOOTER_HEIGHT=80,SIDERBAR_WIDTH=240,EDIT_STEP_WIDTH=320,THEME_COLOR="rgba(102, 111, 255, 1)",COLORS_ARRAY=["rgba(128, 12, 249, 1)","rgba(0, 255, 48, 1)","rgba(255, 136, 247, 1)","rgba(255, 226, 50, 1)","rgba(153, 66, 23, 1)","rgba(2, 130, 250, 1)","rgba(255, 35, 35, 1)","rgba(0, 255, 234, 1)"],ICON_ARRAY=[canvasEdit0,canvasEdit6,canvasEdit3,canvasEdit7,canvasEdit2,canvasEdit8,canvasEdit5,canvasEdit1,canvasEdit4],BASE_ICON={1:baseEditLan,3:baseEditQing,5:baseEditLv,7:baseEditHuang,9:baseEditFen},INVALID_COLOR="rgba(255, 51, 51, 1)",NULL_COLOR="rgba(204, 204, 204, 1)",FILTER_TOOL_COLOR={[EFilterToolOperation.lc]:"rgba(153, 51, 255, 1)",[EFilterToolOperation.rc]:"rgba(51, 153, 255, 1)",[EFilterToolOperation.clc]:"rgba(46, 230, 46, 1)",[EFilterToolOperation.crc]:"rgba(255, 51, 51, 1)"};var style=Object.freeze({__proto__:null,HEADER_HEIGHT,TAB_HEIGHT,SEARCH_HEIGHT,PADDING,TABLE_ROW_HEIGHT,PAGINATION_HEIGHT,TIPS_HEIGHT,FOOTER_HEIGHT,SIDERBAR_WIDTH,EDIT_STEP_WIDTH,THEME_COLOR,COLORS_ARRAY,ICON_ARRAY,BASE_ICON,INVALID_COLOR,NULL_COLOR,NULL_ICON,INVALID_ICON,FILTER_TOOL_COLOR}),EMessage;(function(r){r.NoRotateNotice="noRotateNotice",r.RectErrorSizeNotice="rectErrorSizeNotice",r.TextCheckNumberErrorNotice="textCheckNumberErrorNotice",r.TextCheckEnglishErrorNotice="textCheckEnglishErrorNotice",r.TextCheckCustomErrorNotice="textCheckCustomErrorNotice",r.UpperLimitErrorNotice="UpperLimitErrorNotice",r.LowerLimitErrorNotice="LowerLimitErrorNotice",r.InvalidImage="InvalidImage",r.DisableDelete="DisableDelete",r.ClearPartialData="ClearPartialData",r.MarkerFinish="MarkerFinish",r.LowerLimitPoint="LowerLimitPoint",r.NoRotateInDependence="noRotateInDependence",r.UnableToReannotation="unableToReannotation",r.ForbiddenCreationOutsideBoundary="ForbiddenCreationOutsideBoundary",r.SuccessfulEdgeAdsorption="SuccessfulEdgeAdsorption"})(EMessage||(EMessage={}));const message$1={[EMessage.NoRotateNotice]:"This Image contains data and cannot be rotated",[EMessage.RectErrorSizeNotice]:"The drawing frame size is smaller than the minimum drawing size",[EMessage.TextCheckNumberErrorNotice]:"Please enter in number-only format",[EMessage.TextCheckEnglishErrorNotice]:"Please enter in English only format",[EMessage.TextCheckCustomErrorNotice]:"Please enter in the required format",[EMessage.UpperLimitErrorNotice]:"The number of vertices is not more than",[EMessage.LowerLimitErrorNotice]:"The number of vertices is not less than",[EMessage.InvalidImage]:"Invalid image, please skip this image",[EMessage.DisableDelete]:"Disable delete",[EMessage.ClearPartialData]:"Clear partial data",[EMessage.MarkerFinish]:"ListAnnotation is finished",[EMessage.LowerLimitPoint]:"The maximum number of points has been reached",[EMessage.NoRotateInDependence]:"Disallow rotation in dependent cases",[EMessage.UnableToReannotation]:"Unabled to reannotation",[EMessage.ForbiddenCreationOutsideBoundary]:"Fobid creation outside boundary",[EMessage.SuccessfulEdgeAdsorption]:"Successful edge adsorption"},message={[EMessage.NoRotateNotice]:"\u672C\u56FE\u542B\u6709\u6570\u636E\uFF0C\u65E0\u6CD5\u8FDB\u884C\u65CB\u8F6C",[EMessage.RectErrorSizeNotice]:"\u7ED8\u5236\u6846\u5C3A\u5BF8\u5C0F\u4E8E\u6700\u5C0F\u7ED8\u5236\u5C3A\u5BF8",[EMessage.TextCheckNumberErrorNotice]:"\u8BF7\u6309\u4EC5\u6570\u5B57\u7684\u683C\u5F0F\u8F93\u5165",[EMessage.TextCheckEnglishErrorNotice]:"\u8BF7\u6309\u4EC5\u82F1\u6587\u7684\u683C\u5F0F\u8F93\u5165",[EMessage.TextCheckCustomErrorNotice]:"\u8BF7\u6309\u8981\u6C42\u7684\u683C\u5F0F\u8F93\u5165",[EMessage.UpperLimitErrorNotice]:"\u9876\u70B9\u6570\u4E0D\u591A\u4E8E",[EMessage.LowerLimitErrorNotice]:"\u9876\u70B9\u6570\u4E0D\u5C11\u4E8E",[EMessage.InvalidImage]:"\u65E0\u6548\u56FE\u7247\uFF0C\u8BF7\u8DF3\u8FC7\u6B64\u56FE",[EMessage.DisableDelete]:"\u8BE5\u6570\u636E\u7981\u6B62\u5220\u9664",[EMessage.ClearPartialData]:"\u5B58\u5728\u90E8\u5206\u6570\u636E\u65E0\u6CD5\u6E05\u9664",[EMessage.MarkerFinish]:"\u5217\u8868\u6807\u6CE8\u5DF2\u5B8C\u6210",[EMessage.LowerLimitPoint]:"\u5DF2\u5230\u8FBE\u6807\u70B9\u6570\u91CF\u4E0A\u9650",[EMessage.NoRotateInDependence]:"\u4F9D\u8D56\u60C5\u51B5\u4E0B\u65E0\u6CD5\u8FDB\u884C\u65CB\u8F6C",[EMessage.UnableToReannotation]:"\u65E0\u6CD5\u8FDB\u884C\u7EED\u6807\u64CD\u4F5C",[EMessage.ForbiddenCreationOutsideBoundary]:"\u8FB9\u754C\u5916\u7981\u6B62\u521B\u5EFA",[EMessage.SuccessfulEdgeAdsorption]:"\u8FB9\u7F18\u5438\u9644\u6210\u529F"};class Locale{}Locale.getMessagesByLocale=(r,t)=>{switch(t){case ELang.US:return message$1[r];case ELang.Zh:default:return message[r]}};var __defProp$d=Object.defineProperty,__defProps$b=Object.defineProperties,__getOwnPropDescs$b=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$d=Object.getOwnPropertySymbols,__hasOwnProp$d=Object.prototype.hasOwnProperty,__propIsEnum$d=Object.prototype.propertyIsEnumerable,__defNormalProp$d=(r,t,e)=>t in r?__defProp$d(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,__spreadValues$d=(r,t)=>{for(var e in t||(t={}))__hasOwnProp$d.call(t,e)&&__defNormalProp$d(r,e,t[e]);if(__getOwnPropSymbols$d)for(var e of __getOwnPropSymbols$d(t))__propIsEnum$d.call(t,e)&&__defNormalProp$d(r,e,t[e]);return r},__spreadProps$b=(r,t)=>__defProps$b(r,__getOwnPropDescs$b(t));const REGEXP_NUMBER="^[0-9]+$",REGEXP_ENGLISH="^[A-Za-z]+$";class AttributeUtils{static getAttributeIcon(t,e,i=!0){var s;const n=e.findIndex(l=>l.value===t);let o=(s=ICON_ARRAY[n%ICON_ARRAY.length])!=null?s:NULL_ICON;i||(o=INVALID_ICON),o="";const a=new Image;return a.src=o,a}static checkString(t,e){let i="";switch(t){case ETextType.Order:case ETextType.NumberOnly:i=REGEXP_NUMBER;break;case ETextType.EnglishOnly:i=REGEXP_ENGLISH;break;case ETextType.CustomFormat:i=e;break}return i}static checkTextAttibute(t,e){if(t===void 0||t==="")return!0;try{return new RegExp(e).test(t)}catch(i){return!1}}static getAttributeShowText(t,e=[]){var i,s;try{const n=e.findIndex(o=>o.value===t);return(s=(i=e[n])==null?void 0:i.key)!=null?s:t}catch(n){return t}}static getAttributeIndex(t,e){try{const i=e.findIndex(s=>s.value===t);return i>=8?i%8:i}catch(i){return-1}}static getAttributeColor(t,e){try{const i=this.getAttributeIndex(t,e);return i===-1?NULL_COLOR:COLORS_ARRAY[i%COLORS_ARRAY.length]}catch(i){return NULL_COLOR}}static getTextAttribute(t,e){try{if(e===ETextType.Order){const i=t.map(n=>parseInt(n.textAttribute,10)).filter(n=>_.isNumber(n)&&n<Number.MAX_SAFE_INTEGER&&n>=0);return i.sort((n,o)=>n-o),`${(i.pop()||0)+1}`}return""}catch(i){return""}}static textChange(t,e,i){return i.map(s=>s.id===e?__spreadProps$b(__spreadValues$d({},s),{textAttribute:t}):s)}static getErrorNotice(t,e){switch(t){case ETextType.Order:case ETextType.NumberOnly:return Locale.getMessagesByLocale(EMessage.TextCheckNumberErrorNotice,e);case ETextType.EnglishOnly:return Locale.getMessagesByLocale(EMessage.TextCheckEnglishErrorNotice,e);case ETextType.CustomFormat:return Locale.getMessagesByLocale(EMessage.TextCheckCustomErrorNotice,e);default:return""}}static textAttributeValidate(t,e,i){try{return new RegExp(this.checkString(t,e)).test(i)}catch(s){}}static checkTextAttribute(t,e,i,s){let n=!1;return i.forEach(o=>{(o==null?void 0:o.textAttribute)===void 0||(o==null?void 0:o.textAttribute)===""||(s?o.id===s:!0)&&!this.textAttributeValidate(t,e,o.textAttribute)&&(n=!0)}),!!n}static changeTextAttributeInLog(t,e){return t==null?void 0:t.map(i=>i==null?void 0:i.map(s=>{if((e==null?void 0:e.findIndex(n=>(n==null?void 0:n.id)===(s==null?void 0:s.id)))>-1){const n=e==null?void 0:e.find(o=>(o==null?void 0:o.id)===(s==null?void 0:s.id));return __spreadProps$b(__spreadValues$d({},s),{textAttribute:n==null?void 0:n.textAttribute})}return s}))}static getTextIconSvg(t="",e,i=!1,s){if(i===!0){const n=(e==null?void 0:e.findIndex(o=>(o==null?void 0:o.value)===t))%COLORS_ARRAY.length+1;return ICON_ARRAY[n]}return s}static getAttributeByKeycode(t,e){var i;let s;return MathUtils.isInRange(t,[48,57])&&(s=t-48),MathUtils.isInRange(t,[96,105])&&(s=t-96),s===0?"":s?(i=e[s-1])==null?void 0:i.value:void 0}}class UnitUtils{static deg2rad(t){return t*Math.PI/180}static rad2deg(t){return t*180/Math.PI}}var __defProp$c=Object.defineProperty,__defProps$a=Object.defineProperties,__getOwnPropDescs$a=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$c=Object.getOwnPropertySymbols,__hasOwnProp$c=Object.prototype.hasOwnProperty,__propIsEnum$c=Object.prototype.propertyIsEnumerable,__defNormalProp$c=(r,t,e)=>t in r?__defProp$c(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,__spreadValues$c=(r,t)=>{for(var e in t||(t={}))__hasOwnProp$c.call(t,e)&&__defNormalProp$c(r,e,t[e]);if(__getOwnPropSymbols$c)for(var e of __getOwnPropSymbols$c(t))__propIsEnum$c.call(t,e)&&__defNormalProp$c(r,e,t[e]);return r},__spreadProps$a=(r,t)=>__defProps$a(r,__getOwnPropDescs$a(t));const DEFAULT_ZOOM=1,DEFAULT_CURRENT_POS={x:0,y:0},DEFAULT_ROTATE=0,DEFAULT_COLOR="";class DrawUtils{static drawLine(t,e,i,s={}){const n=t.getContext("2d"),{color:o=DEFAULT_COLOR,thickness:a=1,lineCap:l="round"}=s;n.save(),n.strokeStyle=o,n.lineWidth=a,n.lineCap=l,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(i.x+1,i.y+1),n.stroke(),n.restore()}static drawRect(t,e,i={}){const s=t.getContext("2d"),{color:n=DEFAULT_COLOR,thickness:o=1,lineCap:a="round",hiddenText:l=!1,lineDash:h}=i;if(s.save(),s.strokeStyle=n,s.lineWidth=o,s.lineCap=a,Array.isArray(h)&&s.setLineDash(h),s.fillStyle=n,s.strokeRect(e.x,e.y,e.width,e.height),l===!1){let c="";if(e.attribute&&(c=`${c} ${e.attribute}`),this.drawText(t,{x:e.x,y:e.y-5},c),e.textAttribute){const d=`${~~e.width} * ${~~e.height}`.length*7,g=0,v=Math.max(20,e.width-d);this.drawText(t,{x:e.x,y:e.y+e.height+20+g},e.textAttribute,{textMaxWidth:v})}}s.restore()}static drawRectWithFill(t,e,i={}){const s=t.getContext("2d"),{color:n=DEFAULT_COLOR}=i;s.save(),s.fillStyle=n,s.fillRect(e.x,e.y,e.width,e.height),s.restore()}static drawTagByDom(t,e,i){const s=t;if(!((e==null?void 0:e.length)>0))return;const n=document.createElement("div");return n.innerHTML=e,n.setAttribute("id",i),s==null||s.appendChild(n),n}static drawTag(t,e){var i;const s=t==null?void 0:t.parentNode,n=window.self.document.getElementById("tagToolTag");if(n&&s&&s.contains(n)&&(s==null||s.removeChild(n)),!((e==null?void 0:e.length)>0))return;const o=document.createElement("div");return o.innerHTML=(i=e.reduce((a,l)=>`${a}${l.keyName}: ${l.value.join(" \u3001 ")}
|
|
7
7
|
`,""))!=null?i:"",o.setAttribute("id","tagToolTag"),s==null||s.appendChild(o),o}static drawLineWithPointList(t,e,i={}){if(e.length<2)return;const s=t.getContext("2d"),{color:n=DEFAULT_COLOR,thickness:o=1,lineCap:a="round",lineType:l=ELineTypes.Line,lineDash:h,hoverEdgeIndex:c}=i;s.save(),(()=>{s.strokeStyle=n,s.lineWidth=o,s.lineCap=a,Array.isArray(h)?s.setLineDash(h):s.setLineDash([])})(),l===ELineTypes.Curve?(c!==void 0&&c>-1&&e.push(e[0]),e=PolygonUtils.createSmoothCurvePointsFromPointList([...e],SEGMENT_NUMBER$2),c!==void 0&&c>-1&&(e=e.slice((SEGMENT_NUMBER$2+1)*c,(SEGMENT_NUMBER$2+1)*(c+1)))):c!==void 0&&c>-1&&(e=[...e,e[0]],e=e.slice(c,c+2));const d=[];s.beginPath(),s.moveTo(e[0].x,e[0].y);for(let f=0;f<e.length-1;f++)e[f].specialEdge&&d.push({i1:f,i2:f+1}),s.lineTo(e[f+1].x,e[f+1].y);s.stroke(),s.save(),s.lineWidth=o*.8,s.lineCap="butt",s.strokeStyle="white",s.setLineDash([3,3]),d.forEach(f=>{const b=e[f.i1],p=e[f.i2];s.beginPath(),s.moveTo(b.x,b.y),s.lineTo(p.x,p.y),s.stroke()}),s.restore();const g=4,v=2;return e.forEach(f=>{f.specialPoint&&(this.drawSpecialPoint(t,f,g+v,n),this.drawSpecialPoint(t,f,g,"white"))}),s.restore(),e}static drawCircle(t,e,i,s={}){const n=t.getContext("2d"),{startAngleDeg:o=0,endAngleDeg:a=360,thickness:l=1,color:h=DEFAULT_COLOR,fill:c=DEFAULT_COLOR}=s,u=UnitUtils.deg2rad(o),d=UnitUtils.deg2rad(a);n.save(),n.beginPath(),n.strokeStyle=h,n.fillStyle=c,n.lineWidth=l,n.arc(e.x,e.y,i,u,d,!1),n.stroke(),c&&n.fill(),n.closePath(),n.restore()}static drawCircleWithFill(t,e,i=3,s={}){const n=t.getContext("2d"),{color:o=DEFAULT_COLOR}=s;n.save();const a=UnitUtils.deg2rad(0),l=UnitUtils.deg2rad(360);n.fillStyle=o,n.beginPath(),n.arc(e.x,e.y,i,a,l,!1),n.fill(),n.restore()}static drawSpecialPoint(t,e,i=6,s){const n=t.getContext("2d"),{x:o,y:a}=e;n.save(),n.beginPath(),n.fillStyle=s;const l=i*1.5,h=l*Math.sqrt(3)/2,c=l/2;n.moveTo(o,a-l),n.lineTo(o-h,a+c),n.lineTo(o+h,a+c),n.closePath(),n.fill(),n.restore()}static drawPolygon(t,e,i={}){const{isClose:s=!1,lineType:n=ELineTypes.Line}=i;return s===!0&&(e=[...e,e[0]]),n===ELineTypes.Curve&&(e=PolygonUtils.createSmoothCurvePointsFromPointList([...e])),this.drawLineWithPointList(t,e,__spreadProps$a(__spreadValues$c({},i),{lineType:ELineTypes.Line})),e}static drawPolygonWithFill(t,e,i={}){if(e.length<2)return;const s=t.getContext("2d"),{color:n=DEFAULT_COLOR,lineType:o=ELineTypes.Line}=i;s.save(),s.fillStyle=n,s.beginPath(),o===ELineTypes.Curve&&(e=PolygonUtils.createSmoothCurvePointsFromPointList([...e,e[0]]));const[a,...l]=e;return s.moveTo(a.x,a.y),l.forEach(h=>{s.lineTo(h.x,h.y)}),s.fill(),s.restore(),e}static drawPolygonWithFillAndLine(t,e,i={}){const{strokeColor:s,fillColor:n,thickness:o,lineCap:a,isClose:l,lineType:h}=i,c=this.drawPolygon(t,e,{color:s,thickness:o,lineCap:a,isClose:l,lineType:h});return this.drawPolygonWithFill(t,e,{color:n,lineType:h}),c}static drawPolygonWithKeyPoint(t,e,i={}){const{pointColor:s="white",strokeColor:n}=i,o=this.drawPolygon(t,e,i);return o.forEach(a=>{this.drawCircleWithFill(t,a,4,{color:n}),this.drawCircleWithFill(t,a,3,{color:s})}),o}static drawSelectedPolygonWithFillAndLine(t,e,i={}){const{pointColor:s="white",strokeColor:n}=i,o=this.drawPolygonWithFillAndLine(t,e,i);return o.forEach(a=>{this.drawCircleWithFill(t,a,4,{color:n}),this.drawCircleWithFill(t,a,3,{color:s})}),o}static drawText(t,e,i,s={}){if(!i)return;const n=t.getContext("2d"),{color:o=DEFAULT_COLOR,font:a=DEFAULT_FONT,shadowColor:l="",shadowBlur:h=0,shadowOffsetX:c=0,shadowOffsetY:u=0,textMaxWidth:d=164,offsetX:g=0,offsetY:v=0,textAlign:f="start",lineHeight:b}=s;n.save(),n.textAlign=f,n.fillStyle=o!=null?o:"white",n.font=a,n.shadowColor=l,n.shadowOffsetX=c,n.shadowOffsetY=u,n.shadowBlur=h,this.wrapText(t,`${i}`,e.x+g,e.y+v,d,b),n.restore()}static wrapText(t,e,i,s,n,o){if(typeof e!="string"||typeof i!="number"||typeof s!="number")return;const a=t.getContext("2d");typeof n=="undefined"&&(n=t&&t.width||300),typeof o=="undefined"&&(o=t&&parseInt(window.getComputedStyle(t).lineHeight,10)||parseInt(window.getComputedStyle(document.body).lineHeight,10));const l=e.split(`
|
|
8
8
|
`);for(let h=0;h<l.length;h++){const c=l[h].split("");let u="";for(let d=0;d<c.length;d++){const g=u+c[d],f=a.measureText(g).width;n||(n=300),f>n&&d>0?(a.fillText(u,i,s),u=c[d],s+=o):u=g}a.fillText(u,i,s),s+=o}}static drawArrow(t,e,i,s={}){const{color:n=DEFAULT_COLOR,thickness:o=1,lineCap:a="round",theta:l=30,headLen:h=10}=s,c=Math.atan2(e.y-i.y,e.x-i.x)*180/Math.PI,u=(c+l)*Math.PI/180,d=(c-l)*Math.PI/180,g=h*Math.cos(u),v=h*Math.sin(u),f=h*Math.cos(d),b=h*Math.sin(d);t.save(),t.strokeStyle=n,t.lineWidth=o,t.lineCap=a,t.beginPath(),t.moveTo(i.x+g,i.y+v),t.lineTo(i.x,i.y),t.lineTo(i.x+f,i.y+b),t.stroke(),t.restore()}static drawArrowByCanvas(t,e,i,s={}){const n=t.getContext("2d");this.drawArrow(n,e,i,s)}}DrawUtils.drawImg=(r,t,e={})=>{const i=r.getContext("2d"),{zoom:s=DEFAULT_ZOOM,currentPos:n=DEFAULT_CURRENT_POS,rotate:o=DEFAULT_ROTATE,imgAttribute:a}=e;switch(i.save(),o){case 0:i.translate(n.x,n.y);break;case 90:i.translate(n.x+t.height*s,n.y),i.rotate(90*Math.PI/180);break;case 180:i.translate(n.x+t.width*s,n.y+t.height*s),i.rotate(Math.PI);break;case 270:i.translate(n.x,n.y+t.width*s),i.rotate(270*Math.PI/180);break;default:i.translate(n.x,n.y);break}if(a){const{contrast:l,saturation:h,brightness:c}=a;i.filter=`saturate(${h+100}%) contrast(${l+100}%) brightness(${c+100}%)`}i.drawImage(t,0,0,t.width*s,t.height*s),i.restore()};class StyleUtils{static getStrokeAndFill(t,e=!0,i={}){const{isSelected:s=!1,isHover:n=!1}=i;return s?{stroke:e?t.validSelected.stroke:t.invalidSelected.stroke,fill:e?t.validSelected.fill:t.invalidSelected.fill}:n?{stroke:e?t.validHover.stroke:t.invalidHover.stroke,fill:e?t.validHover.fill:t.invalidHover.fill}:{stroke:e?t.valid.stroke:t.invalid.stroke,fill:e?t.valid.fill:t.invalid.fill}}static getStyle2String(t){if(!!t)return Object.entries(t).reduce((e,i)=>`${e} ${i[0]}: ${i[1]};`,"")}}class CanvasUtils{static getMousePositionOnCanvasFromEvent(t,e){if(e&&t){const i=e.getBoundingClientRect();return{x:t.clientX-i.left,y:t.clientY-i.top}}return null}static getClientRect(t){if(t){const e=t.getBoundingClientRect();return{x:e.left,y:e.top,width:e.width,height:e.height}}return null}static getSize(t){if(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}return null}static inViewPort(t,e){return t?MathUtils.isInRange(t.x,[e.left,e.right])&&MathUtils.isInRange(t.y,[e.top,e.bottom]):!1}}CanvasUtils.getViewPort=(r,t,e)=>{const{width:i,height:s}=r,{x:n,y:o}=t,a=(0-o)/e,l=(0-n)/e,h=a+s/e,c=l+i/e;return{top:a,bottom:h,left:l,right:c}},CanvasUtils.getPixelRatio=r=>{if(!r||!window)return 1;const t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t};const rectToolConfig={showConfirm:!1,skipWhileNoDependencies:!1,drawOutsideTarget:!1,copyBackwardResult:!1,minWidth:1,minHeight:1,isShowOrder:!1,filterData:["valid","invalid"],attributeConfigurable:!1,attributeList:[],textConfigurable:!1,textCheckType:0,customFormat:""},tagToolConfig={showConfirm:!1,skipWhileNoDependencies:!1,inputList:[{key:"\u7C7B\u522B1",value:"class1",isMulti:!1,subSelected:[{key:"\u9009\u98791",value:"option1",isDefault:!1},{key:"\u9009\u98792",value:"option1-2",isDefault:!1}]},{key:"\u7C7B\u522B2",value:"class-AH",isMulti:!0,subSelected:[{key:"\u9009\u98792-1",value:"option2-1",isDefault:!1},{key:"\u9009\u98792-2",value:"option2-2",isDefault:!1},{key:"\u9009\u98792-3",value:"option2-3",isDefault:!1}]},{key:"\u7C7B\u522B3",value:"class-0P",isMulti:!1,subSelected:[{key:"\u9009\u98793-1",value:"option3-1",isMulti:!1},{key:"\u9009\u98793-2",value:"option3-2",isDefault:!1},{key:"\u9009\u98793-3",value:"option3-3",isDefault:!1}]}]},lineToolConfig={lineType:0,lineColor:0,edgeAdsorption:!1,outOfTarget:!0,copyBackwardResult:!1,isShowOrder:!1,attributeConfigurable:!1,attributeList:[{key:"\u7C7B\u522B1",value:"\u7C7B\u522B1"},{key:"\u7C7B\u522Bao",value:"class-ao"},{key:"\u7C7B\u522BM1",value:"class-M1"},{key:"\u7C7B\u522BCm",value:"class-Cm"},{key:"\u7C7B\u522Bc3",value:"class-c3"},{key:"\u7C7B\u522Ba0",value:"class-a0"},{key:"\u7C7B\u522Bu7",value:"class-u7"},{key:"\u7C7B\u522BZb",value:"class-Zb"},{key:"\u7C7B\u522Bzi",value:"class-zi"}],textConfigurable:!1,textCheckType:2,customFormat:"",showConfirm:!1,lowerLimitPointNum:2,upperLimitPointNum:"",preReferenceStep:0,skipWhileNoDependencies:!1,filterData:["valid","invalid"]},textToolConfig={showConfirm:!1,skipWhileNoDependencies:!1,enableTextRecognition:!1,recognitionMode:"general",configList:[{label:"\u6587\u672C",key:"text",required:!1,default:"",maxLength:1e3}],filterData:["valid","invalid"]},polygonConfig={lineType:0,lineColor:0,lowerLimitPointNum:3,edgeAdsorption:!1,drawOutsideTarget:!1,copyBackwardResult:!1,isShowOrder:!1,attributeConfigurable:!1,attributeList:[],textConfigurable:!0,textCheckType:0,customFormat:""},getConfig=r=>r==="lineTool"?lineToolConfig:r==="rectTool"?rectToolConfig:r==="tagTool"?tagToolConfig:r==="textTool"?textToolConfig:r==="polygonTool"?polygonConfig:rectToolConfig,styleDefaultConfig={toolColor:{1:{valid:{stroke:"rgba(0,0,255,0.50)",fill:"rgba(0,0,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(0,15,255,1.00)",fill:"rgba(0,15,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(0,15,255,0.80)",fill:"rgba(0,15,255,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}},3:{valid:{stroke:"rgba(0,255,255,0.50)",fill:"rgba(0,255,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(0,212,255,1.00)",fill:"rgba(0,212,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(0,212,255,0.80)",fill:"rgba(0,212,255,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}},5:{valid:{stroke:"rgba(0,255,0,0.50)",fill:"rgba(0,255,0,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(149,255,1.00)",fill:"rgba(149,255,0,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(149,255,0,0.80)",fill:"rgba(149,255,0,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}},7:{valid:{stroke:"rgba(255,255,0,0.50)",fill:"rgba(255,255,0,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(255,230,102,1.00)",fill:"rgba(255,213,0,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(255,230,102,0.80)",fill:"rgba(255,230,102,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}},9:{valid:{stroke:"rgba(255,0,255,0.50)",fill:"rgba(255,0,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(230,102,255,1.00)",fill:"rgba(213,0,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(230,102,255,0.80)",fill:"rgba(230,102,255,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}}},attributeColor:[{valid:{stroke:"rgba(204,204,204,1.00)",fill:"rgba(204,204,204,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(204,204,204,1.00)",fill:"rgba(204,204,204,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(204,204,204,1.00)",fill:"rgba(204,204,204,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(153,51,255,1.00)",fill:"rgba(153,51,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(153,51,255,1.00)",fill:"rgba(153,51,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(153,51,255,1.00)",fill:"rgba(153,51,255,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(51,254,51,1.00)",fill:"rgba(51,254,51,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(51,254,51,1.00)",fill:"rgba(51,254,51,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(51,254,51,1.00)",fill:"rgba(51,254,51,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(255,51,255,1.00)",fill:"rgba(255,51,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(255,51,255,1.00)",fill:"rgba(255,51,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(255,51,255,1.00)",fill:"rgba(255,51,255,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(204,255,51,1.00)",fill:"rgba(204,255,51,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(204,255,51,1.00)",fill:"rgba(204,255,51,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(204,255,51,1.00)",fill:"rgba(204,255,51,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(51,153,255,1.00)",fill:"rgba(51,153,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(51,153,255,1.00)",fill:"rgba(51,153,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(51,153,255,1.00)",fill:"rgba(51,153,255,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(255,153,51,1.00)",fill:"rgba(255,153,51,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(255,153,51,1.00)",fill:"rgba(255,153,51,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(255,153,51,1.00)",fill:"rgba(255,153,51,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(51,255,238,1.00)",fill:"rgba(51,255,238,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(51,255,238,1.00)",fill:"rgba(51,255,238,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(51,255,238,1.00)",fill:"rgba(51,255,238,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(255,221,51,1.00)",fill:"rgba(255,221,51,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(255,221,51,1.00)",fill:"rgba(255,221,51,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(255,221,51,1.00)",fill:"rgba(255,221,51,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}}],lineColor:{1:"rgba(102, 111, 255, 1 )",3:"rgba(102, 230, 255, 1)",5:"rgba(191, 255, 102, 1)",7:"rgba(255, 230, 102, 1)",9:"rgba(230, 102, 255, 1)"},attributeLineColor:["rgba(204, 204, 204, 1)","rgba(153, 51, 255, 1)","rgba(51, 254, 51, 1)","rgba(255, 51, 255, 1)","rgba(204, 255, 51, 1)","rgba(51, 153, 255, 1)","rgba(255, 153, 51, 1)","rgba(51, 255, 238, 1)","rgba(255, 221, 51, 1)"],color:1,width:2,opacity:9};var __defProp$b=Object.defineProperty,__defProps$9=Object.defineProperties,__getOwnPropDescs$9=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$b=Object.getOwnPropertySymbols,__hasOwnProp$b=Object.prototype.hasOwnProperty,__propIsEnum$b=Object.prototype.propertyIsEnumerable,__defNormalProp$b=(r,t,e)=>t in r?__defProp$b(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,__spreadValues$b=(r,t)=>{for(var e in t||(t={}))__hasOwnProp$b.call(t,e)&&__defNormalProp$b(r,e,t[e]);if(__getOwnPropSymbols$b)for(var e of __getOwnPropSymbols$b(t))__propIsEnum$b.call(t,e)&&__defNormalProp$b(r,e,t[e]);return r},__spreadProps$9=(r,t)=>__defProps$9(r,__getOwnPropDescs$9(t)),EStatus$1;(function(r){r[r.Create=0]="Create",r[r.Active=1]="Active",r[r.Edit=1]="Edit",r[r.None=2]="None"})(EStatus$1||(EStatus$1={}));var EColor;(function(r){r.ActiveArea="#B3B8FF"})(EColor||(EColor={}));const SEGMENT_NUMBER$1=16,POINT_RADIUS$1=3,_LineToolUtils=class{static isInLine(r,t,e,i=3){const{length:s}=MathUtils.getFootOfPerpendicular(r,t,e);return s<i}};let LineToolUtils=_LineToolUtils;LineToolUtils.setSpecialEdgeStyle=r=>{r.lineCap="butt",r.setLineDash([10,10])},LineToolUtils.setReferenceCtx=r=>{r.lineCap="butt",r.setLineDash([6])},LineToolUtils.calcOptimalIntersection=(r,t,e,i,s)=>{let n,o=Infinity,a;if(r.find((h,c)=>{if(c===0)return;const u=_LineToolUtils.isInLine(t.pointA,h,r[c-1]),d=_LineToolUtils.isInLine(t.pointB,h,r[c-1]);return u&&d}))return{point:e};if(r.forEach((h,c)=>{if(c===0)return;const u={pointA:r[c-1],pointB:h},d=_LineToolUtils.lineIntersection(t,u);if(d&&t){const{onLine2:g,onLine1:v,x:f,y:b}=d,p=_LineToolUtils.calcDistance(e,d);if(_LineToolUtils.isOnLine(t.pointB.x,t.pointB.y,h.x,h.y,r[c-1].x,r[c-1].y)){if(_LineToolUtils.calcDistance(e,d)<i/s){const m=t.pointB,{footPoint:I,length:L}=MathUtils.getFootOfPerpendicular(m,u.pointA,u.pointB,!0);if(L!==void 0){const P=_LineToolUtils.calcDistance(u.pointA,I),w=_LineToolUtils.calcDistance(u.pointB,I);a={point:I,minDistance:L},L===Infinity&&(a.point=P>w?u.pointB:u.pointA)}}return}p<o&&g&&v&&(o=p,n={x:f,y:b})}}),n)return{point:n,minDistance:o};if(a)return a},LineToolUtils.lineIntersection=(r,t)=>{let e=!1,i=!1;const s=_LineToolUtils.getAxisDiff(r),n=_LineToolUtils.getAxisDiff(t),o=n.y*s.x-n.x*s.y;if(o===0)return!1;let a=r.pointA.y-t.pointA.y,l=r.pointA.x-t.pointA.x;const h=(t.pointB.x-t.pointA.x)*a-(t.pointB.y-t.pointA.y)*l,c=(r.pointB.x-r.pointA.x)*a-(r.pointB.y-r.pointA.y)*l;a=h/o,l=c/o,a>0&&a<1&&(e=!0),l>0&&l<1&&(i=!0);const u=r.pointA.x+a*(r.pointB.x-r.pointA.x),d=r.pointA.y+a*(r.pointB.y-r.pointA.y);return{x:u,y:d,onLine1:e,onLine2:i}},LineToolUtils.getAxisDiff=r=>({x:r.pointB.x-r.pointA.x,y:r.pointB.y-r.pointA.y}),LineToolUtils.calcDistance=(r,t)=>Math.sqrt(Math.pow(Math.abs(r.x-t.x),2)+Math.pow(Math.abs(r.y-t.y),2)),LineToolUtils.drawCurveLine=(r,t,e,i=!0,s=!1,n)=>{const o=createSmoothCurvePointsFromPointList(t,SEGMENT_NUMBER$1);r.save(),r.lineCap="round",r.lineJoin="round",r.strokeStyle=e.color,i&&(r.lineWidth=e.lineWidth),s&&_LineToolUtils.setReferenceCtx(r),t.forEach((a,l)=>{const h=a==null?void 0:a.specialEdge,c=o.splice(0,SEGMENT_NUMBER$1+1);r.save(),r.beginPath(),n===l&&(r.lineWidth=4),c.forEach(({x:u,y:d},g)=>{const v=g>0?"lineTo":"moveTo";h&&_LineToolUtils.setSpecialEdgeStyle(r),r[v](u,d)}),r.stroke(),r.restore()}),r.restore()},LineToolUtils.calcTwoPointDistance=(r,t)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2)),LineToolUtils.pointOverTarget=(r,t,e,i,s,n,o,a,l,h)=>{const c=r;if(!t)return r;if(e===EToolName.Polygon){const u=_LineToolUtils.getPolygonPointList(i,s);if(u.length===0||PolygonUtils.isInPolygon(r,u))return c;const g=u.concat(u[0]).map(x=>l(x)),v=l(t),f=l(r),b={pointA:v,pointB:f},p=_LineToolUtils.calcOptimalIntersection(g,b,v,o,a);if(p){const x=h(p==null?void 0:p.point);c.x=x.x,c.y=x.y}else return t;return c}if(e===EToolName.Rect){const{x:u,y:d,width:g,height:v}=i;return c.x=MathUtils.withinRange(c.x,[u,u+g]),c.y=MathUtils.withinRange(c.y,[d,d+v]),c}return c.x=MathUtils.withinRange(c.x,[0,n.width]),c.y=MathUtils.withinRange(c.y,[0,n.height]),c},LineToolUtils.getPolygonPointList=(r,t)=>{const{pointList:e}=r,{lineType:i}=t;return i===ELineTypes.Line?e:PolygonUtils.createSmoothCurvePoints(e.reduce((s,n)=>[...s,n.x,n.y],[]),.5,!0,20)},LineToolUtils.isOnLine=(r,t,e,i,s,n)=>Math.abs((a=>(i-t)/(e-r)*(a-r)+t)(s)-n)<1e-6&&s>=r&&s<=e,LineToolUtils.inArea=({top:r,left:t,right:e,bottom:i},{x:s,y:n})=>n>=r&&n<=i&&s>=t&&s<=e,LineToolUtils.getVHPoint=(r,t,e,i)=>{const s=_LineToolUtils.getAngle(r,e);return Math.abs(s)<45?__spreadProps$9(__spreadValues$b({},t),{y:i.y}):__spreadProps$9(__spreadValues$b({},t),{x:i.x})},LineToolUtils.getAngle=(r,t)=>{const e=t.x-r.x,i=t.y-r.y;return 360*Math.atan(i/e)/(2*Math.PI)};var EKeyCode;(function(r){r[r.A=65]="A",r[r.B=66]="B",r[r.C=67]="C",r[r.D=68]="D",r[r.E=69]="E",r[r.F=70]="F",r[r.G=71]="G",r[r.H=72]="H",r[r.L=76]="L",r[r.R=82]="R",r[r.Z=90]="Z",r[r.W=87]="W",r[r.X=88]="X",r[r.Y=89]="Y",r[r.S=83]="S",r[r.Q=81]="Q",r[r.Delete=46]="Delete",r[r.F11=122]="F11",r[r.Space=32]="Space",r[r.Esc=27]="Esc",r[r.Left=37]="Left",r[r.Up=38]="Up",r[r.Right=39]="Right",r[r.Down=40]="Down",r[r.Enter=13]="Enter",r[r.Ctrl=17]="Ctrl",r[r.Alt=18]="Alt",r[r.Shift=16]="Shift",r[r.Tab=9]="Tab",r[r.BackSpace=8]="BackSpace"})(EKeyCode||(EKeyCode={}));var EKeyCode$1=EKeyCode,keyCode=Object.freeze({__proto__:null,default:EKeyCode$1});class ActionsHistory{constructor(t){this.record=[],this.recordIndex=-1,this.minRecordIndex=-1,this.emitHistoryChanged=()=>{this.historyChanged&&(this.constructor.name==="ActionsHistory"?!0:this.record.length>0)&&this.historyChanged(this.undoEnabled,this.redoEnabled)},this.historyChanged=t}get undoEnabled(){return this.recordIndex>this.minRecordIndex}get redoEnabled(){return this.recordIndex<this.record.length-1}pushHistory(t){if(this.recordIndex!==this.record.length-1){const e=this.record.slice(0,Math.min(this.recordIndex+1,this.record.length));this.record=e}this.record.push(___default.default.cloneDeepWith(t)),this.recordIndex+=1,this.emitHistoryChanged()}updateHistory(t){this.record[this.recordIndex]=___default.default.cloneDeep(t)}applyAttribute(t,e,i){t&&this.record.forEach(s=>{const n=s.find(o=>o.id===t);n&&(n[e]=i)})}undo(){if(this.undoEnabled)return this.recordIndex-=1,this.emitHistoryChanged(),___default.default.cloneDeep(this.record[this.recordIndex])||[]}redo(){if(this.redoEnabled)return this.recordIndex+=1,this.emitHistoryChanged(),___default.default.cloneDeep(this.record[this.recordIndex])}init(){this.record=[[]],this.recordIndex=0,this.emitHistoryChanged()}empty(){this.record=[],this.recordIndex=-1,this.emitHistoryChanged()}initRecord(t,e=!1){const i=t.length>0||e;this.record=i?[___default.default.cloneDeep(t)]:[],this.minRecordIndex=i?0:-1,this.recordIndex=0}}class DblClickEventListener{constructor(t,e){this.rcTime=0,this.mouseDownTime=0,this.onMouseDown=()=>{this.mouseDownTime=new Date().getTime()},this.dom=t,this.isDoubleClick=!1,this.delay=e}getRcTime(){return this.rcTime}getCoord(t){return{x:t.clientX,y:t.clientY}}removeEvent(){!this.dom||(this.dom.removeEventListener("mouseup",this.mouseUp),this.dom.removeEventListener("mousemove",this.mouseMove),this.dom.removeEventListener("dblclick",this.dblclick),this.dom.removeEventListener("mousedown",this.onMouseDown))}addEvent(t,e,i,s){!this.dom||(this.removeEvent(),this.mouseUp=n=>{const o=new Date().getTime(),a=s?s(n):!0;if(o-this.mouseDownTime>this.delay||a!==!0){t(n);return}if(n.button===2)if(this.rcTime===0)setTimeout(()=>{this.rcTime=0},this.delay),this.rcTime=o;else{o-this.rcTime<this.delay&&(i(n),clearTimeout(this.setTimeFun),this.cacheFunction=void 0),this.rcTime=0;return}this.setTimeFun&&clearTimeout(this.setTimeFun),this.clickCoord=this.getCoord(n),this.cacheFunction=()=>t(n),this.setTimeFun=setTimeout(()=>{if(this.isDoubleClick){this.isDoubleClick=!1;return}this.cacheFunction(),this.clickCoord=void 0},this.delay)},this.mouseMove=n=>{const o=this.getCoord(n);this.clickCoord&&!AxisUtils.getIsInScope(o,this.clickCoord,10)&&(this.cacheFunction&&this.cacheFunction(),this.clickCoord=void 0,this.cacheFunction=null,clearTimeout(this.setTimeFun))},this.dblclick=n=>{this.isDoubleClick=!0,this.clickCoord=void 0,e(n)},this.dom.addEventListener("mouseup",this.mouseUp),this.dom.addEventListener("mousemove",this.mouseMove),this.dom.addEventListener("dblclick",this.dblclick),this.dom.addEventListener("mousedown",this.onMouseDown))}clearRightDblClick(){this.rcTime=0}}class ImgPosUtils{static getInitImgPos(t,e,i=0,s=1,n=!1){(i===90||i===270)&&(e={width:e.height,height:e.width});const o=t.width*s/e.width,a=t.height*s/e.height;let l=n?1:Math.min(o,a);const h={x:(t.width-e.width*l)/2,y:(t.height-e.height*l)/2},c=e.width*l,u=e.height*l;return n&&(l=1),{zoom:l,currentPos:h,imgInfo:{width:c,height:u}}}static getBasicRecPos(t,e,i,s=.9,n=1,o=!1){if(e&&t){const{x:a,y:l,height:h,width:c}=e;let u=i.height/h;c/h>i.width/i.height&&(u=i.width/c);const d=o?1:u*s*n,g={x:i.width/2,y:i.height/2},v={x:(a+c/2)*d,y:(l+h/2)*d};return{currentPos:{x:g.x-v.x,y:g.y-v.y},innerZoom:d}}return!1}}class RenderDomUtils{static renderInvalidPage(t,e,i){const s=document.createElement("div");return s.setAttribute("style",`
|
package/es/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sense-annotation v1.8.0
|
|
2
|
+
* sense-annotation v1.8.0
|
|
3
3
|
* (c) 2020-2022
|
|
4
4
|
* Released under the Apache-2.0 License.
|
|
5
|
-
*/import{polygon as St,difference as Hi,union as Ni}from"@turf/turf";import F,{isNumber as Wt,cloneDeep as Bi,isObject as Fi}from"lodash";import{i18n as Ct}from"@labelbee/lb-utils";import xe from"color-rgba";const $i=320;var pt;(function(r){r.PointCloud="pointCloudTool"})(pt||(pt={}));var bt;(function(r){r.VideoTextTool="videoTextTool",r.VideoTagTool="videoTagTool",r.VideoClipTool="videoClipTool"})(bt||(bt={}));var Vt;(function(r){r[r.Rect=0]="Rect",r[r.Tag=1]="Tag"})(Vt||(Vt={}));var L;(function(r){r.Rect="rectTool",r.Tag="tagTool",r.Point="pointTool",r.PointMarker="pointMarkerTool",r.Segmentation="segmentationTool",r.Filter="filterTool",r.Text="textTool",r.Polygon="polygonTool",r.Line="lineTool",r.LineMarker="lineMarkerTool",r.Empty="emptyTool",r.FolderTag="folderTagTool",r.RectTrack="rectTrackTool",r.Face="faceTool",r.ClientAttribute="clientAttributeTool",r.OCRRelation="OCRRelationTool"})(L||(L={}));var kt;(function(r){r.Check="check"})(kt||(kt={}));var jt;(function(r){r[r.nothing=0]="nothing",r[r.RectBG=1]="RectBG",r[r.showOrder=2]="showOrder"})(jt||(jt={}));const Zi={[L.Rect]:"\u62C9\u6846",[L.Tag]:"\u6807\u7B7E",[L.Point]:"\u6807\u70B9",[L.PointMarker]:"\u5217\u8868\u6807\u70B9",[L.Segmentation]:"\u524D\u666F\u5206\u5272",[L.Filter]:"\u7B5B\u9009",[L.Text]:"\u6587\u672C",[L.Polygon]:"\u591A\u8FB9\u5F62",[L.Line]:"\u7EBF\u6761",[L.LineMarker]:"\u5217\u8868\u7EBF\u6761",[L.FolderTag]:"\u6587\u4EF6\u5939\u6807\u7B7E",[L.RectTrack]:"\u62C9\u6846\u8DDF\u8E2A",[L.Face]:"\u4EBA\u8138106\u5DE5\u5177",[L.ClientAttribute]:"\u5BA2\u6237\u7AEF\u5C5E\u6027\u5DE5\u5177",[L.OCRRelation]:"OCR\u5173\u8054\u5173\u7CFB\u5DE5\u5177",[bt.VideoTextTool]:"\u89C6\u9891\u6587\u672C",[bt.VideoTagTool]:"\u89C6\u9891\u6807\u7B7E",[bt.VideoClipTool]:"\u89C6\u9891\u622A\u53D6",[pt.PointCloud]:"\u70B9\u4E91"};var Xt;(function(r){r[r.noDepend=1]="noDepend",r[r.dependOrigin=2]="dependOrigin",r[r.dependShape=3]="dependShape",r[r.dependLine=4]="dependLine",r[r.dependPolygon=5]="dependPolygon",r[r.dependPreShape=101]="dependPreShape",r[r.dependPreLine=102]="dependPreLine",r[r.dependPrePolygon=103]="dependPrePolygon"})(Xt||(Xt={}));var gt;(function(r){r.lc="leftClick",r.rc="rightClick",r.clc="ctrlLeftClick",r.crc="ctrlRightClick"})(gt||(gt={}));const Ui={leftClick:"\u9F20\u6807\u5DE6\u952E",rightClick:"\u9F20\u6807\u53F3\u952E",ctrlLeftClick:"ctrl + \u9F20\u6807\u5DE6\u952E",ctrlRightClick:"ctrl + \u9F20\u6807\u53F3\u952E"};var Yt;(function(r){r[r.Normal=1]="Normal",r[r.Modify=2]="Modify"})(Yt||(Yt={}));var T;(function(r){r[r.Line=0]="Line",r[r.Curve=1]="Curve"})(T||(T={}));var Ot;(function(r){r[r.SingleColor=0]="SingleColor",r[r.MultiColor=1]="MultiColor"})(Ot||(Ot={}));var Gt;(function(r){r[r.Form=1]="Form",r[r.Json=2]="Json"})(Gt||(Gt={}));var V;(function(r){r[r.Point=0]="Point",r[r.Line=1]="Line",r[r.Plane=2]="Plane"})(V||(V={}));var Kt;(function(r){r[r.None=0]="None",r[r.Drawing=1]="Drawing",r[r.Edit=2]="Edit"})(Kt||(Kt={}));var Jt;(function(r){r[r.Backward=0]="Backward",r[r.Forward=1]="Forward",r[r.JumpSkip=2]="JumpSkip",r[r.None=3]="None"})(Jt||(Jt={}));var qt;(function(r){r[r.Wait=0]="Wait",r[r.Pass=1]="Pass",r[r.Fail=2]="Fail",r[r.Loading=3]="Loading"})(qt||(qt={}));var X;(function(r){r[r.AnyString=0]="AnyString",r[r.Order=1]="Order",r[r.EnglishOnly=2]="EnglishOnly",r[r.NumberOnly=3]="NumberOnly",r[r.CustomFormat=4]="CustomFormat"})(X||(X={}));const zi={0:"\u4EFB\u610F\u5B57\u7B26",1:"\u5E8F\u53F7",2:"\u4EC5\u82F1\u6587",3:"\u4EC5\u6570\u5B57"},Qt=1e3,me=16,Ie=300,Mt="normal normal 500 14px Arial";var te;(function(r){r[r.ImgList=1e3]="ImgList",r[r.TrackPrediction=1001]="TrackPrediction",r[r.ImgSearch=1002]="ImgSearch"})(te||(te={}));const Wi={[pt.PointCloud]:"sensebeepc",[L.ClientAttribute]:"sensebeepc-EnumAttributeTool",[L.Face]:"sensebeepc-FacePointsLabellingTool",[L.OCRRelation]:"sensebeepc-OCRRelationTool"},Vi={[pt.PointCloud]:"\u70B9\u4E91\u5BA2\u6237\u7AEF",[L.ClientAttribute]:"\u5BA2\u6237\u7AEF\u5C5E\u6027\u5DE5\u5177",[L.Face]:"\u4EBA\u8138106\u70B9\u5DE5\u5177",[L.OCRRelation]:"OCR\u5173\u8054\u5173\u7CFB\u5DE5\u5177"},Y=16,yt=10;var Q;(function(r){r[r.Normal=0]="Normal",r[r.Rect=1]="Rect"})(Q||(Q={}));var ji=Object.freeze({__proto__:null,editStepWidth:$i,get EPointCloudName(){return pt},get EVideoToolName(){return bt},get EToolType(){return Vt},get EToolName(){return L},get ECheckModel(){return kt},get ERectPattern(){return jt},TOOL_NAME:Zi,get EDependPattern(){return Xt},get EFilterToolOperation(){return gt},OPERATION_LIST:Ui,get EAnnotationMode(){return Yt},get ELineTypes(){return T},get ELineColor(){return Ot},get ESelectedType(){return Gt},get EDragTarget(){return V},get EDrawPointPattern(){return Kt},get EPageOperator(){return Jt},get EAuditStatus(){return qt},get ETextType(){return X},TEXT_TYPE:zi,TEXT_ATTRIBUTE_MAX_LENGTH:Qt,TEXT_ATTRIBUTE_LINE_HEIGHT:me,DEFAULT_TEXT_MAX_WIDTH:Ie,DEFAULT_FONT:Mt,get EThumbnailOption(){return te},CLIENT_TOOL_HEAD_TYPE:Wi,CLIENT_TOOL_NAME:Vi,SEGMENT_NUMBER:Y,edgeAdsorptionScope:yt,get EPolygonPattern(){return Q}}),Xi=Object.defineProperty,Yi=Object.defineProperties,Gi=Object.getOwnPropertyDescriptors,we=Object.getOwnPropertySymbols,Ki=Object.prototype.hasOwnProperty,Ji=Object.prototype.propertyIsEnumerable,Le=(r,t,e)=>t in r?Xi(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,qi=(r,t)=>{for(var e in t||(t={}))Ki.call(t,e)&&Le(r,e,t[e]);if(we)for(var e of we(t))Ji.call(t,e)&&Le(r,e,t[e]);return r},Qi=(r,t)=>Yi(r,Gi(t));function ee(r,t
|
|
5
|
+
*/import{polygon as St,difference as Hi,union as Ni}from"@turf/turf";import F,{isNumber as Wt,cloneDeep as Bi,isObject as Fi}from"lodash";import{i18n as Ct}from"@labelbee/lb-utils";import xe from"color-rgba";const $i=320;var pt;(function(r){r.PointCloud="pointCloudTool"})(pt||(pt={}));var bt;(function(r){r.VideoTextTool="videoTextTool",r.VideoTagTool="videoTagTool",r.VideoClipTool="videoClipTool"})(bt||(bt={}));var Vt;(function(r){r[r.Rect=0]="Rect",r[r.Tag=1]="Tag"})(Vt||(Vt={}));var L;(function(r){r.Rect="rectTool",r.Tag="tagTool",r.Point="pointTool",r.PointMarker="pointMarkerTool",r.Segmentation="segmentationTool",r.Filter="filterTool",r.Text="textTool",r.Polygon="polygonTool",r.Line="lineTool",r.LineMarker="lineMarkerTool",r.Empty="emptyTool",r.FolderTag="folderTagTool",r.RectTrack="rectTrackTool",r.Face="faceTool",r.ClientAttribute="clientAttributeTool",r.OCRRelation="OCRRelationTool"})(L||(L={}));var kt;(function(r){r.Check="check"})(kt||(kt={}));var jt;(function(r){r[r.nothing=0]="nothing",r[r.RectBG=1]="RectBG",r[r.showOrder=2]="showOrder"})(jt||(jt={}));const Zi={[L.Rect]:"\u62C9\u6846",[L.Tag]:"\u6807\u7B7E",[L.Point]:"\u6807\u70B9",[L.PointMarker]:"\u5217\u8868\u6807\u70B9",[L.Segmentation]:"\u524D\u666F\u5206\u5272",[L.Filter]:"\u7B5B\u9009",[L.Text]:"\u6587\u672C",[L.Polygon]:"\u591A\u8FB9\u5F62",[L.Line]:"\u7EBF\u6761",[L.LineMarker]:"\u5217\u8868\u7EBF\u6761",[L.FolderTag]:"\u6587\u4EF6\u5939\u6807\u7B7E",[L.RectTrack]:"\u62C9\u6846\u8DDF\u8E2A",[L.Face]:"\u4EBA\u8138106\u5DE5\u5177",[L.ClientAttribute]:"\u5BA2\u6237\u7AEF\u5C5E\u6027\u5DE5\u5177",[L.OCRRelation]:"OCR\u5173\u8054\u5173\u7CFB\u5DE5\u5177",[bt.VideoTextTool]:"\u89C6\u9891\u6587\u672C",[bt.VideoTagTool]:"\u89C6\u9891\u6807\u7B7E",[bt.VideoClipTool]:"\u89C6\u9891\u622A\u53D6",[pt.PointCloud]:"\u70B9\u4E91"};var Xt;(function(r){r[r.noDepend=1]="noDepend",r[r.dependOrigin=2]="dependOrigin",r[r.dependShape=3]="dependShape",r[r.dependLine=4]="dependLine",r[r.dependPolygon=5]="dependPolygon",r[r.dependPreShape=101]="dependPreShape",r[r.dependPreLine=102]="dependPreLine",r[r.dependPrePolygon=103]="dependPrePolygon"})(Xt||(Xt={}));var gt;(function(r){r.lc="leftClick",r.rc="rightClick",r.clc="ctrlLeftClick",r.crc="ctrlRightClick"})(gt||(gt={}));const Ui={leftClick:"\u9F20\u6807\u5DE6\u952E",rightClick:"\u9F20\u6807\u53F3\u952E",ctrlLeftClick:"ctrl + \u9F20\u6807\u5DE6\u952E",ctrlRightClick:"ctrl + \u9F20\u6807\u53F3\u952E"};var Yt;(function(r){r[r.Normal=1]="Normal",r[r.Modify=2]="Modify"})(Yt||(Yt={}));var T;(function(r){r[r.Line=0]="Line",r[r.Curve=1]="Curve"})(T||(T={}));var Ot;(function(r){r[r.SingleColor=0]="SingleColor",r[r.MultiColor=1]="MultiColor"})(Ot||(Ot={}));var Gt;(function(r){r[r.Form=1]="Form",r[r.Json=2]="Json"})(Gt||(Gt={}));var V;(function(r){r[r.Point=0]="Point",r[r.Line=1]="Line",r[r.Plane=2]="Plane"})(V||(V={}));var Kt;(function(r){r[r.None=0]="None",r[r.Drawing=1]="Drawing",r[r.Edit=2]="Edit"})(Kt||(Kt={}));var Jt;(function(r){r[r.Backward=0]="Backward",r[r.Forward=1]="Forward",r[r.JumpSkip=2]="JumpSkip",r[r.None=3]="None"})(Jt||(Jt={}));var qt;(function(r){r[r.Wait=0]="Wait",r[r.Pass=1]="Pass",r[r.Fail=2]="Fail",r[r.Loading=3]="Loading"})(qt||(qt={}));var X;(function(r){r[r.AnyString=0]="AnyString",r[r.Order=1]="Order",r[r.EnglishOnly=2]="EnglishOnly",r[r.NumberOnly=3]="NumberOnly",r[r.CustomFormat=4]="CustomFormat"})(X||(X={}));const zi={0:"\u4EFB\u610F\u5B57\u7B26",1:"\u5E8F\u53F7",2:"\u4EC5\u82F1\u6587",3:"\u4EC5\u6570\u5B57"},Qt=1e3,me=16,Ie=300,Mt="normal normal 500 14px Arial";var te;(function(r){r[r.ImgList=1e3]="ImgList",r[r.TrackPrediction=1001]="TrackPrediction",r[r.ImgSearch=1002]="ImgSearch"})(te||(te={}));const Wi={[pt.PointCloud]:"sensebeepc",[L.ClientAttribute]:"sensebeepc-EnumAttributeTool",[L.Face]:"sensebeepc-FacePointsLabellingTool",[L.OCRRelation]:"sensebeepc-OCRRelationTool"},Vi={[pt.PointCloud]:"\u70B9\u4E91\u5BA2\u6237\u7AEF",[L.ClientAttribute]:"\u5BA2\u6237\u7AEF\u5C5E\u6027\u5DE5\u5177",[L.Face]:"\u4EBA\u8138106\u70B9\u5DE5\u5177",[L.OCRRelation]:"OCR\u5173\u8054\u5173\u7CFB\u5DE5\u5177"},Y=16,yt=10;var Q;(function(r){r[r.Normal=0]="Normal",r[r.Rect=1]="Rect"})(Q||(Q={}));var ji=Object.freeze({__proto__:null,editStepWidth:$i,get EPointCloudName(){return pt},get EVideoToolName(){return bt},get EToolType(){return Vt},get EToolName(){return L},get ECheckModel(){return kt},get ERectPattern(){return jt},TOOL_NAME:Zi,get EDependPattern(){return Xt},get EFilterToolOperation(){return gt},OPERATION_LIST:Ui,get EAnnotationMode(){return Yt},get ELineTypes(){return T},get ELineColor(){return Ot},get ESelectedType(){return Gt},get EDragTarget(){return V},get EDrawPointPattern(){return Kt},get EPageOperator(){return Jt},get EAuditStatus(){return qt},get ETextType(){return X},TEXT_TYPE:zi,TEXT_ATTRIBUTE_MAX_LENGTH:Qt,TEXT_ATTRIBUTE_LINE_HEIGHT:me,DEFAULT_TEXT_MAX_WIDTH:Ie,DEFAULT_FONT:Mt,get EThumbnailOption(){return te},CLIENT_TOOL_HEAD_TYPE:Wi,CLIENT_TOOL_NAME:Vi,SEGMENT_NUMBER:Y,edgeAdsorptionScope:yt,get EPolygonPattern(){return Q}}),Xi=Object.defineProperty,Yi=Object.defineProperties,Gi=Object.getOwnPropertyDescriptors,we=Object.getOwnPropertySymbols,Ki=Object.prototype.hasOwnProperty,Ji=Object.prototype.propertyIsEnumerable,Le=(r,t,e)=>t in r?Xi(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,qi=(r,t)=>{for(var e in t||(t={}))Ki.call(t,e)&&Le(r,e,t[e]);if(we)for(var e of we(t))Ji.call(t,e)&&Le(r,e,t[e]);return r},Qi=(r,t)=>Yi(r,Gi(t));function ee(r,t,e,i=16){if(r.length<4)return r;const s=[],n=r.slice(0);let o,a,l,h,c,u,d,g,v,f,b,p,y;for(e?(n.unshift(r[r.length-1]),n.unshift(r[r.length-2]),n.unshift(r[r.length-1]),n.unshift(r[r.length-2]),n.push(r[0]),n.push(r[1])):(n.unshift(r[1]),n.unshift(r[0]),n.push(r[r.length-2]),n.push(r[r.length-1])),y=2;y<n.length-4;y+=2)for(l=(n[y+2]-n[y-2])*t,h=(n[y+4]-n[y-0])*t,c=(n[y+3]-n[y-1])*t,u=(n[y+5]-n[y+1])*t,p=0;p<=i;p++)b=p/i,d=2*Math.pow(b,3)-3*Math.pow(b,2)+1,g=-(2*Math.pow(b,3))+3*Math.pow(b,2),v=Math.pow(b,3)-2*Math.pow(b,2)+b,f=Math.pow(b,3)-Math.pow(b,2),o=d*n[y]+g*n[y+2]+v*l+f*h,a=d*n[y+1]+g*n[y+3]+v*c+f*u,s.push(o),s.push(a);const w=[];for(let D=0;D<s.length-1;D+=2)w.push({x:s[D],y:s[D+1]});if(e)for(let D=0;D<i+1;D++){const R=w.shift();w.push(R)}return w}const Et=(r,t=16)=>ee(r.reduce((e,i)=>[...e,i.x,i.y],[]),.5,!1,t);function Pe(r,t,e=T.Line){let i=0,s,n,o,a;t=[...t],e===T.Curve&&(t=ee(t.reduce((h,c)=>[...h,c.x,c.y],[]),.5,!0,Y)),[o]=t;const l=t.length;for(s=1;s<=l;s++)a=t[s%l],r.x>Math.min(o.x,a.x)&&r.x<=Math.max(o.x,a.x)&&r.y<=Math.max(o.y,a.y)&&o.x!==a.x&&(n=(r.x-o.x)*(a.y-o.y)/(a.x-o.x)+o.y,(o.y===a.y||r.y<=n)&&i++),o=a;return i%2!=0}function Ce(r,t=1){return r.map(e=>Qi(qi({},e),{x:e.x*t,y:e.y*t}))}var De=Math.pow;class xt{static add(t,e){return{x:t.x+e.x,y:t.y+e.y}}static getVector(t,e){return{x:e.x-t.x,y:e.y-t.y}}static len(t){return Math.sqrt(De(t.x,2)+De(t.y,2))}static dotProduct(t,e){return t.x*e.x+t.y+e.y}}class _e{static tanAPlusB(t,e){return(t+e)/(1-t*e)}static sinAPlusB(t,e,i,s){return s*t+e*i}static cosAPlusB(t,e,i,s){return e*s-t*i}}const mt=class{static getRotate(r){return r+90>=360?r+90-360:r+90}static getLineLength(r,t){return Math.sqrt(Math.pow(t.y-r.y,2)+Math.pow(t.x-r.x,2))}static getTextArea(r,t,e=Ie,i=Mt,s){if(typeof t!="string")return{width:0,height:0};const n=r.getContext("2d");n.font=i;let o=0;typeof s=="undefined"&&(s=r&&parseInt(window.getComputedStyle(r).lineHeight,10)||parseInt(window.getComputedStyle(document.body).lineHeight,10));const a=r&&parseInt(window.getComputedStyle(r).fontSize,10)||parseInt(window.getComputedStyle(document.body).fontSize,10)||0,l=t.split(`
|
|
6
6
|
`);let h=0;for(let c=0;c<l.length;c++){const u=l[c].split("");let d="";for(let g=0;g<u.length;g++){const v=d+u[g],b=n.measureText(v).width;b>e&&g>0?(d=u[g],o+=s,h=e):(d=v,b>h&&(h=b))}c!==l.length-1&&(o+=s)}return{width:h,height:o+a,lineHeight:s,fontHeight:a}}static getLineCenterPoint(r){const[t,e]=r,i=xt.getVector(t,e);return{x:t.x+i.x/2,y:t.y+i.y/2}}static getPerpendicularLine(r){if(r.length!==2)return;const[t,e]=r,i={x:e.x+e.y-t.y,y:e.y-(e.x-t.x)};return[e,i]}static getPerpendicularFootOfLine(r,t){if(r.length!==2)return r;const e=this.getPerpendicularLine(r);if(!e)return r;const[i,s]=e;return this.getFootOfPerpendicular(t,i,s).footPoint}static getQuadrangleFromTriangle(r){if(r.length!==3)return r;const[t,e,i]=r,s={x:i.x+t.x-e.x,y:i.y+t.y-e.y};return[t,e,i,s]}static getRectPerpendicularOffset(r,t,e){const[i,s]=e,n=this.getFootOfPerpendicular(r,i,s).footPoint,o=this.getFootOfPerpendicular(t,i,s).footPoint,a={x:n.x-o.x,y:n.y-o.y},l=xt.add(t,a);return xt.getVector(r,l)}static getArrayIndex(r,t){return r<0?t+r:r>=t?r-t:r}static getPointListFromPointOffset(r,t,e){const i=this.getArrayIndex(t-1,r.length),s=this.getArrayIndex(t+1,r.length),n=this.getArrayIndex(t-2,r.length),o=[...r];o[t]=xt.add(o[t],e);const a=this.getFootOfPerpendicular(o[t],o[n],o[i]).footPoint,l=this.getFootOfPerpendicular(o[t],o[s],o[n]).footPoint;return o[i]=a,o[s]=l,o}static getRectCenterPoint(r){const[t,,e]=r;return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}static rotateRectPointList(r=5,t){const e=this.getRectCenterPoint(t),{PI:i}=Math,s=Math.sin(r*i/180),n=Math.cos(r*i/180);return t.map(o=>{const a=xt.getVector(e,o),l=xt.len(a),h=a.y/l,c=a.x/l;return{x:l*_e.cosAPlusB(h,c,s,n)+e.x,y:l*_e.sinAPlusB(h,c,s,n)+e.y}})}static getRectangleByRightAngle(r,t){if(t.length!==2)return t;const e=mt.getPerpendicularFootOfLine(t,r);return mt.getQuadrangleFromTriangle([...t,e])}};let P=mt;P.isInRange=(r,t)=>{const e=Math.min(...t),i=Math.max(...t),s=o=>o<=i&&o>=e;return(Array.isArray(r)?r:[r]).every(o=>s(o))},P.withinRange=(r,t)=>{const e=Math.min(...t),i=Math.max(...t);return r>i?i:r<e?e:r},P.calcViewportBoundaries=(r,t=!1,e=Y,i=1)=>{if(!r)return{top:0,bottom:0,left:0,right:0};const s=20/i,n=[],o=[];let a=r;t&&(a=Et(r,e)),a.forEach(({x:v,y:f})=>{n.push(v),o.push(f)});let l=Math.min(...n),h=Math.max(...n),c=Math.min(...o),u=Math.max(...o);const d=h-l,g=u-c;if(d<s){const v=(s-d)/2;l-=v,h+=v}if(g<s){const v=(s-g)/2;c-=v,u+=v}return{top:c,bottom:u,left:l,right:h}},P.getFootOfPerpendicular=(r,t,e,i=!1)=>{let s={x:0,y:0};const n=t.x-e.x,o=t.y-e.y;if(Math.abs(n)<1e-8&&Math.abs(o)<1e-8)return s=t,s;let a=(r.x-t.x)*(t.x-e.x)+(r.y-t.y)*(t.y-e.y);a/=n*n+o*o,s.x=t.x+a*n,s.y=t.y+a*o;const l=mt.getLineLength(r,s),h=2,c=Math.min(t.x,e.x),u=Math.max(t.x,e.x),d=Math.min(t.y,e.y),g=Math.max(t.y,e.y),v=!(mt.isInRange(r.x,[c,u])||mt.isInRange(r.y,[d,g])),f=r.x>u+h||r.x<c-h||r.y>g+h||r.y<d-h;return(i?v:f)?{footPoint:s,length:Infinity}:{footPoint:s,length:l}};const ts=61,es=40,is=40,ss=240;var Dt;(function(r){r[r.ANNOTATION=1]="ANNOTATION",r[r.QUALITY_INSPECTION=2]="QUALITY_INSPECTION",r[r.PRE_ANNOTATION=3]="PRE_ANNOTATION",r[r.MANUAL_CORRECTION=4]="MANUAL_CORRECTION"})(Dt||(Dt={}));const rs=1e3;var ie;(function(r){r[r.Backward=0]="Backward",r[r.Forward=1]="Forward",r[r.JumpSkip=2]="JumpSkip",r[r.None=3]="None"})(ie||(ie={}));var O;(function(r){r[r.Start=0]="Start",r[r.Stop=1]="Stop",r[r.Wait=2]="Wait",r[r.Move=3]="Move"})(O||(O={}));var q;(function(r){r[r.Point=0]="Point",r[r.Line=1]="Line",r[r.Plane=2]="Plane"})(q||(q={}));var G;(function(r){r[r.ascend=0]="ascend",r[r.descend=1]="descend"})(G||(G={}));var It;(function(r){r[r.Intelligence=0]="Intelligence",r[r.Linear=1]="Linear"})(It||(It={}));var at;(function(r){r.Zh="zh_CN",r.US="en_US"})(at||(at={}));var _t;(function(r){r[r.Clockwise=0]="Clockwise",r[r.Anticlockwise=1]="Anticlockwise"})(_t||(_t={}));const K={offsetX:-10,offsetY:-10},ft={shadowColor:"rgba(0,0,0,0.6)",shadowOffsetX:0,shadowOffsetY:2,shadowBlur:4},vt={x:8,y:26};var ns=Object.freeze({__proto__:null,headerHeight:ts,tipsHeight:es,footerHeight:is,sidebarWidth:ss,get EStepType(){return Dt},ANNOTATION_MAX_SIZE:rs,get EPageOperator(){return ie},get EDragStatus(){return O},get EDragTarget(){return q},get ESortDirection(){return G},get EGrowthMode(){return It},get ELang(){return at},get ERotateDirection(){return _t},DEFAULT_TEXT_OFFSET:K,DEFAULT_TEXT_SHADOW:ft,TEXT_ATTRIBUTE_OFFSET:vt}),os=Object.defineProperty,as=Object.defineProperties,ls=Object.getOwnPropertyDescriptors,Re=Object.getOwnPropertySymbols,hs=Object.prototype.hasOwnProperty,cs=Object.prototype.propertyIsEnumerable,Ae=(r,t,e)=>t in r?os(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,lt=(r,t)=>{for(var e in t||(t={}))hs.call(t,e)&&Ae(r,e,t[e]);if(Re)for(var e of Re(t))cs.call(t,e)&&Ae(r,e,t[e]);return r},ht=(r,t)=>as(r,ls(t));class Z{static composeResult(t,e,i,s,n){try{const o=JSON.parse(t),a=x.getCurrentStepInfo(e,s),{dataSourceStep:l}=a,h=`step_${a.step}`;if(Object.assign(o,n),o[h]){const c=o[h];return c.result?(c.result=i,JSON.stringify(o)):JSON.stringify(ht(lt({},o),{[h]:ht(lt({},o[h]),{result:i})}))}return JSON.stringify(ht(lt({},o),{[h]:{dataSourceStep:l,toolName:a.tool,result:i}}))}catch(o){return t}}static changeCoordinateByRotate(t,e,i){const{x:s,y:n,width:o,height:a}=t,l=I.changeCoordinateByRotate({x:s,y:n},e,i);switch(e%360){case 90:return ht(lt({},t),{x:l.x-a,y:l.y,width:a,height:o});case 180:return ht(lt({},t),{x:l.x-o,y:l.y-a});case 270:return ht(lt({},t),{x:l.x,y:l.y-o,width:a,height:o});default:return t}}static translateRect2Points(t){const{x:e,y:i,width:s,height:n}=t;return[{x:e,y:i},{x:e+s,y:i},{x:e+s,y:i+n},{x:e,y:i+n}]}static translatePoints2Rect(t,e){if(t.length!==4)return;const{x:i,y:s}=t[0],n=t[1].x-t[0].x,o=t[2].y-t[1].y;return ht(lt({},e),{x:i,y:s,width:n,height:o})}static getRectPointList(t,e=1){return[{x:t.x*e,y:t.y*e},{x:(t.x+t.width)*e,y:t.y*e},{x:(t.x+t.width)*e,y:(t.y+t.height)*e},{x:t.x*e,y:(t.y+t.height)*e}]}static getRectEdgeList(t,e=1){const i=this.getRectPointList(t,e),s=i.length;return i.map((n,o)=>({begin:n,end:i[(o+1)%s]}))}static isInRect(t,e,i=0,s=1){return t.x>=e.x*s-i&&t.x<=(e.x+e.width)*s+i&&t.y>=e.y*s-i&&t.y<=(e.y+e.height)*s+i}static getRectUnderZoom(t,e=1){const{x:i,y:s,width:n,height:o}=t;return ht(lt({},t),{x:i*e,y:s*e,width:n*e,height:o*e})}static isRectNotInPolygon(t,e){return this.getRectPointList(t).some(s=>!Pe(s,e))}}function J(r=8,t=62){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=[];let s;if(t=t||e.length,r)for(s=0;s<r;s++)i[s]=e[0|Math.random()*t];else{let n;for(i[8]=i[13]=i[18]=i[23]="-",i[14]="4",s=0;s<36;s++)i[s]||(n=0|Math.random()*16,i[s]=e[s===19?n&3|8:n])}return i.join("")}var ds=Object.defineProperty,Te=Object.getOwnPropertySymbols,us=Object.prototype.hasOwnProperty,gs=Object.prototype.propertyIsEnumerable,Se=(r,t,e)=>t in r?ds(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,ke=(r,t)=>{for(var e in t||(t={}))us.call(t,e)&&Se(r,e,t[e]);if(Te)for(var e of Te(t))gs.call(t,e)&&Se(r,e,t[e]);return r};class Rt{static getTagKeyName(t,e){var i,s;if(!!e)return(s=(i=e.find(n=>n.value===t))==null?void 0:i.key)!=null?s:""}static getTagName([t="",e=""],i){if(!!i){for(const s of i)if(s.value===t){if(!s.subSelected)return console.error("\u6807\u7B7E\u89E3\u6790\u9519\u8BEF",t,e),"";for(const n of s.subSelected)if(n.value===e)return n.key}}}static getTagNameList(t,e){return Object.keys(t).length<=0?[]:Object.entries(t).reduce((i,s)=>{const[n,o]=s;if(o&&o.length>0){const a=o.split(";"),l={keyName:this.getTagKeyName(n,e),value:a.map(h=>this.getTagName([n,h],e))};return[...i,l]}return i},[]).filter(i=>i)}static getTagnameListWithoutConfig(t){return Object.keys(t).length<=0?[]:Object.entries(t).reduce((e,i)=>{const[s,n]=i,o=n.split(";"),a={keyName:s,value:o};return[...e,a]},[]).filter(e=>e)}static judgeResultIsInInputList(t,e,i){return!t||!e||!i?!1:i.filter(n=>{if(n.value===t&&n.subSelected){const o=e==null?void 0:e.split(";");return(n==null?void 0:n.subSelected.filter(a=>o.indexOf(a.value)>-1).length)>0}return!1}).length>0}static getDefaultResultByConfig(t){return t.reduce((e,i)=>(i.subSelected&&i.subSelected.forEach(s=>{var n;if(s.isDefault){const o=(n=e[i.value])!=null?n:"";let a=[];o.length>0&&(a=o.split(";")),a.push(s.value),e[i.value]=a.join(";")}}),e),{})}static getDefaultTagResult(t,e){const i=this.getDefaultResultByConfig(t);return e.length>0?e.map(s=>({id:J(),sourceID:s.id,result:ke({},i)})):[{id:J(),sourceID:"",result:ke({},i)}]}}var Oe='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#ccc"/></g></g></svg>',fs='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#ff2323"/></g></g></svg>',vs='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#ffe232"/></g></g></svg>',ps='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#01ff30"/></g></g></svg>',bs='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#00ffea"/></g></g></svg>',ys='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#0282fa"/></g></g></svg>',xs='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#800cf9"/></g></g></svg>',ms='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#ff88f7"/></g></g></svg>',Is='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#994217"/></g></g></svg>',ws='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#1f0bf9"/></g></g></svg>',Ls='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#3fe"/></g></g></svg>',Ps='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#33fe33"/></g></g></svg>',Cs='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#fdff37"/></g></g></svg>',Ds='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#f70efa"/></g></g></svg>',Me='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#f33"/></g></g></svg>';const Ee=Oe,_s=61,Rs=80,As=62,Ts=20,Ss=55,ks=55,Os=40,Ms=80,Es=240,Hs=320,Ns="rgba(102, 111, 255, 1)",wt=["rgba(128, 12, 249, 1)","rgba(0, 255, 48, 1)","rgba(255, 136, 247, 1)","rgba(255, 226, 50, 1)","rgba(153, 66, 23, 1)","rgba(2, 130, 250, 1)","rgba(255, 35, 35, 1)","rgba(0, 255, 234, 1)"],Ht=[Oe,xs,ps,ms,vs,Is,ys,fs,bs],He={1:ws,3:Ls,5:Ps,7:Cs,9:Ds},Bs="rgba(255, 51, 51, 1)",se="rgba(204, 204, 204, 1)",Fs={[gt.lc]:"rgba(153, 51, 255, 1)",[gt.rc]:"rgba(51, 153, 255, 1)",[gt.clc]:"rgba(46, 230, 46, 1)",[gt.crc]:"rgba(255, 51, 51, 1)"};var $s=Object.freeze({__proto__:null,HEADER_HEIGHT:_s,TAB_HEIGHT:Rs,SEARCH_HEIGHT:As,PADDING:Ts,TABLE_ROW_HEIGHT:Ss,PAGINATION_HEIGHT:ks,TIPS_HEIGHT:Os,FOOTER_HEIGHT:Ms,SIDERBAR_WIDTH:Es,EDIT_STEP_WIDTH:Hs,THEME_COLOR:Ns,COLORS_ARRAY:wt,ICON_ARRAY:Ht,BASE_ICON:He,INVALID_COLOR:Bs,NULL_COLOR:se,NULL_ICON:Ee,INVALID_ICON:Me,FILTER_TOOL_COLOR:Fs}),C;(function(r){r.NoRotateNotice="noRotateNotice",r.RectErrorSizeNotice="rectErrorSizeNotice",r.TextCheckNumberErrorNotice="textCheckNumberErrorNotice",r.TextCheckEnglishErrorNotice="textCheckEnglishErrorNotice",r.TextCheckCustomErrorNotice="textCheckCustomErrorNotice",r.UpperLimitErrorNotice="UpperLimitErrorNotice",r.LowerLimitErrorNotice="LowerLimitErrorNotice",r.InvalidImage="InvalidImage",r.DisableDelete="DisableDelete",r.ClearPartialData="ClearPartialData",r.MarkerFinish="MarkerFinish",r.LowerLimitPoint="LowerLimitPoint",r.NoRotateInDependence="noRotateInDependence",r.UnableToReannotation="unableToReannotation",r.ForbiddenCreationOutsideBoundary="ForbiddenCreationOutsideBoundary",r.SuccessfulEdgeAdsorption="SuccessfulEdgeAdsorption"})(C||(C={}));const Zs={[C.NoRotateNotice]:"This Image contains data and cannot be rotated",[C.RectErrorSizeNotice]:"The drawing frame size is smaller than the minimum drawing size",[C.TextCheckNumberErrorNotice]:"Please enter in number-only format",[C.TextCheckEnglishErrorNotice]:"Please enter in English only format",[C.TextCheckCustomErrorNotice]:"Please enter in the required format",[C.UpperLimitErrorNotice]:"The number of vertices is not more than",[C.LowerLimitErrorNotice]:"The number of vertices is not less than",[C.InvalidImage]:"Invalid image, please skip this image",[C.DisableDelete]:"Disable delete",[C.ClearPartialData]:"Clear partial data",[C.MarkerFinish]:"ListAnnotation is finished",[C.LowerLimitPoint]:"The maximum number of points has been reached",[C.NoRotateInDependence]:"Disallow rotation in dependent cases",[C.UnableToReannotation]:"Unabled to reannotation",[C.ForbiddenCreationOutsideBoundary]:"Fobid creation outside boundary",[C.SuccessfulEdgeAdsorption]:"Successful edge adsorption"},Us={[C.NoRotateNotice]:"\u672C\u56FE\u542B\u6709\u6570\u636E\uFF0C\u65E0\u6CD5\u8FDB\u884C\u65CB\u8F6C",[C.RectErrorSizeNotice]:"\u7ED8\u5236\u6846\u5C3A\u5BF8\u5C0F\u4E8E\u6700\u5C0F\u7ED8\u5236\u5C3A\u5BF8",[C.TextCheckNumberErrorNotice]:"\u8BF7\u6309\u4EC5\u6570\u5B57\u7684\u683C\u5F0F\u8F93\u5165",[C.TextCheckEnglishErrorNotice]:"\u8BF7\u6309\u4EC5\u82F1\u6587\u7684\u683C\u5F0F\u8F93\u5165",[C.TextCheckCustomErrorNotice]:"\u8BF7\u6309\u8981\u6C42\u7684\u683C\u5F0F\u8F93\u5165",[C.UpperLimitErrorNotice]:"\u9876\u70B9\u6570\u4E0D\u591A\u4E8E",[C.LowerLimitErrorNotice]:"\u9876\u70B9\u6570\u4E0D\u5C11\u4E8E",[C.InvalidImage]:"\u65E0\u6548\u56FE\u7247\uFF0C\u8BF7\u8DF3\u8FC7\u6B64\u56FE",[C.DisableDelete]:"\u8BE5\u6570\u636E\u7981\u6B62\u5220\u9664",[C.ClearPartialData]:"\u5B58\u5728\u90E8\u5206\u6570\u636E\u65E0\u6CD5\u6E05\u9664",[C.MarkerFinish]:"\u5217\u8868\u6807\u6CE8\u5DF2\u5B8C\u6210",[C.LowerLimitPoint]:"\u5DF2\u5230\u8FBE\u6807\u70B9\u6570\u91CF\u4E0A\u9650",[C.NoRotateInDependence]:"\u4F9D\u8D56\u60C5\u51B5\u4E0B\u65E0\u6CD5\u8FDB\u884C\u65CB\u8F6C",[C.UnableToReannotation]:"\u65E0\u6CD5\u8FDB\u884C\u7EED\u6807\u64CD\u4F5C",[C.ForbiddenCreationOutsideBoundary]:"\u8FB9\u754C\u5916\u7981\u6B62\u521B\u5EFA",[C.SuccessfulEdgeAdsorption]:"\u8FB9\u7F18\u5438\u9644\u6210\u529F"};class B{}B.getMessagesByLocale=(r,t)=>{switch(t){case at.US:return Zs[r];case at.Zh:default:return Us[r]}};var zs=Object.defineProperty,Ws=Object.defineProperties,Vs=Object.getOwnPropertyDescriptors,Ne=Object.getOwnPropertySymbols,js=Object.prototype.hasOwnProperty,Xs=Object.prototype.propertyIsEnumerable,Be=(r,t,e)=>t in r?zs(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Fe=(r,t)=>{for(var e in t||(t={}))js.call(t,e)&&Be(r,e,t[e]);if(Ne)for(var e of Ne(t))Xs.call(t,e)&&Be(r,e,t[e]);return r},$e=(r,t)=>Ws(r,Vs(t));const Ys="^[0-9]+$",Gs="^[A-Za-z]+$";class S{static getAttributeIcon(t,e,i=!0){var s;const n=e.findIndex(l=>l.value===t);let o=(s=Ht[n%Ht.length])!=null?s:Ee;i||(o=Me),o="";const a=new Image;return a.src=o,a}static checkString(t,e){let i="";switch(t){case X.Order:case X.NumberOnly:i=Ys;break;case X.EnglishOnly:i=Gs;break;case X.CustomFormat:i=e;break}return i}static checkTextAttibute(t,e){if(t===void 0||t==="")return!0;try{return new RegExp(e).test(t)}catch(i){return!1}}static getAttributeShowText(t,e=[]){var i,s;try{const n=e.findIndex(o=>o.value===t);return(s=(i=e[n])==null?void 0:i.key)!=null?s:t}catch(n){return t}}static getAttributeIndex(t,e){try{const i=e.findIndex(s=>s.value===t);return i>=8?i%8:i}catch(i){return-1}}static getAttributeColor(t,e){try{const i=this.getAttributeIndex(t,e);return i===-1?se:wt[i%wt.length]}catch(i){return se}}static getTextAttribute(t,e){try{if(e===X.Order){const i=t.map(n=>parseInt(n.textAttribute,10)).filter(n=>Wt(n)&&n<Number.MAX_SAFE_INTEGER&&n>=0);return i.sort((n,o)=>n-o),`${(i.pop()||0)+1}`}return""}catch(i){return""}}static textChange(t,e,i){return i.map(s=>s.id===e?$e(Fe({},s),{textAttribute:t}):s)}static getErrorNotice(t,e){switch(t){case X.Order:case X.NumberOnly:return B.getMessagesByLocale(C.TextCheckNumberErrorNotice,e);case X.EnglishOnly:return B.getMessagesByLocale(C.TextCheckEnglishErrorNotice,e);case X.CustomFormat:return B.getMessagesByLocale(C.TextCheckCustomErrorNotice,e);default:return""}}static textAttributeValidate(t,e,i){try{return new RegExp(this.checkString(t,e)).test(i)}catch(s){}}static checkTextAttribute(t,e,i,s){let n=!1;return i.forEach(o=>{(o==null?void 0:o.textAttribute)===void 0||(o==null?void 0:o.textAttribute)===""||(s?o.id===s:!0)&&!this.textAttributeValidate(t,e,o.textAttribute)&&(n=!0)}),!!n}static changeTextAttributeInLog(t,e){return t==null?void 0:t.map(i=>i==null?void 0:i.map(s=>{if((e==null?void 0:e.findIndex(n=>(n==null?void 0:n.id)===(s==null?void 0:s.id)))>-1){const n=e==null?void 0:e.find(o=>(o==null?void 0:o.id)===(s==null?void 0:s.id));return $e(Fe({},s),{textAttribute:n==null?void 0:n.textAttribute})}return s}))}static getTextIconSvg(t="",e,i=!1,s){if(i===!0){const n=(e==null?void 0:e.findIndex(o=>(o==null?void 0:o.value)===t))%wt.length+1;return Ht[n]}return s}static getAttributeByKeycode(t,e){var i;let s;return P.isInRange(t,[48,57])&&(s=t-48),P.isInRange(t,[96,105])&&(s=t-96),s===0?"":s?(i=e[s-1])==null?void 0:i.value:void 0}}class Nt{static deg2rad(t){return t*Math.PI/180}static rad2deg(t){return t*180/Math.PI}}var Ks=Object.defineProperty,Js=Object.defineProperties,qs=Object.getOwnPropertyDescriptors,Ze=Object.getOwnPropertySymbols,Qs=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable,Ue=(r,t,e)=>t in r?Ks(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,er=(r,t)=>{for(var e in t||(t={}))Qs.call(t,e)&&Ue(r,e,t[e]);if(Ze)for(var e of Ze(t))tr.call(t,e)&&Ue(r,e,t[e]);return r},ir=(r,t)=>Js(r,qs(t));const sr=1,rr={x:0,y:0},nr=0,tt="";class m{static drawLine(t,e,i,s={}){const n=t.getContext("2d"),{color:o=tt,thickness:a=1,lineCap:l="round"}=s;n.save(),n.strokeStyle=o,n.lineWidth=a,n.lineCap=l,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(i.x+1,i.y+1),n.stroke(),n.restore()}static drawRect(t,e,i={}){const s=t.getContext("2d"),{color:n=tt,thickness:o=1,lineCap:a="round",hiddenText:l=!1,lineDash:h}=i;if(s.save(),s.strokeStyle=n,s.lineWidth=o,s.lineCap=a,Array.isArray(h)&&s.setLineDash(h),s.fillStyle=n,s.strokeRect(e.x,e.y,e.width,e.height),l===!1){let c="";if(e.attribute&&(c=`${c} ${e.attribute}`),this.drawText(t,{x:e.x,y:e.y-5},c),e.textAttribute){const d=`${~~e.width} * ${~~e.height}`.length*7,g=0,v=Math.max(20,e.width-d);this.drawText(t,{x:e.x,y:e.y+e.height+20+g},e.textAttribute,{textMaxWidth:v})}}s.restore()}static drawRectWithFill(t,e,i={}){const s=t.getContext("2d"),{color:n=tt}=i;s.save(),s.fillStyle=n,s.fillRect(e.x,e.y,e.width,e.height),s.restore()}static drawTagByDom(t,e,i){const s=t;if(!((e==null?void 0:e.length)>0))return;const n=document.createElement("div");return n.innerHTML=e,n.setAttribute("id",i),s==null||s.appendChild(n),n}static drawTag(t,e){var i;const s=t==null?void 0:t.parentNode,n=window.self.document.getElementById("tagToolTag");if(n&&s&&s.contains(n)&&(s==null||s.removeChild(n)),!((e==null?void 0:e.length)>0))return;const o=document.createElement("div");return o.innerHTML=(i=e.reduce((a,l)=>`${a}${l.keyName}: ${l.value.join(" \u3001 ")}
|
|
7
7
|
`,""))!=null?i:"",o.setAttribute("id","tagToolTag"),s==null||s.appendChild(o),o}static drawLineWithPointList(t,e,i={}){if(e.length<2)return;const s=t.getContext("2d"),{color:n=tt,thickness:o=1,lineCap:a="round",lineType:l=T.Line,lineDash:h,hoverEdgeIndex:c}=i;s.save(),(()=>{s.strokeStyle=n,s.lineWidth=o,s.lineCap=a,Array.isArray(h)?s.setLineDash(h):s.setLineDash([])})(),l===T.Curve?(c!==void 0&&c>-1&&e.push(e[0]),e=_.createSmoothCurvePointsFromPointList([...e],Y),c!==void 0&&c>-1&&(e=e.slice((Y+1)*c,(Y+1)*(c+1)))):c!==void 0&&c>-1&&(e=[...e,e[0]],e=e.slice(c,c+2));const d=[];s.beginPath(),s.moveTo(e[0].x,e[0].y);for(let f=0;f<e.length-1;f++)e[f].specialEdge&&d.push({i1:f,i2:f+1}),s.lineTo(e[f+1].x,e[f+1].y);s.stroke(),s.save(),s.lineWidth=o*.8,s.lineCap="butt",s.strokeStyle="white",s.setLineDash([3,3]),d.forEach(f=>{const b=e[f.i1],p=e[f.i2];s.beginPath(),s.moveTo(b.x,b.y),s.lineTo(p.x,p.y),s.stroke()}),s.restore();const g=4,v=2;return e.forEach(f=>{f.specialPoint&&(this.drawSpecialPoint(t,f,g+v,n),this.drawSpecialPoint(t,f,g,"white"))}),s.restore(),e}static drawCircle(t,e,i,s={}){const n=t.getContext("2d"),{startAngleDeg:o=0,endAngleDeg:a=360,thickness:l=1,color:h=tt,fill:c=tt}=s,u=Nt.deg2rad(o),d=Nt.deg2rad(a);n.save(),n.beginPath(),n.strokeStyle=h,n.fillStyle=c,n.lineWidth=l,n.arc(e.x,e.y,i,u,d,!1),n.stroke(),c&&n.fill(),n.closePath(),n.restore()}static drawCircleWithFill(t,e,i=3,s={}){const n=t.getContext("2d"),{color:o=tt}=s;n.save();const a=Nt.deg2rad(0),l=Nt.deg2rad(360);n.fillStyle=o,n.beginPath(),n.arc(e.x,e.y,i,a,l,!1),n.fill(),n.restore()}static drawSpecialPoint(t,e,i=6,s){const n=t.getContext("2d"),{x:o,y:a}=e;n.save(),n.beginPath(),n.fillStyle=s;const l=i*1.5,h=l*Math.sqrt(3)/2,c=l/2;n.moveTo(o,a-l),n.lineTo(o-h,a+c),n.lineTo(o+h,a+c),n.closePath(),n.fill(),n.restore()}static drawPolygon(t,e,i={}){const{isClose:s=!1,lineType:n=T.Line}=i;return s===!0&&(e=[...e,e[0]]),n===T.Curve&&(e=_.createSmoothCurvePointsFromPointList([...e])),this.drawLineWithPointList(t,e,ir(er({},i),{lineType:T.Line})),e}static drawPolygonWithFill(t,e,i={}){if(e.length<2)return;const s=t.getContext("2d"),{color:n=tt,lineType:o=T.Line}=i;s.save(),s.fillStyle=n,s.beginPath(),o===T.Curve&&(e=_.createSmoothCurvePointsFromPointList([...e,e[0]]));const[a,...l]=e;return s.moveTo(a.x,a.y),l.forEach(h=>{s.lineTo(h.x,h.y)}),s.fill(),s.restore(),e}static drawPolygonWithFillAndLine(t,e,i={}){const{strokeColor:s,fillColor:n,thickness:o,lineCap:a,isClose:l,lineType:h}=i,c=this.drawPolygon(t,e,{color:s,thickness:o,lineCap:a,isClose:l,lineType:h});return this.drawPolygonWithFill(t,e,{color:n,lineType:h}),c}static drawPolygonWithKeyPoint(t,e,i={}){const{pointColor:s="white",strokeColor:n}=i,o=this.drawPolygon(t,e,i);return o.forEach(a=>{this.drawCircleWithFill(t,a,4,{color:n}),this.drawCircleWithFill(t,a,3,{color:s})}),o}static drawSelectedPolygonWithFillAndLine(t,e,i={}){const{pointColor:s="white",strokeColor:n}=i,o=this.drawPolygonWithFillAndLine(t,e,i);return o.forEach(a=>{this.drawCircleWithFill(t,a,4,{color:n}),this.drawCircleWithFill(t,a,3,{color:s})}),o}static drawText(t,e,i,s={}){if(!i)return;const n=t.getContext("2d"),{color:o=tt,font:a=Mt,shadowColor:l="",shadowBlur:h=0,shadowOffsetX:c=0,shadowOffsetY:u=0,textMaxWidth:d=164,offsetX:g=0,offsetY:v=0,textAlign:f="start",lineHeight:b}=s;n.save(),n.textAlign=f,n.fillStyle=o!=null?o:"white",n.font=a,n.shadowColor=l,n.shadowOffsetX=c,n.shadowOffsetY=u,n.shadowBlur=h,this.wrapText(t,`${i}`,e.x+g,e.y+v,d,b),n.restore()}static wrapText(t,e,i,s,n,o){if(typeof e!="string"||typeof i!="number"||typeof s!="number")return;const a=t.getContext("2d");typeof n=="undefined"&&(n=t&&t.width||300),typeof o=="undefined"&&(o=t&&parseInt(window.getComputedStyle(t).lineHeight,10)||parseInt(window.getComputedStyle(document.body).lineHeight,10));const l=e.split(`
|
|
8
8
|
`);for(let h=0;h<l.length;h++){const c=l[h].split("");let u="";for(let d=0;d<c.length;d++){const g=u+c[d],f=a.measureText(g).width;n||(n=300),f>n&&d>0?(a.fillText(u,i,s),u=c[d],s+=o):u=g}a.fillText(u,i,s),s+=o}}static drawArrow(t,e,i,s={}){const{color:n=tt,thickness:o=1,lineCap:a="round",theta:l=30,headLen:h=10}=s,c=Math.atan2(e.y-i.y,e.x-i.x)*180/Math.PI,u=(c+l)*Math.PI/180,d=(c-l)*Math.PI/180,g=h*Math.cos(u),v=h*Math.sin(u),f=h*Math.cos(d),b=h*Math.sin(d);t.save(),t.strokeStyle=n,t.lineWidth=o,t.lineCap=a,t.beginPath(),t.moveTo(i.x+g,i.y+v),t.lineTo(i.x,i.y),t.lineTo(i.x+f,i.y+b),t.stroke(),t.restore()}static drawArrowByCanvas(t,e,i,s={}){const n=t.getContext("2d");this.drawArrow(n,e,i,s)}}m.drawImg=(r,t,e={})=>{const i=r.getContext("2d"),{zoom:s=sr,currentPos:n=rr,rotate:o=nr,imgAttribute:a}=e;switch(i.save(),o){case 0:i.translate(n.x,n.y);break;case 90:i.translate(n.x+t.height*s,n.y),i.rotate(90*Math.PI/180);break;case 180:i.translate(n.x+t.width*s,n.y+t.height*s),i.rotate(Math.PI);break;case 270:i.translate(n.x,n.y+t.width*s),i.rotate(270*Math.PI/180);break;default:i.translate(n.x,n.y);break}if(a){const{contrast:l,saturation:h,brightness:c}=a;i.filter=`saturate(${h+100}%) contrast(${l+100}%) brightness(${c+100}%)`}i.drawImage(t,0,0,t.width*s,t.height*s),i.restore()};class et{static getStrokeAndFill(t,e=!0,i={}){const{isSelected:s=!1,isHover:n=!1}=i;return s?{stroke:e?t.validSelected.stroke:t.invalidSelected.stroke,fill:e?t.validSelected.fill:t.invalidSelected.fill}:n?{stroke:e?t.validHover.stroke:t.invalidHover.stroke,fill:e?t.validHover.fill:t.invalidHover.fill}:{stroke:e?t.valid.stroke:t.invalid.stroke,fill:e?t.valid.fill:t.invalid.fill}}static getStyle2String(t){if(!!t)return Object.entries(t).reduce((e,i)=>`${e} ${i[0]}: ${i[1]};`,"")}}class st{static getMousePositionOnCanvasFromEvent(t,e){if(e&&t){const i=e.getBoundingClientRect();return{x:t.clientX-i.left,y:t.clientY-i.top}}return null}static getClientRect(t){if(t){const e=t.getBoundingClientRect();return{x:e.left,y:e.top,width:e.width,height:e.height}}return null}static getSize(t){if(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}return null}static inViewPort(t,e){return t?P.isInRange(t.x,[e.left,e.right])&&P.isInRange(t.y,[e.top,e.bottom]):!1}}st.getViewPort=(r,t,e)=>{const{width:i,height:s}=r,{x:n,y:o}=t,a=(0-o)/e,l=(0-n)/e,h=a+s/e,c=l+i/e;return{top:a,bottom:h,left:l,right:c}},st.getPixelRatio=r=>{if(!r||!window)return 1;const t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t};const ze={showConfirm:!1,skipWhileNoDependencies:!1,drawOutsideTarget:!1,copyBackwardResult:!1,minWidth:1,minHeight:1,isShowOrder:!1,filterData:["valid","invalid"],attributeConfigurable:!1,attributeList:[],textConfigurable:!1,textCheckType:0,customFormat:""},or={showConfirm:!1,skipWhileNoDependencies:!1,inputList:[{key:"\u7C7B\u522B1",value:"class1",isMulti:!1,subSelected:[{key:"\u9009\u98791",value:"option1",isDefault:!1},{key:"\u9009\u98792",value:"option1-2",isDefault:!1}]},{key:"\u7C7B\u522B2",value:"class-AH",isMulti:!0,subSelected:[{key:"\u9009\u98792-1",value:"option2-1",isDefault:!1},{key:"\u9009\u98792-2",value:"option2-2",isDefault:!1},{key:"\u9009\u98792-3",value:"option2-3",isDefault:!1}]},{key:"\u7C7B\u522B3",value:"class-0P",isMulti:!1,subSelected:[{key:"\u9009\u98793-1",value:"option3-1",isMulti:!1},{key:"\u9009\u98793-2",value:"option3-2",isDefault:!1},{key:"\u9009\u98793-3",value:"option3-3",isDefault:!1}]}]},ar={lineType:0,lineColor:0,edgeAdsorption:!1,outOfTarget:!0,copyBackwardResult:!1,isShowOrder:!1,attributeConfigurable:!1,attributeList:[{key:"\u7C7B\u522B1",value:"\u7C7B\u522B1"},{key:"\u7C7B\u522Bao",value:"class-ao"},{key:"\u7C7B\u522BM1",value:"class-M1"},{key:"\u7C7B\u522BCm",value:"class-Cm"},{key:"\u7C7B\u522Bc3",value:"class-c3"},{key:"\u7C7B\u522Ba0",value:"class-a0"},{key:"\u7C7B\u522Bu7",value:"class-u7"},{key:"\u7C7B\u522BZb",value:"class-Zb"},{key:"\u7C7B\u522Bzi",value:"class-zi"}],textConfigurable:!1,textCheckType:2,customFormat:"",showConfirm:!1,lowerLimitPointNum:2,upperLimitPointNum:"",preReferenceStep:0,skipWhileNoDependencies:!1,filterData:["valid","invalid"]},lr={showConfirm:!1,skipWhileNoDependencies:!1,enableTextRecognition:!1,recognitionMode:"general",configList:[{label:"\u6587\u672C",key:"text",required:!1,default:"",maxLength:1e3}],filterData:["valid","invalid"]},hr={lineType:0,lineColor:0,lowerLimitPointNum:3,edgeAdsorption:!1,drawOutsideTarget:!1,copyBackwardResult:!1,isShowOrder:!1,attributeConfigurable:!1,attributeList:[],textConfigurable:!0,textCheckType:0,customFormat:""},We=r=>r==="lineTool"?ar:r==="rectTool"?ze:r==="tagTool"?or:r==="textTool"?lr:r==="polygonTool"?hr:ze,Ve={toolColor:{1:{valid:{stroke:"rgba(0,0,255,0.50)",fill:"rgba(0,0,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(0,15,255,1.00)",fill:"rgba(0,15,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(0,15,255,0.80)",fill:"rgba(0,15,255,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}},3:{valid:{stroke:"rgba(0,255,255,0.50)",fill:"rgba(0,255,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(0,212,255,1.00)",fill:"rgba(0,212,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(0,212,255,0.80)",fill:"rgba(0,212,255,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}},5:{valid:{stroke:"rgba(0,255,0,0.50)",fill:"rgba(0,255,0,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(149,255,1.00)",fill:"rgba(149,255,0,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(149,255,0,0.80)",fill:"rgba(149,255,0,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}},7:{valid:{stroke:"rgba(255,255,0,0.50)",fill:"rgba(255,255,0,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(255,230,102,1.00)",fill:"rgba(255,213,0,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(255,230,102,0.80)",fill:"rgba(255,230,102,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}},9:{valid:{stroke:"rgba(255,0,255,0.50)",fill:"rgba(255,0,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(230,102,255,1.00)",fill:"rgba(213,0,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(230,102,255,0.80)",fill:"rgba(230,102,255,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}}},attributeColor:[{valid:{stroke:"rgba(204,204,204,1.00)",fill:"rgba(204,204,204,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(204,204,204,1.00)",fill:"rgba(204,204,204,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(204,204,204,1.00)",fill:"rgba(204,204,204,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(153,51,255,1.00)",fill:"rgba(153,51,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(153,51,255,1.00)",fill:"rgba(153,51,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(153,51,255,1.00)",fill:"rgba(153,51,255,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(51,254,51,1.00)",fill:"rgba(51,254,51,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(51,254,51,1.00)",fill:"rgba(51,254,51,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(51,254,51,1.00)",fill:"rgba(51,254,51,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(255,51,255,1.00)",fill:"rgba(255,51,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(255,51,255,1.00)",fill:"rgba(255,51,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(255,51,255,1.00)",fill:"rgba(255,51,255,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(204,255,51,1.00)",fill:"rgba(204,255,51,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(204,255,51,1.00)",fill:"rgba(204,255,51,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(204,255,51,1.00)",fill:"rgba(204,255,51,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(51,153,255,1.00)",fill:"rgba(51,153,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(51,153,255,1.00)",fill:"rgba(51,153,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(51,153,255,1.00)",fill:"rgba(51,153,255,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(255,153,51,1.00)",fill:"rgba(255,153,51,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(255,153,51,1.00)",fill:"rgba(255,153,51,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(255,153,51,1.00)",fill:"rgba(255,153,51,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(51,255,238,1.00)",fill:"rgba(51,255,238,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(51,255,238,1.00)",fill:"rgba(51,255,238,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(51,255,238,1.00)",fill:"rgba(51,255,238,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(255,221,51,1.00)",fill:"rgba(255,221,51,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(255,221,51,1.00)",fill:"rgba(255,221,51,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(255,221,51,1.00)",fill:"rgba(255,221,51,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}}],lineColor:{1:"rgba(102, 111, 255, 1 )",3:"rgba(102, 230, 255, 1)",5:"rgba(191, 255, 102, 1)",7:"rgba(255, 230, 102, 1)",9:"rgba(230, 102, 255, 1)"},attributeLineColor:["rgba(204, 204, 204, 1)","rgba(153, 51, 255, 1)","rgba(51, 254, 51, 1)","rgba(255, 51, 255, 1)","rgba(204, 255, 51, 1)","rgba(51, 153, 255, 1)","rgba(255, 153, 51, 1)","rgba(51, 255, 238, 1)","rgba(255, 221, 51, 1)"],color:1,width:2,opacity:9};var cr=Object.defineProperty,dr=Object.defineProperties,ur=Object.getOwnPropertyDescriptors,je=Object.getOwnPropertySymbols,gr=Object.prototype.hasOwnProperty,fr=Object.prototype.propertyIsEnumerable,Xe=(r,t,e)=>t in r?cr(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ye=(r,t)=>{for(var e in t||(t={}))gr.call(t,e)&&Xe(r,e,t[e]);if(je)for(var e of je(t))fr.call(t,e)&&Xe(r,e,t[e]);return r},Ge=(r,t)=>dr(r,ur(t)),Ke;(function(r){r[r.Create=0]="Create",r[r.Active=1]="Active",r[r.Edit=1]="Edit",r[r.None=2]="None"})(Ke||(Ke={}));var Je;(function(r){r.ActiveArea="#B3B8FF"})(Je||(Je={}));const qe=16,vr=3,U=class{static isInLine(r,t,e,i=3){const{length:s}=P.getFootOfPerpendicular(r,t,e);return s<i}};let M=U;M.setSpecialEdgeStyle=r=>{r.lineCap="butt",r.setLineDash([10,10])},M.setReferenceCtx=r=>{r.lineCap="butt",r.setLineDash([6])},M.calcOptimalIntersection=(r,t,e,i,s)=>{let n,o=Infinity,a;if(r.find((h,c)=>{if(c===0)return;const u=U.isInLine(t.pointA,h,r[c-1]),d=U.isInLine(t.pointB,h,r[c-1]);return u&&d}))return{point:e};if(r.forEach((h,c)=>{if(c===0)return;const u={pointA:r[c-1],pointB:h},d=U.lineIntersection(t,u);if(d&&t){const{onLine2:g,onLine1:v,x:f,y:b}=d,p=U.calcDistance(e,d);if(U.isOnLine(t.pointB.x,t.pointB.y,h.x,h.y,r[c-1].x,r[c-1].y)){if(U.calcDistance(e,d)<i/s){const D=t.pointB,{footPoint:R,length:E}=P.getFootOfPerpendicular(D,u.pointA,u.pointB,!0);if(E!==void 0){const H=U.calcDistance(u.pointA,R),k=U.calcDistance(u.pointB,R);a={point:R,minDistance:E},E===Infinity&&(a.point=H>k?u.pointB:u.pointA)}}return}p<o&&g&&v&&(o=p,n={x:f,y:b})}}),n)return{point:n,minDistance:o};if(a)return a},M.lineIntersection=(r,t)=>{let e=!1,i=!1;const s=U.getAxisDiff(r),n=U.getAxisDiff(t),o=n.y*s.x-n.x*s.y;if(o===0)return!1;let a=r.pointA.y-t.pointA.y,l=r.pointA.x-t.pointA.x;const h=(t.pointB.x-t.pointA.x)*a-(t.pointB.y-t.pointA.y)*l,c=(r.pointB.x-r.pointA.x)*a-(r.pointB.y-r.pointA.y)*l;a=h/o,l=c/o,a>0&&a<1&&(e=!0),l>0&&l<1&&(i=!0);const u=r.pointA.x+a*(r.pointB.x-r.pointA.x),d=r.pointA.y+a*(r.pointB.y-r.pointA.y);return{x:u,y:d,onLine1:e,onLine2:i}},M.getAxisDiff=r=>({x:r.pointB.x-r.pointA.x,y:r.pointB.y-r.pointA.y}),M.calcDistance=(r,t)=>Math.sqrt(Math.pow(Math.abs(r.x-t.x),2)+Math.pow(Math.abs(r.y-t.y),2)),M.drawCurveLine=(r,t,e,i=!0,s=!1,n)=>{const o=Et(t,qe);r.save(),r.lineCap="round",r.lineJoin="round",r.strokeStyle=e.color,i&&(r.lineWidth=e.lineWidth),s&&U.setReferenceCtx(r),t.forEach((a,l)=>{const h=a==null?void 0:a.specialEdge,c=o.splice(0,qe+1);r.save(),r.beginPath(),n===l&&(r.lineWidth=4),c.forEach(({x:u,y:d},g)=>{const v=g>0?"lineTo":"moveTo";h&&U.setSpecialEdgeStyle(r),r[v](u,d)}),r.stroke(),r.restore()}),r.restore()},M.calcTwoPointDistance=(r,t)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2)),M.pointOverTarget=(r,t,e,i,s,n,o,a,l,h)=>{const c=r;if(!t)return r;if(e===L.Polygon){const u=U.getPolygonPointList(i,s);if(u.length===0||_.isInPolygon(r,u))return c;const g=u.concat(u[0]).map(y=>l(y)),v=l(t),f=l(r),b={pointA:v,pointB:f},p=U.calcOptimalIntersection(g,b,v,o,a);if(p){const y=h(p==null?void 0:p.point);c.x=y.x,c.y=y.y}else return t;return c}if(e===L.Rect){const{x:u,y:d,width:g,height:v}=i;return c.x=P.withinRange(c.x,[u,u+g]),c.y=P.withinRange(c.y,[d,d+v]),c}return c.x=P.withinRange(c.x,[0,n.width]),c.y=P.withinRange(c.y,[0,n.height]),c},M.getPolygonPointList=(r,t)=>{const{pointList:e}=r,{lineType:i}=t;return i===T.Line?e:_.createSmoothCurvePoints(e.reduce((s,n)=>[...s,n.x,n.y],[]),.5,!0,20)},M.isOnLine=(r,t,e,i,s,n)=>Math.abs((a=>(i-t)/(e-r)*(a-r)+t)(s)-n)<1e-6&&s>=r&&s<=e,M.inArea=({top:r,left:t,right:e,bottom:i},{x:s,y:n})=>n>=r&&n<=i&&s>=t&&s<=e,M.getVHPoint=(r,t,e,i)=>{const s=U.getAngle(r,e);return Math.abs(s)<45?Ge(Ye({},t),{y:i.y}):Ge(Ye({},t),{x:i.x})},M.getAngle=(r,t)=>{const e=t.x-r.x,i=t.y-r.y;return 360*Math.atan(i/e)/(2*Math.PI)};var re;(function(r){r[r.A=65]="A",r[r.B=66]="B",r[r.C=67]="C",r[r.D=68]="D",r[r.E=69]="E",r[r.F=70]="F",r[r.G=71]="G",r[r.H=72]="H",r[r.L=76]="L",r[r.R=82]="R",r[r.Z=90]="Z",r[r.W=87]="W",r[r.X=88]="X",r[r.Y=89]="Y",r[r.S=83]="S",r[r.Q=81]="Q",r[r.Delete=46]="Delete",r[r.F11=122]="F11",r[r.Space=32]="Space",r[r.Esc=27]="Esc",r[r.Left=37]="Left",r[r.Up=38]="Up",r[r.Right=39]="Right",r[r.Down=40]="Down",r[r.Enter=13]="Enter",r[r.Ctrl=17]="Ctrl",r[r.Alt=18]="Alt",r[r.Shift=16]="Shift",r[r.Tab=9]="Tab",r[r.BackSpace=8]="BackSpace"})(re||(re={}));var A=re,pr=Object.freeze({__proto__:null,default:A});class ne{constructor(t){this.record=[],this.recordIndex=-1,this.minRecordIndex=-1,this.emitHistoryChanged=()=>{this.historyChanged&&(this.constructor.name==="ActionsHistory"?!0:this.record.length>0)&&this.historyChanged(this.undoEnabled,this.redoEnabled)},this.historyChanged=t}get undoEnabled(){return this.recordIndex>this.minRecordIndex}get redoEnabled(){return this.recordIndex<this.record.length-1}pushHistory(t){if(this.recordIndex!==this.record.length-1){const e=this.record.slice(0,Math.min(this.recordIndex+1,this.record.length));this.record=e}this.record.push(F.cloneDeepWith(t)),this.recordIndex+=1,this.emitHistoryChanged()}updateHistory(t){this.record[this.recordIndex]=F.cloneDeep(t)}applyAttribute(t,e,i){t&&this.record.forEach(s=>{const n=s.find(o=>o.id===t);n&&(n[e]=i)})}undo(){if(this.undoEnabled)return this.recordIndex-=1,this.emitHistoryChanged(),F.cloneDeep(this.record[this.recordIndex])||[]}redo(){if(this.redoEnabled)return this.recordIndex+=1,this.emitHistoryChanged(),F.cloneDeep(this.record[this.recordIndex])}init(){this.record=[[]],this.recordIndex=0,this.emitHistoryChanged()}empty(){this.record=[],this.recordIndex=-1,this.emitHistoryChanged()}initRecord(t,e=!1){const i=t.length>0||e;this.record=i?[F.cloneDeep(t)]:[],this.minRecordIndex=i?0:-1,this.recordIndex=0}}class Qe{constructor(t,e){this.rcTime=0,this.mouseDownTime=0,this.onMouseDown=()=>{this.mouseDownTime=new Date().getTime()},this.dom=t,this.isDoubleClick=!1,this.delay=e}getRcTime(){return this.rcTime}getCoord(t){return{x:t.clientX,y:t.clientY}}removeEvent(){!this.dom||(this.dom.removeEventListener("mouseup",this.mouseUp),this.dom.removeEventListener("mousemove",this.mouseMove),this.dom.removeEventListener("dblclick",this.dblclick),this.dom.removeEventListener("mousedown",this.onMouseDown))}addEvent(t,e,i,s){!this.dom||(this.removeEvent(),this.mouseUp=n=>{const o=new Date().getTime(),a=s?s(n):!0;if(o-this.mouseDownTime>this.delay||a!==!0){t(n);return}if(n.button===2)if(this.rcTime===0)setTimeout(()=>{this.rcTime=0},this.delay),this.rcTime=o;else{o-this.rcTime<this.delay&&(i(n),clearTimeout(this.setTimeFun),this.cacheFunction=void 0),this.rcTime=0;return}this.setTimeFun&&clearTimeout(this.setTimeFun),this.clickCoord=this.getCoord(n),this.cacheFunction=()=>t(n),this.setTimeFun=setTimeout(()=>{if(this.isDoubleClick){this.isDoubleClick=!1;return}this.cacheFunction(),this.clickCoord=void 0},this.delay)},this.mouseMove=n=>{const o=this.getCoord(n);this.clickCoord&&!I.getIsInScope(o,this.clickCoord,10)&&(this.cacheFunction&&this.cacheFunction(),this.clickCoord=void 0,this.cacheFunction=null,clearTimeout(this.setTimeFun))},this.dblclick=n=>{this.isDoubleClick=!0,this.clickCoord=void 0,e(n)},this.dom.addEventListener("mouseup",this.mouseUp),this.dom.addEventListener("mousemove",this.mouseMove),this.dom.addEventListener("dblclick",this.dblclick),this.dom.addEventListener("mousedown",this.onMouseDown))}clearRightDblClick(){this.rcTime=0}}class ti{static getInitImgPos(t,e,i=0,s=1,n=!1){(i===90||i===270)&&(e={width:e.height,height:e.width});const o=t.width*s/e.width,a=t.height*s/e.height;let l=n?1:Math.min(o,a);const h={x:(t.width-e.width*l)/2,y:(t.height-e.height*l)/2},c=e.width*l,u=e.height*l;return n&&(l=1),{zoom:l,currentPos:h,imgInfo:{width:c,height:u}}}static getBasicRecPos(t,e,i,s=.9,n=1,o=!1){if(e&&t){const{x:a,y:l,height:h,width:c}=e;let u=i.height/h;c/h>i.width/i.height&&(u=i.width/c);const d=o?1:u*s*n,g={x:i.width/2,y:i.height/2},v={x:(a+c/2)*d,y:(l+h/2)*d};return{currentPos:{x:g.x-v.x,y:g.y-v.y},innerZoom:d}}return!1}}class br{static renderInvalidPage(t,e,i){const s=document.createElement("div");return s.setAttribute("style",`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-annotation",
|
|
3
|
-
"version": "1.8.0
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Annotation tool collection",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"annotation",
|
|
@@ -90,9 +90,10 @@
|
|
|
90
90
|
"typescript": "^4.2.3"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@labelbee/lb-utils": "^1.2.0
|
|
93
|
+
"@labelbee/lb-utils": "^1.2.0",
|
|
94
94
|
"@turf/turf": "5.1.6",
|
|
95
95
|
"color-rgba": "^2.3.0",
|
|
96
96
|
"lodash": "^4.17.20"
|
|
97
|
-
}
|
|
97
|
+
},
|
|
98
|
+
"gitHead": "ae9450289598ba414b15a4ccad4a5a3474aa4603"
|
|
98
99
|
}
|
package/es/.DS_Store
DELETED
|
Binary file
|