@emailmaker/filemanager 1.1.95 → 1.1.102
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/.build-meta.json +1 -1
- package/assets/icon-sets/lucide.json +6275 -0
- package/assets/icon-sets/tabler.json +19336 -0
- package/components/FilerobotEditor/FilerobotEditor.d.ts +1 -0
- package/components/FilerobotEditor/cornerRadius/CornerRadiusTool.d.ts +22 -0
- package/components/FilerobotEditor/cornerRadius/__tests__/cornerRadiusMath.test.d.ts +1 -0
- package/components/FilerobotEditor/cornerRadius/__tests__/cornerRadiusOutput.test.d.ts +1 -0
- package/components/FilerobotEditor/cornerRadius/__tests__/imageEditorTools.test.d.ts +1 -0
- package/components/FilerobotEditor/cornerRadius/cornerRadiusEraser.d.ts +17 -0
- package/components/FilerobotEditor/cornerRadius/cornerRadiusMath.d.ts +38 -0
- package/components/FilerobotEditor/cornerRadius/cornerRadiusOutput.d.ts +18 -0
- package/components/FilerobotEditor/cornerRadius/imageEditorTools.d.ts +11 -0
- package/components/FilerobotEditor/cornerRadius/useCornerRadiusSync.d.ts +23 -0
- package/components/ImageIcons/iconSets.d.ts +38 -0
- package/components/ImageIcons/iconSets.test.d.ts +1 -0
- package/components/ImageIcons/iconStockSearch.d.ts +3 -1
- package/components/ImageIcons/packagedIconSets.d.ts +9 -0
- package/core.d.ts +1 -0
- package/core.esm.js +272 -259
- package/core.js +1 -1
- package/file-manager-FilerobotEditor.js +576 -0
- package/file-manager-IconsTab.js +2083 -0
- package/{file-manager-ImageCodeGenerator-m06RVQr7.js → file-manager-ImageCodeGenerator.js} +8 -8
- package/{file-manager-JsBarcode-CyaffT5b.js → file-manager-JsBarcode.js} +30 -30
- package/{file-manager-browser-DDyRNDQk.js → file-manager-browser.js} +8 -8
- package/{file-manager-hooks-UP2zpv8z.js → file-manager-hooks-BDRRCedE.js} +4792 -2384
- package/file-manager-imageEditorCropPresets-en0_jYEY.js +76 -0
- package/{file-manager-rolldown-runtime-DAVfCfog.js → file-manager-rolldown-runtime-DawGUBAG.js} +2 -2
- package/{file-manager-useMediaListEngine-B9sz3gcs.js → file-manager-urls-rCuqY9r4.js} +139 -119
- package/file-manager.esm.js +2332 -2277
- package/file-manager.js +12 -12
- package/helpers/__tests__/applyImageEditorTranslations.test.d.ts +1 -0
- package/helpers/__tests__/imageEditorCropPresets.test.d.ts +1 -0
- package/helpers/__tests__/locales.test.d.ts +1 -0
- package/helpers/applyImageEditorTranslations.d.ts +6 -0
- package/helpers/imageEditorCropPresets.d.ts +8 -0
- package/index.d.ts +2 -0
- package/package.json +5 -1
- package/types.d.ts +18 -0
- package/utils/filerobotEditorConfig.d.ts +1 -0
- package/utils/generateId.d.ts +5 -0
- package/utils/imageCompression.d.ts +10 -0
- package/utils/imageCompression.editedImage.test.d.ts +1 -0
- package/utils/imageCompression.png.test.d.ts +1 -0
- package/utils/pngCompression.d.ts +23 -0
- package/utils/pngCompression.test.d.ts +1 -0
- package/file-manager-FilerobotEditor-WbM5WTct.js +0 -330
- package/file-manager-IconsTab-CCn0Q0ng.js +0 -2434
- package/file-manager-imageEditorTranslations-CtNVql-A.js +0 -38
|
@@ -0,0 +1,2083 @@
|
|
|
1
|
+
import { C as e, I as t, L as n, S as r, U as i, V as a, b as o, it as s, j as c, rt as l, t as u, tt as d, x as f } from "./file-manager-hooks-BDRRCedE.js";
|
|
2
|
+
import { a as p, i as m, l as h, o as g, s as _, t as v, u as y } from "./file-manager-urls-rCuqY9r4.js";
|
|
3
|
+
import b from "react";
|
|
4
|
+
import { Button as x, Checkbox as ee, ColorPicker as S, Divider as te, Form as C, Input as w, InputNumber as T, Modal as ne, Space as E, Spin as re, Typography as ie } from "antd";
|
|
5
|
+
import { Fragment as ae, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
6
|
+
import { LoadingOutlined as oe } from "@ant-design/icons";
|
|
7
|
+
import { FolderPlus as se } from "@untitledui/icons/FolderPlus";
|
|
8
|
+
import { Copy04 as ce } from "@untitledui/icons/Copy04";
|
|
9
|
+
import { Scale01 as le } from "@untitledui/icons/Scale01";
|
|
10
|
+
import { SearchMd as ue } from "@untitledui/icons/SearchMd";
|
|
11
|
+
var k = {
|
|
12
|
+
"em-filemanager": "em-filemanager",
|
|
13
|
+
emFilemanager: "em-filemanager",
|
|
14
|
+
iconsTab: "iconsTab",
|
|
15
|
+
hasSearch: "hasSearch",
|
|
16
|
+
iconsSearchWrapper: "iconsSearchWrapper",
|
|
17
|
+
iconsSearchForm: "iconsSearchForm",
|
|
18
|
+
iconsSearchFormCenteredContainer: "iconsSearchFormCenteredContainer",
|
|
19
|
+
iconsSearchFormCentered: "iconsSearchFormCentered",
|
|
20
|
+
iconsSearchFormInput: "iconsSearchFormInput",
|
|
21
|
+
iconsSearchFormInputInput: "iconsSearchFormInputInput",
|
|
22
|
+
iconsSearchResults: "iconsSearchResults",
|
|
23
|
+
iconsControlsControls: "iconsControlsControls",
|
|
24
|
+
iconsControls: "iconsControls",
|
|
25
|
+
iconsControlsFamilySlug: "iconsControlsFamilySlug",
|
|
26
|
+
iconsControlElement: "iconsControlElement",
|
|
27
|
+
iconsControlsNumField: "iconsControlsNumField",
|
|
28
|
+
iconsControlsNumLabel: "iconsControlsNumLabel",
|
|
29
|
+
iconsControlsNumInput: "iconsControlsNumInput",
|
|
30
|
+
iconsControlsNumSuffix: "iconsControlsNumSuffix",
|
|
31
|
+
iconsControlsCompact: "iconsControlsCompact",
|
|
32
|
+
iconsControlsInputNumber: "iconsControlsInputNumber",
|
|
33
|
+
iconsControlsDropdownBtn: "iconsControlsDropdownBtn",
|
|
34
|
+
sliderDropdown: "sliderDropdown",
|
|
35
|
+
iconsControlsHeader: "iconsControlsHeader",
|
|
36
|
+
iconsSearchFormSelect: "iconsSearchFormSelect",
|
|
37
|
+
iconsSearchFormStyleItem: "iconsSearchFormStyleItem",
|
|
38
|
+
fadeInSlide: "fadeInSlide",
|
|
39
|
+
iconsSearchDivider: "iconsSearchDivider",
|
|
40
|
+
iconsSearchFormInputIcon: "iconsSearchFormInputIcon",
|
|
41
|
+
iconsGrid: "iconsGrid",
|
|
42
|
+
iconsBottomBar: "iconsBottomBar",
|
|
43
|
+
iconsBottomBarContent: "iconsBottomBarContent",
|
|
44
|
+
iconsGridEmpty: "iconsGridEmpty",
|
|
45
|
+
iconsGridEmptyState: "iconsGridEmptyState",
|
|
46
|
+
resultsContainer: "resultsContainer",
|
|
47
|
+
playButton: "playButton",
|
|
48
|
+
title: "title",
|
|
49
|
+
subtitle: "subtitle",
|
|
50
|
+
iconsGridInfiniteScroll: "iconsGridInfiniteScroll",
|
|
51
|
+
iconsGridLoadingMore: "iconsGridLoadingMore",
|
|
52
|
+
iconsGridGrid: "iconsGridGrid",
|
|
53
|
+
iconsGridVirtualCanvas: "iconsGridVirtualCanvas",
|
|
54
|
+
iconsGridItem: "iconsGridItem",
|
|
55
|
+
iconsGridItemThumbnail: "iconsGridItemThumbnail",
|
|
56
|
+
iconsGridItemSvg: "iconsGridItemSvg",
|
|
57
|
+
iconsGridItemImg: "iconsGridItemImg",
|
|
58
|
+
iconsGridItemName: "iconsGridItemName",
|
|
59
|
+
iconsGridItemSelected: "iconsGridItemSelected",
|
|
60
|
+
iconsGridItemInsertButton: "iconsGridItemInsertButton",
|
|
61
|
+
iconsGridLoading: "iconsGridLoading",
|
|
62
|
+
iconsControlsBackButton: "iconsControlsBackButton",
|
|
63
|
+
iconsGridCheckbox: "iconsGridCheckbox",
|
|
64
|
+
iconsGridShowCheckboxes: "iconsGridShowCheckboxes",
|
|
65
|
+
iconsHeaderContainer: "iconsHeaderContainer",
|
|
66
|
+
iconsHeaderContainerLeft: "iconsHeaderContainerLeft",
|
|
67
|
+
iconsHeaderDivider: "iconsHeaderDivider",
|
|
68
|
+
copyToFolderModalBody: "copyToFolderModalBody",
|
|
69
|
+
copyToFolderModalLoadingOverlay: "copyToFolderModalLoadingOverlay"
|
|
70
|
+
}, de = ({ query: e, onQueryChange: t, onSubmit: n, hasResults: r = !1, inputRef: i }) => {
|
|
71
|
+
let { t: o } = d(), { options: s } = a(), { config: c } = s, l = e.length > 0 && r;
|
|
72
|
+
return /* @__PURE__ */ O("div", {
|
|
73
|
+
className: k.iconsSearchFormCenteredContainer,
|
|
74
|
+
children: [/* @__PURE__ */ D(C, {
|
|
75
|
+
layout: "inline",
|
|
76
|
+
onFinish: n,
|
|
77
|
+
className: l ? k.iconsSearchResults : k.iconsSearchFormCentered,
|
|
78
|
+
children: /* @__PURE__ */ D(C.Item, {
|
|
79
|
+
className: k.iconsSearchFormInput,
|
|
80
|
+
children: /* @__PURE__ */ D(w, {
|
|
81
|
+
ref: i,
|
|
82
|
+
className: k.iconsSearchFormInputInput,
|
|
83
|
+
allowClear: !0,
|
|
84
|
+
prefix: /* @__PURE__ */ D(ue, {
|
|
85
|
+
size: 16,
|
|
86
|
+
strokeWidth: c?.iconStrokeWidth,
|
|
87
|
+
onClick: n
|
|
88
|
+
}),
|
|
89
|
+
placeholder: o("Search icons"),
|
|
90
|
+
value: e,
|
|
91
|
+
onChange: (e) => t(e.target.value),
|
|
92
|
+
onKeyDown: (e) => e.code === "Space" && n(),
|
|
93
|
+
onPressEnter: n,
|
|
94
|
+
spellCheck: "false"
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
}), l && /* @__PURE__ */ D("div", {
|
|
98
|
+
className: `ant-divider ${k.iconsSearchDivider}`,
|
|
99
|
+
role: "separator"
|
|
100
|
+
})]
|
|
101
|
+
});
|
|
102
|
+
}, fe = (e) => {
|
|
103
|
+
let { t } = d(), { colorHex: n, setColorHex: r, colorHex2: i, setColorHex2: a, colorHex3: o, setColorHex3: s, sizePx: c, setSizePx: l, strokeWidth: u, setStrokeWidth: f, showSecondColor: p, showThirdColor: m } = e;
|
|
104
|
+
return /* @__PURE__ */ D("div", {
|
|
105
|
+
className: k.iconsControls,
|
|
106
|
+
children: /* @__PURE__ */ O("div", {
|
|
107
|
+
className: k.iconsControlsControls,
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ O("div", {
|
|
110
|
+
className: k.iconsControlsNumField,
|
|
111
|
+
children: [/* @__PURE__ */ D(ie.Text, {
|
|
112
|
+
type: "secondary",
|
|
113
|
+
className: k.iconsControlsNumLabel,
|
|
114
|
+
children: t("Size")
|
|
115
|
+
}), /* @__PURE__ */ D(T, {
|
|
116
|
+
className: k.iconsControlsNumInput,
|
|
117
|
+
min: 20,
|
|
118
|
+
max: 200,
|
|
119
|
+
step: 1,
|
|
120
|
+
value: c,
|
|
121
|
+
suffix: /* @__PURE__ */ D("span", {
|
|
122
|
+
className: k.iconsControlsNumSuffix,
|
|
123
|
+
children: "px"
|
|
124
|
+
}),
|
|
125
|
+
onChange: (e) => l(typeof e == "number" && !Number.isNaN(e) ? e : 50),
|
|
126
|
+
"aria-label": t("Size")
|
|
127
|
+
})]
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ O("div", {
|
|
130
|
+
className: k.iconsControlsNumField,
|
|
131
|
+
children: [/* @__PURE__ */ D(ie.Text, {
|
|
132
|
+
type: "secondary",
|
|
133
|
+
className: k.iconsControlsNumLabel,
|
|
134
|
+
children: t("Stroke width")
|
|
135
|
+
}), /* @__PURE__ */ D(T, {
|
|
136
|
+
className: k.iconsControlsNumInput,
|
|
137
|
+
min: .3,
|
|
138
|
+
max: 3,
|
|
139
|
+
step: .1,
|
|
140
|
+
value: typeof u == "number" ? u : 1,
|
|
141
|
+
suffix: /* @__PURE__ */ D("span", {
|
|
142
|
+
className: k.iconsControlsNumSuffix,
|
|
143
|
+
children: "px"
|
|
144
|
+
}),
|
|
145
|
+
onChange: (e) => f(typeof e == "number" && !Number.isNaN(e) ? e : 1),
|
|
146
|
+
"aria-label": t("Stroke width")
|
|
147
|
+
})]
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ O(E, {
|
|
150
|
+
size: 8,
|
|
151
|
+
children: [
|
|
152
|
+
/* @__PURE__ */ O("div", {
|
|
153
|
+
className: k.iconsControlElement,
|
|
154
|
+
children: [/* @__PURE__ */ D("span", { children: t("Color1") }), /* @__PURE__ */ D(S, {
|
|
155
|
+
value: n,
|
|
156
|
+
format: "hex",
|
|
157
|
+
disabledAlpha: !0,
|
|
158
|
+
showText: !0,
|
|
159
|
+
onChange: (e, t) => {
|
|
160
|
+
let n = typeof e == "string" ? e : e?.toHexString ? e.toHexString() : t;
|
|
161
|
+
r(n);
|
|
162
|
+
},
|
|
163
|
+
size: "middle"
|
|
164
|
+
})]
|
|
165
|
+
}),
|
|
166
|
+
p && /* @__PURE__ */ O("div", {
|
|
167
|
+
className: k.iconsControlElement,
|
|
168
|
+
children: [/* @__PURE__ */ D("span", { children: t("Color2") }), /* @__PURE__ */ D(S, {
|
|
169
|
+
value: i,
|
|
170
|
+
format: "hex",
|
|
171
|
+
disabledAlpha: !0,
|
|
172
|
+
showText: !0,
|
|
173
|
+
onChange: (e, t) => {
|
|
174
|
+
let n = typeof e == "string" ? e : e?.toHexString ? e.toHexString() : t;
|
|
175
|
+
a(n);
|
|
176
|
+
},
|
|
177
|
+
size: "middle"
|
|
178
|
+
})]
|
|
179
|
+
}),
|
|
180
|
+
m && /* @__PURE__ */ O("div", {
|
|
181
|
+
className: k.iconsControlElement,
|
|
182
|
+
children: [/* @__PURE__ */ D("span", { children: t("Color3") }), /* @__PURE__ */ D(S, {
|
|
183
|
+
value: o,
|
|
184
|
+
format: "hex",
|
|
185
|
+
disabledAlpha: !0,
|
|
186
|
+
showText: !0,
|
|
187
|
+
onChange: (e, t) => {
|
|
188
|
+
let n = typeof e == "string" ? e : e?.toHexString ? e.toHexString() : t;
|
|
189
|
+
s(n);
|
|
190
|
+
},
|
|
191
|
+
size: "middle"
|
|
192
|
+
})]
|
|
193
|
+
})
|
|
194
|
+
]
|
|
195
|
+
})
|
|
196
|
+
]
|
|
197
|
+
})
|
|
198
|
+
});
|
|
199
|
+
}, pe = /* @__PURE__ */ D(oe, {
|
|
200
|
+
style: { fontSize: 20 },
|
|
201
|
+
spin: !0
|
|
202
|
+
}), me = 240, A = 160, he = 56, ge = ({ items: e, loading: t, isCollectingResults: n = !1, hasMore: r = !1, hasQuery: i, selectedHash: a, onItemClick: o, onInsert: s, onLoadMore: c, colorVars: l, svgTextMap: f, previewSize: p, selectedHashes: g, onToggleSelect: _ }) => {
|
|
203
|
+
let { t: v } = d(), { ThumbsUpIcon: x } = y(), S = !!(g && g.size > 0), te = b.useRef(null), { positionedItems: C, containerHeight: w, isNearEnd: T, handleViewportChange: ne } = m({
|
|
204
|
+
items: e,
|
|
205
|
+
getId: (e) => e.hash,
|
|
206
|
+
getPreviewSrc: () => void 0,
|
|
207
|
+
getAltText: (e) => e.name,
|
|
208
|
+
layoutMode: "grid",
|
|
209
|
+
minColumnWidth: A,
|
|
210
|
+
estimatedItemHeight: (p ?? 50) + he,
|
|
211
|
+
gap: 16,
|
|
212
|
+
prefetchThresholdPx: me
|
|
213
|
+
}), E = u(ne, [e.length, p ?? 50]);
|
|
214
|
+
b.useEffect(() => {
|
|
215
|
+
r || (te.current = null);
|
|
216
|
+
}, [r, e.length]), b.useEffect(() => {
|
|
217
|
+
if (!t && !n && r && e.length > 0 && T) {
|
|
218
|
+
if (te.current === e.length) return;
|
|
219
|
+
te.current = e.length, c?.();
|
|
220
|
+
}
|
|
221
|
+
}, [
|
|
222
|
+
r,
|
|
223
|
+
n,
|
|
224
|
+
T,
|
|
225
|
+
e.length,
|
|
226
|
+
t,
|
|
227
|
+
c
|
|
228
|
+
]);
|
|
229
|
+
let ie = i ? /* @__PURE__ */ D("div", {
|
|
230
|
+
className: k.iconsGridEmptyState,
|
|
231
|
+
children: /* @__PURE__ */ D(h, {})
|
|
232
|
+
}) : /* @__PURE__ */ D("div", {
|
|
233
|
+
className: k.iconsGridEmptyState,
|
|
234
|
+
children: /* @__PURE__ */ O("div", {
|
|
235
|
+
className: k.resultsContainer,
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ D("span", {
|
|
238
|
+
className: k.videoIcon,
|
|
239
|
+
children: /* @__PURE__ */ D(x, {
|
|
240
|
+
className: k.playButton,
|
|
241
|
+
style: {
|
|
242
|
+
width: 48,
|
|
243
|
+
height: 49,
|
|
244
|
+
marginBottom: 10
|
|
245
|
+
}
|
|
246
|
+
})
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ D("h1", {
|
|
249
|
+
className: k.title,
|
|
250
|
+
children: v("Thousands of icons")
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ D("p", {
|
|
253
|
+
className: k.subtitle,
|
|
254
|
+
children: v("Enter a search query and we'll find the perfect icon for you")
|
|
255
|
+
})
|
|
256
|
+
]
|
|
257
|
+
})
|
|
258
|
+
});
|
|
259
|
+
return /* @__PURE__ */ O("div", {
|
|
260
|
+
id: "iconsScrollableDiv",
|
|
261
|
+
ref: E,
|
|
262
|
+
className: k.iconsGrid,
|
|
263
|
+
children: [e.length === 0 && !t ? ie : /* @__PURE__ */ O(ae, { children: [/* @__PURE__ */ D("div", {
|
|
264
|
+
className: k.iconsGridVirtualCanvas,
|
|
265
|
+
style: { height: w },
|
|
266
|
+
children: C.map(({ row: e, layout: t }) => {
|
|
267
|
+
let n = e.item, r = !!(g && g.has(n.hash) || a === n.hash), i = f[n.hash];
|
|
268
|
+
return /* @__PURE__ */ O("div", {
|
|
269
|
+
style: {
|
|
270
|
+
position: "absolute",
|
|
271
|
+
top: t.top,
|
|
272
|
+
left: t.left,
|
|
273
|
+
width: t.width,
|
|
274
|
+
height: t.height
|
|
275
|
+
},
|
|
276
|
+
className: `${k.iconsGridItem} ${r ? k.iconsGridItemSelected : ""} ${S ? k.iconsGridShowCheckboxes : ""}`,
|
|
277
|
+
onClick: () => o(n),
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ D("div", {
|
|
280
|
+
style: { height: p ?? 50 },
|
|
281
|
+
className: k.iconsGridItemThumbnail,
|
|
282
|
+
children: i ? /* @__PURE__ */ D("div", {
|
|
283
|
+
style: {
|
|
284
|
+
color: l?.colorHex,
|
|
285
|
+
"--em-icon-grad-1": l?.colorHex ?? "#000",
|
|
286
|
+
"--em-icon-grad-2": l?.colorHex2 ?? "#ff007a",
|
|
287
|
+
"--em-icon-color-1": l?.colorHex ?? "#000",
|
|
288
|
+
"--em-icon-color-2": l?.colorHex2 ?? "#ff007a",
|
|
289
|
+
"--em-icon-color-3": l?.colorHex3 ?? "#00C2FF",
|
|
290
|
+
"--em-icon-stroke-1": l?.colorHex ?? "#000",
|
|
291
|
+
"--em-icon-stroke-2": l?.colorHex2 ?? "#ff007a",
|
|
292
|
+
"--em-icon-stroke-3": l?.colorHex3 ?? "#00C2FF",
|
|
293
|
+
"--em-icon-fill-1": l?.colorHex ?? "#000",
|
|
294
|
+
"--em-icon-fill-2": l?.colorHex2 ?? "#ff007a",
|
|
295
|
+
"--em-icon-fill-3": l?.colorHex3 ?? "#00C2FF"
|
|
296
|
+
},
|
|
297
|
+
dangerouslySetInnerHTML: { __html: i },
|
|
298
|
+
className: k.iconsGridItemSvg
|
|
299
|
+
}) : /* @__PURE__ */ D("div", {
|
|
300
|
+
className: k.iconsGridItemImg,
|
|
301
|
+
style: {
|
|
302
|
+
display: "flex",
|
|
303
|
+
alignItems: "center",
|
|
304
|
+
justifyContent: "center"
|
|
305
|
+
},
|
|
306
|
+
children: /* @__PURE__ */ D(re, {
|
|
307
|
+
indicator: pe,
|
|
308
|
+
size: "small"
|
|
309
|
+
})
|
|
310
|
+
})
|
|
311
|
+
}),
|
|
312
|
+
/* @__PURE__ */ D("div", {
|
|
313
|
+
className: k.iconsGridItemName,
|
|
314
|
+
title: n.name,
|
|
315
|
+
children: n.name
|
|
316
|
+
}),
|
|
317
|
+
_ ? /* @__PURE__ */ D("div", {
|
|
318
|
+
onClick: (e) => {
|
|
319
|
+
e.stopPropagation();
|
|
320
|
+
},
|
|
321
|
+
className: k.iconsGridCheckbox,
|
|
322
|
+
children: /* @__PURE__ */ D(ee, {
|
|
323
|
+
checked: !!(g && g.has(n.hash)),
|
|
324
|
+
onChange: () => _(n.hash)
|
|
325
|
+
})
|
|
326
|
+
}) : null
|
|
327
|
+
]
|
|
328
|
+
}, n.hash);
|
|
329
|
+
})
|
|
330
|
+
}), n && /* @__PURE__ */ D("div", {
|
|
331
|
+
className: k.iconsGridLoadingMore,
|
|
332
|
+
children: /* @__PURE__ */ D(re, { indicator: pe })
|
|
333
|
+
})] }), t && e.length === 0 && /* @__PURE__ */ D("div", {
|
|
334
|
+
className: k.iconsGridLoading,
|
|
335
|
+
children: /* @__PURE__ */ D(re, { indicator: pe })
|
|
336
|
+
})]
|
|
337
|
+
});
|
|
338
|
+
};
|
|
339
|
+
//#endregion
|
|
340
|
+
//#region packages/file-manager/src/components/ImageIcons/defaultIconStockTranslate.ts
|
|
341
|
+
function _e(e) {
|
|
342
|
+
return /[\u0400-\u04FF]/.test(e);
|
|
343
|
+
}
|
|
344
|
+
function ve(e) {
|
|
345
|
+
let t = e.trim();
|
|
346
|
+
return async (e, n) => {
|
|
347
|
+
let r = e.trim();
|
|
348
|
+
if (!_e(r)) return r;
|
|
349
|
+
try {
|
|
350
|
+
let i = await fetch(t, {
|
|
351
|
+
method: "POST",
|
|
352
|
+
headers: { "Content-Type": "application/json" },
|
|
353
|
+
body: JSON.stringify({
|
|
354
|
+
text: e,
|
|
355
|
+
locale: n.locale
|
|
356
|
+
}),
|
|
357
|
+
credentials: "same-origin"
|
|
358
|
+
});
|
|
359
|
+
if (!i.ok) return r;
|
|
360
|
+
let a = await i.json(), o = a.translatedText ?? a.text ?? r;
|
|
361
|
+
return String(o).trim() || r;
|
|
362
|
+
} catch {
|
|
363
|
+
return r;
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
function ye(e) {
|
|
368
|
+
if (!e) return;
|
|
369
|
+
if (e.handleTranslate) return e.handleTranslate;
|
|
370
|
+
let t = e.iconStockTranslateUrl?.trim();
|
|
371
|
+
if (t) return ve(t);
|
|
372
|
+
}
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region node_modules/@iconify/utils/lib/icon/defaults.js
|
|
375
|
+
var be = Object.freeze({
|
|
376
|
+
left: 0,
|
|
377
|
+
top: 0,
|
|
378
|
+
width: 16,
|
|
379
|
+
height: 16
|
|
380
|
+
}), j = Object.freeze({
|
|
381
|
+
rotate: 0,
|
|
382
|
+
vFlip: !1,
|
|
383
|
+
hFlip: !1
|
|
384
|
+
}), M = Object.freeze({
|
|
385
|
+
...be,
|
|
386
|
+
...j
|
|
387
|
+
}), xe = Object.freeze({
|
|
388
|
+
...M,
|
|
389
|
+
body: "",
|
|
390
|
+
hidden: !1
|
|
391
|
+
}), N = Object.freeze({
|
|
392
|
+
width: null,
|
|
393
|
+
height: null
|
|
394
|
+
}), Se = Object.freeze({
|
|
395
|
+
...N,
|
|
396
|
+
...j
|
|
397
|
+
});
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region node_modules/@iconify/utils/lib/icon/transformations.js
|
|
400
|
+
function P(e, t) {
|
|
401
|
+
let n = {};
|
|
402
|
+
!e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
|
|
403
|
+
let r = ((e.rotate || 0) + (t.rotate || 0)) % 4;
|
|
404
|
+
return r && (n.rotate = r), n;
|
|
405
|
+
}
|
|
406
|
+
//#endregion
|
|
407
|
+
//#region node_modules/@iconify/utils/lib/icon/merge.js
|
|
408
|
+
function Ce(e, t) {
|
|
409
|
+
let n = P(e, t);
|
|
410
|
+
for (let r in xe) r in j ? r in e && !(r in n) && (n[r] = j[r]) : r in t ? n[r] = t[r] : r in e && (n[r] = e[r]);
|
|
411
|
+
return n;
|
|
412
|
+
}
|
|
413
|
+
//#endregion
|
|
414
|
+
//#region node_modules/@iconify/utils/lib/icon-set/tree.js
|
|
415
|
+
function F(e, t) {
|
|
416
|
+
let n = e.icons, r = e.aliases || Object.create(null), i = Object.create(null);
|
|
417
|
+
function a(e) {
|
|
418
|
+
if (n[e]) return i[e] = [];
|
|
419
|
+
if (!(e in i)) {
|
|
420
|
+
i[e] = null;
|
|
421
|
+
let t = r[e] && r[e].parent, n = t && a(t);
|
|
422
|
+
n && (i[e] = [t].concat(n));
|
|
423
|
+
}
|
|
424
|
+
return i[e];
|
|
425
|
+
}
|
|
426
|
+
return (t || Object.keys(n).concat(Object.keys(r))).forEach(a), i;
|
|
427
|
+
}
|
|
428
|
+
//#endregion
|
|
429
|
+
//#region node_modules/@iconify/utils/lib/icon-set/get-icon.js
|
|
430
|
+
function I(e, t, n) {
|
|
431
|
+
let r = e.icons, i = e.aliases || Object.create(null), a = {};
|
|
432
|
+
function o(e) {
|
|
433
|
+
a = Ce(r[e] || i[e], a);
|
|
434
|
+
}
|
|
435
|
+
return o(t), n.forEach(o), Ce(e, a);
|
|
436
|
+
}
|
|
437
|
+
function L(e, t) {
|
|
438
|
+
if (e.icons[t]) return I(e, t, []);
|
|
439
|
+
let n = F(e, [t])[t];
|
|
440
|
+
return n ? I(e, t, n) : null;
|
|
441
|
+
}
|
|
442
|
+
//#endregion
|
|
443
|
+
//#region node_modules/@iconify/utils/lib/svg/size.js
|
|
444
|
+
var we = /(-?[0-9.]*[0-9]+[0-9.]*)/g, R = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
445
|
+
function Te(e, t, n) {
|
|
446
|
+
if (t === 1) return e;
|
|
447
|
+
if (n ||= 100, typeof e == "number") return Math.ceil(e * t * n) / n;
|
|
448
|
+
if (typeof e != "string") return e;
|
|
449
|
+
let r = e.split(we);
|
|
450
|
+
if (r === null || !r.length) return e;
|
|
451
|
+
let i = [], a = r.shift(), o = R.test(a);
|
|
452
|
+
for (;;) {
|
|
453
|
+
if (o) {
|
|
454
|
+
let e = parseFloat(a);
|
|
455
|
+
isNaN(e) ? i.push(a) : i.push(Math.ceil(e * t * n) / n);
|
|
456
|
+
} else i.push(a);
|
|
457
|
+
if (a = r.shift(), a === void 0) return i.join("");
|
|
458
|
+
o = !o;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
//#endregion
|
|
462
|
+
//#region node_modules/@iconify/utils/lib/svg/defs.js
|
|
463
|
+
function z(e, t = "defs") {
|
|
464
|
+
let n = "", r = e.indexOf("<" + t);
|
|
465
|
+
for (; r >= 0;) {
|
|
466
|
+
let i = e.indexOf(">", r), a = e.indexOf("</" + t);
|
|
467
|
+
if (i === -1 || a === -1) break;
|
|
468
|
+
let o = e.indexOf(">", a);
|
|
469
|
+
if (o === -1) break;
|
|
470
|
+
n += e.slice(i + 1, a).trim(), e = e.slice(0, r).trim() + e.slice(o + 1);
|
|
471
|
+
}
|
|
472
|
+
return {
|
|
473
|
+
defs: n,
|
|
474
|
+
content: e
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
function Ee(e, t) {
|
|
478
|
+
return e ? "<defs>" + e + "</defs>" + t : t;
|
|
479
|
+
}
|
|
480
|
+
function De(e, t, n) {
|
|
481
|
+
let r = z(e);
|
|
482
|
+
return Ee(r.defs, t + r.content + n);
|
|
483
|
+
}
|
|
484
|
+
//#endregion
|
|
485
|
+
//#region node_modules/@iconify/utils/lib/svg/build.js
|
|
486
|
+
var Oe = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
487
|
+
function B(e, t) {
|
|
488
|
+
let n = {
|
|
489
|
+
...M,
|
|
490
|
+
...e
|
|
491
|
+
}, r = {
|
|
492
|
+
...Se,
|
|
493
|
+
...t
|
|
494
|
+
}, i = {
|
|
495
|
+
left: n.left,
|
|
496
|
+
top: n.top,
|
|
497
|
+
width: n.width,
|
|
498
|
+
height: n.height
|
|
499
|
+
}, a = n.body;
|
|
500
|
+
[n, r].forEach((e) => {
|
|
501
|
+
let t = [], n = e.hFlip, r = e.vFlip, o = e.rotate;
|
|
502
|
+
n ? r ? o += 2 : (t.push("translate(" + (i.width + i.left).toString() + " " + (0 - i.top).toString() + ")"), t.push("scale(-1 1)"), i.top = i.left = 0) : r && (t.push("translate(" + (0 - i.left).toString() + " " + (i.height + i.top).toString() + ")"), t.push("scale(1 -1)"), i.top = i.left = 0);
|
|
503
|
+
let s;
|
|
504
|
+
switch (o < 0 && (o -= Math.floor(o / 4) * 4), o %= 4, o) {
|
|
505
|
+
case 1:
|
|
506
|
+
s = i.height / 2 + i.top, t.unshift("rotate(90 " + s.toString() + " " + s.toString() + ")");
|
|
507
|
+
break;
|
|
508
|
+
case 2:
|
|
509
|
+
t.unshift("rotate(180 " + (i.width / 2 + i.left).toString() + " " + (i.height / 2 + i.top).toString() + ")");
|
|
510
|
+
break;
|
|
511
|
+
case 3: s = i.width / 2 + i.left, t.unshift("rotate(-90 " + s.toString() + " " + s.toString() + ")");
|
|
512
|
+
}
|
|
513
|
+
o % 2 == 1 && (i.left !== i.top && (s = i.left, i.left = i.top, i.top = s), i.width !== i.height && (s = i.width, i.width = i.height, i.height = s)), t.length && (a = De(a, "<g transform=\"" + t.join(" ") + "\">", "</g>"));
|
|
514
|
+
});
|
|
515
|
+
let o = r.width, s = r.height, c = i.width, l = i.height, u, d;
|
|
516
|
+
o === null ? (d = s === null ? "1em" : s === "auto" ? l : s, u = Te(d, c / l)) : (u = o === "auto" ? c : o, d = s === null ? Te(u, l / c) : s === "auto" ? l : s);
|
|
517
|
+
let f = {}, p = (e, t) => {
|
|
518
|
+
Oe(t) || (f[e] = t.toString());
|
|
519
|
+
};
|
|
520
|
+
p("width", u), p("height", d);
|
|
521
|
+
let m = [
|
|
522
|
+
i.left,
|
|
523
|
+
i.top,
|
|
524
|
+
c,
|
|
525
|
+
l
|
|
526
|
+
];
|
|
527
|
+
return f.viewBox = m.join(" "), {
|
|
528
|
+
attributes: f,
|
|
529
|
+
viewBox: m,
|
|
530
|
+
body: a
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region node_modules/@iconify/utils/lib/svg/html.js
|
|
535
|
+
function V(e, t) {
|
|
536
|
+
let n = e.indexOf("xlink:") === -1 ? "" : " xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
|
|
537
|
+
for (let e in t) n += " " + e + "=\"" + t[e] + "\"";
|
|
538
|
+
return "<svg xmlns=\"http://www.w3.org/2000/svg\"" + n + ">" + e + "</svg>";
|
|
539
|
+
}
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region packages/file-manager/src/components/ImageIcons/iconSearchRuLexicon.ts
|
|
542
|
+
var H = /* @__PURE__ */ new Set(/* @__PURE__ */ "и.в.во.на.с.со.к.ко.у.о.об.от.до.по.за.из.без.для.при.про.или.the.a.an.and.or.of.to.in.on.for".split(".")), U = {
|
|
543
|
+
дом: ["home", "house"],
|
|
544
|
+
домой: ["home"],
|
|
545
|
+
сердце: ["heart"],
|
|
546
|
+
любовь: ["heart"],
|
|
547
|
+
звезда: ["star"],
|
|
548
|
+
солнце: ["sun"],
|
|
549
|
+
луна: ["moon"],
|
|
550
|
+
облако: ["cloud"],
|
|
551
|
+
дождь: ["rain", "cloud"],
|
|
552
|
+
снег: ["snow"],
|
|
553
|
+
огонь: ["fire", "flame"],
|
|
554
|
+
вода: ["droplet", "water"],
|
|
555
|
+
молния: [
|
|
556
|
+
"bolt",
|
|
557
|
+
"zap",
|
|
558
|
+
"lightning"
|
|
559
|
+
],
|
|
560
|
+
пользователь: ["user", "person"],
|
|
561
|
+
человек: [
|
|
562
|
+
"user",
|
|
563
|
+
"person",
|
|
564
|
+
"people"
|
|
565
|
+
],
|
|
566
|
+
люди: ["users", "people"],
|
|
567
|
+
лицо: ["face", "smile"],
|
|
568
|
+
улыбка: ["smile"],
|
|
569
|
+
рука: ["hand"],
|
|
570
|
+
глаз: ["eye"],
|
|
571
|
+
ключ: ["key"],
|
|
572
|
+
замок: ["lock"],
|
|
573
|
+
почта: [
|
|
574
|
+
"mail",
|
|
575
|
+
"email",
|
|
576
|
+
"inbox"
|
|
577
|
+
],
|
|
578
|
+
письмо: [
|
|
579
|
+
"mail",
|
|
580
|
+
"envelope",
|
|
581
|
+
"email"
|
|
582
|
+
],
|
|
583
|
+
конверт: ["envelope", "mail"],
|
|
584
|
+
сообщение: ["message", "chat"],
|
|
585
|
+
чат: ["message", "chat"],
|
|
586
|
+
телефон: ["phone"],
|
|
587
|
+
смартфон: ["smartphone", "device"],
|
|
588
|
+
камера: ["camera"],
|
|
589
|
+
фото: ["image", "photo"],
|
|
590
|
+
картинка: ["image", "picture"],
|
|
591
|
+
изображение: ["image", "photo"],
|
|
592
|
+
видео: ["video"],
|
|
593
|
+
музыка: ["music"],
|
|
594
|
+
звук: [
|
|
595
|
+
"volume",
|
|
596
|
+
"speaker",
|
|
597
|
+
"audio"
|
|
598
|
+
],
|
|
599
|
+
микрофон: ["mic", "microphone"],
|
|
600
|
+
поиск: ["search"],
|
|
601
|
+
лупа: ["search"],
|
|
602
|
+
настройки: [
|
|
603
|
+
"settings",
|
|
604
|
+
"cog",
|
|
605
|
+
"gear"
|
|
606
|
+
],
|
|
607
|
+
меню: ["menu"],
|
|
608
|
+
закрыть: ["x", "close"],
|
|
609
|
+
удалить: ["trash", "delete"],
|
|
610
|
+
корзина: ["trash"],
|
|
611
|
+
редактировать: ["edit", "pencil"],
|
|
612
|
+
копировать: ["copy"],
|
|
613
|
+
сохранить: ["save"],
|
|
614
|
+
скачать: ["download"],
|
|
615
|
+
загрузить: ["upload"],
|
|
616
|
+
папка: ["folder"],
|
|
617
|
+
файл: ["file", "document"],
|
|
618
|
+
документ: ["file", "document"],
|
|
619
|
+
текст: ["text"],
|
|
620
|
+
календарь: ["calendar"],
|
|
621
|
+
время: ["clock"],
|
|
622
|
+
часы: ["clock", "watch"],
|
|
623
|
+
карта: ["map"],
|
|
624
|
+
глобус: ["globe"],
|
|
625
|
+
мир: [
|
|
626
|
+
"globe",
|
|
627
|
+
"world",
|
|
628
|
+
"earth"
|
|
629
|
+
],
|
|
630
|
+
адрес: [
|
|
631
|
+
"map-pin",
|
|
632
|
+
"location",
|
|
633
|
+
"pin"
|
|
634
|
+
],
|
|
635
|
+
метка: [
|
|
636
|
+
"map-pin",
|
|
637
|
+
"marker",
|
|
638
|
+
"pin"
|
|
639
|
+
],
|
|
640
|
+
стрелка: ["arrow", "chevron"],
|
|
641
|
+
влево: [
|
|
642
|
+
"left",
|
|
643
|
+
"arrow-left",
|
|
644
|
+
"chevron-left"
|
|
645
|
+
],
|
|
646
|
+
вправо: [
|
|
647
|
+
"right",
|
|
648
|
+
"arrow-right",
|
|
649
|
+
"chevron-right"
|
|
650
|
+
],
|
|
651
|
+
вверх: [
|
|
652
|
+
"up",
|
|
653
|
+
"arrow-up",
|
|
654
|
+
"chevron-up"
|
|
655
|
+
],
|
|
656
|
+
вниз: [
|
|
657
|
+
"down",
|
|
658
|
+
"arrow-down",
|
|
659
|
+
"chevron-down"
|
|
660
|
+
],
|
|
661
|
+
плей: ["play"],
|
|
662
|
+
пауза: ["pause"],
|
|
663
|
+
стоп: ["stop"],
|
|
664
|
+
галочка: ["check"],
|
|
665
|
+
крестик: ["x"],
|
|
666
|
+
плюс: ["plus"],
|
|
667
|
+
минус: ["minus"],
|
|
668
|
+
покупки: [
|
|
669
|
+
"shopping",
|
|
670
|
+
"cart",
|
|
671
|
+
"bag"
|
|
672
|
+
],
|
|
673
|
+
магазин: ["store", "shop"],
|
|
674
|
+
подарок: ["gift"],
|
|
675
|
+
щит: ["shield"],
|
|
676
|
+
банк: ["bank", "building"],
|
|
677
|
+
картабанковская: ["credit-card", "card"],
|
|
678
|
+
уведомление: ["bell"],
|
|
679
|
+
колокол: ["bell"],
|
|
680
|
+
флаг: ["flag"],
|
|
681
|
+
закладка: ["bookmark"],
|
|
682
|
+
ссылка: ["link"],
|
|
683
|
+
код: ["code", "terminal"],
|
|
684
|
+
терминал: ["terminal"],
|
|
685
|
+
лампочка: ["lightbulb", "light-bulb"],
|
|
686
|
+
идея: ["lightbulb"],
|
|
687
|
+
батарея: ["battery"],
|
|
688
|
+
питание: ["power", "plug"],
|
|
689
|
+
сеть: ["wifi", "network"],
|
|
690
|
+
принтер: ["printer"],
|
|
691
|
+
монитор: ["monitor", "display"],
|
|
692
|
+
компьютер: [
|
|
693
|
+
"computer",
|
|
694
|
+
"laptop",
|
|
695
|
+
"pc"
|
|
696
|
+
],
|
|
697
|
+
клавиатура: ["keyboard"],
|
|
698
|
+
книга: ["book"],
|
|
699
|
+
график: ["chart", "graph"],
|
|
700
|
+
таблица: ["table", "grid"],
|
|
701
|
+
список: ["list"],
|
|
702
|
+
фильтр: ["filter"],
|
|
703
|
+
тег: ["tag"],
|
|
704
|
+
отправить: ["send"],
|
|
705
|
+
поделиться: ["share"],
|
|
706
|
+
нравится: ["thumbs", "like"],
|
|
707
|
+
скрыть: ["eye-off", "hidden"],
|
|
708
|
+
предупреждение: ["alert", "warning"],
|
|
709
|
+
ошибка: ["x-circle", "alert-circle"],
|
|
710
|
+
успех: ["check-circle"],
|
|
711
|
+
информация: ["info"],
|
|
712
|
+
помощь: ["help"],
|
|
713
|
+
вопрос: ["help", "question"],
|
|
714
|
+
язык: [
|
|
715
|
+
"language",
|
|
716
|
+
"languages",
|
|
717
|
+
"translate"
|
|
718
|
+
],
|
|
719
|
+
перевод: ["language", "translate"],
|
|
720
|
+
масштаб: ["zoom", "maximize"],
|
|
721
|
+
экран: [
|
|
722
|
+
"monitor",
|
|
723
|
+
"screen",
|
|
724
|
+
"display"
|
|
725
|
+
],
|
|
726
|
+
цвет: ["palette", "swatch"],
|
|
727
|
+
кисть: ["brush", "paint"],
|
|
728
|
+
карандаш: ["pencil"],
|
|
729
|
+
выравнивание: ["align"],
|
|
730
|
+
центр: ["center"],
|
|
731
|
+
круг: ["circle"],
|
|
732
|
+
квадрат: ["square"],
|
|
733
|
+
вход: ["log-in", "login"],
|
|
734
|
+
выход: ["log-out", "logout"],
|
|
735
|
+
профиль: ["user", "account"],
|
|
736
|
+
команда: ["users", "group"],
|
|
737
|
+
задача: [
|
|
738
|
+
"check",
|
|
739
|
+
"list",
|
|
740
|
+
"todo"
|
|
741
|
+
],
|
|
742
|
+
цель: ["target"],
|
|
743
|
+
вложение: ["paperclip"],
|
|
744
|
+
архив: ["archive"],
|
|
745
|
+
ножницы: ["scissors"],
|
|
746
|
+
скрепка: ["paperclip"],
|
|
747
|
+
локация: ["map-pin"],
|
|
748
|
+
навигация: ["navigation", "compass"],
|
|
749
|
+
компас: ["compass"],
|
|
750
|
+
самолет: ["plane", "airplane"],
|
|
751
|
+
машина: ["car"],
|
|
752
|
+
мяч: ["ball"],
|
|
753
|
+
мячик: ["ball"],
|
|
754
|
+
поезд: ["train"],
|
|
755
|
+
корабль: ["ship"],
|
|
756
|
+
велосипед: ["bike", "bicycle"],
|
|
757
|
+
кофе: ["coffee"],
|
|
758
|
+
еда: [
|
|
759
|
+
"utensils",
|
|
760
|
+
"cake",
|
|
761
|
+
"pizza"
|
|
762
|
+
],
|
|
763
|
+
собака: ["dog"],
|
|
764
|
+
кошка: ["cat"],
|
|
765
|
+
птица: ["bird"],
|
|
766
|
+
дерево: ["tree"],
|
|
767
|
+
цветок: ["flower"],
|
|
768
|
+
гора: ["mountain"],
|
|
769
|
+
волны: ["waves"],
|
|
770
|
+
зонт: ["umbrella"],
|
|
771
|
+
работа: ["briefcase"],
|
|
772
|
+
школа: [
|
|
773
|
+
"school",
|
|
774
|
+
"academic",
|
|
775
|
+
"graduation"
|
|
776
|
+
],
|
|
777
|
+
больница: [
|
|
778
|
+
"cross",
|
|
779
|
+
"heart",
|
|
780
|
+
"medical"
|
|
781
|
+
],
|
|
782
|
+
ребенок: ["baby"],
|
|
783
|
+
семья: ["home", "users"],
|
|
784
|
+
группа: ["users", "group"],
|
|
785
|
+
мужчина: ["man", "user"],
|
|
786
|
+
женщина: ["woman", "user"],
|
|
787
|
+
кольцо: ["ring"],
|
|
788
|
+
корона: ["crown"],
|
|
789
|
+
медаль: ["medal", "award"],
|
|
790
|
+
кубок: ["trophy"],
|
|
791
|
+
рюкзак: ["backpack"],
|
|
792
|
+
чемодан: ["luggage"],
|
|
793
|
+
кошелек: ["wallet"],
|
|
794
|
+
очки: ["glasses"],
|
|
795
|
+
шляпа: ["hat"],
|
|
796
|
+
рубашка: ["shirt"],
|
|
797
|
+
обувь: ["shoe"],
|
|
798
|
+
здание: ["building"],
|
|
799
|
+
окно: ["window"],
|
|
800
|
+
дверь: ["door"],
|
|
801
|
+
лифт: ["arrow-up-down", "arrows-up-down"],
|
|
802
|
+
парковка: ["parking"],
|
|
803
|
+
топливо: ["fuel"],
|
|
804
|
+
дорога: ["route", "road"],
|
|
805
|
+
мост: ["bridge"],
|
|
806
|
+
река: ["waves"],
|
|
807
|
+
море: ["waves"],
|
|
808
|
+
ночь: ["moon"],
|
|
809
|
+
день: ["sun"],
|
|
810
|
+
таймер: ["timer"],
|
|
811
|
+
будильник: ["alarm"],
|
|
812
|
+
деньги: [
|
|
813
|
+
"banknote",
|
|
814
|
+
"currency",
|
|
815
|
+
"dollar"
|
|
816
|
+
],
|
|
817
|
+
процент: ["percent"],
|
|
818
|
+
квитанция: ["receipt"],
|
|
819
|
+
счет: ["receipt", "document"],
|
|
820
|
+
договор: ["document", "signature"],
|
|
821
|
+
печать: ["stamp"],
|
|
822
|
+
подпись: ["signature", "pen"],
|
|
823
|
+
суд: ["scale"],
|
|
824
|
+
полиция: ["shield"],
|
|
825
|
+
пожарные: ["fire"],
|
|
826
|
+
скорая: [
|
|
827
|
+
"life",
|
|
828
|
+
"buoy",
|
|
829
|
+
"cross"
|
|
830
|
+
],
|
|
831
|
+
аптека: ["pill"],
|
|
832
|
+
таблетка: ["pill"],
|
|
833
|
+
здоровье: ["heart", "pulse"],
|
|
834
|
+
рост: ["trending-up", "arrow-up"],
|
|
835
|
+
падение: ["trending-down", "arrow-down"],
|
|
836
|
+
робот: ["bot", "cpu"],
|
|
837
|
+
мозг: ["brain"],
|
|
838
|
+
база: ["database"],
|
|
839
|
+
сервер: ["server"],
|
|
840
|
+
облакоинтернет: ["cloud"],
|
|
841
|
+
заметка: ["note", "sticky"],
|
|
842
|
+
комментарий: ["chat", "bubble"],
|
|
843
|
+
якорь: ["anchor"],
|
|
844
|
+
пароль: ["key", "lock"],
|
|
845
|
+
отпечаток: ["fingerprint"],
|
|
846
|
+
обновить: ["refresh", "sync"],
|
|
847
|
+
синхронизация: ["refresh", "sync"],
|
|
848
|
+
наушники: ["headphones"],
|
|
849
|
+
громкость: ["volume"],
|
|
850
|
+
беззвука: ["volume-x", "mute"],
|
|
851
|
+
повтор: ["repeat"],
|
|
852
|
+
следующий: ["skip-forward", "forward"],
|
|
853
|
+
предыдущий: ["skip-back", "backward"],
|
|
854
|
+
камеравыкл: ["camera-off"],
|
|
855
|
+
микрофонвыкл: ["mic-off"],
|
|
856
|
+
телефонзвонок: ["phone-call"],
|
|
857
|
+
входящие: ["inbox"],
|
|
858
|
+
исходящие: ["send", "outbox"],
|
|
859
|
+
черновик: ["draft", "file"],
|
|
860
|
+
спам: ["ban", "shield"],
|
|
861
|
+
рассылка: ["mail", "send"],
|
|
862
|
+
подписка: ["bell", "rss"],
|
|
863
|
+
отписка: ["bell-off"],
|
|
864
|
+
палитра: ["palette"],
|
|
865
|
+
градиент: ["gradient"],
|
|
866
|
+
слои: ["layers"],
|
|
867
|
+
кроп: ["crop"],
|
|
868
|
+
поворот: ["rotate"],
|
|
869
|
+
гаечный: ["wrench"],
|
|
870
|
+
молоток: ["hammer"],
|
|
871
|
+
баг: ["bug"],
|
|
872
|
+
штрихкод: ["barcode"],
|
|
873
|
+
куаркод: ["qr-code"],
|
|
874
|
+
звезда2: ["sparkles"],
|
|
875
|
+
магия: ["wand", "sparkles"],
|
|
876
|
+
снежинка: ["snowflake"],
|
|
877
|
+
радуга: ["rainbow"],
|
|
878
|
+
лист: ["leaf"],
|
|
879
|
+
ракета: ["rocket"],
|
|
880
|
+
спутник: ["satellite"],
|
|
881
|
+
капля: ["droplet"],
|
|
882
|
+
грузовик: ["truck"],
|
|
883
|
+
автобус: ["bus"],
|
|
884
|
+
такси: ["car", "taxi"],
|
|
885
|
+
торт: ["cake"],
|
|
886
|
+
пицца: ["pizza"],
|
|
887
|
+
яблоко: ["apple"],
|
|
888
|
+
банан: ["banana"],
|
|
889
|
+
рыба: ["fish"],
|
|
890
|
+
вино: ["wine"],
|
|
891
|
+
пиво: ["beer"],
|
|
892
|
+
чашка: ["cup", "mug"],
|
|
893
|
+
рассылка2: ["mail", "megaphone"],
|
|
894
|
+
шаблон: ["layout", "file"],
|
|
895
|
+
воронка: ["filter", "funnel"],
|
|
896
|
+
аналитика: ["chart", "pie"],
|
|
897
|
+
отчет: ["document", "chart"],
|
|
898
|
+
дашборд: ["layout", "grid"],
|
|
899
|
+
поддержка: ["life-buoy", "headset"],
|
|
900
|
+
телеграм: ["telegram", "send"],
|
|
901
|
+
вотсап: ["whatsapp"],
|
|
902
|
+
инстаграм: ["instagram"],
|
|
903
|
+
ютуб: ["youtube"],
|
|
904
|
+
твиттер: ["twitter"],
|
|
905
|
+
фейсбук: ["facebook"],
|
|
906
|
+
гитхаб: ["github", "git"],
|
|
907
|
+
гугл: ["google", "chrome"],
|
|
908
|
+
яндекс: ["search"],
|
|
909
|
+
эпл: ["apple"],
|
|
910
|
+
вк: ["vk"]
|
|
911
|
+
};
|
|
912
|
+
function ke(e) {
|
|
913
|
+
return /[\u0400-\u04FF]/.test(e);
|
|
914
|
+
}
|
|
915
|
+
function Ae(e) {
|
|
916
|
+
return e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 1040 && e <= 1103 || e === 1025 || e === 1105;
|
|
917
|
+
}
|
|
918
|
+
function je(e) {
|
|
919
|
+
let t = 0, n = e.length;
|
|
920
|
+
for (; t < n && !Ae(e.charCodeAt(t));) t += 1;
|
|
921
|
+
for (; n > t && !Ae(e.charCodeAt(n - 1));) --n;
|
|
922
|
+
return e.slice(t, n);
|
|
923
|
+
}
|
|
924
|
+
function Me(e) {
|
|
925
|
+
return e.toLowerCase().trim().split(/[\s,.;/\\|]+/).map(je).filter((e) => e.length >= 2 && !H.has(e));
|
|
926
|
+
}
|
|
927
|
+
function Ne(e) {
|
|
928
|
+
let t = Me(e);
|
|
929
|
+
if (t.length === 0) return [];
|
|
930
|
+
let n = [];
|
|
931
|
+
for (let e of t) if (ke(e)) {
|
|
932
|
+
let t = U[e];
|
|
933
|
+
t?.length ? n.push([...t]) : n.push([e]);
|
|
934
|
+
} else n.push([e]);
|
|
935
|
+
return n;
|
|
936
|
+
}
|
|
937
|
+
function Pe(e) {
|
|
938
|
+
return {
|
|
939
|
+
direct: e.trim().toLowerCase(),
|
|
940
|
+
groups: Ne(e)
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
function Fe(e, t, n) {
|
|
944
|
+
return t.length >= 2 && e.includes(t) ? !0 : n.length !== 0 && n.every((t) => t.some((t) => t.length >= 2 && e.includes(t)));
|
|
945
|
+
}
|
|
946
|
+
//#endregion
|
|
947
|
+
//#region packages/file-manager/src/components/ImageIcons/packagedIconSets.ts
|
|
948
|
+
function Ie(e) {
|
|
949
|
+
try {
|
|
950
|
+
switch (e) {
|
|
951
|
+
case "lucide": return new URL("./assets/icon-sets/lucide.json", import.meta.url).href;
|
|
952
|
+
case "tabler": return new URL("./assets/icon-sets/tabler.json", import.meta.url).href;
|
|
953
|
+
default: return;
|
|
954
|
+
}
|
|
955
|
+
} catch {
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
//#endregion
|
|
960
|
+
//#region packages/file-manager/src/components/ImageIcons/iconSets.ts
|
|
961
|
+
var Le = ["lucide", "tabler"], W = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), K = {};
|
|
962
|
+
function Re(e) {
|
|
963
|
+
let t = K.baseUrl === e.baseUrl, n = K.path === e.path, r = K.load === e.load;
|
|
964
|
+
t && n && r || (K = e, W.clear(), G.clear());
|
|
965
|
+
}
|
|
966
|
+
function q(e) {
|
|
967
|
+
let t = K.path || "static/media/icon-sets";
|
|
968
|
+
return v(K.baseUrl || "", `${t}/${e}.json`);
|
|
969
|
+
}
|
|
970
|
+
function ze(e) {
|
|
971
|
+
if (K.path) return [q(e)];
|
|
972
|
+
let t = Ie(e);
|
|
973
|
+
return t ? [t, q(e)] : [q(e)];
|
|
974
|
+
}
|
|
975
|
+
async function Be(e) {
|
|
976
|
+
let t = await fetch(e);
|
|
977
|
+
if (!t.ok) throw Error(`HTTP ${t.status}`);
|
|
978
|
+
return await t.json();
|
|
979
|
+
}
|
|
980
|
+
async function J(e, t) {
|
|
981
|
+
try {
|
|
982
|
+
let n = await t(e);
|
|
983
|
+
return W.set(e, n), n;
|
|
984
|
+
} catch (t) {
|
|
985
|
+
return console.error(`[file-manager] icon set "${e}" failed to load`, t), G.delete(e), null;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
async function Ve(e) {
|
|
989
|
+
if (K.load) return J(e, K.load);
|
|
990
|
+
let t = ze(e), n;
|
|
991
|
+
for (let r of t) try {
|
|
992
|
+
let t = await Be(r);
|
|
993
|
+
return W.set(e, t), t;
|
|
994
|
+
} catch (e) {
|
|
995
|
+
n = e;
|
|
996
|
+
}
|
|
997
|
+
return console.error(`[file-manager] icon set "${e}" is not available at ${t.join(", ")}`, n), G.delete(e), null;
|
|
998
|
+
}
|
|
999
|
+
function He(e) {
|
|
1000
|
+
let t = W.get(e);
|
|
1001
|
+
if (t) return Promise.resolve(t);
|
|
1002
|
+
let n = G.get(e) ?? Ve(e);
|
|
1003
|
+
return G.set(e, n), n;
|
|
1004
|
+
}
|
|
1005
|
+
async function Ue() {
|
|
1006
|
+
return (await Promise.all(Le.map(async (e) => ({
|
|
1007
|
+
prefix: e,
|
|
1008
|
+
json: await He(e)
|
|
1009
|
+
})))).filter((e) => e.json !== null);
|
|
1010
|
+
}
|
|
1011
|
+
function We(e) {
|
|
1012
|
+
return W.get(e) ?? null;
|
|
1013
|
+
}
|
|
1014
|
+
//#endregion
|
|
1015
|
+
//#region packages/file-manager/src/components/ImageIcons/iconStockSearch.ts
|
|
1016
|
+
var Ge = {
|
|
1017
|
+
lucide: "Lucide",
|
|
1018
|
+
tabler: "Tabler Icons"
|
|
1019
|
+
};
|
|
1020
|
+
function Ke(e, t) {
|
|
1021
|
+
let n = t, r = e.icons;
|
|
1022
|
+
for (let e = 0; e < 24; e += 1) {
|
|
1023
|
+
let e = r[n];
|
|
1024
|
+
if (e && typeof e.parent == "string") {
|
|
1025
|
+
n = e.parent;
|
|
1026
|
+
continue;
|
|
1027
|
+
}
|
|
1028
|
+
break;
|
|
1029
|
+
}
|
|
1030
|
+
return n;
|
|
1031
|
+
}
|
|
1032
|
+
function qe(e, t) {
|
|
1033
|
+
let n = e.icons[t];
|
|
1034
|
+
return !!(n && "body" in n && n.hidden);
|
|
1035
|
+
}
|
|
1036
|
+
function Y(e) {
|
|
1037
|
+
return e.split("-").map((e) => e.length ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" ");
|
|
1038
|
+
}
|
|
1039
|
+
function Je(e, t) {
|
|
1040
|
+
let n = e.prefix || t.toLowerCase(), r = [];
|
|
1041
|
+
for (let i of Object.keys(e.icons)) {
|
|
1042
|
+
let a = e.icons[i];
|
|
1043
|
+
if (a && "body" in a && a.hidden) continue;
|
|
1044
|
+
let o = Ke(e, i);
|
|
1045
|
+
if (qe(e, o) || !L(e, i)) continue;
|
|
1046
|
+
let s = `${i} ${i.replace(/-/g, " ")}`.toLowerCase();
|
|
1047
|
+
r.push({
|
|
1048
|
+
prefix: n,
|
|
1049
|
+
slug: i,
|
|
1050
|
+
canonical: o,
|
|
1051
|
+
haystack: s,
|
|
1052
|
+
label: t
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
return r;
|
|
1056
|
+
}
|
|
1057
|
+
var Ye = null;
|
|
1058
|
+
async function Xe() {
|
|
1059
|
+
return Ye ||= (await Ue()).flatMap(({ prefix: e, json: t }) => Je(t, Ge[e])), Ye;
|
|
1060
|
+
}
|
|
1061
|
+
function Ze(e, t, n) {
|
|
1062
|
+
let { haystack: r, slug: i } = e;
|
|
1063
|
+
if (!Fe(r, t, n)) return 0;
|
|
1064
|
+
let a = 10;
|
|
1065
|
+
if (t.length >= 2 && r.includes(t)) i.startsWith(t) ? a += 100 : r.startsWith(t) ? a += 50 : r.split(/\s+/).some((e) => e.startsWith(t)) ? a += 30 : a += 15;
|
|
1066
|
+
else if (n.length > 0) for (let e of n) {
|
|
1067
|
+
let t = e.filter((e) => e.length >= 2 && r.includes(e));
|
|
1068
|
+
if (t.length === 0) continue;
|
|
1069
|
+
let n = Math.max(...t.map((e) => i.startsWith(e) ? 100 : r.startsWith(e) ? 50 : r.split(/\s+/).some((t) => t.startsWith(e)) ? 30 : 15));
|
|
1070
|
+
a += n;
|
|
1071
|
+
}
|
|
1072
|
+
return a;
|
|
1073
|
+
}
|
|
1074
|
+
async function Qe(e) {
|
|
1075
|
+
let t = e.trim();
|
|
1076
|
+
if (t.length < 3) return [];
|
|
1077
|
+
let { direct: n, groups: r } = Pe(t), i = /* @__PURE__ */ new Map();
|
|
1078
|
+
for (let e of await Xe()) {
|
|
1079
|
+
let t = Ze(e, n, r);
|
|
1080
|
+
if (t <= 0) continue;
|
|
1081
|
+
let a = `${e.prefix}:${e.canonical}`, o = i.get(a);
|
|
1082
|
+
(!o || t > o.score) && i.set(a, { score: t });
|
|
1083
|
+
}
|
|
1084
|
+
return Array.from(i.entries()).sort((e, t) => t[1].score - e[1].score || e[0].localeCompare(t[0])).map(([e]) => e);
|
|
1085
|
+
}
|
|
1086
|
+
function $e(e, t) {
|
|
1087
|
+
if (t.length === 0) return e;
|
|
1088
|
+
let n = new Set(e), r = [...e];
|
|
1089
|
+
for (let e of t) n.has(e) || (n.add(e), r.push(e));
|
|
1090
|
+
return r;
|
|
1091
|
+
}
|
|
1092
|
+
function et(e) {
|
|
1093
|
+
let t = e.indexOf(":"), n = t > 0 ? e.slice(0, t) : "", r = t > 0 ? e.slice(t + 1) : e, i = Ge[n] ?? n;
|
|
1094
|
+
return {
|
|
1095
|
+
hash: e,
|
|
1096
|
+
name: Y(r),
|
|
1097
|
+
imagePreviewUrl: "",
|
|
1098
|
+
isFree: !0,
|
|
1099
|
+
familySlug: n,
|
|
1100
|
+
familyName: i
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
|
+
//#endregion
|
|
1104
|
+
//#region packages/file-manager/src/utils/svgParseUtils.ts
|
|
1105
|
+
var X = "path|rect|circle|ellipse|polygon|line|polyline|g";
|
|
1106
|
+
function tt(e) {
|
|
1107
|
+
let t = e.trim();
|
|
1108
|
+
if (/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t)) {
|
|
1109
|
+
let e = t.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})/);
|
|
1110
|
+
if (e) return "#" + (e[1].length === 3 ? e[1].replace(/(.)/g, "$1$1") : e[1]).toLowerCase();
|
|
1111
|
+
}
|
|
1112
|
+
let n = t.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);
|
|
1113
|
+
if (n) return "#" + [
|
|
1114
|
+
1,
|
|
1115
|
+
2,
|
|
1116
|
+
3
|
|
1117
|
+
].map((e) => parseInt(n[e], 10).toString(16).padStart(2, "0")).join("");
|
|
1118
|
+
let r = t.match(/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*[\d.]+\s*\)/);
|
|
1119
|
+
return r ? "#" + [
|
|
1120
|
+
1,
|
|
1121
|
+
2,
|
|
1122
|
+
3
|
|
1123
|
+
].map((e) => parseInt(r[e], 10).toString(16).padStart(2, "0")).join("") : {
|
|
1124
|
+
black: "#000000",
|
|
1125
|
+
white: "#ffffff",
|
|
1126
|
+
red: "#ff0000",
|
|
1127
|
+
green: "#008000",
|
|
1128
|
+
blue: "#0000ff"
|
|
1129
|
+
}[t.toLowerCase()] ?? (Z(t) || "#000000");
|
|
1130
|
+
}
|
|
1131
|
+
function Z(e) {
|
|
1132
|
+
let t = e.trim();
|
|
1133
|
+
if (!t || t === "none" || t === "transparent" || /^url\(#/.test(t)) return null;
|
|
1134
|
+
if (/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t)) {
|
|
1135
|
+
let e = t.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})/);
|
|
1136
|
+
return e ? "#" + (e[1].length === 3 ? e[1].replace(/(.)/g, "$1$1") : e[1]).toLowerCase() : null;
|
|
1137
|
+
}
|
|
1138
|
+
if (/^rgb\(/.test(t)) {
|
|
1139
|
+
let e = t.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);
|
|
1140
|
+
if (e) return "#" + [
|
|
1141
|
+
1,
|
|
1142
|
+
2,
|
|
1143
|
+
3
|
|
1144
|
+
].map((t) => parseInt(e[t], 10).toString(16).padStart(2, "0")).join("");
|
|
1145
|
+
}
|
|
1146
|
+
if (/^rgba\(/.test(t)) {
|
|
1147
|
+
let e = t.match(/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*[\d.]+\s*\)/);
|
|
1148
|
+
if (e) return "#" + [
|
|
1149
|
+
1,
|
|
1150
|
+
2,
|
|
1151
|
+
3
|
|
1152
|
+
].map((t) => parseInt(e[t], 10).toString(16).padStart(2, "0")).join("");
|
|
1153
|
+
}
|
|
1154
|
+
let n = {
|
|
1155
|
+
black: "#000000",
|
|
1156
|
+
white: "#ffffff",
|
|
1157
|
+
red: "#ff0000",
|
|
1158
|
+
green: "#008000",
|
|
1159
|
+
blue: "#0000ff"
|
|
1160
|
+
}, r = t.toLowerCase();
|
|
1161
|
+
return n[r] ? n[r] : (r === "currentcolor" || r === "inherit" || /^[a-zA-Z]+$/.test(t), null);
|
|
1162
|
+
}
|
|
1163
|
+
function Q(e, t) {
|
|
1164
|
+
let n = RegExp(`${t}\\s*:\\s*([^;]+)`, "i"), r = e.match(n);
|
|
1165
|
+
return r ? r[1].trim() : null;
|
|
1166
|
+
}
|
|
1167
|
+
function nt(e) {
|
|
1168
|
+
let t = [], n = /* @__PURE__ */ new Set();
|
|
1169
|
+
Array.from(e.matchAll(/<stop[^>]*?stop-color\s*=\s*["']([^"']+)["']/gi)).map((e) => e[1]).forEach((e) => {
|
|
1170
|
+
let r = Z(e);
|
|
1171
|
+
r && !n.has(r) && (n.add(r), t.push(e));
|
|
1172
|
+
});
|
|
1173
|
+
let r = RegExp(`<(?:${X})([^>]*)>`, "gi"), i;
|
|
1174
|
+
for (; (i = r.exec(e)) !== null;) {
|
|
1175
|
+
let e = i[1], r = e.match(/fill\s*=\s*["']([^"']*)["']/i);
|
|
1176
|
+
if (r && r[1]) {
|
|
1177
|
+
let e = Z(r[1]);
|
|
1178
|
+
e && !n.has(e) && (n.add(e), t.push(r[1]));
|
|
1179
|
+
}
|
|
1180
|
+
let a = e.match(/stroke\s*=\s*["']([^"']*)["']/i);
|
|
1181
|
+
if (a && a[1]) {
|
|
1182
|
+
let e = Z(a[1]);
|
|
1183
|
+
e && !n.has(e) && (n.add(e), t.push(a[1]));
|
|
1184
|
+
}
|
|
1185
|
+
let o = e.match(/style\s*=\s*["']([^"']*)["']/i);
|
|
1186
|
+
if (o && o[1]) {
|
|
1187
|
+
let e = Q(o[1], "fill");
|
|
1188
|
+
if (e) {
|
|
1189
|
+
let r = Z(e);
|
|
1190
|
+
r && !n.has(r) && (n.add(r), t.push(e));
|
|
1191
|
+
}
|
|
1192
|
+
let r = Q(o[1], "stroke");
|
|
1193
|
+
if (r) {
|
|
1194
|
+
let e = Z(r);
|
|
1195
|
+
e && !n.has(e) && (n.add(e), t.push(r));
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
let a = e.match(/<svg([^>]*)>/i);
|
|
1200
|
+
if (a && a[1]) {
|
|
1201
|
+
let e = a[1];
|
|
1202
|
+
for (let [r, i] of [["fill", /fill\s*=\s*["']([^"']*)["']/i], ["stroke", /stroke\s*=\s*["']([^"']*)["']/i]]) {
|
|
1203
|
+
let r = e.match(i);
|
|
1204
|
+
if (r && r[1]) {
|
|
1205
|
+
let e = Z(r[1]);
|
|
1206
|
+
e && !n.has(e) && (n.add(e), t.push(r[1]));
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
let r = e.match(/style\s*=\s*["']([^"']*)["']/i);
|
|
1210
|
+
if (r && r[1]) for (let e of ["fill", "stroke"]) {
|
|
1211
|
+
let i = Q(r[1], e);
|
|
1212
|
+
if (i) {
|
|
1213
|
+
let e = Z(i);
|
|
1214
|
+
e && !n.has(e) && (n.add(e), t.push(i));
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
return t;
|
|
1219
|
+
}
|
|
1220
|
+
function rt(e) {
|
|
1221
|
+
let t = 0, n = RegExp(`<(?:${X})([^>]*)>`, "gi"), r;
|
|
1222
|
+
for (; (r = n.exec(e)) !== null;) {
|
|
1223
|
+
let e = r[1], n = e.match(/fill\s*=\s*["']([^"']*)["']/i), i = e.match(/style\s*=\s*["']([^"']*)["']/i), a = n && n[1] && !/^none$/i.test(n[1]) && !/^url\(#/i.test(n[1]), o = i && Q(i[1], "fill") && !/^none$/i.test(Q(i[1], "fill"));
|
|
1224
|
+
(a || o) && (t += 1);
|
|
1225
|
+
}
|
|
1226
|
+
return t;
|
|
1227
|
+
}
|
|
1228
|
+
function it(e) {
|
|
1229
|
+
let t = 0, n = RegExp(`<(?:${X})([^>]*)>`, "gi"), r;
|
|
1230
|
+
for (; (r = n.exec(e)) !== null;) {
|
|
1231
|
+
let e = r[1], n = e.match(/stroke\s*=\s*["']([^"']*)["']/i), i = e.match(/style\s*=\s*["']([^"']*)["']/i), a = n && n[1] && !/^none$/i.test(n[1]) && !/^url\(#/i.test(n[1]), o = i && Q(i[1], "stroke") && !/^none$/i.test(Q(i[1], "stroke"));
|
|
1232
|
+
(a || o) && (t += 1);
|
|
1233
|
+
}
|
|
1234
|
+
return t;
|
|
1235
|
+
}
|
|
1236
|
+
function at(e) {
|
|
1237
|
+
return /<linearGradient/i.test(e) || /<radialGradient/i.test(e) || /fill="url\(#|stroke="url\(#/i.test(e);
|
|
1238
|
+
}
|
|
1239
|
+
function $(e) {
|
|
1240
|
+
let t = e.trim().replace(/(?:px|em|ex|%)\s*$/i, ""), n = parseFloat(t);
|
|
1241
|
+
return Number.isNaN(n) || n <= 0 || n > 10 ? null : Math.round(n * 10) / 10;
|
|
1242
|
+
}
|
|
1243
|
+
function ot(e) {
|
|
1244
|
+
let t = [], n = e.indexOf("</defs>"), r = n >= 0 ? e.slice(n) : e, i = RegExp(`<(?:${X})[^>]*stroke-width\\s*=\\s*["']([^"']+)["']`, "gi"), a;
|
|
1245
|
+
for (; (a = i.exec(r)) !== null;) {
|
|
1246
|
+
let e = $(a[1]);
|
|
1247
|
+
e != null && t.push(e);
|
|
1248
|
+
}
|
|
1249
|
+
let o = RegExp(`<(?:${X})[^>]*style\\s*=\\s*["'][^"']*stroke-width\\s*:\\s*([^;"]+)[^"']*["']`, "gi");
|
|
1250
|
+
for (; (a = o.exec(r)) !== null;) {
|
|
1251
|
+
let e = $(a[1]);
|
|
1252
|
+
e != null && t.push(e);
|
|
1253
|
+
}
|
|
1254
|
+
if (t.length === 0) return;
|
|
1255
|
+
t.sort((e, t) => e - t);
|
|
1256
|
+
let s = Math.floor(t.length / 2);
|
|
1257
|
+
return t.length % 2 == 1 ? t[s] : (t[s - 1] + t[s]) / 2;
|
|
1258
|
+
}
|
|
1259
|
+
function st(e) {
|
|
1260
|
+
return {
|
|
1261
|
+
colors: nt(e),
|
|
1262
|
+
fillsCount: rt(e),
|
|
1263
|
+
strokesCount: it(e),
|
|
1264
|
+
hasGradient: at(e),
|
|
1265
|
+
strokeWidth: ot(e)
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
function ct(e) {
|
|
1269
|
+
let t = [], n = /* @__PURE__ */ new Set(), r = 0, i = 0, a = !1, o;
|
|
1270
|
+
for (let s of e) {
|
|
1271
|
+
r += s.fillsCount, i += s.strokesCount, s.hasGradient && (a = !0);
|
|
1272
|
+
for (let e of s.colors) {
|
|
1273
|
+
let r = Z(e);
|
|
1274
|
+
r && !n.has(r) && (n.add(r), t.push(e));
|
|
1275
|
+
}
|
|
1276
|
+
o == null && s.strokeWidth != null && (o = s.strokeWidth);
|
|
1277
|
+
}
|
|
1278
|
+
return {
|
|
1279
|
+
colors: t,
|
|
1280
|
+
fillsCount: r,
|
|
1281
|
+
strokesCount: i,
|
|
1282
|
+
hasGradient: a,
|
|
1283
|
+
strokeWidth: o
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
function lt(e) {
|
|
1287
|
+
let t = /* @__PURE__ */ new Map(), n = { v: 1 }, r = (e) => {
|
|
1288
|
+
let r = Z(e);
|
|
1289
|
+
r && !t.has(r) && (t.set(r, n.v), n.v = Math.min(n.v + 1, 3));
|
|
1290
|
+
}, i = e.match(/<svg([^>]*)>/i);
|
|
1291
|
+
if (i?.[1]) {
|
|
1292
|
+
let e = i[1], t = e.match(/fill\s*=\s*["']([^"']*)["']/i), n = e.match(/stroke\s*=\s*["']([^"']*)["']/i);
|
|
1293
|
+
t?.[1] && !/^none$/i.test(t[1]) && !/^url\(#/i.test(t[1]) && r(t[1]), n?.[1] && !/^none$/i.test(n[1]) && !/^url\(#/i.test(n[1]) && r(n[1]);
|
|
1294
|
+
}
|
|
1295
|
+
let a = RegExp(`<(?:${X})([^>]*)>`, "gi"), o;
|
|
1296
|
+
for (; (o = a.exec(e)) !== null;) {
|
|
1297
|
+
let e = o[1], t = e.match(/fill\s*=\s*["']([^"']*)["']/i), n = e.match(/style\s*=\s*["']([^"']*)["']/i)?.[1]?.match(/fill\s*:\s*([^;]+)/i), i = (t?.[1] ?? n?.[1]?.trim())?.trim();
|
|
1298
|
+
i && !/^none$/i.test(i) && !/^url\(#/i.test(i) && r(i);
|
|
1299
|
+
let a = e.match(/stroke\s*=\s*["']([^"']*)["']/i), s = e.match(/style\s*=\s*["']([^"']*)["']/i)?.[1]?.match(/stroke\s*:\s*([^;]+)/i), c = (a?.[1] ?? s?.[1]?.trim())?.trim();
|
|
1300
|
+
c && !/^none$/i.test(c) && !/^url\(#/i.test(c) && r(c);
|
|
1301
|
+
}
|
|
1302
|
+
return t;
|
|
1303
|
+
}
|
|
1304
|
+
function ut(e) {
|
|
1305
|
+
let t = [], n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
1306
|
+
let r = Z(e);
|
|
1307
|
+
r && !n.has(r) && (n.add(r), t.push(e));
|
|
1308
|
+
}, i = Array.from(e.matchAll(/<stop[^>]*?stop-color\s*=\s*["']([^"']+)["']/gi)).map((e) => e[1]);
|
|
1309
|
+
if (i.length >= 2) return i.slice(0, 3).forEach((e) => r(e)), t;
|
|
1310
|
+
let a = e.match(/<svg([^>]*)>/i);
|
|
1311
|
+
if (a?.[1]) {
|
|
1312
|
+
let e = a[1], t = e.match(/fill\s*=\s*["']([^"']*)["']/i), n = e.match(/stroke\s*=\s*["']([^"']*)["']/i);
|
|
1313
|
+
t?.[1] && !/^none$/i.test(t[1]) && !/^url\(#/i.test(t[1]) && r(t[1]), n?.[1] && !/^none$/i.test(n[1]) && !/^url\(#/i.test(n[1]) && r(n[1]);
|
|
1314
|
+
}
|
|
1315
|
+
let o = RegExp(`<(?:${X})([^>]*)>`, "gi"), s;
|
|
1316
|
+
for (; (s = o.exec(e)) !== null;) {
|
|
1317
|
+
let e = s[1], t = e.match(/fill\s*=\s*["']([^"']*)["']/i), n = e.match(/style\s*=\s*["']([^"']*)["']/i)?.[1]?.match(/fill\s*:\s*([^;]+)/i), i = (t?.[1] ?? n?.[1]?.trim())?.trim();
|
|
1318
|
+
i && !/^none$/i.test(i) && !/^url\(#/i.test(i) && r(i);
|
|
1319
|
+
let a = e.match(/stroke\s*=\s*["']([^"']*)["']/i), o = e.match(/style\s*=\s*["']([^"']*)["']/i)?.[1]?.match(/stroke\s*:\s*([^;]+)/i), c = (a?.[1] ?? o?.[1]?.trim())?.trim();
|
|
1320
|
+
c && !/^none$/i.test(c) && !/^url\(#/i.test(c) && r(c);
|
|
1321
|
+
}
|
|
1322
|
+
return t.slice(0, 3);
|
|
1323
|
+
}
|
|
1324
|
+
//#endregion
|
|
1325
|
+
//#region packages/file-manager/src/components/ImageIcons/normalizeSvgForCss.ts
|
|
1326
|
+
function dt(e, t) {
|
|
1327
|
+
let n = e, r = /<linearGradient[\s\S]*?<\/linearGradient>/i.test(n) || /<radialGradient[\s\S]*?<\/radialGradient>/i.test(n);
|
|
1328
|
+
if (!(/fill="url\(#/i.test(n) || /stroke="url\(#/i.test(n))) {
|
|
1329
|
+
let e = lt(n), t = (t) => {
|
|
1330
|
+
let n = Z(t), r = n ? e.get(n) : void 0;
|
|
1331
|
+
return r === 1 ? "var(--em-icon-color-1)" : r === 2 ? "var(--em-icon-color-2)" : r === 3 ? "var(--em-icon-color-3)" : "currentColor";
|
|
1332
|
+
};
|
|
1333
|
+
n = n.replace(/<svg([^>]*)>/i, (e, n) => {
|
|
1334
|
+
let r = n, i = n.match(/fill\s*=\s*["']([^"']*)["']/i);
|
|
1335
|
+
i?.[1] && !/^none$/i.test(i[1]) && !/^url\(#/i.test(i[1]) && (r = r.replace(/fill\s*=\s*["'][^"']*["']/i, `fill="${t(i[1])}"`));
|
|
1336
|
+
let a = n.match(/stroke\s*=\s*["']([^"']*)["']/i);
|
|
1337
|
+
return a?.[1] && !/^none$/i.test(a[1]) && !/^url\(#/i.test(a[1]) && (r = r.replace(/stroke\s*=\s*["'][^"']*["']/i, `stroke="${t(a[1])}"`)), `<svg${r}>`;
|
|
1338
|
+
}), n = n.replace(/<(path|rect|circle|ellipse|polygon|line|polyline)([^>]*?)(\/>|>)/gi, (e, n, r, i) => {
|
|
1339
|
+
let a = r, o = r.match(/fill\s*=\s*["']([^"']*)["']/i), s = r.match(/style\s*=\s*["']([^"']*)["']/i), c = s?.[1]?.match(/fill\s*:\s*([^;]+)/i), l = (o?.[1] ?? c?.[1]?.trim())?.trim();
|
|
1340
|
+
if (l && !/^none$/i.test(l) && !/^url\(#/i.test(l)) {
|
|
1341
|
+
let e = t(l);
|
|
1342
|
+
o ? a = a.replace(/fill\s*=\s*["'][^"']*["']/i, `fill="${e}"`) : s?.[1] && (a = a.replace(/style\s*=\s*["']([^"']*)["']/i, (t, n) => "style=\"" + n.replace(/fill\s*:\s*[^;]+/gi, "fill: " + e) + "\""));
|
|
1343
|
+
}
|
|
1344
|
+
let u = r.match(/stroke\s*=\s*["']([^"']*)["']/i), d = r.match(/style\s*=\s*["']([^"']*)["']/i), f = d?.[1]?.match(/stroke\s*:\s*([^;]+)/i), p = (u?.[1] ?? f?.[1]?.trim())?.trim();
|
|
1345
|
+
if (p && !/^none$/i.test(p) && !/^url\(#/i.test(p)) {
|
|
1346
|
+
let e = t(p);
|
|
1347
|
+
u ? a = a.replace(/stroke\s*=\s*["'][^"']*["']/i, `stroke="${e}"`) : d?.[1] && (a = a.replace(/style\s*=\s*["']([^"']*)["']/i, (t, n) => "style=\"" + n.replace(/stroke\s*:\s*[^;]+/gi, "stroke: " + e) + "\""));
|
|
1348
|
+
}
|
|
1349
|
+
return `<${n}${a}${i}`;
|
|
1350
|
+
});
|
|
1351
|
+
}
|
|
1352
|
+
return r && (n = n.replace(/<linearGradient([^>]*?)>([\s\S]*?)<\/linearGradient>/gi, (e, t, n) => {
|
|
1353
|
+
let r = 0;
|
|
1354
|
+
return `<linearGradient${t}>${n.replace(/<stop([^>]*?)>/gi, (e, t) => {
|
|
1355
|
+
let n = r === 0 ? "var(--em-icon-grad-1)" : "var(--em-icon-grad-2)";
|
|
1356
|
+
return r += 1, /stop-color\s*=/.test(t) ? "<stop" + t.replace(/stop-color="[^"]*"/i, "stop-color=\"" + n + "\"") + ">" : "<stop" + t + " stop-color=\"" + n + "\">";
|
|
1357
|
+
})}</linearGradient>`;
|
|
1358
|
+
}), n = n.replace(/<radialGradient([^>]*?)>([\s\S]*?)<\/radialGradient>/gi, (e, t, n) => {
|
|
1359
|
+
let r = 0;
|
|
1360
|
+
return `<radialGradient${t}>${n.replace(/<stop([^>]*?)>/gi, (e, t) => {
|
|
1361
|
+
let n = r === 0 ? "var(--em-icon-grad-1)" : "var(--em-icon-grad-2)";
|
|
1362
|
+
return r += 1, /stop-color\s*=/.test(t) ? "<stop" + t.replace(/stop-color="[^"]*"/i, "stop-color=\"" + n + "\"") + ">" : "<stop" + t + " stop-color=\"" + n + "\">";
|
|
1363
|
+
})}</radialGradient>`;
|
|
1364
|
+
})), typeof t?.strokeWidth == "number" && !Number.isNaN(t.strokeWidth) && (/stroke-width\s*=\s*["'][^"']*["']/i.test(n) && (n = n.replace(/stroke-width\s*=\s*["'][^"']*["']/gi, `stroke-width="${t.strokeWidth}"`)), /stroke-width\s*:/.test(n) && (n = n.replace(/stroke-width\s*:\s*[^;]+/gi, `stroke-width: ${t.strokeWidth}`)), /stroke-width/i.test(n) || (n = n.replace(/<svg/, `<svg stroke-width="${t.strokeWidth}"`))), n = n.replace(/<svg([^>]*)>/i, (e, t) => `<svg${t.replace(/\swidth="[^"]*"/i, "").replace(/\sheight="[^"]*"/i, "")} width="100%" height="100%">`), n;
|
|
1365
|
+
}
|
|
1366
|
+
//#endregion
|
|
1367
|
+
//#region packages/file-manager/src/components/ImageIcons/useIconifyStock.ts
|
|
1368
|
+
var ft = /* @__PURE__ */ new Map();
|
|
1369
|
+
function pt(e) {
|
|
1370
|
+
let t = e.indexOf(":");
|
|
1371
|
+
if (t <= 0) return null;
|
|
1372
|
+
let n = e.slice(0, t), r = e.slice(t + 1);
|
|
1373
|
+
return r ? {
|
|
1374
|
+
prefix: n,
|
|
1375
|
+
slug: r
|
|
1376
|
+
} : null;
|
|
1377
|
+
}
|
|
1378
|
+
function mt(e, t, n) {
|
|
1379
|
+
let r = We(e);
|
|
1380
|
+
if (!r) throw Error(`Unknown icon set prefix: ${e}`);
|
|
1381
|
+
let i = L(r, t);
|
|
1382
|
+
if (!i) throw Error(`Unknown icon: ${e}:${t}`);
|
|
1383
|
+
let a = B(i, {
|
|
1384
|
+
width: n,
|
|
1385
|
+
height: n
|
|
1386
|
+
}), o = V(a.body, a.attributes);
|
|
1387
|
+
return o = o.replace(/<svg([^>]*)>/i, (e, t) => `<svg${t.replace(/\swidth="[^"]*"/i, "").replace(/\sheight="[^"]*"/i, "")} width="100%" height="100%">`), o;
|
|
1388
|
+
}
|
|
1389
|
+
function ht(e) {
|
|
1390
|
+
return {
|
|
1391
|
+
fetchSvgDataUrl: b.useCallback(async (t, n) => {
|
|
1392
|
+
let r = pt(t);
|
|
1393
|
+
if (!r) throw Error(`Invalid icon id (expected prefix:name): ${t}`);
|
|
1394
|
+
let { prefix: i, slug: a } = r, s = n?.size ?? 96, c = [
|
|
1395
|
+
t,
|
|
1396
|
+
e ? "css=1" : "css=0",
|
|
1397
|
+
e ? "" : `c1=${n?.inlineColors?.colorHex ?? ""}|c2=${n?.inlineColors?.colorHex2 ?? ""}|c3=${n?.inlineColors?.colorHex3 ?? ""}`,
|
|
1398
|
+
n?.strokeWidth == null ? "" : `sw=${n.strokeWidth}`,
|
|
1399
|
+
`s=${s}`
|
|
1400
|
+
].filter(Boolean).join("|"), l = ft.get(c);
|
|
1401
|
+
if (l) return l;
|
|
1402
|
+
if (n?.signal?.aborted) throw new DOMException("Aborted", "AbortError");
|
|
1403
|
+
await Ue();
|
|
1404
|
+
let u = mt(i, a, s), d = u;
|
|
1405
|
+
e ? d = dt(d, { strokeWidth: n?.strokeWidth }) : n?.inlineColors && (d = o(d, n.inlineColors));
|
|
1406
|
+
let f = `data:image/svg+xml;utf8,${encodeURIComponent(d)}`, p = {
|
|
1407
|
+
text: d,
|
|
1408
|
+
url: f,
|
|
1409
|
+
original: u
|
|
1410
|
+
};
|
|
1411
|
+
return ft.set(c, p), p;
|
|
1412
|
+
}, [e]),
|
|
1413
|
+
normalizeSvgForCss: dt
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
//#endregion
|
|
1417
|
+
//#region packages/file-manager/src/components/ImageIcons/useIconsCopyToFolder.tsx
|
|
1418
|
+
async function gt(e) {
|
|
1419
|
+
let { hashes: t, items: n, folderId: r, dataProviders: a, getPngDataUrlForItem: o, dataUrlToBlob: c, config: u } = e, d = 0, f = 0;
|
|
1420
|
+
for (let e of t) {
|
|
1421
|
+
let t = n.find((t) => t.hash === e);
|
|
1422
|
+
if (!t) {
|
|
1423
|
+
f += 1;
|
|
1424
|
+
continue;
|
|
1425
|
+
}
|
|
1426
|
+
let p = await o(t);
|
|
1427
|
+
if (!p) {
|
|
1428
|
+
f += 1;
|
|
1429
|
+
continue;
|
|
1430
|
+
}
|
|
1431
|
+
let m = t.name?.trim() || `icon-${e}`, h = s(`${m}.png`, u), g = await i(a, h, r, !1, l(u)), _ = c(p, "image/png"), v = new File([_], g, {
|
|
1432
|
+
type: "image/png",
|
|
1433
|
+
lastModified: Date.now()
|
|
1434
|
+
});
|
|
1435
|
+
try {
|
|
1436
|
+
await a.uploadFile({
|
|
1437
|
+
name: g,
|
|
1438
|
+
size: v.size,
|
|
1439
|
+
type: v.type,
|
|
1440
|
+
folderId: r,
|
|
1441
|
+
data: v,
|
|
1442
|
+
extension: "png"
|
|
1443
|
+
}), d += 1;
|
|
1444
|
+
} catch {
|
|
1445
|
+
f += 1;
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
return {
|
|
1449
|
+
successCount: d,
|
|
1450
|
+
failCount: f
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
var _t = ({ items: e, selectedHashes: t, getPngDataUrlForItem: r, dataUrlToBlob: i, clearSelection: o }) => {
|
|
1454
|
+
let { t: s } = d(), { options: l, state: u } = a(), f = n(), [m, h] = b.useState(!1), [g] = C.useForm(), [_, v] = b.useState(!1), x = b.useRef(!1), { state: ee, actions: { fetchFolders: S, fetchChildFolders: te, handleModalOk: w } } = c(), { EmptyFolderIcon: T } = y(), { activeFormField: ne, setActiveFormField: E, generateMenuItemsFromFolders: re } = p({
|
|
1455
|
+
folders: Array.isArray(ee.folders) ? ee.folders : [],
|
|
1456
|
+
selectedFolder: u.selectedFolder,
|
|
1457
|
+
EmptyFolderIcon: T,
|
|
1458
|
+
handleCreateFolderModalOk: w,
|
|
1459
|
+
setIsLoading: v,
|
|
1460
|
+
t: s
|
|
1461
|
+
}), ie = b.useCallback(async () => {
|
|
1462
|
+
await S(), h(!0);
|
|
1463
|
+
}, [S]), ae = b.useCallback(async (e) => {
|
|
1464
|
+
e.length > 0 && (g.setFieldsValue({ targetFolder: e[0] }), ne !== e[0].toString() && E(""));
|
|
1465
|
+
}, [
|
|
1466
|
+
ne,
|
|
1467
|
+
g,
|
|
1468
|
+
E
|
|
1469
|
+
]), D = b.useCallback(async (n) => {
|
|
1470
|
+
try {
|
|
1471
|
+
let { dataProviders: a } = l;
|
|
1472
|
+
if (!a || !a.uploadFile && !a.uploadFiles) {
|
|
1473
|
+
f.error({
|
|
1474
|
+
id: "FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",
|
|
1475
|
+
message: s("API-endpoint for file upload is not configured"),
|
|
1476
|
+
placement: "bottomRight"
|
|
1477
|
+
});
|
|
1478
|
+
return;
|
|
1479
|
+
}
|
|
1480
|
+
let c = n || u?.selectedFolder || void 0, d = Array.from(t);
|
|
1481
|
+
if (d.length === 0) return;
|
|
1482
|
+
let { successCount: p, failCount: m } = await gt({
|
|
1483
|
+
hashes: d,
|
|
1484
|
+
items: e,
|
|
1485
|
+
folderId: c,
|
|
1486
|
+
dataProviders: {
|
|
1487
|
+
uploadFile: a.uploadFile ?? (async (e) => {
|
|
1488
|
+
if (!a.uploadFiles) throw Error("Upload is not supported by data provider");
|
|
1489
|
+
let t = await a.uploadFiles({
|
|
1490
|
+
folderId: e.folderId,
|
|
1491
|
+
items: [{
|
|
1492
|
+
name: e.name,
|
|
1493
|
+
size: e.size,
|
|
1494
|
+
type: e.type,
|
|
1495
|
+
folderId: e.folderId,
|
|
1496
|
+
data: e.data,
|
|
1497
|
+
extension: e.extension
|
|
1498
|
+
}]
|
|
1499
|
+
}), n = t?.detailed?.[0];
|
|
1500
|
+
if (!t || !t.success || !n || n.success === !1) {
|
|
1501
|
+
let e = n?.error?.message || t?.error?.message || "Upload failed";
|
|
1502
|
+
throw Error(e);
|
|
1503
|
+
}
|
|
1504
|
+
return n.data;
|
|
1505
|
+
}),
|
|
1506
|
+
getFiles: a.getFiles,
|
|
1507
|
+
getFolders: a.getFolders
|
|
1508
|
+
},
|
|
1509
|
+
getPngDataUrlForItem: r,
|
|
1510
|
+
dataUrlToBlob: i,
|
|
1511
|
+
config: l?.config
|
|
1512
|
+
});
|
|
1513
|
+
p > 0 && f.success({
|
|
1514
|
+
id: "FILES_COPY_SUCCESS",
|
|
1515
|
+
message: s("Files copied"),
|
|
1516
|
+
placement: "bottomRight",
|
|
1517
|
+
data: {
|
|
1518
|
+
successCount: p,
|
|
1519
|
+
totalCount: d.length,
|
|
1520
|
+
itemIds: d,
|
|
1521
|
+
folderId: c ?? null
|
|
1522
|
+
}
|
|
1523
|
+
}), m > 0 && f.error({
|
|
1524
|
+
id: "FILES_COPY_ERROR",
|
|
1525
|
+
message: s("При копировании произошли ошибки"),
|
|
1526
|
+
placement: "bottomRight",
|
|
1527
|
+
data: {
|
|
1528
|
+
failCount: m,
|
|
1529
|
+
totalCount: d.length,
|
|
1530
|
+
itemIds: d,
|
|
1531
|
+
folderId: c ?? null
|
|
1532
|
+
}
|
|
1533
|
+
}), o();
|
|
1534
|
+
} catch (e) {
|
|
1535
|
+
console.error(e), f.error({
|
|
1536
|
+
id: "FILES_COPY_ERROR",
|
|
1537
|
+
message: s("При копировании произошли ошибки"),
|
|
1538
|
+
placement: "bottomRight",
|
|
1539
|
+
innerException: e,
|
|
1540
|
+
data: {
|
|
1541
|
+
failCount: Array.from(t).length || 0,
|
|
1542
|
+
totalCount: Array.from(t).length || 0,
|
|
1543
|
+
itemIds: Array.from(t),
|
|
1544
|
+
folderId: u?.selectedFolder ?? null
|
|
1545
|
+
}
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1548
|
+
}, [
|
|
1549
|
+
o,
|
|
1550
|
+
i,
|
|
1551
|
+
r,
|
|
1552
|
+
e,
|
|
1553
|
+
f,
|
|
1554
|
+
l,
|
|
1555
|
+
t,
|
|
1556
|
+
u?.selectedFolder,
|
|
1557
|
+
s
|
|
1558
|
+
]);
|
|
1559
|
+
return {
|
|
1560
|
+
isCopyIconsModalVisible: m,
|
|
1561
|
+
isCopyLoading: _,
|
|
1562
|
+
copyForm: g,
|
|
1563
|
+
openCopyModal: ie,
|
|
1564
|
+
closeCopyModal: b.useCallback(() => {
|
|
1565
|
+
_ || x.current || (h(!1), E(""), v(!1));
|
|
1566
|
+
}, [_, E]),
|
|
1567
|
+
resetAfterClose: b.useCallback(() => {
|
|
1568
|
+
E(""), v(!1);
|
|
1569
|
+
}, [E]),
|
|
1570
|
+
handleCopyTreeSelect: ae,
|
|
1571
|
+
handleIconsCopyOk: b.useCallback(async (e) => {
|
|
1572
|
+
if (!x.current) {
|
|
1573
|
+
x.current = !0, v(!0);
|
|
1574
|
+
try {
|
|
1575
|
+
await D(e ?? null), h(!1), E("");
|
|
1576
|
+
} finally {
|
|
1577
|
+
x.current = !1, v(!1);
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}, [D, E]),
|
|
1581
|
+
handleCreateFolderAndCopy: b.useCallback(() => {
|
|
1582
|
+
let e = u.selectedFolder ?? "folders";
|
|
1583
|
+
E(e), g.setFieldsValue({
|
|
1584
|
+
folderName: s("New folder"),
|
|
1585
|
+
targetFolder: e
|
|
1586
|
+
});
|
|
1587
|
+
}, [
|
|
1588
|
+
g,
|
|
1589
|
+
u.selectedFolder,
|
|
1590
|
+
E,
|
|
1591
|
+
s
|
|
1592
|
+
]),
|
|
1593
|
+
fetchChildFolders: te,
|
|
1594
|
+
generateMenuItemsFromFolders: re
|
|
1595
|
+
};
|
|
1596
|
+
}, vt = 30, yt = 30, bt = 8;
|
|
1597
|
+
async function xt(e, t, n) {
|
|
1598
|
+
if (e.length === 0) return [];
|
|
1599
|
+
let r = Array(e.length), i = 0, a = Math.max(1, Math.min(t, e.length)), o = async () => {
|
|
1600
|
+
for (;;) {
|
|
1601
|
+
let t = i++;
|
|
1602
|
+
if (t >= e.length) return;
|
|
1603
|
+
r[t] = await n(e[t]);
|
|
1604
|
+
}
|
|
1605
|
+
};
|
|
1606
|
+
return await Promise.all(Array.from({ length: a }, () => o())), r;
|
|
1607
|
+
}
|
|
1608
|
+
var St = ({ customRequest: n, query: i, setQuery: s, inputRef: c }) => {
|
|
1609
|
+
let { t: l } = d(), u = t(), [p, m] = b.useState(""), h = i === void 0 ? p : i, v = s === void 0 ? m : s, [y, ee] = b.useState(""), [S, T] = b.useState([]), [oe, ue] = b.useState(0), [pe, me] = b.useState(!1), [A, he] = b.useState(!1), [_e, ve] = b.useState(!1), [be, j] = b.useState(null), [M, xe] = b.useState({}), [N, Se] = b.useState({}), [P, Ce] = b.useState("#000000"), [F, I] = b.useState("#ff007a"), [L, we] = b.useState("#00C2FF"), [R, Te] = b.useState(1), [z, Ee] = b.useState(50), [De, Oe] = b.useState(!1), { options: B } = a(), V = B.config, H = b.useRef(!1), U = b.useRef(null), ke = b.useRef(0), Ae = b.useRef(null), je = b.useRef(null), Me = b.useRef(void 0);
|
|
1610
|
+
Me.current = ye(B?.config);
|
|
1611
|
+
let Ne = b.useRef(B?.config?.locale);
|
|
1612
|
+
Ne.current = B?.config?.locale;
|
|
1613
|
+
let Pe = b.useRef(null), Fe = b.useRef(/* @__PURE__ */ new Set()), Ie = b.useRef(null), Le = b.useRef(/* @__PURE__ */ new Set()), [W, G] = b.useState(/* @__PURE__ */ new Set()), K = b.useRef([]), q = b.useRef(null), { fetchSvgDataUrl: ze, normalizeSvgForCss: Be } = ht(!0), J = b.useMemo(() => {
|
|
1614
|
+
if (S.length === 0) return null;
|
|
1615
|
+
let e = new Set(S.map((e) => e.hash)), t = Object.keys(N).some((t) => e.has(t)) ? N : M, n = S.map((e) => t[e.hash]).filter((e) => !!e);
|
|
1616
|
+
return n.length === 0 ? null : ct(n.map((e) => st(e)));
|
|
1617
|
+
}, [
|
|
1618
|
+
S,
|
|
1619
|
+
N,
|
|
1620
|
+
M
|
|
1621
|
+
]), Ve = !!J?.hasGradient, He = b.useMemo(() => {
|
|
1622
|
+
let t = e("icon-color-2", "i");
|
|
1623
|
+
return S.some((e) => {
|
|
1624
|
+
let n = M[e.hash];
|
|
1625
|
+
return !!n && t.test(n);
|
|
1626
|
+
});
|
|
1627
|
+
}, [S, M]), Ue = b.useMemo(() => {
|
|
1628
|
+
let t = e("icon-color-3", "i");
|
|
1629
|
+
return S.some((e) => {
|
|
1630
|
+
let n = M[e.hash];
|
|
1631
|
+
return !!n && t.test(n);
|
|
1632
|
+
});
|
|
1633
|
+
}, [S, M]), We = b.useMemo(() => J ? Ve || J.colors.length >= 2 && He : !1, [
|
|
1634
|
+
J,
|
|
1635
|
+
Ve,
|
|
1636
|
+
!0,
|
|
1637
|
+
He
|
|
1638
|
+
]), Ge = b.useMemo(() => J ? J.colors.length >= 3 && Ue : !1, [
|
|
1639
|
+
J,
|
|
1640
|
+
!0,
|
|
1641
|
+
Ue
|
|
1642
|
+
]);
|
|
1643
|
+
b.useEffect(() => {
|
|
1644
|
+
Re({
|
|
1645
|
+
baseUrl: V?.baseUrl,
|
|
1646
|
+
path: V?.iconSetsUrl,
|
|
1647
|
+
load: V?.loadIconSet
|
|
1648
|
+
});
|
|
1649
|
+
}, [
|
|
1650
|
+
V?.baseUrl,
|
|
1651
|
+
V?.iconSetsUrl,
|
|
1652
|
+
V?.loadIconSet
|
|
1653
|
+
]), b.useEffect(() => (H.current = !0, () => {
|
|
1654
|
+
H.current = !1;
|
|
1655
|
+
try {
|
|
1656
|
+
Pe.current?.abort(), Ie.current?.abort();
|
|
1657
|
+
} catch {}
|
|
1658
|
+
}), []);
|
|
1659
|
+
let Ke = b.useRef(h), qe = b.useCallback(async (e) => {
|
|
1660
|
+
let t = e.override?.query ?? y;
|
|
1661
|
+
if (!t || t.trim().length < 3 || (e.initial ? A : _e || A) || !H.current) return;
|
|
1662
|
+
e.initial ? (K.current = e.override?.stockIds === void 0 ? await Qe(t) : e.override.stockIds, he(!0), T([]), xe({}), Se({}), ue(0), me(!1)) : ve(!0);
|
|
1663
|
+
let n = K.current, r = e.initial ? 0 : oe, i = e.initial ? vt : yt, a = `${t}|${r}|${i}|${e.initial ? "i" : "m"}`;
|
|
1664
|
+
if (!Le.current.has(a)) {
|
|
1665
|
+
Le.current.add(a);
|
|
1666
|
+
try {
|
|
1667
|
+
let t = n.slice(r, r + i).map(et);
|
|
1668
|
+
if (!H.current) return;
|
|
1669
|
+
if (e.initial) {
|
|
1670
|
+
let e = t.filter((e, t, n) => n.findIndex((t) => t.hash === e.hash) === t);
|
|
1671
|
+
T(e);
|
|
1672
|
+
} else T((e) => {
|
|
1673
|
+
let n = new Set(e.map((e) => e.hash)), r = t.filter((e) => !n.has(e.hash));
|
|
1674
|
+
return r.length > 0 ? [...e, ...r] : e;
|
|
1675
|
+
});
|
|
1676
|
+
me(r + t.length < n.length), ue(r + t.length);
|
|
1677
|
+
} catch (e) {
|
|
1678
|
+
if (e?.name === "AbortError") return;
|
|
1679
|
+
console.error(e), u.error(l("Request error"));
|
|
1680
|
+
} finally {
|
|
1681
|
+
H.current && (e.initial ? he(!1) : ve(!1)), Le.current.delete(a);
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
}, [
|
|
1685
|
+
y,
|
|
1686
|
+
_e,
|
|
1687
|
+
A,
|
|
1688
|
+
oe,
|
|
1689
|
+
l
|
|
1690
|
+
]);
|
|
1691
|
+
b.useEffect(() => {
|
|
1692
|
+
je.current = qe;
|
|
1693
|
+
}, [qe]);
|
|
1694
|
+
let Y = b.useCallback(async (e) => {
|
|
1695
|
+
if (!e || e.trim().length < 3) return;
|
|
1696
|
+
let t = e.trim();
|
|
1697
|
+
if (Ae.current === t) return;
|
|
1698
|
+
let n = ++ke.current, r = e.trim(), i = r;
|
|
1699
|
+
if (Me.current) try {
|
|
1700
|
+
i = (await Me.current(e, { locale: Ne.current }) ?? r).trim() || r;
|
|
1701
|
+
} catch (e) {
|
|
1702
|
+
console.error("IconsTab: translation error", e), i = r;
|
|
1703
|
+
}
|
|
1704
|
+
if (n !== ke.current) return;
|
|
1705
|
+
Fe.current.clear(), j(null), G(/* @__PURE__ */ new Set()), ee(i);
|
|
1706
|
+
let a;
|
|
1707
|
+
Me.current && r !== i && (a = $e(await Qe(i), await Qe(r))), await je.current?.({
|
|
1708
|
+
initial: !0,
|
|
1709
|
+
override: {
|
|
1710
|
+
query: i,
|
|
1711
|
+
stockIds: a
|
|
1712
|
+
}
|
|
1713
|
+
}), Ae.current = t;
|
|
1714
|
+
}, []), Je = b.useCallback(async () => {
|
|
1715
|
+
!h || h.trim().length < 3 || (U.current &&= (window.clearTimeout(U.current), null), await Y(h));
|
|
1716
|
+
}, [h, Y]), Ye = b.useCallback(() => {
|
|
1717
|
+
ke.current += 1, Fe.current.clear(), K.current = [], q.current = null, ee(""), T([]), ve(!1), me(!1), ue(0), Ae.current = null, j(null), G(/* @__PURE__ */ new Set()), Ce("#000000"), I("#ff007a"), we("#00C2FF");
|
|
1718
|
+
}, []);
|
|
1719
|
+
b.useEffect(() => {
|
|
1720
|
+
let e = Ke.current;
|
|
1721
|
+
e && e.trim().length >= 3 && Y(e);
|
|
1722
|
+
}, [Y]), b.useEffect(() => {
|
|
1723
|
+
let e = h.trim();
|
|
1724
|
+
if (U.current &&= (window.clearTimeout(U.current), null), e.length < 3) {
|
|
1725
|
+
Ye();
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
U.current = window.setTimeout(() => {
|
|
1729
|
+
Y(e);
|
|
1730
|
+
}, 700);
|
|
1731
|
+
}, [
|
|
1732
|
+
h,
|
|
1733
|
+
Ye,
|
|
1734
|
+
Y
|
|
1735
|
+
]);
|
|
1736
|
+
let Xe = b.useCallback((e) => {
|
|
1737
|
+
j(e.hash);
|
|
1738
|
+
}, []);
|
|
1739
|
+
b.useEffect(() => {
|
|
1740
|
+
if (S.length === 0) return;
|
|
1741
|
+
let e = S.map((e) => e.hash).filter((e) => !M[e]);
|
|
1742
|
+
if (e = e.filter((e) => !Fe.current.has(e)), e.length === 0) return;
|
|
1743
|
+
let t = !1;
|
|
1744
|
+
Pe.current?.abort();
|
|
1745
|
+
let n = new AbortController();
|
|
1746
|
+
return Pe.current = n, xt(e, bt, (e) => ze(e, {
|
|
1747
|
+
strokeWidth: typeof R == "number" ? R : void 0,
|
|
1748
|
+
size: z,
|
|
1749
|
+
signal: n.signal,
|
|
1750
|
+
inlineColors: void 0
|
|
1751
|
+
}).then((t) => ({
|
|
1752
|
+
h: e,
|
|
1753
|
+
r: t
|
|
1754
|
+
})).catch((t) => (t?.name === "AbortError" || Fe.current.add(e), {
|
|
1755
|
+
h: e,
|
|
1756
|
+
r: null
|
|
1757
|
+
}))).then((e) => {
|
|
1758
|
+
if (t || !H.current) return;
|
|
1759
|
+
let n = {}, r = {};
|
|
1760
|
+
e.forEach((e) => {
|
|
1761
|
+
e && e.h && e.r && (n[e.h] = e.r.text, e.r.original && (r[e.h] = e.r.original));
|
|
1762
|
+
}), Object.keys(n).length > 0 && xe((e) => ({
|
|
1763
|
+
...e,
|
|
1764
|
+
...n
|
|
1765
|
+
})), Object.keys(r).length > 0 && Se((e) => ({
|
|
1766
|
+
...e,
|
|
1767
|
+
...r
|
|
1768
|
+
}));
|
|
1769
|
+
}).catch(() => {}), () => {
|
|
1770
|
+
t = !0, n.abort();
|
|
1771
|
+
};
|
|
1772
|
+
}, [
|
|
1773
|
+
P,
|
|
1774
|
+
F,
|
|
1775
|
+
L,
|
|
1776
|
+
ze,
|
|
1777
|
+
S,
|
|
1778
|
+
z,
|
|
1779
|
+
R,
|
|
1780
|
+
M,
|
|
1781
|
+
!0
|
|
1782
|
+
]), b.useEffect(() => {
|
|
1783
|
+
if (S.length === 0) return;
|
|
1784
|
+
let e = S.map((e) => e.hash), t = {}, n = !1;
|
|
1785
|
+
e.forEach((e) => {
|
|
1786
|
+
let r = N[e] || M[e];
|
|
1787
|
+
if (!r) return;
|
|
1788
|
+
let i = Be(r, { strokeWidth: typeof R == "number" ? R : void 0 });
|
|
1789
|
+
i && i !== M[e] && (t[e] = i, n = !0);
|
|
1790
|
+
}), n && Object.keys(t).length > 0 && xe((e) => ({
|
|
1791
|
+
...e,
|
|
1792
|
+
...t
|
|
1793
|
+
}));
|
|
1794
|
+
}, [
|
|
1795
|
+
S,
|
|
1796
|
+
Be,
|
|
1797
|
+
N,
|
|
1798
|
+
R,
|
|
1799
|
+
M
|
|
1800
|
+
]), b.useEffect(() => {
|
|
1801
|
+
if (S.length === 0) return;
|
|
1802
|
+
let e = y.trim();
|
|
1803
|
+
if (!e || q.current === e) return;
|
|
1804
|
+
let t = S.find((e) => N[e.hash]);
|
|
1805
|
+
if (!t) return;
|
|
1806
|
+
let n = N[t.hash];
|
|
1807
|
+
if (!n) return;
|
|
1808
|
+
q.current = e;
|
|
1809
|
+
let r = ut(n), i = (e) => {
|
|
1810
|
+
let t = (e || "").trim().match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
|
|
1811
|
+
return t ? "#" + (t[1].length === 3 ? t[1].replace(/(.)/g, "$1$1") : t[1]).toLowerCase() : tt(e);
|
|
1812
|
+
};
|
|
1813
|
+
r[0] && Ce(i(r[0])), r[1] && I(i(r[1])), r[2] && we(i(r[2]));
|
|
1814
|
+
}, [
|
|
1815
|
+
y,
|
|
1816
|
+
S,
|
|
1817
|
+
N
|
|
1818
|
+
]);
|
|
1819
|
+
let Ze = b.useCallback((e) => o(e, {
|
|
1820
|
+
colorHex: P,
|
|
1821
|
+
colorHex2: F,
|
|
1822
|
+
colorHex3: L
|
|
1823
|
+
}), [
|
|
1824
|
+
P,
|
|
1825
|
+
F,
|
|
1826
|
+
L
|
|
1827
|
+
]), X = b.useCallback((e) => {
|
|
1828
|
+
G((t) => {
|
|
1829
|
+
let n = new Set(t);
|
|
1830
|
+
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
1831
|
+
});
|
|
1832
|
+
}, []), Z = b.useCallback(() => {
|
|
1833
|
+
G(/* @__PURE__ */ new Set());
|
|
1834
|
+
}, []), Q = b.useMemo(() => {
|
|
1835
|
+
if (W.size === 1) {
|
|
1836
|
+
let [e] = Array.from(W);
|
|
1837
|
+
return S.find((t) => t.hash === e) || null;
|
|
1838
|
+
}
|
|
1839
|
+
return W.size === 0 && be && S.find((e) => e.hash === be) || null;
|
|
1840
|
+
}, [
|
|
1841
|
+
S,
|
|
1842
|
+
be,
|
|
1843
|
+
W
|
|
1844
|
+
]), nt = b.useCallback((e, t = "image/png") => {
|
|
1845
|
+
try {
|
|
1846
|
+
let n = e.split(",");
|
|
1847
|
+
if (n.length < 2) return new Blob([], { type: t });
|
|
1848
|
+
let r = n[1] || "", i = atob(r), a = Array(i.length);
|
|
1849
|
+
for (let e = 0; e < i.length; e += 1) a[e] = i.charCodeAt(e);
|
|
1850
|
+
let o = new Uint8Array(a);
|
|
1851
|
+
return new Blob([o], { type: t });
|
|
1852
|
+
} catch {
|
|
1853
|
+
return new Blob([], { type: t });
|
|
1854
|
+
}
|
|
1855
|
+
}, []), rt = b.useCallback(async (e, t) => {
|
|
1856
|
+
try {
|
|
1857
|
+
let n = M[e.hash] || N[e.hash];
|
|
1858
|
+
n ||= (await ze(e.hash, {
|
|
1859
|
+
strokeWidth: typeof R == "number" ? R : void 0,
|
|
1860
|
+
size: z,
|
|
1861
|
+
signal: t,
|
|
1862
|
+
inlineColors: void 0
|
|
1863
|
+
})).text;
|
|
1864
|
+
let i = Ze(n), a = f(i, z);
|
|
1865
|
+
return r(i, a.width, a.height);
|
|
1866
|
+
} catch {
|
|
1867
|
+
return null;
|
|
1868
|
+
}
|
|
1869
|
+
}, [
|
|
1870
|
+
Ze,
|
|
1871
|
+
P,
|
|
1872
|
+
F,
|
|
1873
|
+
L,
|
|
1874
|
+
ze,
|
|
1875
|
+
N,
|
|
1876
|
+
z,
|
|
1877
|
+
R,
|
|
1878
|
+
M,
|
|
1879
|
+
!0
|
|
1880
|
+
]), it = b.useCallback(async (e) => {
|
|
1881
|
+
try {
|
|
1882
|
+
if (!H.current) return;
|
|
1883
|
+
Oe(!0), Ie.current?.abort();
|
|
1884
|
+
let t = new AbortController();
|
|
1885
|
+
Ie.current = t;
|
|
1886
|
+
let r = await rt(e, t.signal);
|
|
1887
|
+
if (!H.current || !r) return;
|
|
1888
|
+
await Promise.resolve(n(r));
|
|
1889
|
+
} catch (e) {
|
|
1890
|
+
console.error("IconsTab: insert error", e), u.error(l("Request error"));
|
|
1891
|
+
} finally {
|
|
1892
|
+
H.current && Oe(!1);
|
|
1893
|
+
}
|
|
1894
|
+
}, [
|
|
1895
|
+
n,
|
|
1896
|
+
rt,
|
|
1897
|
+
l
|
|
1898
|
+
]), { isCopyIconsModalVisible: at, isCopyLoading: $, copyForm: ot, openCopyModal: lt, closeCopyModal: dt, resetAfterClose: ft, handleCopyTreeSelect: pt, handleIconsCopyOk: mt, fetchChildFolders: gt, generateMenuItemsFromFolders: St, handleCreateFolderAndCopy: Ct } = _t({
|
|
1899
|
+
items: S,
|
|
1900
|
+
selectedHashes: W,
|
|
1901
|
+
getPngDataUrlForItem: rt,
|
|
1902
|
+
dataUrlToBlob: nt,
|
|
1903
|
+
clearSelection: Z
|
|
1904
|
+
}), wt = !!y.trim() && (S.length > 0 || A), Tt = wt && W.size > 0;
|
|
1905
|
+
return /* @__PURE__ */ O(ae, { children: [/* @__PURE__ */ O("div", {
|
|
1906
|
+
className: `${k.iconsTab} ${y.trim() ? k.hasSearch : ""}`,
|
|
1907
|
+
children: [
|
|
1908
|
+
wt && Tt ? /* @__PURE__ */ O("div", {
|
|
1909
|
+
className: k.iconsHeaderContainer,
|
|
1910
|
+
children: [/* @__PURE__ */ O("div", {
|
|
1911
|
+
className: k.iconsHeaderContainerLeft,
|
|
1912
|
+
children: [/* @__PURE__ */ O(ie.Text, {
|
|
1913
|
+
type: "secondary",
|
|
1914
|
+
children: [
|
|
1915
|
+
W.size,
|
|
1916
|
+
" ",
|
|
1917
|
+
l("selected")
|
|
1918
|
+
]
|
|
1919
|
+
}), /* @__PURE__ */ D(x, {
|
|
1920
|
+
icon: /* @__PURE__ */ D(le, { size: 16 }),
|
|
1921
|
+
onClick: Z,
|
|
1922
|
+
children: l("Deselected")
|
|
1923
|
+
})]
|
|
1924
|
+
}), /* @__PURE__ */ D(E, { children: /* @__PURE__ */ D(x, {
|
|
1925
|
+
icon: /* @__PURE__ */ D(ce, { size: 16 }),
|
|
1926
|
+
onClick: lt,
|
|
1927
|
+
children: l("Copy to folder")
|
|
1928
|
+
}) })]
|
|
1929
|
+
}) : /* @__PURE__ */ D(de, {
|
|
1930
|
+
query: h,
|
|
1931
|
+
onQueryChange: v,
|
|
1932
|
+
onSubmit: Je,
|
|
1933
|
+
hasResults: S.length > 0 || A,
|
|
1934
|
+
inputRef: c
|
|
1935
|
+
}),
|
|
1936
|
+
wt ? /* @__PURE__ */ D(fe, {
|
|
1937
|
+
colorHex: P,
|
|
1938
|
+
setColorHex: Ce,
|
|
1939
|
+
colorHex2: F,
|
|
1940
|
+
setColorHex2: I,
|
|
1941
|
+
colorHex3: L,
|
|
1942
|
+
setColorHex3: we,
|
|
1943
|
+
sizePx: z,
|
|
1944
|
+
setSizePx: Ee,
|
|
1945
|
+
strokeWidth: R,
|
|
1946
|
+
setStrokeWidth: Te,
|
|
1947
|
+
showSecondColor: We,
|
|
1948
|
+
showThirdColor: Ge
|
|
1949
|
+
}) : null,
|
|
1950
|
+
/* @__PURE__ */ D(ge, {
|
|
1951
|
+
items: S,
|
|
1952
|
+
loading: A,
|
|
1953
|
+
isCollectingResults: _e,
|
|
1954
|
+
hasMore: pe,
|
|
1955
|
+
hasQuery: !!y.trim(),
|
|
1956
|
+
selectedHash: be,
|
|
1957
|
+
onItemClick: Xe,
|
|
1958
|
+
onInsert: it,
|
|
1959
|
+
onLoadMore: () => {
|
|
1960
|
+
qe({ initial: !1 }).catch(() => {});
|
|
1961
|
+
},
|
|
1962
|
+
colorVars: {
|
|
1963
|
+
colorHex: P,
|
|
1964
|
+
colorHex2: F,
|
|
1965
|
+
colorHex3: L
|
|
1966
|
+
},
|
|
1967
|
+
svgTextMap: M,
|
|
1968
|
+
previewSize: z,
|
|
1969
|
+
selectedHashes: W,
|
|
1970
|
+
onToggleSelect: X
|
|
1971
|
+
}),
|
|
1972
|
+
Q ? /* @__PURE__ */ O("div", {
|
|
1973
|
+
className: k.iconsBottomBar,
|
|
1974
|
+
children: [/* @__PURE__ */ D(te, { className: "zero-divider" }), /* @__PURE__ */ D("div", {
|
|
1975
|
+
className: k.iconsBottomBarContent,
|
|
1976
|
+
children: /* @__PURE__ */ D(E, { children: /* @__PURE__ */ D(x, {
|
|
1977
|
+
size: "large",
|
|
1978
|
+
type: "primary",
|
|
1979
|
+
style: { height: 40 },
|
|
1980
|
+
loading: De,
|
|
1981
|
+
onClick: () => it(Q),
|
|
1982
|
+
children: l("Choose")
|
|
1983
|
+
}) })
|
|
1984
|
+
})]
|
|
1985
|
+
}) : null
|
|
1986
|
+
]
|
|
1987
|
+
}), /* @__PURE__ */ D(ne, {
|
|
1988
|
+
title: /* @__PURE__ */ D("div", {
|
|
1989
|
+
className: "modal-title",
|
|
1990
|
+
children: l("Copy to folder")
|
|
1991
|
+
}),
|
|
1992
|
+
open: at,
|
|
1993
|
+
onCancel: () => {
|
|
1994
|
+
$ || dt();
|
|
1995
|
+
},
|
|
1996
|
+
mask: { closable: !$ },
|
|
1997
|
+
closable: !$,
|
|
1998
|
+
keyboard: !$,
|
|
1999
|
+
centered: !0,
|
|
2000
|
+
getContainer: B.getModalContainer,
|
|
2001
|
+
footer: /* @__PURE__ */ O("div", {
|
|
2002
|
+
className: g.formFooter,
|
|
2003
|
+
children: [/* @__PURE__ */ O(x, {
|
|
2004
|
+
className: g.folderButton,
|
|
2005
|
+
onClick: Ct,
|
|
2006
|
+
loading: $,
|
|
2007
|
+
children: [/* @__PURE__ */ D(se, {
|
|
2008
|
+
size: 18,
|
|
2009
|
+
strokeWidth: B.config?.iconStrokeWidth
|
|
2010
|
+
}), l("Create folder")]
|
|
2011
|
+
}), /* @__PURE__ */ D(x, {
|
|
2012
|
+
type: "primary",
|
|
2013
|
+
className: g.folderButton,
|
|
2014
|
+
onClick: () => {
|
|
2015
|
+
dt();
|
|
2016
|
+
},
|
|
2017
|
+
loading: $,
|
|
2018
|
+
children: l("Done")
|
|
2019
|
+
})]
|
|
2020
|
+
}),
|
|
2021
|
+
afterClose: () => ft(),
|
|
2022
|
+
children: /* @__PURE__ */ O("div", {
|
|
2023
|
+
className: k.copyToFolderModalBody,
|
|
2024
|
+
children: [$ ? /* @__PURE__ */ D("div", {
|
|
2025
|
+
className: k.copyToFolderModalLoadingOverlay,
|
|
2026
|
+
children: /* @__PURE__ */ D(re, { size: "large" })
|
|
2027
|
+
}) : null, /* @__PURE__ */ D(C, {
|
|
2028
|
+
form: ot,
|
|
2029
|
+
layout: "vertical",
|
|
2030
|
+
initialValues: {
|
|
2031
|
+
targetFolder: "folders",
|
|
2032
|
+
folderName: l("New folder"),
|
|
2033
|
+
is_force_create: !1
|
|
2034
|
+
},
|
|
2035
|
+
children: /* @__PURE__ */ O("div", {
|
|
2036
|
+
className: g.foldersWrapper,
|
|
2037
|
+
children: [
|
|
2038
|
+
/* @__PURE__ */ D(C.Item, {
|
|
2039
|
+
name: "targetFolder",
|
|
2040
|
+
rules: [{
|
|
2041
|
+
required: !0,
|
|
2042
|
+
message: l("Select the destination folder")
|
|
2043
|
+
}],
|
|
2044
|
+
className: g.formItem,
|
|
2045
|
+
children: /* @__PURE__ */ D(_, {
|
|
2046
|
+
onSelect: pt,
|
|
2047
|
+
generateMenuItems: () => St({
|
|
2048
|
+
targetForm: ot,
|
|
2049
|
+
onTreeSelect: pt,
|
|
2050
|
+
onComplete: mt,
|
|
2051
|
+
actionButtonText: l("Copy here")
|
|
2052
|
+
}),
|
|
2053
|
+
fetchChildFolders: gt,
|
|
2054
|
+
disabledFolders: [],
|
|
2055
|
+
mode: "selection",
|
|
2056
|
+
className: "folderSelectionTree",
|
|
2057
|
+
defaultExpandAll: !0
|
|
2058
|
+
})
|
|
2059
|
+
}),
|
|
2060
|
+
/* @__PURE__ */ D(C.Item, {
|
|
2061
|
+
name: "folderName",
|
|
2062
|
+
style: { display: "none" },
|
|
2063
|
+
rules: [{
|
|
2064
|
+
required: !0,
|
|
2065
|
+
validator: (e, t) => typeof t == "string" && t.trim().length === 0 ? Promise.reject(Error(l("Enter the name of the folder"))) : Promise.resolve()
|
|
2066
|
+
}],
|
|
2067
|
+
children: /* @__PURE__ */ D(w, {})
|
|
2068
|
+
}),
|
|
2069
|
+
/* @__PURE__ */ D(C.Item, {
|
|
2070
|
+
name: "is_force_create",
|
|
2071
|
+
style: { display: "none" },
|
|
2072
|
+
children: /* @__PURE__ */ D(w, {})
|
|
2073
|
+
})
|
|
2074
|
+
]
|
|
2075
|
+
})
|
|
2076
|
+
})]
|
|
2077
|
+
})
|
|
2078
|
+
})] });
|
|
2079
|
+
};
|
|
2080
|
+
//#endregion
|
|
2081
|
+
export { St as IconsTab, St as default };
|
|
2082
|
+
|
|
2083
|
+
//# sourceMappingURL=file-manager-IconsTab.js.map
|