@ingcreators/annot-core 0.1.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/CHANGELOG.md +7 -0
- package/LICENSE +201 -0
- package/README.md +56 -0
- package/dist/auto-capture-options.d.ts +78 -0
- package/dist/editor/arrow-markers.d.ts +142 -0
- package/dist/editor/bake-translate.d.ts +192 -0
- package/dist/editor/font-registry.d.ts +58 -0
- package/dist/editor/gradient-utils.d.ts +23 -0
- package/dist/editor/history-core.d.ts +48 -0
- package/dist/editor/icons/brand-icons.d.ts +53 -0
- package/dist/editor/icons/material-symbols.d.ts +105 -0
- package/dist/editor/icons/registry.d.ts +179 -0
- package/dist/editor/icons/render.d.ts +22 -0
- package/dist/editor/icons/sanitize.d.ts +60 -0
- package/dist/editor/index.d.ts +13 -0
- package/dist/editor/path-utils.d.ts +32 -0
- package/dist/editor/property-schema.d.ts +263 -0
- package/dist/editor/rich-text-mapper.d.ts +8 -0
- package/dist/editor/selection-geometry.d.ts +66 -0
- package/dist/editor/shape-utils.d.ts +27 -0
- package/dist/editor/svg-format.d.ts +68 -0
- package/dist/editor/svg-id-utils.d.ts +37 -0
- package/dist/editor/svg-to-annotation-shapes.d.ts +34 -0
- package/dist/editor/text-utils.d.ts +212 -0
- package/dist/editor/tool-lifecycle.d.ts +56 -0
- package/dist/editor/tool-options.d.ts +126 -0
- package/dist/editor/tool-panel-adapter.d.ts +105 -0
- package/dist/editor/tool-preset-serde.d.ts +43 -0
- package/dist/editor/tool-registry.d.ts +320 -0
- package/dist/editor/tool-style-reader.d.ts +36 -0
- package/dist/editor/tool-style-writer.d.ts +33 -0
- package/dist/editor/toolbar-icons.d.ts +84 -0
- package/dist/editor/transform-utils.d.ts +127 -0
- package/dist/editor/viewport-math.d.ts +69 -0
- package/dist/encode/index.d.ts +4 -0
- package/dist/encode/options.d.ts +79 -0
- package/dist/encode/png8.d.ts +10 -0
- package/dist/headless.d.ts +29 -0
- package/dist/icons/index.d.ts +15 -0
- package/dist/icons/types.d.ts +108 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3164 -0
- package/dist/storage/errors.d.ts +59 -0
- package/dist/storage/index.d.ts +6 -0
- package/dist/storage/metadata-cache.d.ts +231 -0
- package/dist/storage/path.d.ts +49 -0
- package/dist/storage/thumbnail-cache.d.ts +110 -0
- package/dist/storage/thumbnail.d.ts +31 -0
- package/dist/storage/types.d.ts +677 -0
- package/dist/utils/assert.d.ts +31 -0
- package/dist/utils/constants.d.ts +10 -0
- package/dist/utils/dash-utils.d.ts +6 -0
- package/dist/utils/desktop-bridge.d.ts +349 -0
- package/dist/utils/filename.d.ts +48 -0
- package/dist/utils/id.d.ts +21 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/types.d.ts +20 -0
- package/dist/xmp/xmp-browser.d.ts +39 -0
- package/dist/zip/zip-builder.d.ts +8 -0
- package/dist/zip/zip-bytes.d.ts +22 -0
- package/package.json +58 -0
- package/styles/editor.css +1912 -0
- package/styles/fonts.css +46 -0
- package/styles/property-panel.css +779 -0
- package/styles/toolbar.css +673 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3164 @@
|
|
|
1
|
+
//#region src/editor/font-registry.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"Annot Sans",
|
|
4
|
+
"Annot Serif",
|
|
5
|
+
"Annot Mono"
|
|
6
|
+
], t = {
|
|
7
|
+
"Annot Sans": [
|
|
8
|
+
"-apple-system",
|
|
9
|
+
"BlinkMacSystemFont",
|
|
10
|
+
"\"Segoe UI\"",
|
|
11
|
+
"\"Helvetica Neue\"",
|
|
12
|
+
"Arial",
|
|
13
|
+
"\"Hiragino Sans\"",
|
|
14
|
+
"\"Yu Gothic UI\"",
|
|
15
|
+
"\"Yu Gothic\"",
|
|
16
|
+
"Meiryo",
|
|
17
|
+
"\"MS PGothic\"",
|
|
18
|
+
"\"PingFang SC\"",
|
|
19
|
+
"\"Microsoft YaHei\"",
|
|
20
|
+
"\"Apple SD Gothic Neo\"",
|
|
21
|
+
"\"Malgun Gothic\"",
|
|
22
|
+
"\"Nirmala UI\"",
|
|
23
|
+
"Tahoma",
|
|
24
|
+
"sans-serif",
|
|
25
|
+
"\"Apple Color Emoji\"",
|
|
26
|
+
"\"Segoe UI Emoji\""
|
|
27
|
+
].join(", "),
|
|
28
|
+
"Annot Serif": [
|
|
29
|
+
"Cambria",
|
|
30
|
+
"Georgia",
|
|
31
|
+
"\"Yu Mincho\"",
|
|
32
|
+
"\"Hiragino Mincho ProN\"",
|
|
33
|
+
"\"SimSun\"",
|
|
34
|
+
"\"Noto Serif CJK SC\"",
|
|
35
|
+
"serif"
|
|
36
|
+
].join(", "),
|
|
37
|
+
"Annot Mono": [
|
|
38
|
+
"\"SF Mono\"",
|
|
39
|
+
"Menlo",
|
|
40
|
+
"Consolas",
|
|
41
|
+
"\"Cascadia Mono\"",
|
|
42
|
+
"\"Yu Gothic Mono\"",
|
|
43
|
+
"\"Noto Sans Mono CJK JP\"",
|
|
44
|
+
"monospace"
|
|
45
|
+
].join(", ")
|
|
46
|
+
}, n = {
|
|
47
|
+
"Annot Sans": {
|
|
48
|
+
latin: "Calibri",
|
|
49
|
+
ea: "Yu Gothic UI",
|
|
50
|
+
cs: "Arial"
|
|
51
|
+
},
|
|
52
|
+
"Annot Serif": {
|
|
53
|
+
latin: "Cambria",
|
|
54
|
+
ea: "Yu Mincho",
|
|
55
|
+
cs: "Times New Roman"
|
|
56
|
+
},
|
|
57
|
+
"Annot Mono": {
|
|
58
|
+
latin: "Consolas",
|
|
59
|
+
ea: "MS Gothic",
|
|
60
|
+
cs: "Courier New"
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
function r(e) {
|
|
64
|
+
return t[e];
|
|
65
|
+
}
|
|
66
|
+
function i(e) {
|
|
67
|
+
return n[e];
|
|
68
|
+
}
|
|
69
|
+
function a(t) {
|
|
70
|
+
return t == null ? !1 : e.includes(t);
|
|
71
|
+
}
|
|
72
|
+
function o(e) {
|
|
73
|
+
return a(e) ? e : "Annot Sans";
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/editor/history-core.ts
|
|
77
|
+
var s = 100;
|
|
78
|
+
function c(e) {
|
|
79
|
+
let t = [], n = [], r = e.maxDepth ?? 100, i = () => {
|
|
80
|
+
e.onStateChange?.();
|
|
81
|
+
}, a = {
|
|
82
|
+
save() {
|
|
83
|
+
t.push(e.getSnapshot()), n.length = 0, t.length > r && t.shift(), i();
|
|
84
|
+
},
|
|
85
|
+
undo() {
|
|
86
|
+
if (t.length <= 1) return !1;
|
|
87
|
+
let r = t.pop();
|
|
88
|
+
return n.push(r), e.setSnapshot(t[t.length - 1]), e.onRestore?.(), i(), !0;
|
|
89
|
+
},
|
|
90
|
+
redo() {
|
|
91
|
+
if (n.length === 0) return !1;
|
|
92
|
+
let r = n.pop();
|
|
93
|
+
return t.push(r), e.setSnapshot(r), e.onRestore?.(), i(), !0;
|
|
94
|
+
},
|
|
95
|
+
get canUndo() {
|
|
96
|
+
return t.length > 1;
|
|
97
|
+
},
|
|
98
|
+
get canRedo() {
|
|
99
|
+
return n.length > 0;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
return a.save(), a;
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/editor/toolbar-icons.ts
|
|
106
|
+
var l = {
|
|
107
|
+
rect: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linejoin=\"miter\" aria-hidden=\"true\"><rect x=\"4\" y=\"4\" width=\"16\" height=\"16\"/></svg>",
|
|
108
|
+
rounded: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"5\"/></svg>",
|
|
109
|
+
ellipse: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><ellipse cx=\"12\" cy=\"12\" rx=\"8\" ry=\"8\"/></svg>"
|
|
110
|
+
}, u = {
|
|
111
|
+
none: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M4 12 H20\"/></svg>",
|
|
112
|
+
end: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M4 12 H20\"/><path d=\"M16 8 L20 12 L16 16\"/></svg>",
|
|
113
|
+
both: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M4 12 H20\"/><path d=\"M16 8 L20 12 L16 16\"/><path d=\"M8 8 L4 12 L8 16\"/></svg>"
|
|
114
|
+
}, d = {
|
|
115
|
+
circle: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><ellipse cx=\"12\" cy=\"12\" rx=\"8\" ry=\"8\"/><text x=\"12\" y=\"17\" text-anchor=\"middle\" font-size=\"14\" font-weight=\"800\" font-family=\"system-ui, sans-serif\" fill=\"currentColor\" stroke=\"none\">1</text></svg>",
|
|
116
|
+
rect: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linejoin=\"miter\" aria-hidden=\"true\"><rect x=\"4\" y=\"4\" width=\"16\" height=\"16\"/><text x=\"12\" y=\"17\" text-anchor=\"middle\" font-size=\"14\" font-weight=\"800\" font-family=\"system-ui, sans-serif\" fill=\"currentColor\" stroke=\"none\">1</text></svg>",
|
|
117
|
+
rounded: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"5\"/><text x=\"12\" y=\"17\" text-anchor=\"middle\" font-size=\"14\" font-weight=\"800\" font-family=\"system-ui, sans-serif\" fill=\"currentColor\" stroke=\"none\">1</text></svg>"
|
|
118
|
+
}, f = [
|
|
119
|
+
{
|
|
120
|
+
value: "#ffe100",
|
|
121
|
+
label: "Yellow"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
value: "#7bff7b",
|
|
125
|
+
label: "Green"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
value: "#ff91e0",
|
|
129
|
+
label: "Pink"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
value: "#7be0ff",
|
|
133
|
+
label: "Blue"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
value: "#ffb84c",
|
|
137
|
+
label: "Orange"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
value: "#c991ff",
|
|
141
|
+
label: "Purple"
|
|
142
|
+
}
|
|
143
|
+
], p = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.42 7.42 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z\"/></svg>", m = {
|
|
144
|
+
add: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M450-450H200v-60h250v-250h60v250h250v60H510v250h-60v-250Z\"/></svg>",
|
|
145
|
+
add_to_drive: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M210-100q-12 0-25.5-7.5T165-126L55-318q-6-11-6-26t6-26l270-464q6-11 19.5-18.5T370-860h220q12 0 25.5 7.5T635-834l187 321q-18-5-36.5-7t-37.5-1L585-800H375L109-344l105 184h338q10 17 22.5 32t26.5 28H210Zm80-180-29-51 183-319h72l101 176q-13 9-23.5 20T573-431l-93-161-145 252h193q-4 14-6 29t-2 31H290Zm440 150v-120H610v-60h120v-120h60v120h120v60H790v120h-60Z\"/></svg>",
|
|
146
|
+
align_horizontal_center: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M450-80v-210H240v-100h210v-180H120v-100h330v-210h60v210h330v100H510v180h210v100H510v210h-60Z\"/></svg>",
|
|
147
|
+
align_horizontal_left: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M80-80v-800h60v800H80Zm160-210v-100h400v100H240Zm0-280v-100h640v100H240Z\"/></svg>",
|
|
148
|
+
align_horizontal_right: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M820-80v-800h60v800h-60ZM320-290v-100h400v100H320ZM80-570v-100h640v100H80Z\"/></svg>",
|
|
149
|
+
align_vertical_bottom: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M80-80v-60h800v60H80Zm210-160v-640h100v640H290Zm280 0v-400h100v400H570Z\"/></svg>",
|
|
150
|
+
align_vertical_center: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M290-120v-330H80v-60h210v-330h100v330h180v-210h100v210h210v60H670v210H570v-210H390v330H290Z\"/></svg>",
|
|
151
|
+
align_vertical_top: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M290-80v-640h100v640H290Zm280-240v-400h100v400H570ZM80-820v-60h800v60H80Z\"/></svg>",
|
|
152
|
+
apps: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M179-179q-19-19-19-47t19-47q19-19 47-19t47 19q19 19 19 47t-19 47q-19 19-47 19t-47-19Zm254 0q-19-19-19-47t19-47q19-19 47-19t47 19q19 19 19 47t-19 47q-19 19-47 19t-47-19Zm254 0q-19-19-19-47t19-47q19-19 47-19t47 19q19 19 19 47t-19 47q-19 19-47 19t-47-19ZM179-433q-19-19-19-47t19-47q19-19 47-19t47 19q19 19 19 47t-19 47q-19 19-47 19t-47-19Zm254 0q-19-19-19-47t19-47q19-19 47-19t47 19q19 19 19 47t-19 47q-19 19-47 19t-47-19Zm254 0q-19-19-19-47t19-47q19-19 47-19t47 19q19 19 19 47t-19 47q-19 19-47 19t-47-19ZM179-687q-19-19-19-47t19-47q19-19 47-19t47 19q19 19 19 47t-19 47q-19 19-47 19t-47-19Zm254 0q-19-19-19-47t19-47q19-19 47-19t47 19q19 19 19 47t-19 47q-19 19-47 19t-47-19Zm254 0q-19-19-19-47t19-47q19-19 47-19t47 19q19 19 19 47t-19 47q-19 19-47 19t-47-19Z\"/></svg>",
|
|
153
|
+
arrow_right_alt: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"m560-242-43-42 168-168H160v-60h525L516-681l43-42 241 241-240 240Z\"/></svg>",
|
|
154
|
+
arrow_selector_tool: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"m300-347 109-153h218L300-757v410ZM560-84 412-401 240-160v-720l560 440H505l145 314-90 42ZM409-500Z\"/></svg>",
|
|
155
|
+
article: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M277-279h275v-60H277v60Zm0-171h406v-60H277v60Zm0-171h406v-60H277v60Zm-97 501q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h600v-600H180v600Zm0-600v600-600Z\"/></svg>",
|
|
156
|
+
blur_on: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M106-387q-6-6-6-15t6-15q6-6 15-6t15 6q6 6 6 15t-6 15q-6 6-15 6t-15-6Zm0-156q-6-6-6-15t6-15q6-6 15-6t15 6q6 6 6 15t-6 15q-6 6-15 6t-15-6Zm107 330q-11-11-11-27t11-27q11-11 27-11t27 11q11 11 11 27t-11 27q-11 11-27 11t-27-11Zm0-162q-11-11-11-27t11-27q11-11 27-11t27 11q11 11 11 27t-11 27q-11 11-27 11t-27-11Zm0-156q-11-11-11-27t11-27q11-11 27-11t27 11q11 11 11 27t-11 27q-11 11-27 11t-27-11Zm0-162q-11-11-11-27t11-27q11-11 27-11t27 11q11 11 11 27t-11 27q-11 11-27 11t-27-11Zm150.5 329.5Q348-379 348-402t15.5-38.5Q379-456 402-456t38.5 15.5Q456-425 456-402t-15.5 38.5Q425-348 402-348t-38.5-15.5Zm0-156Q348-535 348-558t15.5-38.5Q379-612 402-612t38.5 15.5Q456-581 456-558t-15.5 38.5Q425-504 402-504t-38.5-15.5ZM375-213q-11-11-11-27t11-27q11-11 27-11t27 11q11 11 11 27t-11 27q-11 11-27 11t-27-11Zm0-480q-11-11-11-27t11-27q11-11 27-11t27 11q11 11 11 27t-11 27q-11 11-27 11t-27-11Zm12 587q-6-6-6-15t6-15q6-6 15-6t15 6q6 6 6 15t-6 15q-6 6-15 6t-15-6Zm0-718q-6-6-6-15t6-15q6-6 15-6t15 6q6 6 6 15t-6 15q-6 6-15 6t-15-6Zm132.5 460.5Q504-379 504-402t15.5-38.5Q535-456 558-456t38.5 15.5Q612-425 612-402t-15.5 38.5Q581-348 558-348t-38.5-15.5Zm0-156Q504-535 504-558t15.5-38.5Q535-612 558-612t38.5 15.5Q612-581 612-558t-15.5 38.5Q581-504 558-504t-38.5-15.5ZM531-213q-11-11-11-27t11-27q11-11 27-11t27 11q11 11 11 27t-11 27q-11 11-27 11t-27-11Zm0-480q-11-11-11-27t11-27q11-11 27-11t27 11q11 11 11 27t-11 27q-11 11-27 11t-27-11Zm18 587q-6-6-6-15t6-15q6-6 15-6t15 6q6 6 6 15t-6 15q-6 6-15 6t-15-6Zm-6-718q-6-6-6-15t6-15q6-6 15-6t15 6q6 6 6 15t-6 15q-6 6-15 6t-15-6Zm150 611q-11-11-11-27t11-27q11-11 27-11t27 11q11 11 11 27t-11 27q-11 11-27 11t-27-11Zm0-162q-11-11-11-27t11-27q11-11 27-11t27 11q11 11 11 27t-11 27q-11 11-27 11t-27-11Zm0-156q-11-11-11-27t11-27q11-11 27-11t27 11q11 11 11 27t-11 27q-11 11-27 11t-27-11Zm0-162q-11-11-11-27t11-27q11-11 27-11t27 11q11 11 11 27t-11 27q-11 11-27 11t-27-11Zm131 306q-6-6-6-15t6-15q6-6 15-6t15 6q6 6 6 15t-6 15q-6 6-15 6t-15-6Zm0-156q-6-6-6-15t6-15q6-6 15-6t15 6q6 6 6 15t-6 15q-6 6-15 6t-15-6Z\"/></svg>",
|
|
157
|
+
chat: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M240-399h313v-60H240v60Zm0-130h480v-60H240v60Zm0-130h480v-60H240v60ZM80-80v-740q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H240L80-80Zm134-220h606v-520H140v600l74-80Zm-74 0v-520 520Z\"/></svg>",
|
|
158
|
+
chat_bubble: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M80-80v-740q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H240L80-80Zm134-220h606v-520H140v600l74-80Zm-74 0v-520 520Z\"/></svg>",
|
|
159
|
+
check_box: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"m419-321 289-289-43-43-246 246-119-119-43 43 162 162ZM180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h600v-600H180v600Zm0-600v600-600Z\"/></svg>",
|
|
160
|
+
chevron_right: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M530-481 332-679l43-43 241 241-241 241-43-43 198-198Z\"/></svg>",
|
|
161
|
+
circle: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-156t86-127Q252-817 325-848.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82-31.5 155T763-197.5q-54 54.5-127 86T480-80Zm0-60q142 0 241-99.5T820-480q0-142-99-241t-241-99q-141 0-240.5 99T140-480q0 141 99.5 240.5T480-140Zm0-340Z\"/></svg>",
|
|
162
|
+
close: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z\"/></svg>",
|
|
163
|
+
cloud: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M251-160q-88 0-149.5-61.5T40-371q0-78 50-137t127-71q20-97 94-158.5T482-799q112 0 189 81.5T748-522v24q72-2 122 46.5T920-329q0 69-50 119t-119 50H251Zm0-60h500q45 0 77-32t32-77q0-45-32-77t-77-32h-63v-84q0-91-61-154t-149-63q-88 0-149.5 63T267-522h-19q-62 0-105 43.5T100-371q0 63 44 107t107 44Zm229-260Z\"/></svg>",
|
|
164
|
+
cloud_done: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"m412-279 230-230-40-40-189 189-100-100-41 41 140 140ZM251-160q-88 0-149.5-61.5T40-371q0-78 50-137t127-71q20-97 94-158.5T482-799q112 0 189 81.5T748-522v24q72-2 122 46.5T920-329q0 69-50 119t-119 50H251Zm0-60h500q45 0 77-32t32-77q0-45-32-77t-77-32h-63v-84q0-91-61-154t-149-63q-88 0-149.5 63T267-522h-19q-62 0-105 43.5T100-371q0 63 44 107t107 44Zm229-260Z\"/></svg>",
|
|
165
|
+
cloud_off: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M818-56 703-171H248q-88 0-148-59T40-377q0-80 50.5-134T217-577q2-14 6.5-31.5T236-640L70-806l42-42L861-99l-43 43ZM248-231h397L285-591q-11 15-14.5 34t-3.5 37h-19q-62 0-105 39.5t-43 101q0 61.5 43 105T248-231Zm216-181Zm390 210-47-47q25-17 39-38t14-50q0-43-31-73.5T755-441h-67v-81q0-88-61-147.5T478.47-729q-28.47 0-60.97 9T358-691l-42-42q36-29 77.5-42.5T478-789q111 0 190.5 79T748-520v21q72-1 122 45t50 117q0 35-16.5 73.5T854-202ZM583-470Z\"/></svg>",
|
|
166
|
+
cloud_queue: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M251-160q-88 0-149.5-61.5T40-371q0-78 50-137t127-71q20-97 94-158.5T482-799q112 0 189 81.5T748-522v24q72-2 122 46.5T920-329q0 69-50 119t-119 50H251Zm0-60h500q45 0 77-32t32-77q0-45-32-77t-77-32h-63v-84q0-91-61-154t-149-63q-88 0-149.5 63T267-522h-19q-62 0-105 43.5T100-371q0 63 44 107t107 44Zm229-260Z\"/></svg>",
|
|
167
|
+
collections_bookmark: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M260-260h560v-560h-60v278l-93-57-93 57v-278H260v560Zm0 60q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h560q24 0 42 18t18 42v560q0 24-18 42t-42 18H260ZM140-80q-24 0-42-18t-18-42v-620h60v620h620v60H140Zm434-740h186-186Zm-314 0h560-560Z\"/></svg>",
|
|
168
|
+
content_copy: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M300-200q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H300Zm0-60h440v-560H300v560ZM180-80q-24 0-42-18t-18-42v-620h60v620h500v60H180Zm120-180v-560 560Z\"/></svg>",
|
|
169
|
+
content_paste: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M180-120q-26 0-43-17t-17-43v-600q0-26 17-43t43-17h202q7-35 34.5-57.5T480-920q36 0 63.5 22.5T578-840h202q26 0 43 17t17 43v600q0 26-17 43t-43 17H180Zm0-60h600v-600h-60v90H240v-90h-60v600Zm328.5-611.5Q520-803 520-820t-11.5-28.5Q497-860 480-860t-28.5 11.5Q440-837 440-820t11.5 28.5Q463-780 480-780t28.5-11.5Z\"/></svg>",
|
|
170
|
+
counter_1: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M480.27-80q-82.74 0-155.5-31.5Q252-143 197.5-197.5t-86-127.34Q80-397.68 80-480.5t31.5-155.66Q143-709 197.5-763t127.34-85.5Q397.68-880 480.5-880t155.66 31.5Q709-817 763-763t85.5 127Q880-563 880-480.27q0 82.74-31.5 155.5Q817-252 763-197.68q-54 54.31-127 86Q563-80 480.27-80Zm.23-60Q622-140 721-239.5t99-241Q820-622 721.19-721T480-820q-141 0-240.5 98.81T140-480q0 141 99.5 240.5t241 99.5Zm-.5-340Zm-8 203h60v-406H389v60h83v346Z\"/></svg>",
|
|
171
|
+
create_new_folder: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M550-320h60v-90h90v-60h-90v-90h-60v90h-90v60h90v90ZM140-160q-24 0-42-18.5T80-220v-520q0-23 18-41.5t42-18.5h281l60 60h339q23 0 41.5 18.5T880-680v460q0 23-18.5 41.5T820-160H140Zm0-60h680v-460H456l-60-60H140v520Zm0 0v-520 520Z\"/></svg>",
|
|
172
|
+
crop: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M695-40v-165H265q-24 0-42-18t-18-42v-430H40v-60h165v-165h60v655h655v60H755v165h-60Zm0-285v-370H325v-60h370q24 0 42 18t18 42v370h-60Z\"/></svg>",
|
|
173
|
+
crop_square: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h600v-600H180v600Zm0 0v-600 600Z\"/></svg>",
|
|
174
|
+
dark_mode: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M480-120q-150 0-255-105T120-480q0-150 105-255t255-105q8 0 17 .5t23 1.5q-36 32-56 79t-20 99q0 90 63 153t153 63q52 0 99-18.5t79-51.5q1 12 1.5 19.5t.5 14.5q0 150-105 255T480-120Zm0-60q109 0 190-67.5T771-406q-25 11-53.67 16.5Q688.67-384 660-384q-114.69 0-195.34-80.66Q384-545.31 384-660q0-24 5-51.5t18-62.5q-98 27-162.5 109.5T180-480q0 125 87.5 212.5T480-180Zm-4-297Z\"/></svg>",
|
|
175
|
+
database: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M480-120q-151 0-255.5-46.5T120-280v-400q0-66 105.5-113T480-840q149 0 254.5 47T840-680v400q0 67-104.5 113.5T480-120Zm0-488q86 0 176.5-26.5T773-694q-27-32-117.5-59T480-780q-88 0-177 26t-117 60q28 35 116 60.5T480-608Zm-1 214q42 0 84-4.5t80.5-13.5q38.5-9 73.5-22t63-29v-155q-29 16-64 29t-74 22q-39 9-80 14t-83 5q-42 0-84-5t-80.5-14q-38.5-9-73-22T180-618v155q27 16 61 29t72.5 22q38.5 9 80.5 13.5t85 4.5Zm1 214q48 0 99-8.5t93.5-22.5q42.5-14 72-31t35.5-35v-125q-28 16-63 28.5T643.5-352q-38.5 9-80 13.5T479-334q-43 0-85-4.5T313.5-352q-38.5-9-72.5-21.5T180-402v126q5 17 34 34.5t72 31q43 13.5 94 22t100 8.5Z\"/></svg>",
|
|
176
|
+
delete: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M261-120q-24.75 0-42.37-17.63Q201-155.25 201-180v-570h-41v-60h188v-30h264v30h188v60h-41v570q0 24-18 42t-42 18H261Zm438-630H261v570h438v-570ZM367-266h60v-399h-60v399Zm166 0h60v-399h-60v399ZM261-750v570-570Z\"/></svg>",
|
|
177
|
+
desktop_windows: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M334-120v-60h86v-100H140q-24 0-42-18t-18-42v-440q0-24 18-42t42-18h680q24 0 42 18t18 42v440q0 24-18 42t-42 18H540v100h86v60H334ZM140-340h680v-440H140v440Zm0 0v-440 440Z\"/></svg>",
|
|
178
|
+
download: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M480-313 287-506l43-43 120 120v-371h60v371l120-120 43 43-193 193ZM220-160q-24 0-42-18t-18-42v-143h60v143h520v-143h60v143q0 24-18 42t-42 18H220Z\"/></svg>",
|
|
179
|
+
draw: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M160-120v-128l571-571q11-11 22.5-16t24.5-5q12 0 23.5 5t22.5 16l35 35q11 10 16 21.5t5 24.5q0 12-5 24t-16 23L288-120H160Zm60-60h44l446-446-22-22-22-22-446 446v44Zm601-557-44-44 44 44Zm-133 89-22-22 44 44-22-22ZM560-120q78 0 139-36.5T760-260q0-40-29.5-73.5T638-386l-47 47q50 12 79.5 34t29.5 45q0 32-40.5 56T560-180q-12 0-21 8.5t-9 21.5q0 12 9 21t21 9ZM240-414l48-48q-54-13-81-27.5T180-520q0-16 21.5-30.5T290-590q83-31 111.5-59.5T430-719q0-56-41-88.5T280-840q-42 0-76 14.5T153-789q-8 9-7.5 21t11.5 20q10 8 22.5 6.5T200-751q15-15 34-22t46-7q46 0 68 18t22 43q0 20-19 35t-85 39q-94 34-120 62t-26 63q0 32 28 62t92 44Z\"/></svg>",
|
|
180
|
+
drive_file_rename_outline: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h405l-60 60H180v600h600v-348l60-60v408q0 24-18 42t-42 18H180Zm300-360ZM360-360v-170l382-382q9-9 20-13t22-4q11 0 22.32 4.5Q817.63-920 827-911l83 84q8.61 8.96 13.3 19.78 4.7 10.83 4.7 22.02 0 11.2-4.5 22.7T910-742L530-360H360Zm508-425-84-84 84 84ZM420-420h85l253-253-43-42-43-42-252 251v86Zm295-295-43-42 43 42 43 42-43-42Z\"/></svg>",
|
|
181
|
+
drive_folder_upload: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M450-280h60v-227l74 74 42-42-146-146-146 146 42 42 74-74v227ZM140-160q-24 0-42-18.5T80-220v-520q0-23 18-41.5t42-18.5h281l60 60h339q23 0 41.5 18.5T880-680v460q0 23-18.5 41.5T820-160H140Zm0-60h680v-460H456l-60-60H140v520Zm0 0v-520 520Z\"/></svg>",
|
|
182
|
+
edit: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M180-180h44l472-471-44-44-472 471v44Zm-60 60v-128l575-574q8-8 19-12.5t23-4.5q11 0 22 4.5t20 12.5l44 44q9 9 13 20t4 22q0 11-4.5 22.5T823-694L248-120H120Zm659-617-41-41 41 41Zm-105 64-22-22 44 44-22-22Z\"/></svg>",
|
|
183
|
+
error: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M503.5-289.48q9.5-9.48 9.5-23.5t-9.48-23.52q-9.48-9.5-23.5-9.5t-23.52 9.48q-9.5 9.48-9.5 23.5t9.48 23.52q9.48 9.5 23.5 9.5t23.52-9.48ZM453-433h60v-253h-60v253Zm27.27 353q-82.74 0-155.5-31.5Q252-143 197.5-197.5t-86-127.34Q80-397.68 80-480.5t31.5-155.66Q143-709 197.5-763t127.34-85.5Q397.68-880 480.5-880t155.66 31.5Q709-817 763-763t85.5 127Q880-563 880-480.27q0 82.74-31.5 155.5Q817-252 763-197.68q-54 54.31-127 86Q563-80 480.27-80Zm.23-60Q622-140 721-239.5t99-241Q820-622 721.19-721T480-820q-141 0-240.5 98.81T140-480q0 141 99.5 240.5t241 99.5Zm-.5-340Z\"/></svg>",
|
|
184
|
+
expand_more: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M480-344 240-584l43-43 197 197 197-197 43 43-240 240Z\"/></svg>",
|
|
185
|
+
extension: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M356-120H180q-24 0-42-18t-18-42v-176q44-5 75.5-34.5T227-463q0-43-31.5-72.5T120-570v-176q0-24 18-42t42-18h177q11-40 39.5-67t68.5-27q40 0 68.5 27t39.5 67h173q24 0 42 18t18 42v173q40 11 65.5 41.5T897-461q0 40-25.5 67T806-356v176q0 24-18 42t-42 18H570q-5-48-35.5-77.5T463-227q-41 0-71.5 29.5T356-120Zm-176-60h130q25-61 69.89-84t83-23Q501-287 546-264t70 84h130v-235h45q20 0 33-13t13-33q0-20-13-33t-33-13h-45v-239H511v-48q0-20-13-33t-33-13q-20 0-33 13t-13 33v48H180v130q48.15 17.82 77.58 59.69Q287-514.45 287-462.78 287-412 257.5-370T180-310v130Zm285-281Z\"/></svg>",
|
|
186
|
+
file_copy: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M780-160H260q-24 0-42-18t-18-42v-640q0-24 18-42t42-18h348l232 232v468q0 24-18 42t-42 18ZM578-662v-198H260v640h520v-442H578ZM140-40q-24 0-42-18t-18-42v-619h60v619h498v60H140Zm120-820v198-198 640-640Z\"/></svg>",
|
|
187
|
+
flip: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M349-120H180q-24.75 0-42.37-17.63Q120-155.25 120-180v-600q0-24.75 17.63-42.38Q155.25-840 180-840h169v60H180v600h169v60Zm103 80v-880h60v880h-60Zm163-80v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60q0 25-17.62 42.5Q804.75-120 780-120Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60q24.75 0 42.38 17.62Q840-804.75 840-780h-60Z\"/></svg>",
|
|
188
|
+
flip_to_back: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M180-120q-24.75 0-42.37-17.63Q120-155.25 120-180v-495h60v495h495v60H180Zm165-225v60q-24.75 0-42.37-17.63Q285-320.25 285-345h60Zm-60-105v-60h60v60h-60Zm0-165v-60h60v60h-60Zm60-165h-60q0-24.75 17.63-42.38Q320.25-840 345-840v60Zm105 495v-60h60v60h-60Zm0-495v-60h60v60h-60Zm165 0v-60h60v60h-60Zm0 495v-60h60v60h-60Zm165-495v-60q24.75 0 42.38 17.62Q840-804.75 840-780h-60Zm0 435h60q0 24.75-17.62 42.37Q804.75-285 780-285v-60Zm0-105v-60h60v60h-60Zm0-165v-60h60v60h-60Z\"/></svg>",
|
|
189
|
+
flip_to_front: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M345-285q-24 0-42-18t-18-42v-435q0-24 18-42t42-18h435q24 0 42 18t18 42v435q0 24-18 42t-42 18H345Zm0-60h435v-435H345v435ZM180-180v60q-24.75 0-42.37-17.63Q120-155.25 120-180h60Zm-60-105v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 495v-60h60v60h-60Zm165 0v-60h60v60h-60Zm165 0v-60h60v60h-60Z\"/></svg>",
|
|
190
|
+
folder: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M140-160q-24 0-42-18.5T80-220v-520q0-23 18-41.5t42-18.5h281l60 60h339q23 0 41.5 18.5T880-680v460q0 23-18.5 41.5T820-160H140Zm0-60h680v-460H456l-60-60H140v520Zm0 0v-520 520Z\"/></svg>",
|
|
191
|
+
folder_open: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M140-160q-23 0-41.5-18.5T80-220v-520q0-23 18.5-41.5T140-800h281l60 60h339q23 0 41.5 18.5T880-680H455l-60-60H140v520l102-400h698L833-206q-6 24-22 35t-41 11H140Zm63-60h572l84-340H287l-84 340Zm0 0 84-340-84 340Zm-63-460v-60 60Z\"/></svg>",
|
|
192
|
+
grid_view: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M120-510v-330h330v330H120Zm0 390v-330h330v330H120Zm390-390v-330h330v330H510Zm0 390v-330h330v330H510ZM180-570h210v-210H180v210Zm390 0h210v-210H570v210Zm0 390h210v-210H570v210Zm-390 0h210v-210H180v210Zm390-390Zm0 180Zm-180 0Zm0-180Z\"/></svg>",
|
|
193
|
+
group_remove: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M474-486q26-32 38.5-66t12.5-79q0-45-12.5-79T474-776q76-17 133.5 23T665-631q0 82-57.5 122T474-486Zm216 326v-94q0-51-26-95t-90-74q173 22 236.5 64T874-254v94H690Zm270-389H700v-60h260v60Zm-753 26q-42-42-42-108t42-108q42-42 108-42t108 42q42 42 42 108t-42 108q-42 42-108 42t-108-42ZM0-160v-94q0-35 18.5-63.5T68-360q72-32 128.5-46T315-420q62 0 118 14t128 46q31 14 50 42.5t19 63.5v94H0Zm315-381q39 0 64.5-25.5T405-631q0-39-25.5-64.5T315-721q-39 0-64.5 25.5T225-631q0 39 25.5 64.5T315-541ZM60-220h510v-34q0-16-8-30t-25-22q-69-32-117-43t-105-11q-57 0-104.5 11T92-306q-15 7-23.5 21.5T60-254v34Zm255-411Zm0 411Z\"/></svg>",
|
|
194
|
+
group_work: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M387-320q31 0 52-21.42t21-51.5q0-30.08-21-51.58T387.5-466q-30.5 0-52 21.42t-21.5 51.5q0 30.08 21.44 51.58Q356.89-320 387-320Zm237.5-21.42q21.5-21.42 21.5-51.5t-21.42-51.58q-21.42-21.5-51.5-21.5t-51.58 21.42q-21.5 21.42-21.5 51.5t21.42 51.58q21.42 21.5 51.5 21.5t51.58-21.42ZM531.5-528q21.5-21 21.5-51.5t-21.42-52q-21.42-21.5-51.5-21.5t-51.58 21.44Q407-610.11 407-580q0 31 21.42 52t51.5 21q30.08 0 51.58-21ZM480.27-80q-82.74 0-155.5-31.5Q252-143 197.5-197.5t-86-127.34Q80-397.68 80-480.5t31.5-155.66Q143-709 197.5-763t127.34-85.5Q397.68-880 480.5-880t155.66 31.5Q709-817 763-763t85.5 127Q880-563 880-480.27q0 82.74-31.5 155.5Q817-252 763-197.68q-54 54.31-127 86Q563-80 480.27-80Zm.23-60Q622-140 721-239.5t99-241Q820-622 721.19-721T480-820q-141 0-240.5 98.81T140-480q0 141 99.5 240.5t241 99.5Zm-.5-340Z\"/></svg>",
|
|
195
|
+
groups: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M0-240v-53q0-38.57 41.5-62.78Q83-380 150.38-380q12.16 0 23.39.5t22.23 2.15q-8 17.35-12 35.17-4 17.81-4 37.18v65H0Zm240 0v-65q0-32 17.5-58.5T307-410q32-20 76.5-30t96.5-10q53 0 97.5 10t76.5 30q32 20 49 46.5t17 58.5v65H240Zm540 0v-65q0-19.86-3.5-37.43T765-377.27q11-1.73 22.17-2.23 11.17-.5 22.83-.5 67.5 0 108.75 23.77T960-293v53H780Zm-480-60h360v-6q0-37-50.5-60.5T480-390q-79 0-129.5 23.5T300-305v5ZM149.57-410q-28.57 0-49.07-20.56Q80-451.13 80-480q0-29 20.56-49.5Q121.13-550 150-550q29 0 49.5 20.5t20.5 49.93q0 28.57-20.5 49.07T149.57-410Zm660 0q-28.57 0-49.07-20.56Q740-451.13 740-480q0-29 20.56-49.5Q781.13-550 810-550q29 0 49.5 20.5t20.5 49.93q0 28.57-20.5 49.07T809.57-410ZM480-480q-50 0-85-35t-35-85q0-51 35-85.5t85-34.5q51 0 85.5 34.5T600-600q0 50-34.5 85T480-480Zm.35-60Q506-540 523-557.35t17-43Q540-626 522.85-643t-42.5-17q-25.35 0-42.85 17.15t-17.5 42.5q0 25.35 17.35 42.85t43 17.5ZM480-300Zm0-300Z\"/></svg>",
|
|
196
|
+
help_outline: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M511-258q11-11 11-27t-11-27q-11-11-27-11t-27 11q-11 11-11 27t11 27q11 11 27 11t27-11Zm-62-135h59q0-26 6.5-47.5T555-490q31-26 44-51t13-55q0-53-34.5-85T486-713q-49 0-86.5 24.5T345-621l53 20q11-28 33-43.5t52-15.5q34 0 55 18.5t21 47.5q0 22-13 41.5T508-512q-30 26-44.5 51.5T449-393Zm31 313q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-156t86-127Q252-817 325-848.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82-31.5 155T763-197.5q-54 54.5-127 86T480-80Zm0-60q142 0 241-99.5T820-480q0-142-99-241t-241-99q-141 0-240.5 99T140-480q0 141 99.5 240.5T480-140Zm0-340Z\"/></svg>",
|
|
197
|
+
highlight: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"m225-655-85-84 43-43 84 85-42 42Zm225-105v-120h60v120h-60Zm285 107-43-43 86-84 42 42-85 85ZM360-80v-200L240-400v-200h480v200L600-280v200H360Zm60-60h120v-165l120-120v-115H300v115l120 120v165Zm60-200Z\"/></svg>",
|
|
198
|
+
history: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M477-120q-149 0-253-105.5T120-481h60q0 125 86 213t211 88q127 0 215-89t88-216q0-124-89-209.5T477-780q-68 0-127.5 31T246-667h105v60H142v-208h60v106q52-61 123.5-96T477-840q75 0 141 28t115.5 76.5Q783-687 811.5-622T840-482q0 75-28.5 141t-78 115Q684-177 618-148.5T477-120Zm128-197L451-469v-214h60v189l137 134-43 43Z\"/></svg>",
|
|
199
|
+
home_storage: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"m200-120-80-480h720l-80 480H200Zm50-60h460l57-360H193l57 360Zm150-200h160q13 0 21.5-9t8.5-21q0-13-8.5-21.5T560-440H400q-12 0-21 8.5t-9 21.5q0 12 9 21t21 9ZM240-660q-12 0-21-9t-9-21q0-13 9-21.5t21-8.5h480q13 0 21.5 8.5T750-690q0 12-8.5 21t-21.5 9H240Zm80-120q-12 0-21-9t-9-21q0-13 9-21.5t21-8.5h320q13 0 21.5 8.5T670-810q0 12-8.5 21t-21.5 9H320Zm-70 600h460-460Z\"/></svg>",
|
|
200
|
+
horizontal_distribute: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M80-80v-800h60v800H80Zm350-200v-400h100v400H430ZM820-80v-800h60v800h-60Z\"/></svg>",
|
|
201
|
+
horizontal_rule: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M160-450v-60h640v60H160Z\"/></svg>",
|
|
202
|
+
hub: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M153-73q-33-33-33-81t33.25-81q33.25-33 80.75-33 14 0 24.5 2.5T280-258l85-106q-19-23-29-52.5t-5-61.5l-121-41q-15 25-39.5 39T114-466q-47.5 0-80.75-33.25T0-580q0-47.5 33.25-80.75T114-694q47.5 0 80.75 33.25T228-580v4l122 42q18-32 43.5-49t56.5-24v-129q-39-11-61.5-43T366-846q0-47.5 33-80.75T480-960q48 0 81 33.25T594-846q0 35-23 67t-61 43v129q31 7 57 24t44 49l121-42v-4q0-47.5 33.25-80.75T846-694q47.5 0 80.75 33T960-580q0 48-33.25 81T846-466q-32 0-57-14t-39-39l-121 41q5 32-4.5 61.5T595-364l85 106q11-5 21.5-7.5t24.06-2.5Q774-268 807-235t33 81q0 48-33 81t-81 33q-48 0-81-33.25T612-154q0-20 5.5-36t15.5-31l-85-106q-32.13 17-68.56 17Q443-310 411-327l-84 107q10 15 15.5 30.5T348-154q0 47.5-33 80.75T234-40q-48 0-81-33Zm-38.96-453q22.96 0 38.46-15.54 15.5-15.53 15.5-38.5 0-22.96-15.54-38.46-15.53-15.5-38.5-15.5Q91-634 75.5-618.46 60-602.93 60-579.96 60-557 75.54-541.5q15.53 15.5 38.5 15.5ZM272.5-115.54q15.5-15.53 15.5-38.5 0-22.96-15.54-38.46-15.53-15.5-38.5-15.5-22.96 0-38.46 15.54-15.5 15.53-15.5 38.5 0 22.96 15.54 38.46 15.53 15.5 38.5 15.5 22.96 0 38.46-15.54Zm246-692q15.5-15.53 15.5-38.5 0-22.96-15.54-38.46-15.53-15.5-38.5-15.5-22.96 0-38.46 15.54-15.5 15.53-15.5 38.5 0 22.96 15.54 38.46 15.53 15.5 38.5 15.5 22.96 0 38.46-15.54ZM480.5-370q37.5 0 63.5-26.5t26-64q0-37.5-26.1-63.5T480-550q-37 0-63.5 26.1T390-460q0 37 26.5 63.5t64 26.5Zm284 254.46q15.5-15.53 15.5-38.5 0-22.96-15.54-38.46-15.53-15.5-38.5-15.5-22.96 0-38.46 15.54-15.5 15.53-15.5 38.5 0 22.96 15.54 38.46 15.53 15.5 38.5 15.5 22.96 0 38.46-15.54Zm120-426q15.5-15.53 15.5-38.5 0-22.96-15.54-38.46-15.53-15.5-38.5-15.5-22.96 0-38.46 15.54-15.5 15.53-15.5 38.5 0 22.96 15.54 38.46 15.53 15.5 38.5 15.5 22.96 0 38.46-15.54ZM480-846ZM114-580Zm366 120Zm366-120ZM234-154Zm492 0Z\"/></svg>",
|
|
203
|
+
info: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M453-280h60v-240h-60v240Zm50.5-323.2q9.5-9.2 9.5-22.8 0-14.45-9.48-24.22-9.48-9.78-23.5-9.78t-23.52 9.78Q447-640.45 447-626q0 13.6 9.48 22.8 9.48 9.2 23.5 9.2t23.52-9.2ZM480.27-80q-82.74 0-155.5-31.5Q252-143 197.5-197.5t-86-127.34Q80-397.68 80-480.5t31.5-155.66Q143-709 197.5-763t127.34-85.5Q397.68-880 480.5-880t155.66 31.5Q709-817 763-763t85.5 127Q880-563 880-480.27q0 82.74-31.5 155.5Q817-252 763-197.68q-54 54.31-127 86Q563-80 480.27-80Zm.23-60Q622-140 721-239.5t99-241Q820-622 721.19-721T480-820q-141 0-240.5 98.81T140-480q0 141 99.5 240.5t241 99.5Zm-.5-340Z\"/></svg>",
|
|
204
|
+
ink_highlighter: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M554-407 439-522 217-300l115 115 222-222Zm-72-158 115 115 213-213-115-115-213 213Zm-64-21 200 200-234 234q-19 19-52.5 19T279-152l-11-11-43 43H70l120-120-4-4q-22-22-21.5-55.5T187-355l231-231Zm0 0 237-237q17-17 43-17t43 17l112 112q17 17 16.5 45.5T852-620L618-386 418-586Z\"/></svg>",
|
|
205
|
+
join_inner: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M320-200q-117 0-198.5-81.5T40-480q0-117 81.5-198.5T320-760q36 0 69.5 8.5T452-727q-13 10-24 21t-22 23q-20-8-41.5-12.5T320-700q-91 0-155.5 64T100-480q0 91 64.5 155.5T320-260q23 0 44.5-4.5T406-277q11 12 22 23t24 21q-29 16-62.5 24.5T320-200Zm320 0q-36 0-69.5-8.5T508-233q13-10 24-21t22-23q20 8 41.5 12.5T640-260q92 0 156-64.5T860-480q0-92-64-156t-156-64q-23 0-44.5 4.5T554-683q-11-12-22-23t-24-21q29-16 62.5-24.5T640-760q117 0 198.5 81.5T920-480q0 117-81.5 198.5T640-200Zm-160-50q-57-39-88.5-100T360-480q0-69 31.5-130T480-710q57 39 88.5 100T600-480q0 69-31.5 130T480-250Z\"/></svg>",
|
|
206
|
+
join_left: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M320-200q-117 0-198.5-81.5T40-480q0-117 81.5-198.5T320-760q36 0 69.5 8.5T452-727q-58 45-90 109.5T330-480q0 73 32 137.5T452-233q-29 16-62.5 24.5T320-200Zm320 0q-36 0-69.5-8.5T508-233q13-10 24-21t22-23q20 8 41.5 12.5T640-260q92 0 156-64.5T860-480q0-92-64-156t-156-64q-23 0-44.5 4.5T554-683q-11-12-22-23t-24-21q29-16 62.5-24.5T640-760q117 0 198.5 81.5T920-480q0 117-81.5 198.5T640-200Zm-160-50q-57-39-88.5-100T360-480q0-69 31.5-130T480-710q57 39 88.5 100T600-480q0 69-31.5 130T480-250Z\"/></svg>",
|
|
207
|
+
keyboard_arrow_down: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M480-344 240-584l43-43 197 197 197-197 43 43-240 240Z\"/></svg>",
|
|
208
|
+
keyboard_arrow_up: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M480-554 283-357l-43-43 240-240 240 240-43 43-197-197Z\"/></svg>",
|
|
209
|
+
laptop: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M57-160q-23.51 0-40.26-17.63Q0-195.25 0-220h141q-24 0-42-18t-18-42v-500q0-24 18-42t42-18h678q24 0 42 18t18 42v500q0 24-18 42t-42 18h141q0 25-17.62 42.5Q924.75-160 900-160H57Zm447-32q10-10 10-24t-10-24q-10-10-24-10t-24 10q-10 10-10 24t10 24q10 10 24 10t24-10Zm-363-88h678v-500H141v500Zm0 0v-500 500Z\"/></svg>",
|
|
210
|
+
library_books: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M343-420h225v-60H343v60Zm0-90h395v-60H343v60Zm0-90h395v-60H343v60Zm-83 400q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h560q24 0 42 18t18 42v560q0 24-18 42t-42 18H260Zm0-60h560v-560H260v560ZM140-80q-24 0-42-18t-18-42v-620h60v620h620v60H140Zm120-740v560-560Z\"/></svg>",
|
|
211
|
+
light_mode: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M579-381q41-41 41-99t-41-99q-41-41-99-41t-99 41q-41 41-41 99t41 99q41 41 99 41t99-41Zm-240.5 42.5Q280-397 280-480t58.5-141.5Q397-680 480-680t141.5 58.5Q680-563 680-480t-58.5 141.5Q563-280 480-280t-141.5-58.5ZM200-450H40v-60h160v60Zm720 0H760v-60h160v60ZM450-760v-160h60v160h-60Zm0 720v-160h60v160h-60ZM262-658l-100-97 43-44 96 100-39 41Zm494 496-98-100 41-41 99 98-42 43Zm-99-537 98-99 44 42-99 98-43-41ZM162-205l99-98 42 42-98 99-43-43Zm318-275Z\"/></svg>",
|
|
212
|
+
more_vert: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M479.86-160Q460-160 446-174.14t-14-34Q432-228 446.14-242t34-14Q500-256 514-241.86t14 34Q528-188 513.86-174t-34 14Zm0-272Q460-432 446-446.14t-14-34Q432-500 446.14-514t34-14Q500-528 514-513.86t14 34Q528-460 513.86-446t-34 14Zm0-272Q460-704 446-718.14t-14-34Q432-772 446.14-786t34-14Q500-800 514-785.86t14 34Q528-732 513.86-718t-34 14Z\"/></svg>",
|
|
213
|
+
near_me: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M527-120 413-413 120-527v-43l720-270-270 720h-43Zm18-114 192-503-502 192 224 86 86 225Zm-86-225Z\"/></svg>",
|
|
214
|
+
north_east: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"m202-160-42-42 498-498H364v-60h396v396h-60v-294L202-160Z\"/></svg>",
|
|
215
|
+
open_in_new: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h279v60H180v600h600v-279h60v279q0 24-18 42t-42 18H180Zm202-219-42-43 398-398H519v-60h321v321h-60v-218L382-339Z\"/></svg>",
|
|
216
|
+
rectangle: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M80-160v-640h800v640H80Zm60-60h680v-520H140v520Zm0 0v-520 520Z\"/></svg>",
|
|
217
|
+
redo: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M392-200q-95 0-163.5-64T160-422q0-94 68.5-158T392-644h294L572-758l42-42 186 186-186 186-42-42 114-114H391q-70 0-120.5 46.5T220-422q0 69 50.5 115.5T391-260h310v60H392Z\"/></svg>",
|
|
218
|
+
refresh: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M480-160q-133 0-226.5-93.5T160-480q0-133 93.5-226.5T480-800q85 0 149 34.5T740-671v-129h60v254H546v-60h168q-38-60-97-97t-137-37q-109 0-184.5 75.5T220-480q0 109 75.5 184.5T480-220q83 0 152-47.5T728-393h62q-29 105-115 169t-195 64Z\"/></svg>",
|
|
219
|
+
remove: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M200-450v-60h560v60H200Z\"/></svg>",
|
|
220
|
+
rotate_left: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M435-80q-48-7-93-25t-85-48l43-44q32 24 66 37.5t69 19.5v60Zm90 0v-60q110-21 182.5-103.5T780-443q0-127-86.5-213.5T480-743h-20l79 79-44 44-153-153 153-153 44 44-79 79h20q75 0 140.5 28T735-698q49 49 77 114.5T840-443q0 140-89 241T525-80ZM194-216q-28-38-46.5-84.5T122-398h61q5 38 18.5 73t36.5 65l-44 44Zm-72-272q7-50 25-95.5t47-85.5l44 43q-23 33-36.5 68T183-488h-61Z\"/></svg>",
|
|
221
|
+
rotate_right: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M527-80v-60q35-6 69-19.5t66-37.5l43 44q-40 30-85 48t-93 25Zm-90 0q-137-21-226-122t-89-241q0-75 28-140.5T227-698q49-49 114.5-77T482-803h20l-79-79 44-44 153 153-153 153-44-44 79-79h-20q-127 0-213.5 86.5T182-443q0 117 72.5 199.5T437-140v60Zm331-136-44-44q23-30 36.5-65t18.5-73h61q-7 51-25.5 97.5T768-216Zm72-272h-61q-5-35-18.5-70T724-626l44-43q29 40 47 85.5t25 95.5Z\"/></svg>",
|
|
222
|
+
rounded_corner: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm165 0v-60h60v60h-60Zm165 0v-60h60v60h-60Zm0-165v-60h60v60h-60Zm60-165h-60v-195q0-57-39-96t-96-39H450v-60h195q80.93 0 137.96 57.04Q840-725.93 840-645v195Z\"/></svg>",
|
|
223
|
+
save: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M840-683v503q0 24-18 42t-42 18H180q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h503l157 157Zm-60 27L656-780H180v600h600v-476ZM553.5-275.26q30.5-30.27 30.5-73.5 0-43.24-30.26-73.74-30.27-30.5-73.5-30.5-43.24 0-73.74 30.26-30.5 30.27-30.5 73.5 0 43.24 30.26 73.74 30.27 30.5 73.5 30.5 43.24 0 73.74-30.26ZM233-584h358v-143H233v143Zm-53-72v476-600 124Z\"/></svg>",
|
|
224
|
+
screenshot_monitor: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M600-320h160v-160h-40v120H600v40ZM200-560h40v-120h120v-40H200v160Zm130 440v-80H140q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H630v80H330ZM140-260h680v-520H140v520Zm0 0v-520 520Z\"/></svg>",
|
|
225
|
+
search: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M796-121 533-384q-30 26-70 40.5T378-329q-108 0-183-75t-75-181q0-106 75-181t182-75q106 0 180.5 75T632-585q0 43-14 83t-42 75l264 262-44 44ZM377-389q81 0 138-57.5T572-585q0-81-57-138.5T377-781q-82 0-139.5 57.5T180-585q0 81 57.5 138.5T377-389Z\"/></svg>",
|
|
226
|
+
shapes: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M600-360Zm-280 98q10 2 19.5 2H360q5.5 0 10.25-.25T380-261v121h440v-440H699q.5-5 .75-9.75T700-600v-20.5q0-9.5-2-19.5h122q24.75 0 42.38 17.62Q880-604.75 880-580v440q0 24.75-17.62 42.37Q844.75-80 820-80H380q-24.75 0-42.37-17.63Q320-115.25 320-140v-122ZM161.5-401.5Q80-483 80-600t81.5-198.5Q243-880 360-880t198.5 81.5Q640-717 640-600t-81.5 198.5Q477-320 360-320t-198.5-81.5Zm354-42.79q64.5-64.29 64.5-155.5T515.71-755.5Q451.42-820 360.21-820T204.5-755.71Q140-691.42 140-600.21t64.29 155.71q64.29 64.5 155.5 64.5t155.71-64.29ZM360-600Z\"/></svg>",
|
|
227
|
+
share: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M686-80q-47.5 0-80.75-33.25T572-194q0-8 5-34L278-403q-16.28 17.34-37.64 27.17Q219-366 194-366q-47.5 0-80.75-33T80-480q0-48 33.25-81T194-594q24 0 45 9.3 21 9.29 37 25.7l301-173q-2-8-3.5-16.5T572-766q0-47.5 33.25-80.75T686-880q47.5 0 80.75 33.25T800-766q0 47.5-33.25 80.75T686-652q-23.27 0-43.64-9Q622-670 606-685L302-516q3 8 4.5 17.5t1.5 18q0 8.5-1 16t-3 15.5l303 173q16-15 36.09-23.5 20.1-8.5 43.07-8.5Q734-308 767-274.75T800-194q0 47.5-33.25 80.75T686-80Zm.04-60q22.96 0 38.46-15.54 15.5-15.53 15.5-38.5 0-22.96-15.54-38.46-15.53-15.5-38.5-15.5-22.96 0-38.46 15.54-15.5 15.53-15.5 38.5 0 22.96 15.54 38.46 15.53 15.5 38.5 15.5Zm-492-286q22.96 0 38.46-15.54 15.5-15.53 15.5-38.5 0-22.96-15.54-38.46-15.53-15.5-38.5-15.5-22.96 0-38.46 15.54-15.5 15.53-15.5 38.5 0 22.96 15.54 38.46 15.53 15.5 38.5 15.5ZM724.5-727.54q15.5-15.53 15.5-38.5 0-22.96-15.54-38.46-15.53-15.5-38.5-15.5-22.96 0-38.46 15.54-15.5 15.53-15.5 38.5 0 22.96 15.54 38.46 15.53 15.5 38.5 15.5 22.96 0 38.46-15.54ZM686-194ZM194-480Zm492-286Z\"/></svg>",
|
|
228
|
+
square: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M120-120v-720h720v720H120Zm60-60h600v-600H180v600Zm0 0v-600 600Z\"/></svg>",
|
|
229
|
+
sticky_note_2: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M180-180h400v-200h200v-400H180v600Zm0 60q-24.75 0-42.37-17.63Q120-155.25 120-180v-600q0-24.75 17.63-42.38Q155.25-840 180-840h600q24.75 0 42.38 17.62Q840-804.75 840-780v420L600-120H180Zm120-300v-60h170v60H300Zm0-160v-60h360v60H300ZM180-180v-600 600Z\"/></svg>",
|
|
230
|
+
swap_horiz: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M273-160 80-353l193-193 42 42-121 121h316v60H194l121 121-42 42Zm414-254-42-42 121-121H450v-60h316L645-758l42-42 193 193-193 193Z\"/></svg>",
|
|
231
|
+
swap_vert: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M323-450v-316L202-645l-42-42 193-193 193 193-42 42-121-121v316h-60ZM607-80 414-273l42-42 121 121v-316h60v316l121-121 42 42L607-80Z\"/></svg>",
|
|
232
|
+
sync: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M167-160v-60h130l-15-12q-64-51-93-111t-29-134q0-106 62.5-190.5T387-784v62q-75 29-121 96.5T220-477q0 63 23.5 109.5T307-287l30 21v-124h60v230H167Zm407-15v-63q76-29 121-96.5T740-483q0-48-23.5-97.5T655-668l-29-26v124h-60v-230h230v60H665l15 14q60 56 90 120t30 123q0 106-62 191T574-175Z\"/></svg>",
|
|
233
|
+
sync_alt: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M271-120 80-311l192-192 42 42-120 120h646v60H194l119 119-42 42Zm418-337-42-42 119-119H120v-60h646L646-798l42-42 192 192-191 191Z\"/></svg>",
|
|
234
|
+
task: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"m434-255 229-229-39-39-190 190-103-103-39 39 142 142ZM220-80q-24 0-42-18t-18-42v-680q0-24 18-42t42-18h361l219 219v521q0 24-18 42t-42 18H220Zm331-554v-186H220v680h520v-494H551ZM220-820v186-186 680-680Z\"/></svg>",
|
|
235
|
+
text_fields: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M290-160v-540H80v-100h520v100H390v540H290Zm360 0v-340H520v-100h360v100H750v340H650Z\"/></svg>",
|
|
236
|
+
timer: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M360-860v-60h240v60H360Zm90 447h60v-230h-60v230ZM340.5-109.5Q275-138 226-187t-77.5-114.5Q120-367 120-441t28.5-139.5Q177-646 226-695t114.5-77.5Q406-801 480-801q67 0 126 22.5T711-716l51-51 42 42-51 51q36 40 61.5 97T840-441q0 74-28.5 139.5T734-187q-49 49-114.5 77.5T480-81q-74 0-139.5-28.5Zm352-119Q780-316 780-441t-87.5-212.5Q605-741 480-741t-212.5 87.5Q180-566 180-441t87.5 212.5Q355-141 480-141t212.5-87.5ZM480-440Z\"/></svg>",
|
|
237
|
+
title: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M430-160v-540H200v-100h560v100H530v540H430Z\"/></svg>",
|
|
238
|
+
tune: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M427-120v-225h60v83h353v60H487v82h-60Zm-307-82v-60h247v60H120Zm187-166v-82H120v-60h187v-84h60v226h-60Zm120-82v-60h413v60H427Zm166-165v-225h60v82h187v60H653v83h-60Zm-473-83v-60h413v60H120Z\"/></svg>",
|
|
239
|
+
undo: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M259-200v-60h310q70 0 120.5-46.5T740-422q0-69-50.5-115.5T569-584H274l114 114-42 42-186-186 186-186 42 42-114 114h294q95 0 163.5 64T800-422q0 94-68.5 158T568-200H259Z\"/></svg>",
|
|
240
|
+
upload: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M450-313v-371L330-564l-43-43 193-193 193 193-43 43-120-120v371h-60ZM220-160q-24 0-42-18t-18-42v-143h60v143h520v-143h60v143q0 24-18 42t-42 18H220Z\"/></svg>",
|
|
241
|
+
vertical_distribute: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M80-80v-60h800v60H80Zm200-350v-100h400v100H280ZM80-820v-60h800v60H80Z\"/></svg>",
|
|
242
|
+
view_list: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M350-220h470v-137H350v137ZM140-603h150v-137H140v137Zm0 187h150v-127H140v127Zm0 196h150v-137H140v137Zm210-196h470v-127H350v127Zm0-187h470v-137H350v137ZM140-160q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H140Z\"/></svg>",
|
|
243
|
+
view_module: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M621-510h159v-190H621v190Zm-221 0h161v-190H400v190Zm-219 0h159v-190H181v190Zm0 250h159v-190H181v190Zm219 0h161v-190H400v190Zm221 0h159v-190H621v190Zm-500 0v-440q0-24.75 17.63-42.38Q156.25-760 181-760h599q24.75 0 42.38 17.62Q840-724.75 840-700v440q0 24.75-17.62 42.37Q804.75-200 780-200H181q-24.75 0-42.37-17.63Q121-235.25 121-260Z\"/></svg>",
|
|
244
|
+
visibility_off: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"m629-419-44-44q26-71-27-118t-115-24l-44-44q17-11 38-16t43-5q71 0 120.5 49.5T650-500q0 22-5.5 43.5T629-419Zm129 129-40-40q49-36 85.5-80.5T857-500q-50-111-150-175.5T490-740q-42 0-86 8t-69 19l-46-47q35-16 89.5-28T485-800q143 0 261.5 81.5T920-500q-26 64-67 117t-95 93Zm58 226L648-229q-35 14-79 21.5t-89 7.5q-146 0-265-81.5T40-500q20-52 55.5-101.5T182-696L56-822l42-43 757 757-39 44ZM223-654q-37 27-71.5 71T102-500q51 111 153.5 175.5T488-260q33 0 65-4t48-12l-64-64q-11 5-27 7.5t-30 2.5q-70 0-120-49t-50-121q0-15 2.5-30t7.5-27l-97-97Zm305 142Zm-116 58Z\"/></svg>",
|
|
245
|
+
warning: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"m40-120 440-760 440 760H40Zm104-60h672L480-760 144-180Zm361.5-65.68q8.5-8.67 8.5-21.5 0-12.82-8.68-21.32-8.67-8.5-21.5-8.5-12.82 0-21.32 8.68-8.5 8.67-8.5 21.5 0 12.82 8.68 21.32 8.67 8.5 21.5 8.5 12.82 0 21.32-8.68ZM454-348h60v-224h-60v224Zm26-122Z\"/></svg>"
|
|
246
|
+
}, h = {
|
|
247
|
+
"shape.rect": l.rect,
|
|
248
|
+
"shape.rounded": l.rounded,
|
|
249
|
+
"shape.ellipse": l.ellipse,
|
|
250
|
+
"arrow.none": u.none,
|
|
251
|
+
"arrow.end": u.end,
|
|
252
|
+
"arrow.both": u.both,
|
|
253
|
+
"counter.circle": d.circle,
|
|
254
|
+
"counter.rect": d.rect,
|
|
255
|
+
"counter.rounded": d.rounded,
|
|
256
|
+
"brand.github": p
|
|
257
|
+
}, g = {
|
|
258
|
+
...m,
|
|
259
|
+
...h
|
|
260
|
+
}, _ = Object.keys(g);
|
|
261
|
+
function v(e) {
|
|
262
|
+
return g[e];
|
|
263
|
+
}
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/editor/icons/sanitize.ts
|
|
266
|
+
var y = "http://www.w3.org/2000/svg", b = 64 * 1024, x = {
|
|
267
|
+
svg: "svg",
|
|
268
|
+
g: "g",
|
|
269
|
+
path: "path",
|
|
270
|
+
circle: "circle",
|
|
271
|
+
ellipse: "ellipse",
|
|
272
|
+
rect: "rect",
|
|
273
|
+
line: "line",
|
|
274
|
+
polyline: "polyline",
|
|
275
|
+
polygon: "polygon",
|
|
276
|
+
defs: "defs",
|
|
277
|
+
lineargradient: "linearGradient",
|
|
278
|
+
radialgradient: "radialGradient",
|
|
279
|
+
stop: "stop",
|
|
280
|
+
symbol: "symbol",
|
|
281
|
+
use: "use",
|
|
282
|
+
title: "title",
|
|
283
|
+
desc: "desc",
|
|
284
|
+
text: "text",
|
|
285
|
+
tspan: "tspan"
|
|
286
|
+
}, S = new Set(/* @__PURE__ */ "id.class.viewBox.preserveAspectRatio.fill.fill-rule.fill-opacity.stroke.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.stroke-dashoffset.stroke-opacity.stroke-miterlimit.transform.opacity.color.aria-hidden.aria-label.role.width.height.x.y.x1.y1.x2.y2.cx.cy.r.rx.ry.d.points.offset.stop-color.stop-opacity.gradientUnits.gradientTransform.spreadMethod.fr.fx.fy.text-anchor.dominant-baseline.font-size.font-family.font-weight.letter-spacing.dx.dy".split(".")), C = { use: new Set(["href", "xlink:href"]) };
|
|
287
|
+
function ee(e) {
|
|
288
|
+
return /^#[A-Za-z_][A-Za-z0-9_\-:.]*$/.test(e);
|
|
289
|
+
}
|
|
290
|
+
function te(e) {
|
|
291
|
+
return /^\s*(javascript|data:text\/html|vbscript):/i.test(e);
|
|
292
|
+
}
|
|
293
|
+
function w(e) {
|
|
294
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
295
|
+
}
|
|
296
|
+
function T(e) {
|
|
297
|
+
if (typeof e != "string" || e.length === 0 || e.length > b) return null;
|
|
298
|
+
let t = globalThis.DOMParser;
|
|
299
|
+
if (!t) return null;
|
|
300
|
+
let n = new t().parseFromString(e, "image/svg+xml").documentElement;
|
|
301
|
+
return !n || n.namespaceURI !== y || (n.localName ?? "").toLowerCase() !== "svg" ? null : E(n);
|
|
302
|
+
}
|
|
303
|
+
function E(e) {
|
|
304
|
+
let t = (e.localName ?? "").toLowerCase(), n = x[t];
|
|
305
|
+
if (!n) return "";
|
|
306
|
+
let r = D(e, t, n === "svg"), i = [];
|
|
307
|
+
for (let t of Array.from(e.childNodes)) if (t.nodeType === 1) {
|
|
308
|
+
let e = t;
|
|
309
|
+
if (e.namespaceURI !== y) continue;
|
|
310
|
+
let n = E(e);
|
|
311
|
+
n && i.push(n);
|
|
312
|
+
} else if (t.nodeType === 3) {
|
|
313
|
+
let e = t.nodeValue ?? "";
|
|
314
|
+
e.length > 0 && i.push(w(e));
|
|
315
|
+
}
|
|
316
|
+
return i.length === 0 ? `<${n}${r}/>` : `<${n}${r}>${i.join("")}</${n}>`;
|
|
317
|
+
}
|
|
318
|
+
function D(e, t, n) {
|
|
319
|
+
let r = C[t], i = [];
|
|
320
|
+
n && i.push(` xmlns="${y}"`);
|
|
321
|
+
for (let t of Array.from(e.attributes)) {
|
|
322
|
+
let e = t.name;
|
|
323
|
+
if (e.startsWith("on") || e === "style" || e.startsWith("xmlns")) continue;
|
|
324
|
+
let n = S.has(e), a = r?.has(e) === !0;
|
|
325
|
+
!n && !a || a && !ee(t.value) || te(t.value) || i.push(` ${e}="${w(t.value)}"`);
|
|
326
|
+
}
|
|
327
|
+
return i.join("");
|
|
328
|
+
}
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region src/editor/icons/render.ts
|
|
331
|
+
function O(e) {
|
|
332
|
+
let t = e.trim();
|
|
333
|
+
return t.length === 0 ? !1 : /^data:image\/svg\+xml[,;]/i.test(t) ? !0 : !(/^javascript:/i.test(t) || /^data:/i.test(t) || /^[a-z][a-z0-9+.-]*:/i.test(t));
|
|
334
|
+
}
|
|
335
|
+
function ne(e) {
|
|
336
|
+
switch (e.kind) {
|
|
337
|
+
case "builtin": return v(e.id) ?? "";
|
|
338
|
+
case "svg": return T(e.svg) ?? "";
|
|
339
|
+
case "url": return O(e.url) ? `<img src="${e.url.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<")}" alt="" aria-hidden="true" class="annot-icon-img"/>` : "";
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function re(e, t) {
|
|
343
|
+
let n = ne(e);
|
|
344
|
+
if (!n) return null;
|
|
345
|
+
let r = t ?? globalThis.document ?? null;
|
|
346
|
+
if (!r) return null;
|
|
347
|
+
let i = r.createElement("template");
|
|
348
|
+
return i.innerHTML = n, i.content.firstElementChild ?? null;
|
|
349
|
+
}
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/editor/path-utils.ts
|
|
352
|
+
var ie = {
|
|
353
|
+
M: ["x", "y"],
|
|
354
|
+
L: ["x", "y"],
|
|
355
|
+
H: ["x"],
|
|
356
|
+
V: ["y"],
|
|
357
|
+
C: [
|
|
358
|
+
"x",
|
|
359
|
+
"y",
|
|
360
|
+
"x",
|
|
361
|
+
"y",
|
|
362
|
+
"x",
|
|
363
|
+
"y"
|
|
364
|
+
],
|
|
365
|
+
S: [
|
|
366
|
+
"x",
|
|
367
|
+
"y",
|
|
368
|
+
"x",
|
|
369
|
+
"y"
|
|
370
|
+
],
|
|
371
|
+
Q: [
|
|
372
|
+
"x",
|
|
373
|
+
"y",
|
|
374
|
+
"x",
|
|
375
|
+
"y"
|
|
376
|
+
],
|
|
377
|
+
T: ["x", "y"],
|
|
378
|
+
A: [
|
|
379
|
+
"n",
|
|
380
|
+
"n",
|
|
381
|
+
"n",
|
|
382
|
+
"n",
|
|
383
|
+
"n",
|
|
384
|
+
"x",
|
|
385
|
+
"y"
|
|
386
|
+
],
|
|
387
|
+
Z: []
|
|
388
|
+
};
|
|
389
|
+
function ae(e) {
|
|
390
|
+
let t = [], n = /([A-DF-Za-df-z])|(-?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?)/g, r = null, i = n.exec(e);
|
|
391
|
+
for (; i !== null;) {
|
|
392
|
+
let a = i[1], o = i[2];
|
|
393
|
+
a === void 0 ? o !== void 0 && (r || (r = {
|
|
394
|
+
cmd: "M",
|
|
395
|
+
params: []
|
|
396
|
+
}, t.push(r)), r.params.push(Number.parseFloat(o))) : (r = {
|
|
397
|
+
cmd: a,
|
|
398
|
+
params: []
|
|
399
|
+
}, t.push(r)), i = n.exec(e);
|
|
400
|
+
}
|
|
401
|
+
return t;
|
|
402
|
+
}
|
|
403
|
+
function oe(e) {
|
|
404
|
+
return Math.abs(e) < 1e-9 ? "0" : Number(e.toFixed(6)).toString();
|
|
405
|
+
}
|
|
406
|
+
function se(e) {
|
|
407
|
+
let t = [];
|
|
408
|
+
for (let n of e) n.params.length === 0 ? t.push(n.cmd) : t.push(n.cmd + n.params.map(oe).join(" "));
|
|
409
|
+
return t.join(" ");
|
|
410
|
+
}
|
|
411
|
+
function ce(e, t, n) {
|
|
412
|
+
if (t === 0 && n === 0) return e;
|
|
413
|
+
let r = ae(e), i = !0;
|
|
414
|
+
for (let e of r) {
|
|
415
|
+
let r = e.cmd.toUpperCase(), a = ie[r];
|
|
416
|
+
if (!a || a.length === 0) {
|
|
417
|
+
i = !1;
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
420
|
+
let o = e.cmd === r, s = i && e.cmd === "m";
|
|
421
|
+
for (let r = 0; r < e.params.length; r += a.length) for (let i = 0; i < a.length; i++) {
|
|
422
|
+
let c = r + i;
|
|
423
|
+
if (c >= e.params.length) break;
|
|
424
|
+
let l = a[i];
|
|
425
|
+
if (l === "n") continue;
|
|
426
|
+
let u = !1;
|
|
427
|
+
if ((o || s && r === 0) && (u = !0), !u) continue;
|
|
428
|
+
let d = e.params[c];
|
|
429
|
+
d !== void 0 && (e.params[c] = d + (l === "x" ? t : n));
|
|
430
|
+
}
|
|
431
|
+
i = !1;
|
|
432
|
+
}
|
|
433
|
+
return se(r);
|
|
434
|
+
}
|
|
435
|
+
//#endregion
|
|
436
|
+
//#region src/utils/dash-utils.ts
|
|
437
|
+
var le = {
|
|
438
|
+
dash: [4, 3],
|
|
439
|
+
dot: [1, 3],
|
|
440
|
+
dashDot: [
|
|
441
|
+
4,
|
|
442
|
+
3,
|
|
443
|
+
1,
|
|
444
|
+
3
|
|
445
|
+
],
|
|
446
|
+
lgDash: [8, 3]
|
|
447
|
+
};
|
|
448
|
+
function k(e, t) {
|
|
449
|
+
let n = le[e];
|
|
450
|
+
return n ? n.map((e) => Math.max(1, Math.round(e * t))).join(",") : "";
|
|
451
|
+
}
|
|
452
|
+
function A(e, t) {
|
|
453
|
+
if (!e) return "";
|
|
454
|
+
for (let [n, r] of Object.entries(le)) if (r.map((e) => Math.max(1, Math.round(e * t))).join(",") === e) return n;
|
|
455
|
+
let n = e.split(",").map(Number);
|
|
456
|
+
return n.length === 4 ? "dashDot" : n.length === 2 && n[0] <= t * 2 ? "dot" : n.length === 2 && n[0] > t * 5 ? "lgDash" : "dash";
|
|
457
|
+
}
|
|
458
|
+
//#endregion
|
|
459
|
+
//#region src/editor/arrow-markers.ts
|
|
460
|
+
var j = class {
|
|
461
|
+
#e = "";
|
|
462
|
+
begin() {}
|
|
463
|
+
moveTo(e, t) {
|
|
464
|
+
this.#e += `M ${M(e)} ${M(t)} `;
|
|
465
|
+
}
|
|
466
|
+
lineTo(e, t) {
|
|
467
|
+
this.#e += `L ${M(e)} ${M(t)} `;
|
|
468
|
+
}
|
|
469
|
+
quadTo(e, t, n, r) {
|
|
470
|
+
this.#e += `Q ${M(e)} ${M(t)} ${M(n)} ${M(r)} `;
|
|
471
|
+
}
|
|
472
|
+
close() {
|
|
473
|
+
this.#e += "Z ";
|
|
474
|
+
}
|
|
475
|
+
ellipse(e, t, n, r) {
|
|
476
|
+
let i = n / 2, a = r / 2, o = e + i, s = t + a;
|
|
477
|
+
this.#e += `M ${M(o - i)} ${M(s)} A ${M(i)} ${M(a)} 0 1 0 ${M(o + i)} ${M(s)} A ${M(i)} ${M(a)} 0 1 0 ${M(o - i)} ${M(s)} Z `;
|
|
478
|
+
}
|
|
479
|
+
stroke() {}
|
|
480
|
+
fillAndStroke() {}
|
|
481
|
+
get d() {
|
|
482
|
+
return this.#e.trim();
|
|
483
|
+
}
|
|
484
|
+
clear() {
|
|
485
|
+
this.#e = "";
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
function M(e) {
|
|
489
|
+
return Math.abs(e) < 1e-9 ? "0" : Number(e.toFixed(3)).toString();
|
|
490
|
+
}
|
|
491
|
+
function ue(e, t, n, r, i, a, o, s) {
|
|
492
|
+
let c = i * s * 1.118, l = a * s * 1.118, u = i * (o + s), d = a * (o + s), f = {
|
|
493
|
+
x: r.x - c,
|
|
494
|
+
y: r.y - l
|
|
495
|
+
}, p = n ? 3 / 4 : 1;
|
|
496
|
+
r.x += -u * p - c, r.y += -d * p - l, e.moveTo(f.x, f.y), e.lineTo(f.x - u - d / t, f.y - d + u / t), n && e.lineTo(f.x - u * 3 / 4, f.y - d * 3 / 4), e.lineTo(f.x + d / t - u, f.y - d - u / t), e.close();
|
|
497
|
+
}
|
|
498
|
+
function de(e, t, n, r, i, a, o) {
|
|
499
|
+
let s = r * o * 1.118, c = i * o * 1.118, l = r * (a + o), u = i * (a + o), d = {
|
|
500
|
+
x: n.x - s,
|
|
501
|
+
y: n.y - c
|
|
502
|
+
};
|
|
503
|
+
n.x += -s * 2, n.y += -c * 2, e.moveTo(d.x - l - u / t, d.y - u + l / t), e.lineTo(d.x, d.y), e.lineTo(d.x + u / t - l, d.y - u - l / t);
|
|
504
|
+
}
|
|
505
|
+
function fe(e, t, n, r, i, a, o) {
|
|
506
|
+
let s = t ? .9862 : Math.SQRT1_2, c = r * o * s, l = i * o * s, u = r * (a + o), d = i * (a + o), f = {
|
|
507
|
+
x: n.x - c,
|
|
508
|
+
y: n.y - l
|
|
509
|
+
};
|
|
510
|
+
n.x += -u - c, n.y += -d - l;
|
|
511
|
+
let p = t ? 3.4 : 2;
|
|
512
|
+
e.moveTo(f.x, f.y), e.lineTo(f.x - u / 2 - d / p, f.y + u / p - d / 2), e.lineTo(f.x - u, f.y - d), e.lineTo(f.x - u / 2 + d / p, f.y - d / 2 - u / p), e.close();
|
|
513
|
+
}
|
|
514
|
+
function pe(e, t, n, r, i) {
|
|
515
|
+
let a = i / 2, o = {
|
|
516
|
+
x: t.x,
|
|
517
|
+
y: t.y
|
|
518
|
+
};
|
|
519
|
+
t.x -= n * a, t.y -= r * a, e.ellipse(o.x - a, o.y - a, i, i);
|
|
520
|
+
}
|
|
521
|
+
var me = {
|
|
522
|
+
sm: 6,
|
|
523
|
+
md: 10,
|
|
524
|
+
lg: 14
|
|
525
|
+
}, he = {
|
|
526
|
+
sm: 3.2,
|
|
527
|
+
md: 2.4,
|
|
528
|
+
lg: 1.8
|
|
529
|
+
}, ge = {
|
|
530
|
+
sm: 11,
|
|
531
|
+
md: 15,
|
|
532
|
+
lg: 20
|
|
533
|
+
}, _e = {
|
|
534
|
+
sm: 2.4,
|
|
535
|
+
md: 1.8,
|
|
536
|
+
lg: 1.35
|
|
537
|
+
};
|
|
538
|
+
function ve(e, t, n, r, i, a) {
|
|
539
|
+
if (t.shape === "none") return { filled: !1 };
|
|
540
|
+
let o = t.shape === "arrow" ? ge[t.length] : me[t.length], s = t.shape === "arrow" ? _e[t.width] : he[t.width];
|
|
541
|
+
switch (t.shape) {
|
|
542
|
+
case "triangle": return ue(e, s, !1, n, r, i, o, a), { filled: !0 };
|
|
543
|
+
case "stealth": return ue(e, s, !0, n, r, i, o, a), { filled: !0 };
|
|
544
|
+
case "arrow": return de(e, s, n, r, i, o, a), { filled: !1 };
|
|
545
|
+
case "diamond": return fe(e, !1, n, r, i, o, a), { filled: !0 };
|
|
546
|
+
case "oval": return pe(e, n, r, i, o), { filled: !0 };
|
|
547
|
+
}
|
|
548
|
+
return { filled: !1 };
|
|
549
|
+
}
|
|
550
|
+
function ye(e, t, n, r, i, a, o, s) {
|
|
551
|
+
let c = new j(), l = new j(), u = n - e, d = r - t, f = Math.hypot(u, d) || 1, p = u / f, m = d / f, h = p, g = m, _ = p, v = m;
|
|
552
|
+
if (s) {
|
|
553
|
+
let i = s.x - e, a = s.y - t, o = Math.hypot(i, a);
|
|
554
|
+
o > 1e-6 && (h = i / o, g = a / o);
|
|
555
|
+
let c = n - s.x, l = r - s.y, u = Math.hypot(c, l);
|
|
556
|
+
u > 1e-6 && (_ = c / u, v = l / u);
|
|
557
|
+
}
|
|
558
|
+
let y = {
|
|
559
|
+
x: e,
|
|
560
|
+
y: t
|
|
561
|
+
}, b = {
|
|
562
|
+
x: n,
|
|
563
|
+
y: r
|
|
564
|
+
}, x = be(a.shape), S = be(i.shape);
|
|
565
|
+
ve(x ? c : l, a, b, _, v, o), ve(S ? c : l, i, y, -h, -g, o);
|
|
566
|
+
let C = new j();
|
|
567
|
+
return C.moveTo(y.x, y.y), s ? C.quadTo(s.x, s.y, b.x, b.y) : C.lineTo(b.x, b.y), {
|
|
568
|
+
stemD: C.d,
|
|
569
|
+
headFilledD: c.d,
|
|
570
|
+
headOpenD: l.d
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
function be(e) {
|
|
574
|
+
return e === "triangle" || e === "stealth" || e === "diamond" || e === "oval";
|
|
575
|
+
}
|
|
576
|
+
function N(e, t) {
|
|
577
|
+
return {
|
|
578
|
+
shape: e.getAttribute(`data-arrow-${t}-shape`) || "none",
|
|
579
|
+
width: e.getAttribute(`data-arrow-${t}-width`) || e.getAttribute(`data-arrow-${t}-size`) || "md",
|
|
580
|
+
length: e.getAttribute(`data-arrow-${t}-length`) || e.getAttribute(`data-arrow-${t}-size`) || "md"
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
function xe(e) {
|
|
584
|
+
return {
|
|
585
|
+
x1: Number.parseFloat(e.getAttribute("data-x1") || "0"),
|
|
586
|
+
y1: Number.parseFloat(e.getAttribute("data-y1") || "0"),
|
|
587
|
+
x2: Number.parseFloat(e.getAttribute("data-x2") || "0"),
|
|
588
|
+
y2: Number.parseFloat(e.getAttribute("data-y2") || "0")
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
function Se(e) {
|
|
592
|
+
let t = e.getAttribute("data-cx"), n = e.getAttribute("data-cy");
|
|
593
|
+
if (t == null || n == null) return null;
|
|
594
|
+
let r = Number.parseFloat(t), i = Number.parseFloat(n);
|
|
595
|
+
return !Number.isFinite(r) || !Number.isFinite(i) ? null : {
|
|
596
|
+
x: r,
|
|
597
|
+
y: i
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
function Ce(e) {
|
|
601
|
+
let { x1: t, y1: n, x2: r, y2: i } = xe(e), a = Se(e), { stemD: o, headFilledD: s, headOpenD: c } = ye(t, n, r, i, N(e, "start"), N(e, "end"), Number.parseFloat(e.getAttribute("stroke-width") || "3") || 3, a), l = e.querySelector(":scope > [data-role=\"stem\"]");
|
|
602
|
+
l || (l = document.createElementNS("http://www.w3.org/2000/svg", "path"), l.setAttribute("data-role", "stem"), e.appendChild(l)), l.setAttribute("fill", "none"), l.removeAttribute("stroke-linecap"), l.removeAttribute("stroke-linejoin"), l.setAttribute("d", o);
|
|
603
|
+
let u = e.getAttribute("stroke") || "#ff0000", d = (e, t, n) => {
|
|
604
|
+
e.setAttribute("stroke-dasharray", "none"), e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-linejoin", "miter"), e.setAttribute("fill", t), e.removeAttribute("stroke-width"), e.setAttribute("d", n);
|
|
605
|
+
}, f = e.querySelector(":scope > [data-role=\"head-filled\"]");
|
|
606
|
+
f || (f = document.createElementNS("http://www.w3.org/2000/svg", "path"), f.setAttribute("data-role", "head-filled"), e.appendChild(f)), d(f, u, s);
|
|
607
|
+
let p = e.querySelector(":scope > [data-role=\"head-open\"]");
|
|
608
|
+
p || (p = document.createElementNS("http://www.w3.org/2000/svg", "path"), p.setAttribute("data-role", "head-open"), e.appendChild(p)), d(p, "none", c);
|
|
609
|
+
}
|
|
610
|
+
function we(e, t = "right") {
|
|
611
|
+
let n = Te(e);
|
|
612
|
+
return `<svg width="40" height="14" viewBox="0 0 40 14">${t === "left" ? `<g transform="translate(40,0) scale(-1,1)">${n}</g>` : n}</svg>`;
|
|
613
|
+
}
|
|
614
|
+
function Te(e) {
|
|
615
|
+
let t = (e) => `<line x1="2" y1="7" x2="${e}" y2="7" stroke="currentColor" stroke-width="1.6" stroke-linecap="butt"/>`;
|
|
616
|
+
switch (e) {
|
|
617
|
+
case "none": return "<line x1=\"2\" y1=\"7\" x2=\"38\" y2=\"7\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"butt\"/>";
|
|
618
|
+
case "triangle": return `${t(28)}<polygon points="28 2, 38 7, 28 12" fill="currentColor"/>`;
|
|
619
|
+
case "arrow": return `${t(38)}<polyline points="26 1, 38 7, 26 13" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linejoin="round" stroke-linecap="round"/>`;
|
|
620
|
+
case "stealth": return `${t(31)}<polygon points="28 2, 38 7, 28 12, 31 7" fill="currentColor"/>`;
|
|
621
|
+
case "diamond": return `${t(28)}<polygon points="24 7, 31 2, 38 7, 31 12" fill="currentColor"/>`;
|
|
622
|
+
case "oval": return `${t(28)}<circle cx="33" cy="7" r="5" fill="currentColor"/>`;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function Ee(e, t, n = "right") {
|
|
626
|
+
let r = 1.2, { stemD: i, headFilledD: a, headOpenD: o } = ye(2, 7, 38, 7, {
|
|
627
|
+
shape: "none",
|
|
628
|
+
width: e,
|
|
629
|
+
length: t
|
|
630
|
+
}, {
|
|
631
|
+
shape: "triangle",
|
|
632
|
+
width: e,
|
|
633
|
+
length: t
|
|
634
|
+
}, r), s = `stroke="currentColor" stroke-width="${r}" stroke-linecap="round" stroke-linejoin="miter"`, c = `<path d="${i}" fill="none" stroke="currentColor" stroke-width="${r}" stroke-linecap="butt"/><path d="${a}" fill="currentColor" ${s}/><path d="${o}" fill="none" ${s}/>`;
|
|
635
|
+
return `<svg width="40" height="14" viewBox="0 0 40 14">${n === "left" ? `<g transform="translate(40,0) scale(-1,1)">${c}</g>` : c}</svg>`;
|
|
636
|
+
}
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region src/editor/shape-utils.ts
|
|
639
|
+
var De = "http://www.w3.org/2000/svg";
|
|
640
|
+
function Oe(e) {
|
|
641
|
+
return e.tagName === "ellipse" ? "ellipse" : e.tagName === "rect" ? e.hasAttribute("data-rounded") ? "rounded" : "rect" : null;
|
|
642
|
+
}
|
|
643
|
+
function ke(e) {
|
|
644
|
+
if (e.tagName === "ellipse") {
|
|
645
|
+
let t = Number.parseFloat(e.getAttribute("cx") || "0"), n = Number.parseFloat(e.getAttribute("cy") || "0"), r = Number.parseFloat(e.getAttribute("rx") || "0"), i = Number.parseFloat(e.getAttribute("ry") || "0");
|
|
646
|
+
return {
|
|
647
|
+
x: t - r,
|
|
648
|
+
y: n - i,
|
|
649
|
+
w: r * 2,
|
|
650
|
+
h: i * 2
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
return {
|
|
654
|
+
x: Number.parseFloat(e.getAttribute("x") || "0"),
|
|
655
|
+
y: Number.parseFloat(e.getAttribute("y") || "0"),
|
|
656
|
+
w: Number.parseFloat(e.getAttribute("width") || "0"),
|
|
657
|
+
h: Number.parseFloat(e.getAttribute("height") || "0")
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
var Ae = [
|
|
661
|
+
"stroke",
|
|
662
|
+
"stroke-width",
|
|
663
|
+
"stroke-dasharray",
|
|
664
|
+
"stroke-linecap",
|
|
665
|
+
"data-dash-key",
|
|
666
|
+
"fill",
|
|
667
|
+
"fill-opacity"
|
|
668
|
+
];
|
|
669
|
+
function je(e, t) {
|
|
670
|
+
let { x: n, y: r, w: i, h: a } = ke(e), o = e.parentNode;
|
|
671
|
+
if (!o) throw Error("convertShape: element is detached from DOM");
|
|
672
|
+
let s;
|
|
673
|
+
if (t === "ellipse") s = document.createElementNS(De, "ellipse"), s.setAttribute("cx", String(n + i / 2)), s.setAttribute("cy", String(r + a / 2)), s.setAttribute("rx", String(i / 2)), s.setAttribute("ry", String(a / 2));
|
|
674
|
+
else if (s = document.createElementNS(De, "rect"), s.setAttribute("x", String(n)), s.setAttribute("y", String(r)), s.setAttribute("width", String(i)), s.setAttribute("height", String(a)), t === "rounded") {
|
|
675
|
+
let e = Math.max(2, Math.round(Math.min(i, a) / 6));
|
|
676
|
+
s.setAttribute("rx", String(e)), s.setAttribute("data-rounded", "true");
|
|
677
|
+
} else s.setAttribute("rx", "0");
|
|
678
|
+
for (let t of Ae) {
|
|
679
|
+
let n = e.getAttribute(t);
|
|
680
|
+
n != null && s.setAttribute(t, n);
|
|
681
|
+
}
|
|
682
|
+
return o.replaceChild(s, e), s;
|
|
683
|
+
}
|
|
684
|
+
//#endregion
|
|
685
|
+
//#region src/editor/text-utils.ts
|
|
686
|
+
var P = "http://www.w3.org/2000/svg", Me = {
|
|
687
|
+
"#ff0000": "rgba(255,255,200,0.92)",
|
|
688
|
+
"#00ff00": "rgba(200,255,200,0.92)",
|
|
689
|
+
"#0000ff": "rgba(200,220,255,0.92)",
|
|
690
|
+
"#ff8800": "rgba(255,230,200,0.92)",
|
|
691
|
+
"#ff00ff": "rgba(255,210,255,0.92)"
|
|
692
|
+
};
|
|
693
|
+
function Ne(e) {
|
|
694
|
+
return Me[e.toLowerCase()] || "rgba(255,255,200,0.92)";
|
|
695
|
+
}
|
|
696
|
+
function F(e, t, n) {
|
|
697
|
+
let r = e.getAttribute(t);
|
|
698
|
+
if (r == null) return n;
|
|
699
|
+
let i = Number.parseFloat(r);
|
|
700
|
+
return Number.isFinite(i) && i >= 0 ? i : n;
|
|
701
|
+
}
|
|
702
|
+
function Pe(e) {
|
|
703
|
+
let t = e.getAttribute("data-shape-kind"), n = t === "plain" ? 2 : 10, r = t === "plain" ? 0 : 8;
|
|
704
|
+
return {
|
|
705
|
+
left: F(e, "data-text-margin-l", n),
|
|
706
|
+
right: F(e, "data-text-margin-r", n),
|
|
707
|
+
top: F(e, "data-text-margin-t", r),
|
|
708
|
+
bottom: F(e, "data-text-margin-b", r)
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
function Fe(e) {
|
|
712
|
+
return e === "rect" || e === "rounded" || e === "ellipse" ? "middle" : "start";
|
|
713
|
+
}
|
|
714
|
+
function Ie(e) {
|
|
715
|
+
return e === "rect" || e === "rounded" || e === "ellipse" ? "middle" : "top";
|
|
716
|
+
}
|
|
717
|
+
var I;
|
|
718
|
+
function Le() {
|
|
719
|
+
if (I !== void 0) return I;
|
|
720
|
+
if (typeof document > "u") return I = null;
|
|
721
|
+
try {
|
|
722
|
+
I = document.createElement("canvas").getContext("2d");
|
|
723
|
+
} catch {
|
|
724
|
+
I = null;
|
|
725
|
+
}
|
|
726
|
+
return I;
|
|
727
|
+
}
|
|
728
|
+
function Re(e, t, n, r, i) {
|
|
729
|
+
let a = Le();
|
|
730
|
+
return a ? (a.font = `${`${i ? "italic " : ""}${r ? "bold " : ""}`}${t}px ${n}`, a.measureText(e).width) : 0;
|
|
731
|
+
}
|
|
732
|
+
var L;
|
|
733
|
+
function ze() {
|
|
734
|
+
if (L !== void 0) return L;
|
|
735
|
+
if (typeof Intl > "u" || Intl.Segmenter === void 0) return L = null;
|
|
736
|
+
try {
|
|
737
|
+
let e = typeof navigator < "u" ? navigator.language : void 0;
|
|
738
|
+
L = new Intl.Segmenter(e, { granularity: "word" });
|
|
739
|
+
} catch {
|
|
740
|
+
L = null;
|
|
741
|
+
}
|
|
742
|
+
return L;
|
|
743
|
+
}
|
|
744
|
+
var R = /^[\s ]+$/;
|
|
745
|
+
function Be(e, t, n, r) {
|
|
746
|
+
let i = [], a = {
|
|
747
|
+
segments: [],
|
|
748
|
+
maxFontSize: 0
|
|
749
|
+
}, o = 0, s = ze(), c = () => {
|
|
750
|
+
i.push(a), a = {
|
|
751
|
+
segments: [],
|
|
752
|
+
maxFontSize: 0
|
|
753
|
+
}, o = 0;
|
|
754
|
+
};
|
|
755
|
+
for (let i of e) {
|
|
756
|
+
let e = i.font_size ?? n, l = i.font_family ?? r, u = !!i.bold, d = !!i.italic, f = [];
|
|
757
|
+
if (i.text) if (s) for (let e of s.segment(i.text)) f.push(e.segment);
|
|
758
|
+
else {
|
|
759
|
+
let e = 0;
|
|
760
|
+
for (; e < i.text.length;) {
|
|
761
|
+
let t = R.test(i.text[e]), n = e + 1;
|
|
762
|
+
for (; n < i.text.length && R.test(i.text[n]) === t;) n++;
|
|
763
|
+
f.push(i.text.slice(e, n)), e = n;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
let p = "", m = () => {
|
|
767
|
+
p &&= (a.segments.push({
|
|
768
|
+
text: p,
|
|
769
|
+
bold: i.bold,
|
|
770
|
+
italic: i.italic,
|
|
771
|
+
underline: i.underline,
|
|
772
|
+
font_size: i.font_size,
|
|
773
|
+
font_family: i.font_family,
|
|
774
|
+
color: i.color
|
|
775
|
+
}), e > a.maxFontSize && (a.maxFontSize = e), "");
|
|
776
|
+
};
|
|
777
|
+
for (let n of f) {
|
|
778
|
+
if (a.segments.length === 0 && p === "" && R.test(n)) continue;
|
|
779
|
+
let r = Re(n, e, l, u, d);
|
|
780
|
+
o + r > t && (o > 0 || p !== "") && (m(), c(), R.test(n)) || (p += n, o += r);
|
|
781
|
+
}
|
|
782
|
+
m(), i.text === "" && a.segments.length === 0 && e > a.maxFontSize && (a.maxFontSize = e), i.line_break_after && c();
|
|
783
|
+
}
|
|
784
|
+
(a.segments.length > 0 || i.length === 0) && (a.maxFontSize === 0 && (a.maxFontSize = n), i.push(a));
|
|
785
|
+
for (let e of i) e.maxFontSize === 0 && (e.maxFontSize = n);
|
|
786
|
+
return i;
|
|
787
|
+
}
|
|
788
|
+
function Ve(e) {
|
|
789
|
+
let { x: t, y: n, w: r, h: i, lineFontSizes: a, margins: o, textAnchor: s, textVerticalAnchor: c } = e, l = a.length > 0 ? a : [16], u = l.map((e) => e * 1.4), d = Array(l.length);
|
|
790
|
+
d[0] = 0;
|
|
791
|
+
for (let e = 1; e < l.length; e++) d[e] = d[e - 1] + u[e - 1];
|
|
792
|
+
let f = d[l.length - 1] + u[l.length - 1], p;
|
|
793
|
+
p = s === "start" ? t + o.left : s === "end" ? t + r - o.right : t + (o.left + (r - o.right)) / 2;
|
|
794
|
+
let m;
|
|
795
|
+
return m = c === "top" ? n + o.top : c === "bottom" ? n + i - o.bottom - f : n + o.top + (Math.max(0, i - o.top - o.bottom) - f) / 2, {
|
|
796
|
+
textAnchorAttr: s,
|
|
797
|
+
xForLine: p,
|
|
798
|
+
yForLine: (e) => {
|
|
799
|
+
let t = Math.max(0, Math.min(l.length - 1, e));
|
|
800
|
+
return m + d[t] + l[t];
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
function He(e) {
|
|
805
|
+
return e.tagName === "g" && e.getAttribute("data-type") === "shape" && e.getAttribute("data-shape-kind") != null;
|
|
806
|
+
}
|
|
807
|
+
function Ue(e) {
|
|
808
|
+
let t = e.getAttribute("data-shape-kind");
|
|
809
|
+
return t === "plain" || t === "sticky" || t === "callout" ? t : "sticky";
|
|
810
|
+
}
|
|
811
|
+
function We(e) {
|
|
812
|
+
return e.hasAttribute("x") || e.hasAttribute("y");
|
|
813
|
+
}
|
|
814
|
+
function Ge(e) {
|
|
815
|
+
let t = e.querySelector("text");
|
|
816
|
+
if (!t) return [];
|
|
817
|
+
let n = Array.from(t.querySelectorAll("tspan"));
|
|
818
|
+
if (n.length === 0) {
|
|
819
|
+
let e = t.textContent ?? "";
|
|
820
|
+
return e ? [{
|
|
821
|
+
text: e,
|
|
822
|
+
line_break_after: !1
|
|
823
|
+
}] : [];
|
|
824
|
+
}
|
|
825
|
+
let r = [];
|
|
826
|
+
for (let e = 0; e < n.length; e++) {
|
|
827
|
+
let t = n[e], i = { text: t.textContent ?? "" }, a = t.getAttribute("font-weight");
|
|
828
|
+
(a === "bold" || a === "700") && (i.bold = !0), t.getAttribute("font-style") === "italic" && (i.italic = !0), t.getAttribute("text-decoration")?.includes("underline") && (i.underline = !0);
|
|
829
|
+
let o = t.getAttribute("font-size");
|
|
830
|
+
if (o) {
|
|
831
|
+
let e = Number.parseFloat(o);
|
|
832
|
+
Number.isFinite(e) && (i.font_size = e);
|
|
833
|
+
}
|
|
834
|
+
let s = t.getAttribute("font-family");
|
|
835
|
+
s && (i.font_family = s);
|
|
836
|
+
let c = t.getAttribute("fill");
|
|
837
|
+
c && (i.color = c);
|
|
838
|
+
let l = n[e + 1];
|
|
839
|
+
i.line_break_after = l != null && We(l), r.push(i);
|
|
840
|
+
}
|
|
841
|
+
return r;
|
|
842
|
+
}
|
|
843
|
+
function z(e) {
|
|
844
|
+
let t = e.querySelector("rect"), n = Number.parseFloat(t?.getAttribute("x") || "0"), r = Number.parseFloat(t?.getAttribute("y") || "0"), i = Number.parseFloat(t?.getAttribute("width") || "200"), a = Number.parseFloat(t?.getAttribute("height") || "80"), o = Number.parseFloat(e.getAttribute("data-font-size") || "16"), s = e.getAttribute("data-font-family") || "Annot Sans", c = e.getAttribute("data-color") || "#ff0000", l = Ue(e), u = e.getAttribute("data-shape-kind"), d = e.getAttribute("data-tail-x"), f = e.getAttribute("data-tail-y"), p = e.getAttribute("data-text-anchor"), m = e.getAttribute("data-text-vanchor");
|
|
845
|
+
return {
|
|
846
|
+
x: n,
|
|
847
|
+
y: r,
|
|
848
|
+
w: i,
|
|
849
|
+
h: a,
|
|
850
|
+
variant: l,
|
|
851
|
+
runs: Ge(e),
|
|
852
|
+
fontSize: o,
|
|
853
|
+
fontFamily: s,
|
|
854
|
+
color: c,
|
|
855
|
+
textAnchor: p ?? Fe(u),
|
|
856
|
+
textVerticalAnchor: m ?? Ie(u),
|
|
857
|
+
tailX: d == null ? void 0 : Number.parseFloat(d),
|
|
858
|
+
tailY: f == null ? void 0 : Number.parseFloat(f)
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
function Ke(e) {
|
|
862
|
+
let t = document.createElementNS(P, "g");
|
|
863
|
+
t.setAttribute("data-type", "shape"), t.setAttribute("data-shape-kind", e.variant), t.setAttribute("data-font-size", String(e.fontSize)), t.setAttribute("data-font-family", e.fontFamily), t.setAttribute("data-color", e.color);
|
|
864
|
+
let n = e.textAnchor ?? Fe(e.variant), r = e.textVerticalAnchor ?? Ie(e.variant);
|
|
865
|
+
t.setAttribute("data-text-anchor", n), t.setAttribute("data-text-vanchor", r);
|
|
866
|
+
let i = document.createElementNS(P, "rect");
|
|
867
|
+
if (i.setAttribute("x", String(e.x)), i.setAttribute("y", String(e.y)), i.setAttribute("width", String(e.w)), i.setAttribute("height", String(e.h)), e.variant === "plain" ? (i.setAttribute("fill", "none"), i.setAttribute("stroke", "none"), i.setAttribute("pointer-events", "all")) : e.variant === "sticky" ? (i.setAttribute("rx", "4"), i.setAttribute("fill", Ne(e.color)), i.setAttribute("stroke", "rgba(0,0,0,0.15)"), i.setAttribute("stroke-width", "1")) : (i.setAttribute("rx", "8"), i.setAttribute("fill", Ne(e.color)), i.setAttribute("stroke", "none")), t.appendChild(i), e.variant === "callout") {
|
|
868
|
+
let n = e.tailX ?? e.x - 30, r = e.tailY ?? e.y + e.h + 40;
|
|
869
|
+
t.setAttribute("data-tail-x", String(n)), t.setAttribute("data-tail-y", String(r));
|
|
870
|
+
let i = document.createElementNS(P, "path");
|
|
871
|
+
i.setAttribute("d", ""), i.setAttribute("fill", Ne(e.color)), i.setAttribute("stroke", "rgba(0,0,0,0.25)"), i.setAttribute("stroke-width", "1"), t.appendChild(i), Je(t);
|
|
872
|
+
}
|
|
873
|
+
let a = `clip-textshape-${Math.random().toString(36).slice(2, 9)}`, o = document.createElementNS(P, "clipPath");
|
|
874
|
+
o.id = a;
|
|
875
|
+
let s = document.createElementNS(P, "rect");
|
|
876
|
+
s.setAttribute("x", String(e.x)), s.setAttribute("y", String(e.y)), s.setAttribute("width", String(e.w)), s.setAttribute("height", String(e.h)), o.appendChild(s), t.appendChild(o);
|
|
877
|
+
let c = Pe(t), l = Math.max(0, e.w - c.left - c.right), u = Be(e.runs, l, e.fontSize, e.fontFamily), d = Ve({
|
|
878
|
+
x: e.x,
|
|
879
|
+
y: e.y,
|
|
880
|
+
w: e.w,
|
|
881
|
+
h: e.h,
|
|
882
|
+
lineFontSizes: u.map((e) => e.maxFontSize),
|
|
883
|
+
margins: c,
|
|
884
|
+
textAnchor: n,
|
|
885
|
+
textVerticalAnchor: r
|
|
886
|
+
}), f = document.createElementNS(P, "text");
|
|
887
|
+
return f.setAttribute("font-size", String(e.fontSize)), f.setAttribute("fill", e.color), f.setAttribute("font-family", e.fontFamily), f.setAttribute("clip-path", `url(#${a})`), f.setAttribute("text-anchor", d.textAnchorAttr), f.style.pointerEvents = "none", qe(f, u, d), t.appendChild(f), t;
|
|
888
|
+
}
|
|
889
|
+
function qe(e, t, n) {
|
|
890
|
+
for (let r = 0; r < t.length; r++) {
|
|
891
|
+
let i = t[r], a = n.xForLine, o = n.yForLine(r);
|
|
892
|
+
if (i.segments.length === 0) {
|
|
893
|
+
let t = document.createElementNS(P, "tspan");
|
|
894
|
+
t.setAttribute("x", String(a)), t.setAttribute("y", String(o)), t.textContent = "", e.appendChild(t);
|
|
895
|
+
continue;
|
|
896
|
+
}
|
|
897
|
+
let s = !0;
|
|
898
|
+
for (let t of i.segments) {
|
|
899
|
+
let n = document.createElementNS(P, "tspan");
|
|
900
|
+
s &&= (n.setAttribute("x", String(a)), n.setAttribute("y", String(o)), !1), t.bold && n.setAttribute("font-weight", "bold"), t.italic && n.setAttribute("font-style", "italic"), t.underline && n.setAttribute("text-decoration", "underline"), t.font_size != null && n.setAttribute("font-size", String(t.font_size)), t.font_family != null && n.setAttribute("font-family", t.font_family), t.color != null && n.setAttribute("fill", t.color), n.textContent = t.text, e.appendChild(n);
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
function Je(e) {
|
|
905
|
+
if (e.getAttribute("data-shape-kind") !== "callout") return;
|
|
906
|
+
let t = e.querySelector("rect"), n = e.querySelector("path");
|
|
907
|
+
if (!t || !n) return;
|
|
908
|
+
let r = Number.parseFloat(t.getAttribute("x") || "0"), i = Number.parseFloat(t.getAttribute("y") || "0"), a = Number.parseFloat(t.getAttribute("width") || "0"), o = Number.parseFloat(t.getAttribute("height") || "0"), s = Number.parseFloat(t.getAttribute("rx") || "0"), c = Number.parseFloat(e.getAttribute("data-tail-x") || String(r - 30)), l = Number.parseFloat(e.getAttribute("data-tail-y") || String(i + o + 40)), u = r + a / 2, d = i + o / 2, f = c < r ? r - c : c > r + a ? c - (r + a) : 0, p = l < i ? i - l : l > i + o ? l - (i + o) : 0, m;
|
|
909
|
+
if (f === 0 && p === 0) {
|
|
910
|
+
let e = c - u, t = l - d;
|
|
911
|
+
m = Math.abs(e) > Math.abs(t) ? e > 0 ? "right" : "left" : t > 0 ? "bottom" : "top";
|
|
912
|
+
} else m = f > p ? c < r ? "left" : "right" : l < i ? "top" : "bottom";
|
|
913
|
+
let h = .1667, g = r, _ = r + a, v = i, y = i + o, b = Math.max(0, Math.min(a * h, a - 2 * s)), x = Math.max(0, Math.min(o * h, o - 2 * s)), S = b / 2, C = x / 2, ee = c < u ? (u + (g + s)) / 2 : (u + (_ - s)) / 2, te = l < d ? (d + (v + s)) / 2 : (d + (y - s)) / 2, w = ee - S, T = ee + S, E = te - C, D = te + C, O = [];
|
|
914
|
+
O.push(`M ${g + s} ${v}`), m === "top" && (O.push(`L ${w} ${v}`), O.push(`L ${c} ${l}`), O.push(`L ${T} ${v}`)), O.push(`L ${_ - s} ${v}`), s > 0 && O.push(`A ${s} ${s} 0 0 1 ${_} ${v + s}`), m === "right" && (O.push(`L ${_} ${E}`), O.push(`L ${c} ${l}`), O.push(`L ${_} ${D}`)), O.push(`L ${_} ${y - s}`), s > 0 && O.push(`A ${s} ${s} 0 0 1 ${_ - s} ${y}`), m === "bottom" && (O.push(`L ${T} ${y}`), O.push(`L ${c} ${l}`), O.push(`L ${w} ${y}`)), O.push(`L ${g + s} ${y}`), s > 0 && O.push(`A ${s} ${s} 0 0 1 ${g} ${y - s}`), m === "left" && (O.push(`L ${g} ${D}`), O.push(`L ${c} ${l}`), O.push(`L ${g} ${E}`)), O.push(`L ${g} ${v + s}`), s > 0 && O.push(`A ${s} ${s} 0 0 1 ${g + s} ${v}`), O.push("Z"), n.setAttribute("d", O.join(" "));
|
|
915
|
+
}
|
|
916
|
+
function B(e, t) {
|
|
917
|
+
let n = (() => {
|
|
918
|
+
for (let t of Array.from(e.children)) if (t.tagName === "rect") return t;
|
|
919
|
+
return null;
|
|
920
|
+
})(), r = n ? Number.parseFloat(n.getAttribute("x") || "0") : 0, i = n ? Number.parseFloat(n.getAttribute("y") || "0") : 0, a = n ? Number.parseFloat(n.getAttribute("width") || "0") : 0, o = n ? Number.parseFloat(n.getAttribute("height") || "0") : 0, s = Number.parseFloat(e.getAttribute("data-font-size") || "16"), c = e.getAttribute("data-font-family") || "Annot Sans", l = e.getAttribute("data-color") || "#000000", u = e.getAttribute("data-shape-kind"), d = Pe(e), f = e.getAttribute("data-text-anchor") ?? Fe(u), p = e.getAttribute("data-text-vanchor") ?? Ie(u), m = Be(t, Math.max(0, a - d.left - d.right), s, c), h = m.map((e) => e.maxFontSize), g = Ve({
|
|
921
|
+
x: r,
|
|
922
|
+
y: i,
|
|
923
|
+
w: a,
|
|
924
|
+
h: o,
|
|
925
|
+
lineFontSizes: h,
|
|
926
|
+
margins: d,
|
|
927
|
+
textAnchor: f,
|
|
928
|
+
textVerticalAnchor: p
|
|
929
|
+
}), _ = null;
|
|
930
|
+
for (let t of Array.from(e.children)) if (t.tagName === "text") {
|
|
931
|
+
_ = t;
|
|
932
|
+
break;
|
|
933
|
+
}
|
|
934
|
+
for (_ || (_ = document.createElementNS(P, "text"), e.appendChild(_)), _.setAttribute("font-size", String(s)), _.setAttribute("font-family", c), _.setAttribute("fill", l), _.setAttribute("text-anchor", g.textAnchorAttr), _.style.pointerEvents = "none"; _.firstChild;) _.removeChild(_.firstChild);
|
|
935
|
+
if (qe(_, m, g), e.getAttribute("data-text-autofit") === "resize" && n) {
|
|
936
|
+
let r = 0;
|
|
937
|
+
for (let e of h) r += e * 1.4;
|
|
938
|
+
r === 0 && (r = s * 1.4);
|
|
939
|
+
let i = r + d.top + d.bottom;
|
|
940
|
+
if (i > o) {
|
|
941
|
+
n.setAttribute("height", String(i));
|
|
942
|
+
let r = e.querySelector("clipPath > rect");
|
|
943
|
+
r instanceof Element && r.setAttribute("height", String(i)), Je(e), B(e, t);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
function Ye(e, t) {
|
|
948
|
+
let n = e.parentNode;
|
|
949
|
+
if (!n) throw Error("convertTextVariant: element is detached");
|
|
950
|
+
let r = Ke({
|
|
951
|
+
...z(e),
|
|
952
|
+
variant: t
|
|
953
|
+
}), i = e.getAttribute("transform");
|
|
954
|
+
return i && r.setAttribute("transform", i), n.replaceChild(r, e), r;
|
|
955
|
+
}
|
|
956
|
+
//#endregion
|
|
957
|
+
//#region src/editor/property-schema.ts
|
|
958
|
+
var V = {
|
|
959
|
+
shapeTypePicker: "shapeTypePicker",
|
|
960
|
+
arrowVariantPicker: "arrowVariantPicker",
|
|
961
|
+
drawStylePicker: "drawStylePicker",
|
|
962
|
+
fillColor: "fillColor",
|
|
963
|
+
strokeColor: "strokeColor",
|
|
964
|
+
strokeWidth: "strokeWidth",
|
|
965
|
+
strokeStyle: "strokeStyle",
|
|
966
|
+
textVariantPicker: "textVariantPicker",
|
|
967
|
+
textColor: "textColor",
|
|
968
|
+
fontFamily: "fontFamily",
|
|
969
|
+
fontSize: "fontSize",
|
|
970
|
+
textBold: "textBold",
|
|
971
|
+
textItalic: "textItalic",
|
|
972
|
+
textUnderline: "textUnderline",
|
|
973
|
+
textAnchor: "textAnchor",
|
|
974
|
+
textVerticalAnchor: "textVerticalAnchor",
|
|
975
|
+
textAutofit: "textAutofit",
|
|
976
|
+
textMarginLeft: "textMarginLeft",
|
|
977
|
+
textMarginRight: "textMarginRight",
|
|
978
|
+
textMarginTop: "textMarginTop",
|
|
979
|
+
textMarginBottom: "textMarginBottom",
|
|
980
|
+
redactStylePicker: "redactStylePicker",
|
|
981
|
+
redactSolidColor: "redactSolidColor",
|
|
982
|
+
highlightColorPicker: "highlightColorPicker",
|
|
983
|
+
highlightTransparency: "highlightTransparency",
|
|
984
|
+
markerShapePicker: "markerShapePicker",
|
|
985
|
+
markerSize: "markerSize",
|
|
986
|
+
markerBgFillColor: "markerBgFillColor",
|
|
987
|
+
markerBgStrokeColor: "markerBgStrokeColor",
|
|
988
|
+
markerBgStrokeWidth: "markerBgStrokeWidth",
|
|
989
|
+
markerBgStrokeStyle: "markerBgStrokeStyle",
|
|
990
|
+
markerLabelValue: "markerLabelValue",
|
|
991
|
+
fillOpacity: "fillOpacity",
|
|
992
|
+
strokeOpacity: "strokeOpacity",
|
|
993
|
+
strokeLinecap: "strokeLinecap",
|
|
994
|
+
arrowStartShape: "arrowStartShape",
|
|
995
|
+
arrowStartSize: "arrowStartSize",
|
|
996
|
+
arrowEndShape: "arrowEndShape",
|
|
997
|
+
arrowEndSize: "arrowEndSize"
|
|
998
|
+
}, Xe = {
|
|
999
|
+
textbox: [
|
|
1000
|
+
V.textVariantPicker,
|
|
1001
|
+
V.textColor,
|
|
1002
|
+
V.fontFamily,
|
|
1003
|
+
V.fontSize,
|
|
1004
|
+
V.textBold,
|
|
1005
|
+
V.textItalic,
|
|
1006
|
+
V.textUnderline,
|
|
1007
|
+
V.textAnchor,
|
|
1008
|
+
V.textVerticalAnchor,
|
|
1009
|
+
V.textAutofit,
|
|
1010
|
+
V.textMarginLeft,
|
|
1011
|
+
V.textMarginRight,
|
|
1012
|
+
V.textMarginTop,
|
|
1013
|
+
V.textMarginBottom
|
|
1014
|
+
],
|
|
1015
|
+
marker: [
|
|
1016
|
+
V.markerShapePicker,
|
|
1017
|
+
V.markerBgFillColor,
|
|
1018
|
+
V.markerBgStrokeColor,
|
|
1019
|
+
V.markerBgStrokeWidth,
|
|
1020
|
+
V.markerBgStrokeStyle,
|
|
1021
|
+
V.markerLabelValue,
|
|
1022
|
+
V.markerSize
|
|
1023
|
+
],
|
|
1024
|
+
"redact-mosaic": [V.redactStylePicker],
|
|
1025
|
+
"redact-solid": [V.redactStylePicker, V.redactSolidColor],
|
|
1026
|
+
"redact-blur": [V.redactStylePicker],
|
|
1027
|
+
highlight: [V.highlightColorPicker, V.highlightTransparency],
|
|
1028
|
+
group: [],
|
|
1029
|
+
shape: [
|
|
1030
|
+
V.shapeTypePicker,
|
|
1031
|
+
V.arrowVariantPicker,
|
|
1032
|
+
V.drawStylePicker,
|
|
1033
|
+
V.fillColor,
|
|
1034
|
+
V.fillOpacity,
|
|
1035
|
+
V.strokeColor,
|
|
1036
|
+
V.strokeOpacity,
|
|
1037
|
+
V.strokeWidth,
|
|
1038
|
+
V.strokeStyle,
|
|
1039
|
+
V.strokeLinecap,
|
|
1040
|
+
V.arrowStartShape,
|
|
1041
|
+
V.arrowStartSize,
|
|
1042
|
+
V.arrowEndShape,
|
|
1043
|
+
V.arrowEndSize
|
|
1044
|
+
]
|
|
1045
|
+
}, H = {
|
|
1046
|
+
applyArrowVariant: "applyArrowVariant",
|
|
1047
|
+
applyDrawStyle: "applyDrawStyle",
|
|
1048
|
+
applyMarkerShape: "applyMarkerShape",
|
|
1049
|
+
resizeMarker: "resizeMarker",
|
|
1050
|
+
applyRedactStyle: "applyRedactStyle",
|
|
1051
|
+
applyTextColor: "applyTextColor",
|
|
1052
|
+
applyArrowStartShape: "applyArrowStartShape",
|
|
1053
|
+
applyArrowStartSize: "applyArrowStartSize",
|
|
1054
|
+
applyArrowEndShape: "applyArrowEndShape",
|
|
1055
|
+
applyArrowEndSize: "applyArrowEndSize"
|
|
1056
|
+
};
|
|
1057
|
+
function Ze(e) {
|
|
1058
|
+
let t = (e.getAttribute("data-arrow-start-shape") ?? "none") === "none", n = (e.getAttribute("data-arrow-end-shape") ?? "none") === "none";
|
|
1059
|
+
return t && n ? "none" : !t && !n ? "both" : "end";
|
|
1060
|
+
}
|
|
1061
|
+
function Qe(e) {
|
|
1062
|
+
let t = e.getAttribute("data-draw-style");
|
|
1063
|
+
if (t === "pen" || t === "highlighter") return t;
|
|
1064
|
+
if (e.tagName === "g" && e.getAttribute("data-type") === "freehand") {
|
|
1065
|
+
let t = e.querySelector("path");
|
|
1066
|
+
if (t) return Qe(t);
|
|
1067
|
+
}
|
|
1068
|
+
return Number.parseFloat(e.getAttribute("stroke-opacity") || "1") < .99 ? "highlighter" : "pen";
|
|
1069
|
+
}
|
|
1070
|
+
function $e(e) {
|
|
1071
|
+
let t = e.getAttribute("data-shape");
|
|
1072
|
+
return t === "circle" || t === "rect" || t === "rounded" ? t : e.querySelector("circle, rect")?.tagName === "rect" ? "rect" : "circle";
|
|
1073
|
+
}
|
|
1074
|
+
function U(e) {
|
|
1075
|
+
return e.querySelector("circle") ?? e.querySelector("rect");
|
|
1076
|
+
}
|
|
1077
|
+
function W(e) {
|
|
1078
|
+
if (e.tagName === "g" && e.getAttribute("data-type") === "freehand") {
|
|
1079
|
+
let t = [];
|
|
1080
|
+
for (let n of Array.from(e.children)) n.tagName.toLowerCase() === "path" && t.push(n);
|
|
1081
|
+
return t;
|
|
1082
|
+
}
|
|
1083
|
+
return [e];
|
|
1084
|
+
}
|
|
1085
|
+
function G(e, t) {
|
|
1086
|
+
return e.tagName === "g" ? e.querySelector("path, rect, line, circle")?.getAttribute(t) ?? e.getAttribute(t) : e.getAttribute(t);
|
|
1087
|
+
}
|
|
1088
|
+
function et(e) {
|
|
1089
|
+
return e.tagName === "g" && e.getAttribute("data-type") === "arrow";
|
|
1090
|
+
}
|
|
1091
|
+
function tt(e) {
|
|
1092
|
+
let t = N(e, "start").shape === "none", n = N(e, "end").shape === "none";
|
|
1093
|
+
return t && n ? "none" : !t && !n ? "both" : "end";
|
|
1094
|
+
}
|
|
1095
|
+
function nt(e, t) {
|
|
1096
|
+
let n = e === "start" ? "left" : "right";
|
|
1097
|
+
return [
|
|
1098
|
+
{
|
|
1099
|
+
value: "none",
|
|
1100
|
+
label: "None"
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
value: "triangle",
|
|
1104
|
+
label: "Triangle"
|
|
1105
|
+
},
|
|
1106
|
+
{
|
|
1107
|
+
value: "arrow",
|
|
1108
|
+
label: "Arrow"
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
value: "stealth",
|
|
1112
|
+
label: "Stealth"
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
value: "diamond",
|
|
1116
|
+
label: "Diamond"
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
value: "oval",
|
|
1120
|
+
label: "Oval"
|
|
1121
|
+
}
|
|
1122
|
+
].filter((n) => {
|
|
1123
|
+
let r = n.value === "none";
|
|
1124
|
+
return t === "none" ? r : t === "both" ? !r : e === "start" ? r : !r;
|
|
1125
|
+
}).map((e) => ({
|
|
1126
|
+
value: e.value,
|
|
1127
|
+
label: e.label,
|
|
1128
|
+
iconSvg: we(e.value, n)
|
|
1129
|
+
}));
|
|
1130
|
+
}
|
|
1131
|
+
function rt(e) {
|
|
1132
|
+
let t = e === "start" ? "left" : "right", n = [
|
|
1133
|
+
"sm",
|
|
1134
|
+
"md",
|
|
1135
|
+
"lg"
|
|
1136
|
+
], r = [];
|
|
1137
|
+
for (let e of n) for (let i of n) r.push({
|
|
1138
|
+
value: `${e}-${i}`,
|
|
1139
|
+
label: `W:${e.toUpperCase()} L:${i.toUpperCase()}`,
|
|
1140
|
+
iconSvg: Ee(e, i, t)
|
|
1141
|
+
});
|
|
1142
|
+
return r;
|
|
1143
|
+
}
|
|
1144
|
+
function it(e) {
|
|
1145
|
+
let t = e.querySelector("text");
|
|
1146
|
+
return Number.parseFloat(t?.getAttribute("font-size") || "13");
|
|
1147
|
+
}
|
|
1148
|
+
function at(e) {
|
|
1149
|
+
let t = e.getAttribute("data-redact-style");
|
|
1150
|
+
return t === "mosaic" || t === "solid" || t === "blur" ? t : "mosaic";
|
|
1151
|
+
}
|
|
1152
|
+
function K(e) {
|
|
1153
|
+
return e.tagName === "line" ? !0 : e.tagName === "g" && e.getAttribute("data-type") === "arrow";
|
|
1154
|
+
}
|
|
1155
|
+
function ot(e) {
|
|
1156
|
+
return e.tagName === "g" && e.getAttribute("data-type") === "freehand";
|
|
1157
|
+
}
|
|
1158
|
+
var st = {
|
|
1159
|
+
shapeTypePicker: {
|
|
1160
|
+
id: V.shapeTypePicker,
|
|
1161
|
+
type: "variantPicker",
|
|
1162
|
+
label: "Shape type",
|
|
1163
|
+
getValue: (e) => Oe(e),
|
|
1164
|
+
replace: (e, t) => je(e, t),
|
|
1165
|
+
visibleWhen: (e) => Oe(e) !== null,
|
|
1166
|
+
options: [
|
|
1167
|
+
{
|
|
1168
|
+
value: "rect",
|
|
1169
|
+
label: "Rectangle",
|
|
1170
|
+
iconSvg: l.rect
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
value: "rounded",
|
|
1174
|
+
label: "Rounded",
|
|
1175
|
+
iconSvg: l.rounded
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
value: "ellipse",
|
|
1179
|
+
label: "Ellipse",
|
|
1180
|
+
iconSvg: l.ellipse
|
|
1181
|
+
}
|
|
1182
|
+
]
|
|
1183
|
+
},
|
|
1184
|
+
arrowVariantPicker: {
|
|
1185
|
+
id: V.arrowVariantPicker,
|
|
1186
|
+
type: "variantPicker",
|
|
1187
|
+
label: "Arrow type",
|
|
1188
|
+
getValue: (e) => Ze(e),
|
|
1189
|
+
effect: H.applyArrowVariant,
|
|
1190
|
+
visibleWhen: (e) => K(e),
|
|
1191
|
+
options: [
|
|
1192
|
+
{
|
|
1193
|
+
value: "none",
|
|
1194
|
+
label: "Line",
|
|
1195
|
+
iconSvg: u.none
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
value: "end",
|
|
1199
|
+
label: "Arrow",
|
|
1200
|
+
iconSvg: u.end
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
value: "both",
|
|
1204
|
+
label: "Double arrow",
|
|
1205
|
+
iconSvg: u.both
|
|
1206
|
+
}
|
|
1207
|
+
]
|
|
1208
|
+
},
|
|
1209
|
+
drawStylePicker: {
|
|
1210
|
+
id: V.drawStylePicker,
|
|
1211
|
+
type: "variantPicker",
|
|
1212
|
+
label: "Draw style",
|
|
1213
|
+
getValue: (e) => Qe(e),
|
|
1214
|
+
effect: H.applyDrawStyle,
|
|
1215
|
+
visibleWhen: (e) => e.tagName === "path" || ot(e),
|
|
1216
|
+
options: [{
|
|
1217
|
+
value: "pen",
|
|
1218
|
+
label: "Pen",
|
|
1219
|
+
materialIcon: "edit"
|
|
1220
|
+
}, {
|
|
1221
|
+
value: "highlighter",
|
|
1222
|
+
label: "Highlighter",
|
|
1223
|
+
materialIcon: "ink_highlighter"
|
|
1224
|
+
}]
|
|
1225
|
+
},
|
|
1226
|
+
fillColor: {
|
|
1227
|
+
id: V.fillColor,
|
|
1228
|
+
type: "color",
|
|
1229
|
+
label: "Color",
|
|
1230
|
+
getValue: (e) => e.getAttribute("fill") ?? "none",
|
|
1231
|
+
setValue: (e, t) => {
|
|
1232
|
+
e.setAttribute("fill", String(t));
|
|
1233
|
+
},
|
|
1234
|
+
visibleWhen: (e) => !K(e) && e.tagName !== "path" && !ot(e),
|
|
1235
|
+
allowNone: !0
|
|
1236
|
+
},
|
|
1237
|
+
strokeColor: {
|
|
1238
|
+
id: V.strokeColor,
|
|
1239
|
+
type: "color",
|
|
1240
|
+
label: "Color",
|
|
1241
|
+
getValue: (e) => G(e, "stroke") ?? "#000000",
|
|
1242
|
+
setValue: (e, t) => {
|
|
1243
|
+
let n = String(t);
|
|
1244
|
+
for (let t of W(e)) t.setAttribute("stroke", n);
|
|
1245
|
+
if (et(e)) {
|
|
1246
|
+
let t = e.querySelector(":scope > [data-role=\"head-filled\"]");
|
|
1247
|
+
t && t.setAttribute("fill", n);
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
},
|
|
1251
|
+
strokeWidth: {
|
|
1252
|
+
id: V.strokeWidth,
|
|
1253
|
+
type: "number",
|
|
1254
|
+
label: "Width",
|
|
1255
|
+
getValue: (e) => Number.parseFloat(G(e, "stroke-width") || "0"),
|
|
1256
|
+
setValue: (e, t) => {
|
|
1257
|
+
let n = Number(t);
|
|
1258
|
+
for (let t of W(e)) {
|
|
1259
|
+
t.setAttribute("stroke-width", String(n));
|
|
1260
|
+
let e = t.getAttribute("data-dash-key");
|
|
1261
|
+
e && t.setAttribute("stroke-dasharray", k(e, n));
|
|
1262
|
+
}
|
|
1263
|
+
et(e) && Ce(e);
|
|
1264
|
+
},
|
|
1265
|
+
min: .25,
|
|
1266
|
+
max: 200,
|
|
1267
|
+
step: .25,
|
|
1268
|
+
unit: "pt"
|
|
1269
|
+
},
|
|
1270
|
+
strokeStyle: {
|
|
1271
|
+
id: V.strokeStyle,
|
|
1272
|
+
type: "select",
|
|
1273
|
+
label: "Dash type",
|
|
1274
|
+
getValue: (e) => {
|
|
1275
|
+
let t = G(e, "data-dash-key");
|
|
1276
|
+
if (t != null) return t;
|
|
1277
|
+
let n = Number.parseFloat(G(e, "stroke-width") || "1");
|
|
1278
|
+
return A(G(e, "stroke-dasharray") || "", n) ?? "";
|
|
1279
|
+
},
|
|
1280
|
+
setValue: (e, t) => {
|
|
1281
|
+
let n = String(t);
|
|
1282
|
+
for (let t of W(e)) {
|
|
1283
|
+
let e = Number.parseFloat(t.getAttribute("stroke-width") || "1");
|
|
1284
|
+
n ? (t.setAttribute("data-dash-key", n), t.setAttribute("stroke-dasharray", k(n, e))) : (t.removeAttribute("data-dash-key"), t.removeAttribute("stroke-dasharray"));
|
|
1285
|
+
}
|
|
1286
|
+
},
|
|
1287
|
+
options: [
|
|
1288
|
+
{
|
|
1289
|
+
value: "",
|
|
1290
|
+
label: "Solid"
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
value: "dash",
|
|
1294
|
+
label: "Dashed"
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
value: "dot",
|
|
1298
|
+
label: "Dotted"
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
value: "dashDot",
|
|
1302
|
+
label: "Dash-Dot"
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
value: "lgDash",
|
|
1306
|
+
label: "Long Dash"
|
|
1307
|
+
}
|
|
1308
|
+
]
|
|
1309
|
+
},
|
|
1310
|
+
textVariantPicker: {
|
|
1311
|
+
id: V.textVariantPicker,
|
|
1312
|
+
type: "variantPicker",
|
|
1313
|
+
label: "Text type",
|
|
1314
|
+
getValue: (e) => Ue(e),
|
|
1315
|
+
replace: (e, t) => Ye(e, t),
|
|
1316
|
+
options: [
|
|
1317
|
+
{
|
|
1318
|
+
value: "plain",
|
|
1319
|
+
label: "Plain text",
|
|
1320
|
+
materialIcon: "text_fields"
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
value: "sticky",
|
|
1324
|
+
label: "Sticky note",
|
|
1325
|
+
materialIcon: "sticky_note_2"
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
value: "callout",
|
|
1329
|
+
label: "Callout",
|
|
1330
|
+
materialIcon: "chat_bubble"
|
|
1331
|
+
}
|
|
1332
|
+
]
|
|
1333
|
+
},
|
|
1334
|
+
textColor: {
|
|
1335
|
+
id: V.textColor,
|
|
1336
|
+
type: "color",
|
|
1337
|
+
label: "Color",
|
|
1338
|
+
getValue: (e) => e.querySelector("text")?.getAttribute("fill") ?? "#ff0000",
|
|
1339
|
+
effect: H.applyTextColor
|
|
1340
|
+
},
|
|
1341
|
+
fontFamily: {
|
|
1342
|
+
id: V.fontFamily,
|
|
1343
|
+
type: "select",
|
|
1344
|
+
label: "Font",
|
|
1345
|
+
getValue: (e) => o(e.getAttribute("data-font-family") ?? e.querySelector("text")?.getAttribute("font-family")),
|
|
1346
|
+
setValue: (e, t) => {
|
|
1347
|
+
let n = o(String(t));
|
|
1348
|
+
e.setAttribute("data-font-family", n), e.querySelector("text")?.setAttribute("font-family", n);
|
|
1349
|
+
},
|
|
1350
|
+
options: [
|
|
1351
|
+
{
|
|
1352
|
+
value: "Annot Sans",
|
|
1353
|
+
label: "Sans (Multilingual)"
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
value: "Annot Serif",
|
|
1357
|
+
label: "Serif"
|
|
1358
|
+
},
|
|
1359
|
+
{
|
|
1360
|
+
value: "Annot Mono",
|
|
1361
|
+
label: "Mono"
|
|
1362
|
+
}
|
|
1363
|
+
]
|
|
1364
|
+
},
|
|
1365
|
+
fontSize: {
|
|
1366
|
+
id: V.fontSize,
|
|
1367
|
+
type: "number",
|
|
1368
|
+
label: "Size",
|
|
1369
|
+
getValue: (e) => Number.parseFloat(e.querySelector("text")?.getAttribute("font-size") || "16"),
|
|
1370
|
+
setValue: (e, t) => {
|
|
1371
|
+
let n = Number(t);
|
|
1372
|
+
if (e.querySelector("text")?.setAttribute("font-size", String(n)), e.setAttribute("data-font-size", String(n)), He(e)) {
|
|
1373
|
+
let t = z(e).runs;
|
|
1374
|
+
B(e, t);
|
|
1375
|
+
}
|
|
1376
|
+
},
|
|
1377
|
+
min: 8,
|
|
1378
|
+
max: 96,
|
|
1379
|
+
step: 1,
|
|
1380
|
+
unit: "pt"
|
|
1381
|
+
},
|
|
1382
|
+
textAnchor: {
|
|
1383
|
+
id: V.textAnchor,
|
|
1384
|
+
type: "select",
|
|
1385
|
+
label: "Align",
|
|
1386
|
+
getValue: (e) => e.getAttribute("data-text-anchor") ?? "start",
|
|
1387
|
+
setValue: (e, t) => {
|
|
1388
|
+
let n = String(t);
|
|
1389
|
+
e.setAttribute("data-text-anchor", n);
|
|
1390
|
+
let r = z(e).runs;
|
|
1391
|
+
B(e, r);
|
|
1392
|
+
},
|
|
1393
|
+
options: [
|
|
1394
|
+
{
|
|
1395
|
+
value: "start",
|
|
1396
|
+
label: "Left",
|
|
1397
|
+
materialIcon: "format_align_left"
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
value: "middle",
|
|
1401
|
+
label: "Center",
|
|
1402
|
+
materialIcon: "format_align_center"
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
value: "end",
|
|
1406
|
+
label: "Right",
|
|
1407
|
+
materialIcon: "format_align_right"
|
|
1408
|
+
}
|
|
1409
|
+
]
|
|
1410
|
+
},
|
|
1411
|
+
textVerticalAnchor: {
|
|
1412
|
+
id: V.textVerticalAnchor,
|
|
1413
|
+
type: "select",
|
|
1414
|
+
label: "V-Align",
|
|
1415
|
+
getValue: (e) => e.getAttribute("data-text-vanchor") ?? "top",
|
|
1416
|
+
setValue: (e, t) => {
|
|
1417
|
+
let n = String(t);
|
|
1418
|
+
e.setAttribute("data-text-vanchor", n);
|
|
1419
|
+
let r = z(e).runs;
|
|
1420
|
+
B(e, r);
|
|
1421
|
+
},
|
|
1422
|
+
options: [
|
|
1423
|
+
{
|
|
1424
|
+
value: "top",
|
|
1425
|
+
label: "Top",
|
|
1426
|
+
materialIcon: "vertical_align_top"
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
value: "middle",
|
|
1430
|
+
label: "Middle",
|
|
1431
|
+
materialIcon: "vertical_align_center"
|
|
1432
|
+
},
|
|
1433
|
+
{
|
|
1434
|
+
value: "bottom",
|
|
1435
|
+
label: "Bottom",
|
|
1436
|
+
materialIcon: "vertical_align_bottom"
|
|
1437
|
+
}
|
|
1438
|
+
]
|
|
1439
|
+
},
|
|
1440
|
+
textAutofit: {
|
|
1441
|
+
id: V.textAutofit,
|
|
1442
|
+
type: "select",
|
|
1443
|
+
label: "Autofit",
|
|
1444
|
+
getValue: (e) => e.getAttribute("data-text-autofit") || "none",
|
|
1445
|
+
setValue: (e, t) => {
|
|
1446
|
+
let n = String(t);
|
|
1447
|
+
n === "none" ? e.removeAttribute("data-text-autofit") : e.setAttribute("data-text-autofit", n);
|
|
1448
|
+
let r = z(e).runs;
|
|
1449
|
+
B(e, r);
|
|
1450
|
+
},
|
|
1451
|
+
options: [
|
|
1452
|
+
{
|
|
1453
|
+
value: "none",
|
|
1454
|
+
label: "Do not autofit"
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
value: "shrink",
|
|
1458
|
+
label: "Shrink text on overflow"
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
value: "resize",
|
|
1462
|
+
label: "Resize shape to fit text"
|
|
1463
|
+
}
|
|
1464
|
+
]
|
|
1465
|
+
},
|
|
1466
|
+
textMarginLeft: q(V.textMarginLeft, "Margin L", "data-text-margin-l"),
|
|
1467
|
+
textMarginRight: q(V.textMarginRight, "Margin R", "data-text-margin-r"),
|
|
1468
|
+
textMarginTop: q(V.textMarginTop, "Margin T", "data-text-margin-t"),
|
|
1469
|
+
textMarginBottom: q(V.textMarginBottom, "Margin B", "data-text-margin-b"),
|
|
1470
|
+
textBold: lt(V.textBold, "Bold", "font-weight", "bold", (e) => e === "bold" || e === "700"),
|
|
1471
|
+
textItalic: lt(V.textItalic, "Italic", "font-style", "italic", (e) => e === "italic"),
|
|
1472
|
+
textUnderline: lt(V.textUnderline, "Underline", "text-decoration", "underline", (e) => e.includes("underline")),
|
|
1473
|
+
redactStylePicker: {
|
|
1474
|
+
id: V.redactStylePicker,
|
|
1475
|
+
type: "variantPicker",
|
|
1476
|
+
label: "Redact style",
|
|
1477
|
+
getValue: (e) => at(e),
|
|
1478
|
+
effect: H.applyRedactStyle,
|
|
1479
|
+
options: [
|
|
1480
|
+
{
|
|
1481
|
+
value: "mosaic",
|
|
1482
|
+
label: "Mosaic (pixelate)",
|
|
1483
|
+
materialIcon: "apps"
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
value: "solid",
|
|
1487
|
+
label: "Solid bar",
|
|
1488
|
+
materialIcon: "rectangle"
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
value: "blur",
|
|
1492
|
+
label: "Blur",
|
|
1493
|
+
materialIcon: "blur_on"
|
|
1494
|
+
}
|
|
1495
|
+
]
|
|
1496
|
+
},
|
|
1497
|
+
redactSolidColor: {
|
|
1498
|
+
id: V.redactSolidColor,
|
|
1499
|
+
type: "color",
|
|
1500
|
+
label: "Color",
|
|
1501
|
+
getValue: (e) => e.getAttribute("fill") ?? "#111111",
|
|
1502
|
+
setValue: (e, t) => {
|
|
1503
|
+
e.setAttribute("fill", String(t));
|
|
1504
|
+
},
|
|
1505
|
+
visibleWhen: (e) => at(e) === "solid"
|
|
1506
|
+
},
|
|
1507
|
+
highlightColorPicker: {
|
|
1508
|
+
id: V.highlightColorPicker,
|
|
1509
|
+
type: "variantPicker",
|
|
1510
|
+
label: "Highlight color",
|
|
1511
|
+
getValue: (e) => (e.getAttribute("fill") ?? f[0]?.value ?? "#ffff00").toLowerCase(),
|
|
1512
|
+
setValue: (e, t) => {
|
|
1513
|
+
e.setAttribute("fill", String(t));
|
|
1514
|
+
},
|
|
1515
|
+
options: f.map((e) => ({
|
|
1516
|
+
value: e.value,
|
|
1517
|
+
label: e.label,
|
|
1518
|
+
swatchColor: e.value
|
|
1519
|
+
}))
|
|
1520
|
+
},
|
|
1521
|
+
highlightTransparency: {
|
|
1522
|
+
id: V.highlightTransparency,
|
|
1523
|
+
type: "number",
|
|
1524
|
+
label: "Transparency",
|
|
1525
|
+
getValue: (e) => {
|
|
1526
|
+
let t = Number.parseFloat(e.getAttribute("fill-opacity") || "0.4");
|
|
1527
|
+
return Math.round((1 - (Number.isFinite(t) ? t : .4)) * 100);
|
|
1528
|
+
},
|
|
1529
|
+
setValue: (e, t) => {
|
|
1530
|
+
let n = 1 - Number(t) / 100;
|
|
1531
|
+
e.setAttribute("fill-opacity", String(n));
|
|
1532
|
+
},
|
|
1533
|
+
min: 0,
|
|
1534
|
+
max: 100,
|
|
1535
|
+
step: 5,
|
|
1536
|
+
unit: "%"
|
|
1537
|
+
},
|
|
1538
|
+
markerShapePicker: {
|
|
1539
|
+
id: V.markerShapePicker,
|
|
1540
|
+
type: "variantPicker",
|
|
1541
|
+
label: "Counter shape",
|
|
1542
|
+
getValue: (e) => $e(e),
|
|
1543
|
+
effect: H.applyMarkerShape,
|
|
1544
|
+
options: [
|
|
1545
|
+
{
|
|
1546
|
+
value: "circle",
|
|
1547
|
+
label: "Circle",
|
|
1548
|
+
iconSvg: d.circle
|
|
1549
|
+
},
|
|
1550
|
+
{
|
|
1551
|
+
value: "rect",
|
|
1552
|
+
label: "Square",
|
|
1553
|
+
iconSvg: d.rect
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
value: "rounded",
|
|
1557
|
+
label: "Rounded square",
|
|
1558
|
+
iconSvg: d.rounded
|
|
1559
|
+
}
|
|
1560
|
+
]
|
|
1561
|
+
},
|
|
1562
|
+
markerSize: {
|
|
1563
|
+
id: V.markerSize,
|
|
1564
|
+
type: "number",
|
|
1565
|
+
label: "Size",
|
|
1566
|
+
getValue: (e) => it(e),
|
|
1567
|
+
effect: H.resizeMarker,
|
|
1568
|
+
min: 8,
|
|
1569
|
+
max: 96,
|
|
1570
|
+
step: 1,
|
|
1571
|
+
unit: "pt"
|
|
1572
|
+
},
|
|
1573
|
+
markerBgFillColor: {
|
|
1574
|
+
id: V.markerBgFillColor,
|
|
1575
|
+
type: "color",
|
|
1576
|
+
label: "Color",
|
|
1577
|
+
getValue: (e) => U(e)?.getAttribute("fill") ?? "#ff0000",
|
|
1578
|
+
setValue: (e, t) => {
|
|
1579
|
+
U(e)?.setAttribute("fill", String(t));
|
|
1580
|
+
},
|
|
1581
|
+
allowNone: !0
|
|
1582
|
+
},
|
|
1583
|
+
markerBgStrokeColor: {
|
|
1584
|
+
id: V.markerBgStrokeColor,
|
|
1585
|
+
type: "color",
|
|
1586
|
+
label: "Color",
|
|
1587
|
+
getValue: (e) => U(e)?.getAttribute("stroke") ?? "#ffffff",
|
|
1588
|
+
setValue: (e, t) => {
|
|
1589
|
+
U(e)?.setAttribute("stroke", String(t));
|
|
1590
|
+
}
|
|
1591
|
+
},
|
|
1592
|
+
markerBgStrokeWidth: {
|
|
1593
|
+
id: V.markerBgStrokeWidth,
|
|
1594
|
+
type: "number",
|
|
1595
|
+
label: "Width",
|
|
1596
|
+
getValue: (e) => Number.parseFloat(U(e)?.getAttribute("stroke-width") || "1.5"),
|
|
1597
|
+
setValue: (e, t) => {
|
|
1598
|
+
let n = U(e);
|
|
1599
|
+
if (!n) return;
|
|
1600
|
+
let r = Number(t);
|
|
1601
|
+
n.setAttribute("stroke-width", String(r));
|
|
1602
|
+
let i = n.getAttribute("data-dash-key");
|
|
1603
|
+
i && n.setAttribute("stroke-dasharray", k(i, r));
|
|
1604
|
+
},
|
|
1605
|
+
min: 0,
|
|
1606
|
+
max: 20,
|
|
1607
|
+
step: .25,
|
|
1608
|
+
unit: "pt"
|
|
1609
|
+
},
|
|
1610
|
+
markerBgStrokeStyle: {
|
|
1611
|
+
id: V.markerBgStrokeStyle,
|
|
1612
|
+
type: "select",
|
|
1613
|
+
label: "Dash type",
|
|
1614
|
+
getValue: (e) => {
|
|
1615
|
+
let t = U(e);
|
|
1616
|
+
if (!t) return "";
|
|
1617
|
+
let n = t.getAttribute("data-dash-key");
|
|
1618
|
+
if (n != null) return n;
|
|
1619
|
+
let r = Number.parseFloat(t.getAttribute("stroke-width") || "1.5");
|
|
1620
|
+
return A(t.getAttribute("stroke-dasharray") || "", r) ?? "";
|
|
1621
|
+
},
|
|
1622
|
+
setValue: (e, t) => {
|
|
1623
|
+
let n = U(e);
|
|
1624
|
+
if (!n) return;
|
|
1625
|
+
let r = String(t), i = Number.parseFloat(n.getAttribute("stroke-width") || "1.5");
|
|
1626
|
+
r ? (n.setAttribute("data-dash-key", r), n.setAttribute("stroke-dasharray", k(r, i))) : (n.removeAttribute("data-dash-key"), n.removeAttribute("stroke-dasharray"));
|
|
1627
|
+
},
|
|
1628
|
+
options: [
|
|
1629
|
+
{
|
|
1630
|
+
value: "",
|
|
1631
|
+
label: "Solid"
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
value: "dash",
|
|
1635
|
+
label: "Dashed"
|
|
1636
|
+
},
|
|
1637
|
+
{
|
|
1638
|
+
value: "dot",
|
|
1639
|
+
label: "Dotted"
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
value: "dashDot",
|
|
1643
|
+
label: "Dash-Dot"
|
|
1644
|
+
},
|
|
1645
|
+
{
|
|
1646
|
+
value: "lgDash",
|
|
1647
|
+
label: "Long Dash"
|
|
1648
|
+
}
|
|
1649
|
+
]
|
|
1650
|
+
},
|
|
1651
|
+
markerLabelValue: {
|
|
1652
|
+
id: V.markerLabelValue,
|
|
1653
|
+
type: "number",
|
|
1654
|
+
label: "Value",
|
|
1655
|
+
getValue: (e) => {
|
|
1656
|
+
let t = Number.parseInt(e.getAttribute("data-marker") || "1", 10);
|
|
1657
|
+
return Number.isFinite(t) ? t : 1;
|
|
1658
|
+
},
|
|
1659
|
+
setValue: (e, t) => {
|
|
1660
|
+
let n = Math.round(Number(t));
|
|
1661
|
+
e.setAttribute("data-marker", String(n));
|
|
1662
|
+
let r = e.querySelector("text");
|
|
1663
|
+
r && (r.textContent = String(n));
|
|
1664
|
+
},
|
|
1665
|
+
min: 1,
|
|
1666
|
+
max: 999,
|
|
1667
|
+
step: 1
|
|
1668
|
+
},
|
|
1669
|
+
fillOpacity: {
|
|
1670
|
+
id: V.fillOpacity,
|
|
1671
|
+
type: "number",
|
|
1672
|
+
label: "Transparency",
|
|
1673
|
+
getValue: (e) => {
|
|
1674
|
+
let t = Number.parseFloat(G(e, "fill-opacity") || "1");
|
|
1675
|
+
return Math.round((1 - (Number.isFinite(t) ? t : 1)) * 100);
|
|
1676
|
+
},
|
|
1677
|
+
setValue: (e, t) => {
|
|
1678
|
+
let n = 1 - Number(t) / 100;
|
|
1679
|
+
e.setAttribute("fill-opacity", String(n));
|
|
1680
|
+
},
|
|
1681
|
+
visibleWhen: (e) => !K(e) && e.tagName !== "path" && !ot(e),
|
|
1682
|
+
min: 0,
|
|
1683
|
+
max: 100,
|
|
1684
|
+
step: 1,
|
|
1685
|
+
unit: "%"
|
|
1686
|
+
},
|
|
1687
|
+
strokeOpacity: {
|
|
1688
|
+
id: V.strokeOpacity,
|
|
1689
|
+
type: "number",
|
|
1690
|
+
label: "Transparency",
|
|
1691
|
+
getValue: (e) => {
|
|
1692
|
+
let t = e.getAttribute("opacity") ?? (G(e, "stroke-opacity") || "1"), n = Number.parseFloat(t);
|
|
1693
|
+
return Math.round((1 - (Number.isFinite(n) ? n : 1)) * 100);
|
|
1694
|
+
},
|
|
1695
|
+
setValue: (e, t) => {
|
|
1696
|
+
let n = 1 - Number(t) / 100;
|
|
1697
|
+
for (let t of W(e)) K(t) ? (t.setAttribute("opacity", String(n)), t.removeAttribute("stroke-opacity")) : t.setAttribute("stroke-opacity", String(n));
|
|
1698
|
+
},
|
|
1699
|
+
min: 0,
|
|
1700
|
+
max: 100,
|
|
1701
|
+
step: 1,
|
|
1702
|
+
unit: "%"
|
|
1703
|
+
},
|
|
1704
|
+
strokeLinecap: {
|
|
1705
|
+
id: V.strokeLinecap,
|
|
1706
|
+
type: "select",
|
|
1707
|
+
label: "Cap type",
|
|
1708
|
+
getValue: (e) => G(e, "stroke-linecap") ?? "butt",
|
|
1709
|
+
setValue: (e, t) => {
|
|
1710
|
+
let n = String(t);
|
|
1711
|
+
for (let t of W(e)) t.setAttribute("stroke-linecap", n);
|
|
1712
|
+
},
|
|
1713
|
+
options: [
|
|
1714
|
+
{
|
|
1715
|
+
value: "square",
|
|
1716
|
+
label: "Square"
|
|
1717
|
+
},
|
|
1718
|
+
{
|
|
1719
|
+
value: "round",
|
|
1720
|
+
label: "Round"
|
|
1721
|
+
},
|
|
1722
|
+
{
|
|
1723
|
+
value: "butt",
|
|
1724
|
+
label: "Flat"
|
|
1725
|
+
}
|
|
1726
|
+
]
|
|
1727
|
+
},
|
|
1728
|
+
arrowStartShape: {
|
|
1729
|
+
id: V.arrowStartShape,
|
|
1730
|
+
type: "select",
|
|
1731
|
+
label: "Begin arrow type",
|
|
1732
|
+
getValue: (e) => N(e, "start").shape,
|
|
1733
|
+
effect: H.applyArrowStartShape,
|
|
1734
|
+
visibleWhen: K,
|
|
1735
|
+
getOptions: (e) => nt("start", tt(e)),
|
|
1736
|
+
selectColumns: 3,
|
|
1737
|
+
selectPopupWidth: 170
|
|
1738
|
+
},
|
|
1739
|
+
arrowStartSize: {
|
|
1740
|
+
id: V.arrowStartSize,
|
|
1741
|
+
type: "select",
|
|
1742
|
+
label: "Begin arrow size",
|
|
1743
|
+
getValue: (e) => {
|
|
1744
|
+
let t = N(e, "start");
|
|
1745
|
+
return `${t.width}-${t.length}`;
|
|
1746
|
+
},
|
|
1747
|
+
effect: H.applyArrowStartSize,
|
|
1748
|
+
visibleWhen: K,
|
|
1749
|
+
options: rt("start"),
|
|
1750
|
+
selectColumns: 3,
|
|
1751
|
+
selectPopupWidth: 180
|
|
1752
|
+
},
|
|
1753
|
+
arrowEndShape: {
|
|
1754
|
+
id: V.arrowEndShape,
|
|
1755
|
+
type: "select",
|
|
1756
|
+
label: "End arrow type",
|
|
1757
|
+
getValue: (e) => N(e, "end").shape,
|
|
1758
|
+
effect: H.applyArrowEndShape,
|
|
1759
|
+
visibleWhen: K,
|
|
1760
|
+
getOptions: (e) => nt("end", tt(e)),
|
|
1761
|
+
selectColumns: 3,
|
|
1762
|
+
selectPopupWidth: 170
|
|
1763
|
+
},
|
|
1764
|
+
arrowEndSize: {
|
|
1765
|
+
id: V.arrowEndSize,
|
|
1766
|
+
type: "select",
|
|
1767
|
+
label: "End arrow size",
|
|
1768
|
+
getValue: (e) => {
|
|
1769
|
+
let t = N(e, "end");
|
|
1770
|
+
return `${t.width}-${t.length}`;
|
|
1771
|
+
},
|
|
1772
|
+
effect: H.applyArrowEndSize,
|
|
1773
|
+
visibleWhen: K,
|
|
1774
|
+
options: rt("end"),
|
|
1775
|
+
selectColumns: 3,
|
|
1776
|
+
selectPopupWidth: 180
|
|
1777
|
+
}
|
|
1778
|
+
};
|
|
1779
|
+
function ct(e) {
|
|
1780
|
+
let t = e.tagName;
|
|
1781
|
+
if (t === "g") {
|
|
1782
|
+
let t = e.getAttribute("data-type");
|
|
1783
|
+
if (t === "shape") return "textbox";
|
|
1784
|
+
if (t === "group") return "group";
|
|
1785
|
+
if (e.hasAttribute("data-marker")) return "marker";
|
|
1786
|
+
if (t === "arrow") return "shape";
|
|
1787
|
+
}
|
|
1788
|
+
if (t === "rect" && e.getAttribute("data-highlight") === "1") return "highlight";
|
|
1789
|
+
let n = e.getAttribute("data-redact-style");
|
|
1790
|
+
return n === "mosaic" ? "redact-mosaic" : n === "solid" ? "redact-solid" : n === "blur" ? "redact-blur" : "shape";
|
|
1791
|
+
}
|
|
1792
|
+
function q(e, t, n) {
|
|
1793
|
+
return {
|
|
1794
|
+
id: e,
|
|
1795
|
+
type: "number",
|
|
1796
|
+
label: t,
|
|
1797
|
+
getValue: (e) => {
|
|
1798
|
+
let t = e.getAttribute("data-shape-kind"), r = n === "data-text-margin-l" || n === "data-text-margin-r", i = t === "plain" ? r ? 2 : 0 : r ? 10 : 8, a = e.getAttribute(n);
|
|
1799
|
+
if (a == null) return i;
|
|
1800
|
+
let o = Number.parseFloat(a);
|
|
1801
|
+
return Number.isFinite(o) && o >= 0 ? o : i;
|
|
1802
|
+
},
|
|
1803
|
+
setValue: (e, t) => {
|
|
1804
|
+
let r = Number(t);
|
|
1805
|
+
if (!Number.isFinite(r) || r < 0) return;
|
|
1806
|
+
e.setAttribute(n, String(r));
|
|
1807
|
+
let i = z(e).runs;
|
|
1808
|
+
B(e, i);
|
|
1809
|
+
},
|
|
1810
|
+
min: 0,
|
|
1811
|
+
max: 200,
|
|
1812
|
+
step: 1,
|
|
1813
|
+
unit: "px"
|
|
1814
|
+
};
|
|
1815
|
+
}
|
|
1816
|
+
function lt(e, t, n, r, i) {
|
|
1817
|
+
return {
|
|
1818
|
+
id: e,
|
|
1819
|
+
type: "select",
|
|
1820
|
+
label: t,
|
|
1821
|
+
getValue: (e) => {
|
|
1822
|
+
let t = Array.from(e.querySelectorAll("tspan"));
|
|
1823
|
+
return t.length === 0 ? "off" : t.every((e) => {
|
|
1824
|
+
let t = e.getAttribute(n);
|
|
1825
|
+
return t != null && i(t);
|
|
1826
|
+
}) ? "on" : "off";
|
|
1827
|
+
},
|
|
1828
|
+
setValue: (e, t) => {
|
|
1829
|
+
let i = String(t) === "on", a = Array.from(e.querySelectorAll("tspan"));
|
|
1830
|
+
for (let e of a) i ? e.setAttribute(n, r) : e.removeAttribute(n);
|
|
1831
|
+
},
|
|
1832
|
+
options: [{
|
|
1833
|
+
value: "off",
|
|
1834
|
+
label: "Off"
|
|
1835
|
+
}, {
|
|
1836
|
+
value: "on",
|
|
1837
|
+
label: "On"
|
|
1838
|
+
}]
|
|
1839
|
+
};
|
|
1840
|
+
}
|
|
1841
|
+
function ut(e) {
|
|
1842
|
+
if (e.length === 0) return {
|
|
1843
|
+
category: null,
|
|
1844
|
+
uniform: !0
|
|
1845
|
+
};
|
|
1846
|
+
let t = ct(e[0]);
|
|
1847
|
+
for (let n = 1; n < e.length; n++) if (ct(e[n]) !== t) return {
|
|
1848
|
+
category: t,
|
|
1849
|
+
uniform: !1
|
|
1850
|
+
};
|
|
1851
|
+
return {
|
|
1852
|
+
category: t,
|
|
1853
|
+
uniform: !0
|
|
1854
|
+
};
|
|
1855
|
+
}
|
|
1856
|
+
//#endregion
|
|
1857
|
+
//#region src/editor/selection-geometry.ts
|
|
1858
|
+
function dt(e, t, n, r, i) {
|
|
1859
|
+
let a = Math.cos(i), o = Math.sin(i);
|
|
1860
|
+
return {
|
|
1861
|
+
x: n + (e - n) * a - (t - r) * o,
|
|
1862
|
+
y: r + (e - n) * o + (t - r) * a
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
1865
|
+
var ft = [
|
|
1866
|
+
"ew-resize",
|
|
1867
|
+
"nwse-resize",
|
|
1868
|
+
"ns-resize",
|
|
1869
|
+
"nesw-resize",
|
|
1870
|
+
"ew-resize",
|
|
1871
|
+
"nwse-resize",
|
|
1872
|
+
"ns-resize",
|
|
1873
|
+
"nesw-resize"
|
|
1874
|
+
];
|
|
1875
|
+
function pt(e) {
|
|
1876
|
+
let t = Math.PI * 2, n = (e % t + t) % t;
|
|
1877
|
+
return n += Math.PI / 8, n >= t && (n -= t), ft[Math.floor(n / (Math.PI / 4)) % 8];
|
|
1878
|
+
}
|
|
1879
|
+
function mt(e) {
|
|
1880
|
+
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
1881
|
+
for (let a of e) a.x < t && (t = a.x), a.y < n && (n = a.y), a.x + a.width > r && (r = a.x + a.width), a.y + a.height > i && (i = a.y + a.height);
|
|
1882
|
+
return {
|
|
1883
|
+
x: t,
|
|
1884
|
+
y: n,
|
|
1885
|
+
width: r - t,
|
|
1886
|
+
height: i - n
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
|
+
function ht(e) {
|
|
1890
|
+
let { draggedBoxes: t, dx: n, dy: r, otherBoxes: i, threshold: a } = e;
|
|
1891
|
+
if (t.length === 0 || i.length === 0) return {
|
|
1892
|
+
dx: n,
|
|
1893
|
+
dy: r,
|
|
1894
|
+
guides: []
|
|
1895
|
+
};
|
|
1896
|
+
let o = mt(t), s = {
|
|
1897
|
+
left: o.x + n,
|
|
1898
|
+
right: o.x + o.width + n,
|
|
1899
|
+
centerX: o.x + o.width / 2 + n,
|
|
1900
|
+
top: o.y + r,
|
|
1901
|
+
bottom: o.y + o.height + r,
|
|
1902
|
+
centerY: o.y + o.height / 2 + r
|
|
1903
|
+
}, c = null, l = null;
|
|
1904
|
+
for (let e of i) {
|
|
1905
|
+
let t = {
|
|
1906
|
+
left: e.x,
|
|
1907
|
+
right: e.x + e.width,
|
|
1908
|
+
centerX: e.x + e.width / 2,
|
|
1909
|
+
top: e.y,
|
|
1910
|
+
bottom: e.y + e.height,
|
|
1911
|
+
centerY: e.y + e.height / 2
|
|
1912
|
+
};
|
|
1913
|
+
for (let n of [
|
|
1914
|
+
s.left,
|
|
1915
|
+
s.centerX,
|
|
1916
|
+
s.right
|
|
1917
|
+
]) for (let i of [
|
|
1918
|
+
t.left,
|
|
1919
|
+
t.centerX,
|
|
1920
|
+
t.right
|
|
1921
|
+
]) {
|
|
1922
|
+
let t = i - n;
|
|
1923
|
+
if (Math.abs(t) <= a && (!c || Math.abs(t) < Math.abs(c.delta))) {
|
|
1924
|
+
let n = i;
|
|
1925
|
+
c = {
|
|
1926
|
+
delta: t,
|
|
1927
|
+
guide: {
|
|
1928
|
+
x1: n,
|
|
1929
|
+
y1: Math.min(o.y + r, e.y),
|
|
1930
|
+
x2: n,
|
|
1931
|
+
y2: Math.max(o.y + r + o.height, e.y + e.height)
|
|
1932
|
+
}
|
|
1933
|
+
};
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
for (let r of [
|
|
1937
|
+
s.top,
|
|
1938
|
+
s.centerY,
|
|
1939
|
+
s.bottom
|
|
1940
|
+
]) for (let i of [
|
|
1941
|
+
t.top,
|
|
1942
|
+
t.centerY,
|
|
1943
|
+
t.bottom
|
|
1944
|
+
]) {
|
|
1945
|
+
let t = i - r;
|
|
1946
|
+
if (Math.abs(t) <= a && (!l || Math.abs(t) < Math.abs(l.delta))) {
|
|
1947
|
+
let r = i;
|
|
1948
|
+
l = {
|
|
1949
|
+
delta: t,
|
|
1950
|
+
guide: {
|
|
1951
|
+
x1: Math.min(o.x + n, e.x),
|
|
1952
|
+
y1: r,
|
|
1953
|
+
x2: Math.max(o.x + n + o.width, e.x + e.width),
|
|
1954
|
+
y2: r
|
|
1955
|
+
}
|
|
1956
|
+
};
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
let u = [], d = n, f = r;
|
|
1961
|
+
return c && (d += c.delta, u.push(c.guide)), l && (f += l.delta, u.push(l.guide)), {
|
|
1962
|
+
dx: d,
|
|
1963
|
+
dy: f,
|
|
1964
|
+
guides: u
|
|
1965
|
+
};
|
|
1966
|
+
}
|
|
1967
|
+
//#endregion
|
|
1968
|
+
//#region src/editor/svg-format.ts
|
|
1969
|
+
var gt = "1", _t = "0", vt = "data-annot-version";
|
|
1970
|
+
function yt(e) {
|
|
1971
|
+
e.setAttribute(vt, "1");
|
|
1972
|
+
}
|
|
1973
|
+
function bt(e) {
|
|
1974
|
+
return e.getAttribute("data-annot-version") || "0";
|
|
1975
|
+
}
|
|
1976
|
+
function xt(e) {
|
|
1977
|
+
let t = /\sdata-annot-version="([^"]*)"/.exec(e);
|
|
1978
|
+
return t ? t[1] : "0";
|
|
1979
|
+
}
|
|
1980
|
+
//#endregion
|
|
1981
|
+
//#region src/editor/tool-lifecycle.ts
|
|
1982
|
+
function St(e) {
|
|
1983
|
+
let t = [], n = [], r = {
|
|
1984
|
+
drafts: t,
|
|
1985
|
+
committed: n,
|
|
1986
|
+
saveCount: 0,
|
|
1987
|
+
attachDraft(n) {
|
|
1988
|
+
t.push(n), e.appendChild(n);
|
|
1989
|
+
},
|
|
1990
|
+
addAnnotation(t) {
|
|
1991
|
+
n.push(t), e.appendChild(t), r.saveCount += 1;
|
|
1992
|
+
},
|
|
1993
|
+
saveHistory() {
|
|
1994
|
+
r.saveCount += 1;
|
|
1995
|
+
}
|
|
1996
|
+
};
|
|
1997
|
+
return r;
|
|
1998
|
+
}
|
|
1999
|
+
//#endregion
|
|
2000
|
+
//#region src/editor/tool-style-writer.ts
|
|
2001
|
+
function J(e, t) {
|
|
2002
|
+
t.strokeColor && e.setAttribute("stroke", t.strokeColor), t.strokeWidth != null && e.setAttribute("stroke-width", String(t.strokeWidth)), t.strokeDasharray != null && (e.setAttribute("stroke-dasharray", k(t.strokeDasharray, t.strokeWidth)), e.setAttribute("data-dash-key", t.strokeDasharray)), t.fillColor && e.setAttribute("fill", t.fillColor), t.fillOpacity != null && e.setAttribute("fill-opacity", String(t.fillOpacity)), t.strokeLinecap && e.setAttribute("stroke-linecap", t.strokeLinecap), t.strokeLinejoin && e.setAttribute("stroke-linejoin", t.strokeLinejoin), t.strokeOpacity != null && (e.tagName === "line" || e.tagName === "g" && e.getAttribute("data-type") === "arrow" ? e.setAttribute("opacity", String(t.strokeOpacity)) : e.setAttribute("stroke-opacity", String(t.strokeOpacity)));
|
|
2003
|
+
}
|
|
2004
|
+
//#endregion
|
|
2005
|
+
//#region src/editor/tool-registry.ts
|
|
2006
|
+
var Ct = [
|
|
2007
|
+
"tool.typeChips",
|
|
2008
|
+
"tool.transparencyPercent",
|
|
2009
|
+
"tool.fillTransparencyPercent",
|
|
2010
|
+
"tool.fillOpacityPercent",
|
|
2011
|
+
"tool.freehandDone"
|
|
2012
|
+
], Y = [
|
|
2013
|
+
"strokeColor",
|
|
2014
|
+
"strokeWidth",
|
|
2015
|
+
"strokeDasharray",
|
|
2016
|
+
"strokeOpacity",
|
|
2017
|
+
"strokeLinecap"
|
|
2018
|
+
];
|
|
2019
|
+
function wt(e) {
|
|
2020
|
+
return e.getAttribute("data-highlight") === "1" || e.getAttribute("data-redact-style") === "solid" ? null : e.hasAttribute("data-rounded") ? "rounded" : "rect";
|
|
2021
|
+
}
|
|
2022
|
+
function Tt(e) {
|
|
2023
|
+
let t = (e.getAttribute("data-arrow-start-shape") ?? "none") !== "none", n = (e.getAttribute("data-arrow-end-shape") ?? "none") !== "none";
|
|
2024
|
+
return t && n ? "both" : t || n ? "end" : "none";
|
|
2025
|
+
}
|
|
2026
|
+
function Et(e, t, n) {
|
|
2027
|
+
if (e !== "arrow") return;
|
|
2028
|
+
let r = n, i = "triangle", a = "none", o = n.arrowHeadStart, s = n.arrowHeadEnd;
|
|
2029
|
+
switch (t) {
|
|
2030
|
+
case "none":
|
|
2031
|
+
r.arrowHeadStart = a, r.arrowHeadEnd = a;
|
|
2032
|
+
break;
|
|
2033
|
+
case "end":
|
|
2034
|
+
r.arrowHeadStart = a, r.arrowHeadEnd = s && s !== "none" ? s : i;
|
|
2035
|
+
break;
|
|
2036
|
+
case "both":
|
|
2037
|
+
r.arrowHeadStart = o && o !== "none" ? o : i, r.arrowHeadEnd = s && s !== "none" ? s : i;
|
|
2038
|
+
break;
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
var Dt = {
|
|
2042
|
+
arrow: {
|
|
2043
|
+
id: "arrow",
|
|
2044
|
+
label: "Line",
|
|
2045
|
+
icon: "north_east",
|
|
2046
|
+
variantField: "arrowHead",
|
|
2047
|
+
defaultVariant: "end",
|
|
2048
|
+
variants: [
|
|
2049
|
+
{
|
|
2050
|
+
value: "none",
|
|
2051
|
+
icon: "horizontal_rule",
|
|
2052
|
+
label: "Line (no arrow)",
|
|
2053
|
+
svg: u.none
|
|
2054
|
+
},
|
|
2055
|
+
{
|
|
2056
|
+
value: "end",
|
|
2057
|
+
icon: "north_east",
|
|
2058
|
+
label: "Arrow",
|
|
2059
|
+
svg: u.end
|
|
2060
|
+
},
|
|
2061
|
+
{
|
|
2062
|
+
value: "both",
|
|
2063
|
+
icon: "sync_alt",
|
|
2064
|
+
label: "Double arrow",
|
|
2065
|
+
svg: u.both
|
|
2066
|
+
}
|
|
2067
|
+
],
|
|
2068
|
+
presetFields: [
|
|
2069
|
+
...Y,
|
|
2070
|
+
"arrowHead",
|
|
2071
|
+
"arrowHeadStart",
|
|
2072
|
+
"arrowHeadEnd",
|
|
2073
|
+
"arrowWidthStart",
|
|
2074
|
+
"arrowWidthEnd",
|
|
2075
|
+
"arrowLengthStart",
|
|
2076
|
+
"arrowLengthEnd"
|
|
2077
|
+
],
|
|
2078
|
+
panelControls: [
|
|
2079
|
+
{
|
|
2080
|
+
section: "Type",
|
|
2081
|
+
id: "tool.typeChips"
|
|
2082
|
+
},
|
|
2083
|
+
{
|
|
2084
|
+
section: "Line",
|
|
2085
|
+
id: V.strokeColor
|
|
2086
|
+
},
|
|
2087
|
+
{
|
|
2088
|
+
section: "Line",
|
|
2089
|
+
id: "tool.transparencyPercent"
|
|
2090
|
+
},
|
|
2091
|
+
{
|
|
2092
|
+
section: "Line",
|
|
2093
|
+
id: V.strokeWidth
|
|
2094
|
+
},
|
|
2095
|
+
{
|
|
2096
|
+
section: "Line",
|
|
2097
|
+
id: V.strokeStyle
|
|
2098
|
+
},
|
|
2099
|
+
{
|
|
2100
|
+
section: "Line",
|
|
2101
|
+
id: V.strokeLinecap
|
|
2102
|
+
},
|
|
2103
|
+
{
|
|
2104
|
+
section: "Line",
|
|
2105
|
+
id: V.arrowStartShape
|
|
2106
|
+
},
|
|
2107
|
+
{
|
|
2108
|
+
section: "Line",
|
|
2109
|
+
id: V.arrowStartSize
|
|
2110
|
+
},
|
|
2111
|
+
{
|
|
2112
|
+
section: "Line",
|
|
2113
|
+
id: V.arrowEndShape
|
|
2114
|
+
},
|
|
2115
|
+
{
|
|
2116
|
+
section: "Line",
|
|
2117
|
+
id: V.arrowEndSize
|
|
2118
|
+
}
|
|
2119
|
+
],
|
|
2120
|
+
variantKeyForElement(e) {
|
|
2121
|
+
return e.tagName === "line" || e.tagName === "g" && e.getAttribute("data-type") === "arrow" ? `arrow.${Tt(e)}` : null;
|
|
2122
|
+
},
|
|
2123
|
+
extractStyleFromElement(e, t) {
|
|
2124
|
+
t.arrowHead = Tt(e);
|
|
2125
|
+
let n = e.getAttribute("data-arrow-start-shape"), r = e.getAttribute("data-arrow-end-shape"), i = e.getAttribute("data-arrow-start-width"), a = e.getAttribute("data-arrow-start-length"), o = e.getAttribute("data-arrow-end-width"), s = e.getAttribute("data-arrow-end-length");
|
|
2126
|
+
n && (t.arrowHeadStart = n), r && (t.arrowHeadEnd = r), i && (t.arrowWidthStart = i), a && (t.arrowLengthStart = a), o && (t.arrowWidthEnd = o), s && (t.arrowLengthEnd = s), Et("arrow", t.arrowHead, t);
|
|
2127
|
+
},
|
|
2128
|
+
applyStyleToElement(e, t) {
|
|
2129
|
+
J(e, t), e.tagName === "g" && e.getAttribute("data-type") === "arrow" && Ce(e);
|
|
2130
|
+
}
|
|
2131
|
+
},
|
|
2132
|
+
shape: {
|
|
2133
|
+
id: "shape",
|
|
2134
|
+
label: "Shape",
|
|
2135
|
+
icon: "shapes",
|
|
2136
|
+
variantField: "shapeType",
|
|
2137
|
+
defaultVariant: "rect",
|
|
2138
|
+
variants: [
|
|
2139
|
+
{
|
|
2140
|
+
value: "rect",
|
|
2141
|
+
icon: "rectangle",
|
|
2142
|
+
label: "Rectangle",
|
|
2143
|
+
svg: l.rect
|
|
2144
|
+
},
|
|
2145
|
+
{
|
|
2146
|
+
value: "rounded",
|
|
2147
|
+
icon: "crop_square",
|
|
2148
|
+
label: "Rounded rectangle",
|
|
2149
|
+
svg: l.rounded
|
|
2150
|
+
},
|
|
2151
|
+
{
|
|
2152
|
+
value: "ellipse",
|
|
2153
|
+
icon: "circle",
|
|
2154
|
+
label: "Ellipse",
|
|
2155
|
+
svg: l.ellipse
|
|
2156
|
+
}
|
|
2157
|
+
],
|
|
2158
|
+
presetFields: [
|
|
2159
|
+
...Y,
|
|
2160
|
+
"fillColor",
|
|
2161
|
+
"fillOpacity",
|
|
2162
|
+
"shapeType",
|
|
2163
|
+
"strokeLinejoin"
|
|
2164
|
+
],
|
|
2165
|
+
panelControls: [
|
|
2166
|
+
{
|
|
2167
|
+
section: "Type",
|
|
2168
|
+
id: "tool.typeChips"
|
|
2169
|
+
},
|
|
2170
|
+
{
|
|
2171
|
+
section: "Fill",
|
|
2172
|
+
id: V.fillColor
|
|
2173
|
+
},
|
|
2174
|
+
{
|
|
2175
|
+
section: "Fill",
|
|
2176
|
+
id: "tool.fillOpacityPercent"
|
|
2177
|
+
},
|
|
2178
|
+
{
|
|
2179
|
+
section: "Line",
|
|
2180
|
+
id: V.strokeColor
|
|
2181
|
+
},
|
|
2182
|
+
{
|
|
2183
|
+
section: "Line",
|
|
2184
|
+
id: "tool.transparencyPercent"
|
|
2185
|
+
},
|
|
2186
|
+
{
|
|
2187
|
+
section: "Line",
|
|
2188
|
+
id: V.strokeWidth
|
|
2189
|
+
},
|
|
2190
|
+
{
|
|
2191
|
+
section: "Line",
|
|
2192
|
+
id: V.strokeStyle
|
|
2193
|
+
},
|
|
2194
|
+
{
|
|
2195
|
+
section: "Line",
|
|
2196
|
+
id: V.strokeLinecap
|
|
2197
|
+
}
|
|
2198
|
+
],
|
|
2199
|
+
variantKeyForElement(e) {
|
|
2200
|
+
if (e.tagName === "ellipse") return "shape.ellipse";
|
|
2201
|
+
if (e.tagName === "rect") {
|
|
2202
|
+
let t = wt(e);
|
|
2203
|
+
return t ? `shape.${t}` : null;
|
|
2204
|
+
}
|
|
2205
|
+
return null;
|
|
2206
|
+
},
|
|
2207
|
+
extractStyleFromElement(e, t) {
|
|
2208
|
+
e.tagName === "ellipse" ? t.shapeType = "ellipse" : e.tagName === "rect" && (t.shapeType = e.hasAttribute("data-rounded") ? "rounded" : "rect");
|
|
2209
|
+
},
|
|
2210
|
+
applyStyleToElement(e, t) {
|
|
2211
|
+
J(e, t);
|
|
2212
|
+
}
|
|
2213
|
+
},
|
|
2214
|
+
highlight: {
|
|
2215
|
+
id: "highlight",
|
|
2216
|
+
label: "Highlight",
|
|
2217
|
+
icon: "ink_highlighter",
|
|
2218
|
+
variantField: "highlightColor",
|
|
2219
|
+
defaultVariant: f[0].value,
|
|
2220
|
+
variants: f.map((e) => ({
|
|
2221
|
+
value: e.value,
|
|
2222
|
+
icon: "ink_highlighter",
|
|
2223
|
+
label: e.label
|
|
2224
|
+
})),
|
|
2225
|
+
flyoutKind: "color",
|
|
2226
|
+
tooltipLabelForVariant: (e) => {
|
|
2227
|
+
let t = e.toLowerCase();
|
|
2228
|
+
return f.find((e) => e.value === t)?.label ?? "";
|
|
2229
|
+
},
|
|
2230
|
+
ensurePresetForVariantChange: (e) => {
|
|
2231
|
+
e.shapeType = "highlight";
|
|
2232
|
+
},
|
|
2233
|
+
presetFields: ["highlightColor", "fillOpacity"],
|
|
2234
|
+
panelControls: [{
|
|
2235
|
+
section: "Type",
|
|
2236
|
+
id: "tool.typeChips"
|
|
2237
|
+
}, {
|
|
2238
|
+
section: "Fill",
|
|
2239
|
+
id: "tool.fillTransparencyPercent"
|
|
2240
|
+
}],
|
|
2241
|
+
variantKeyForElement(e) {
|
|
2242
|
+
if (e.tagName !== "rect" || e.getAttribute("data-highlight") !== "1") return null;
|
|
2243
|
+
let t = e.getAttribute("fill");
|
|
2244
|
+
return `highlight.${t ? t.toLowerCase() : f[0].value}`;
|
|
2245
|
+
},
|
|
2246
|
+
extractStyleFromElement(e, t) {
|
|
2247
|
+
let n = e.getAttribute("fill");
|
|
2248
|
+
n && (t.highlightColor = n);
|
|
2249
|
+
},
|
|
2250
|
+
applyStyleToElement(e, t) {
|
|
2251
|
+
t.highlightColor && e.setAttribute("fill", t.highlightColor), t.fillOpacity != null && e.setAttribute("fill-opacity", String(t.fillOpacity));
|
|
2252
|
+
}
|
|
2253
|
+
},
|
|
2254
|
+
text: {
|
|
2255
|
+
id: "text",
|
|
2256
|
+
label: "Text",
|
|
2257
|
+
icon: "title",
|
|
2258
|
+
variantField: "textVariant",
|
|
2259
|
+
defaultVariant: "sticky",
|
|
2260
|
+
variants: [
|
|
2261
|
+
{
|
|
2262
|
+
value: "plain",
|
|
2263
|
+
icon: "text_fields",
|
|
2264
|
+
label: "Plain text"
|
|
2265
|
+
},
|
|
2266
|
+
{
|
|
2267
|
+
value: "sticky",
|
|
2268
|
+
icon: "sticky_note_2",
|
|
2269
|
+
label: "Sticky note"
|
|
2270
|
+
},
|
|
2271
|
+
{
|
|
2272
|
+
value: "callout",
|
|
2273
|
+
icon: "chat_bubble",
|
|
2274
|
+
label: "Callout"
|
|
2275
|
+
}
|
|
2276
|
+
],
|
|
2277
|
+
presetFields: [
|
|
2278
|
+
"strokeColor",
|
|
2279
|
+
"fillColor",
|
|
2280
|
+
"fontSize",
|
|
2281
|
+
"fontFamily",
|
|
2282
|
+
"textVariant",
|
|
2283
|
+
"textAnchor",
|
|
2284
|
+
"textVerticalAnchor"
|
|
2285
|
+
],
|
|
2286
|
+
panelControls: [
|
|
2287
|
+
{
|
|
2288
|
+
section: "Type",
|
|
2289
|
+
id: "tool.typeChips"
|
|
2290
|
+
},
|
|
2291
|
+
{
|
|
2292
|
+
section: "Line",
|
|
2293
|
+
id: V.strokeColor
|
|
2294
|
+
},
|
|
2295
|
+
{
|
|
2296
|
+
section: "Line",
|
|
2297
|
+
id: V.fontFamily
|
|
2298
|
+
},
|
|
2299
|
+
{
|
|
2300
|
+
section: "Line",
|
|
2301
|
+
id: V.fontSize
|
|
2302
|
+
},
|
|
2303
|
+
{
|
|
2304
|
+
section: "Label",
|
|
2305
|
+
id: V.textAnchor
|
|
2306
|
+
},
|
|
2307
|
+
{
|
|
2308
|
+
section: "Label",
|
|
2309
|
+
id: V.textVerticalAnchor
|
|
2310
|
+
}
|
|
2311
|
+
],
|
|
2312
|
+
variantKeyForElement(e) {
|
|
2313
|
+
if (e.tagName === "text") return `text.${e.getAttribute("data-shape-kind") ?? "sticky"}`;
|
|
2314
|
+
if (e.tagName === "g" && e.getAttribute("data-type") === "shape") {
|
|
2315
|
+
let t = e.getAttribute("data-shape-kind");
|
|
2316
|
+
return t !== "plain" && t !== "sticky" && t !== "callout" ? null : `text.${t}`;
|
|
2317
|
+
}
|
|
2318
|
+
return null;
|
|
2319
|
+
},
|
|
2320
|
+
extractStyleFromElement(e, t) {
|
|
2321
|
+
let n = e.tagName === "g" ? e.querySelector("text") : e, r = Number.parseFloat(n?.getAttribute("font-size") || "");
|
|
2322
|
+
Number.isFinite(r) && r > 0 && (t.fontSize = r);
|
|
2323
|
+
let i = n?.getAttribute("font-family") || e.getAttribute("data-font-family");
|
|
2324
|
+
i && (t.fontFamily = i);
|
|
2325
|
+
let a = e.getAttribute("data-shape-kind");
|
|
2326
|
+
(a === "plain" || a === "sticky" || a === "callout") && (t.textVariant = a);
|
|
2327
|
+
let o = n?.getAttribute("fill") || e.getAttribute("data-color");
|
|
2328
|
+
o && (t.strokeColor = o);
|
|
2329
|
+
let s = e.getAttribute("data-text-anchor");
|
|
2330
|
+
(s === "start" || s === "middle" || s === "end") && (t.textAnchor = s);
|
|
2331
|
+
let c = e.getAttribute("data-text-vanchor");
|
|
2332
|
+
(c === "top" || c === "middle" || c === "bottom") && (t.textVerticalAnchor = c);
|
|
2333
|
+
},
|
|
2334
|
+
applyStyleToElement(e, t) {
|
|
2335
|
+
if (e.tagName === "g" && e.getAttribute("data-type") === "shape") {
|
|
2336
|
+
if (t.strokeColor) {
|
|
2337
|
+
e.setAttribute("data-color", t.strokeColor);
|
|
2338
|
+
let n = e.querySelector("text");
|
|
2339
|
+
n && n.setAttribute("fill", t.strokeColor);
|
|
2340
|
+
}
|
|
2341
|
+
if (t.fontFamily) {
|
|
2342
|
+
e.setAttribute("data-font-family", t.fontFamily);
|
|
2343
|
+
let n = e.querySelector("text");
|
|
2344
|
+
n && n.setAttribute("font-family", t.fontFamily);
|
|
2345
|
+
}
|
|
2346
|
+
if (t.fontSize != null) {
|
|
2347
|
+
let n = e.querySelector("text");
|
|
2348
|
+
n && n.setAttribute("font-size", String(t.fontSize));
|
|
2349
|
+
}
|
|
2350
|
+
return;
|
|
2351
|
+
}
|
|
2352
|
+
J(e, t);
|
|
2353
|
+
}
|
|
2354
|
+
},
|
|
2355
|
+
freehand: {
|
|
2356
|
+
id: "freehand",
|
|
2357
|
+
label: "Draw",
|
|
2358
|
+
icon: "draw",
|
|
2359
|
+
variantField: "drawStyle",
|
|
2360
|
+
defaultVariant: "pen",
|
|
2361
|
+
variants: [{
|
|
2362
|
+
value: "pen",
|
|
2363
|
+
icon: "edit",
|
|
2364
|
+
label: "Pen"
|
|
2365
|
+
}, {
|
|
2366
|
+
value: "highlighter",
|
|
2367
|
+
icon: "ink_highlighter",
|
|
2368
|
+
label: "Highlighter"
|
|
2369
|
+
}],
|
|
2370
|
+
presetFields: [...Y, "drawStyle"],
|
|
2371
|
+
panelControls: [
|
|
2372
|
+
{
|
|
2373
|
+
section: "Type",
|
|
2374
|
+
id: "tool.typeChips"
|
|
2375
|
+
},
|
|
2376
|
+
{
|
|
2377
|
+
section: "Line",
|
|
2378
|
+
id: V.strokeColor
|
|
2379
|
+
},
|
|
2380
|
+
{
|
|
2381
|
+
section: "Line",
|
|
2382
|
+
id: "tool.transparencyPercent"
|
|
2383
|
+
},
|
|
2384
|
+
{
|
|
2385
|
+
section: "Line",
|
|
2386
|
+
id: V.strokeWidth
|
|
2387
|
+
},
|
|
2388
|
+
{
|
|
2389
|
+
section: "Line",
|
|
2390
|
+
id: V.strokeStyle
|
|
2391
|
+
},
|
|
2392
|
+
{
|
|
2393
|
+
section: "Line",
|
|
2394
|
+
id: V.strokeLinecap
|
|
2395
|
+
},
|
|
2396
|
+
{
|
|
2397
|
+
section: "Line",
|
|
2398
|
+
id: "tool.freehandDone"
|
|
2399
|
+
}
|
|
2400
|
+
],
|
|
2401
|
+
variantKeyForElement(e) {
|
|
2402
|
+
return e.tagName === "path" || e.tagName === "g" && e.getAttribute("data-type") === "freehand" ? `freehand.${e.getAttribute("data-draw-style") ?? "pen"}` : null;
|
|
2403
|
+
},
|
|
2404
|
+
extractStyleFromElement(e, t) {
|
|
2405
|
+
let n = e.getAttribute("data-draw-style");
|
|
2406
|
+
(n === "pen" || n === "highlighter") && (t.drawStyle = n);
|
|
2407
|
+
},
|
|
2408
|
+
applyStyleToElement(e, t) {
|
|
2409
|
+
J(e, t);
|
|
2410
|
+
}
|
|
2411
|
+
},
|
|
2412
|
+
marker: {
|
|
2413
|
+
id: "marker",
|
|
2414
|
+
label: "Counter",
|
|
2415
|
+
icon: "counter_1",
|
|
2416
|
+
variantField: "markerShape",
|
|
2417
|
+
defaultVariant: "circle",
|
|
2418
|
+
variants: [
|
|
2419
|
+
{
|
|
2420
|
+
value: "circle",
|
|
2421
|
+
icon: "circle",
|
|
2422
|
+
label: "Circle",
|
|
2423
|
+
svg: d.circle
|
|
2424
|
+
},
|
|
2425
|
+
{
|
|
2426
|
+
value: "rect",
|
|
2427
|
+
icon: "square",
|
|
2428
|
+
label: "Square",
|
|
2429
|
+
svg: d.rect
|
|
2430
|
+
},
|
|
2431
|
+
{
|
|
2432
|
+
value: "rounded",
|
|
2433
|
+
icon: "crop_square",
|
|
2434
|
+
label: "Rounded square",
|
|
2435
|
+
svg: d.rounded
|
|
2436
|
+
}
|
|
2437
|
+
],
|
|
2438
|
+
presetFields: [
|
|
2439
|
+
...Y,
|
|
2440
|
+
"fillColor",
|
|
2441
|
+
"fontSize",
|
|
2442
|
+
"markerShape"
|
|
2443
|
+
],
|
|
2444
|
+
panelControls: [
|
|
2445
|
+
{
|
|
2446
|
+
section: "Type",
|
|
2447
|
+
id: "tool.typeChips"
|
|
2448
|
+
},
|
|
2449
|
+
{
|
|
2450
|
+
section: "Fill",
|
|
2451
|
+
id: V.fillColor
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
section: "Line",
|
|
2455
|
+
id: V.strokeColor
|
|
2456
|
+
},
|
|
2457
|
+
{
|
|
2458
|
+
section: "Line",
|
|
2459
|
+
id: V.strokeWidth
|
|
2460
|
+
},
|
|
2461
|
+
{
|
|
2462
|
+
section: "Line",
|
|
2463
|
+
id: V.strokeStyle
|
|
2464
|
+
},
|
|
2465
|
+
{
|
|
2466
|
+
section: "Label",
|
|
2467
|
+
id: V.fontSize
|
|
2468
|
+
}
|
|
2469
|
+
],
|
|
2470
|
+
variantKeyForElement(e) {
|
|
2471
|
+
return e.tagName !== "g" || !e.hasAttribute("data-marker") ? null : `marker.${e.getAttribute("data-shape") ?? "circle"}`;
|
|
2472
|
+
},
|
|
2473
|
+
extractStyleFromElement(e, t) {
|
|
2474
|
+
let n = e.getAttribute("data-shape");
|
|
2475
|
+
(n === "circle" || n === "rect" || n === "rounded") && (t.markerShape = n);
|
|
2476
|
+
let r = e.querySelector("circle, rect"), i = r?.getAttribute("fill");
|
|
2477
|
+
i && (t.fillColor = i);
|
|
2478
|
+
let a = r?.getAttribute("stroke");
|
|
2479
|
+
a && (t.strokeColor = a);
|
|
2480
|
+
let o = Number.parseFloat(r?.getAttribute("stroke-width") || "");
|
|
2481
|
+
Number.isFinite(o) && o >= 0 && (t.strokeWidth = o);
|
|
2482
|
+
let s = r?.getAttribute("data-dash-key") ?? r?.getAttribute("stroke-dasharray");
|
|
2483
|
+
s != null && (t.strokeDasharray = s);
|
|
2484
|
+
let c = e.tagName === "g" ? e.querySelector("text") : null, l = Number.parseFloat(c?.getAttribute("font-size") || "");
|
|
2485
|
+
Number.isFinite(l) && l > 0 && (t.fontSize = l);
|
|
2486
|
+
},
|
|
2487
|
+
applyStyleToElement(e, t) {
|
|
2488
|
+
let n = e.querySelector("circle, rect");
|
|
2489
|
+
if (n) {
|
|
2490
|
+
if (t.fillColor && n.setAttribute("fill", t.fillColor), t.strokeColor && n.setAttribute("stroke", t.strokeColor), t.strokeWidth != null && n.setAttribute("stroke-width", String(t.strokeWidth)), t.strokeDasharray != null) {
|
|
2491
|
+
let e = t.strokeWidth ?? Number.parseFloat(n.getAttribute("stroke-width") || "1.5");
|
|
2492
|
+
n.setAttribute("stroke-dasharray", k(t.strokeDasharray, e)), n.setAttribute("data-dash-key", t.strokeDasharray);
|
|
2493
|
+
}
|
|
2494
|
+
if (t.fontSize != null) {
|
|
2495
|
+
let n = e.querySelector("text");
|
|
2496
|
+
n && n.setAttribute("font-size", String(t.fontSize));
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
},
|
|
2501
|
+
redact: {
|
|
2502
|
+
id: "redact",
|
|
2503
|
+
label: "Redact",
|
|
2504
|
+
icon: "visibility_off",
|
|
2505
|
+
variantField: "redactStyle",
|
|
2506
|
+
defaultVariant: "mosaic",
|
|
2507
|
+
variants: [
|
|
2508
|
+
{
|
|
2509
|
+
value: "mosaic",
|
|
2510
|
+
icon: "apps",
|
|
2511
|
+
label: "Mosaic (pixelate)"
|
|
2512
|
+
},
|
|
2513
|
+
{
|
|
2514
|
+
value: "solid",
|
|
2515
|
+
icon: "rectangle",
|
|
2516
|
+
label: "Solid bar"
|
|
2517
|
+
},
|
|
2518
|
+
{
|
|
2519
|
+
value: "blur",
|
|
2520
|
+
icon: "blur_on",
|
|
2521
|
+
label: "Blur"
|
|
2522
|
+
}
|
|
2523
|
+
],
|
|
2524
|
+
presetFields: ["fillColor", "redactStyle"],
|
|
2525
|
+
panelControls: [{
|
|
2526
|
+
section: "Type",
|
|
2527
|
+
id: "tool.typeChips"
|
|
2528
|
+
}, {
|
|
2529
|
+
section: "Fill",
|
|
2530
|
+
id: V.fillColor,
|
|
2531
|
+
visibleWhen: (e) => e.redactStyle === "solid"
|
|
2532
|
+
}],
|
|
2533
|
+
variantKeyForElement(e) {
|
|
2534
|
+
if (e.tagName === "rect" && e.getAttribute("data-redact-style") === "solid") return "redact.solid";
|
|
2535
|
+
if (e.tagName === "image") {
|
|
2536
|
+
let t = e.getAttribute("data-redact-style");
|
|
2537
|
+
return t === "mosaic" || t === "blur" ? `redact.${t}` : "redact.mosaic";
|
|
2538
|
+
}
|
|
2539
|
+
return null;
|
|
2540
|
+
},
|
|
2541
|
+
extractStyleFromElement(e, t) {
|
|
2542
|
+
let n = e.getAttribute("data-redact-style");
|
|
2543
|
+
(n === "solid" || n === "mosaic" || n === "blur") && (t.redactStyle = n);
|
|
2544
|
+
},
|
|
2545
|
+
applyStyleToElement(e, t) {
|
|
2546
|
+
e.tagName === "rect" && e.getAttribute("data-redact-style") === "solid" && (t.fillColor && t.fillColor !== "none" && e.setAttribute("fill", t.fillColor), e.removeAttribute("stroke"), e.removeAttribute("stroke-width"), e.removeAttribute("stroke-dasharray"), e.removeAttribute("data-dash-key"), e.removeAttribute("stroke-linecap"), e.removeAttribute("stroke-linejoin"), e.removeAttribute("stroke-opacity"), e.removeAttribute("opacity"), e.removeAttribute("fill-opacity"));
|
|
2547
|
+
}
|
|
2548
|
+
},
|
|
2549
|
+
crop: {
|
|
2550
|
+
id: "crop",
|
|
2551
|
+
label: "Crop",
|
|
2552
|
+
icon: "crop",
|
|
2553
|
+
category: "image-op",
|
|
2554
|
+
presetFields: []
|
|
2555
|
+
}
|
|
2556
|
+
}, Ot = [
|
|
2557
|
+
"arrow",
|
|
2558
|
+
"shape",
|
|
2559
|
+
"highlight",
|
|
2560
|
+
"text",
|
|
2561
|
+
"freehand",
|
|
2562
|
+
"marker",
|
|
2563
|
+
"redact",
|
|
2564
|
+
"crop"
|
|
2565
|
+
], kt = (e, t) => Math.round((1 - (Number.isFinite(e) ? e : t)) * 100), At = (e) => 1 - e / 100, jt = (e, t) => Math.round((Number.isFinite(e) ? e : t) * 100), Mt = (e) => e / 100;
|
|
2566
|
+
function Nt(e) {
|
|
2567
|
+
return e === "sm" || e === "md" || e === "lg";
|
|
2568
|
+
}
|
|
2569
|
+
function Pt(e, t) {
|
|
2570
|
+
return e ?? t;
|
|
2571
|
+
}
|
|
2572
|
+
function Ft(e, t) {
|
|
2573
|
+
return `${Pt(e, "md")}-${Pt(t, "md")}`;
|
|
2574
|
+
}
|
|
2575
|
+
function It(e) {
|
|
2576
|
+
let [t, n] = e.split("-");
|
|
2577
|
+
return {
|
|
2578
|
+
width: t && Nt(t) ? t : "md",
|
|
2579
|
+
length: n && Nt(n) ? n : "md"
|
|
2580
|
+
};
|
|
2581
|
+
}
|
|
2582
|
+
var Lt = {
|
|
2583
|
+
[V.strokeColor]: {
|
|
2584
|
+
read: (e) => e.strokeColor,
|
|
2585
|
+
write: (e, t) => {
|
|
2586
|
+
e.strokeColor = String(t);
|
|
2587
|
+
},
|
|
2588
|
+
selectionDef: V.strokeColor
|
|
2589
|
+
},
|
|
2590
|
+
[V.strokeWidth]: {
|
|
2591
|
+
read: (e) => e.strokeWidth,
|
|
2592
|
+
write: (e, t) => {
|
|
2593
|
+
e.strokeWidth = Number(t);
|
|
2594
|
+
},
|
|
2595
|
+
selectionDef: V.strokeWidth
|
|
2596
|
+
},
|
|
2597
|
+
[V.strokeStyle]: {
|
|
2598
|
+
read: (e) => e.strokeDasharray ?? "",
|
|
2599
|
+
write: (e, t) => {
|
|
2600
|
+
e.strokeDasharray = String(t);
|
|
2601
|
+
},
|
|
2602
|
+
selectionDef: V.strokeStyle
|
|
2603
|
+
},
|
|
2604
|
+
[V.strokeLinecap]: {
|
|
2605
|
+
read: (e) => e.strokeLinecap ?? "butt",
|
|
2606
|
+
write: (e, t) => {
|
|
2607
|
+
e.strokeLinecap = t;
|
|
2608
|
+
},
|
|
2609
|
+
selectionDef: V.strokeLinecap
|
|
2610
|
+
},
|
|
2611
|
+
[V.fillColor]: {
|
|
2612
|
+
read: (e) => e.fillColor,
|
|
2613
|
+
write: (e, t) => {
|
|
2614
|
+
e.fillColor = String(t);
|
|
2615
|
+
},
|
|
2616
|
+
selectionDef: V.fillColor
|
|
2617
|
+
},
|
|
2618
|
+
[V.fontSize]: {
|
|
2619
|
+
read: (e) => e.fontSize,
|
|
2620
|
+
write: (e, t) => {
|
|
2621
|
+
e.fontSize = Number(t);
|
|
2622
|
+
},
|
|
2623
|
+
selectionDef: V.fontSize
|
|
2624
|
+
},
|
|
2625
|
+
[V.fontFamily]: {
|
|
2626
|
+
read: (e) => o(e.fontFamily),
|
|
2627
|
+
write: (e, t) => {
|
|
2628
|
+
e.fontFamily = o(String(t));
|
|
2629
|
+
},
|
|
2630
|
+
selectionDef: V.fontFamily
|
|
2631
|
+
},
|
|
2632
|
+
[V.textAnchor]: {
|
|
2633
|
+
read: (e) => e.textAnchor ?? "start",
|
|
2634
|
+
write: (e, t) => {
|
|
2635
|
+
e.textAnchor = t;
|
|
2636
|
+
},
|
|
2637
|
+
selectionDef: V.textAnchor
|
|
2638
|
+
},
|
|
2639
|
+
[V.textVerticalAnchor]: {
|
|
2640
|
+
read: (e) => e.textVerticalAnchor ?? "top",
|
|
2641
|
+
write: (e, t) => {
|
|
2642
|
+
e.textVerticalAnchor = t;
|
|
2643
|
+
},
|
|
2644
|
+
selectionDef: V.textVerticalAnchor
|
|
2645
|
+
},
|
|
2646
|
+
[V.arrowStartShape]: {
|
|
2647
|
+
read: (e) => e.arrowHeadStart ?? "none",
|
|
2648
|
+
write: (e, t) => {
|
|
2649
|
+
e.arrowHeadStart = t;
|
|
2650
|
+
},
|
|
2651
|
+
selectionDef: V.arrowStartShape
|
|
2652
|
+
},
|
|
2653
|
+
[V.arrowEndShape]: {
|
|
2654
|
+
read: (e) => e.arrowHeadEnd ?? "triangle",
|
|
2655
|
+
write: (e, t) => {
|
|
2656
|
+
e.arrowHeadEnd = t;
|
|
2657
|
+
},
|
|
2658
|
+
selectionDef: V.arrowEndShape
|
|
2659
|
+
},
|
|
2660
|
+
[V.arrowStartSize]: {
|
|
2661
|
+
read: (e) => Ft(e.arrowWidthStart, e.arrowLengthStart),
|
|
2662
|
+
write: (e, t) => {
|
|
2663
|
+
let { width: n, length: r } = It(String(t));
|
|
2664
|
+
e.arrowWidthStart = n, e.arrowLengthStart = r;
|
|
2665
|
+
},
|
|
2666
|
+
selectionDef: V.arrowStartSize
|
|
2667
|
+
},
|
|
2668
|
+
[V.arrowEndSize]: {
|
|
2669
|
+
read: (e) => Ft(e.arrowWidthEnd, e.arrowLengthEnd),
|
|
2670
|
+
write: (e, t) => {
|
|
2671
|
+
let { width: n, length: r } = It(String(t));
|
|
2672
|
+
e.arrowWidthEnd = n, e.arrowLengthEnd = r;
|
|
2673
|
+
},
|
|
2674
|
+
selectionDef: V.arrowEndSize
|
|
2675
|
+
},
|
|
2676
|
+
"tool.typeChips": {
|
|
2677
|
+
read: (e, t) => {
|
|
2678
|
+
let n = Dt[t]?.variantField;
|
|
2679
|
+
if (n) return e[n];
|
|
2680
|
+
},
|
|
2681
|
+
write: (e, t, n) => {
|
|
2682
|
+
let r = Dt[n]?.variantField;
|
|
2683
|
+
r && (e[r] = t);
|
|
2684
|
+
},
|
|
2685
|
+
selectionDef: null
|
|
2686
|
+
},
|
|
2687
|
+
"tool.transparencyPercent": {
|
|
2688
|
+
read: (e) => kt(e.strokeOpacity ?? 1, 1),
|
|
2689
|
+
write: (e, t) => {
|
|
2690
|
+
e.strokeOpacity = At(Number(t));
|
|
2691
|
+
},
|
|
2692
|
+
selectionDef: V.strokeOpacity
|
|
2693
|
+
},
|
|
2694
|
+
"tool.fillTransparencyPercent": {
|
|
2695
|
+
read: (e) => kt(e.fillOpacity ?? .4, .4),
|
|
2696
|
+
write: (e, t) => {
|
|
2697
|
+
e.fillOpacity = At(Number(t));
|
|
2698
|
+
},
|
|
2699
|
+
selectionDef: V.fillOpacity
|
|
2700
|
+
},
|
|
2701
|
+
"tool.fillOpacityPercent": {
|
|
2702
|
+
read: (e) => jt(e.fillOpacity ?? 1, 1),
|
|
2703
|
+
write: (e, t) => {
|
|
2704
|
+
e.fillOpacity = Mt(Number(t));
|
|
2705
|
+
},
|
|
2706
|
+
selectionDef: null
|
|
2707
|
+
},
|
|
2708
|
+
"tool.freehandDone": {
|
|
2709
|
+
read: () => null,
|
|
2710
|
+
write: () => {},
|
|
2711
|
+
selectionDef: null
|
|
2712
|
+
}
|
|
2713
|
+
};
|
|
2714
|
+
function Rt(e) {
|
|
2715
|
+
let t = Lt[e];
|
|
2716
|
+
if (!t?.selectionDef) return null;
|
|
2717
|
+
let n = st[t.selectionDef];
|
|
2718
|
+
return n ? {
|
|
2719
|
+
label: n.label,
|
|
2720
|
+
options: n.options,
|
|
2721
|
+
min: n.min,
|
|
2722
|
+
max: n.max,
|
|
2723
|
+
step: n.step,
|
|
2724
|
+
unit: n.unit,
|
|
2725
|
+
allowNone: n.allowNone
|
|
2726
|
+
} : null;
|
|
2727
|
+
}
|
|
2728
|
+
var zt = [
|
|
2729
|
+
V.strokeColor,
|
|
2730
|
+
V.strokeWidth,
|
|
2731
|
+
V.strokeStyle,
|
|
2732
|
+
V.strokeLinecap,
|
|
2733
|
+
V.fillColor,
|
|
2734
|
+
V.fontSize,
|
|
2735
|
+
V.fontFamily,
|
|
2736
|
+
V.textAnchor,
|
|
2737
|
+
V.textVerticalAnchor,
|
|
2738
|
+
V.arrowStartShape,
|
|
2739
|
+
V.arrowEndShape,
|
|
2740
|
+
V.arrowStartSize,
|
|
2741
|
+
V.arrowEndSize,
|
|
2742
|
+
...Ct
|
|
2743
|
+
], Bt = {
|
|
2744
|
+
strokeColor: "stroke_color",
|
|
2745
|
+
fillColor: "fill_color",
|
|
2746
|
+
strokeWidth: "stroke_width",
|
|
2747
|
+
fontSize: "font_size",
|
|
2748
|
+
strokeDasharray: "stroke_dasharray",
|
|
2749
|
+
fillOpacity: "fill_opacity",
|
|
2750
|
+
shapeType: "shape_type",
|
|
2751
|
+
arrowHead: "arrow_head",
|
|
2752
|
+
textVariant: "shape_kind",
|
|
2753
|
+
fontFamily: "font_family",
|
|
2754
|
+
textAnchor: "text_anchor",
|
|
2755
|
+
textVerticalAnchor: "text_vanchor",
|
|
2756
|
+
drawStyle: "draw_style",
|
|
2757
|
+
redactStyle: "redact_style",
|
|
2758
|
+
arrowHeadStart: "arrow_head_start",
|
|
2759
|
+
arrowHeadEnd: "arrow_head_end",
|
|
2760
|
+
arrowWidthStart: "arrow_width_start",
|
|
2761
|
+
arrowWidthEnd: "arrow_width_end",
|
|
2762
|
+
arrowLengthStart: "arrow_length_start",
|
|
2763
|
+
arrowLengthEnd: "arrow_length_end",
|
|
2764
|
+
highlightColor: "highlight_color",
|
|
2765
|
+
markerShape: "marker_shape",
|
|
2766
|
+
strokeOpacity: "stroke_opacity",
|
|
2767
|
+
strokeLinecap: "stroke_linecap",
|
|
2768
|
+
strokeLinejoin: "stroke_linejoin"
|
|
2769
|
+
}, Vt = (() => {
|
|
2770
|
+
let e = {};
|
|
2771
|
+
for (let [t, n] of Object.entries(Bt)) e[n] = t;
|
|
2772
|
+
return e;
|
|
2773
|
+
})();
|
|
2774
|
+
function Ht(e, t) {
|
|
2775
|
+
return t === "camel" ? e : Bt[e] ?? e;
|
|
2776
|
+
}
|
|
2777
|
+
function Ut(e, t, n) {
|
|
2778
|
+
if (t === "camel") return e in n ? e : null;
|
|
2779
|
+
let r = Bt[e];
|
|
2780
|
+
return r !== void 0 && r in n ? r : null;
|
|
2781
|
+
}
|
|
2782
|
+
function Wt(e, t, n) {
|
|
2783
|
+
let r = {};
|
|
2784
|
+
for (let i of t) {
|
|
2785
|
+
let t = e[i];
|
|
2786
|
+
t !== void 0 && (r[Ht(i, n)] = t);
|
|
2787
|
+
}
|
|
2788
|
+
return r;
|
|
2789
|
+
}
|
|
2790
|
+
function Gt(e, t, n) {
|
|
2791
|
+
let r = {};
|
|
2792
|
+
for (let i of t) {
|
|
2793
|
+
let t = Ut(i, n, e);
|
|
2794
|
+
if (t === null) continue;
|
|
2795
|
+
let a = e[t];
|
|
2796
|
+
a !== void 0 && a !== "" && (r[i] = a);
|
|
2797
|
+
}
|
|
2798
|
+
return r;
|
|
2799
|
+
}
|
|
2800
|
+
function Kt(e) {
|
|
2801
|
+
return Vt[e];
|
|
2802
|
+
}
|
|
2803
|
+
//#endregion
|
|
2804
|
+
//#region src/editor/tool-style-reader.ts
|
|
2805
|
+
function qt(e) {
|
|
2806
|
+
if (e.tagName.toLowerCase() !== "g" || e.getAttribute("data-type") !== "freehand") return e;
|
|
2807
|
+
let t = e.querySelectorAll(":scope > path");
|
|
2808
|
+
return t.length === 0 ? e : t[t.length - 1];
|
|
2809
|
+
}
|
|
2810
|
+
function Jt(e, t) {
|
|
2811
|
+
let n = qt(e), r = n.getAttribute("stroke");
|
|
2812
|
+
r && (t.strokeColor = r);
|
|
2813
|
+
let i = n.getAttribute("fill");
|
|
2814
|
+
i && (t.fillColor = i);
|
|
2815
|
+
let a = Number.parseFloat(n.getAttribute("stroke-width") || "");
|
|
2816
|
+
Number.isFinite(a) && a > 0 && (t.strokeWidth = a);
|
|
2817
|
+
let o = n.getAttribute("data-dash-key") ?? n.getAttribute("stroke-dasharray");
|
|
2818
|
+
o != null && (t.strokeDasharray = o);
|
|
2819
|
+
let s = Number.parseFloat(n.getAttribute("fill-opacity") || "");
|
|
2820
|
+
Number.isFinite(s) && (t.fillOpacity = s);
|
|
2821
|
+
let c = Number.parseFloat(n.getAttribute("opacity") || n.getAttribute("stroke-opacity") || "");
|
|
2822
|
+
Number.isFinite(c) && (t.strokeOpacity = c);
|
|
2823
|
+
let l = n.getAttribute("stroke-linecap");
|
|
2824
|
+
(l === "butt" || l === "round" || l === "square") && (t.strokeLinecap = l);
|
|
2825
|
+
let u = n.getAttribute("stroke-linejoin");
|
|
2826
|
+
(u === "miter" || u === "round" || u === "bevel") && (t.strokeLinejoin = u);
|
|
2827
|
+
}
|
|
2828
|
+
//#endregion
|
|
2829
|
+
//#region src/editor/viewport-math.ts
|
|
2830
|
+
var Yt = .1, Xt = 5, Zt = 40;
|
|
2831
|
+
function Qt(e, t = Yt, n = 5) {
|
|
2832
|
+
return Math.max(t, Math.min(e, n));
|
|
2833
|
+
}
|
|
2834
|
+
function $t(e, t, n, r, i = 40, a = 1) {
|
|
2835
|
+
if (e <= 0 || t <= 0) return 0;
|
|
2836
|
+
let o = n - i, s = r - i;
|
|
2837
|
+
return o <= 0 || s <= 0 ? 0 : Math.min(o / e, s / t, a);
|
|
2838
|
+
}
|
|
2839
|
+
function en(e, t, n) {
|
|
2840
|
+
return {
|
|
2841
|
+
width: Math.round(e * n),
|
|
2842
|
+
height: Math.round(t * n)
|
|
2843
|
+
};
|
|
2844
|
+
}
|
|
2845
|
+
function tn(e, t, n) {
|
|
2846
|
+
let [r, i, a, o, s, c] = e, l = r * o - i * a;
|
|
2847
|
+
if (l === 0) throw Error("applyInverseAffine: matrix is singular");
|
|
2848
|
+
return {
|
|
2849
|
+
x: (o * t - a * n + (a * c - o * s)) / l,
|
|
2850
|
+
y: (-i * t + r * n + (i * s - r * c)) / l
|
|
2851
|
+
};
|
|
2852
|
+
}
|
|
2853
|
+
//#endregion
|
|
2854
|
+
//#region src/icons/types.ts
|
|
2855
|
+
function nn(e) {
|
|
2856
|
+
return {
|
|
2857
|
+
kind: "builtin",
|
|
2858
|
+
id: e
|
|
2859
|
+
};
|
|
2860
|
+
}
|
|
2861
|
+
function rn(e) {
|
|
2862
|
+
return {
|
|
2863
|
+
kind: "svg",
|
|
2864
|
+
svg: e
|
|
2865
|
+
};
|
|
2866
|
+
}
|
|
2867
|
+
function an(e) {
|
|
2868
|
+
return {
|
|
2869
|
+
kind: "url",
|
|
2870
|
+
url: e
|
|
2871
|
+
};
|
|
2872
|
+
}
|
|
2873
|
+
function on(e) {
|
|
2874
|
+
return e.kind === "builtin";
|
|
2875
|
+
}
|
|
2876
|
+
function sn(e) {
|
|
2877
|
+
return e.kind === "svg";
|
|
2878
|
+
}
|
|
2879
|
+
function cn(e) {
|
|
2880
|
+
return e.kind === "url";
|
|
2881
|
+
}
|
|
2882
|
+
//#endregion
|
|
2883
|
+
//#region src/storage/errors.ts
|
|
2884
|
+
var X = class extends Error {
|
|
2885
|
+
code;
|
|
2886
|
+
path;
|
|
2887
|
+
constructor(e, t, n) {
|
|
2888
|
+
super(n), this.name = "StorageError", this.code = e, this.path = t;
|
|
2889
|
+
}
|
|
2890
|
+
}, ln = class extends X {
|
|
2891
|
+
constructor(e, t) {
|
|
2892
|
+
super("conflict", e, t ?? `Path already exists: ${e}`), this.name = "StorageConflictError";
|
|
2893
|
+
}
|
|
2894
|
+
}, un = class extends X {
|
|
2895
|
+
constructor(e, t) {
|
|
2896
|
+
super("not-found", e, t ?? `Path not found: ${e}`), this.name = "StorageNotFoundError";
|
|
2897
|
+
}
|
|
2898
|
+
}, dn = class extends X {
|
|
2899
|
+
constructor(e, t) {
|
|
2900
|
+
super("permission", e, t ?? `Permission denied: ${e}`), this.name = "StoragePermissionError";
|
|
2901
|
+
}
|
|
2902
|
+
}, fn = class extends X {
|
|
2903
|
+
constructor(e, t) {
|
|
2904
|
+
super("quota", e, t ?? `Quota exceeded: ${e}`), this.name = "StorageQuotaError";
|
|
2905
|
+
}
|
|
2906
|
+
}, pn = class extends Error {
|
|
2907
|
+
constructor(e, t) {
|
|
2908
|
+
super(e, t), this.name = "MetadataCacheError";
|
|
2909
|
+
}
|
|
2910
|
+
}, mn = class extends pn {
|
|
2911
|
+
constructor(e = "Metadata cache quota exceeded", t) {
|
|
2912
|
+
super(e, t), this.name = "MetadataCacheQuotaError";
|
|
2913
|
+
}
|
|
2914
|
+
};
|
|
2915
|
+
function hn(e) {
|
|
2916
|
+
let t = e;
|
|
2917
|
+
return typeof t.metadataNamespace == "function" && typeof t.attachMetadataCache == "function";
|
|
2918
|
+
}
|
|
2919
|
+
//#endregion
|
|
2920
|
+
//#region src/storage/path.ts
|
|
2921
|
+
var gn = "", _n = /[<>:"/\\|?*\x00-\x1f]/;
|
|
2922
|
+
function vn(e) {
|
|
2923
|
+
if (!e) throw Error("Name must not be empty");
|
|
2924
|
+
if (e === "." || e === "..") throw Error(`Name "${e}" is reserved`);
|
|
2925
|
+
if (_n.test(e)) throw Error(`Name "${e}" contains invalid characters`);
|
|
2926
|
+
if (e.length > 255) throw Error("Name is too long (max 255 chars)");
|
|
2927
|
+
}
|
|
2928
|
+
function yn(e, t) {
|
|
2929
|
+
if (!t) throw Error("joinPath: name is required");
|
|
2930
|
+
if (t.includes("/")) throw Error(`joinPath: name must not contain "/": "${t}"`);
|
|
2931
|
+
return e ? `${e}/${t}` : t;
|
|
2932
|
+
}
|
|
2933
|
+
function bn(e) {
|
|
2934
|
+
if (!e) return "";
|
|
2935
|
+
let t = e.lastIndexOf("/");
|
|
2936
|
+
return t < 0 ? "" : e.slice(0, t);
|
|
2937
|
+
}
|
|
2938
|
+
function xn(e) {
|
|
2939
|
+
if (!e) return "";
|
|
2940
|
+
let t = e.lastIndexOf("/");
|
|
2941
|
+
return t < 0 ? e : e.slice(t + 1);
|
|
2942
|
+
}
|
|
2943
|
+
function Sn(e) {
|
|
2944
|
+
return e ? e.split("/") : [];
|
|
2945
|
+
}
|
|
2946
|
+
function Cn(e) {
|
|
2947
|
+
let t = Sn(e), n = [], r = "";
|
|
2948
|
+
for (let e = 0; e < t.length - 1; e++) r = r ? `${r}/${t[e]}` : t[e], n.push(r);
|
|
2949
|
+
return n;
|
|
2950
|
+
}
|
|
2951
|
+
function wn(e, t) {
|
|
2952
|
+
return t ? e === t || e.startsWith(`${t}/`) : !0;
|
|
2953
|
+
}
|
|
2954
|
+
function Tn(e) {
|
|
2955
|
+
let t = e.lastIndexOf(".");
|
|
2956
|
+
return t <= 0 ? [e, ""] : [e.slice(0, t), e.slice(t)];
|
|
2957
|
+
}
|
|
2958
|
+
function En(e, t) {
|
|
2959
|
+
if (!t(e)) return e;
|
|
2960
|
+
let [n, r] = Tn(e);
|
|
2961
|
+
for (let e = 2; e < 1e4; e++) {
|
|
2962
|
+
let i = `${n} (${e})${r}`;
|
|
2963
|
+
if (!t(i)) return i;
|
|
2964
|
+
}
|
|
2965
|
+
throw Error(`Could not find unique name for "${e}"`);
|
|
2966
|
+
}
|
|
2967
|
+
async function Dn(e, t) {
|
|
2968
|
+
if (!await t(e)) return e;
|
|
2969
|
+
let [n, r] = Tn(e);
|
|
2970
|
+
for (let e = 2; e < 1e4; e++) {
|
|
2971
|
+
let i = `${n} (${e})${r}`;
|
|
2972
|
+
if (!await t(i)) return i;
|
|
2973
|
+
}
|
|
2974
|
+
throw Error(`Could not find unique name for "${e}"`);
|
|
2975
|
+
}
|
|
2976
|
+
function On(e, t, n) {
|
|
2977
|
+
return e === t ? n : t && e.startsWith(`${t}/`) ? n ? n + e.slice(t.length) : e.slice(t.length + 1) : t ? e : n ? `${n}/${e}` : e;
|
|
2978
|
+
}
|
|
2979
|
+
//#endregion
|
|
2980
|
+
//#region src/storage/thumbnail-cache.ts
|
|
2981
|
+
var kn = class extends Error {
|
|
2982
|
+
constructor(e, t) {
|
|
2983
|
+
super(e, t), this.name = "ThumbnailCacheError";
|
|
2984
|
+
}
|
|
2985
|
+
}, An = class extends kn {
|
|
2986
|
+
constructor(e = "Thumbnail cache quota exceeded", t) {
|
|
2987
|
+
super(e, t), this.name = "ThumbnailCacheQuotaError";
|
|
2988
|
+
}
|
|
2989
|
+
};
|
|
2990
|
+
//#endregion
|
|
2991
|
+
//#region src/storage/types.ts
|
|
2992
|
+
function jn(e) {
|
|
2993
|
+
return typeof e.resync == "function";
|
|
2994
|
+
}
|
|
2995
|
+
function Mn(e) {
|
|
2996
|
+
return typeof e.forceRefresh == "function";
|
|
2997
|
+
}
|
|
2998
|
+
function Nn(e) {
|
|
2999
|
+
return typeof e.setTokenRefresher == "function" && typeof e.setToken == "function";
|
|
3000
|
+
}
|
|
3001
|
+
function Pn(e) {
|
|
3002
|
+
return typeof e.init == "function";
|
|
3003
|
+
}
|
|
3004
|
+
function Fn(e) {
|
|
3005
|
+
return typeof e.getRateLimit == "function" && typeof e.setRateLimitListener == "function";
|
|
3006
|
+
}
|
|
3007
|
+
function In(e) {
|
|
3008
|
+
let t = e;
|
|
3009
|
+
return typeof t.saveDocument == "function" && typeof t.getDocument == "function" && typeof t.listDocuments == "function" && typeof t.updateDocument == "function";
|
|
3010
|
+
}
|
|
3011
|
+
//#endregion
|
|
3012
|
+
//#region src/utils/assert.ts
|
|
3013
|
+
function Ln(e, t) {
|
|
3014
|
+
if (e == null) throw Error(`Assertion failed: ${t}`);
|
|
3015
|
+
return e;
|
|
3016
|
+
}
|
|
3017
|
+
//#endregion
|
|
3018
|
+
//#region src/utils/constants.ts
|
|
3019
|
+
var Rn = .9, zn = "#ff0000", Bn = "none", Vn = 3, Hn = 24, Un = 10, Wn = "annot";
|
|
3020
|
+
function Z(e, t = 2) {
|
|
3021
|
+
return String(e).padStart(t, "0");
|
|
3022
|
+
}
|
|
3023
|
+
function Gn(e = /* @__PURE__ */ new Date()) {
|
|
3024
|
+
return `${e.getFullYear()}${Z(e.getMonth() + 1)}${Z(e.getDate())}-${Z(e.getHours())}${Z(e.getMinutes())}${Z(e.getSeconds())}-${Z(e.getMilliseconds(), 3)}`;
|
|
3025
|
+
}
|
|
3026
|
+
function Kn(e = /* @__PURE__ */ new Date()) {
|
|
3027
|
+
return `${Wn}-${Gn(e)}`;
|
|
3028
|
+
}
|
|
3029
|
+
function qn(e, t = /* @__PURE__ */ new Date()) {
|
|
3030
|
+
let n = e.startsWith("data:image/jpeg") ? "jpg" : "png";
|
|
3031
|
+
return `${Kn(t)}.annot.${n}`;
|
|
3032
|
+
}
|
|
3033
|
+
//#endregion
|
|
3034
|
+
//#region src/utils/id.ts
|
|
3035
|
+
var Jn = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
3036
|
+
function Yn(e = Date.now()) {
|
|
3037
|
+
let t = new Uint8Array(16), n = Math.floor(e / 4294967296), r = e >>> 0;
|
|
3038
|
+
return t[0] = n >>> 8 & 255, t[1] = n & 255, t[2] = r >>> 24 & 255, t[3] = r >>> 16 & 255, t[4] = r >>> 8 & 255, t[5] = r & 255, crypto.getRandomValues(t.subarray(6)), t[6] = t[6] & 15 | 112, t[8] = t[8] & 63 | 128, t;
|
|
3039
|
+
}
|
|
3040
|
+
function Xn(e) {
|
|
3041
|
+
let t = 0;
|
|
3042
|
+
for (; t < e.length && e[t] === 0;) t++;
|
|
3043
|
+
let n = Array.from(e), r = [], i = t;
|
|
3044
|
+
for (; i < n.length;) {
|
|
3045
|
+
let e = 0;
|
|
3046
|
+
for (let t = i; t < n.length; t++) {
|
|
3047
|
+
let r = (n[t] & 255) + e * 256;
|
|
3048
|
+
n[t] = Math.floor(r / 58), e = r % 58;
|
|
3049
|
+
}
|
|
3050
|
+
for (; i < n.length && n[i] === 0;) i++;
|
|
3051
|
+
r.push(e);
|
|
3052
|
+
}
|
|
3053
|
+
let a = "";
|
|
3054
|
+
for (let e = 0; e < t; e++) a += Jn[0];
|
|
3055
|
+
for (let e = r.length - 1; e >= 0; e--) a += Jn[r[e]];
|
|
3056
|
+
return a;
|
|
3057
|
+
}
|
|
3058
|
+
function Zn() {
|
|
3059
|
+
return Xn(Yn());
|
|
3060
|
+
}
|
|
3061
|
+
//#endregion
|
|
3062
|
+
//#region src/zip/zip-bytes.ts
|
|
3063
|
+
var Qn = new TextEncoder();
|
|
3064
|
+
function $n(e) {
|
|
3065
|
+
let t = 4294967295;
|
|
3066
|
+
for (let n = 0; n < e.length; n++) {
|
|
3067
|
+
t ^= e[n];
|
|
3068
|
+
for (let e = 0; e < 8; e++) t = t >>> 1 ^ (t & 1 ? 3988292384 : 0);
|
|
3069
|
+
}
|
|
3070
|
+
return (t ^ 4294967295) >>> 0;
|
|
3071
|
+
}
|
|
3072
|
+
function Q(e) {
|
|
3073
|
+
return new Uint8Array([e & 255, e >> 8 & 255]);
|
|
3074
|
+
}
|
|
3075
|
+
function $(e) {
|
|
3076
|
+
return new Uint8Array([
|
|
3077
|
+
e & 255,
|
|
3078
|
+
e >> 8 & 255,
|
|
3079
|
+
e >> 16 & 255,
|
|
3080
|
+
e >> 24 & 255
|
|
3081
|
+
]);
|
|
3082
|
+
}
|
|
3083
|
+
function er(e) {
|
|
3084
|
+
let t = [], n = [], r = 0;
|
|
3085
|
+
for (let i of e) {
|
|
3086
|
+
let e = Qn.encode(i.name), a = $n(i.data), o = i.data.length, s = new Uint8Array([
|
|
3087
|
+
80,
|
|
3088
|
+
75,
|
|
3089
|
+
3,
|
|
3090
|
+
4,
|
|
3091
|
+
...Q(20),
|
|
3092
|
+
...Q(0),
|
|
3093
|
+
...Q(0),
|
|
3094
|
+
...Q(0),
|
|
3095
|
+
...Q(0),
|
|
3096
|
+
...$(a),
|
|
3097
|
+
...$(o),
|
|
3098
|
+
...$(o),
|
|
3099
|
+
...Q(e.length),
|
|
3100
|
+
...Q(0)
|
|
3101
|
+
]);
|
|
3102
|
+
t.push(s, e, i.data);
|
|
3103
|
+
let c = new Uint8Array([
|
|
3104
|
+
80,
|
|
3105
|
+
75,
|
|
3106
|
+
1,
|
|
3107
|
+
2,
|
|
3108
|
+
...Q(20),
|
|
3109
|
+
...Q(20),
|
|
3110
|
+
...Q(0),
|
|
3111
|
+
...Q(0),
|
|
3112
|
+
...Q(0),
|
|
3113
|
+
...Q(0),
|
|
3114
|
+
...$(a),
|
|
3115
|
+
...$(o),
|
|
3116
|
+
...$(o),
|
|
3117
|
+
...Q(e.length),
|
|
3118
|
+
...Q(0),
|
|
3119
|
+
...Q(0),
|
|
3120
|
+
...Q(0),
|
|
3121
|
+
...Q(0),
|
|
3122
|
+
...$(0),
|
|
3123
|
+
...$(r)
|
|
3124
|
+
]);
|
|
3125
|
+
n.push(c, e), r += s.length + e.length + i.data.length;
|
|
3126
|
+
}
|
|
3127
|
+
let i = r, a = 0;
|
|
3128
|
+
for (let e of n) a += e.length;
|
|
3129
|
+
let o = new Uint8Array([
|
|
3130
|
+
80,
|
|
3131
|
+
75,
|
|
3132
|
+
5,
|
|
3133
|
+
6,
|
|
3134
|
+
...Q(0),
|
|
3135
|
+
...Q(0),
|
|
3136
|
+
...Q(e.length),
|
|
3137
|
+
...Q(e.length),
|
|
3138
|
+
...$(a),
|
|
3139
|
+
...$(i),
|
|
3140
|
+
...Q(0)
|
|
3141
|
+
]), s = o.length;
|
|
3142
|
+
for (let e of t) s += e.length;
|
|
3143
|
+
for (let e of n) s += e.length;
|
|
3144
|
+
let c = new Uint8Array(s), l = 0;
|
|
3145
|
+
for (let e of t) c.set(e, l), l += e.length;
|
|
3146
|
+
for (let e of n) c.set(e, l), l += e.length;
|
|
3147
|
+
return c.set(o, l), c;
|
|
3148
|
+
}
|
|
3149
|
+
//#endregion
|
|
3150
|
+
//#region src/zip/zip-builder.ts
|
|
3151
|
+
function tr(e) {
|
|
3152
|
+
let t = er(e);
|
|
3153
|
+
return new Blob([t], { type: "application/zip" });
|
|
3154
|
+
}
|
|
3155
|
+
function nr(e) {
|
|
3156
|
+
let t = e.split(",")[1] || "", n = atob(t), r = new Uint8Array(n.length);
|
|
3157
|
+
for (let e = 0; e < n.length; e++) r[e] = n.charCodeAt(e);
|
|
3158
|
+
return r;
|
|
3159
|
+
}
|
|
3160
|
+
function rr(e) {
|
|
3161
|
+
return e.startsWith("data:image/png") ? "png" : "jpg";
|
|
3162
|
+
}
|
|
3163
|
+
//#endregion
|
|
3164
|
+
export { Wn as ANNOT_FILENAME_PREFIX, gt as ANNOT_SVG_VERSION, vt as ANNOT_SVG_VERSION_ATTR, _t as ANNOT_SVG_VERSION_UNSTAMPED, g as BUILTIN_ICONS, _ as BUILTIN_ICON_IDS, Xe as CATEGORY_CONTROL_SHAPE, Bn as DEFAULT_FILL_COLOR, Hn as DEFAULT_FONT_SIZE, s as DEFAULT_HISTORY_DEPTH, Xt as DEFAULT_MAX_ZOOM, Yt as DEFAULT_MIN_ZOOM, zn as DEFAULT_STROKE_COLOR, Vn as DEFAULT_STROKE_WIDTH, Zt as FIT_VIEW_PADDING, Rn as JPEG_QUALITY, e as LOGICAL_FAMILIES, Un as MOSAIC_BLOCK_SIZE, pn as MetadataCacheError, mn as MetadataCacheQuotaError, st as PROPERTY_CONTROLS, V as PROPERTY_CONTROL_IDS, H as PROPERTY_EFFECT_IDS, gn as ROOT_PATH, ln as StorageConflictError, X as StorageError, un as StorageNotFoundError, dn as StoragePermissionError, fn as StorageQuotaError, Lt as TOOL_PANEL_ADAPTERS, zt as TOOL_PANEL_ADAPTER_IDS, Ct as TOOL_PANEL_EXTRA_CONTROL_IDS, Dt as TOOL_REGISTRY, Ot as TOOL_REGISTRY_IDS, kn as ThumbnailCacheError, An as ThumbnailCacheQuotaError, Cn as ancestorPaths, tn as applyInverseAffine, Ln as assertNonNull, tr as buildZip, nn as builtinIcon, Qt as clampZoom, ct as classifyPropertyElement, ut as classifyPropertySelection, o as coerceToLogicalFamily, k as computeDasharray, $t as computeFitZoom, en as computeRenderedSize, ht as computeSnap, c as createHistoryCore, St as createMockToolSurface, r as cssStackFor, pt as cursorForAngle, rr as dataUrlExt, nr as dataUrlToBytes, Kn as defaultAnnotFilenameStem, qn as defaultAnnotImageFilename, A as detectDashKey, Kt as fieldForSnakeKey, Gn as formatLocalTimestamp, xt as getAnnotVersionFromString, xn as getFilename, bn as getParentPath, on as isBuiltinIcon, wn as isDescendantOrSame, a as isLogicalFamily, sn as isSvgIcon, cn as isUrlIcon, yn as joinPath, Zn as newIdB58, Et as normalizeVariantSideFields, i as ooxmlTypefacesFor, Gt as presetFromWire, Wt as presetToWire, bt as readAnnotVersion, Jt as readUniversalStyleAttrs, re as renderIconElement, ne as renderIconHtml, v as resolveBuiltinIcon, qt as resolveStyleReadSource, On as rewritePathPrefix, dt as rotateAround, T as sanitizeIconSvg, Rt as selectionDefMetadata, Tn as splitExt, Sn as splitPath, yt as stampAnnotVersion, In as supportsDocuments, Mn as supportsForceRefresh, Pn as supportsInit, hn as supportsMetadataCache, Fn as supportsRateLimit, jn as supportsResync, Nn as supportsTokenRefresher, rn as svgIcon, ce as translatePathD, En as uniquifyFilename, Dn as uniquifyFilenameAsync, an as urlIcon, vn as validateName, J as writeUniversalStyleAttrs };
|