@commentkit/comment-kit 0.7.1 → 0.7.2
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 +14 -0
- package/README.md +10 -6
- package/SECURITY.md +14 -6
- package/dist/angular.es.js +2 -2
- package/dist/comment-kit.es.js +5 -5
- package/dist/demo.es.js +35 -34
- package/dist/headless.es.js +3 -3
- package/dist/preact.es.js +2 -2
- package/dist/qwik.qwik.mjs +2 -2
- package/dist/react.es.js +2 -2
- package/dist/shared/{ShadowRootContext-Bv-4aElu.js → ShadowRootContext-CjciYxVN.js} +4 -4
- package/dist/shared/annotation-toolbar-CZI1KVdW.js +1094 -0
- package/dist/shared/{attachment-refresh-CzQFXHkL.js → attachment-refresh-mQw-L7hB.js} +2 -2
- package/dist/shared/{button-group-CWdKaOlC.js → button-group-C285iSkZ.js} +1 -1
- package/dist/shared/capture-privacy-DUROnio5.js +77 -0
- package/dist/shared/{comment-drawing-canvas-DdXlMgbF.js → comment-drawing-canvas-CYFFKgCm.js} +2 -2
- package/dist/shared/{comment-icon-Dg9ZWpz-.js → comment-icon-4SQd3nlz.js} +1 -1
- package/dist/shared/{comment-image-lightbox-B7iHjnAz.js → comment-image-lightbox-DmTNxuqX.js} +5 -5
- package/dist/shared/{comment-images-content-D7YNUgo5.js → comment-images-content-BX4DQ9Ol.js} +3 -3
- package/dist/shared/{comment-kit-core-C862uNAm.js → comment-kit-core-VuIidMeu.js} +786 -703
- package/dist/shared/{comment-kit-ui-0vd-DY4S.js → comment-kit-ui-BjJ1ZLiv.js} +4429 -4620
- package/dist/shared/{comment-screenshot-annotator-DcaSSuWB.js → comment-screenshot-annotator-CMOG1md7.js} +2 -2
- package/dist/shared/{comment-screenshot-overlay-D_nFoJmM.js → comment-screenshot-overlay-iWW-V-Iw.js} +113 -118
- package/dist/shared/comment-shortcut-groups-CfEmkitU.js +153 -0
- package/dist/shared/{dev-export-panel-pWBlhlse.js → dev-export-panel-CrRENbMn.js} +3 -4
- package/dist/shared/dev-grab-Ca4MlS2Y.js +196 -0
- package/dist/shared/{element-selector-DC-_XJ0k.js → element-selector-g1bTvdEA.js} +408 -405
- package/dist/shared/{mount-ui-B68j8r6I.js → mount-ui-Dz5QLq4W.js} +121 -106
- package/dist/shared/{pusher-C1FHQGXV.js → pusher-ue0D83de.js} +1 -1
- package/dist/shared/realtime-CieWAnsW.js +321 -0
- package/dist/shared/{realtime-recovery-DJ_adc-H.js → realtime-recovery-BSVMwsXJ.js} +1 -1
- package/dist/shared/request-activity-DQrAUwfA.js +11 -0
- package/dist/shared/{separator-XDBsaWyw.js → separator-aphZiRoJ.js} +1 -1
- package/dist/shared/{shadow-root-CrO75sED.js → shadow-root-Cv1aLuFf.js} +31 -31
- package/dist/shared/{styles-C9Jwvm0Q.js → styles-CnYsLS2f.js} +1 -1
- package/dist/shared/text-B4HHZNaa.js +23 -0
- package/dist/shared/token-session-CPQpt3-u.js +25 -0
- package/dist/shared/{validation-D-8u4M7I.js → validation-3wbbbuX0.js} +14 -2
- package/dist/shared/{websocket-manager-CFak_YHy.js → websocket-manager-BnK55c3U.js} +136 -116
- package/dist/solid.es.js +2 -2
- package/dist/svelte.es.js +2 -2
- package/dist/types/core/api-client.d.ts +3 -1
- package/dist/types/core/comment-kit-core.d.ts +2 -5
- package/dist/types/core/types.d.ts +22 -5
- package/dist/types/core/websocket-manager.d.ts +1 -0
- package/dist/vue.es.js +2 -2
- package/docs/api-reference.md +19 -4
- package/package.json +1 -1
- package/dist/shared/annotation-toolbar-cGC1p-SP.js +0 -1093
- package/dist/shared/dev-grab-eQ9EgEGY.js +0 -210
- package/dist/shared/realtime-Diqz7G_y.js +0 -317
|
@@ -0,0 +1,1094 @@
|
|
|
1
|
+
import { u as e } from "./comment-kit-core-VuIidMeu.js";
|
|
2
|
+
import { D as t, I as n, L as r, T as i, c as a, d as o, f as s, g as c, m as l, p as u, s as d, t as f, u as p } from "./button-By0hGrJK.js";
|
|
3
|
+
import { $t as m, Ct as h, Et as g, Nt as _, Ot as v, Tt as y, Zt as ee, en as te, i as b, o as x, r as S, t as C, x as w, xt as T } from "./separator-aphZiRoJ.js";
|
|
4
|
+
import { E as ne, M as re, S as ie, h as ae, j as oe, n as se, t as ce, u as le, y as ue } from "./useValueChanged-CrzfD8l-.js";
|
|
5
|
+
import { a as de } from "./ShadowRootContext-CjciYxVN.js";
|
|
6
|
+
import { a as fe, i as pe, l as me, n as he, o as ge, r as E, s as D, t as _e, u as ve } from "./button-group-C285iSkZ.js";
|
|
7
|
+
import { A as O, B as k, D as ye, E as be, F as A, I as xe, L as j, M, O as Se, P as N, R as Ce, T as we, b as Te, d as P, f as Ee, k as De, o as F, s as I, w as L, x as Oe, y as R, z } from "./comment-kit-ui-BjJ1ZLiv.js";
|
|
8
|
+
import { a as B, c as V, d as H, l as ke, n as U, o as Ae, r as je, s as W, t as G, u as Me } from "./annotation-icons-Dh-bmNYK.js";
|
|
9
|
+
import * as K from "react";
|
|
10
|
+
import { jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
11
|
+
var Ne = () => () => {}, Pe = () => !0, Fe = () => !1;
|
|
12
|
+
function Ie() {
|
|
13
|
+
return w(Ne, Pe, Fe);
|
|
14
|
+
}
|
|
15
|
+
function Le() {
|
|
16
|
+
let [e, t] = K.useState(!1);
|
|
17
|
+
return K.useEffect(() => {
|
|
18
|
+
t(!0);
|
|
19
|
+
}, []), e;
|
|
20
|
+
}
|
|
21
|
+
var Re = u(18) ? Ie : Le;
|
|
22
|
+
function ze() {
|
|
23
|
+
return !Re();
|
|
24
|
+
}
|
|
25
|
+
function Be(e) {
|
|
26
|
+
let { script: t } = e, { nonce: n } = Ee();
|
|
27
|
+
return ze() ? /*#__PURE__*/ q("script", {
|
|
28
|
+
nonce: n,
|
|
29
|
+
dangerouslySetInnerHTML: { __html: t },
|
|
30
|
+
suppressHydrationWarning: !0
|
|
31
|
+
}) : null;
|
|
32
|
+
}
|
|
33
|
+
function Ve() {
|
|
34
|
+
let e = K.useRef(0), [t, n] = K.useState({
|
|
35
|
+
paths: [],
|
|
36
|
+
undone: [],
|
|
37
|
+
activePath: null,
|
|
38
|
+
tool: "pen",
|
|
39
|
+
color: M,
|
|
40
|
+
strokeWidth: 3
|
|
41
|
+
}), r = K.useCallback((e) => {
|
|
42
|
+
n((t) => ({
|
|
43
|
+
...t,
|
|
44
|
+
tool: e
|
|
45
|
+
}));
|
|
46
|
+
}, []), i = K.useCallback((e) => {
|
|
47
|
+
n((t) => ({
|
|
48
|
+
...t,
|
|
49
|
+
color: e
|
|
50
|
+
}));
|
|
51
|
+
}, []), a = K.useCallback((e) => {
|
|
52
|
+
n((t) => ({
|
|
53
|
+
...t,
|
|
54
|
+
strokeWidth: e
|
|
55
|
+
}));
|
|
56
|
+
}, []), o = K.useCallback((t, r, i = 1) => {
|
|
57
|
+
let a = `path-${String(++e.current)}`;
|
|
58
|
+
n((e) => ({
|
|
59
|
+
...e,
|
|
60
|
+
activePath: {
|
|
61
|
+
id: a,
|
|
62
|
+
tool: e.tool,
|
|
63
|
+
points: [{
|
|
64
|
+
x: t,
|
|
65
|
+
y: r
|
|
66
|
+
}],
|
|
67
|
+
color: e.color,
|
|
68
|
+
strokeWidth: e.strokeWidth * i
|
|
69
|
+
}
|
|
70
|
+
}));
|
|
71
|
+
}, []), s = K.useCallback((e, t) => {
|
|
72
|
+
n((n) => {
|
|
73
|
+
if (!n.activePath) return n;
|
|
74
|
+
if (n.activePath.tool === "pen") return {
|
|
75
|
+
...n,
|
|
76
|
+
activePath: {
|
|
77
|
+
...n.activePath,
|
|
78
|
+
points: [...n.activePath.points, {
|
|
79
|
+
x: e,
|
|
80
|
+
y: t
|
|
81
|
+
}]
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
let r = n.activePath.points[0] ?? {
|
|
85
|
+
x: 0,
|
|
86
|
+
y: 0
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
...n,
|
|
90
|
+
activePath: {
|
|
91
|
+
...n.activePath,
|
|
92
|
+
points: [r, {
|
|
93
|
+
x: e,
|
|
94
|
+
y: t
|
|
95
|
+
}]
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
}, []), c = K.useCallback(() => {
|
|
100
|
+
n((e) => !e.activePath || e.activePath.points.length < 2 ? {
|
|
101
|
+
...e,
|
|
102
|
+
activePath: null
|
|
103
|
+
} : {
|
|
104
|
+
...e,
|
|
105
|
+
paths: [...e.paths, e.activePath],
|
|
106
|
+
undone: [],
|
|
107
|
+
activePath: null
|
|
108
|
+
});
|
|
109
|
+
}, []), l = K.useCallback(() => {
|
|
110
|
+
n((e) => ({
|
|
111
|
+
...e,
|
|
112
|
+
activePath: null
|
|
113
|
+
}));
|
|
114
|
+
}, []), u = K.useCallback(() => {
|
|
115
|
+
n((e) => e.paths.length === 0 ? e : {
|
|
116
|
+
...e,
|
|
117
|
+
paths: e.paths.slice(0, -1),
|
|
118
|
+
undone: [...e.undone, ...e.paths.slice(-1)]
|
|
119
|
+
});
|
|
120
|
+
}, []), d = K.useCallback(() => {
|
|
121
|
+
n((e) => e.undone.length === 0 ? e : {
|
|
122
|
+
...e,
|
|
123
|
+
paths: [...e.paths, ...e.undone.slice(-1)],
|
|
124
|
+
undone: e.undone.slice(0, -1)
|
|
125
|
+
});
|
|
126
|
+
}, []), f = K.useCallback(() => {
|
|
127
|
+
n((e) => ({
|
|
128
|
+
...e,
|
|
129
|
+
paths: [],
|
|
130
|
+
undone: [],
|
|
131
|
+
activePath: null
|
|
132
|
+
}));
|
|
133
|
+
}, []);
|
|
134
|
+
return {
|
|
135
|
+
...t,
|
|
136
|
+
setTool: r,
|
|
137
|
+
setColor: i,
|
|
138
|
+
setStrokeWidth: a,
|
|
139
|
+
startPath: o,
|
|
140
|
+
addPoint: s,
|
|
141
|
+
endPath: c,
|
|
142
|
+
cancelPath: l,
|
|
143
|
+
undo: u,
|
|
144
|
+
redo: d,
|
|
145
|
+
clear: f,
|
|
146
|
+
canUndo: t.paths.length > 0,
|
|
147
|
+
canRedo: t.undone.length > 0
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function Y(e) {
|
|
151
|
+
let t = e.composedPath?.()[0] ?? e.target;
|
|
152
|
+
return t instanceof Element ? [
|
|
153
|
+
"INPUT",
|
|
154
|
+
"TEXTAREA",
|
|
155
|
+
"SELECT"
|
|
156
|
+
].includes(t.tagName) || t instanceof HTMLElement && t.isContentEditable : !1;
|
|
157
|
+
}
|
|
158
|
+
function He(t, n, r) {
|
|
159
|
+
K.useEffect(() => {
|
|
160
|
+
let i = (i) => {
|
|
161
|
+
if (e() || i.defaultPrevented || i.isComposing || Y(i)) return;
|
|
162
|
+
let a = i.key.toLowerCase();
|
|
163
|
+
(i.metaKey || i.ctrlKey) && !i.altKey && (a === "z" || a === "y") ? (i.preventDefault(), a === "y" || i.shiftKey ? n() : t()) : i.key === "Escape" && (i.preventDefault(), r());
|
|
164
|
+
};
|
|
165
|
+
return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
|
|
166
|
+
}, [
|
|
167
|
+
t,
|
|
168
|
+
n,
|
|
169
|
+
r
|
|
170
|
+
]);
|
|
171
|
+
}
|
|
172
|
+
function Ue(e, t) {
|
|
173
|
+
return e - t;
|
|
174
|
+
}
|
|
175
|
+
function We(e, t, n, r, i, a) {
|
|
176
|
+
let o = P(e, n, r);
|
|
177
|
+
if (!i) return o;
|
|
178
|
+
let s = a.slice();
|
|
179
|
+
return s[t] = P(o, a[t - 1] ?? -Infinity, a[t + 1] ?? Infinity), s.sort(Ue);
|
|
180
|
+
}
|
|
181
|
+
function Ge(e, t, n) {
|
|
182
|
+
if (!Array.isArray(e)) return !0;
|
|
183
|
+
let r = t * n;
|
|
184
|
+
for (let t = 0; t < e.length - 1; t += 1) if (!(Math.abs(e[t] - e[t + 1]) >= r)) return !1;
|
|
185
|
+
return !0;
|
|
186
|
+
}
|
|
187
|
+
var X = () => null, Ke = {
|
|
188
|
+
activeThumbIndex: X,
|
|
189
|
+
max: X,
|
|
190
|
+
min: X,
|
|
191
|
+
minStepsBetweenValues: X,
|
|
192
|
+
step: X,
|
|
193
|
+
values: X,
|
|
194
|
+
...O
|
|
195
|
+
}, qe = /*#__PURE__*/ K.createContext(void 0);
|
|
196
|
+
process.env.NODE_ENV !== "production" && (qe.displayName = "SliderRootContext");
|
|
197
|
+
function Je() {
|
|
198
|
+
let e = K.useContext(qe);
|
|
199
|
+
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? n(62) : "Base UI: SliderRootContext is missing. Slider parts must be placed within <Slider.Root>.");
|
|
200
|
+
return e;
|
|
201
|
+
}
|
|
202
|
+
function Ye(e, t) {
|
|
203
|
+
return e === t || Array.isArray(e) && Array.isArray(t) && Oe(e, t);
|
|
204
|
+
}
|
|
205
|
+
var Z = /*#__PURE__*/ K.forwardRef(function(e, t) {
|
|
206
|
+
let { "aria-labelledby": n, className: i, defaultValue: a, disabled: o = !1, id: c, format: u, largeStep: d = 10, locale: f, render: g, max: _ = 100, min: v = 0, minStepsBetweenValues: y = 0, form: te, name: b, onValueChange: x, onValueCommitted: S, orientation: C = "horizontal", step: w = 1, thumbCollisionBehavior: T = "push", thumbAlignment: ne = "center", value: le, style: de, ...fe } = e, pe = se(c), me = R(pe), he = l(x), ge = l(S), { clearErrors: E } = be(), { state: D, disabled: _e, name: ve, setTouched: O, setDirty: k, validityData: A, validation: j } = De(), { labelId: M } = we(), [Se, N] = K.useState(), Ee = n ?? Te(M, Se), F = _e || o, I = ve ?? b, [L, z] = Ce({
|
|
207
|
+
controlled: le,
|
|
208
|
+
default: a ?? v,
|
|
209
|
+
name: "Slider"
|
|
210
|
+
}), B = K.useRef(null), V = K.useRef(null), H = K.useRef([]), ke = K.useRef(null), U = K.useRef(-1), Ae = K.useRef(null), je = K.useRef(ie), [W, G] = K.useState(-1), [Me, J] = K.useState(-1), [Ne, Pe] = K.useState(!1), [Fe, Ie] = K.useState(() => /* @__PURE__ */ new Map()), [Le, Re] = K.useState([void 0, void 0]), ze = l((e) => {
|
|
211
|
+
G(e), e !== -1 && J(e);
|
|
212
|
+
}), Be = l((e) => {
|
|
213
|
+
e && (V.current = e);
|
|
214
|
+
}), Ve = Array.isArray(L), Y = K.useMemo(() => Ve ? L.map((e) => P(e, v, _)).sort(Ue) : [P(L, v, _)], [
|
|
215
|
+
_,
|
|
216
|
+
v,
|
|
217
|
+
Ve,
|
|
218
|
+
L
|
|
219
|
+
]), He = Ve ? Y : Y[0];
|
|
220
|
+
ye(j.inputRef, pe, He, void 0, !F, b), ce(He, () => {
|
|
221
|
+
E(I), j.change(He);
|
|
222
|
+
let e = A.initialValue, t;
|
|
223
|
+
t = Array.isArray(He) && Array.isArray(e) ? !Oe(He, e) : He !== e, k(t);
|
|
224
|
+
});
|
|
225
|
+
let X = l((e, t) => {
|
|
226
|
+
if (Number.isNaN(e) || Ye(e, L)) return !1;
|
|
227
|
+
let n = t.event, r = n.constructor, i = new r(n.type, n);
|
|
228
|
+
return Object.defineProperty(i, "target", {
|
|
229
|
+
writable: !0,
|
|
230
|
+
value: {
|
|
231
|
+
value: e,
|
|
232
|
+
name: I
|
|
233
|
+
}
|
|
234
|
+
}), t.event = i, he(e, t), !t.isCanceled && (je.current = t.reason, z(e), !0);
|
|
235
|
+
}), Je = l((e, t, n) => {
|
|
236
|
+
let r = We(e, t, v, _, Ve, Y);
|
|
237
|
+
if (Ge(r, w, y)) {
|
|
238
|
+
let e = "key" in n ? ue : ae, i = X(r, oe(e, n.nativeEvent, void 0, { activeThumbIndex: t }));
|
|
239
|
+
O(!0), i && ge(r, re(e, n.nativeEvent));
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
process.env.NODE_ENV !== "production" && v >= _ && s("Slider `max` must be greater than `min`."), r(() => {
|
|
243
|
+
if (!F) return;
|
|
244
|
+
let e = ee(h(B.current));
|
|
245
|
+
m(B.current, e) && e.blur(), W !== -1 && ze(-1);
|
|
246
|
+
}, [
|
|
247
|
+
W,
|
|
248
|
+
F,
|
|
249
|
+
ze
|
|
250
|
+
]);
|
|
251
|
+
let Z = K.useMemo(() => ({
|
|
252
|
+
...D,
|
|
253
|
+
activeThumbIndex: W,
|
|
254
|
+
disabled: F,
|
|
255
|
+
dragging: Ne,
|
|
256
|
+
orientation: C,
|
|
257
|
+
max: _,
|
|
258
|
+
min: v,
|
|
259
|
+
minStepsBetweenValues: y,
|
|
260
|
+
step: w,
|
|
261
|
+
values: Y
|
|
262
|
+
}), [
|
|
263
|
+
D,
|
|
264
|
+
W,
|
|
265
|
+
F,
|
|
266
|
+
Ne,
|
|
267
|
+
_,
|
|
268
|
+
v,
|
|
269
|
+
y,
|
|
270
|
+
C,
|
|
271
|
+
w,
|
|
272
|
+
Y
|
|
273
|
+
]), Xe = K.useMemo(() => ({
|
|
274
|
+
active: W,
|
|
275
|
+
controlRef: V,
|
|
276
|
+
disabled: F,
|
|
277
|
+
dragging: Ne,
|
|
278
|
+
validation: j,
|
|
279
|
+
format: u,
|
|
280
|
+
handleInputChange: Je,
|
|
281
|
+
indicatorPosition: Le,
|
|
282
|
+
inset: ne !== "center",
|
|
283
|
+
isArrayValue: Ve,
|
|
284
|
+
labelId: Ee,
|
|
285
|
+
rootLabelId: me,
|
|
286
|
+
largeStep: d,
|
|
287
|
+
lastUsedThumbIndex: Me,
|
|
288
|
+
lastChangeReasonRef: je,
|
|
289
|
+
form: te,
|
|
290
|
+
locale: f,
|
|
291
|
+
max: _,
|
|
292
|
+
min: v,
|
|
293
|
+
minStepsBetweenValues: y,
|
|
294
|
+
name: I,
|
|
295
|
+
onValueCommitted: ge,
|
|
296
|
+
orientation: C,
|
|
297
|
+
pressedThumbCenterOffsetRef: ke,
|
|
298
|
+
pressedThumbIndexRef: U,
|
|
299
|
+
pressedValuesRef: Ae,
|
|
300
|
+
registerFieldControlRef: Be,
|
|
301
|
+
renderBeforeHydration: ne === "edge",
|
|
302
|
+
setActive: ze,
|
|
303
|
+
setDragging: Pe,
|
|
304
|
+
setIndicatorPosition: Re,
|
|
305
|
+
setLabelId: N,
|
|
306
|
+
setValue: X,
|
|
307
|
+
state: Z,
|
|
308
|
+
step: w,
|
|
309
|
+
thumbCollisionBehavior: T,
|
|
310
|
+
thumbMap: Fe,
|
|
311
|
+
thumbRefs: H,
|
|
312
|
+
values: Y
|
|
313
|
+
}), [
|
|
314
|
+
W,
|
|
315
|
+
Ee,
|
|
316
|
+
me,
|
|
317
|
+
F,
|
|
318
|
+
Ne,
|
|
319
|
+
j,
|
|
320
|
+
u,
|
|
321
|
+
Je,
|
|
322
|
+
Le,
|
|
323
|
+
d,
|
|
324
|
+
Me,
|
|
325
|
+
te,
|
|
326
|
+
f,
|
|
327
|
+
_,
|
|
328
|
+
v,
|
|
329
|
+
y,
|
|
330
|
+
I,
|
|
331
|
+
ge,
|
|
332
|
+
C,
|
|
333
|
+
Ve,
|
|
334
|
+
Be,
|
|
335
|
+
ze,
|
|
336
|
+
X,
|
|
337
|
+
Z,
|
|
338
|
+
w,
|
|
339
|
+
T,
|
|
340
|
+
ne,
|
|
341
|
+
Fe,
|
|
342
|
+
Y
|
|
343
|
+
]), Ze = p("div", e, {
|
|
344
|
+
state: Z,
|
|
345
|
+
ref: [t, B],
|
|
346
|
+
props: [
|
|
347
|
+
{
|
|
348
|
+
"aria-labelledby": Ee,
|
|
349
|
+
id: pe,
|
|
350
|
+
role: "group"
|
|
351
|
+
},
|
|
352
|
+
fe,
|
|
353
|
+
(e) => j.getValidationProps(F, e)
|
|
354
|
+
],
|
|
355
|
+
stateAttributesMapping: Ke
|
|
356
|
+
});
|
|
357
|
+
return /*#__PURE__*/ q(qe.Provider, {
|
|
358
|
+
value: Xe,
|
|
359
|
+
children: /*#__PURE__*/ q(xe, {
|
|
360
|
+
elementsRef: H,
|
|
361
|
+
onMapChange: Ie,
|
|
362
|
+
children: Ze
|
|
363
|
+
})
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
process.env.NODE_ENV !== "production" && (Z.displayName = "SliderRoot");
|
|
367
|
+
function Xe(e) {
|
|
368
|
+
return e === "touch" || e === "pen";
|
|
369
|
+
}
|
|
370
|
+
function Ze(e, t) {
|
|
371
|
+
let n = e.getBoundingClientRect();
|
|
372
|
+
return t ? (n.top + n.bottom) / 2 : (n.left + n.right) / 2;
|
|
373
|
+
}
|
|
374
|
+
function Q(e) {
|
|
375
|
+
if (e === 0) return 0;
|
|
376
|
+
if (Math.abs(e) < 1) {
|
|
377
|
+
let t = e.toExponential().split("e-"), n = t[0].split(".")[1];
|
|
378
|
+
return (n ? n.length : 0) + parseInt(t[1], 10);
|
|
379
|
+
}
|
|
380
|
+
let t = e.toString().split(".")[1];
|
|
381
|
+
return t ? t.length : 0;
|
|
382
|
+
}
|
|
383
|
+
function Qe(e, t, n) {
|
|
384
|
+
let r = Math.round((e - n) / t) * t + n;
|
|
385
|
+
return Number(r.toFixed(Math.max(Q(t), Q(n))));
|
|
386
|
+
}
|
|
387
|
+
function $e(e, t, n, r, i, a, o, s) {
|
|
388
|
+
let c = e.slice(), l = a * o, u = c.length - 1, d = s ?? e, f = r + t * l, p = i - (u - t) * l;
|
|
389
|
+
c[t] = P(n, f, p);
|
|
390
|
+
for (let e = t + 1; e <= u; e += 1) {
|
|
391
|
+
let t = c[e - 1] + l, n = i - (u - e) * l, r = d[e], a = Math.max(c[e], t);
|
|
392
|
+
r < a && (a = Math.max(r, t)), c[e] = P(a, t, n);
|
|
393
|
+
}
|
|
394
|
+
for (let e = t - 1; e >= 0; --e) {
|
|
395
|
+
let t = c[e + 1] - l, n = r + e * l, i = d[e], a = Math.min(c[e], t);
|
|
396
|
+
i > a && (a = Math.min(i, t)), c[e] = P(a, n, t);
|
|
397
|
+
}
|
|
398
|
+
for (let e = 0; e <= u; e += 1) c[e] = Number(c[e].toFixed(12));
|
|
399
|
+
return c;
|
|
400
|
+
}
|
|
401
|
+
function et(e, t, n, r, i, a, o, s, c, l) {
|
|
402
|
+
let u = n ?? t, d = r ?? t;
|
|
403
|
+
if (!(u.length > 1)) return {
|
|
404
|
+
value: a,
|
|
405
|
+
thumbIndex: 0,
|
|
406
|
+
didSwap: !1
|
|
407
|
+
};
|
|
408
|
+
let f = c * l;
|
|
409
|
+
if (e === "push") return {
|
|
410
|
+
value: $e(u, i, a, o, s, c, l),
|
|
411
|
+
thumbIndex: i,
|
|
412
|
+
didSwap: !1
|
|
413
|
+
};
|
|
414
|
+
let p = u.slice(), m = p[i - 1], h = p[i + 1], g = m == null ? o : m + f, _ = h == null ? s : h - f, v = Number(P(a, g, _).toFixed(12));
|
|
415
|
+
switch (p[i] = v, e) {
|
|
416
|
+
case "swap": {
|
|
417
|
+
let e = u[i], t = 1e-7, n = a > e, r = a < e, g = n && h != null && a >= h - t, _ = r && m != null && a <= m + t;
|
|
418
|
+
if (!g && !_) return {
|
|
419
|
+
value: p,
|
|
420
|
+
thumbIndex: i,
|
|
421
|
+
didSwap: !1
|
|
422
|
+
};
|
|
423
|
+
let y = g ? i + 1 : i - 1, ee = p.map((e, t) => t === i ? v : d[t] ?? u[t]), te = a;
|
|
424
|
+
te = g ? Math.max(a, p[y]) : Math.min(a, p[y]);
|
|
425
|
+
let b = $e(p, y, te, o, s, c, l, ee), x = g ? y - 1 : y + 1, S = b[x - 1], C = b[x + 1], w = S == null ? o : S + f;
|
|
426
|
+
w = Math.max(w, o + x * f);
|
|
427
|
+
let T = C == null ? s : C - f;
|
|
428
|
+
T = Math.min(T, s - (b.length - 1 - x) * f);
|
|
429
|
+
let ne = P(v, w, T);
|
|
430
|
+
return b[x] = Number(ne.toFixed(12)), {
|
|
431
|
+
value: b,
|
|
432
|
+
thumbIndex: y,
|
|
433
|
+
didSwap: !0
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
default: return {
|
|
437
|
+
value: p,
|
|
438
|
+
thumbIndex: i,
|
|
439
|
+
didSwap: !1
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
var tt = 2;
|
|
444
|
+
function nt(e, t) {
|
|
445
|
+
if (!e) return {
|
|
446
|
+
start: 0,
|
|
447
|
+
end: 0
|
|
448
|
+
};
|
|
449
|
+
function n(e) {
|
|
450
|
+
let t = e == null ? 0 : parseFloat(e);
|
|
451
|
+
return Number.isNaN(t) ? 0 : t;
|
|
452
|
+
}
|
|
453
|
+
let r = t ? "Top" : "InlineStart", i = t ? "Bottom" : "InlineEnd";
|
|
454
|
+
return {
|
|
455
|
+
start: n(e[`border${r}Width`]) + n(e[`padding${r}`]),
|
|
456
|
+
end: n(e[`border${i}Width`]) + n(e[`padding${i}`])
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
function rt(e, t) {
|
|
460
|
+
if (t.current != null && e.changedTouches) {
|
|
461
|
+
let n = e;
|
|
462
|
+
for (let e = 0; e < n.changedTouches.length; e += 1) {
|
|
463
|
+
let r = n.changedTouches[e];
|
|
464
|
+
if (r.identifier === t.current) return {
|
|
465
|
+
x: r.clientX,
|
|
466
|
+
y: r.clientY
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
return null;
|
|
470
|
+
}
|
|
471
|
+
return {
|
|
472
|
+
x: e.clientX,
|
|
473
|
+
y: e.clientY
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
var $ = /*#__PURE__*/ K.forwardRef(function(e, n) {
|
|
477
|
+
let { render: r, className: a, style: o, ...s } = e, { disabled: c, dragging: u, inset: d, isArrayValue: f, lastChangeReasonRef: _, max: b, min: x, minStepsBetweenValues: S, onValueCommitted: C, orientation: w, pressedThumbCenterOffsetRef: T, pressedThumbIndexRef: ie, pressedValuesRef: ae, registerFieldControlRef: se, renderBeforeHydration: ce, setActive: ue, setDragging: fe, setValue: pe, state: me, step: he, thumbCollisionBehavior: ge, thumbRefs: E, values: D } = Je(), _e = de(), ve = D.length > 1, O = w === "vertical", k = K.useRef(null), ye = K.useRef(null), be = l((e) => {
|
|
478
|
+
e && ye.current == null && (ye.current = i(e).getComputedStyle(e));
|
|
479
|
+
}), A = K.useRef(null), xe = K.useRef(0), j = K.useRef(0), M = K.useRef(null), Se = K.useRef(!1), N = g(D);
|
|
480
|
+
function Ce(e) {
|
|
481
|
+
return e?.querySelector("input[type=\"range\"]");
|
|
482
|
+
}
|
|
483
|
+
function we(e) {
|
|
484
|
+
ie.current = e, E.current[e] || (T.current = null);
|
|
485
|
+
}
|
|
486
|
+
function Te() {
|
|
487
|
+
ie.current = -1, T.current = null;
|
|
488
|
+
}
|
|
489
|
+
function Ee(e) {
|
|
490
|
+
return t(e) ? E.current.some((n) => !t(n) || !m(n, e) ? !1 : Ce(n)?.disabled === !0) : !1;
|
|
491
|
+
}
|
|
492
|
+
function De(e) {
|
|
493
|
+
let t = k.current, n = ie.current;
|
|
494
|
+
if (!t || n < 0 || n >= D.length) return n >= D.length && (M.current = null), null;
|
|
495
|
+
let { width: r, height: i, bottom: a, left: o, right: s } = t.getBoundingClientRect(), c = nt(ye.current, O), l = j.current, u = (O ? i : r) - c.start - c.end - l * 2, d = T.current ?? 0, p = e.x - d, m = e.y - d, h = O ? a - m - c.end : (_e === "rtl" ? s - p : p - o) - c.start, g = P((h - l) / u, 0, 1), _ = (b - x) * g + x;
|
|
496
|
+
return _ = Qe(_, he, x), _ = P(_, x, b), ve ? et(ge, D, N.current, ae.current, n, _, x, b, he, S) : {
|
|
497
|
+
value: f ? [_] : _,
|
|
498
|
+
thumbIndex: n,
|
|
499
|
+
didSwap: !1
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
function F(e) {
|
|
503
|
+
ae.current = ve ? D.slice() : null, M.current = null, N.current = D;
|
|
504
|
+
let n = ie.current, r = n;
|
|
505
|
+
if (n > -1 && n < D.length) {
|
|
506
|
+
if (D[n] === b) {
|
|
507
|
+
let e = n;
|
|
508
|
+
for (; e > 0 && D[e - 1] === b;) --e;
|
|
509
|
+
r = e;
|
|
510
|
+
}
|
|
511
|
+
} else {
|
|
512
|
+
let n = O ? "y" : "x", i;
|
|
513
|
+
r = -1;
|
|
514
|
+
for (let a = 0; a < E.current.length; a += 1) {
|
|
515
|
+
let o = E.current[a];
|
|
516
|
+
if (t(o) && !Ce(o)?.disabled) {
|
|
517
|
+
let t = Ze(o, O), s = Math.abs(e[n] - t);
|
|
518
|
+
(i === void 0 || s <= i) && (r = a, i = s);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
if (r > -1 && r !== n && we(r), d) {
|
|
523
|
+
let e = E.current[r];
|
|
524
|
+
if (t(e)) {
|
|
525
|
+
let t = e.getBoundingClientRect();
|
|
526
|
+
j.current = t[O ? "height" : "width"] / 2;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
function I(e) {
|
|
531
|
+
let t = Ce(E.current?.[e]);
|
|
532
|
+
t && t.focus({
|
|
533
|
+
preventScroll: !0,
|
|
534
|
+
focusVisible: !1
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
function L(e, t, n) {
|
|
538
|
+
let r = pe(e.value, oe(t, n, void 0, { activeThumbIndex: e.thumbIndex }));
|
|
539
|
+
return r && (M.current = e.value, N.current = Array.isArray(e.value) ? e.value : [e.value], e.didSwap && (we(e.thumbIndex), I(e.thumbIndex))), r;
|
|
540
|
+
}
|
|
541
|
+
let Oe = l((e) => {
|
|
542
|
+
let t = rt(e, A);
|
|
543
|
+
if (t == null) return;
|
|
544
|
+
if (xe.current += 1, e.type === "pointermove" && e.buttons === 0) {
|
|
545
|
+
R(e);
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
let n = De(t);
|
|
549
|
+
n != null && Ge(n.value, he, S) && (!u && xe.current > tt && fe(!0), L(n, le, e));
|
|
550
|
+
}), R = l((e) => {
|
|
551
|
+
if (rt(e, A) == null) return;
|
|
552
|
+
ue(-1), fe(!1), T.current = null;
|
|
553
|
+
let t = M.current;
|
|
554
|
+
if (Array.isArray(t) && t.length !== D.length && (M.current = null), M.current != null) {
|
|
555
|
+
let t = _.current;
|
|
556
|
+
C(M.current, re(t, e));
|
|
557
|
+
}
|
|
558
|
+
"pointerType" in e && k.current?.hasPointerCapture(e.pointerId) && k.current?.releasePointerCapture(e.pointerId), ie.current = -1, V();
|
|
559
|
+
}), z = l((e) => {
|
|
560
|
+
A.current ?? R(e);
|
|
561
|
+
}), B = l((e) => {
|
|
562
|
+
let t = Se.current;
|
|
563
|
+
if (Se.current = !1, c) return;
|
|
564
|
+
if (Ee(te(e))) {
|
|
565
|
+
Te();
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
let n = e.changedTouches[0];
|
|
569
|
+
if (n == null) return;
|
|
570
|
+
if (A.current = n.identifier, !t) {
|
|
571
|
+
let t = {
|
|
572
|
+
x: n.clientX,
|
|
573
|
+
y: n.clientY
|
|
574
|
+
};
|
|
575
|
+
F(t);
|
|
576
|
+
let r = De(t);
|
|
577
|
+
if (r == null) return;
|
|
578
|
+
I(r.thumbIndex), L(r, ne, e), xe.current = 0;
|
|
579
|
+
}
|
|
580
|
+
let r = h(k.current);
|
|
581
|
+
r.addEventListener("touchmove", Oe, { passive: !0 }), r.addEventListener("touchend", R, { passive: !0 }), r.addEventListener("touchcancel", R, { passive: !0 });
|
|
582
|
+
}), V = l(() => {
|
|
583
|
+
let e = h(k.current);
|
|
584
|
+
e.removeEventListener("pointermove", Oe), e.removeEventListener("pointerup", R), e.removeEventListener("pointercancel", z), e.removeEventListener("touchmove", Oe), e.removeEventListener("touchend", R), e.removeEventListener("touchcancel", R), A.current = null, ae.current = null, M.current = null, Se.current = !1;
|
|
585
|
+
}), H = y();
|
|
586
|
+
return K.useEffect(() => {
|
|
587
|
+
let e = k.current;
|
|
588
|
+
if (!e) return () => V();
|
|
589
|
+
let t = v(e, "touchstart", B, { passive: !0 });
|
|
590
|
+
return () => {
|
|
591
|
+
t(), H.cancel(), V();
|
|
592
|
+
};
|
|
593
|
+
}, [
|
|
594
|
+
V,
|
|
595
|
+
B,
|
|
596
|
+
k,
|
|
597
|
+
H
|
|
598
|
+
]), K.useEffect(() => {
|
|
599
|
+
c && V();
|
|
600
|
+
}, [c, V]), p("div", e, {
|
|
601
|
+
state: me,
|
|
602
|
+
ref: [
|
|
603
|
+
n,
|
|
604
|
+
se,
|
|
605
|
+
k,
|
|
606
|
+
be
|
|
607
|
+
],
|
|
608
|
+
props: [{
|
|
609
|
+
"data-base-ui-slider-control": ce ? "" : void 0,
|
|
610
|
+
onPointerDown(e) {
|
|
611
|
+
Se.current = !1;
|
|
612
|
+
let n = k.current, r = te(e.nativeEvent);
|
|
613
|
+
if (!n || c || e.defaultPrevented || !t(r) || e.button !== 0) return;
|
|
614
|
+
if (Ee(r)) {
|
|
615
|
+
Te();
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
let i = {
|
|
619
|
+
x: e.clientX,
|
|
620
|
+
y: e.clientY
|
|
621
|
+
};
|
|
622
|
+
F(i);
|
|
623
|
+
let a = De(i);
|
|
624
|
+
if (a == null) return;
|
|
625
|
+
m(E.current[a.thumbIndex], ee(h(n))) ? e.preventDefault() : H.request(() => {
|
|
626
|
+
I(a.thumbIndex);
|
|
627
|
+
}), fe(!0), T.current ?? L(a, ne, e.nativeEvent), e.nativeEvent.pointerId && n.setPointerCapture(e.nativeEvent.pointerId), xe.current = 0, Se.current = Xe(e.pointerType);
|
|
628
|
+
let o = h(n);
|
|
629
|
+
o.addEventListener("pointermove", Oe, { passive: !0 }), o.addEventListener("pointerup", R, { once: !0 }), o.addEventListener("pointercancel", z, { once: !0 });
|
|
630
|
+
}
|
|
631
|
+
}, s],
|
|
632
|
+
stateAttributesMapping: Ke
|
|
633
|
+
});
|
|
634
|
+
});
|
|
635
|
+
process.env.NODE_ENV !== "production" && ($.displayName = "SliderControl");
|
|
636
|
+
var it = /*#__PURE__*/ K.forwardRef(function(e, t) {
|
|
637
|
+
let { render: n, className: r, style: i, ...a } = e, { state: o } = Je();
|
|
638
|
+
return p("div", e, {
|
|
639
|
+
state: o,
|
|
640
|
+
ref: t,
|
|
641
|
+
props: [{ style: { position: "relative" } }, a],
|
|
642
|
+
stateAttributesMapping: Ke
|
|
643
|
+
});
|
|
644
|
+
});
|
|
645
|
+
process.env.NODE_ENV !== "production" && (it.displayName = "SliderTrack");
|
|
646
|
+
var at = "data-index", ot, st = /* @__PURE__ */ new Set([
|
|
647
|
+
...ge,
|
|
648
|
+
ve,
|
|
649
|
+
me
|
|
650
|
+
]);
|
|
651
|
+
function ct(e, t, n, r) {
|
|
652
|
+
if (!(t < 0)) return e.length === 2 ? `${I(e[t], r, n)} ${t === 0 ? "start" : "end"} range` : n ? I(e[t], r, n) : void 0;
|
|
653
|
+
}
|
|
654
|
+
function lt(e, t, n, r, i) {
|
|
655
|
+
let a = e + t * n, o = Number(a.toFixed(Math.max(Q(e), Q(t), Q(r))));
|
|
656
|
+
return P(o, r, i);
|
|
657
|
+
}
|
|
658
|
+
var ut = /*#__PURE__*/ K.forwardRef(function(e, t) {
|
|
659
|
+
let { render: n, children: a, className: s, "aria-describedby": u, "aria-label": d, "aria-labelledby": f, "aria-valuetext": h, disabled: g = !1, getAriaLabel: v, getAriaValueText: y, id: ee, index: te, inputRef: b, onBlur: x, onFocus: S, onKeyDown: C, tabIndex: w, style: ne, ...re } = e, ie = se(ee), { active: ae, lastUsedThumbIndex: oe, controlRef: ce, disabled: le, validation: ue, format: _e, handleInputChange: O, inset: k, isArrayValue: ye, labelId: be, largeStep: A, locale: xe, max: M, min: N, minStepsBetweenValues: Ce, form: we, name: Te, orientation: P, pressedThumbCenterOffsetRef: Ee, pressedThumbIndexRef: Oe, renderBeforeHydration: R, setActive: z, setIndicatorPosition: B, state: V, step: H, thumbRefs: ke, values: U } = Je(), Ae = de(), je = g || le, W = U.length > 1, G = P === "vertical", Me = Ae === "rtl", { setTouched: Ne, validationMode: Pe } = De(), Fe = K.useRef(null), Ie = K.useRef(null), Le = Se(je, Ie), Re = K.useRef(!1), Ve = l((e) => {
|
|
660
|
+
Re.current || S?.(e);
|
|
661
|
+
}), Y = l((e) => {
|
|
662
|
+
Re.current || x?.(e);
|
|
663
|
+
}), He = se(), Ue = L(), Ge = W ? He : Ue, X = K.useMemo(() => ({ inputId: Ge }), [Ge]), { ref: qe, index: Ye } = j({ metadata: X }), Z = W ? te ?? Ye : 0, Xe = Z === U.length - 1, Q = U[Z], $e = F(Q, N, M), [et, tt] = K.useState(), nt = ze(), rt = oe >= 0 && oe < U.length ? oe : -1, $ = l(() => {
|
|
664
|
+
let e = ce.current, t = Fe.current;
|
|
665
|
+
if (!e || !t) return;
|
|
666
|
+
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = G ? "height" : "width", a = r[i] - n[i], o = (n[i] / 2 + a * $e / 100) / r[i] * 100, s = Number.isFinite(o) ? o : void 0;
|
|
667
|
+
tt(s), Z === 0 ? B((e) => [s, e[1]]) : Xe && B((e) => [e[0], s]);
|
|
668
|
+
});
|
|
669
|
+
r(() => {
|
|
670
|
+
k && queueMicrotask($);
|
|
671
|
+
}, [$, k]), r(() => {
|
|
672
|
+
k && $();
|
|
673
|
+
}, [
|
|
674
|
+
$,
|
|
675
|
+
k,
|
|
676
|
+
$e
|
|
677
|
+
]), r(() => {
|
|
678
|
+
if (!k) return;
|
|
679
|
+
let e = ce.current, t = Fe.current;
|
|
680
|
+
if (!e || !t) return;
|
|
681
|
+
let n = i(e).ResizeObserver;
|
|
682
|
+
if (typeof n != "function") return;
|
|
683
|
+
let r = new n($);
|
|
684
|
+
return r.observe(e), r.observe(t), () => {
|
|
685
|
+
r.disconnect();
|
|
686
|
+
};
|
|
687
|
+
}, [
|
|
688
|
+
ce,
|
|
689
|
+
$,
|
|
690
|
+
k
|
|
691
|
+
]);
|
|
692
|
+
let it = G ? "bottom" : "insetInlineStart", ut = G ? "left" : "top", dt;
|
|
693
|
+
W ? ae === Z ? dt = 2 : rt === Z && (dt = 1) : ae === Z && (dt = 1);
|
|
694
|
+
let ft;
|
|
695
|
+
ft = !k && !Number.isFinite($e) ? T : {
|
|
696
|
+
position: "absolute",
|
|
697
|
+
[it]: k ? "var(--position)" : `${$e}%`,
|
|
698
|
+
[ut]: "50%",
|
|
699
|
+
translate: `${(G || !Me ? -1 : 1) * 50}% ${(G ? 1 : -1) * 50}%`,
|
|
700
|
+
zIndex: dt,
|
|
701
|
+
...k && {
|
|
702
|
+
"--position": `${et ?? 0}%`,
|
|
703
|
+
visibility: R && nt || et === void 0 ? "hidden" : void 0
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
let pt;
|
|
707
|
+
G && (pt = Me ? "vertical-rl" : "vertical-lr");
|
|
708
|
+
let mt = typeof v == "function" ? v(Z) : d, ht = o({
|
|
709
|
+
"aria-label": mt,
|
|
710
|
+
"aria-labelledby": f ?? (mt == null ? be : void 0),
|
|
711
|
+
"aria-describedby": u,
|
|
712
|
+
"aria-orientation": P,
|
|
713
|
+
"aria-valuenow": Q,
|
|
714
|
+
"aria-valuetext": typeof y == "function" ? y(I(Q, xe, _e), Q, Z) : h ?? ct(U, Z, _e, xe),
|
|
715
|
+
disabled: je,
|
|
716
|
+
form: we,
|
|
717
|
+
id: Ge,
|
|
718
|
+
max: M,
|
|
719
|
+
min: N,
|
|
720
|
+
name: Te,
|
|
721
|
+
onChange(e) {
|
|
722
|
+
O(e.currentTarget.valueAsNumber, Z, e);
|
|
723
|
+
},
|
|
724
|
+
onFocus(e) {
|
|
725
|
+
let t = Re.current;
|
|
726
|
+
Re.current = !1, z(Z), Le(!0), t && e.stopPropagation();
|
|
727
|
+
},
|
|
728
|
+
onBlur(e) {
|
|
729
|
+
Re.current ? e.stopPropagation() : (z(-1), !ke.current.some((t) => m(t, e.relatedTarget)) && (Ne(!0), Le(!1), Pe === "onBlur" && ue.commit(We(Q, Z, N, M, ye, U))));
|
|
730
|
+
},
|
|
731
|
+
onKeyDown(e) {
|
|
732
|
+
if (e.defaultPrevented || !st.has(e.key)) return;
|
|
733
|
+
ge.has(e.key) && e.stopPropagation();
|
|
734
|
+
let t = null, n = 0, r = e.shiftKey ? A : H, i = Qe(Q, H, N);
|
|
735
|
+
switch (e.key) {
|
|
736
|
+
case fe:
|
|
737
|
+
n = 1;
|
|
738
|
+
break;
|
|
739
|
+
case pe:
|
|
740
|
+
n = Me ? -1 : 1;
|
|
741
|
+
break;
|
|
742
|
+
case he:
|
|
743
|
+
n = -1;
|
|
744
|
+
break;
|
|
745
|
+
case E:
|
|
746
|
+
n = Me ? 1 : -1;
|
|
747
|
+
break;
|
|
748
|
+
case ve:
|
|
749
|
+
r = A, n = 1;
|
|
750
|
+
break;
|
|
751
|
+
case me:
|
|
752
|
+
r = A, n = -1;
|
|
753
|
+
break;
|
|
754
|
+
case "End":
|
|
755
|
+
t = W && Number.isFinite(U[Z + 1]) ? U[Z + 1] - H * Ce : M;
|
|
756
|
+
break;
|
|
757
|
+
case D: t = W && Number.isFinite(U[Z - 1]) ? U[Z - 1] + H * Ce : N;
|
|
758
|
+
}
|
|
759
|
+
if (n !== 0 && (t = lt(i, r, n, N, M)), t !== null) {
|
|
760
|
+
let n = e.currentTarget;
|
|
761
|
+
_(n) || (Re.current = !0, n.blur(), n.focus({
|
|
762
|
+
preventScroll: !0,
|
|
763
|
+
focusVisible: !0
|
|
764
|
+
})), O(t, Z, e), e.preventDefault();
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
step: H,
|
|
768
|
+
style: {
|
|
769
|
+
...T,
|
|
770
|
+
width: "100%",
|
|
771
|
+
height: "100%",
|
|
772
|
+
writingMode: pt
|
|
773
|
+
},
|
|
774
|
+
tabIndex: w,
|
|
775
|
+
type: "range",
|
|
776
|
+
value: Q ?? ""
|
|
777
|
+
}, (e) => ue.getValidationProps(je, e), {
|
|
778
|
+
onFocus: Ve,
|
|
779
|
+
onBlur: Y,
|
|
780
|
+
onKeyDown: C
|
|
781
|
+
}), gt = c(Ie, ue.inputRef, b);
|
|
782
|
+
return p("div", e, {
|
|
783
|
+
state: V,
|
|
784
|
+
ref: [
|
|
785
|
+
t,
|
|
786
|
+
qe,
|
|
787
|
+
Fe
|
|
788
|
+
],
|
|
789
|
+
props: [{
|
|
790
|
+
[at]: Z,
|
|
791
|
+
children: /*#__PURE__*/ J(K.Fragment, { children: [
|
|
792
|
+
a,
|
|
793
|
+
/*#__PURE__*/ q("input", {
|
|
794
|
+
ref: gt,
|
|
795
|
+
...ht,
|
|
796
|
+
suppressHydrationWarning: !0
|
|
797
|
+
}),
|
|
798
|
+
k && Xe && R && (ot ||= /*#__PURE__*/ q(Be, { script: "" }))
|
|
799
|
+
] }),
|
|
800
|
+
id: ie,
|
|
801
|
+
onPointerDown(e) {
|
|
802
|
+
if (je) return;
|
|
803
|
+
Oe.current = Z;
|
|
804
|
+
let t = Ze(e.currentTarget, G);
|
|
805
|
+
Ee.current = (G ? e.clientY : e.clientX) - t;
|
|
806
|
+
},
|
|
807
|
+
style: ft,
|
|
808
|
+
suppressHydrationWarning: R || void 0
|
|
809
|
+
}, re],
|
|
810
|
+
stateAttributesMapping: Ke
|
|
811
|
+
});
|
|
812
|
+
});
|
|
813
|
+
process.env.NODE_ENV !== "production" && (ut.displayName = "SliderThumb");
|
|
814
|
+
function dt(e, t, n, r, i, a) {
|
|
815
|
+
let o = {
|
|
816
|
+
visibility: a || n && (r === void 0 || t && i === void 0) ? "hidden" : void 0,
|
|
817
|
+
position: e ? "absolute" : "relative",
|
|
818
|
+
[e ? "width" : "height"]: "inherit"
|
|
819
|
+
}, s = `${r ?? 0}%`, c = `${(i ?? 0) - (r ?? 0)}%`;
|
|
820
|
+
return n && (o["--start-position"] = s, s = "var(--start-position)", t && (o["--relative-size"] = c, c = "var(--relative-size)")), o[e ? "bottom" : "insetInlineStart"] = t ? s : 0, o[e ? "height" : "width"] = t ? c : s, o;
|
|
821
|
+
}
|
|
822
|
+
var ft = /*#__PURE__*/ K.forwardRef(function(e, t) {
|
|
823
|
+
let { render: n, className: r, style: i, ...a } = e, { indicatorPosition: o, inset: s, max: c, min: l, orientation: u, renderBeforeHydration: d, state: f, values: m } = Je(), h = ze(), g = dt(u === "vertical", m.length > 1, s, s ? o[0] : F(m[0], l, c), s ? o[1] : F(m[m.length - 1], l, c), s && d && h);
|
|
824
|
+
return p("div", e, {
|
|
825
|
+
state: f,
|
|
826
|
+
ref: t,
|
|
827
|
+
props: [{
|
|
828
|
+
"data-base-ui-slider-indicator": d ? "" : void 0,
|
|
829
|
+
style: g,
|
|
830
|
+
suppressHydrationWarning: d || void 0
|
|
831
|
+
}, a],
|
|
832
|
+
stateAttributesMapping: Ke
|
|
833
|
+
});
|
|
834
|
+
});
|
|
835
|
+
process.env.NODE_ENV !== "production" && (ft.displayName = "SliderIndicator");
|
|
836
|
+
var pt = K.forwardRef(function({ className: e, defaultValue: t, value: n, min: r = 0, max: i = 100, thumbAriaLabels: o, ...s }, c) {
|
|
837
|
+
let l = K.useMemo(() => Array.isArray(n) ? n : Array.isArray(t) ? t : [r], [
|
|
838
|
+
n,
|
|
839
|
+
t,
|
|
840
|
+
r
|
|
841
|
+
]);
|
|
842
|
+
return /* @__PURE__ */ q(Z, {
|
|
843
|
+
ref: c,
|
|
844
|
+
className: a("ck-slider", e),
|
|
845
|
+
"data-slot": "slider",
|
|
846
|
+
defaultValue: t,
|
|
847
|
+
value: n,
|
|
848
|
+
min: r,
|
|
849
|
+
max: i,
|
|
850
|
+
thumbAlignment: "edge",
|
|
851
|
+
...s,
|
|
852
|
+
children: /* @__PURE__ */ J($, {
|
|
853
|
+
className: "ck-slider-control",
|
|
854
|
+
children: [/* @__PURE__ */ q(it, {
|
|
855
|
+
"data-slot": "slider-track",
|
|
856
|
+
className: "ck-slider-track",
|
|
857
|
+
children: /* @__PURE__ */ q(ft, {
|
|
858
|
+
"data-slot": "slider-range",
|
|
859
|
+
className: "ck-slider-range"
|
|
860
|
+
})
|
|
861
|
+
}), Array.from({ length: l.length }, (e, t) => /* @__PURE__ */ q(ut, {
|
|
862
|
+
"data-slot": "slider-thumb",
|
|
863
|
+
className: "ck-slider-thumb",
|
|
864
|
+
"aria-label": o?.[t] ?? (l.length > 1 ? `Value ${t + 1} of ${l.length}` : "Value")
|
|
865
|
+
}, t))]
|
|
866
|
+
})
|
|
867
|
+
});
|
|
868
|
+
});
|
|
869
|
+
pt.displayName = "Slider";
|
|
870
|
+
var mt = [
|
|
871
|
+
"pen",
|
|
872
|
+
"line",
|
|
873
|
+
"rect",
|
|
874
|
+
"circle",
|
|
875
|
+
"arrow"
|
|
876
|
+
];
|
|
877
|
+
function ht(e) {
|
|
878
|
+
return e != null && mt.includes(e);
|
|
879
|
+
}
|
|
880
|
+
var gt = [
|
|
881
|
+
{
|
|
882
|
+
value: "pen",
|
|
883
|
+
label: "Pen",
|
|
884
|
+
icon: V
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
value: "line",
|
|
888
|
+
label: "Line",
|
|
889
|
+
icon: W
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
value: "rect",
|
|
893
|
+
label: "Rectangle",
|
|
894
|
+
icon: ke
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
value: "circle",
|
|
898
|
+
label: "Circle",
|
|
899
|
+
icon: Ae
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
value: "arrow",
|
|
903
|
+
label: "Arrow",
|
|
904
|
+
icon: je
|
|
905
|
+
}
|
|
906
|
+
], _t = K.memo(function({ tools: e, colors: t, drawing: n, onSave: r, saveDisabled: i, onCancel: a }) {
|
|
907
|
+
let o = e ? gt.filter((t) => e.includes(t.value)) : gt;
|
|
908
|
+
function s(e) {
|
|
909
|
+
let t = e[0];
|
|
910
|
+
ht(t) && n.setTool(t);
|
|
911
|
+
}
|
|
912
|
+
function c(e) {
|
|
913
|
+
let t = e[0];
|
|
914
|
+
t && n.setColor(t);
|
|
915
|
+
}
|
|
916
|
+
return /* @__PURE__ */ J("div", {
|
|
917
|
+
className: "ck-annotation-toolbar",
|
|
918
|
+
role: "toolbar",
|
|
919
|
+
"aria-label": "Annotation tools",
|
|
920
|
+
children: [
|
|
921
|
+
/* @__PURE__ */ q(N, {
|
|
922
|
+
value: [n.tool],
|
|
923
|
+
onValueChange: s,
|
|
924
|
+
size: "sm",
|
|
925
|
+
spacing: 1,
|
|
926
|
+
"aria-label": "Drawing tool",
|
|
927
|
+
children: o.map(({ value: e, label: t, icon: n }) => /* @__PURE__ */ J(S, { children: [/* @__PURE__ */ q(x, {
|
|
928
|
+
render: /* @__PURE__ */ q(A, {
|
|
929
|
+
value: e,
|
|
930
|
+
"aria-label": t
|
|
931
|
+
}),
|
|
932
|
+
children: /* @__PURE__ */ q(n, {
|
|
933
|
+
size: 16,
|
|
934
|
+
stroke: 2
|
|
935
|
+
})
|
|
936
|
+
}), /* @__PURE__ */ q(b, { children: t })] }, e))
|
|
937
|
+
}),
|
|
938
|
+
/* @__PURE__ */ q(C, {
|
|
939
|
+
orientation: "vertical",
|
|
940
|
+
className: "ck-annotation-separator"
|
|
941
|
+
}),
|
|
942
|
+
/* @__PURE__ */ q(N, {
|
|
943
|
+
value: [n.color],
|
|
944
|
+
onValueChange: c,
|
|
945
|
+
size: "sm",
|
|
946
|
+
spacing: 1,
|
|
947
|
+
"aria-label": "Stroke color",
|
|
948
|
+
children: t.map((e) => /* @__PURE__ */ J(S, { children: [/* @__PURE__ */ q(x, {
|
|
949
|
+
render: /* @__PURE__ */ q(A, {
|
|
950
|
+
value: e.value,
|
|
951
|
+
"aria-label": e.label
|
|
952
|
+
}),
|
|
953
|
+
children: /* @__PURE__ */ q("span", {
|
|
954
|
+
className: "ck-annotation-swatch",
|
|
955
|
+
style: { "--ck-bg": e.value }
|
|
956
|
+
})
|
|
957
|
+
}), /* @__PURE__ */ q(b, { children: e.label })] }, e.value))
|
|
958
|
+
}),
|
|
959
|
+
/* @__PURE__ */ q(C, {
|
|
960
|
+
orientation: "vertical",
|
|
961
|
+
className: "ck-annotation-separator"
|
|
962
|
+
}),
|
|
963
|
+
/* @__PURE__ */ J("div", {
|
|
964
|
+
className: "ck-annotation-stroke",
|
|
965
|
+
children: [/* @__PURE__ */ q(pt, {
|
|
966
|
+
className: "ck-annotation-slider",
|
|
967
|
+
value: [n.strokeWidth],
|
|
968
|
+
onValueChange: (e) => {
|
|
969
|
+
let t = Array.isArray(e) ? e[0] : e;
|
|
970
|
+
t != null && Number.isFinite(t) && n.setStrokeWidth(t);
|
|
971
|
+
},
|
|
972
|
+
min: 1,
|
|
973
|
+
max: 12,
|
|
974
|
+
step: 1,
|
|
975
|
+
"aria-label": "Stroke width"
|
|
976
|
+
}), /* @__PURE__ */ J("span", {
|
|
977
|
+
className: "ck-annotation-stroke-label",
|
|
978
|
+
children: [n.strokeWidth, "px"]
|
|
979
|
+
})]
|
|
980
|
+
}),
|
|
981
|
+
/* @__PURE__ */ q(C, {
|
|
982
|
+
orientation: "vertical",
|
|
983
|
+
className: "ck-annotation-separator"
|
|
984
|
+
}),
|
|
985
|
+
/* @__PURE__ */ J(_e, { children: [
|
|
986
|
+
/* @__PURE__ */ J(S, { children: [/* @__PURE__ */ q(x, {
|
|
987
|
+
render: /* @__PURE__ */ q(f, {
|
|
988
|
+
variant: "outline",
|
|
989
|
+
size: "icon-sm",
|
|
990
|
+
"aria-label": "Undo",
|
|
991
|
+
onClick: () => n.undo(),
|
|
992
|
+
disabled: !n.canUndo
|
|
993
|
+
}),
|
|
994
|
+
children: /* @__PURE__ */ q(G, {
|
|
995
|
+
size: 16,
|
|
996
|
+
stroke: 2
|
|
997
|
+
})
|
|
998
|
+
}), /* @__PURE__ */ q(b, { children: /* @__PURE__ */ J("span", {
|
|
999
|
+
className: "ck-annotation-tooltip",
|
|
1000
|
+
children: [
|
|
1001
|
+
"Undo",
|
|
1002
|
+
" ",
|
|
1003
|
+
/* @__PURE__ */ J(k, { children: [/* @__PURE__ */ q(z, { children: "⌘" }), /* @__PURE__ */ q(z, { children: "Z" })] })
|
|
1004
|
+
]
|
|
1005
|
+
}) })] }),
|
|
1006
|
+
/* @__PURE__ */ J(S, { children: [/* @__PURE__ */ q(x, {
|
|
1007
|
+
render: /* @__PURE__ */ q(f, {
|
|
1008
|
+
variant: "outline",
|
|
1009
|
+
size: "icon-sm",
|
|
1010
|
+
"aria-label": "Redo",
|
|
1011
|
+
onClick: () => n.redo(),
|
|
1012
|
+
disabled: !n.canRedo
|
|
1013
|
+
}),
|
|
1014
|
+
children: /* @__PURE__ */ q(U, {
|
|
1015
|
+
size: 16,
|
|
1016
|
+
stroke: 2
|
|
1017
|
+
})
|
|
1018
|
+
}), /* @__PURE__ */ q(b, { children: /* @__PURE__ */ J("span", {
|
|
1019
|
+
className: "ck-annotation-tooltip",
|
|
1020
|
+
children: [
|
|
1021
|
+
"Redo",
|
|
1022
|
+
" ",
|
|
1023
|
+
/* @__PURE__ */ J(k, { children: [
|
|
1024
|
+
/* @__PURE__ */ q(z, { children: "⌘" }),
|
|
1025
|
+
/* @__PURE__ */ q(z, { children: "⇧" }),
|
|
1026
|
+
/* @__PURE__ */ q(z, { children: "Z" })
|
|
1027
|
+
] })
|
|
1028
|
+
]
|
|
1029
|
+
}) })] }),
|
|
1030
|
+
/* @__PURE__ */ J(S, { children: [/* @__PURE__ */ q(x, {
|
|
1031
|
+
render: /* @__PURE__ */ q(f, {
|
|
1032
|
+
variant: "outline",
|
|
1033
|
+
size: "icon-sm",
|
|
1034
|
+
"aria-label": "Clear all",
|
|
1035
|
+
onClick: () => n.clear(),
|
|
1036
|
+
disabled: n.paths.length === 0
|
|
1037
|
+
}),
|
|
1038
|
+
children: /* @__PURE__ */ q(Me, {
|
|
1039
|
+
size: 16,
|
|
1040
|
+
stroke: 2
|
|
1041
|
+
})
|
|
1042
|
+
}), /* @__PURE__ */ q(b, { children: "Clear all" })] })
|
|
1043
|
+
] }),
|
|
1044
|
+
/* @__PURE__ */ q(C, {
|
|
1045
|
+
orientation: "vertical",
|
|
1046
|
+
className: "ck-annotation-separator"
|
|
1047
|
+
}),
|
|
1048
|
+
r ? /* @__PURE__ */ J(_e, { children: [/* @__PURE__ */ J(S, { children: [/* @__PURE__ */ q(x, {
|
|
1049
|
+
render: /* @__PURE__ */ q(f, {
|
|
1050
|
+
variant: "outline",
|
|
1051
|
+
size: "icon-sm",
|
|
1052
|
+
"aria-label": "Cancel",
|
|
1053
|
+
onClick: a
|
|
1054
|
+
}),
|
|
1055
|
+
children: /* @__PURE__ */ q(H, {
|
|
1056
|
+
size: 16,
|
|
1057
|
+
stroke: 2
|
|
1058
|
+
})
|
|
1059
|
+
}), /* @__PURE__ */ q(b, { children: /* @__PURE__ */ J("span", {
|
|
1060
|
+
className: "ck-annotation-tooltip",
|
|
1061
|
+
children: ["Cancel ", /* @__PURE__ */ q(z, { children: "Esc" })]
|
|
1062
|
+
}) })] }), /* @__PURE__ */ J(S, { children: [/* @__PURE__ */ q(x, {
|
|
1063
|
+
render: /* @__PURE__ */ q(f, {
|
|
1064
|
+
size: "icon-sm",
|
|
1065
|
+
"aria-label": "Save drawing",
|
|
1066
|
+
"aria-disabled": i || void 0,
|
|
1067
|
+
className: d(i && "ck-annotation-save--disabled"),
|
|
1068
|
+
onClick: () => {
|
|
1069
|
+
i || r();
|
|
1070
|
+
}
|
|
1071
|
+
}),
|
|
1072
|
+
children: /* @__PURE__ */ q(B, {
|
|
1073
|
+
size: 16,
|
|
1074
|
+
stroke: 2
|
|
1075
|
+
})
|
|
1076
|
+
}), /* @__PURE__ */ q(b, { children: i ? "Draw something first" : "Save drawing" })] })] }) : /* @__PURE__ */ J(S, { children: [/* @__PURE__ */ q(x, {
|
|
1077
|
+
render: /* @__PURE__ */ q(f, {
|
|
1078
|
+
variant: "outline",
|
|
1079
|
+
size: "icon-sm",
|
|
1080
|
+
"aria-label": "Cancel",
|
|
1081
|
+
onClick: a
|
|
1082
|
+
}),
|
|
1083
|
+
children: /* @__PURE__ */ q(H, {
|
|
1084
|
+
size: 16,
|
|
1085
|
+
stroke: 2
|
|
1086
|
+
})
|
|
1087
|
+
}), /* @__PURE__ */ q(b, { children: /* @__PURE__ */ J("span", {
|
|
1088
|
+
className: "ck-annotation-tooltip",
|
|
1089
|
+
children: ["Cancel ", /* @__PURE__ */ q(z, { children: "Esc" })]
|
|
1090
|
+
}) })] })
|
|
1091
|
+
]
|
|
1092
|
+
});
|
|
1093
|
+
});
|
|
1094
|
+
export { He as n, Ve as r, _t as t };
|