react-sync-board 1.1.1 → 1.1.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.
@@ -1,11 +1,11 @@
1
1
  var Dr = Object.defineProperty;
2
2
  var $r = (e, t, r) => t in e ? Dr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var Ot = (e, t, r) => ($r(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import g, { useContext as be, useDebugValue as Ar, useRef as Ie, useMemo as ct, useEffect as Me, useCallback as Jt, memo as Zt } from "react";
5
- function zr(e) {
4
+ import m, { useContext as be, useDebugValue as Ar, useRef as Ie, useMemo as ct, useEffect as Me, useCallback as Jt, memo as Zt } from "react";
5
+ function Lr(e) {
6
6
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
7
7
  }
8
- var Oe = {}, Lr = {
8
+ var Oe = {}, zr = {
9
9
  get exports() {
10
10
  return Oe;
11
11
  },
@@ -27,7 +27,7 @@ function Yr() {
27
27
  if (Tt)
28
28
  return we;
29
29
  Tt = 1;
30
- var e = g, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
30
+ var e = m, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
31
31
  function a(u, l, d) {
32
32
  var f, c = {}, b = null, _ = null;
33
33
  d !== void 0 && (b = "" + d), l.key !== void 0 && (b = "" + l.key), l.ref !== void 0 && (_ = l.ref);
@@ -53,51 +53,51 @@ var Ce = {};
53
53
  var kt;
54
54
  function Br() {
55
55
  return kt || (kt = 1, process.env.NODE_ENV !== "production" && function() {
56
- var e = g, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), u = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), c = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), w = Symbol.iterator, m = "@@iterator";
57
- function E(i) {
56
+ var e = m, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), u = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), c = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), C = Symbol.iterator, h = "@@iterator";
57
+ function S(i) {
58
58
  if (i === null || typeof i != "object")
59
59
  return null;
60
- var S = w && i[w] || i[m];
61
- return typeof S == "function" ? S : null;
60
+ var y = C && i[C] || i[h];
61
+ return typeof y == "function" ? y : null;
62
62
  }
63
- var R = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
63
+ var E = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
64
64
  function x(i) {
65
65
  {
66
- for (var S = arguments.length, I = new Array(S > 1 ? S - 1 : 0), j = 1; j < S; j++)
66
+ for (var y = arguments.length, I = new Array(y > 1 ? y - 1 : 0), j = 1; j < y; j++)
67
67
  I[j - 1] = arguments[j];
68
- y("error", i, I);
68
+ v("error", i, I);
69
69
  }
70
70
  }
71
- function y(i, S, I) {
71
+ function v(i, y, I) {
72
72
  {
73
- var j = R.ReactDebugCurrentFrame, B = j.getStackAddendum();
74
- B !== "" && (S += "%s", I = I.concat([B]));
75
- var X = I.map(function(L) {
76
- return String(L);
73
+ var j = E.ReactDebugCurrentFrame, U = j.getStackAddendum();
74
+ U !== "" && (y += "%s", I = I.concat([U]));
75
+ var W = I.map(function(Y) {
76
+ return String(Y);
77
77
  });
78
- X.unshift("Warning: " + S), Function.prototype.apply.call(console[i], console, X);
78
+ W.unshift("Warning: " + y), Function.prototype.apply.call(console[i], console, W);
79
79
  }
80
80
  }
81
- var p = !1, h = !1, v = !1, C = !1, D = !1, k;
82
- k = Symbol.for("react.module.reference");
83
- function P(i) {
84
- return !!(typeof i == "string" || typeof i == "function" || i === n || i === s || D || i === o || i === d || i === f || C || i === _ || p || h || v || typeof i == "object" && i !== null && (i.$$typeof === b || i.$$typeof === c || i.$$typeof === a || i.$$typeof === u || i.$$typeof === l || // This needs to include all possible module reference object
81
+ var p = !1, R = !1, w = !1, g = !1, k = !1, P;
82
+ P = Symbol.for("react.module.reference");
83
+ function M(i) {
84
+ return !!(typeof i == "string" || typeof i == "function" || i === n || i === s || k || i === o || i === d || i === f || g || i === _ || p || R || w || typeof i == "object" && i !== null && (i.$$typeof === b || i.$$typeof === c || i.$$typeof === a || i.$$typeof === u || i.$$typeof === l || // This needs to include all possible module reference object
85
85
  // types supported by any Flight configuration anywhere since
86
86
  // we don't know which Flight build this will end up being used
87
87
  // with.
88
- i.$$typeof === k || i.getModuleId !== void 0));
88
+ i.$$typeof === P || i.getModuleId !== void 0));
89
89
  }
90
- function M(i, S, I) {
90
+ function $(i, y, I) {
91
91
  var j = i.displayName;
92
92
  if (j)
93
93
  return j;
94
- var B = S.displayName || S.name || "";
95
- return B !== "" ? I + "(" + B + ")" : I;
94
+ var U = y.displayName || y.name || "";
95
+ return U !== "" ? I + "(" + U + ")" : I;
96
96
  }
97
- function N(i) {
97
+ function B(i) {
98
98
  return i.displayName || "Context";
99
99
  }
100
- function F(i) {
100
+ function N(i) {
101
101
  if (i == null)
102
102
  return null;
103
103
  if (typeof i.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
@@ -121,20 +121,20 @@ function Br() {
121
121
  if (typeof i == "object")
122
122
  switch (i.$$typeof) {
123
123
  case u:
124
- var S = i;
125
- return N(S) + ".Consumer";
124
+ var y = i;
125
+ return B(y) + ".Consumer";
126
126
  case a:
127
127
  var I = i;
128
- return N(I._context) + ".Provider";
128
+ return B(I._context) + ".Provider";
129
129
  case l:
130
- return M(i, i.render, "ForwardRef");
130
+ return $(i, i.render, "ForwardRef");
131
131
  case c:
132
132
  var j = i.displayName || null;
133
- return j !== null ? j : F(i.type) || "Memo";
133
+ return j !== null ? j : N(i.type) || "Memo";
134
134
  case b: {
135
- var B = i, X = B._payload, L = B._init;
135
+ var U = i, W = U._payload, Y = U._init;
136
136
  try {
137
- return F(L(X));
137
+ return N(Y(W));
138
138
  } catch {
139
139
  return null;
140
140
  }
@@ -142,14 +142,14 @@ function Br() {
142
142
  }
143
143
  return null;
144
144
  }
145
- var K = Object.assign, O = 0, $, A, U, Y, W, J, te;
145
+ var K = Object.assign, O = 0, D, A, X, z, F, H, te;
146
146
  function re() {
147
147
  }
148
148
  re.__reactDisabledLog = !0;
149
149
  function ne() {
150
150
  {
151
151
  if (O === 0) {
152
- $ = console.log, A = console.info, U = console.warn, Y = console.error, W = console.group, J = console.groupCollapsed, te = console.groupEnd;
152
+ D = console.log, A = console.info, X = console.warn, z = console.error, F = console.group, H = console.groupCollapsed, te = console.groupEnd;
153
153
  var i = {
154
154
  configurable: !0,
155
155
  enumerable: !0,
@@ -179,22 +179,22 @@ function Br() {
179
179
  };
180
180
  Object.defineProperties(console, {
181
181
  log: K({}, i, {
182
- value: $
182
+ value: D
183
183
  }),
184
184
  info: K({}, i, {
185
185
  value: A
186
186
  }),
187
187
  warn: K({}, i, {
188
- value: U
188
+ value: X
189
189
  }),
190
190
  error: K({}, i, {
191
- value: Y
191
+ value: z
192
192
  }),
193
193
  group: K({}, i, {
194
- value: W
194
+ value: F
195
195
  }),
196
196
  groupCollapsed: K({}, i, {
197
- value: J
197
+ value: H
198
198
  }),
199
199
  groupEnd: K({}, i, {
200
200
  value: te
@@ -204,18 +204,18 @@ function Br() {
204
204
  O < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
205
205
  }
206
206
  }
207
- var ee = R.ReactCurrentDispatcher, le;
208
- function he(i, S, I) {
207
+ var ee = E.ReactCurrentDispatcher, fe;
208
+ function he(i, y, I) {
209
209
  {
210
- if (le === void 0)
210
+ if (fe === void 0)
211
211
  try {
212
212
  throw Error();
213
- } catch (B) {
214
- var j = B.stack.trim().match(/\n( *(at )?)/);
215
- le = j && j[1] || "";
213
+ } catch (U) {
214
+ var j = U.stack.trim().match(/\n( *(at )?)/);
215
+ fe = j && j[1] || "";
216
216
  }
217
217
  return `
218
- ` + le + i;
218
+ ` + fe + i;
219
219
  }
220
220
  }
221
221
  var Ve = !1, je;
@@ -223,7 +223,7 @@ function Br() {
223
223
  var fr = typeof WeakMap == "function" ? WeakMap : Map;
224
224
  je = new fr();
225
225
  }
226
- function mt(i, S) {
226
+ function mt(i, y) {
227
227
  if (!i || Ve)
228
228
  return "";
229
229
  {
@@ -233,33 +233,33 @@ function Br() {
233
233
  }
234
234
  var j;
235
235
  Ve = !0;
236
- var B = Error.prepareStackTrace;
236
+ var U = Error.prepareStackTrace;
237
237
  Error.prepareStackTrace = void 0;
238
- var X;
239
- X = ee.current, ee.current = null, ne();
238
+ var W;
239
+ W = ee.current, ee.current = null, ne();
240
240
  try {
241
- if (S) {
242
- var L = function() {
241
+ if (y) {
242
+ var Y = function() {
243
243
  throw Error();
244
244
  };
245
- if (Object.defineProperty(L.prototype, "props", {
245
+ if (Object.defineProperty(Y.prototype, "props", {
246
246
  set: function() {
247
247
  throw Error();
248
248
  }
249
249
  }), typeof Reflect == "object" && Reflect.construct) {
250
250
  try {
251
- Reflect.construct(L, []);
251
+ Reflect.construct(Y, []);
252
252
  } catch (ae) {
253
253
  j = ae;
254
254
  }
255
- Reflect.construct(i, [], L);
255
+ Reflect.construct(i, [], Y);
256
256
  } else {
257
257
  try {
258
- L.call();
258
+ Y.call();
259
259
  } catch (ae) {
260
260
  j = ae;
261
261
  }
262
- i.call(L.prototype);
262
+ i.call(Y.prototype);
263
263
  }
264
264
  } else {
265
265
  try {
@@ -271,37 +271,37 @@ function Br() {
271
271
  }
272
272
  } catch (ae) {
273
273
  if (ae && j && typeof ae.stack == "string") {
274
- for (var z = ae.stack.split(`
274
+ for (var L = ae.stack.split(`
275
275
  `), Q = j.stack.split(`
276
- `), q = z.length - 1, G = Q.length - 1; q >= 1 && G >= 0 && z[q] !== Q[G]; )
277
- G--;
278
- for (; q >= 1 && G >= 0; q--, G--)
279
- if (z[q] !== Q[G]) {
280
- if (q !== 1 || G !== 1)
276
+ `), G = L.length - 1, J = Q.length - 1; G >= 1 && J >= 0 && L[G] !== Q[J]; )
277
+ J--;
278
+ for (; G >= 1 && J >= 0; G--, J--)
279
+ if (L[G] !== Q[J]) {
280
+ if (G !== 1 || J !== 1)
281
281
  do
282
- if (q--, G--, G < 0 || z[q] !== Q[G]) {
282
+ if (G--, J--, J < 0 || L[G] !== Q[J]) {
283
283
  var oe = `
284
- ` + z[q].replace(" at new ", " at ");
284
+ ` + L[G].replace(" at new ", " at ");
285
285
  return i.displayName && oe.includes("<anonymous>") && (oe = oe.replace("<anonymous>", i.displayName)), typeof i == "function" && je.set(i, oe), oe;
286
286
  }
287
- while (q >= 1 && G >= 0);
287
+ while (G >= 1 && J >= 0);
288
288
  break;
289
289
  }
290
290
  }
291
291
  } finally {
292
- Ve = !1, ee.current = X, V(), Error.prepareStackTrace = B;
292
+ Ve = !1, ee.current = W, V(), Error.prepareStackTrace = U;
293
293
  }
294
294
  var ye = i ? i.displayName || i.name : "", It = ye ? he(ye) : "";
295
295
  return typeof i == "function" && je.set(i, It), It;
296
296
  }
297
- function dr(i, S, I) {
297
+ function dr(i, y, I) {
298
298
  return mt(i, !1);
299
299
  }
300
300
  function pr(i) {
301
- var S = i.prototype;
302
- return !!(S && S.isReactComponent);
301
+ var y = i.prototype;
302
+ return !!(y && y.isReactComponent);
303
303
  }
304
- function De(i, S, I) {
304
+ function De(i, y, I) {
305
305
  if (i == null)
306
306
  return "";
307
307
  if (typeof i == "function")
@@ -319,41 +319,41 @@ function Br() {
319
319
  case l:
320
320
  return dr(i.render);
321
321
  case c:
322
- return De(i.type, S, I);
322
+ return De(i.type, y, I);
323
323
  case b: {
324
- var j = i, B = j._payload, X = j._init;
324
+ var j = i, U = j._payload, W = j._init;
325
325
  try {
326
- return De(X(B), S, I);
326
+ return De(W(U), y, I);
327
327
  } catch {
328
328
  }
329
329
  }
330
330
  }
331
331
  return "";
332
332
  }
333
- var $e = Object.prototype.hasOwnProperty, gt = {}, ht = R.ReactDebugCurrentFrame;
333
+ var $e = Object.prototype.hasOwnProperty, gt = {}, ht = E.ReactDebugCurrentFrame;
334
334
  function Ae(i) {
335
335
  if (i) {
336
- var S = i._owner, I = De(i.type, i._source, S ? S.type : null);
336
+ var y = i._owner, I = De(i.type, i._source, y ? y.type : null);
337
337
  ht.setExtraStackFrame(I);
338
338
  } else
339
339
  ht.setExtraStackFrame(null);
340
340
  }
341
- function mr(i, S, I, j, B) {
341
+ function mr(i, y, I, j, U) {
342
342
  {
343
- var X = Function.call.bind($e);
344
- for (var L in i)
345
- if (X(i, L)) {
346
- var z = void 0;
343
+ var W = Function.call.bind($e);
344
+ for (var Y in i)
345
+ if (W(i, Y)) {
346
+ var L = void 0;
347
347
  try {
348
- if (typeof i[L] != "function") {
349
- var Q = Error((j || "React class") + ": " + I + " type `" + L + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[L] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
348
+ if (typeof i[Y] != "function") {
349
+ var Q = Error((j || "React class") + ": " + I + " type `" + Y + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[Y] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
350
350
  throw Q.name = "Invariant Violation", Q;
351
351
  }
352
- z = i[L](S, L, j, I, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
353
- } catch (q) {
354
- z = q;
352
+ L = i[Y](y, Y, j, I, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
353
+ } catch (G) {
354
+ L = G;
355
355
  }
356
- z && !(z instanceof Error) && (Ae(B), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", j || "React class", I, L, typeof z), Ae(null)), z instanceof Error && !(z.message in gt) && (gt[z.message] = !0, Ae(B), x("Failed %s type: %s", I, z.message), Ae(null));
356
+ L && !(L instanceof Error) && (Ae(U), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", j || "React class", I, Y, typeof L), Ae(null)), L instanceof Error && !(L.message in gt) && (gt[L.message] = !0, Ae(U), x("Failed %s type: %s", I, L.message), Ae(null));
357
357
  }
358
358
  }
359
359
  }
@@ -363,7 +363,7 @@ function Br() {
363
363
  }
364
364
  function hr(i) {
365
365
  {
366
- var S = typeof Symbol == "function" && Symbol.toStringTag, I = S && i[Symbol.toStringTag] || i.constructor.name || "Object";
366
+ var y = typeof Symbol == "function" && Symbol.toStringTag, I = y && i[Symbol.toStringTag] || i.constructor.name || "Object";
367
367
  return I;
368
368
  }
369
369
  }
@@ -381,7 +381,7 @@ function Br() {
381
381
  if (vr(i))
382
382
  return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", hr(i)), vt(i);
383
383
  }
384
- var Ee = R.ReactCurrentOwner, yr = {
384
+ var Ee = E.ReactCurrentOwner, yr = {
385
385
  key: !0,
386
386
  ref: !0,
387
387
  __self: !0,
@@ -390,30 +390,30 @@ function Br() {
390
390
  Ke = {};
391
391
  function Sr(i) {
392
392
  if ($e.call(i, "ref")) {
393
- var S = Object.getOwnPropertyDescriptor(i, "ref").get;
394
- if (S && S.isReactWarning)
393
+ var y = Object.getOwnPropertyDescriptor(i, "ref").get;
394
+ if (y && y.isReactWarning)
395
395
  return !1;
396
396
  }
397
397
  return i.ref !== void 0;
398
398
  }
399
399
  function _r(i) {
400
400
  if ($e.call(i, "key")) {
401
- var S = Object.getOwnPropertyDescriptor(i, "key").get;
402
- if (S && S.isReactWarning)
401
+ var y = Object.getOwnPropertyDescriptor(i, "key").get;
402
+ if (y && y.isReactWarning)
403
403
  return !1;
404
404
  }
405
405
  return i.key !== void 0;
406
406
  }
407
- function br(i, S) {
408
- if (typeof i.ref == "string" && Ee.current && S && Ee.current.stateNode !== S) {
409
- var I = F(Ee.current.type);
410
- Ke[I] || (x('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', F(Ee.current.type), i.ref), Ke[I] = !0);
407
+ function br(i, y) {
408
+ if (typeof i.ref == "string" && Ee.current && y && Ee.current.stateNode !== y) {
409
+ var I = N(Ee.current.type);
410
+ Ke[I] || (x('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', N(Ee.current.type), i.ref), Ke[I] = !0);
411
411
  }
412
412
  }
413
- function Er(i, S) {
413
+ function Er(i, y) {
414
414
  {
415
415
  var I = function() {
416
- St || (St = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", S));
416
+ St || (St = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", y));
417
417
  };
418
418
  I.isReactWarning = !0, Object.defineProperty(i, "key", {
419
419
  get: I,
@@ -421,10 +421,10 @@ function Br() {
421
421
  });
422
422
  }
423
423
  }
424
- function wr(i, S) {
424
+ function wr(i, y) {
425
425
  {
426
426
  var I = function() {
427
- _t || (_t = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", S));
427
+ _t || (_t = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", y));
428
428
  };
429
429
  I.isReactWarning = !0, Object.defineProperty(i, "ref", {
430
430
  get: I,
@@ -432,57 +432,57 @@ function Br() {
432
432
  });
433
433
  }
434
434
  }
435
- var Cr = function(i, S, I, j, B, X, L) {
436
- var z = {
435
+ var Cr = function(i, y, I, j, U, W, Y) {
436
+ var L = {
437
437
  // This tag allows us to uniquely identify this as a React Element
438
438
  $$typeof: t,
439
439
  // Built-in properties that belong on the element
440
440
  type: i,
441
- key: S,
441
+ key: y,
442
442
  ref: I,
443
- props: L,
443
+ props: Y,
444
444
  // Record the component responsible for creating this element.
445
- _owner: X
445
+ _owner: W
446
446
  };
447
- return z._store = {}, Object.defineProperty(z._store, "validated", {
447
+ return L._store = {}, Object.defineProperty(L._store, "validated", {
448
448
  configurable: !1,
449
449
  enumerable: !1,
450
450
  writable: !0,
451
451
  value: !1
452
- }), Object.defineProperty(z, "_self", {
452
+ }), Object.defineProperty(L, "_self", {
453
453
  configurable: !1,
454
454
  enumerable: !1,
455
455
  writable: !1,
456
456
  value: j
457
- }), Object.defineProperty(z, "_source", {
457
+ }), Object.defineProperty(L, "_source", {
458
458
  configurable: !1,
459
459
  enumerable: !1,
460
460
  writable: !1,
461
- value: B
462
- }), Object.freeze && (Object.freeze(z.props), Object.freeze(z)), z;
461
+ value: U
462
+ }), Object.freeze && (Object.freeze(L.props), Object.freeze(L)), L;
463
463
  };
464
- function xr(i, S, I, j, B) {
464
+ function xr(i, y, I, j, U) {
465
465
  {
466
- var X, L = {}, z = null, Q = null;
467
- I !== void 0 && (yt(I), z = "" + I), _r(S) && (yt(S.key), z = "" + S.key), Sr(S) && (Q = S.ref, br(S, B));
468
- for (X in S)
469
- $e.call(S, X) && !yr.hasOwnProperty(X) && (L[X] = S[X]);
466
+ var W, Y = {}, L = null, Q = null;
467
+ I !== void 0 && (yt(I), L = "" + I), _r(y) && (yt(y.key), L = "" + y.key), Sr(y) && (Q = y.ref, br(y, U));
468
+ for (W in y)
469
+ $e.call(y, W) && !yr.hasOwnProperty(W) && (Y[W] = y[W]);
470
470
  if (i && i.defaultProps) {
471
- var q = i.defaultProps;
472
- for (X in q)
473
- L[X] === void 0 && (L[X] = q[X]);
471
+ var G = i.defaultProps;
472
+ for (W in G)
473
+ Y[W] === void 0 && (Y[W] = G[W]);
474
474
  }
475
- if (z || Q) {
476
- var G = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
477
- z && Er(L, G), Q && wr(L, G);
475
+ if (L || Q) {
476
+ var J = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
477
+ L && Er(Y, J), Q && wr(Y, J);
478
478
  }
479
- return Cr(i, z, Q, B, j, Ee.current, L);
479
+ return Cr(i, L, Q, U, j, Ee.current, Y);
480
480
  }
481
481
  }
482
- var He = R.ReactCurrentOwner, bt = R.ReactDebugCurrentFrame;
482
+ var He = E.ReactCurrentOwner, bt = E.ReactDebugCurrentFrame;
483
483
  function ve(i) {
484
484
  if (i) {
485
- var S = i._owner, I = De(i.type, i._source, S ? S.type : null);
485
+ var y = i._owner, I = De(i.type, i._source, y ? y.type : null);
486
486
  bt.setExtraStackFrame(I);
487
487
  } else
488
488
  bt.setExtraStackFrame(null);
@@ -495,7 +495,7 @@ function Br() {
495
495
  function Et() {
496
496
  {
497
497
  if (He.current) {
498
- var i = F(He.current.type);
498
+ var i = N(He.current.type);
499
499
  if (i)
500
500
  return `
501
501
 
@@ -507,10 +507,10 @@ Check the render method of \`` + i + "`.";
507
507
  function Rr(i) {
508
508
  {
509
509
  if (i !== void 0) {
510
- var S = i.fileName.replace(/^.*[\\\/]/, ""), I = i.lineNumber;
510
+ var y = i.fileName.replace(/^.*[\\\/]/, ""), I = i.lineNumber;
511
511
  return `
512
512
 
513
- Check your code at ` + S + ":" + I + ".";
513
+ Check your code at ` + y + ":" + I + ".";
514
514
  }
515
515
  return "";
516
516
  }
@@ -518,77 +518,77 @@ Check your code at ` + S + ":" + I + ".";
518
518
  var wt = {};
519
519
  function Ir(i) {
520
520
  {
521
- var S = Et();
522
- if (!S) {
521
+ var y = Et();
522
+ if (!y) {
523
523
  var I = typeof i == "string" ? i : i.displayName || i.name;
524
- I && (S = `
524
+ I && (y = `
525
525
 
526
526
  Check the top-level render call using <` + I + ">.");
527
527
  }
528
- return S;
528
+ return y;
529
529
  }
530
530
  }
531
- function Ct(i, S) {
531
+ function Ct(i, y) {
532
532
  {
533
533
  if (!i._store || i._store.validated || i.key != null)
534
534
  return;
535
535
  i._store.validated = !0;
536
- var I = Ir(S);
536
+ var I = Ir(y);
537
537
  if (wt[I])
538
538
  return;
539
539
  wt[I] = !0;
540
540
  var j = "";
541
- i && i._owner && i._owner !== He.current && (j = " It was passed a child from " + F(i._owner.type) + "."), ve(i), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', I, j), ve(null);
541
+ i && i._owner && i._owner !== He.current && (j = " It was passed a child from " + N(i._owner.type) + "."), ve(i), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', I, j), ve(null);
542
542
  }
543
543
  }
544
- function xt(i, S) {
544
+ function xt(i, y) {
545
545
  {
546
546
  if (typeof i != "object")
547
547
  return;
548
548
  if (Fe(i))
549
549
  for (var I = 0; I < i.length; I++) {
550
550
  var j = i[I];
551
- Ge(j) && Ct(j, S);
551
+ Ge(j) && Ct(j, y);
552
552
  }
553
553
  else if (Ge(i))
554
554
  i._store && (i._store.validated = !0);
555
555
  else if (i) {
556
- var B = E(i);
557
- if (typeof B == "function" && B !== i.entries)
558
- for (var X = B.call(i), L; !(L = X.next()).done; )
559
- Ge(L.value) && Ct(L.value, S);
556
+ var U = S(i);
557
+ if (typeof U == "function" && U !== i.entries)
558
+ for (var W = U.call(i), Y; !(Y = W.next()).done; )
559
+ Ge(Y.value) && Ct(Y.value, y);
560
560
  }
561
561
  }
562
562
  }
563
563
  function Or(i) {
564
564
  {
565
- var S = i.type;
566
- if (S == null || typeof S == "string")
565
+ var y = i.type;
566
+ if (y == null || typeof y == "string")
567
567
  return;
568
568
  var I;
569
- if (typeof S == "function")
570
- I = S.propTypes;
571
- else if (typeof S == "object" && (S.$$typeof === l || // Note: Memo only checks outer props here.
569
+ if (typeof y == "function")
570
+ I = y.propTypes;
571
+ else if (typeof y == "object" && (y.$$typeof === l || // Note: Memo only checks outer props here.
572
572
  // Inner props are checked in the reconciler.
573
- S.$$typeof === c))
574
- I = S.propTypes;
573
+ y.$$typeof === c))
574
+ I = y.propTypes;
575
575
  else
576
576
  return;
577
577
  if (I) {
578
- var j = F(S);
578
+ var j = N(y);
579
579
  mr(I, i.props, "prop", j, i);
580
- } else if (S.PropTypes !== void 0 && !qe) {
580
+ } else if (y.PropTypes !== void 0 && !qe) {
581
581
  qe = !0;
582
- var B = F(S);
583
- x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", B || "Unknown");
582
+ var U = N(y);
583
+ x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", U || "Unknown");
584
584
  }
585
- typeof S.getDefaultProps == "function" && !S.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
585
+ typeof y.getDefaultProps == "function" && !y.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
586
586
  }
587
587
  }
588
588
  function Tr(i) {
589
589
  {
590
- for (var S = Object.keys(i.props), I = 0; I < S.length; I++) {
591
- var j = S[I];
590
+ for (var y = Object.keys(i.props), I = 0; I < y.length; I++) {
591
+ var j = y[I];
592
592
  if (j !== "children" && j !== "key") {
593
593
  ve(i), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", j), ve(null);
594
594
  break;
@@ -597,22 +597,22 @@ Check the top-level render call using <` + I + ">.");
597
597
  i.ref !== null && (ve(i), x("Invalid attribute `ref` supplied to `React.Fragment`."), ve(null));
598
598
  }
599
599
  }
600
- function Rt(i, S, I, j, B, X) {
600
+ function Rt(i, y, I, j, U, W) {
601
601
  {
602
- var L = P(i);
603
- if (!L) {
604
- var z = "";
605
- (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (z += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
606
- var Q = Rr(B);
607
- Q ? z += Q : z += Et();
608
- var q;
609
- i === null ? q = "null" : Fe(i) ? q = "array" : i !== void 0 && i.$$typeof === t ? (q = "<" + (F(i.type) || "Unknown") + " />", z = " Did you accidentally export a JSX literal instead of a component?") : q = typeof i, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", q, z);
602
+ var Y = M(i);
603
+ if (!Y) {
604
+ var L = "";
605
+ (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (L += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
606
+ var Q = Rr(U);
607
+ Q ? L += Q : L += Et();
608
+ var G;
609
+ i === null ? G = "null" : Fe(i) ? G = "array" : i !== void 0 && i.$$typeof === t ? (G = "<" + (N(i.type) || "Unknown") + " />", L = " Did you accidentally export a JSX literal instead of a component?") : G = typeof i, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", G, L);
610
610
  }
611
- var G = xr(i, S, I, B, X);
612
- if (G == null)
613
- return G;
614
- if (L) {
615
- var oe = S.children;
611
+ var J = xr(i, y, I, U, W);
612
+ if (J == null)
613
+ return J;
614
+ if (Y) {
615
+ var oe = y.children;
616
616
  if (oe !== void 0)
617
617
  if (j)
618
618
  if (Fe(oe)) {
@@ -624,14 +624,14 @@ Check the top-level render call using <` + I + ">.");
624
624
  else
625
625
  xt(oe, i);
626
626
  }
627
- return i === n ? Tr(G) : Or(G), G;
627
+ return i === n ? Tr(J) : Or(J), J;
628
628
  }
629
629
  }
630
- function kr(i, S, I) {
631
- return Rt(i, S, I, !0);
630
+ function kr(i, y, I) {
631
+ return Rt(i, y, I, !0);
632
632
  }
633
- function Pr(i, S, I) {
634
- return Rt(i, S, I, !1);
633
+ function Pr(i, y, I) {
634
+ return Rt(i, y, I, !1);
635
635
  }
636
636
  var Mr = Pr, jr = kr;
637
637
  Ce.Fragment = n, Ce.jsx = Mr, Ce.jsxs = jr;
@@ -639,8 +639,8 @@ Check the top-level render call using <` + I + ">.");
639
639
  }
640
640
  (function(e) {
641
641
  process.env.NODE_ENV === "production" ? e.exports = Yr() : e.exports = Br();
642
- })(Lr);
643
- const Qt = Oe.Fragment, T = Oe.jsx, ue = Oe.jsxs;
642
+ })(zr);
643
+ const Qt = Oe.Fragment, T = Oe.jsx, le = Oe.jsxs;
644
644
  let Nr = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, r) => (r &= 63, r < 36 ? t += r.toString(36) : r < 62 ? t += (r - 26).toString(36).toUpperCase() : r > 62 ? t += "-" : t += "_", t), "");
645
645
  class Ur {
646
646
  constructor(t, r, n = null) {
@@ -761,7 +761,7 @@ const Xr = ({
761
761
  });
762
762
  }), e.emit("joinSuperSocket", { room: t, userId: o });
763
763
  });
764
- }, ot = g.createContext(), Wr = () => /* @__PURE__ */ T(
764
+ }, ot = m.createContext(), Wr = () => /* @__PURE__ */ T(
765
765
  "div",
766
766
  {
767
767
  style: {
@@ -782,30 +782,30 @@ const Xr = ({
782
782
  LoadingComponent: n = Wr,
783
783
  children: o
784
784
  }) => {
785
- const [s, a] = g.useState(!1), [u, l] = g.useState(!1), [d, f] = g.useState(null), c = g.useRef(null), b = g.useRef(!1), _ = be(ot), w = g.useRef(!1);
786
- return g.useEffect(() => (b.current = !0, () => {
785
+ const [s, a] = m.useState(!1), [u, l] = m.useState(!1), [d, f] = m.useState(null), c = m.useRef(null), b = m.useRef(!1), _ = be(ot), C = m.useRef(!1);
786
+ return m.useEffect(() => (b.current = !0, () => {
787
787
  b.current = !1;
788
- }), []), g.useEffect(() => {
788
+ }), []), m.useEffect(() => {
789
789
  if (!e)
790
790
  return null;
791
- const m = () => {
791
+ const h = () => {
792
792
  console.log(`Disconnected from ${r}…`), b.current && (a(!1), l(!1));
793
793
  };
794
- return e.on("disconnect", m), () => {
795
- e.off("disconnect", m);
794
+ return e.on("disconnect", h), () => {
795
+ e.off("disconnect", h);
796
796
  };
797
- }, [r, e]), g.useEffect(() => e ? (e.connected || e.connect(), console.log(`Try to connect to wire ${t} on channel ${r}`), w.current || (w.current = !0, Xr({
797
+ }, [r, e]), m.useEffect(() => e ? (e.connected || e.connect(), console.log(`Try to connect to wire ${t} on channel ${r}`), C.current || (C.current = !0, Xr({
798
798
  socket: e,
799
799
  room: t,
800
800
  onMaster: () => {
801
801
  console.log(`Is now master on channel ${r}…`), b.current && l(!0);
802
802
  },
803
- onJoined: (m) => {
804
- console.log(`Connected on channel ${r}…`), c.current = m, b.current && (f(m), a(!0));
803
+ onJoined: (h) => {
804
+ console.log(`Connected on channel ${r}…`), c.current = h, b.current && (f(h), a(!0));
805
805
  }
806
806
  })), () => {
807
- var m;
808
- (m = c.current) == null || m.leave();
807
+ var h;
808
+ (h = c.current) == null || h.leave();
809
809
  }) : null, [r, t, e]), !s || !d ? /* @__PURE__ */ T(n, {}) : /* @__PURE__ */ T(
810
810
  ot.Provider,
811
811
  {
@@ -857,18 +857,18 @@ function Kr() {
857
857
  if (Mt)
858
858
  return Ze;
859
859
  Mt = 1;
860
- var e = g;
860
+ var e = m;
861
861
  function t(c, b) {
862
862
  return c === b && (c !== 0 || 1 / c === 1 / b) || c !== c && b !== b;
863
863
  }
864
864
  var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, o = e.useEffect, s = e.useLayoutEffect, a = e.useDebugValue;
865
865
  function u(c, b) {
866
- var _ = b(), w = n({ inst: { value: _, getSnapshot: b } }), m = w[0].inst, E = w[1];
866
+ var _ = b(), C = n({ inst: { value: _, getSnapshot: b } }), h = C[0].inst, S = C[1];
867
867
  return s(function() {
868
- m.value = _, m.getSnapshot = b, l(m) && E({ inst: m });
868
+ h.value = _, h.getSnapshot = b, l(h) && S({ inst: h });
869
869
  }, [c, _, b]), o(function() {
870
- return l(m) && E({ inst: m }), c(function() {
871
- l(m) && E({ inst: m });
870
+ return l(h) && S({ inst: h }), c(function() {
871
+ l(h) && S({ inst: h });
872
872
  });
873
873
  }, [c]), a(_), _;
874
874
  }
@@ -902,70 +902,70 @@ var jt;
902
902
  function Hr() {
903
903
  return jt || (jt = 1, process.env.NODE_ENV !== "production" && function() {
904
904
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
905
- var e = g, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
906
- function r(y) {
905
+ var e = m, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
906
+ function r(v) {
907
907
  {
908
- for (var p = arguments.length, h = new Array(p > 1 ? p - 1 : 0), v = 1; v < p; v++)
909
- h[v - 1] = arguments[v];
910
- n("error", y, h);
908
+ for (var p = arguments.length, R = new Array(p > 1 ? p - 1 : 0), w = 1; w < p; w++)
909
+ R[w - 1] = arguments[w];
910
+ n("error", v, R);
911
911
  }
912
912
  }
913
- function n(y, p, h) {
913
+ function n(v, p, R) {
914
914
  {
915
- var v = t.ReactDebugCurrentFrame, C = v.getStackAddendum();
916
- C !== "" && (p += "%s", h = h.concat([C]));
917
- var D = h.map(function(k) {
918
- return String(k);
915
+ var w = t.ReactDebugCurrentFrame, g = w.getStackAddendum();
916
+ g !== "" && (p += "%s", R = R.concat([g]));
917
+ var k = R.map(function(P) {
918
+ return String(P);
919
919
  });
920
- D.unshift("Warning: " + p), Function.prototype.apply.call(console[y], console, D);
920
+ k.unshift("Warning: " + p), Function.prototype.apply.call(console[v], console, k);
921
921
  }
922
922
  }
923
- function o(y, p) {
924
- return y === p && (y !== 0 || 1 / y === 1 / p) || y !== y && p !== p;
923
+ function o(v, p) {
924
+ return v === p && (v !== 0 || 1 / v === 1 / p) || v !== v && p !== p;
925
925
  }
926
926
  var s = typeof Object.is == "function" ? Object.is : o, a = e.useState, u = e.useEffect, l = e.useLayoutEffect, d = e.useDebugValue, f = !1, c = !1;
927
- function b(y, p, h) {
927
+ function b(v, p, R) {
928
928
  f || e.startTransition !== void 0 && (f = !0, r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
929
- var v = p();
929
+ var w = p();
930
930
  if (!c) {
931
- var C = p();
932
- s(v, C) || (r("The result of getSnapshot should be cached to avoid an infinite loop"), c = !0);
931
+ var g = p();
932
+ s(w, g) || (r("The result of getSnapshot should be cached to avoid an infinite loop"), c = !0);
933
933
  }
934
- var D = a({
934
+ var k = a({
935
935
  inst: {
936
- value: v,
936
+ value: w,
937
937
  getSnapshot: p
938
938
  }
939
- }), k = D[0].inst, P = D[1];
939
+ }), P = k[0].inst, M = k[1];
940
940
  return l(function() {
941
- k.value = v, k.getSnapshot = p, _(k) && P({
942
- inst: k
941
+ P.value = w, P.getSnapshot = p, _(P) && M({
942
+ inst: P
943
943
  });
944
- }, [y, v, p]), u(function() {
945
- _(k) && P({
946
- inst: k
944
+ }, [v, w, p]), u(function() {
945
+ _(P) && M({
946
+ inst: P
947
947
  });
948
- var M = function() {
949
- _(k) && P({
950
- inst: k
948
+ var $ = function() {
949
+ _(P) && M({
950
+ inst: P
951
951
  });
952
952
  };
953
- return y(M);
954
- }, [y]), d(v), v;
953
+ return v($);
954
+ }, [v]), d(w), w;
955
955
  }
956
- function _(y) {
957
- var p = y.getSnapshot, h = y.value;
956
+ function _(v) {
957
+ var p = v.getSnapshot, R = v.value;
958
958
  try {
959
- var v = p();
960
- return !s(h, v);
959
+ var w = p();
960
+ return !s(R, w);
961
961
  } catch {
962
962
  return !0;
963
963
  }
964
964
  }
965
- function w(y, p, h) {
965
+ function C(v, p, R) {
966
966
  return p();
967
967
  }
968
- var m = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", E = !m, R = E ? w : b, x = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : R;
968
+ var h = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", S = !h, E = S ? C : b, x = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : E;
969
969
  Qe.useSyncExternalStore = x, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
970
970
  }()), Qe;
971
971
  }
@@ -989,44 +989,44 @@ function qr() {
989
989
  if ($t)
990
990
  return Je;
991
991
  $t = 1;
992
- var e = g, t = tr();
992
+ var e = m, t = tr();
993
993
  function r(d, f) {
994
994
  return d === f && (d !== 0 || 1 / d === 1 / f) || d !== d && f !== f;
995
995
  }
996
996
  var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, s = e.useRef, a = e.useEffect, u = e.useMemo, l = e.useDebugValue;
997
997
  return Je.useSyncExternalStoreWithSelector = function(d, f, c, b, _) {
998
- var w = s(null);
999
- if (w.current === null) {
1000
- var m = { hasValue: !1, value: null };
1001
- w.current = m;
998
+ var C = s(null);
999
+ if (C.current === null) {
1000
+ var h = { hasValue: !1, value: null };
1001
+ C.current = h;
1002
1002
  } else
1003
- m = w.current;
1004
- w = u(function() {
1005
- function R(v) {
1003
+ h = C.current;
1004
+ C = u(function() {
1005
+ function E(w) {
1006
1006
  if (!x) {
1007
- if (x = !0, y = v, v = b(v), _ !== void 0 && m.hasValue) {
1008
- var C = m.value;
1009
- if (_(C, v))
1010
- return p = C;
1007
+ if (x = !0, v = w, w = b(w), _ !== void 0 && h.hasValue) {
1008
+ var g = h.value;
1009
+ if (_(g, w))
1010
+ return p = g;
1011
1011
  }
1012
- return p = v;
1012
+ return p = w;
1013
1013
  }
1014
- if (C = p, n(y, v))
1015
- return C;
1016
- var D = b(v);
1017
- return _ !== void 0 && _(C, D) ? C : (y = v, p = D);
1014
+ if (g = p, n(v, w))
1015
+ return g;
1016
+ var k = b(w);
1017
+ return _ !== void 0 && _(g, k) ? g : (v = w, p = k);
1018
1018
  }
1019
- var x = !1, y, p, h = c === void 0 ? null : c;
1019
+ var x = !1, v, p, R = c === void 0 ? null : c;
1020
1020
  return [function() {
1021
- return R(f());
1022
- }, h === null ? void 0 : function() {
1023
- return R(h());
1021
+ return E(f());
1022
+ }, R === null ? void 0 : function() {
1023
+ return E(R());
1024
1024
  }];
1025
1025
  }, [f, c, b, _]);
1026
- var E = o(d, w[0], w[1]);
1026
+ var S = o(d, C[0], C[1]);
1027
1027
  return a(function() {
1028
- m.hasValue = !0, m.value = E;
1029
- }, [E]), l(E), E;
1028
+ h.hasValue = !0, h.value = S;
1029
+ }, [S]), l(S), S;
1030
1030
  }, Je;
1031
1031
  }
1032
1032
  var et = {};
@@ -1043,43 +1043,43 @@ var At;
1043
1043
  function Gr() {
1044
1044
  return At || (At = 1, process.env.NODE_ENV !== "production" && function() {
1045
1045
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
1046
- var e = g, t = tr();
1046
+ var e = m, t = tr();
1047
1047
  function r(f, c) {
1048
1048
  return f === c && (f !== 0 || 1 / f === 1 / c) || f !== f && c !== c;
1049
1049
  }
1050
1050
  var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, s = e.useRef, a = e.useEffect, u = e.useMemo, l = e.useDebugValue;
1051
- function d(f, c, b, _, w) {
1052
- var m = s(null), E;
1053
- m.current === null ? (E = {
1051
+ function d(f, c, b, _, C) {
1052
+ var h = s(null), S;
1053
+ h.current === null ? (S = {
1054
1054
  hasValue: !1,
1055
1055
  value: null
1056
- }, m.current = E) : E = m.current;
1057
- var R = u(function() {
1058
- var h = !1, v, C, D = function(N) {
1059
- if (!h) {
1060
- h = !0, v = N;
1061
- var F = _(N);
1062
- if (w !== void 0 && E.hasValue) {
1063
- var K = E.value;
1064
- if (w(K, F))
1065
- return C = K, K;
1056
+ }, h.current = S) : S = h.current;
1057
+ var E = u(function() {
1058
+ var R = !1, w, g, k = function(B) {
1059
+ if (!R) {
1060
+ R = !0, w = B;
1061
+ var N = _(B);
1062
+ if (C !== void 0 && S.hasValue) {
1063
+ var K = S.value;
1064
+ if (C(K, N))
1065
+ return g = K, K;
1066
1066
  }
1067
- return C = F, F;
1067
+ return g = N, N;
1068
1068
  }
1069
- var O = v, $ = C;
1070
- if (n(O, N))
1071
- return $;
1072
- var A = _(N);
1073
- return w !== void 0 && w($, A) ? $ : (v = N, C = A, A);
1074
- }, k = b === void 0 ? null : b, P = function() {
1075
- return D(c());
1076
- }, M = k === null ? void 0 : function() {
1077
- return D(k());
1069
+ var O = w, D = g;
1070
+ if (n(O, B))
1071
+ return D;
1072
+ var A = _(B);
1073
+ return C !== void 0 && C(D, A) ? D : (w = B, g = A, A);
1074
+ }, P = b === void 0 ? null : b, M = function() {
1075
+ return k(c());
1076
+ }, $ = P === null ? void 0 : function() {
1077
+ return k(P());
1078
1078
  };
1079
- return [P, M];
1080
- }, [c, b, _, w]), x = R[0], y = R[1], p = o(f, x, y);
1079
+ return [M, $];
1080
+ }, [c, b, _, C]), x = E[0], v = E[1], p = o(f, x, v);
1081
1081
  return a(function() {
1082
- E.hasValue = !0, E.value = p;
1082
+ S.hasValue = !0, S.value = p;
1083
1083
  }, [p]), l(p), p;
1084
1084
  }
1085
1085
  et.useSyncExternalStoreWithSelector = d, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
@@ -1088,7 +1088,7 @@ function Gr() {
1088
1088
  (function(e) {
1089
1089
  process.env.NODE_ENV === "production" ? e.exports = qr() : e.exports = Gr();
1090
1090
  })(Vr);
1091
- const Jr = /* @__PURE__ */ zr(st), { useSyncExternalStoreWithSelector: Zr } = Jr;
1091
+ const Jr = /* @__PURE__ */ Lr(st), { useSyncExternalStoreWithSelector: Zr } = Jr;
1092
1092
  function Ue(e, t = e.getState, r) {
1093
1093
  const n = Zr(
1094
1094
  e.subscribe,
@@ -1137,17 +1137,17 @@ const _e = (e, t) => e.classList && e.classList.contains(t), Te = (e, t) => _e(e
1137
1137
  e + r / 2 - a.x,
1138
1138
  t + n / 2 - a.y
1139
1139
  ];
1140
- let d, f, c, b, _, w, m, E, R, x;
1141
- const y = s / 1.1547;
1140
+ let d, f, c, b, _, C, h, S, E, x;
1141
+ const v = s / 1.1547;
1142
1142
  switch (o) {
1143
1143
  case "grid":
1144
1144
  d = Math.round(u / s) * s, f = Math.round(l / s) * s;
1145
1145
  break;
1146
1146
  case "hexH":
1147
- c = 2 * y, b = 3 * s, _ = Math.round(u / c) * c, m = Math.round(l / b) * b, w = _ > u ? _ - y : _ + y, E = m > l ? m - 1.5 * s : m + 1.5 * s, R = Math.hypot(_ - u, m - l), x = Math.hypot(w - u, E - l), R < x ? (d = _, f = m) : (d = w, f = E);
1147
+ c = 2 * v, b = 3 * s, _ = Math.round(u / c) * c, h = Math.round(l / b) * b, C = _ > u ? _ - v : _ + v, S = h > l ? h - 1.5 * s : h + 1.5 * s, E = Math.hypot(_ - u, h - l), x = Math.hypot(C - u, S - l), E < x ? (d = _, f = h) : (d = C, f = S);
1148
1148
  break;
1149
1149
  case "hexV":
1150
- c = 3 * s, b = 2 * y, _ = Math.round(u / c) * c, m = Math.round(l / b) * b, w = _ > u ? _ - 1.5 * s : _ + 1.5 * s, E = m > l ? m - y : m + y, R = Math.hypot(_ - u, m - l), x = Math.hypot(w - u, E - l), R < x ? (d = _, f = m) : (d = w, f = E);
1150
+ c = 3 * s, b = 2 * v, _ = Math.round(u / c) * c, h = Math.round(l / b) * b, C = _ > u ? _ - 1.5 * s : _ + 1.5 * s, S = h > l ? h - v : h + v, E = Math.hypot(_ - u, h - l), x = Math.hypot(C - u, S - l), E < x ? (d = _, f = h) : (d = C, f = S);
1151
1151
  break;
1152
1152
  default:
1153
1153
  d = e + r / 2, f = t + n / 2;
@@ -1156,7 +1156,7 @@ const _e = (e, t) => e.classList && e.classList.contains(t), Te = (e, t) => _e(e
1156
1156
  x: d + a.x - r / 2,
1157
1157
  y: f + a.y - n / 2
1158
1158
  };
1159
- }, zt = [
1159
+ }, Lt = [
1160
1160
  "#037758",
1161
1161
  "#99092a",
1162
1162
  "#067070",
@@ -1187,13 +1187,13 @@ const _e = (e, t) => e.classList && e.classList.contains(t), Te = (e, t) => _e(e
1187
1187
  "#007a4b",
1188
1188
  "#bf0daa",
1189
1189
  "#af0ad8"
1190
- ], Lt = () => zt[Math.floor(Math.random() * zt.length)], rn = !1, ut = ({ wire: e, storeName: t, noSync: r = [], defaultValue: n }, o) => (s, a, u) => {
1190
+ ], zt = () => Lt[Math.floor(Math.random() * Lt.length)], rn = !1, ut = ({ wire: e, storeName: t, noSync: r = [], defaultValue: n }, o) => (s, a, u) => {
1191
1191
  s({ ready: !1 });
1192
1192
  const l = [];
1193
1193
  (async () => {
1194
1194
  try {
1195
1195
  const _ = await e.call(`${t}_getValue`);
1196
- rn && console.log("init from peer with value", _), s((w) => ({ ...w, ..._ }));
1196
+ rn && console.log("init from peer with value", _), s((C) => ({ ...C, ..._ }));
1197
1197
  } catch {
1198
1198
  n !== void 0 && s(n);
1199
1199
  }
@@ -1202,23 +1202,23 @@ const _e = (e, t) => e.classList && e.classList.contains(t), Te = (e, t) => _e(e
1202
1202
  `${t}_getValue`,
1203
1203
  () => Object.fromEntries(
1204
1204
  Object.entries(a()).filter(
1205
- ([_, w]) => typeof w != "function" && !r.includes(_)
1205
+ ([_, C]) => typeof C != "function" && !r.includes(_)
1206
1206
  )
1207
1207
  ),
1208
1208
  { invoke: "first" }
1209
1209
  )
1210
1210
  ), l.push(
1211
- e.subscribe(`${t}_call`, ([_, w]) => {
1212
- c[_](...w);
1211
+ e.subscribe(`${t}_call`, ([_, C]) => {
1212
+ c[_](...C);
1213
1213
  })
1214
1214
  ), s({ ready: !0 });
1215
1215
  })();
1216
1216
  const f = o(s, a, u), c = { ...f }, b = Object.fromEntries(
1217
1217
  // Send the update message on all method calls
1218
- Object.entries(f).map(([_, w]) => typeof w == "function" && !_.startsWith("get") && !r.includes(_) ? [_, (...E) => {
1219
- const R = w(...E);
1220
- return e.publish(`${t}_call`, [_, E]), R;
1221
- }] : [_, w])
1218
+ Object.entries(f).map(([_, C]) => typeof C == "function" && !_.startsWith("get") && !r.includes(_) ? [_, (...S) => {
1219
+ const E = C(...S);
1220
+ return e.publish(`${t}_call`, [_, S]), E;
1221
+ }] : [_, C])
1222
1222
  );
1223
1223
  return b.unsub = () => {
1224
1224
  l.forEach((_) => _());
@@ -1253,7 +1253,7 @@ function Xe(e, t) {
1253
1253
  return !1;
1254
1254
  return !0;
1255
1255
  }
1256
- const or = g.createContext(), nn = (e, t) => ({
1256
+ const or = m.createContext(), nn = (e, t) => ({
1257
1257
  items: {},
1258
1258
  getItems: () => t().items,
1259
1259
  setItems: (r) => e({ items: r }),
@@ -1333,7 +1333,7 @@ const or = g.createContext(), nn = (e, t) => ({
1333
1333
  setSessionInfo: (r) => e({ session: r }),
1334
1334
  updateSessionInfo: (r) => e((n) => ({ session: { ...n.session, ...r } }))
1335
1335
  }), Yt = ({ storeName: e, children: t, defaultValue: r }) => {
1336
- const { wire: n } = Be("room"), [o] = g.useState(
1336
+ const { wire: n } = Be("room"), [o] = m.useState(
1337
1337
  () => Ne(
1338
1338
  ut({ wire: n, storeName: e, defaultValue: r }, (...s) => ({
1339
1339
  ...nn(...s),
@@ -1353,7 +1353,7 @@ const or = g.createContext(), nn = (e, t) => ({
1353
1353
  n.itemIds,
1354
1354
  n.items
1355
1355
  ]);
1356
- return g.useMemo(
1356
+ return m.useMemo(
1357
1357
  () => e.map((n) => t[n]),
1358
1358
  [e, t]
1359
1359
  );
@@ -1362,14 +1362,14 @@ const or = g.createContext(), nn = (e, t) => ({
1362
1362
  a.items,
1363
1363
  a.itemIds,
1364
1364
  a.getItemList
1365
- ]), [n, o] = g.useState(r()), [, s] = g.useTransition();
1366
- return g.useEffect(() => {
1365
+ ]), [n, o] = m.useState(r()), [, s] = m.useTransition();
1366
+ return m.useEffect(() => {
1367
1367
  const a = r();
1368
1368
  s(() => {
1369
1369
  o(a);
1370
1370
  });
1371
1371
  }, [e, t, r]), n;
1372
- }, sr = 5e4, ir = g.createContext(), un = (e, t) => ({
1372
+ }, sr = 5e4, ir = m.createContext(), un = (e, t) => ({
1373
1373
  config: {
1374
1374
  itemTemplates: {},
1375
1375
  actions: {},
@@ -1436,7 +1436,7 @@ const or = g.createContext(), nn = (e, t) => ({
1436
1436
  return !o || !r || o.top !== r.top || o.left !== r.left || o.width !== r.width || o.height !== r.height ? { selectionBox: r } : {};
1437
1437
  })
1438
1438
  }), Bt = ({ children: e }) => {
1439
- const [t] = g.useState(
1439
+ const [t] = m.useState(
1440
1440
  () => Ne((...r) => ({
1441
1441
  ...un(...r),
1442
1442
  ...ln(...r),
@@ -1493,7 +1493,7 @@ function ft(e, t, r, n = 0) {
1493
1493
  [r, n, ...t]
1494
1494
  );
1495
1495
  }
1496
- const ze = 100, Se = 1e3, mn = 0.8, Nt = ({
1496
+ const Le = 100, Se = 1e3, mn = 0.8, Nt = ({
1497
1497
  x: e,
1498
1498
  y: t,
1499
1499
  scale: r,
@@ -1502,10 +1502,10 @@ const ze = 100, Se = 1e3, mn = 0.8, Nt = ({
1502
1502
  boardSize: l
1503
1503
  }) => {
1504
1504
  const d = {
1505
- left: -n * r + ze * r,
1506
- right: u.width - o * r - ze * r,
1507
- top: -a * r + ze * r,
1508
- bottom: u.height - s * r - ze * r,
1505
+ left: -n * r + Le * r,
1506
+ right: u.width - o * r - Le * r,
1507
+ top: -a * r + Le * r,
1508
+ bottom: u.height - s * r - Le * r,
1509
1509
  maxRight: u.width - l * r,
1510
1510
  maxLeft: u.height - l * r
1511
1511
  }, f = Math.min(
@@ -1525,119 +1525,119 @@ const ze = 100, Se = 1e3, mn = 0.8, Nt = ({
1525
1525
  r,
1526
1526
  n,
1527
1527
  o
1528
- ] = Z((m) => [
1529
- m.getBoardState,
1530
- m.updateBoardState,
1531
- m.config.itemExtent,
1532
- m.getConfiguration,
1533
- m.updateConfiguration
1534
- ]), s = g.useRef([0.1, 8]), [a] = se((m) => [m.getItemList]), u = g.useCallback(() => {
1535
- const { translateX: m, translateY: E, scale: R } = e();
1536
- return { translateX: m, translateY: E, scale: R };
1537
- }, [e]), l = g.useCallback(
1538
- (m) => {
1539
- const { itemExtent: E, boardWrapperRect: R, boardSize: x } = n(), y = e(), { translateX: p, translateY: h, scale: v } = {
1540
- ...y,
1541
- ...m(y)
1528
+ ] = Z((h) => [
1529
+ h.getBoardState,
1530
+ h.updateBoardState,
1531
+ h.config.itemExtent,
1532
+ h.getConfiguration,
1533
+ h.updateConfiguration
1534
+ ]), s = m.useRef([0.1, 8]), [a] = se((h) => [h.getItemList]), u = m.useCallback(() => {
1535
+ const { translateX: h, translateY: S, scale: E } = e();
1536
+ return { translateX: h, translateY: S, scale: E };
1537
+ }, [e]), l = m.useCallback(
1538
+ (h) => {
1539
+ const { itemExtent: S, boardWrapperRect: E, boardSize: x } = n(), v = e(), { translateX: p, translateY: R, scale: w } = {
1540
+ ...v,
1541
+ ...h(v)
1542
1542
  };
1543
- let C = v;
1544
- v !== y.scale && (C > s.current[1] && ([, C] = s.current), C < s.current[0] && ([C] = s.current));
1545
- let [D, k] = [p, h];
1546
- (p !== y.translateX || h !== y.translateY) && ([D, k] = Nt({
1543
+ let g = w;
1544
+ w !== v.scale && (g > s.current[1] && ([, g] = s.current), g < s.current[0] && ([g] = s.current));
1545
+ let [k, P] = [p, R];
1546
+ (p !== v.translateX || R !== v.translateY) && ([k, P] = Nt({
1547
1547
  x: p,
1548
- y: h,
1549
- scale: C,
1550
- itemExtent: E,
1551
- boardWrapperRect: R,
1548
+ y: R,
1549
+ scale: g,
1550
+ itemExtent: S,
1551
+ boardWrapperRect: E,
1552
1552
  boardSize: x
1553
1553
  })), t({
1554
- translateX: D,
1555
- translateY: k,
1556
- scale: C
1554
+ translateX: k,
1555
+ translateY: P,
1556
+ scale: g
1557
1557
  });
1558
1558
  },
1559
1559
  [e, n, t]
1560
- ), d = g.useCallback(
1561
- (m, E) => {
1562
- const { itemExtent: R, boardWrapperRect: x, boardSize: y } = n();
1563
- let p = E;
1560
+ ), d = m.useCallback(
1561
+ (h, S) => {
1562
+ const { itemExtent: E, boardWrapperRect: x, boardSize: v } = n();
1563
+ let p = S;
1564
1564
  p || (p = {
1565
1565
  x: x.width / 2,
1566
1566
  y: x.height / 2
1567
1567
  });
1568
- const h = e();
1569
- let v = h.scale * m;
1570
- v > s.current[1] && ([, v] = s.current), v < s.current[0] && ([v] = s.current);
1571
- const C = p.x - x.left, D = p.y - x.top, k = C - (C - h.translateX) * v / h.scale, P = D - (D - h.translateY) * v / h.scale, [M, N] = Nt({
1572
- x: k,
1573
- y: P,
1574
- scale: v,
1575
- itemExtent: R,
1568
+ const R = e();
1569
+ let w = R.scale * h;
1570
+ w > s.current[1] && ([, w] = s.current), w < s.current[0] && ([w] = s.current);
1571
+ const g = p.x - x.left, k = p.y - x.top, P = g - (g - R.translateX) * w / R.scale, M = k - (k - R.translateY) * w / R.scale, [$, B] = Nt({
1572
+ x: P,
1573
+ y: M,
1574
+ scale: w,
1575
+ itemExtent: E,
1576
1576
  boardWrapperRect: x,
1577
- boardSize: y
1577
+ boardSize: v
1578
1578
  });
1579
1579
  t({
1580
- scale: v,
1581
- translateX: M,
1582
- translateY: N
1580
+ scale: w,
1581
+ translateX: $,
1582
+ translateY: B
1583
1583
  });
1584
1584
  },
1585
1585
  [e, n, t]
1586
- ), f = g.useCallback(
1587
- ({ left: m, top: E, width: R, height: x }) => {
1588
- const { boardWrapperRect: y } = n(), p = y.width / R, h = y.height / x, C = Math.min(p, h) * mn, D = y.width / 2 - (m + R / 2) * C, k = y.height / 2 - (E + x / 2) * C;
1586
+ ), f = m.useCallback(
1587
+ ({ left: h, top: S, width: E, height: x }) => {
1588
+ const { boardWrapperRect: v } = n(), p = v.width / E, R = v.height / x, g = Math.min(p, R) * mn, k = v.width / 2 - (h + E / 2) * g, P = v.height / 2 - (S + x / 2) * g;
1589
1589
  t({
1590
- translateX: D,
1591
- translateY: k,
1592
- scale: C
1590
+ translateX: k,
1591
+ translateY: P,
1592
+ scale: g
1593
1593
  });
1594
1594
  },
1595
1595
  [n, t]
1596
- ), c = g.useCallback(async () => {
1596
+ ), c = m.useCallback(async () => {
1597
1597
  const {
1598
- itemExtent: { width: m, height: E },
1599
- boardWrapperRect: R
1600
- } = n(), x = R.width / m, y = R.height / E, p = Math.min(x, y);
1598
+ itemExtent: { width: h, height: S },
1599
+ boardWrapperRect: E
1600
+ } = n(), x = E.width / h, v = E.height / S, p = Math.min(x, v);
1601
1601
  s.current = [
1602
1602
  Math.max(p * 0.5, 0.05),
1603
1603
  Math.max(p * 10, 10)
1604
1604
  ];
1605
- }, [n]), b = g.useCallback(() => {
1606
- const { boardWrapperRect: m, boardSize: E } = n(), { translateX: R, translateY: x, scale: y } = e();
1605
+ }, [n]), b = m.useCallback(() => {
1606
+ const { boardWrapperRect: h, boardSize: S } = n(), { translateX: E, translateY: x, scale: v } = e();
1607
1607
  return {
1608
- x: (m.width / 2 - R) / y - E / 2,
1609
- y: (m.height / 2 - x) / y - E / 2
1608
+ x: (h.width / 2 - E) / v - S / 2,
1609
+ y: (h.height / 2 - x) / v - S / 2
1610
1610
  };
1611
- }, [e, n]), _ = g.useCallback(() => {
1612
- const m = a(), { boardWrapperRect: E, boardWrapper: R, boardSize: x } = n(), { scale: y, translateX: p, translateY: h } = e(), { left: v, top: C, width: D, height: k } = nr(
1613
- m.map(({ id: M }) => M),
1614
- R
1611
+ }, [e, n]), _ = m.useCallback(() => {
1612
+ const h = a(), { boardWrapperRect: S, boardWrapper: E, boardSize: x } = n(), { scale: v, translateX: p, translateY: R } = e(), { left: w, top: g, width: k, height: P } = nr(
1613
+ h.map(({ id: $ }) => $),
1614
+ E
1615
1615
  ) || {
1616
- left: x / 2 * y + E.left + p,
1617
- top: x / 2 * y + E.top + h,
1616
+ left: x / 2 * v + S.left + p,
1617
+ top: x / 2 * v + S.top + R,
1618
1618
  width: 0,
1619
1619
  height: 0
1620
- }, P = {
1621
- left: (v - E.left - p) / y,
1622
- top: (C - E.top - h) / y,
1623
- width: D / y,
1624
- height: k / y
1620
+ }, M = {
1621
+ left: (w - S.left - p) / v,
1622
+ top: (g - S.top - R) / v,
1623
+ width: k / v,
1624
+ height: P / v
1625
1625
  };
1626
- if (P.right = P.left + P.width, P.bottom = P.top + P.height, P.width < Se) {
1627
- const M = (Se - P.width) / 2;
1628
- P.left -= M, P.right += M, P.width = Se;
1626
+ if (M.right = M.left + M.width, M.bottom = M.top + M.height, M.width < Se) {
1627
+ const $ = (Se - M.width) / 2;
1628
+ M.left -= $, M.right += $, M.width = Se;
1629
1629
  }
1630
- if (P.height < Se) {
1631
- const M = (Se - P.height) / 2;
1632
- P.top -= M, P.bottom += M, P.height = Se;
1630
+ if (M.height < Se) {
1631
+ const $ = (Se - M.height) / 2;
1632
+ M.top -= $, M.bottom += $, M.height = Se;
1633
1633
  }
1634
- o({ itemExtent: P });
1635
- }, [e, n, a, o]), w = ft(
1634
+ o({ itemExtent: M });
1635
+ }, [e, n, a, o]), C = ft(
1636
1636
  () => _(),
1637
1637
  [_],
1638
1638
  200
1639
1639
  );
1640
- return g.useEffect(() => {
1640
+ return m.useEffect(() => {
1641
1641
  r.left && c();
1642
1642
  }, [c, r]), {
1643
1643
  setDim: l,
@@ -1646,7 +1646,7 @@ const ze = 100, Se = 1e3, mn = 0.8, Nt = ({
1646
1646
  zoomToCenter: d,
1647
1647
  zoomToExtent: f,
1648
1648
  getCenter: b,
1649
- updateItemExtent: w
1649
+ updateItemExtent: C
1650
1650
  };
1651
1651
  }, gn = (e) => {
1652
1652
  const [t, r, n] = Z(
@@ -1655,12 +1655,12 @@ const ze = 100, Se = 1e3, mn = 0.8, Nt = ({
1655
1655
  u,
1656
1656
  l
1657
1657
  ]
1658
- ), o = g.useCallback(
1658
+ ), o = m.useCallback(
1659
1659
  (a) => (t(e, a), () => {
1660
1660
  r(e, a);
1661
1661
  }),
1662
1662
  [e, t, r]
1663
- ), s = g.useCallback(
1663
+ ), s = m.useCallback(
1664
1664
  (a) => {
1665
1665
  n(e, a);
1666
1666
  },
@@ -1681,72 +1681,72 @@ const ze = 100, Se = 1e3, mn = 0.8, Nt = ({
1681
1681
  moveItems: c,
1682
1682
  removeItemsById: b,
1683
1683
  getItemList: _,
1684
- insertItems: w,
1685
- setItemList: m
1684
+ insertItems: C,
1685
+ setItemList: h
1686
1686
  } = se(
1687
1687
  ({
1688
1688
  getItems: O,
1689
- getItemIds: $,
1689
+ getItemIds: D,
1690
1690
  setItemIds: A,
1691
- updateItems: U,
1692
- moveItems: Y,
1693
- removeItemsById: W,
1694
- getItemList: J,
1691
+ updateItems: X,
1692
+ moveItems: z,
1693
+ removeItemsById: F,
1694
+ getItemList: H,
1695
1695
  insertItems: te,
1696
1696
  setItemList: re
1697
1697
  }) => ({
1698
1698
  getItems: O,
1699
- getItemIds: $,
1699
+ getItemIds: D,
1700
1700
  setItemIds: A,
1701
- updateItems: U,
1702
- moveItems: Y,
1703
- removeItemsById: W,
1704
- getItemList: J,
1701
+ updateItems: X,
1702
+ moveItems: z,
1703
+ removeItemsById: F,
1704
+ getItemList: H,
1705
1705
  insertItems: te,
1706
1706
  setItemList: re
1707
1707
  })
1708
- ), E = g.useCallback(
1709
- (O, $) => {
1710
- let A = $;
1711
- typeof $ == "object" && (A = () => $);
1712
- const U = l().filter((J) => O.includes(J)), Y = u(), W = Object.fromEntries(
1713
- U.map((J) => [J, A({ ...Y[J] })])
1708
+ ), S = m.useCallback(
1709
+ (O, D) => {
1710
+ let A = D;
1711
+ typeof D == "object" && (A = () => D);
1712
+ const X = l().filter((H) => O.includes(H)), z = u(), F = Object.fromEntries(
1713
+ X.map((H) => [H, A({ ...z[H] })])
1714
1714
  );
1715
- f(W), r();
1715
+ f(F), r();
1716
1716
  },
1717
1717
  [l, u, r, f]
1718
- ), R = g.useCallback(
1718
+ ), E = m.useCallback(
1719
1719
  (O) => {
1720
- m(O), n(), r();
1720
+ h(O), n(), r();
1721
1721
  },
1722
- [n, m, r]
1723
- ), x = g.useCallback(
1724
- (O, $) => {
1725
- E([O], $);
1722
+ [n, h, r]
1723
+ ), x = m.useCallback(
1724
+ (O, D) => {
1725
+ S([O], D);
1726
1726
  },
1727
- [E]
1728
- ), y = g.useCallback(
1729
- (O, $) => {
1730
- c(O, $), r();
1727
+ [S]
1728
+ ), v = m.useCallback(
1729
+ (O, D) => {
1730
+ c(O, D), r();
1731
1731
  },
1732
1732
  [c, r]
1733
- ), p = g.useCallback(
1733
+ ), p = m.useCallback(
1734
1734
  (O) => {
1735
- const $ = l(), A = $.filter((Y) => !O.includes(Y)), U = $.filter(
1736
- (Y) => O.includes(Y)
1735
+ const D = l(), A = D.filter((z) => !O.includes(z)), X = D.filter(
1736
+ (z) => O.includes(z)
1737
1737
  );
1738
- d([...A, ...U]);
1738
+ d([...A, ...X]);
1739
1739
  },
1740
1740
  [l, d]
1741
- ), h = g.useCallback(
1742
- (O, { type: $, size: A } = {}) => {
1743
- const { boardWrapper: U } = a(), Y = {}, W = u();
1744
- O.forEach((J) => {
1745
- const te = W[J], re = it(U, J);
1741
+ ), R = m.useCallback(
1742
+ (O, { type: D, size: A } = {}) => {
1743
+ const { boardWrapper: X } = a(), z = {}, F = u();
1744
+ O.forEach((H) => {
1745
+ const te = F[H], re = it(X, H);
1746
1746
  if (!re)
1747
1747
  return;
1748
1748
  const ne = {
1749
- type: $ || "grid",
1749
+ type: D || "grid",
1750
1750
  size: A || 1,
1751
1751
  offset: { x: 0, y: 0 },
1752
1752
  ...te.grid
@@ -1759,117 +1759,117 @@ const ze = 100, Se = 1e3, mn = 0.8, Nt = ({
1759
1759
  },
1760
1760
  ne
1761
1761
  );
1762
- Y[J] = { ...te, ...V };
1763
- }), f(Y);
1762
+ z[H] = { ...te, ...V };
1763
+ }), f(z);
1764
1764
  },
1765
1765
  [a, u, f]
1766
- ), v = g.useCallback(
1767
- (O, $) => {
1768
- p(O), E(O, (A) => {
1769
- const U = { ...A };
1770
- return delete U.moving, U;
1771
- }), h(O, $), e(O), r();
1766
+ ), w = m.useCallback(
1767
+ (O, D) => {
1768
+ p(O), S(O, (A) => {
1769
+ const X = { ...A };
1770
+ return delete X.moving, X;
1771
+ }), R(O, D), e(O), r();
1772
1772
  },
1773
1773
  [
1774
- E,
1774
+ S,
1775
1775
  e,
1776
1776
  p,
1777
- h,
1777
+ R,
1778
1778
  r
1779
1779
  ]
1780
- ), C = g.useCallback(
1780
+ ), g = m.useCallback(
1781
1781
  (O) => {
1782
1782
  d(O);
1783
1783
  },
1784
1784
  [d]
1785
- ), D = g.useCallback(
1785
+ ), k = m.useCallback(
1786
1786
  (O) => {
1787
- const $ = l(), A = $.filter(
1788
- (Y) => O.includes(Y)
1789
- ), U = $.map((Y) => O.includes(Y) ? A.pop() : Y);
1790
- d(U), o();
1787
+ const D = l(), A = D.filter(
1788
+ (z) => O.includes(z)
1789
+ ), X = D.map((z) => O.includes(z) ? A.pop() : z);
1790
+ d(X), o();
1791
1791
  },
1792
1792
  [l, o, d]
1793
- ), k = g.useCallback(
1794
- (O, $) => {
1795
- const A = u(), U = O.map((V) => A[V]), Y = $.map((V) => A[V]), W = $.reduce((V, ee) => (V[ee] = U.shift(), V), {}), J = Y.reduce((V, ee) => {
1796
- const le = W[ee.id], he = {
1793
+ ), P = m.useCallback(
1794
+ (O, D) => {
1795
+ const A = u(), X = O.map((V) => A[V]), z = D.map((V) => A[V]), F = D.reduce((V, ee) => (V[ee] = X.shift(), V), {}), H = z.reduce((V, ee) => {
1796
+ const fe = F[ee.id], he = {
1797
1797
  ...ee,
1798
- x: le.x,
1799
- y: le.y
1798
+ x: fe.x,
1799
+ y: fe.y
1800
1800
  };
1801
1801
  return V[ee.id] = he, V;
1802
1802
  }, {});
1803
- f(J);
1804
- const te = O.reduce((V, ee) => (V[ee] = $.shift(), V), {}), ne = l().map((V) => O.includes(V) ? te[V] : V);
1803
+ f(H);
1804
+ const te = O.reduce((V, ee) => (V[ee] = D.shift(), V), {}), ne = l().map((V) => O.includes(V) ? te[V] : V);
1805
1805
  d(ne);
1806
1806
  },
1807
1807
  [u, f, l, d]
1808
- ), P = g.useCallback(
1809
- (O, $) => {
1810
- const A = t(), U = O.map((Y, W) => !Y.x || !Y.y ? { ...Y, x: A.x + 2 * W, y: A.y + 2 * W } : Y);
1811
- w(U, $), r();
1808
+ ), M = m.useCallback(
1809
+ (O, D) => {
1810
+ const A = t(), X = O.map((z, F) => !z.x || !z.y ? { ...z, x: A.x + 2 * F, y: A.y + 2 * F } : z);
1811
+ C(X, D), r();
1812
1812
  },
1813
- [t, w, r]
1814
- ), M = g.useCallback(
1815
- (O, $) => {
1816
- P([O], $);
1813
+ [t, C, r]
1814
+ ), $ = m.useCallback(
1815
+ (O, D) => {
1816
+ M([O], D);
1817
1817
  },
1818
- [P]
1819
- ), N = g.useCallback(
1818
+ [M]
1819
+ ), B = m.useCallback(
1820
1820
  (O) => {
1821
1821
  s(O), b(O);
1822
1822
  },
1823
1823
  [s, b]
1824
- ), F = g.useCallback(
1824
+ ), N = m.useCallback(
1825
1825
  (O) => {
1826
- const $ = u();
1827
- return O.map((A) => $[A]);
1826
+ const D = u();
1827
+ return O.map((A) => D[A]);
1828
1828
  },
1829
1829
  [u]
1830
- ), K = g.useCallback(
1831
- ({ target: O, clientX: $, clientY: A }, { returnLocked: U = !1, passLocked: Y = !1 } = {}) => {
1830
+ ), K = m.useCallback(
1831
+ ({ target: O, clientX: D, clientY: A }, { returnLocked: X = !1, passLocked: z = !1 } = {}) => {
1832
1832
  if (["INPUT", "TEXTAREA"].includes(O.tagName))
1833
1833
  return null;
1834
- const W = Te(O, "item");
1835
- if (W) {
1836
- if (_e(W, "selected"))
1837
- return W;
1838
- if (!Y && _e(W, "locked") && !_e(O, "passthrough"))
1839
- return U ? W : null;
1834
+ const F = Te(O, "item");
1835
+ if (F) {
1836
+ if (_e(F, "selected"))
1837
+ return F;
1838
+ if (!z && _e(F, "locked") && !_e(O, "passthrough"))
1839
+ return X ? F : null;
1840
1840
  if (_e(O, "passthrough")) {
1841
- const J = l(), { boardWrapper: te } = a(), re = J.reduce((ne, V) => {
1842
- const ee = it(te, V), le = ee.getBoundingClientRect();
1843
- return rr({ x: $, y: A }, le) && ne.unshift(ee), ne;
1841
+ const H = l(), { boardWrapper: te } = a(), re = H.reduce((ne, V) => {
1842
+ const ee = it(te, V), fe = ee.getBoundingClientRect();
1843
+ return rr({ x: D, y: A }, fe) && ne.unshift(ee), ne;
1844
1844
  }, []);
1845
1845
  for (let ne = 0; ne < re.length; ne += 1) {
1846
1846
  const V = re[ne];
1847
- if (V !== W && (Y || !_e(V, "locked")))
1847
+ if (V !== F && (z || !_e(V, "locked")))
1848
1848
  return V;
1849
1849
  }
1850
1850
  return null;
1851
1851
  }
1852
1852
  }
1853
- return W;
1853
+ return F;
1854
1854
  },
1855
1855
  [a, l]
1856
1856
  );
1857
1857
  return {
1858
1858
  putItemsOnTop: p,
1859
- batchUpdateItems: E,
1860
- updateItemOrder: C,
1861
- moveItems: y,
1862
- placeItems: v,
1859
+ batchUpdateItems: S,
1860
+ updateItemOrder: g,
1861
+ moveItems: v,
1862
+ placeItems: w,
1863
1863
  updateItem: x,
1864
- swapItems: k,
1865
- reverseItemsOrder: D,
1866
- setItemList: R,
1867
- pushItem: M,
1868
- pushItems: P,
1869
- removeItems: N,
1864
+ swapItems: P,
1865
+ reverseItemsOrder: k,
1866
+ setItemList: E,
1867
+ pushItem: $,
1868
+ pushItems: M,
1869
+ removeItems: B,
1870
1870
  getItemList: _,
1871
1871
  findElementUnderPointer: K,
1872
- getItems: F
1872
+ getItems: N
1873
1873
  };
1874
1874
  };
1875
1875
  var hn = function e(t, r) {
@@ -1954,17 +1954,17 @@ const yn = (e, t) => {
1954
1954
  c.config.itemTemplates,
1955
1955
  c.selection,
1956
1956
  c.getSelection
1957
- ]), [s, a] = g.useState([]), u = g.useRef(!1), [, l] = g.useTransition();
1958
- g.useEffect(() => (u.current = !0, () => {
1957
+ ]), [s, a] = m.useState([]), u = m.useRef(!1), [, l] = m.useTransition();
1958
+ m.useEffect(() => (u.current = !0, () => {
1959
1959
  u.current = !1;
1960
1960
  }), []);
1961
- const d = g.useCallback(
1961
+ const d = m.useCallback(
1962
1962
  (c) => {
1963
1963
  const b = t();
1964
1964
  if (c)
1965
- return [c, c.map((w) => b[w])];
1965
+ return [c, c.map((C) => b[C])];
1966
1966
  const _ = o();
1967
- return [_, _.map((w) => b[w])];
1967
+ return [_, _.map((C) => b[C])];
1968
1968
  },
1969
1969
  [t, o]
1970
1970
  ), f = Jt(() => {
@@ -1972,10 +1972,10 @@ const yn = (e, t) => {
1972
1972
  if (c.length > 0) {
1973
1973
  if (!u.current)
1974
1974
  return;
1975
- const _ = b.reduce((w, m) => {
1976
- const E = Ut(m, r);
1977
- return w.filter(
1978
- (R) => E.some((x) => hn(R, x))
1975
+ const _ = b.reduce((C, h) => {
1976
+ const S = Ut(h, r);
1977
+ return C.filter(
1978
+ (E) => S.some((x) => hn(E, x))
1979
1979
  );
1980
1980
  }, Ut(b[0], r));
1981
1981
  l(() => {
@@ -1998,13 +1998,13 @@ const yn = (e, t) => {
1998
1998
  return e;
1999
1999
  };
2000
2000
  let me = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, r) => (r &= 63, r < 36 ? t += r.toString(36) : r < 62 ? t += (r - 26).toString(36).toUpperCase() : r > 62 ? t += "-" : t += "_", t), "");
2001
- const ar = g.createContext(), at = (e) => {
2001
+ const ar = m.createContext(), at = (e) => {
2002
2002
  localStorage.setItem("user", JSON.stringify(e));
2003
2003
  }, Sn = () => {
2004
2004
  if (localStorage.user) {
2005
2005
  const t = {
2006
2006
  name: "Player",
2007
- color: Lt(),
2007
+ color: zt(),
2008
2008
  uid: me(),
2009
2009
  ...JSON.parse(localStorage.user)
2010
2010
  };
@@ -2012,7 +2012,7 @@ const ar = g.createContext(), at = (e) => {
2012
2012
  }
2013
2013
  const e = {
2014
2014
  name: "Player",
2015
- color: Lt(),
2015
+ color: zt(),
2016
2016
  uid: me()
2017
2017
  };
2018
2018
  return at(e), e;
@@ -2069,8 +2069,8 @@ const ar = g.createContext(), at = (e) => {
2069
2069
  return delete n[t], { cursors: n };
2070
2070
  })
2071
2071
  }), cr = ({ storeName: e, children: t }) => {
2072
- const { wire: r, isMaster: n } = Be("room"), [o, s] = g.useState(null), [a, u] = g.useState(!1), l = g.useRef(!1);
2073
- return g.useEffect(() => {
2072
+ const { wire: r, isMaster: n } = Be("room"), [o, s] = m.useState(null), [a, u] = m.useState(!1), l = m.useRef(!1);
2073
+ return m.useEffect(() => {
2074
2074
  let d = !0;
2075
2075
  const f = [];
2076
2076
  if (!o && !l.current)
@@ -2087,18 +2087,18 @@ const ar = g.createContext(), at = (e) => {
2087
2087
  "electSpaceMaster"
2088
2088
  ]
2089
2089
  },
2090
- (...w) => ({
2091
- ..._n(r.userId)(...w),
2092
- ...bn(...w)
2090
+ (...C) => ({
2091
+ ..._n(r.userId)(...C),
2092
+ ...bn(...C)
2093
2093
  })
2094
2094
  )
2095
- ), _ = b.subscribe((w) => {
2096
- w.ready && (_(), d && s(b));
2095
+ ), _ = b.subscribe((C) => {
2096
+ C.ready && (_(), d && s(b));
2097
2097
  });
2098
2098
  })(), () => {
2099
2099
  d = !1, l.current = !1, f.forEach((b) => b());
2100
2100
  };
2101
- }, [o, e, r, r.userId]), g.useEffect(() => {
2101
+ }, [o, e, r, r.userId]), m.useEffect(() => {
2102
2102
  if (o)
2103
2103
  return o.getState().addUser({
2104
2104
  ...Sn(),
@@ -2106,7 +2106,7 @@ const ar = g.createContext(), at = (e) => {
2106
2106
  }), u(!0), () => {
2107
2107
  o.getState().removeUser(r.userId);
2108
2108
  };
2109
- }, [n, o, r]), g.useEffect(() => {
2109
+ }, [n, o, r]), m.useEffect(() => {
2110
2110
  if (o) {
2111
2111
  const d = r.subscribe("userLeave", (f) => {
2112
2112
  o.getState().removeUser(f);
@@ -2115,7 +2115,7 @@ const ar = g.createContext(), at = (e) => {
2115
2115
  d();
2116
2116
  };
2117
2117
  }
2118
- }, [n, o, r]), g.useEffect(() => {
2118
+ }, [n, o, r]), m.useEffect(() => {
2119
2119
  n && o && o.getState().updateCurrentUser({ isMaster: n });
2120
2120
  }, [n, o, r]), a ? /* @__PURE__ */ T(ar.Provider, { value: o, children: t }) : null;
2121
2121
  }, ge = (e, t) => {
@@ -2128,7 +2128,7 @@ const ar = g.createContext(), at = (e) => {
2128
2128
  u.users,
2129
2129
  u.updateCurrentUser,
2130
2130
  u.joinSpace
2131
- ]), s = g.useMemo(() => Object.values(r), [r]), a = g.useMemo(() => {
2131
+ ]), s = m.useMemo(() => Object.values(r), [r]), a = m.useMemo(() => {
2132
2132
  const { space: u } = t;
2133
2133
  return s.filter(({ space: l }) => l === u);
2134
2134
  }, [t, s]);
@@ -2143,7 +2143,7 @@ const ar = g.createContext(), at = (e) => {
2143
2143
  }, ns = () => {
2144
2144
  const [e, t, r] = se(
2145
2145
  (o) => [o.boardConfig, o.getBoardConfig, o.setBoardConfig]
2146
- ), n = g.useCallback(
2146
+ ), n = m.useCallback(
2147
2147
  (o) => {
2148
2148
  let s = o;
2149
2149
  typeof o == "object" && (s = () => o);
@@ -2164,7 +2164,7 @@ const ar = g.createContext(), at = (e) => {
2164
2164
  o.session
2165
2165
  ]);
2166
2166
  return { getSessionInfo: e, setSessionInfo: t, sessionInfo: n, updateSessionInfo: r };
2167
- }, ur = g.createContext(), En = ({ user: { name: e, uid: t, color: r }, content: n }) => ({
2167
+ }, ur = m.createContext(), En = ({ user: { name: e, uid: t, color: r }, content: n }) => ({
2168
2168
  type: "message",
2169
2169
  user: { name: e, uid: t, color: r },
2170
2170
  content: n,
@@ -2196,7 +2196,7 @@ const ar = g.createContext(), at = (e) => {
2196
2196
  children: t,
2197
2197
  defaultValue: r = []
2198
2198
  }) => {
2199
- const { wire: n } = Be("room"), [o] = g.useState(
2199
+ const { wire: n } = Be("room"), [o] = m.useState(
2200
2200
  () => Ne(
2201
2201
  ut(
2202
2202
  { wire: n, storeName: e, defaultValue: r, noSync: ["sendMessage"] },
@@ -2217,10 +2217,10 @@ const ar = g.createContext(), at = (e) => {
2217
2217
  a.setMessages,
2218
2218
  a.sendMessage
2219
2219
  ]);
2220
- g.useEffect(() => {
2220
+ m.useEffect(() => {
2221
2221
  r.length && e();
2222
2222
  }, [r, e]);
2223
- const s = g.useCallback(
2223
+ const s = m.useCallback(
2224
2224
  (a) => {
2225
2225
  o(t, a);
2226
2226
  },
@@ -2229,7 +2229,7 @@ const ar = g.createContext(), at = (e) => {
2229
2229
  return { messages: r, setMessages: n, sendMessage: s };
2230
2230
  }, Wt = ({ children: e, session: t }) => {
2231
2231
  const r = ge((n) => n.joinSpace);
2232
- return g.useEffect(() => (r(t), () => {
2232
+ return m.useEffect(() => (r(t), () => {
2233
2233
  r(null);
2234
2234
  }), [r, t]), e;
2235
2235
  }, as = ({
@@ -2241,7 +2241,7 @@ const ar = g.createContext(), at = (e) => {
2241
2241
  LoadingComponent: s,
2242
2242
  ...a
2243
2243
  }) => {
2244
- const [u] = g.useState(t || me()), [l] = g.useState(r || me()), [d] = g.useState(() => ({
2244
+ const [u] = m.useState(t || me()), [l] = m.useState(r || me()), [d] = m.useState(() => ({
2245
2245
  itemIds: n.map(({ id: c }) => c),
2246
2246
  items: Object.fromEntries(n.map((c) => [c.id, c]))
2247
2247
  }));
@@ -2284,7 +2284,7 @@ const ar = g.createContext(), at = (e) => {
2284
2284
  }
2285
2285
  );
2286
2286
  }, cs = ({ socket: e, room: t, children: r, LoadingComponent: n }) => {
2287
- const [o] = g.useState(t || me());
2287
+ const [o] = m.useState(t || me());
2288
2288
  return /* @__PURE__ */ T(
2289
2289
  er,
2290
2290
  {
@@ -2313,7 +2313,7 @@ const ar = g.createContext(), at = (e) => {
2313
2313
  }, Ft = ([e, t], [r, n]) => {
2314
2314
  const o = Math.abs(e - r), s = Math.abs(t - n);
2315
2315
  return Math.hypot(o, s);
2316
- }, de = () => {
2316
+ }, pe = () => {
2317
2317
  }, Tn = (e) => (t) => {
2318
2318
  const { event: r } = t;
2319
2319
  return r.isPropagationStopped() ? null : e(t);
@@ -2336,157 +2336,158 @@ class Pn {
2336
2336
  }
2337
2337
  const ie = new Pn(), We = ({
2338
2338
  children: e,
2339
- onDrag: t = de,
2340
- onDragStart: r = de,
2341
- onDragEnd: n = de,
2342
- onPan: o = de,
2343
- onTap: s = de,
2344
- onLongTap: a = de,
2345
- onDoubleTap: u = de,
2339
+ onDrag: t = pe,
2340
+ onDragStart: r = pe,
2341
+ onDragEnd: n = pe,
2342
+ onPan: o = pe,
2343
+ onTap: s = pe,
2344
+ onLongTap: a = pe,
2345
+ onDoubleTap: u = pe,
2346
2346
  onZoom: l,
2347
2347
  mainAction: d = "drag"
2348
2348
  }) => {
2349
- const f = g.useRef(null), c = g.useRef({
2349
+ const f = m.useRef(null), c = m.useRef({
2350
2350
  moving: !1,
2351
2351
  pointers: {},
2352
2352
  mainPointer: void 0
2353
- }), b = (R) => {
2353
+ }), b = (E) => {
2354
2354
  const {
2355
2355
  deltaX: x,
2356
- deltaY: y,
2356
+ deltaY: v,
2357
2357
  clientX: p,
2358
- clientY: h,
2359
- deltaMode: v,
2360
- ctrlKey: C,
2361
- altKey: D,
2362
- metaKey: k,
2363
- target: P
2364
- } = R;
2365
- if (!(D || C && !tt()))
2366
- if (tt() && !C)
2358
+ clientY: R,
2359
+ deltaMode: w,
2360
+ ctrlKey: g,
2361
+ altKey: k,
2362
+ metaKey: P,
2363
+ target: M
2364
+ } = E;
2365
+ if (!(k || g && !tt()))
2366
+ if (tt() && !g)
2367
2367
  ie.add(o, {
2368
2368
  deltaX: -2 * x,
2369
- deltaY: -2 * y,
2369
+ deltaY: -2 * v,
2370
2370
  button: 1,
2371
- ctrlKey: C,
2372
- metaKey: k,
2373
- target: P,
2374
- event: R
2371
+ ctrlKey: g,
2372
+ metaKey: P,
2373
+ target: M,
2374
+ event: E
2375
2375
  });
2376
2376
  else {
2377
- if (l === void 0 || !y)
2377
+ if (l === void 0 || !v)
2378
2378
  return;
2379
- let M = y;
2380
- switch (v) {
2379
+ let $ = v;
2380
+ switch (w) {
2381
2381
  case 1:
2382
- M *= In;
2382
+ $ *= In;
2383
2383
  break;
2384
2384
  case 2:
2385
- M *= On;
2385
+ $ *= On;
2386
2386
  break;
2387
2387
  }
2388
- tt() && (M *= 2), ie.add(l, { scale: M, clientX: p, clientY: h, event: R });
2388
+ tt() && ($ *= 2), ie.add(l, { scale: $, clientX: p, clientY: R, event: E });
2389
2389
  }
2390
- }, _ = (R) => {
2390
+ }, _ = (E) => {
2391
2391
  const {
2392
2392
  target: x,
2393
- button: y,
2393
+ button: v,
2394
2394
  clientX: p,
2395
- clientY: h,
2396
- pointerId: v,
2397
- altKey: C,
2398
- ctrlKey: D,
2399
- metaKey: k,
2400
- isPrimary: P
2401
- } = R;
2402
- if (c.current.pointers[v] = { clientX: p, clientY: h }, P && (c.current.mainPointer = void 0), c.current.mainPointer !== void 0) {
2403
- if (c.current.mainPointer !== v)
2395
+ clientY: R,
2396
+ pointerId: w,
2397
+ altKey: g,
2398
+ ctrlKey: k,
2399
+ metaKey: P,
2400
+ isPrimary: M
2401
+ } = E;
2402
+ if (c.current.pointers[w] = { clientX: p, clientY: R }, M && (c.current.mainPointer = void 0), c.current.mainPointer !== void 0) {
2403
+ if (c.current.mainPointer !== w)
2404
2404
  try {
2405
- const { clientX: M, clientY: N } = Vt(
2405
+ const { clientX: $, clientY: B } = Vt(
2406
2406
  c.current.pointers,
2407
- v
2408
- ), F = (M + p) / 2, K = (N + h) / 2, O = Ft(
2409
- [M, N],
2410
- [p, h]
2407
+ w
2408
+ ), N = ($ + p) / 2, K = (B + R) / 2, O = Ft(
2409
+ [$, B],
2410
+ [p, R]
2411
2411
  );
2412
2412
  Object.assign(c.current, {
2413
2413
  pressed: !0,
2414
2414
  moving: !1,
2415
2415
  gestureStart: !1,
2416
2416
  startX: p,
2417
- startY: h,
2418
- prevX: F,
2417
+ startY: R,
2418
+ prevX: N,
2419
2419
  prevY: K,
2420
2420
  startDistance: O,
2421
2421
  prevDistance: O
2422
2422
  });
2423
- } catch (M) {
2424
- console.log("Error while getting other pointer. Ignoring", M), c.current.mainPointer;
2423
+ } catch ($) {
2424
+ console.log("Error while getting other pointer. Ignoring", $), c.current.mainPointer;
2425
2425
  }
2426
2426
  return;
2427
2427
  }
2428
- c.current.mainPointer = v, Object.assign(c.current, {
2428
+ c.current.mainPointer = w, Object.assign(c.current, {
2429
2429
  pressed: !0,
2430
2430
  moving: !1,
2431
2431
  gestureStart: !1,
2432
2432
  startX: p,
2433
- startY: h,
2433
+ startY: R,
2434
2434
  prevX: p,
2435
- prevY: h,
2436
- currentButton: y,
2437
- pointerDownEvent: R,
2435
+ prevY: R,
2436
+ currentButton: v,
2437
+ pointerDownEvent: E,
2438
2438
  target: x,
2439
2439
  timeStart: Date.now(),
2440
2440
  longTapTimeout: setTimeout(async () => {
2441
2441
  c.current.noTap = !0, ie.add(a, {
2442
2442
  clientX: p,
2443
- clientY: h,
2444
- altKey: C,
2445
- ctrlKey: D,
2446
- metaKey: k,
2443
+ clientY: R,
2444
+ altKey: g,
2445
+ ctrlKey: k,
2446
+ metaKey: P,
2447
2447
  target: x,
2448
- event: R
2448
+ event: E
2449
2449
  });
2450
2450
  }, 750)
2451
2451
  });
2452
2452
  try {
2453
- x.setPointerCapture(v);
2454
- } catch (M) {
2455
- console.log("Fail to capture pointer", M);
2453
+ x.setPointerCapture(w);
2454
+ } catch ($) {
2455
+ console.log("Fail to capture pointer", $);
2456
2456
  }
2457
- }, w = (R) => {
2457
+ }, C = (E) => {
2458
2458
  if (c.current.pressed) {
2459
2459
  const {
2460
2460
  pointerId: x,
2461
- clientX: y,
2461
+ clientX: v,
2462
2462
  clientY: p,
2463
- altKey: h,
2464
- ctrlKey: v,
2465
- metaKey: C,
2466
- buttons: D,
2467
- pointerType: k
2468
- } = R;
2463
+ altKey: R,
2464
+ shiftKey: w,
2465
+ ctrlKey: g,
2466
+ metaKey: k,
2467
+ buttons: P,
2468
+ pointerType: M
2469
+ } = E;
2469
2470
  c.current.pointers[x] = {
2470
- clientX: y,
2471
+ clientX: v,
2471
2472
  clientY: p
2472
2473
  }, c.current.moving = !0;
2473
- const P = Object.keys(c.current.pointers).length === 2;
2474
- let M, N, F;
2475
- if (P) {
2476
- const { clientX: A, clientY: U } = Vt(
2474
+ const $ = Object.keys(c.current.pointers).length === 2;
2475
+ let B, N, K;
2476
+ if ($) {
2477
+ const { clientX: X, clientY: z } = Vt(
2477
2478
  c.current.pointers,
2478
2479
  x
2479
2480
  );
2480
- M = (A + y) / 2, N = (U + p) / 2, F = Ft(
2481
- [A, U],
2482
- [y, p]
2481
+ B = (X + v) / 2, N = (z + p) / 2, K = Ft(
2482
+ [X, z],
2483
+ [v, p]
2483
2484
  );
2484
2485
  } else
2485
- M = y, N = p;
2486
- let K = h || v || C || D !== 1;
2487
- d !== "drag" && (K = !K);
2488
- const O = k !== "touch" ? !K : !P, $ = k !== "touch" ? K : P;
2489
- if (O) {
2486
+ B = v, N = p;
2487
+ let O = w || R || g || k || P !== 1;
2488
+ d !== "drag" && (O = !O);
2489
+ const D = M !== "touch" ? !O : !$, A = M !== "touch" ? O : $;
2490
+ if (D) {
2490
2491
  c.current.gestureStart || (f.current.style.cursor = "move", c.current.gestureStart = !0, clearTimeout(c.current.longTapTimeout), ie.add(r, {
2491
2492
  deltaX: 0,
2492
2493
  deltaY: 0,
@@ -2497,57 +2498,69 @@ const ie = new Pn(), We = ({
2497
2498
  distanceX: 0,
2498
2499
  distanceY: 0,
2499
2500
  button: c.current.currentButton,
2500
- altKey: h,
2501
- ctrlKey: v,
2502
- metaKey: C,
2501
+ altKey: R,
2502
+ shiftKey: w,
2503
+ ctrlKey: g,
2504
+ metaKey: k,
2503
2505
  target: c.current.target,
2504
2506
  event: c.current.pointerDownEvent
2505
2507
  }));
2506
- const A = M - c.current.prevX, U = N - c.current.prevY, Y = M - c.current.startX, W = N - c.current.startY;
2508
+ const X = B - c.current.prevX, z = N - c.current.prevY, F = B - c.current.startX, H = N - c.current.startY;
2507
2509
  ie.add(t, {
2508
- deltaX: A,
2509
- deltaY: U,
2510
+ deltaX: X,
2511
+ deltaY: z,
2510
2512
  startX: c.current.startX,
2511
2513
  startY: c.current.startY,
2512
- clientX: M,
2514
+ clientX: B,
2513
2515
  clientY: N,
2514
- distanceX: Y,
2515
- distanceY: W,
2516
+ distanceX: F,
2517
+ distanceY: H,
2516
2518
  button: c.current.currentButton,
2517
- altKey: h,
2518
- ctrlKey: v,
2519
- metaKey: C,
2519
+ altKey: R,
2520
+ shiftKey: w,
2521
+ ctrlKey: g,
2522
+ metaKey: k,
2520
2523
  target: c.current.target,
2521
- event: R
2524
+ event: E
2522
2525
  });
2523
2526
  }
2524
- if ($) {
2527
+ if (A) {
2525
2528
  c.current.gestureStart || (f.current.style.cursor = "move", c.current.gestureStart = !0, clearTimeout(c.current.longTapTimeout));
2526
- const A = M - c.current.prevX, U = N - c.current.prevY, { target: Y } = c.current;
2529
+ const X = B - c.current.prevX, z = N - c.current.prevY, { target: F } = c.current;
2527
2530
  if (ie.add(o, {
2528
- deltaX: A,
2529
- deltaY: U,
2531
+ deltaX: X,
2532
+ deltaY: z,
2530
2533
  button: c.current.currentButton,
2531
- altKey: h,
2532
- ctrlKey: v,
2533
- metaKey: C,
2534
- target: Y,
2535
- event: R
2536
- }), F !== c.current.prevDistance && l) {
2537
- const W = c.current.prevDistance - F;
2538
- Math.abs(W) > 0 && (ie.add(l, {
2539
- scale: W * 3,
2540
- clientX: M,
2534
+ altKey: R,
2535
+ shiftKey: w,
2536
+ ctrlKey: g,
2537
+ metaKey: k,
2538
+ target: F,
2539
+ event: E
2540
+ }), K !== c.current.prevDistance && l) {
2541
+ const H = c.current.prevDistance - K;
2542
+ Math.abs(H) > 0 && (ie.add(l, {
2543
+ scale: H * 3,
2544
+ clientX: B,
2541
2545
  clientY: N,
2542
- event: R
2543
- }), c.current.prevDistance = F);
2546
+ event: E
2547
+ }), c.current.prevDistance = K);
2544
2548
  }
2545
2549
  }
2546
- c.current.prevX = M, c.current.prevY = N;
2550
+ c.current.prevX = B, c.current.prevY = N;
2547
2551
  }
2548
- }, m = (R) => {
2549
- const { clientX: x, clientY: y, altKey: p, ctrlKey: h, metaKey: v, target: C, pointerId: D } = R;
2550
- if (c.current.pointers[D] && (delete c.current.pointers[D], c.current.mainPointer === D)) {
2552
+ }, h = (E) => {
2553
+ const {
2554
+ clientX: x,
2555
+ clientY: v,
2556
+ altKey: p,
2557
+ shiftKey: R,
2558
+ ctrlKey: w,
2559
+ metaKey: g,
2560
+ target: k,
2561
+ pointerId: P
2562
+ } = E;
2563
+ if (c.current.pointers[P] && (delete c.current.pointers[P], c.current.mainPointer === P)) {
2551
2564
  for (; Object.keys(c.current.pointers).length > 0; ) {
2552
2565
  c.current.mainPointer = Number(
2553
2566
  Object.keys(c.current.pointers)[0]
@@ -2555,36 +2568,38 @@ const ie = new Pn(), We = ({
2555
2568
  try {
2556
2569
  c.current.target.setPointerCapture(c.current.mainPointer);
2557
2570
  return;
2558
- } catch (k) {
2559
- console.log("Fails to set pointer capture", k), c.current.mainPointer = void 0, delete c.current.pointers[Object.keys(c.current.pointers)[0]];
2571
+ } catch (M) {
2572
+ console.log("Fails to set pointer capture", M), c.current.mainPointer = void 0, delete c.current.pointers[Object.keys(c.current.pointers)[0]];
2560
2573
  }
2561
2574
  }
2562
2575
  if (c.current.mainPointer = void 0, c.current.pressed = !1, clearTimeout(c.current.longTapTimeout), c.current.moving)
2563
2576
  c.current.moving = !1, ie.add(n, {
2564
2577
  deltaX: x - c.current.prevX,
2565
- deltaY: y - c.current.prevY,
2578
+ deltaY: v - c.current.prevY,
2566
2579
  startX: c.current.startX,
2567
2580
  startY: c.current.startY,
2568
2581
  clientX: x,
2569
- clientY: y,
2582
+ clientY: v,
2570
2583
  distanceX: x - c.current.startX,
2571
- distanceY: y - c.current.startY,
2584
+ distanceY: v - c.current.startY,
2572
2585
  button: c.current.currentButton,
2573
2586
  altKey: p,
2574
- ctrlKey: h,
2575
- metaKey: v,
2576
- event: R
2587
+ shiftKey: R,
2588
+ ctrlKey: w,
2589
+ metaKey: g,
2590
+ event: E
2577
2591
  }), f.current.style.cursor = "auto";
2578
2592
  else {
2579
- const k = Date.now();
2580
- c.current.noTap ? c.current.noTap = !1 : c.current.timeStart - k < 300 && ie.add(s, {
2593
+ const M = Date.now();
2594
+ c.current.noTap ? c.current.noTap = !1 : c.current.timeStart - M < 300 && ie.add(s, {
2581
2595
  clientX: x,
2582
- clientY: y,
2596
+ clientY: v,
2583
2597
  altKey: p,
2584
- ctrlKey: h,
2585
- metaKey: v,
2586
- target: C,
2587
- event: R
2598
+ shiftKey: R,
2599
+ ctrlKey: w,
2600
+ metaKey: g,
2601
+ target: k,
2602
+ event: E
2588
2603
  });
2589
2604
  }
2590
2605
  }
@@ -2594,21 +2609,22 @@ const ie = new Pn(), We = ({
2594
2609
  {
2595
2610
  onWheel: b,
2596
2611
  onPointerDown: _,
2597
- onPointerMove: w,
2598
- onPointerUp: m,
2599
- onPointerOut: m,
2600
- onPointerLeave: m,
2601
- onPointerCancel: m,
2602
- onDoubleClick: (R) => {
2603
- const { clientX: x, clientY: y, altKey: p, ctrlKey: h, metaKey: v, target: C } = R;
2612
+ onPointerMove: C,
2613
+ onPointerUp: h,
2614
+ onPointerOut: h,
2615
+ onPointerLeave: h,
2616
+ onPointerCancel: h,
2617
+ onDoubleClick: (E) => {
2618
+ const { clientX: x, clientY: v, altKey: p, shiftKey: R, ctrlKey: w, metaKey: g, target: k } = E;
2604
2619
  ie.add(u, {
2605
2620
  clientX: x,
2606
- clientY: y,
2621
+ clientY: v,
2607
2622
  altKey: p,
2608
- ctrlKey: h,
2609
- metaKey: v,
2610
- target: C,
2611
- event: R
2623
+ shiftKey: R,
2624
+ ctrlKey: w,
2625
+ metaKey: g,
2626
+ target: k,
2627
+ event: E
2612
2628
  });
2613
2629
  },
2614
2630
  style: { touchAction: "none" },
@@ -2627,11 +2643,11 @@ const ie = new Pn(), We = ({
2627
2643
  });
2628
2644
  }, children: /* @__PURE__ */ T("div", { ...t }) });
2629
2645
  };
2630
- let Mn = { data: "" }, jn = (e) => typeof window == "object" ? ((e ? e.querySelector("#_goober") : window._goober) || Object.assign((e || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : e || Mn, Dn = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, $n = /\/\*[^]*?\*\/| +/g, Kt = /\n+/g, fe = (e, t) => {
2646
+ let Mn = { data: "" }, jn = (e) => typeof window == "object" ? ((e ? e.querySelector("#_goober") : window._goober) || Object.assign((e || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : e || Mn, Dn = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, $n = /\/\*[^]*?\*\/| +/g, Kt = /\n+/g, de = (e, t) => {
2631
2647
  let r = "", n = "", o = "";
2632
2648
  for (let s in e) {
2633
2649
  let a = e[s];
2634
- s[0] == "@" ? s[1] == "i" ? r = s + " " + a + ";" : n += s[1] == "f" ? fe(a, s) : s + "{" + fe(a, s[1] == "k" ? "" : t) + "}" : typeof a == "object" ? n += fe(a, t ? t.replace(/([^,])+/g, (u) => s.replace(/(^:.*)|([^,])+/g, (l) => /&/.test(l) ? l.replace(/&/g, u) : u ? u + " " + l : l)) : s) : a != null && (s = /^--/.test(s) ? s : s.replace(/[A-Z]/g, "-$&").toLowerCase(), o += fe.p ? fe.p(s, a) : s + ":" + a + ";");
2650
+ s[0] == "@" ? s[1] == "i" ? r = s + " " + a + ";" : n += s[1] == "f" ? de(a, s) : s + "{" + de(a, s[1] == "k" ? "" : t) + "}" : typeof a == "object" ? n += de(a, t ? t.replace(/([^,])+/g, (u) => s.replace(/(^:.*)|([^,])+/g, (l) => /&/.test(l) ? l.replace(/&/g, u) : u ? u + " " + l : l)) : s) : a != null && (s = /^--/.test(s) ? s : s.replace(/[A-Z]/g, "-$&").toLowerCase(), o += de.p ? de.p(s, a) : s + ":" + a + ";");
2635
2651
  }
2636
2652
  return r + (t && o ? t + "{" + o + "}" : o) + n;
2637
2653
  }, ce = {}, lr = (e) => {
@@ -2656,28 +2672,28 @@ let Mn = { data: "" }, jn = (e) => typeof window == "object" ? ((e ? e.querySele
2656
2672
  f[4] ? b.shift() : f[3] ? (c = f[3].replace(Kt, " ").trim(), b.unshift(b[0][c] = b[0][c] || {})) : b[0][f[1]] = f[2].replace(Kt, " ").trim();
2657
2673
  return b[0];
2658
2674
  })(e);
2659
- ce[a] = fe(o ? { ["@keyframes " + a]: l } : l, r ? "" : "." + a);
2675
+ ce[a] = de(o ? { ["@keyframes " + a]: l } : l, r ? "" : "." + a);
2660
2676
  }
2661
2677
  let u = r && ce.g ? ce.g : null;
2662
2678
  return r && (ce.g = ce[a]), ((l, d, f, c) => {
2663
2679
  c ? d.data = d.data.replace(c, l) : d.data.indexOf(l) === -1 && (d.data = f ? l + d.data : d.data + l);
2664
2680
  })(ce[a], t, n, u), a;
2665
- }, zn = (e, t, r) => e.reduce((n, o, s) => {
2681
+ }, Ln = (e, t, r) => e.reduce((n, o, s) => {
2666
2682
  let a = t[s];
2667
2683
  if (a && a.call) {
2668
2684
  let u = a(r), l = u && u.props && u.props.className || /^go/.test(u) && u;
2669
- a = l ? "." + l : u && typeof u == "object" ? u.props ? "" : fe(u, "") : u === !1 ? "" : u;
2685
+ a = l ? "." + l : u && typeof u == "object" ? u.props ? "" : de(u, "") : u === !1 ? "" : u;
2670
2686
  }
2671
2687
  return n + o + (a ?? "");
2672
2688
  }, "");
2673
- function H(e) {
2689
+ function q(e) {
2674
2690
  let t = this || {}, r = e.call ? e(t.p) : e;
2675
- return An(r.unshift ? r.raw ? zn(r, [].slice.call(arguments, 1), t.p) : r.reduce((n, o) => Object.assign(n, o && o.call ? o(t.p) : o), {}) : r, jn(t.target), t.g, t.o, t.k);
2691
+ return An(r.unshift ? r.raw ? Ln(r, [].slice.call(arguments, 1), t.p) : r.reduce((n, o) => Object.assign(n, o && o.call ? o(t.p) : o), {}) : r, jn(t.target), t.g, t.o, t.k);
2676
2692
  }
2677
- H.bind({ g: 1 });
2678
- H.bind({ k: 1 });
2679
- function Ln(e, t, r, n) {
2680
- fe.p = t;
2693
+ q.bind({ g: 1 });
2694
+ q.bind({ k: 1 });
2695
+ function zn(e, t, r, n) {
2696
+ de.p = t;
2681
2697
  }
2682
2698
  var Yn = function e(t, r) {
2683
2699
  if (t === r)
@@ -2714,36 +2730,36 @@ var Yn = function e(t, r) {
2714
2730
  }
2715
2731
  return t !== t && r !== r;
2716
2732
  };
2717
- const Bn = H`
2733
+ const Bn = q`
2718
2734
  display: inline-block;
2719
2735
  transition: transform 150ms;
2720
2736
  user-select: none;
2721
2737
  padding: 2px;
2722
2738
  box-sizing: border-box;
2723
- `, Nn = H`
2739
+ `, Nn = q`
2724
2740
  border: 2px dashed #db5034;
2725
2741
  padding: 0px;
2726
2742
  cursor: pointer;
2727
- `, xe = H`
2743
+ `, xe = q`
2728
2744
  position: absolute;
2729
2745
  width: 0px;
2730
2746
  height: 0px;
2731
- `, Un = H`
2747
+ `, Un = q`
2732
2748
  top: 0;
2733
2749
  left: 0;
2734
- `, Xn = H`
2750
+ `, Xn = q`
2735
2751
  top: 0;
2736
2752
  right: 0;
2737
- `, Wn = H`
2753
+ `, Wn = q`
2738
2754
  bottom: 0;
2739
2755
  left: 0;
2740
- `, Vn = H`
2756
+ `, Vn = q`
2741
2757
  bottom: 0;
2742
2758
  right: 0;
2743
- `, Fn = H`
2759
+ `, Fn = q`
2744
2760
  top: 50%;
2745
2761
  left: 50%;
2746
- `, nt = H`
2762
+ `, nt = q`
2747
2763
  position: absolute;
2748
2764
 
2749
2765
  width: 10px;
@@ -2751,22 +2767,22 @@ const Bn = H`
2751
2767
  border: 2px solid #db5034;
2752
2768
  background-color: #db5034;
2753
2769
  cursor: move;
2754
- `, Kn = H`
2770
+ `, Kn = q`
2755
2771
  cursor: ew-resize;
2756
2772
  right: -6px;
2757
2773
  top: calc(50% - 5px);
2758
- `, Hn = H`
2774
+ `, Hn = q`
2759
2775
  cursor: ns-resize;
2760
2776
  bottom: -6px;
2761
2777
  left: calc(50% - 5px);
2762
- `, qn = H`
2778
+ `, qn = q`
2763
2779
  cursor: nwse-resize;
2764
2780
  bottom: -6px;
2765
2781
  right: -6px;
2766
- `, Gn = ({ onReload: e }) => /* @__PURE__ */ ue(
2782
+ `, Gn = ({ onReload: e }) => /* @__PURE__ */ le(
2767
2783
  "div",
2768
2784
  {
2769
- className: `syncboard-error-item ${H({
2785
+ className: `syncboard-error-item ${q({
2770
2786
  width: "100px",
2771
2787
  display: "flex",
2772
2788
  flexDirection: "column",
@@ -2780,7 +2796,7 @@ const Bn = H`
2780
2796
  ]
2781
2797
  }
2782
2798
  );
2783
- class Jn extends g.Component {
2799
+ class Jn extends m.Component {
2784
2800
  constructor(t) {
2785
2801
  super(t), this.state = { hasError: !1, itemId: t.itemId }, this.onReload = this.onReload.bind(this);
2786
2802
  }
@@ -2841,61 +2857,61 @@ const Zn = (e) => {
2841
2857
  itemMap: d,
2842
2858
  showResizeHandle: f = !0
2843
2859
  }) => {
2844
- var v;
2845
- const c = g.useRef(null), {
2860
+ var w;
2861
+ const c = m.useRef(null), {
2846
2862
  component: b = () => null,
2847
2863
  resizeDirections: _ = eo,
2848
- resize: w = Qn
2849
- } = d[t], m = g.useCallback(
2850
- (C) => e(n, C),
2864
+ resize: C = Qn
2865
+ } = d[t], h = m.useCallback(
2866
+ (g) => e(n, g),
2851
2867
  [e, n]
2852
2868
  );
2853
- g.useEffect(() => {
2869
+ m.useEffect(() => {
2854
2870
  c.current.className = u;
2855
2871
  }, [u]);
2856
- const E = ["item", n, Bn];
2857
- o && E.push("locked"), l && (E.push("selected"), E.push(Nn));
2858
- const R = E.join(" "), x = ({ width: C = 0, height: D = 0, keepRatio: k }) => {
2859
- m((P) => {
2860
- const { offsetWidth: M, offsetHeight: N } = c.current;
2861
- return w({
2862
- prevState: P,
2863
- width: C,
2864
- height: D,
2865
- actualHeight: N,
2866
- actualWidth: M,
2867
- keepRatio: k
2872
+ const S = ["item", n, Bn];
2873
+ o && S.push("locked"), l && (S.push("selected"), S.push(Nn));
2874
+ const E = S.join(" "), x = ({ width: g = 0, height: k = 0, keepRatio: P }) => {
2875
+ h((M) => {
2876
+ const { offsetWidth: $, offsetHeight: B } = c.current;
2877
+ return C({
2878
+ prevState: M,
2879
+ width: g,
2880
+ height: k,
2881
+ actualHeight: B,
2882
+ actualWidth: $,
2883
+ keepRatio: P
2868
2884
  });
2869
2885
  });
2870
- }, y = ({ width: C }) => {
2871
- x({ width: C });
2872
- }, p = ({ height: C }) => {
2873
- x({ height: C });
2874
- }, h = ({ width: C }) => {
2875
- x({ height: C, width: C, keepRatio: !0 });
2886
+ }, v = ({ width: g }) => {
2887
+ x({ width: g });
2888
+ }, p = ({ height: g }) => {
2889
+ x({ height: g });
2890
+ }, R = ({ width: g }) => {
2891
+ x({ height: g, width: g, keepRatio: !0 });
2876
2892
  };
2877
2893
  return /* @__PURE__ */ T(
2878
2894
  "div",
2879
2895
  {
2880
2896
  style: { transform: `rotate(${r}deg` },
2881
2897
  "data-id": n,
2882
- className: R,
2883
- children: /* @__PURE__ */ ue(
2898
+ className: E,
2899
+ children: /* @__PURE__ */ le(
2884
2900
  "div",
2885
2901
  {
2886
2902
  style: { display: "flex" },
2887
2903
  ref: c,
2888
2904
  onAnimationEnd: Zn,
2889
- onKeyDown: (C) => C.stopPropagation(),
2890
- onKeyUp: (C) => C.stopPropagation(),
2905
+ onKeyDown: (g) => g.stopPropagation(),
2906
+ onKeyUp: (g) => g.stopPropagation(),
2891
2907
  children: [
2892
2908
  /* @__PURE__ */ T(
2893
2909
  Jn,
2894
2910
  {
2895
2911
  itemId: n,
2896
2912
  state: a,
2897
- ErrorComponent: ((v = d == null ? void 0 : d.error) == null ? void 0 : v.component) || Gn,
2898
- children: /* @__PURE__ */ T(b, { ...a, id: n, setState: m })
2913
+ ErrorComponent: ((w = d == null ? void 0 : d.error) == null ? void 0 : w.component) || Gn,
2914
+ children: /* @__PURE__ */ T(b, { ...a, id: n, setState: h })
2899
2915
  }
2900
2916
  ),
2901
2917
  /* @__PURE__ */ T("div", { className: `corner ${xe} ${Un}` }),
@@ -2903,12 +2919,12 @@ const Zn = (e) => {
2903
2919
  /* @__PURE__ */ T("div", { className: `corner ${xe} ${Vn}` }),
2904
2920
  /* @__PURE__ */ T("div", { className: `corner ${xe} ${Wn}` }),
2905
2921
  /* @__PURE__ */ T("div", { className: `${xe} ${Fn}` }),
2906
- f && /* @__PURE__ */ ue(Qt, { children: [
2922
+ f && /* @__PURE__ */ le(Qt, { children: [
2907
2923
  _.b && /* @__PURE__ */ T(
2908
2924
  rt,
2909
2925
  {
2910
2926
  className: `${nt} ${qn}`,
2911
- onResize: h
2927
+ onResize: R
2912
2928
  }
2913
2929
  ),
2914
2930
  _.h && /* @__PURE__ */ T(
@@ -2922,7 +2938,7 @@ const Zn = (e) => {
2922
2938
  rt,
2923
2939
  {
2924
2940
  className: `${nt} ${Kn}`,
2925
- onResize: y
2941
+ onResize: v
2926
2942
  }
2927
2943
  )
2928
2944
  ] })
@@ -2983,7 +2999,7 @@ const Zn = (e) => {
2983
2999
  d.config.itemTemplates,
2984
3000
  d.selection
2985
3001
  ]
2986
- ), [u] = ge((d) => [d.getUser]), l = H({
3002
+ ), [u] = ge((d) => [d.getUser]), l = q({
2987
3003
  position: "absolute",
2988
3004
  top: `${n / 2}px`,
2989
3005
  left: `${n / 2}px`,
@@ -3003,21 +3019,57 @@ const Zn = (e) => {
3003
3019
  },
3004
3020
  d
3005
3021
  ));
3006
- }, ao = H({
3022
+ };
3023
+ function ao(e = !1) {
3024
+ const t = Ie(e), r = Jt(() => t.current, []);
3025
+ return Me(() => (t.current = !0, () => {
3026
+ t.current = !1;
3027
+ }), []), r;
3028
+ }
3029
+ function co(e, ...t) {
3030
+ e && e.addEventListener && e.addEventListener(...t);
3031
+ }
3032
+ function uo(e, ...t) {
3033
+ e && e.removeEventListener && e.removeEventListener(...t);
3034
+ }
3035
+ const lo = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
3036
+ function ue(e, ...t) {
3037
+ const r = ao(), n = lt(t[1]), o = ct(
3038
+ () => (
3039
+ // as some event listeners designed to be used through `this`
3040
+ // it is better to make listener a conventional function as it
3041
+ // infers call context
3042
+ // eslint-disable-next-line func-names
3043
+ function(...s) {
3044
+ r() && (typeof n.current == "function" ? n.current.apply(this, s) : typeof n.current.handleEvent == "function" && n.current.handleEvent.apply(this, s));
3045
+ }
3046
+ ),
3047
+ // eslint-disable-next-line react-hooks/exhaustive-deps
3048
+ []
3049
+ );
3050
+ Me(() => {
3051
+ const s = e && lo(e, "current") ? e.current : e;
3052
+ if (!s)
3053
+ return;
3054
+ const a = t.slice(2);
3055
+ return co(s, t[0], o, ...a), () => uo(s, t[0], o, ...a);
3056
+ }, [e, t[0]]);
3057
+ }
3058
+ const fo = q({
3007
3059
  zIndex: 210,
3008
3060
  position: "absolute",
3009
3061
  backgroundColor: "hsla(0, 40%, 50%, 10%)",
3010
3062
  border: "2px solid hsl(0, 55%, 40%)"
3011
- }), co = (e, t) => {
3012
- const r = t.getElementsByClassName("selector");
3013
- if (!r.length)
3063
+ }), po = (e, t, r = !1) => {
3064
+ const n = t.getElementsByClassName("selector");
3065
+ if (!n.length)
3014
3066
  return [];
3015
- const n = r[0];
3016
- return Array.from(t.getElementsByClassName("item")).filter((o) => {
3017
- const s = ke(o), a = e[s];
3018
- return !a || a.locked ? !1 : en(o, n);
3019
- }).map((o) => ke(o));
3020
- }, uo = ({ children: e, moveFirst: t }) => {
3067
+ const o = n[0];
3068
+ return Array.from(t.getElementsByClassName("item")).filter((s) => {
3069
+ const a = ke(s), u = e[a];
3070
+ return !u || !r && u.locked ? !1 : en(s, o);
3071
+ }).map((s) => ke(s));
3072
+ }, mo = ({ children: e, moveFirst: t }) => {
3021
3073
  const [
3022
3074
  r,
3023
3075
  n,
@@ -3026,68 +3078,72 @@ const Zn = (e) => {
3026
3078
  a,
3027
3079
  u,
3028
3080
  l
3029
- ] = Z((h) => [
3030
- h.getSelection,
3031
- h.clear,
3032
- h.setSelection,
3033
- h.select,
3034
- h.getConfiguration,
3035
- h.getBoardState,
3036
- h.updateBoardState
3037
- ]), { findElementUnderPointer: d } = pt(), [f] = se((h) => [h.getItems]), [c, b] = g.useState({}), [, _] = g.useTransition(), w = g.useRef(null), m = g.useRef({
3081
+ ] = Z((g) => [
3082
+ g.getSelection,
3083
+ g.clear,
3084
+ g.setSelection,
3085
+ g.select,
3086
+ g.getConfiguration,
3087
+ g.getBoardState,
3088
+ g.updateBoardState
3089
+ ]), { findElementUnderPointer: d } = pt(), [f] = se((g) => [g.getItems]), [c, b] = m.useState({}), [, _] = m.useTransition(), [C, h] = m.useState(!1), S = m.useRef(null), E = m.useRef({
3038
3090
  moving: !1
3039
3091
  });
3040
- return g.useEffect(() => (n(), () => {
3092
+ return ue(document, "keydown", (g) => {
3093
+ g.key === "l" && h(!0);
3094
+ }), ue(document, "keyup", (g) => {
3095
+ g.key === "l" && h(!1);
3096
+ }), m.useEffect(() => (n(), () => {
3041
3097
  n();
3042
- }), [n]), g.useEffect(() => {
3043
- if (m.current.moving) {
3044
- const h = f(), { boardWrapper: v } = a(), C = co(h, v);
3098
+ }), [n]), m.useEffect(() => {
3099
+ if (E.current.moving) {
3100
+ const g = f(), { boardWrapper: k } = a(), P = po(g, k, C);
3045
3101
  _(() => {
3046
- o(C);
3102
+ o(P);
3047
3103
  });
3048
3104
  }
3049
- }, [a, f, c, o]), /* @__PURE__ */ T(
3105
+ }, [a, f, c, o, C]), /* @__PURE__ */ T(
3050
3106
  We,
3051
3107
  {
3052
- onDragStart: async (h) => {
3053
- await d(h) || (m.current.moving = !0, _(() => {
3108
+ onDragStart: async (g) => {
3109
+ await d(g) || (E.current.moving = !0, _(() => {
3054
3110
  l({ selecting: !0 });
3055
- }), w.current.style.cursor = "crosshair");
3111
+ }), S.current.style.cursor = "crosshair");
3056
3112
  },
3057
- onDrag: ({ distanceY: h, distanceX: v, startX: C, startY: D }) => {
3058
- if (m.current.moving) {
3059
- const { top: k, left: P } = w.current.getBoundingClientRect(), { scale: M } = u(), N = (C - P) / M, F = (D - k) / M, K = v / M, O = h / M;
3060
- K > 0 ? (m.current.left = N, m.current.width = K) : (m.current.left = N + K, m.current.width = -K), O > 0 ? (m.current.top = F, m.current.height = O) : (m.current.top = F + O, m.current.height = -O), b({ ...m.current, moving: !0 });
3113
+ onDrag: ({ distanceY: g, distanceX: k, startX: P, startY: M }) => {
3114
+ if (E.current.moving) {
3115
+ const { top: $, left: B } = S.current.getBoundingClientRect(), { scale: N } = u(), K = (P - B) / N, O = (M - $) / N, D = k / N, A = g / N;
3116
+ D > 0 ? (E.current.left = K, E.current.width = D) : (E.current.left = K + D, E.current.width = -D), A > 0 ? (E.current.top = O, E.current.height = A) : (E.current.top = O + A, E.current.height = -A), b({ ...E.current, moving: !0 });
3061
3117
  }
3062
3118
  },
3063
3119
  onDragEnd: () => {
3064
- m.current.moving && (_(() => {
3120
+ E.current.moving && (_(() => {
3065
3121
  l({ selecting: !1 });
3066
- }), m.current.moving = !1, b({ moving: !1 }), w.current.style.cursor = "auto");
3122
+ }), E.current.moving = !1, b({ moving: !1 }), S.current.style.cursor = "auto");
3067
3123
  },
3068
- onTap: (h) => {
3069
- const { target: v, ctrlKey: C, metaKey: D } = h, k = d(h);
3070
- if (!k && Te(v, "board"))
3124
+ onTap: (g) => {
3125
+ const { target: k, ctrlKey: P, metaKey: M } = g, $ = d(g);
3126
+ if (!$ && Te(k, "board"))
3071
3127
  n();
3072
3128
  else {
3073
- const P = ke(k);
3074
- if (!P) {
3129
+ const B = ke($);
3130
+ if (!B) {
3075
3131
  n();
3076
3132
  return;
3077
3133
  }
3078
- const M = r();
3079
- k && !M.includes(P) && (C || D ? s([P]) : o([P]));
3134
+ const N = r();
3135
+ $ && !N.includes(B) && (P || M ? s([B]) : o([B]));
3080
3136
  }
3081
3137
  },
3082
- onLongTap: ({ target: h }) => {
3083
- const v = Te(h, "item");
3084
- if (v) {
3085
- const C = ke(v);
3086
- o([C]);
3138
+ onLongTap: ({ target: g }) => {
3139
+ const k = Te(g, "item");
3140
+ if (k) {
3141
+ const P = ke(k);
3142
+ o([P]);
3087
3143
  }
3088
3144
  },
3089
3145
  mainAction: t ? "pan" : "drag",
3090
- children: /* @__PURE__ */ ue("div", { ref: w, children: [
3146
+ children: /* @__PURE__ */ le("div", { ref: S, children: [
3091
3147
  c.moving && /* @__PURE__ */ T(
3092
3148
  "div",
3093
3149
  {
@@ -3096,106 +3152,70 @@ const Zn = (e) => {
3096
3152
  height: `${c.height}px`,
3097
3153
  width: `${c.width}px`
3098
3154
  },
3099
- className: `selector ${ao}`
3155
+ className: `selector ${fo}`
3100
3156
  }
3101
3157
  ),
3102
3158
  e
3103
3159
  ] })
3104
3160
  }
3105
3161
  );
3106
- };
3107
- function lo(e = !1) {
3108
- const t = Ie(e), r = Jt(() => t.current, []);
3109
- return Me(() => (t.current = !0, () => {
3110
- t.current = !1;
3111
- }), []), r;
3112
- }
3113
- function fo(e, ...t) {
3114
- e && e.addEventListener && e.addEventListener(...t);
3115
- }
3116
- function po(e, ...t) {
3117
- e && e.removeEventListener && e.removeEventListener(...t);
3118
- }
3119
- const mo = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
3120
- function pe(e, ...t) {
3121
- const r = lo(), n = lt(t[1]), o = ct(
3122
- () => (
3123
- // as some event listeners designed to be used through `this`
3124
- // it is better to make listener a conventional function as it
3125
- // infers call context
3126
- // eslint-disable-next-line func-names
3127
- function(...s) {
3128
- r() && (typeof n.current == "function" ? n.current.apply(this, s) : typeof n.current.handleEvent == "function" && n.current.handleEvent.apply(this, s));
3129
- }
3130
- ),
3131
- // eslint-disable-next-line react-hooks/exhaustive-deps
3132
- []
3133
- );
3134
- Me(() => {
3135
- const s = e && mo(e, "current") ? e.current : e;
3136
- if (!s)
3137
- return;
3138
- const a = t.slice(2);
3139
- return fo(s, t[0], o, ...a), () => po(s, t[0], o, ...a);
3140
- }, [e, t[0]]);
3141
- }
3142
- const go = ({ children: e }) => {
3143
- const { moveItems: t, placeItems: r, findElementUnderPointer: n } = pt(), [o, s, a, u, l] = Z((E) => [
3144
- E.select,
3145
- E.setSelection,
3146
- E.getSelection,
3147
- E.getBoardState,
3148
- E.updateBoardState
3149
- ]), [d] = se((E) => [E.getBoardConfig]), f = g.useRef({}), c = g.useRef({
3162
+ }, go = ({ children: e }) => {
3163
+ const { moveItems: t, placeItems: r, findElementUnderPointer: n } = pt(), [o, s, a, u, l] = Z((S) => [
3164
+ S.select,
3165
+ S.setSelection,
3166
+ S.getSelection,
3167
+ S.getBoardState,
3168
+ S.updateBoardState
3169
+ ]), [d] = se((S) => [S.getBoardConfig]), f = m.useRef({}), c = m.useRef({
3150
3170
  items: []
3151
- }), b = (E) => {
3152
- const { ctrlKey: R, metaKey: x, event: y } = E, p = n(E);
3171
+ }), b = (S) => {
3172
+ const { ctrlKey: E, metaKey: x, event: v } = S, p = n(S);
3153
3173
  if (p) {
3154
- y.stopPropagation();
3155
- const h = a();
3156
- c.current.items = h;
3157
- const v = ke(p);
3158
- h.includes(v) || (R || x ? (c.current.items = [...h, v], o([v])) : (c.current.items = [v], s([v]))), Object.assign(f.current, {
3174
+ v.stopPropagation();
3175
+ const R = a();
3176
+ c.current.items = R;
3177
+ const w = ke(p);
3178
+ R.includes(w) || (E || x ? (c.current.items = [...R, w], o([w])) : (c.current.items = [w], s([w]))), Object.assign(f.current, {
3159
3179
  moving: !0,
3160
3180
  remainX: 0,
3161
3181
  remainY: 0
3162
3182
  });
3163
3183
  }
3164
- }, _ = ({ deltaX: E, deltaY: R, event: x }) => {
3184
+ }, _ = ({ deltaX: S, deltaY: E, event: x }) => {
3165
3185
  if (f.current.moving) {
3166
3186
  x.stopPropagation();
3167
- const { scale: y } = u(), p = f.current.remainX + E / y, h = f.current.remainY + R / y;
3187
+ const { scale: v } = u(), p = f.current.remainX + S / v, R = f.current.remainY + E / v;
3168
3188
  t(
3169
3189
  c.current.items,
3170
3190
  {
3171
3191
  x: p,
3172
- y: h
3192
+ y: R
3173
3193
  },
3174
3194
  !0
3175
3195
  ), l({ movingItems: !0 });
3176
3196
  }
3177
- }, w = () => {
3197
+ }, C = () => {
3178
3198
  if (f.current.moving) {
3179
- const { gridSize: E = 1 } = d(), R = E || 1;
3199
+ const { gridSize: S = 1 } = d(), E = S || 1;
3180
3200
  f.current = { moving: !1 }, r(c.current.items, {
3181
3201
  type: "grid",
3182
- size: R
3202
+ size: E
3183
3203
  }), l({ movingItems: !1 });
3184
3204
  }
3185
3205
  };
3186
- return pe(document, "keydown", (E) => {
3187
- if (["INPUT", "TEXTAREA"].includes(E.target.tagName))
3206
+ return ue(document, "keydown", (S) => {
3207
+ if (["INPUT", "TEXTAREA"].includes(S.target.tagName))
3188
3208
  return;
3189
- const R = a();
3190
- if (R.length) {
3209
+ const E = a();
3210
+ if (E.length) {
3191
3211
  const { gridSize: x = 1 } = d();
3192
- let y = 0, p = 0;
3193
- switch (E.key) {
3212
+ let v = 0, p = 0;
3213
+ switch (S.key) {
3194
3214
  case "ArrowLeft":
3195
- y = -10;
3215
+ v = -10;
3196
3216
  break;
3197
3217
  case "ArrowRight":
3198
- y = 10;
3218
+ v = 10;
3199
3219
  break;
3200
3220
  case "ArrowUp":
3201
3221
  p = -10;
@@ -3204,45 +3224,45 @@ const go = ({ children: e }) => {
3204
3224
  p = 10;
3205
3225
  break;
3206
3226
  }
3207
- (y || p) && (E.shiftKey && (y *= 5, p *= 5), (E.ctrlKey || E.altKey || E.metaKey) && (y /= 10, p /= 10), t(
3208
- R,
3227
+ (v || p) && (S.shiftKey && (v *= 5, p *= 5), (S.ctrlKey || S.altKey || S.metaKey) && (v /= 10, p /= 10), t(
3228
+ E,
3209
3229
  {
3210
- x: y,
3230
+ x: v,
3211
3231
  y: p
3212
3232
  },
3213
3233
  !0
3214
- ), r(R, {
3234
+ ), r(E, {
3215
3235
  type: "grid",
3216
3236
  size: x || 1
3217
- }), E.preventDefault());
3237
+ }), S.preventDefault());
3218
3238
  }
3219
- }), /* @__PURE__ */ T(We, { onDragStart: b, onDrag: _, onDragEnd: w, children: e });
3239
+ }), /* @__PURE__ */ T(We, { onDragStart: b, onDrag: _, onDragEnd: C, children: e });
3220
3240
  }, ho = (e) => {
3221
- const t = g.useRef({ hover: !1, x: 0, y: 0 });
3222
- return pe(e.current, "mousemove", (n) => {
3241
+ const t = m.useRef({ hover: !1, x: 0, y: 0 });
3242
+ return ue(e.current, "mousemove", (n) => {
3223
3243
  const { clientX: o, clientY: s } = n;
3224
3244
  t.current.x = o, t.current.y = s;
3225
- }), pe(e.current, "mouseenter", () => {
3245
+ }), ue(e.current, "mouseenter", () => {
3226
3246
  t.current.hover = !0;
3227
- }), pe(e.current, "mouseleave", () => {
3247
+ }), ue(e.current, "mouseleave", () => {
3228
3248
  t.current.hover = !1;
3229
- }), g.useCallback(() => t.current, []);
3249
+ }), m.useCallback(() => t.current, []);
3230
3250
  }, vo = [...Array(5).keys()].map((e) => `Digit${e + 1}`), yo = () => {
3231
- const [e, t] = g.useState({}), [r, n] = Z((o) => [
3251
+ const [e, t] = m.useState({}), [r, n] = Z((o) => [
3232
3252
  o.getBoardState,
3233
3253
  o.updateBoardState
3234
3254
  ]);
3235
- return pe(document, "keydown", (o) => {
3255
+ return ue(document, "keydown", (o) => {
3236
3256
  if (!["INPUT", "TEXTAREA"].includes(o.target.tagName) && vo.includes(o.code)) {
3237
3257
  const s = o.code, { translateX: a, translateY: u, scale: l } = r();
3238
- o.altKey || o.metaKey || o.ctrlKey ? t((d) => ({
3258
+ o.altKey || o.metaKey || o.ctrlKey || o.shiftKey ? t((d) => ({
3239
3259
  ...d,
3240
3260
  [s]: { translateX: a, translateY: u, scale: l }
3241
3261
  })) : e[s] && n(e[s]), o.preventDefault();
3242
3262
  }
3243
3263
  }), null;
3244
3264
  }, So = ({ children: e, moveFirst: t = !1 }) => {
3245
- const r = g.useRef(null), [
3265
+ const r = m.useRef(null), [
3246
3266
  n,
3247
3267
  o,
3248
3268
  s,
@@ -3258,70 +3278,70 @@ const go = ({ children: e }) => {
3258
3278
  p.getConfiguration,
3259
3279
  p.updateBoardState,
3260
3280
  p.getSelection
3261
- ]), { setDim: l, zoomToCenter: d, zoomToExtent: f } = dt(), [c, b] = g.useState(!1), _ = g.useRef({}), w = ho(r);
3281
+ ]), { setDim: l, zoomToCenter: d, zoomToExtent: f } = dt(), [c, b] = m.useState(!1), _ = m.useRef({}), C = ho(r);
3262
3282
  yo();
3263
- const m = g.useCallback(() => {
3283
+ const h = m.useCallback(() => {
3264
3284
  const { itemExtent: p } = s();
3265
3285
  f(p);
3266
3286
  }, [s, f]);
3267
- g.useEffect(() => {
3268
- !c && o.left && (m(), b(!0));
3269
- }, [m, c, o]);
3270
- const E = ({ clientX: p, clientY: h, scale: v }) => {
3271
- d(1 - v / 500, { x: p, y: h }), clearTimeout(_.current.zoom), _.current.zoom = setTimeout(() => {
3287
+ m.useEffect(() => {
3288
+ !c && o.left && (h(), b(!0));
3289
+ }, [h, c, o]);
3290
+ const S = ({ clientX: p, clientY: R, scale: w }) => {
3291
+ d(1 - w / 500, { x: p, y: R }), clearTimeout(_.current.zoom), _.current.zoom = setTimeout(() => {
3272
3292
  a({ zooming: !1 });
3273
3293
  }, 200), a({ zooming: !0 });
3274
- }, R = ({ deltaX: p, deltaY: h }) => {
3275
- l((v) => ({
3276
- ...v,
3277
- translateX: v.translateX + p,
3278
- translateY: v.translateY + h
3294
+ }, E = ({ deltaX: p, deltaY: R }) => {
3295
+ l((w) => ({
3296
+ ...w,
3297
+ translateX: w.translateX + p,
3298
+ translateY: w.translateY + R
3279
3299
  })), clearTimeout(_.current.pan), _.current.pan = setTimeout(() => {
3280
3300
  a({ panning: !1 });
3281
3301
  }, 200), a({ panning: !0 });
3282
3302
  }, x = (p) => {
3283
3303
  if (["INPUT", "TEXTAREA"].includes(p.target.tagName))
3284
3304
  return;
3285
- let h = 0, v = 0, C = 1;
3305
+ let R = 0, w = 0, g = 1;
3286
3306
  switch (p.key) {
3287
3307
  case "ArrowLeft":
3288
- h = -10;
3308
+ R = -10;
3289
3309
  break;
3290
3310
  case "ArrowRight":
3291
- h = 10;
3311
+ R = 10;
3292
3312
  break;
3293
3313
  case "ArrowUp":
3294
- v = -10;
3314
+ w = -10;
3295
3315
  break;
3296
3316
  case "ArrowDown":
3297
- v = 10;
3317
+ w = 10;
3298
3318
  break;
3299
3319
  case "PageUp":
3300
- C = 1.2;
3320
+ g = 1.2;
3301
3321
  break;
3302
3322
  case "PageDown":
3303
- C = 0.8;
3323
+ g = 0.8;
3304
3324
  break;
3305
3325
  }
3306
- if (h || v || C !== 1) {
3307
- const D = u();
3308
- if (C === 1 && D.length)
3326
+ if (R || w || g !== 1) {
3327
+ const k = u();
3328
+ if (g === 1 && k.length)
3309
3329
  return;
3310
- p.shiftKey && (h *= 5, v *= 5), (p.ctrlKey || p.altKey || p.metaKey) && (h /= 5, v /= 5), l((k) => ({
3311
- ...k,
3312
- translateY: k.translateY + v,
3313
- translateX: k.translateX + h
3314
- })), d(C), p.preventDefault();
3315
- }
3316
- p.key === " " && !p.repeat && w().hover && d(3, w());
3317
- }, y = (p) => {
3318
- ["INPUT", "TEXTAREA"].includes(p.target.tagName) || p.key === " " && w().hover && d(1 / 3, w());
3330
+ p.shiftKey && (R *= 5, w *= 5), (p.ctrlKey || p.altKey || p.metaKey) && (R /= 5, w /= 5), l((P) => ({
3331
+ ...P,
3332
+ translateY: P.translateY + w,
3333
+ translateX: P.translateX + R
3334
+ })), d(g), p.preventDefault();
3335
+ }
3336
+ p.key === " " && !p.repeat && C().hover && d(3, C());
3337
+ }, v = (p) => {
3338
+ ["INPUT", "TEXTAREA"].includes(p.target.tagName) || p.key === " " && C().hover && d(1 / 3, C());
3319
3339
  };
3320
- return pe(document, "keydown", x), pe(document, "keyup", y), /* @__PURE__ */ T(
3340
+ return ue(document, "keydown", x), ue(document, "keyup", v), /* @__PURE__ */ T(
3321
3341
  We,
3322
3342
  {
3323
- onPan: R,
3324
- onZoom: E,
3343
+ onPan: E,
3344
+ onZoom: S,
3325
3345
  mainAction: t ? "pan" : "drag",
3326
3346
  children: /* @__PURE__ */ T(
3327
3347
  "div",
@@ -3338,7 +3358,7 @@ const go = ({ children: e }) => {
3338
3358
  )
3339
3359
  }
3340
3360
  );
3341
- }, _o = H({
3361
+ }, _o = q({
3342
3362
  position: "absolute",
3343
3363
  top: 0,
3344
3364
  left: 0,
@@ -3365,26 +3385,26 @@ const go = ({ children: e }) => {
3365
3385
  translateY: c.boardState.translateY,
3366
3386
  scale: c.boardState.scale
3367
3387
  }
3368
- ]), [l] = se((c) => [c.items]), d = g.useCallback(() => {
3388
+ ]), [l] = se((c) => [c.items]), d = m.useCallback(() => {
3369
3389
  const c = t(), { boardWrapperRect: b, boardWrapper: _ } = o();
3370
3390
  if (c.length === 0) {
3371
3391
  n(null);
3372
3392
  return;
3373
3393
  }
3374
- const w = nr(c, _);
3375
- if (!w) {
3394
+ const C = nr(c, _);
3395
+ if (!C) {
3376
3396
  n(null);
3377
3397
  return;
3378
3398
  }
3379
- const { left: m, top: E, width: R, height: x } = w, y = {
3380
- left: m - b.left,
3381
- top: E - b.top,
3399
+ const { left: h, top: S, width: E, height: x } = C, v = {
3400
+ left: h - b.left,
3401
+ top: S - b.top,
3382
3402
  height: x,
3383
- width: R
3403
+ width: E
3384
3404
  };
3385
- n(y);
3405
+ n(v);
3386
3406
  }, [o, t, n]), f = ft(d, [d], 300);
3387
- return g.useEffect(() => {
3407
+ return m.useEffect(() => {
3388
3408
  d(), f();
3389
3409
  }, [
3390
3410
  e,
@@ -3409,19 +3429,19 @@ const go = ({ children: e }) => {
3409
3429
  const [e] = Z((t) => [t.boardState.movingItems]);
3410
3430
  return e ? null : /* @__PURE__ */ T(bo, {});
3411
3431
  }, wo = typeof window < "u" && typeof navigator < "u" && typeof document < "u";
3412
- let Le;
3432
+ let ze;
3413
3433
  function Co() {
3414
3434
  if (!wo)
3415
3435
  return;
3416
- if (Le)
3417
- return Le;
3436
+ if (ze)
3437
+ return ze;
3418
3438
  const e = /* @__PURE__ */ new Map(), t = new ResizeObserver((r) => {
3419
3439
  r.forEach((n) => {
3420
3440
  var o;
3421
3441
  return (o = e.get(n.target)) == null ? void 0 : o.forEach((s) => setTimeout(() => s(n), 0));
3422
3442
  });
3423
3443
  });
3424
- return Le = {
3444
+ return ze = {
3425
3445
  observer: t,
3426
3446
  subscribe: (r, n) => {
3427
3447
  let o = e.get(r);
@@ -3431,7 +3451,7 @@ function Co() {
3431
3451
  const o = e.get(r);
3432
3452
  o && (o.delete(n), o.size || (e.delete(r), t.unobserve(r)));
3433
3453
  }
3434
- }, Le;
3454
+ }, ze;
3435
3455
  }
3436
3456
  function xo(e, t, r = !0) {
3437
3457
  const n = r && Co(), o = lt(t), s = e && "current" in e ? e.current : e;
@@ -3519,7 +3539,7 @@ const Pe = (e, t) => Array.from(Array(t)).map(() => e).join(""), Po = new RegExp
3519
3539
  const f = n - s / 2, c = u + f, b = l + f, _ = d + f;
3520
3540
  return [c, b, _].map(Gt);
3521
3541
  };
3522
- function zo(e) {
3542
+ function Lo(e) {
3523
3543
  if (e === "transparent")
3524
3544
  return 0;
3525
3545
  function t(s) {
@@ -3529,16 +3549,16 @@ function zo(e) {
3529
3549
  const [r, n, o] = Io(e);
3530
3550
  return 0.2126 * t(r) + 0.7152 * t(n) + 0.0722 * t(o);
3531
3551
  }
3532
- function Lo(e) {
3533
- return zo(e) > 0.179;
3552
+ function zo(e) {
3553
+ return Lo(e) > 0.179;
3534
3554
  }
3535
- const Yo = H({
3555
+ const Yo = q({
3536
3556
  display: "flex",
3537
3557
  flexDirection: "row",
3538
3558
  alignItems: "center",
3539
3559
  zIndex: 210,
3540
3560
  pointerEvents: "none"
3541
- }), Bo = H({
3561
+ }), Bo = q({
3542
3562
  fontWeight: "bold",
3543
3563
  padding: "0 0.5em",
3544
3564
  borderRadius: "2px",
@@ -3550,9 +3570,9 @@ const Yo = H({
3550
3570
  whitespace: "nowrap",
3551
3571
  pointerEvents: "none"
3552
3572
  }), No = ({ color: e = "#666", size: t = 40, text: r }) => {
3553
- const n = Lo(e) ? "#222" : "#EEE";
3554
- return /* @__PURE__ */ ue("div", { className: Yo, children: [
3555
- /* @__PURE__ */ ue(
3573
+ const n = zo(e) ? "#222" : "#EEE";
3574
+ return /* @__PURE__ */ le("div", { className: Yo, children: [
3575
+ /* @__PURE__ */ le(
3556
3576
  "svg",
3557
3577
  {
3558
3578
  version: "1.1",
@@ -3596,7 +3616,7 @@ const Yo = H({
3596
3616
  }
3597
3617
  )
3598
3618
  ] });
3599
- }, Uo = g.memo(No), Xo = H({
3619
+ }, Uo = m.memo(No), Xo = q({
3600
3620
  top: 0,
3601
3621
  left: 0,
3602
3622
  zIndex: 210,
@@ -3635,14 +3655,14 @@ const Yo = H({
3635
3655
  l.getConfiguration,
3636
3656
  l.getBoardState
3637
3657
  ]);
3638
- return /* @__PURE__ */ ue("div", { onPointerMove: ({ clientX: l, clientY: d }) => {
3658
+ return /* @__PURE__ */ le("div", { onPointerMove: ({ clientX: l, clientY: d }) => {
3639
3659
  const { scale: f, translateX: c, translateY: b } = s(), {
3640
- boardWrapperRect: { left: _, top: w }
3641
- } = o(), m = {
3660
+ boardWrapperRect: { left: _, top: C }
3661
+ } = o(), h = {
3642
3662
  x: (l - _ - c) / f,
3643
- y: (d - w - b) / f
3663
+ y: (d - C - b) / f
3644
3664
  };
3645
- r(t.id, m);
3665
+ r(t.id, h);
3646
3666
  }, onPointerLeave: () => {
3647
3667
  n(t.id);
3648
3668
  }, children: [
@@ -3663,9 +3683,9 @@ const Yo = H({
3663
3683
  showResizeHandle: a = !1,
3664
3684
  Wrapper: u = Ko
3665
3685
  }) => {
3666
- const l = g.useRef(null), [d, f] = Z((w) => [
3667
- w.config.uid,
3668
- w.updateConfiguration
3686
+ const l = m.useRef(null), [d, f] = Z((C) => [
3687
+ C.config.uid,
3688
+ C.updateConfiguration
3669
3689
  ]), { updateItemExtent: c } = dt(), b = {
3670
3690
  userSelect: "none",
3671
3691
  width: `${o}px`,
@@ -3673,28 +3693,28 @@ const Yo = H({
3673
3693
  backgroundColor: "#333",
3674
3694
  ...t
3675
3695
  };
3676
- g.useEffect(() => {
3677
- const w = (m) => {
3678
- Te(m.target, "board") && m.preventDefault();
3696
+ m.useEffect(() => {
3697
+ const C = (h) => {
3698
+ Te(h.target, "board") && h.preventDefault();
3679
3699
  };
3680
- return document.body.addEventListener("wheel", w, { passive: !1 }), () => {
3681
- document.body.removeEventListener("wheel", w);
3700
+ return document.body.addEventListener("wheel", C, { passive: !1 }), () => {
3701
+ document.body.removeEventListener("wheel", C);
3682
3702
  };
3683
- }, []), g.useEffect(() => {
3703
+ }, []), m.useEffect(() => {
3684
3704
  f({
3685
3705
  boardWrapper: l.current
3686
3706
  });
3687
- }, [f]), g.useEffect(() => {
3707
+ }, [f]), m.useEffect(() => {
3688
3708
  d || f({
3689
3709
  uid: me()
3690
3710
  });
3691
- }, [d, f]), g.useEffect(() => {
3711
+ }, [d, f]), m.useEffect(() => {
3692
3712
  f({
3693
3713
  itemTemplates: n,
3694
3714
  boardSize: o,
3695
3715
  showResizeHandle: a
3696
3716
  });
3697
- }, [n, o, a, f]), g.useEffect(() => {
3717
+ }, [n, o, a, f]), m.useEffect(() => {
3698
3718
  f({
3699
3719
  boardWrapperRect: l.current.getBoundingClientRect()
3700
3720
  }), c(), setTimeout(c, 2e3);
@@ -3703,19 +3723,19 @@ const Yo = H({
3703
3723
  boardWrapperRect: l.current.getBoundingClientRect()
3704
3724
  });
3705
3725
  });
3706
- const _ = H({ ...Ho, ...r });
3707
- return /* @__PURE__ */ ue(
3726
+ const _ = q({ ...Ho, ...r });
3727
+ return /* @__PURE__ */ le(
3708
3728
  "div",
3709
3729
  {
3710
3730
  ref: l,
3711
3731
  id: d,
3712
3732
  className: `sync-board ${_}`,
3713
3733
  children: [
3714
- /* @__PURE__ */ T(So, { moveFirst: e, children: /* @__PURE__ */ T(uo, { moveFirst: e, children: /* @__PURE__ */ T(go, { moveFirst: e, children: /* @__PURE__ */ T(Fo, { children: /* @__PURE__ */ T(u, { children: /* @__PURE__ */ ue(
3734
+ /* @__PURE__ */ T(So, { moveFirst: e, children: /* @__PURE__ */ T(mo, { moveFirst: e, children: /* @__PURE__ */ T(go, { moveFirst: e, children: /* @__PURE__ */ T(Fo, { children: /* @__PURE__ */ T(u, { children: /* @__PURE__ */ le(
3715
3735
  "div",
3716
3736
  {
3717
- onContextMenu: (w) => {
3718
- w.preventDefault();
3737
+ onContextMenu: (C) => {
3738
+ C.preventDefault();
3719
3739
  },
3720
3740
  style: b,
3721
3741
  className: "board",
@@ -3730,7 +3750,7 @@ const Yo = H({
3730
3750
  }
3731
3751
  );
3732
3752
  };
3733
- Ln(g.createElement);
3753
+ zn(m.createElement);
3734
3754
  export {
3735
3755
  us as Board,
3736
3756
  as as BoardWrapper,