@ninesstudios/whiteboard 0.0.8 β†’ 0.0.9

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.
@@ -129,7 +129,7 @@ function Kn() {
129
129
  function q(o) {
130
130
  return !!(typeof o == "string" || typeof o == "function" || o === e.Fragment || o === f || o === T || o === a || o === u || o === g || o === R || U || typeof o == "object" && o !== null && (o.$$typeof === E || o.$$typeof === m || o.$$typeof === h || o.$$typeof === p || o.$$typeof === l || o.$$typeof === S || o.$$typeof === v || o[0] === d));
131
131
  }
132
- function se(o, y, x) {
132
+ function ie(o, y, x) {
133
133
  var O = y.displayName || y.name || "";
134
134
  return o.displayName || (O !== "" ? x + "(" + O + ")" : x);
135
135
  }
@@ -166,7 +166,7 @@ function Kn() {
166
166
  var x = o;
167
167
  return H(x._context) + ".Provider";
168
168
  case l:
169
- return se(o, o.render, "ForwardRef");
169
+ return ie(o, o.render, "ForwardRef");
170
170
  case m:
171
171
  return Q(o.type);
172
172
  case v:
@@ -258,13 +258,13 @@ function Kn() {
258
258
  ` + Oe + o;
259
259
  }
260
260
  }
261
- var ie = !1, ce;
261
+ var ae = !1, ce;
262
262
  {
263
263
  var le = typeof WeakMap == "function" ? WeakMap : Map;
264
264
  ce = new le();
265
265
  }
266
266
  function I(o, y) {
267
- if (!o || ie)
267
+ if (!o || ae)
268
268
  return "";
269
269
  {
270
270
  var x = ce.get(o);
@@ -272,7 +272,7 @@ function Kn() {
272
272
  return x;
273
273
  }
274
274
  var O;
275
- ie = !0;
275
+ ae = !0;
276
276
  var _ = Error.prepareStackTrace;
277
277
  Error.prepareStackTrace = void 0;
278
278
  var N;
@@ -329,7 +329,7 @@ function Kn() {
329
329
  }
330
330
  }
331
331
  } finally {
332
- ie = !1, me.current = N, ze(), Error.prepareStackTrace = _;
332
+ ae = !1, me.current = N, ze(), Error.prepareStackTrace = _;
333
333
  }
334
334
  var te = o ? o.displayName || o.name : "", Se = te ? je(te) : "";
335
335
  return typeof o == "function" && ce.set(o, Se), Se;
@@ -998,7 +998,7 @@ Selectors that return the entire state are almost certainly a mistake, as they w
998
998
  return Bn(d), d;
999
999
  };
1000
1000
  }
1001
- const ae = /* @__PURE__ */ fo();
1001
+ const se = /* @__PURE__ */ fo();
1002
1002
  var Dt = { exports: {} }, $ = {};
1003
1003
  /** @license React v16.13.1
1004
1004
  * react-is.production.min.js
@@ -1123,7 +1123,7 @@ function po() {
1123
1123
  }
1124
1124
  }
1125
1125
  }
1126
- var c = p, M = l, j = h, L = f, Z = t, U = u, q = n, se = v, H = E, Q = r, fe = a, Te = i, _e = g, ge = !1;
1126
+ var c = p, M = l, j = h, L = f, Z = t, U = u, q = n, ie = v, H = E, Q = r, fe = a, Te = i, _e = g, ge = !1;
1127
1127
  function xe(I) {
1128
1128
  return ge || (ge = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), Ee(I) || k(I) === p;
1129
1129
  }
@@ -1154,7 +1154,7 @@ function po() {
1154
1154
  function je(I) {
1155
1155
  return k(I) === r;
1156
1156
  }
1157
- function ie(I) {
1157
+ function ae(I) {
1158
1158
  return k(I) === a;
1159
1159
  }
1160
1160
  function ce(I) {
@@ -1163,7 +1163,7 @@ function po() {
1163
1163
  function le(I) {
1164
1164
  return k(I) === g;
1165
1165
  }
1166
- F.AsyncMode = c, F.ConcurrentMode = M, F.ContextConsumer = j, F.ContextProvider = L, F.Element = Z, F.ForwardRef = U, F.Fragment = q, F.Lazy = se, F.Memo = H, F.Portal = Q, F.Profiler = fe, F.StrictMode = Te, F.Suspense = _e, F.isAsyncMode = xe, F.isConcurrentMode = Ee, F.isContextConsumer = Re, F.isContextProvider = De, F.isElement = Me, F.isForwardRef = qe, F.isFragment = ze, F.isLazy = me, F.isMemo = Oe, F.isPortal = je, F.isProfiler = ie, F.isStrictMode = ce, F.isSuspense = le, F.isValidElementType = P, F.typeOf = k;
1166
+ F.AsyncMode = c, F.ConcurrentMode = M, F.ContextConsumer = j, F.ContextProvider = L, F.Element = Z, F.ForwardRef = U, F.Fragment = q, F.Lazy = ie, F.Memo = H, F.Portal = Q, F.Profiler = fe, F.StrictMode = Te, F.Suspense = _e, F.isAsyncMode = xe, F.isConcurrentMode = Ee, F.isContextConsumer = Re, F.isContextProvider = De, F.isElement = Me, F.isForwardRef = qe, F.isFragment = ze, F.isLazy = me, F.isMemo = Oe, F.isPortal = je, F.isProfiler = ae, F.isStrictMode = ce, F.isSuspense = le, F.isValidElementType = P, F.typeOf = k;
1167
1167
  })()), F;
1168
1168
  }
1169
1169
  var Yr;
@@ -1369,7 +1369,7 @@ function mo() {
1369
1369
  }
1370
1370
  }
1371
1371
  }
1372
- var M = f, j = a, L = e, Z = p, U = r, q = m, se = g, H = t, Q = i, fe = n, Te = l, _e = u, ge = !1, xe = !1;
1372
+ var M = f, j = a, L = e, Z = p, U = r, q = m, ie = g, H = t, Q = i, fe = n, Te = l, _e = u, ge = !1, xe = !1;
1373
1373
  function Ee(D) {
1374
1374
  return ge || (ge = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")), !1;
1375
1375
  }
@@ -1397,7 +1397,7 @@ function mo() {
1397
1397
  function je(D) {
1398
1398
  return c(D) === g;
1399
1399
  }
1400
- function ie(D) {
1400
+ function ae(D) {
1401
1401
  return c(D) === t;
1402
1402
  }
1403
1403
  function ce(D) {
@@ -1412,7 +1412,7 @@ function mo() {
1412
1412
  function ue(D) {
1413
1413
  return c(D) === u;
1414
1414
  }
1415
- B.ContextConsumer = M, B.ContextProvider = j, B.Element = L, B.ForwardRef = Z, B.Fragment = U, B.Lazy = q, B.Memo = se, B.Portal = H, B.Profiler = Q, B.StrictMode = fe, B.Suspense = Te, B.SuspenseList = _e, B.isAsyncMode = Ee, B.isConcurrentMode = Re, B.isContextConsumer = De, B.isContextProvider = Me, B.isElement = qe, B.isForwardRef = ze, B.isFragment = me, B.isLazy = Oe, B.isMemo = je, B.isPortal = ie, B.isProfiler = ce, B.isStrictMode = le, B.isSuspense = I, B.isSuspenseList = ue, B.isValidElementType = k, B.typeOf = c;
1415
+ B.ContextConsumer = M, B.ContextProvider = j, B.Element = L, B.ForwardRef = Z, B.Fragment = U, B.Lazy = q, B.Memo = ie, B.Portal = H, B.Profiler = Q, B.StrictMode = fe, B.Suspense = Te, B.SuspenseList = _e, B.isAsyncMode = Ee, B.isConcurrentMode = Re, B.isContextConsumer = De, B.isContextProvider = Me, B.isElement = qe, B.isForwardRef = ze, B.isFragment = me, B.isLazy = Oe, B.isMemo = je, B.isPortal = ae, B.isProfiler = ce, B.isStrictMode = le, B.isSuspense = I, B.isSuspenseList = ue, B.isValidElementType = k, B.typeOf = c;
1416
1416
  })()), B;
1417
1417
  }
1418
1418
  var Xr;
@@ -3123,9 +3123,9 @@ var ji = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW", Pi
3123
3123
  name: "ConditionError",
3124
3124
  message: "Aborted due to condition callback returning false."
3125
3125
  };
3126
- return j = new Promise(function(q, se) {
3126
+ return j = new Promise(function(q, ie) {
3127
3127
  return d.signal.addEventListener("abort", function() {
3128
- return se({
3128
+ return ie({
3129
3129
  name: "AbortError",
3130
3130
  message: S || "Aborted"
3131
3131
  });
@@ -3139,11 +3139,11 @@ var ji = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW", Pi
3139
3139
  requestId: v,
3140
3140
  signal: d.signal,
3141
3141
  abort: T,
3142
- rejectWithValue: function(q, se) {
3143
- return new ar(q, se);
3142
+ rejectWithValue: function(q, ie) {
3143
+ return new ar(q, ie);
3144
3144
  },
3145
- fulfillWithValue: function(q, se) {
3146
- return new un(q, se);
3145
+ fulfillWithValue: function(q, ie) {
3146
+ return new un(q, ie);
3147
3147
  }
3148
3148
  })).then(function(q) {
3149
3149
  if (q instanceof ar)
@@ -3463,7 +3463,7 @@ const Bi = /* @__PURE__ */ new Set([
3463
3463
  },
3464
3464
  middleware: (e) => e().concat(Gi)
3465
3465
  }), Ji = () => {
3466
- const e = ae((t) => t.whiteboard.watermark);
3466
+ const e = se((t) => t.whiteboard.watermark);
3467
3467
  return /* @__PURE__ */ w.jsx("a", { href: e.url, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ w.jsx("div", { className: "wb-watermark", children: e.text }) });
3468
3468
  };
3469
3469
  var Fn = {
@@ -3666,9 +3666,9 @@ function Oa(e) {
3666
3666
  return ee({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M11.107 0a.5.5 0 0 1 .353.146l4.394 4.394a.5.5 0 0 1 .146.353v6.214a.5.5 0 0 1-.146.353l-4.394 4.394a.5.5 0 0 1-.353.146H4.893a.5.5 0 0 1-.353-.146L.146 11.46A.5.5 0 0 1 0 11.107V4.893a.5.5 0 0 1 .146-.353L4.54.146A.5.5 0 0 1 4.893 0z" }, child: [] }] })(e);
3667
3667
  }
3668
3668
  const ja = ({ onExport: e, onFitToView: t, mode: r }) => {
3669
- const n = gr(), { t: i, language: a, changeLanguage: f } = _n(), h = ae(
3669
+ const n = gr(), { t: i, language: a, changeLanguage: f } = _n(), h = se(
3670
3670
  (M) => M.whiteboard.toolbar.selectedTool
3671
- ), p = ae((M) => M.whiteboard.lock.isLocked), [l, u] = re(!1), [g, m] = re(!1), E = Ce(null), v = Ce(null), d = Ce(null), S = Ce(null), T = Ce(null), R = (M) => {
3671
+ ), p = se((M) => M.whiteboard.lock.isLocked), [l, u] = re(!1), [g, m] = re(!1), E = Ce(null), v = Ce(null), d = Ce(null), S = Ce(null), T = Ce(null), R = (M) => {
3672
3672
  const j = M.target.files[0];
3673
3673
  if (!j) return;
3674
3674
  const L = new FileReader();
@@ -3872,13 +3872,13 @@ const ja = ({ onExport: e, onFitToView: t, mode: r }) => {
3872
3872
  )
3873
3873
  ] });
3874
3874
  }, Pa = () => {
3875
- const e = gr(), { t } = _n(), r = ae(
3875
+ const e = gr(), { t } = _n(), r = se(
3876
3876
  (g) => g.whiteboard.toolbar.selectedTool
3877
- ), n = ae(
3877
+ ), n = se(
3878
3878
  (g) => g.whiteboard.toolProperties
3879
- ), i = ae(
3879
+ ), i = se(
3880
3880
  (g) => g.whiteboard.selectedElementId
3881
- ), a = ae((g) => g.whiteboard.elements), f = i ? a.find((g) => g.id === i) : null, h = (g, m, E) => {
3881
+ ), a = se((g) => g.whiteboard.elements), f = i ? a.find((g) => g.id === i) : null, h = (g, m, E) => {
3882
3882
  e(Ii({ tool: g, property: m, value: E }));
3883
3883
  }, p = (g, m) => {
3884
3884
  i && e(
@@ -4259,13 +4259,13 @@ const ja = ({ onExport: e, onFitToView: t, mode: r }) => {
4259
4259
  ] });
4260
4260
  }, Ta = gn(({ onAction: e, watermark: t, isLocked: r, lockText: n, onLockChange: i, isWatermarkEnabled: a, watermarkText: f, mode: h }, p) => {
4261
4261
  var kt;
4262
- const l = Ce(null), u = gr(), g = ae((s) => s.whiteboard.grid), m = ae(
4262
+ const l = Ce(null), u = gr(), g = se((s) => s.whiteboard.grid), m = se(
4263
4263
  (s) => s.whiteboard.toolbar.selectedTool
4264
- ), E = ae((s) => s.whiteboard.elements), v = ae((s) => s.whiteboard.viewport), d = ae(
4264
+ ), E = se((s) => s.whiteboard.elements), v = se((s) => s.whiteboard.viewport), d = se(
4265
4265
  (s) => s.whiteboard.toolProperties
4266
- ), S = ae(
4266
+ ), S = se(
4267
4267
  (s) => s.whiteboard.selectedElementId
4268
- ), T = ae((s) => s.whiteboard.lock), R = T.isLocked, [P, k] = re(!1), [c, M] = re({ x: 0, y: 0 }), [j, L] = re({ x: 0, y: 0 }), [Z, U] = re([]), [q, se] = re(!1), [H, Q] = re({ x: 0, y: 0 }), [fe, Te] = re(!1), [_e, ge] = re(!1), [xe, Ee] = re(!1), [Re, De] = re({ x: 0, y: 0 }), [Me, qe] = re({ y: 0, initialZoom: 1 }), [ze, me] = re(!1), [Oe, je] = re({ x: 0, y: 0 }), [ie, ce] = re(""), [le, I] = re(null), ue = Ce(null), D = Ce(null), de = J(
4268
+ ), T = se((s) => s.whiteboard.lock), R = T.isLocked, [P, k] = re(!1), [c, M] = re({ x: 0, y: 0 }), [j, L] = re({ x: 0, y: 0 }), [Z, U] = re([]), [q, ie] = re(!1), [H, Q] = re({ x: 0, y: 0 }), [fe, Te] = re(!1), [_e, ge] = re(!1), [xe, Ee] = re(!1), [Re, De] = re({ x: 0, y: 0 }), [Me, qe] = re({ y: 0, initialZoom: 1 }), [ze, me] = re(!1), [Oe, je] = re({ x: 0, y: 0 }), [ae, ce] = re(""), [le, I] = re(null), ue = Ce(null), D = Ce(null), de = J(
4269
4269
  (s) => {
4270
4270
  le && s.trim() && (ue.current && clearTimeout(ue.current), ue.current = setTimeout(() => {
4271
4271
  le && s !== D.current && (D.current = s, u(Et({ id: le, updates: { text: s } })));
@@ -4327,7 +4327,7 @@ const ja = ({ onExport: e, onFitToView: t, mode: r }) => {
4327
4327
  }, [r, R, u]), pe(() => {
4328
4328
  i && i(R);
4329
4329
  }, [R, i]);
4330
- const he = ae((s) => s.whiteboard.watermark);
4330
+ const he = se((s) => s.whiteboard.watermark);
4331
4331
  pe(() => {
4332
4332
  a !== void 0 && a !== he.visible && u($i(a));
4333
4333
  }, [a, he.visible, u]), pe(() => {
@@ -4882,17 +4882,18 @@ const ja = ({ onExport: e, onFitToView: t, mode: r }) => {
4882
4882
  ]);
4883
4883
  const Pt = (s) => {
4884
4884
  const C = l.current.getBoundingClientRect(), o = s.clientX - C.left, y = s.clientY - C.top;
4885
- if (R || ze)
4885
+ if (ze)
4886
4886
  return;
4887
4887
  if (fe) {
4888
4888
  s.preventDefault(), s.button === 0 ? (ge(!0), De({ x: o - v.panX, y: y - v.panY })) : s.button === 2 && (Ee(!0), qe({ y, initialZoom: v.zoom }));
4889
4889
  return;
4890
4890
  }
4891
+ if (R) return;
4891
4892
  const { x, y: O } = wt(o, y);
4892
4893
  if (m === "pointer") {
4893
4894
  const _ = Qe(x, O);
4894
4895
  if (_)
4895
- if (u(St(_.id)), se(!0), _.type === "rectangle")
4896
+ if (u(St(_.id)), ie(!0), _.type === "rectangle")
4896
4897
  Q({ x: x - _.x, y: O - _.y });
4897
4898
  else if (_.type === "circle")
4898
4899
  Q({
@@ -4945,6 +4946,7 @@ const ja = ({ onExport: e, onFitToView: t, mode: r }) => {
4945
4946
  u(Wi(z));
4946
4947
  return;
4947
4948
  }
4949
+ if (R) return;
4948
4950
  const { x, y: O } = wt(o, y);
4949
4951
  if (q && S) {
4950
4952
  const _ = E.find(
@@ -5006,8 +5008,12 @@ const ja = ({ onExport: e, onFitToView: t, mode: r }) => {
5006
5008
  ge(!1), Ee(!1);
5007
5009
  return;
5008
5010
  }
5011
+ if (R) {
5012
+ ie(!1), k(!1);
5013
+ return;
5014
+ }
5009
5015
  if (q) {
5010
- se(!1);
5016
+ ie(!1);
5011
5017
  return;
5012
5018
  }
5013
5019
  if (P) {
@@ -5177,6 +5183,7 @@ const ja = ({ onExport: e, onFitToView: t, mode: r }) => {
5177
5183
  onMouseUp: Rt,
5178
5184
  onMouseLeave: Rt,
5179
5185
  onDoubleClick: (s) => {
5186
+ if (R) return;
5180
5187
  const C = l.current.getBoundingClientRect(), o = s.clientX - C.left, y = s.clientY - C.top, { x, y: O } = wt(o, y), _ = Qe(x, O);
5181
5188
  _ && _.type === "text" && (I(_.id), je({ x: _.x, y: _.y }), ce(_.text), D.current = _.text, me(!0));
5182
5189
  },
@@ -5189,26 +5196,26 @@ const ja = ({ onExport: e, onFitToView: t, mode: r }) => {
5189
5196
  "input",
5190
5197
  {
5191
5198
  type: "text",
5192
- value: ie,
5199
+ value: ae,
5193
5200
  onChange: (s) => {
5194
5201
  const b = s.target.value;
5195
5202
  ce(b), de(b);
5196
5203
  },
5197
5204
  onKeyDown: (s) => {
5198
- s.key === "Enter" && ie.trim() ? (le && (u(
5205
+ s.key === "Enter" && ae.trim() ? (le && (u(
5199
5206
  Et({
5200
5207
  id: le,
5201
- updates: { text: ie }
5208
+ updates: { text: ae }
5202
5209
  })
5203
- ), D.current = ie), me(!1), ce(""), I(null)) : s.key === "Escape" && (me(!1), ce(""), I(null));
5210
+ ), D.current = ae), me(!1), ce(""), I(null)) : s.key === "Escape" && (me(!1), ce(""), I(null));
5204
5211
  },
5205
5212
  onBlur: () => {
5206
- ie.trim() && le && (u(
5213
+ ae.trim() && le && (u(
5207
5214
  Et({
5208
5215
  id: le,
5209
- updates: { text: ie }
5216
+ updates: { text: ae }
5210
5217
  })
5211
- ), D.current = ie), me(!1), ce(""), I(null);
5218
+ ), D.current = ae), me(!1), ce(""), I(null);
5212
5219
  },
5213
5220
  onMouseDown: (s) => s.stopPropagation(),
5214
5221
  autoFocus: !0,
@@ -16,11 +16,11 @@ object-assign
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var Or;function Un(){return Or||(Or=1,(function(e){process.env.NODE_ENV!=="production"&&(function(){var t=M,r=Cr(),n=60103,i=60106;e.Fragment=60107;var a=60108,f=60114,h=60109,p=60110,l=60112,u=60113,g=60120,m=60115,E=60116,v=60121,d=60122,S=60117,T=60129,k=60131;if(typeof Symbol=="function"&&Symbol.for){var P=Symbol.for;n=P("react.element"),i=P("react.portal"),e.Fragment=P("react.fragment"),a=P("react.strict_mode"),f=P("react.profiler"),h=P("react.provider"),p=P("react.context"),l=P("react.forward_ref"),u=P("react.suspense"),g=P("react.suspense_list"),m=P("react.memo"),E=P("react.lazy"),v=P("react.block"),d=P("react.server.block"),S=P("react.fundamental"),P("react.scope"),P("react.opaque.id"),T=P("react.debug_trace_mode"),P("react.offscreen"),k=P("react.legacy_hidden")}var N=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function R(o){if(o===null||typeof o!="object")return null;var y=N&&o[N]||o[c];return typeof y=="function"?y:null}var j=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Y(o){{for(var y=arguments.length,x=new Array(y>1?y-1:0),O=1;O<y;O++)x[O-1]=arguments[O];Z("error",o,x)}}function Z(o,y,x){{var O=j.ReactDebugCurrentFrame,_=O.getStackAddendum();_!==""&&(y+="%s",x=x.concat([_]));var A=x.map(function(W){return""+W});A.unshift("Warning: "+y),Function.prototype.apply.call(console[o],console,A)}}var q=!1;function H(o){return!!(typeof o=="string"||typeof o=="function"||o===e.Fragment||o===f||o===T||o===a||o===u||o===g||o===k||q||typeof o=="object"&&o!==null&&(o.$$typeof===E||o.$$typeof===m||o.$$typeof===h||o.$$typeof===p||o.$$typeof===l||o.$$typeof===S||o.$$typeof===v||o[0]===d))}function ae(o,y,x){var O=y.displayName||y.name||"";return o.displayName||(O!==""?x+"("+O+")":x)}function G(o){return o.displayName||"Context"}function ee(o){if(o==null)return null;if(typeof o.tag=="number"&&Y("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case e.Fragment:return"Fragment";case i:return"Portal";case f:return"Profiler";case a:return"StrictMode";case u:return"Suspense";case g:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case p:var y=o;return G(y)+".Consumer";case h:var x=o;return G(x._context)+".Provider";case l:return ae(o,o.render,"ForwardRef");case m:return ee(o.type);case v:return ee(o._render);case E:{var O=o,_=O._payload,A=O._init;try{return ee(A(_))}catch{return null}}}return null}var fe=0,Te,Se,ye,be,we,Me,Le;function ke(){}ke.__reactDisabledLog=!0;function qe(){{if(fe===0){Te=console.log,Se=console.info,ye=console.warn,be=console.error,we=console.group,Me=console.groupCollapsed,Le=console.groupEnd;var o={configurable:!0,enumerable:!0,value:ke,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}fe++}}function Ye(){{if(fe--,fe===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:r({},o,{value:Te}),info:r({},o,{value:Se}),warn:r({},o,{value:ye}),error:r({},o,{value:be}),group:r({},o,{value:we}),groupCollapsed:r({},o,{value:Me}),groupEnd:r({},o,{value:Le})})}fe<0&&Y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=j.ReactCurrentDispatcher,Ce;function _e(o,y,x){{if(Ce===void 0)try{throw Error()}catch(_){var O=_.stack.trim().match(/\n( *(at )?)/);Ce=O&&O[1]||""}return`
20
- `+Ce+o}}var ie=!1,se;{var ce=typeof WeakMap=="function"?WeakMap:Map;se=new ce}function D(o,y){if(!o||ie)return"";{var x=se.get(o);if(x!==void 0)return x}var O;ie=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var A;A=ge.current,ge.current=null,qe();try{if(y){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(Re){O=Re}Reflect.construct(o,[],W)}else{try{W.call()}catch(Re){O=Re}o.call(W.prototype)}}else{try{throw Error()}catch(Re){O=Re}o()}}catch(Re){if(Re&&O&&typeof Re.stack=="string"){for(var I=Re.stack.split(`
19
+ */var Or;function Un(){return Or||(Or=1,(function(e){process.env.NODE_ENV!=="production"&&(function(){var t=M,r=Cr(),n=60103,i=60106;e.Fragment=60107;var a=60108,f=60114,h=60109,p=60110,l=60112,u=60113,g=60120,m=60115,E=60116,v=60121,d=60122,S=60117,T=60129,k=60131;if(typeof Symbol=="function"&&Symbol.for){var P=Symbol.for;n=P("react.element"),i=P("react.portal"),e.Fragment=P("react.fragment"),a=P("react.strict_mode"),f=P("react.profiler"),h=P("react.provider"),p=P("react.context"),l=P("react.forward_ref"),u=P("react.suspense"),g=P("react.suspense_list"),m=P("react.memo"),E=P("react.lazy"),v=P("react.block"),d=P("react.server.block"),S=P("react.fundamental"),P("react.scope"),P("react.opaque.id"),T=P("react.debug_trace_mode"),P("react.offscreen"),k=P("react.legacy_hidden")}var N=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function R(o){if(o===null||typeof o!="object")return null;var y=N&&o[N]||o[c];return typeof y=="function"?y:null}var j=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Y(o){{for(var y=arguments.length,x=new Array(y>1?y-1:0),O=1;O<y;O++)x[O-1]=arguments[O];Z("error",o,x)}}function Z(o,y,x){{var O=j.ReactDebugCurrentFrame,_=O.getStackAddendum();_!==""&&(y+="%s",x=x.concat([_]));var A=x.map(function(W){return""+W});A.unshift("Warning: "+y),Function.prototype.apply.call(console[o],console,A)}}var q=!1;function H(o){return!!(typeof o=="string"||typeof o=="function"||o===e.Fragment||o===f||o===T||o===a||o===u||o===g||o===k||q||typeof o=="object"&&o!==null&&(o.$$typeof===E||o.$$typeof===m||o.$$typeof===h||o.$$typeof===p||o.$$typeof===l||o.$$typeof===S||o.$$typeof===v||o[0]===d))}function ie(o,y,x){var O=y.displayName||y.name||"";return o.displayName||(O!==""?x+"("+O+")":x)}function G(o){return o.displayName||"Context"}function ee(o){if(o==null)return null;if(typeof o.tag=="number"&&Y("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case e.Fragment:return"Fragment";case i:return"Portal";case f:return"Profiler";case a:return"StrictMode";case u:return"Suspense";case g:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case p:var y=o;return G(y)+".Consumer";case h:var x=o;return G(x._context)+".Provider";case l:return ie(o,o.render,"ForwardRef");case m:return ee(o.type);case v:return ee(o._render);case E:{var O=o,_=O._payload,A=O._init;try{return ee(A(_))}catch{return null}}}return null}var fe=0,Te,Se,ye,be,we,Me,Le;function ke(){}ke.__reactDisabledLog=!0;function qe(){{if(fe===0){Te=console.log,Se=console.info,ye=console.warn,be=console.error,we=console.group,Me=console.groupCollapsed,Le=console.groupEnd;var o={configurable:!0,enumerable:!0,value:ke,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}fe++}}function Ye(){{if(fe--,fe===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:r({},o,{value:Te}),info:r({},o,{value:Se}),warn:r({},o,{value:ye}),error:r({},o,{value:be}),group:r({},o,{value:we}),groupCollapsed:r({},o,{value:Me}),groupEnd:r({},o,{value:Le})})}fe<0&&Y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=j.ReactCurrentDispatcher,Ce;function _e(o,y,x){{if(Ce===void 0)try{throw Error()}catch(_){var O=_.stack.trim().match(/\n( *(at )?)/);Ce=O&&O[1]||""}return`
20
+ `+Ce+o}}var ae=!1,se;{var ce=typeof WeakMap=="function"?WeakMap:Map;se=new ce}function D(o,y){if(!o||ae)return"";{var x=se.get(o);if(x!==void 0)return x}var O;ae=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var A;A=ge.current,ge.current=null,qe();try{if(y){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(Re){O=Re}Reflect.construct(o,[],W)}else{try{W.call()}catch(Re){O=Re}o.call(W.prototype)}}else{try{throw Error()}catch(Re){O=Re}o()}}catch(Re){if(Re&&O&&typeof Re.stack=="string"){for(var I=Re.stack.split(`
21
21
  `),U=O.stack.split(`
22
22
  `),V=I.length-1,L=U.length-1;V>=1&&L>=0&&I[V]!==U[L];)L--;for(;V>=1&&L>=0;V--,L--)if(I[V]!==U[L]){if(V!==1||L!==1)do if(V--,L--,L<0||I[V]!==U[L]){var J=`
23
- `+I[V].replace(" at new "," at ");return typeof o=="function"&&se.set(o,J),J}while(V>=1&&L>=0);break}}}finally{ie=!1,ge.current=A,Ye(),Error.prepareStackTrace=_}var re=o?o.displayName||o.name:"",xe=re?_e(re):"";return typeof o=="function"&&se.set(o,xe),xe}function le(o,y,x){return D(o,!1)}function z(o){var y=o.prototype;return!!(y&&y.isReactComponent)}function de(o,y,x){if(o==null)return"";if(typeof o=="function")return D(o,z(o));if(typeof o=="string")return _e(o);switch(o){case u:return _e("Suspense");case g:return _e("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case l:return le(o.render);case m:return de(o.type,y,x);case v:return le(o._render);case E:{var O=o,_=O._payload,A=O._init;try{return de(A(_),y,x)}catch{}}}return""}var he={},Ve=j.ReactDebugCurrentFrame;function He(o){if(o){var y=o._owner,x=de(o.type,o._source,y?y.type:null);Ve.setExtraStackFrame(x)}else Ve.setExtraStackFrame(null)}function at(o,y,x,O,_){{var A=Function.call.bind(Object.prototype.hasOwnProperty);for(var W in o)if(A(o,W)){var I=void 0;try{if(typeof o[W]!="function"){var U=Error((O||"React class")+": "+x+" type `"+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[W]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw U.name="Invariant Violation",U}I=o[W](y,W,O,x,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(V){I=V}I&&!(I instanceof Error)&&(He(_),Y("%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).",O||"React class",x,W,typeof I),He(null)),I instanceof Error&&!(I.message in he)&&(he[I.message]=!0,He(_),Y("Failed %s type: %s",x,I.message),He(null))}}}var Ge=j.ReactCurrentOwner,$e=Object.prototype.hasOwnProperty,It={key:!0,ref:!0,__self:!0,__source:!0},Ke,Je;function st(o){if($e.call(o,"ref")){var y=Object.getOwnPropertyDescriptor(o,"ref").get;if(y&&y.isReactWarning)return!1}return o.ref!==void 0}function ct(o){if($e.call(o,"key")){var y=Object.getOwnPropertyDescriptor(o,"key").get;if(y&&y.isReactWarning)return!1}return o.key!==void 0}function lt(o,y){typeof o.ref=="string"&&Ge.current}function ut(o,y){{var x=function(){Ke||(Ke=!0,Y("%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))};x.isReactWarning=!0,Object.defineProperty(o,"key",{get:x,configurable:!0})}}function ft(o,y){{var x=function(){Je||(Je=!0,Y("%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))};x.isReactWarning=!0,Object.defineProperty(o,"ref",{get:x,configurable:!0})}}var dt=function(o,y,x,O,_,A,W){var I={$$typeof:n,type:o,key:y,ref:x,props:W,_owner:A};return I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(I,"_self",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.defineProperty(I,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I};function bt(o,y,x,O,_){{var A,W={},I=null,U=null;x!==void 0&&(I=""+x),ct(y)&&(I=""+y.key),st(y)&&(U=y.ref,lt(y,_));for(A in y)$e.call(y,A)&&!It.hasOwnProperty(A)&&(W[A]=y[A]);if(o&&o.defaultProps){var V=o.defaultProps;for(A in V)W[A]===void 0&&(W[A]=V[A])}if(I||U){var L=typeof o=="function"?o.displayName||o.name||"Unknown":o;I&&ut(W,L),U&&ft(W,L)}return dt(o,I,U,_,O,Ge.current,W)}}var ht=j.ReactCurrentOwner,Ze=j.ReactDebugCurrentFrame;function Fe(o){if(o){var y=o._owner,x=de(o.type,o._source,y?y.type:null);Ze.setExtraStackFrame(x)}else Ze.setExtraStackFrame(null)}var wt;wt=!1;function Qe(o){return typeof o=="object"&&o!==null&&o.$$typeof===n}function xt(){{if(ht.current){var o=ee(ht.current.type);if(o)return`
23
+ `+I[V].replace(" at new "," at ");return typeof o=="function"&&se.set(o,J),J}while(V>=1&&L>=0);break}}}finally{ae=!1,ge.current=A,Ye(),Error.prepareStackTrace=_}var re=o?o.displayName||o.name:"",xe=re?_e(re):"";return typeof o=="function"&&se.set(o,xe),xe}function le(o,y,x){return D(o,!1)}function z(o){var y=o.prototype;return!!(y&&y.isReactComponent)}function de(o,y,x){if(o==null)return"";if(typeof o=="function")return D(o,z(o));if(typeof o=="string")return _e(o);switch(o){case u:return _e("Suspense");case g:return _e("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case l:return le(o.render);case m:return de(o.type,y,x);case v:return le(o._render);case E:{var O=o,_=O._payload,A=O._init;try{return de(A(_),y,x)}catch{}}}return""}var he={},Ve=j.ReactDebugCurrentFrame;function He(o){if(o){var y=o._owner,x=de(o.type,o._source,y?y.type:null);Ve.setExtraStackFrame(x)}else Ve.setExtraStackFrame(null)}function at(o,y,x,O,_){{var A=Function.call.bind(Object.prototype.hasOwnProperty);for(var W in o)if(A(o,W)){var I=void 0;try{if(typeof o[W]!="function"){var U=Error((O||"React class")+": "+x+" type `"+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[W]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw U.name="Invariant Violation",U}I=o[W](y,W,O,x,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(V){I=V}I&&!(I instanceof Error)&&(He(_),Y("%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).",O||"React class",x,W,typeof I),He(null)),I instanceof Error&&!(I.message in he)&&(he[I.message]=!0,He(_),Y("Failed %s type: %s",x,I.message),He(null))}}}var Ge=j.ReactCurrentOwner,$e=Object.prototype.hasOwnProperty,It={key:!0,ref:!0,__self:!0,__source:!0},Ke,Je;function st(o){if($e.call(o,"ref")){var y=Object.getOwnPropertyDescriptor(o,"ref").get;if(y&&y.isReactWarning)return!1}return o.ref!==void 0}function ct(o){if($e.call(o,"key")){var y=Object.getOwnPropertyDescriptor(o,"key").get;if(y&&y.isReactWarning)return!1}return o.key!==void 0}function lt(o,y){typeof o.ref=="string"&&Ge.current}function ut(o,y){{var x=function(){Ke||(Ke=!0,Y("%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))};x.isReactWarning=!0,Object.defineProperty(o,"key",{get:x,configurable:!0})}}function ft(o,y){{var x=function(){Je||(Je=!0,Y("%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))};x.isReactWarning=!0,Object.defineProperty(o,"ref",{get:x,configurable:!0})}}var dt=function(o,y,x,O,_,A,W){var I={$$typeof:n,type:o,key:y,ref:x,props:W,_owner:A};return I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(I,"_self",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.defineProperty(I,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I};function bt(o,y,x,O,_){{var A,W={},I=null,U=null;x!==void 0&&(I=""+x),ct(y)&&(I=""+y.key),st(y)&&(U=y.ref,lt(y,_));for(A in y)$e.call(y,A)&&!It.hasOwnProperty(A)&&(W[A]=y[A]);if(o&&o.defaultProps){var V=o.defaultProps;for(A in V)W[A]===void 0&&(W[A]=V[A])}if(I||U){var L=typeof o=="function"?o.displayName||o.name||"Unknown":o;I&&ut(W,L),U&&ft(W,L)}return dt(o,I,U,_,O,Ge.current,W)}}var ht=j.ReactCurrentOwner,Ze=j.ReactDebugCurrentFrame;function Fe(o){if(o){var y=o._owner,x=de(o.type,o._source,y?y.type:null);Ze.setExtraStackFrame(x)}else Ze.setExtraStackFrame(null)}var wt;wt=!1;function Qe(o){return typeof o=="object"&&o!==null&&o.$$typeof===n}function xt(){{if(ht.current){var o=ee(ht.current.type);if(o)return`
24
24
 
25
25
  Check the render method of \``+o+"`."}return""}}function Dt(o){return""}var me={};function Et(o){{var y=xt();if(!y){var x=typeof o=="string"?o:o.displayName||o.name;x&&(y=`
26
26
 
@@ -72,7 +72,7 @@ Selectors that return the entire state are almost certainly a mistake, as they w
72
72
  *
73
73
  * This source code is licensed under the MIT license found in the
74
74
  * LICENSE file in the root directory of this source tree.
75
- */var Yr;function co(){return Yr||(Yr=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,f=e?Symbol.for("react.provider"):60109,h=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,E=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,d=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,T=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function P(D){return typeof D=="string"||typeof D=="function"||D===n||D===l||D===a||D===i||D===g||D===m||typeof D=="object"&&D!==null&&(D.$$typeof===v||D.$$typeof===E||D.$$typeof===f||D.$$typeof===h||D.$$typeof===u||D.$$typeof===S||D.$$typeof===T||D.$$typeof===k||D.$$typeof===d)}function N(D){if(typeof D=="object"&&D!==null){var le=D.$$typeof;switch(le){case t:var z=D.type;switch(z){case p:case l:case n:case a:case i:case g:return z;default:var de=z&&z.$$typeof;switch(de){case h:case u:case v:case E:case f:return de;default:return le}}case r:return le}}}var c=p,R=l,j=h,Y=f,Z=t,q=u,H=n,ae=v,G=E,ee=r,fe=a,Te=i,Se=g,ye=!1;function be(D){return ye||(ye=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),we(D)||N(D)===p}function we(D){return N(D)===l}function Me(D){return N(D)===h}function Le(D){return N(D)===f}function ke(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function qe(D){return N(D)===u}function Ye(D){return N(D)===n}function ge(D){return N(D)===v}function Ce(D){return N(D)===E}function _e(D){return N(D)===r}function ie(D){return N(D)===a}function se(D){return N(D)===i}function ce(D){return N(D)===g}F.AsyncMode=c,F.ConcurrentMode=R,F.ContextConsumer=j,F.ContextProvider=Y,F.Element=Z,F.ForwardRef=q,F.Fragment=H,F.Lazy=ae,F.Memo=G,F.Portal=ee,F.Profiler=fe,F.StrictMode=Te,F.Suspense=Se,F.isAsyncMode=be,F.isConcurrentMode=we,F.isContextConsumer=Me,F.isContextProvider=Le,F.isElement=ke,F.isForwardRef=qe,F.isFragment=Ye,F.isLazy=ge,F.isMemo=Ce,F.isPortal=_e,F.isProfiler=ie,F.isStrictMode=se,F.isSuspense=ce,F.isValidElementType=P,F.typeOf=N})()),F}var Vr;function lo(){return Vr||(Vr=1,process.env.NODE_ENV==="production"?Ot.exports=so():Ot.exports=co()),Ot.exports}var Kt,$r;function uo(){if($r)return Kt;$r=1;var e=lo(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=n,a[e.Memo]=i;function f(v){return e.isMemo(v)?i:a[v.$$typeof]||t}var h=Object.defineProperty,p=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,m=Object.prototype;function E(v,d,S){if(typeof d!="string"){if(m){var T=g(d);T&&T!==m&&E(v,T,S)}var k=p(d);l&&(k=k.concat(l(d)));for(var P=f(v),N=f(d),c=0;c<k.length;++c){var R=k[c];if(!r[R]&&!(S&&S[R])&&!(N&&N[R])&&!(P&&P[R])){var j=u(d,R);try{h(v,R,j)}catch{}}}}return v}return Kt=E,Kt}uo();var jt={exports:{}},X={};/**
75
+ */var Yr;function co(){return Yr||(Yr=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,f=e?Symbol.for("react.provider"):60109,h=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,E=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,d=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,T=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function P(D){return typeof D=="string"||typeof D=="function"||D===n||D===l||D===a||D===i||D===g||D===m||typeof D=="object"&&D!==null&&(D.$$typeof===v||D.$$typeof===E||D.$$typeof===f||D.$$typeof===h||D.$$typeof===u||D.$$typeof===S||D.$$typeof===T||D.$$typeof===k||D.$$typeof===d)}function N(D){if(typeof D=="object"&&D!==null){var le=D.$$typeof;switch(le){case t:var z=D.type;switch(z){case p:case l:case n:case a:case i:case g:return z;default:var de=z&&z.$$typeof;switch(de){case h:case u:case v:case E:case f:return de;default:return le}}case r:return le}}}var c=p,R=l,j=h,Y=f,Z=t,q=u,H=n,ie=v,G=E,ee=r,fe=a,Te=i,Se=g,ye=!1;function be(D){return ye||(ye=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),we(D)||N(D)===p}function we(D){return N(D)===l}function Me(D){return N(D)===h}function Le(D){return N(D)===f}function ke(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function qe(D){return N(D)===u}function Ye(D){return N(D)===n}function ge(D){return N(D)===v}function Ce(D){return N(D)===E}function _e(D){return N(D)===r}function ae(D){return N(D)===a}function se(D){return N(D)===i}function ce(D){return N(D)===g}F.AsyncMode=c,F.ConcurrentMode=R,F.ContextConsumer=j,F.ContextProvider=Y,F.Element=Z,F.ForwardRef=q,F.Fragment=H,F.Lazy=ie,F.Memo=G,F.Portal=ee,F.Profiler=fe,F.StrictMode=Te,F.Suspense=Se,F.isAsyncMode=be,F.isConcurrentMode=we,F.isContextConsumer=Me,F.isContextProvider=Le,F.isElement=ke,F.isForwardRef=qe,F.isFragment=Ye,F.isLazy=ge,F.isMemo=Ce,F.isPortal=_e,F.isProfiler=ae,F.isStrictMode=se,F.isSuspense=ce,F.isValidElementType=P,F.typeOf=N})()),F}var Vr;function lo(){return Vr||(Vr=1,process.env.NODE_ENV==="production"?Ot.exports=so():Ot.exports=co()),Ot.exports}var Kt,$r;function uo(){if($r)return Kt;$r=1;var e=lo(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=n,a[e.Memo]=i;function f(v){return e.isMemo(v)?i:a[v.$$typeof]||t}var h=Object.defineProperty,p=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,m=Object.prototype;function E(v,d,S){if(typeof d!="string"){if(m){var T=g(d);T&&T!==m&&E(v,T,S)}var k=p(d);l&&(k=k.concat(l(d)));for(var P=f(v),N=f(d),c=0;c<k.length;++c){var R=k[c];if(!r[R]&&!(S&&S[R])&&!(N&&N[R])&&!(P&&P[R])){var j=u(d,R);try{h(v,R,j)}catch{}}}}return v}return Kt=E,Kt}uo();var jt={exports:{}},X={};/**
76
76
  * @license React
77
77
  * react-is.production.min.js
78
78
  *
@@ -88,7 +88,7 @@ Selectors that return the entire state are almost certainly a mistake, as they w
88
88
  *
89
89
  * This source code is licensed under the MIT license found in the
90
90
  * LICENSE file in the root directory of this source tree.
91
- */var Xr;function ho(){return Xr||(Xr=1,process.env.NODE_ENV!=="production"&&(function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.server_context"),p=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),v=!1,d=!1,S=!1,T=!1,k=!1,P;P=Symbol.for("react.module.reference");function N(z){return!!(typeof z=="string"||typeof z=="function"||z===r||z===i||k||z===n||z===l||z===u||T||z===E||v||d||S||typeof z=="object"&&z!==null&&(z.$$typeof===m||z.$$typeof===g||z.$$typeof===a||z.$$typeof===f||z.$$typeof===p||z.$$typeof===P||z.getModuleId!==void 0))}function c(z){if(typeof z=="object"&&z!==null){var de=z.$$typeof;switch(de){case e:var he=z.type;switch(he){case r:case i:case n:case l:case u:return he;default:var Ve=he&&he.$$typeof;switch(Ve){case h:case f:case p:case m:case g:case a:return Ve;default:return de}}case t:return de}}}var R=f,j=a,Y=e,Z=p,q=r,H=m,ae=g,G=t,ee=i,fe=n,Te=l,Se=u,ye=!1,be=!1;function we(z){return ye||(ye=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Me(z){return be||(be=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Le(z){return c(z)===f}function ke(z){return c(z)===a}function qe(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function Ye(z){return c(z)===p}function ge(z){return c(z)===r}function Ce(z){return c(z)===m}function _e(z){return c(z)===g}function ie(z){return c(z)===t}function se(z){return c(z)===i}function ce(z){return c(z)===n}function D(z){return c(z)===l}function le(z){return c(z)===u}B.ContextConsumer=R,B.ContextProvider=j,B.Element=Y,B.ForwardRef=Z,B.Fragment=q,B.Lazy=H,B.Memo=ae,B.Portal=G,B.Profiler=ee,B.StrictMode=fe,B.Suspense=Te,B.SuspenseList=Se,B.isAsyncMode=we,B.isConcurrentMode=Me,B.isContextConsumer=Le,B.isContextProvider=ke,B.isElement=qe,B.isForwardRef=Ye,B.isFragment=ge,B.isLazy=Ce,B.isMemo=_e,B.isPortal=ie,B.isProfiler=se,B.isStrictMode=ce,B.isSuspense=D,B.isSuspenseList=le,B.isValidElementType=N,B.typeOf=c})()),B}var Br;function po(){return Br||(Br=1,process.env.NODE_ENV==="production"?jt.exports=fo():jt.exports=ho()),jt.exports}po();function vo(){const e=ro();let t=null,r=null;return{clear(){t=null,r=null},notify(){e(()=>{let n=t;for(;n;)n.callback(),n=n.next})},get(){let n=[],i=t;for(;i;)n.push(i),i=i.next;return n},subscribe(n){let i=!0,a=r={callback:n,next:null,prev:r};return a.prev?a.prev.next=a:t=a,function(){!i||t===null||(i=!1,a.next?a.next.prev=a.prev:r=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}const Ur={notify(){},get:()=>[]};function yo(e,t){let r,n=Ur,i=0,a=!1;function f(d){u();const S=n.subscribe(d);let T=!1;return()=>{T||(T=!0,S(),g())}}function h(){n.notify()}function p(){v.onStateChange&&v.onStateChange()}function l(){return a}function u(){i++,r||(r=e.subscribe(p),n=vo())}function g(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=Ur)}function m(){a||(a=!0,u())}function E(){a&&(a=!1,g())}const v={addNestedSub:f,notifyNestedSubs:h,handleChangeWrapper:p,isSubscribed:l,trySubscribe:m,tryUnsubscribe:E,getListeners:()=>n};return v}const go=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?Oe.useLayoutEffect:Oe.useEffect;function mo({store:e,context:t,children:r,serverState:n,stabilityCheck:i="once",noopCheck:a="once"}){const f=Oe.useMemo(()=>{const l=yo(e);return{store:e,subscription:l,getServerState:n?()=>n:void 0,stabilityCheck:i,noopCheck:a}},[e,n,i,a]),h=Oe.useMemo(()=>e.getState(),[e]);go(()=>{const{subscription:l}=f;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),h!==e.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[f,h]);const p=t||Ne;return Oe.createElement(p.Provider,{value:f},r)}function qr(e=Ne){const t=e===Ne?zr:Gt(e);return function(){const{store:n}=t();return n}}const bo=qr();function wo(e=Ne){const t=e===Ne?bo:qr(e);return function(){return t().dispatch}}const Jt=wo();oo(Qn.useSyncExternalStoreWithSelector),to(Fn.unstable_batchedUpdates);const xo={en:{pointer:"Pointer",text:"Text",image:"Image",pencil:"Pencil",rectangle:"Rectangle",circle:"Circle",eraser:"Eraser",fitToView:"Fit to view",exportAsPng:"Export as PNG",moreShapes:"More Shapes",triangle:"Triangle",diamond:"Diamond",star:"Star",heart:"Heart",hexagon:"Hexagon",octagon:"Octagon",arrow:"Arrow",fontSize:"Font Size",fontColor:"Font Color",layerOrder:"Layer Order",bringToFront:"Bring to Front",sendToBack:"Send to Back",brushColor:"Brush Color",brushSize:"Brush Size",strokeColor:"Stroke Color",fillColor:"Fill Color",strokeWidth:"Stroke Width",language:"Language",english:"English",turkish:"Turkish"},tr:{pointer:"İşaretΓ§i",text:"Metin",image:"Resim",pencil:"Kalem",rectangle:"DikdΓΆrtgen",circle:"Daire",eraser:"Silgi",fitToView:"Ekrana sığdΔ±r",exportAsPng:"PNG olarak dışa aktar",moreShapes:"Daha Fazla Şekil",triangle:"Üçgen",diamond:"Elmas",star:"YΔ±ldΔ±z",heart:"Kalp",hexagon:"AltΔ±gen",octagon:"Sekizgen",arrow:"Ok",fontSize:"YazΔ± Boyutu",fontColor:"YazΔ± Rengi",layerOrder:"Katman SΔ±rasΔ±",bringToFront:"Γ–ne Getir",sendToBack:"Arkaya GΓΆnder",brushColor:"FΔ±rΓ§a Rengi",brushSize:"FΔ±rΓ§a Boyutu",strokeColor:"Γ‡izgi Rengi",fillColor:"Dolgu Rengi",strokeWidth:"Γ‡izgi KalΔ±nlığı",language:"Dil",english:"Δ°ngilizce",turkish:"TΓΌrkΓ§e"}},Hr=M.createContext(),Gr="whiteboard-language",Eo=()=>(navigator.language||navigator.userLanguage).startsWith("tr")?"tr":"en",So=()=>{const e=localStorage.getItem(Gr);return e&&(e==="en"||e==="tr")?e:Eo()},Co=({children:e})=>{const[t,r]=M.useState(So);M.useEffect(()=>{localStorage.setItem(Gr,t)},[t]);const n=a=>xo[t][a]||a,i=a=>{(a==="en"||a==="tr")&&r(a)};return w.jsx(Hr.Provider,{value:{language:t,t:n,changeLanguage:i},children:e})},Kr=()=>{const e=M.useContext(Hr);if(!e)throw new Error("useLanguage must be used within a LanguageProvider");return e};function te(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(process.env.NODE_ENV!=="production"){var i=No[e],a=i?typeof i=="function"?i.apply(null,r):i:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(f){return"'"+f+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Ae(e){return!!e&&!!e[K]}function je(e){var t;return!!e&&((function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===Ao})(e)||Array.isArray(e)||!!e[sn]||!!(!((t=e.constructor)===null||t===void 0)&&t[sn])||Zt(e)||Qt(e))}function Xe(e,t,r){r===void 0&&(r=!1),tt(e)===0?(r?Object.keys:ot)(e).forEach((function(n){r&&typeof n=="symbol"||t(n,e[n],e)})):e.forEach((function(n,i){return t(i,n,e)}))}function tt(e){var t=e[K];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Zt(e)?2:Qt(e)?3:0}function rt(e,t){return tt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function _o(e,t){return tt(e)===2?e.get(t):e[t]}function Jr(e,t,r){var n=tt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Zr(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Zt(e){return ko&&e instanceof Map}function Qt(e){return Ro&&e instanceof Set}function Ie(e){return e.o||e.t}function er(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=cn(e);delete t[K];for(var r=ot(t),n=0;n<r.length;n++){var i=r[n],a=t[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function tr(e,t){return t===void 0&&(t=!1),rr(e)||Ae(e)||!je(e)||(tt(e)>1&&(e.set=e.add=e.clear=e.delete=Oo),Object.freeze(e),t&&Xe(e,(function(r,n){return tr(n,!0)}),!0)),e}function Oo(){te(2)}function rr(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Ee(e){var t=fr[e];return t||te(18,e),t}function jo(e,t){fr[e]||(fr[e]=t)}function nr(){return process.env.NODE_ENV==="production"||nt||te(0),nt}function or(e,t){t&&(Ee("Patches"),e.u=[],e.s=[],e.v=t)}function Pt(e){ir(e),e.p.forEach(Po),e.p=null}function ir(e){e===nt&&(nt=e.l)}function Qr(e){return nt={p:[],l:nt,h:e,m:!0,_:0}}function Po(e){var t=e[K];t.i===0||t.i===1?t.j():t.g=!0}function ar(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.O||Ee("ES5").S(t,e,n),n?(r[K].P&&(Pt(t),te(4)),je(e)&&(e=Tt(t,e),t.l||Mt(t,e)),t.u&&Ee("Patches").M(r[K].t,e,t.u,t.s)):e=Tt(t,r,[]),Pt(t),t.u&&t.v(t.u,t.s),e!==an?e:void 0}function Tt(e,t,r){if(rr(t))return t;var n=t[K];if(!n)return Xe(t,(function(h,p){return en(e,n,t,h,p,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return Mt(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=er(n.k):n.o,a=i,f=!1;n.i===3&&(a=new Set(i),i.clear(),f=!0),Xe(a,(function(h,p){return en(e,n,i,h,p,r,f)})),Mt(e,i,!1),r&&e.u&&Ee("Patches").N(n,r,e.u,e.s)}return n.o}function en(e,t,r,n,i,a,f){if(process.env.NODE_ENV!=="production"&&i===r&&te(5),Ae(i)){var h=Tt(e,i,a&&t&&t.i!==3&&!rt(t.R,n)?a.concat(n):void 0);if(Jr(r,n,h),!Ae(h))return;e.m=!1}else f&&r.add(i);if(je(i)&&!rr(i)){if(!e.h.D&&e._<1)return;Tt(e,i),t&&t.A.l||Mt(e,i)}}function Mt(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&tr(t,r)}function sr(e,t){var r=e[K];return(r?Ie(r):e)[t]}function tn(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function De(e){e.P||(e.P=!0,e.l&&De(e.l))}function cr(e){e.o||(e.o=er(e.t))}function lr(e,t,r){var n=Zt(t)?Ee("MapSet").F(t,r):Qt(t)?Ee("MapSet").T(t,r):e.O?(function(i,a){var f=Array.isArray(i),h={i:f?1:0,A:a?a.A:nr(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},p=h,l=pt;f&&(p=[h],l=vt);var u=Proxy.revocable(p,l),g=u.revoke,m=u.proxy;return h.k=m,h.j=g,m})(t,r):Ee("ES5").J(t,r);return(r?r.A:nr()).p.push(n),n}function To(e){return Ae(e)||te(22,e),(function t(r){if(!je(r))return r;var n,i=r[K],a=tt(r);if(i){if(!i.P&&(i.i<4||!Ee("ES5").K(i)))return i.t;i.I=!0,n=rn(r,a),i.I=!1}else n=rn(r,a);return Xe(n,(function(f,h){i&&_o(i.t,f)===h||Jr(n,f,t(h))})),a===3?new Set(n):n})(e)}function rn(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return er(e)}function Mo(){function e(f,h){var p=a[f];return p?p.enumerable=h:a[f]=p={configurable:!0,enumerable:h,get:function(){var l=this[K];return process.env.NODE_ENV!=="production"&&i(l),pt.get(l,f)},set:function(l){var u=this[K];process.env.NODE_ENV!=="production"&&i(u),pt.set(u,f,l)}},p}function t(f){for(var h=f.length-1;h>=0;h--){var p=f[h][K];if(!p.P)switch(p.i){case 5:n(p)&&De(p);break;case 4:r(p)&&De(p)}}}function r(f){for(var h=f.t,p=f.k,l=ot(p),u=l.length-1;u>=0;u--){var g=l[u];if(g!==K){var m=h[g];if(m===void 0&&!rt(h,g))return!0;var E=p[g],v=E&&E[K];if(v?v.t!==m:!Zr(E,m))return!0}}var d=!!h[K];return l.length!==ot(h).length+(d?0:1)}function n(f){var h=f.k;if(h.length!==f.t.length)return!0;var p=Object.getOwnPropertyDescriptor(h,h.length-1);if(p&&!p.get)return!0;for(var l=0;l<h.length;l++)if(!h.hasOwnProperty(l))return!0;return!1}function i(f){f.g&&te(3,JSON.stringify(Ie(f)))}var a={};jo("ES5",{J:function(f,h){var p=Array.isArray(f),l=(function(g,m){if(g){for(var E=Array(m.length),v=0;v<m.length;v++)Object.defineProperty(E,""+v,e(v,!0));return E}var d=cn(m);delete d[K];for(var S=ot(d),T=0;T<S.length;T++){var k=S[T];d[k]=e(k,g||!!d[k].enumerable)}return Object.create(Object.getPrototypeOf(m),d)})(p,f),u={i:p?5:4,A:h?h.A:nr(),P:!1,I:!1,R:{},l:h,t:f,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,K,{value:u,writable:!0}),l},S:function(f,h,p){p?Ae(h)&&h[K].A===f&&t(f.p):(f.u&&(function l(u){if(u&&typeof u=="object"){var g=u[K];if(g){var m=g.t,E=g.k,v=g.R,d=g.i;if(d===4)Xe(E,(function(N){N!==K&&(m[N]!==void 0||rt(m,N)?v[N]||l(E[N]):(v[N]=!0,De(g)))})),Xe(m,(function(N){E[N]!==void 0||rt(E,N)||(v[N]=!1,De(g))}));else if(d===5){if(n(g)&&(De(g),v.length=!0),E.length<m.length)for(var S=E.length;S<m.length;S++)v[S]=!1;else for(var T=m.length;T<E.length;T++)v[T]=!0;for(var k=Math.min(E.length,m.length),P=0;P<k;P++)E.hasOwnProperty(P)||(v[P]=!0),v[P]===void 0&&l(E[P])}}}})(f.p[0]),t(f.p))},K:function(f){return f.i===4?r(f):n(f)}})}var nn,nt,ur=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ko=typeof Map<"u",Ro=typeof Set<"u",on=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",an=ur?Symbol.for("immer-nothing"):((nn={})["immer-nothing"]=!0,nn),sn=ur?Symbol.for("immer-draftable"):"__$immer_draftable",K=ur?Symbol.for("immer-state"):"__$immer_state",No={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Ao=""+Object.prototype.constructor,ot=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,cn=Object.getOwnPropertyDescriptors||function(e){var t={};return ot(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},fr={},pt={get:function(e,t){if(t===K)return e;var r=Ie(e);if(!rt(r,t))return(function(i,a,f){var h,p=tn(a,f);return p?"value"in p?p.value:(h=p.get)===null||h===void 0?void 0:h.call(i.k):void 0})(e,r,t);var n=r[t];return e.I||!je(n)?n:n===sr(e.t,t)?(cr(e),e.o[t]=lr(e.A.h,n,e)):n},has:function(e,t){return t in Ie(e)},ownKeys:function(e){return Reflect.ownKeys(Ie(e))},set:function(e,t,r){var n=tn(Ie(e),t);if(n!=null&&n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=sr(Ie(e),t),a=i==null?void 0:i[K];if(a&&a.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(Zr(r,i)&&(r!==void 0||rt(e.t,t)))return!0;cr(e),De(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return sr(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,cr(e),De(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Ie(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){te(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){te(12)}},vt={};Xe(pt,(function(e,t){vt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),vt.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&te(13),vt.set.call(this,e,t,void 0)},vt.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&te(14),pt.set.call(this,e[0],t,r,e[0])};var Io=(function(){function e(r){var n=this;this.O=on,this.D=!0,this.produce=function(i,a,f){if(typeof i=="function"&&typeof a!="function"){var h=a;a=i;var p=n;return function(d){var S=this;d===void 0&&(d=h);for(var T=arguments.length,k=Array(T>1?T-1:0),P=1;P<T;P++)k[P-1]=arguments[P];return p.produce(d,(function(N){var c;return(c=a).call.apply(c,[S,N].concat(k))}))}}var l;if(typeof a!="function"&&te(6),f!==void 0&&typeof f!="function"&&te(7),je(i)){var u=Qr(n),g=lr(n,i,void 0),m=!0;try{l=a(g),m=!1}finally{m?Pt(u):ir(u)}return typeof Promise<"u"&&l instanceof Promise?l.then((function(d){return or(u,f),ar(d,u)}),(function(d){throw Pt(u),d})):(or(u,f),ar(l,u))}if(!i||typeof i!="object"){if((l=a(i))===void 0&&(l=i),l===an&&(l=void 0),n.D&&tr(l,!0),f){var E=[],v=[];Ee("Patches").M(i,l,E,v),f(E,v)}return l}te(21,i)},this.produceWithPatches=function(i,a){if(typeof i=="function")return function(l){for(var u=arguments.length,g=Array(u>1?u-1:0),m=1;m<u;m++)g[m-1]=arguments[m];return n.produceWithPatches(l,(function(E){return i.apply(void 0,[E].concat(g))}))};var f,h,p=n.produce(i,a,(function(l,u){f=l,h=u}));return typeof Promise<"u"&&p instanceof Promise?p.then((function(l){return[l,f,h]})):[p,f,h]},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var t=e.prototype;return t.createDraft=function(r){je(r)||te(8),Ae(r)&&(r=To(r));var n=Qr(this),i=lr(this,r,void 0);return i[K].C=!0,ir(n),i},t.finishDraft=function(r,n){var i=r&&r[K];process.env.NODE_ENV!=="production"&&(i&&i.C||te(9),i.I&&te(10));var a=i.A;return or(a,n),ar(void 0,a)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!on&&te(20),this.O=r},t.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}i>-1&&(n=n.slice(i+1));var f=Ee("Patches").$;return Ae(r)?f(r,n):this.produce(r,(function(h){return f(h,n)}))},e})(),ue=new Io,ln=ue.produce;ue.produceWithPatches.bind(ue),ue.setAutoFreeze.bind(ue),ue.setUseProxies.bind(ue),ue.applyPatches.bind(ue),ue.createDraft.bind(ue),ue.finishDraft.bind(ue);function yt(e){"@babel/helpers - typeof";return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(e)}function Do(e,t){if(yt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(yt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zo(e){var t=Do(e,"string");return yt(t)=="symbol"?t:t+""}function Wo(e,t,r){return(t=zo(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function un(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?un(Object(r),!0).forEach(function(n){Wo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):un(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ne(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var dn=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),dr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Be={INIT:"@@redux/INIT"+dr(),REPLACE:"@@redux/REPLACE"+dr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+dr()}};function hn(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Lo(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if($o(e))return"date";if(Vo(e))return"error";var r=Yo(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Yo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Vo(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function $o(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ue(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Lo(e)),t}function pn(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ne(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?ne(1):"Expected the enhancer to be a function. Instead, received: '"+Ue(r)+"'");return r(pn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ne(2):"Expected the root reducer to be a function. Instead, received: '"+Ue(e)+"'");var i=e,a=t,f=[],h=f,p=!1;function l(){h===f&&(h=f.slice())}function u(){if(p)throw new Error(process.env.NODE_ENV==="production"?ne(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function g(d){if(typeof d!="function")throw new Error(process.env.NODE_ENV==="production"?ne(4):"Expected the listener to be a function. Instead, received: '"+Ue(d)+"'");if(p)throw new Error(process.env.NODE_ENV==="production"?ne(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var S=!0;return l(),h.push(d),function(){if(S){if(p)throw new Error(process.env.NODE_ENV==="production"?ne(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");S=!1,l();var k=h.indexOf(d);h.splice(k,1),f=null}}}function m(d){if(!hn(d))throw new Error(process.env.NODE_ENV==="production"?ne(7):"Actions must be plain objects. Instead, the actual type was: '"+Ue(d)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof d.type>"u")throw new Error(process.env.NODE_ENV==="production"?ne(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(p)throw new Error(process.env.NODE_ENV==="production"?ne(9):"Reducers may not dispatch actions.");try{p=!0,a=i(a,d)}finally{p=!1}for(var S=f=h,T=0;T<S.length;T++){var k=S[T];k()}return d}function E(d){if(typeof d!="function")throw new Error(process.env.NODE_ENV==="production"?ne(10):"Expected the nextReducer to be a function. Instead, received: '"+Ue(d));i=d,m({type:Be.REPLACE})}function v(){var d,S=g;return d={subscribe:function(k){if(typeof k!="object"||k===null)throw new Error(process.env.NODE_ENV==="production"?ne(11):"Expected the observer to be an object. Instead, received: '"+Ue(k)+"'");function P(){k.next&&k.next(u())}P();var N=S(P);return{unsubscribe:N}}},d[dn]=function(){return this},d}return m({type:Be.INIT}),n={dispatch:m,subscribe:g,getState:u,replaceReducer:E},n[dn]=v,n}function vn(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function Fo(e,t,r,n){var i=Object.keys(t),a=r&&r.type===Be.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(i.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!hn(e))return"The "+a+' has unexpected type of "'+Ue(e)+'". Expected argument to be an object with the following '+('keys: "'+i.join('", "')+'"');var f=Object.keys(e).filter(function(h){return!t.hasOwnProperty(h)&&!n[h]});if(f.forEach(function(h){n[h]=!0}),!(r&&r.type===Be.REPLACE)&&f.length>0)return"Unexpected "+(f.length>1?"keys":"key")+" "+('"'+f.join('", "')+'" found in '+a+". ")+"Expected to find one of the known reducer keys instead: "+('"'+i.join('", "')+'". Unexpected keys will be ignored.')}function Xo(e){Object.keys(e).forEach(function(t){var r=e[t],n=r(void 0,{type:Be.INIT});if(typeof n>"u")throw new Error(process.env.NODE_ENV==="production"?ne(12):'The slice reducer for key "'+t+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:Be.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?ne(13):'The slice reducer for key "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle '"+Be.INIT+`' or other actions in "redux/*" `)+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}function Bo(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var i=t[n];process.env.NODE_ENV!=="production"&&typeof e[i]>"u"&&vn('No reducer provided for key "'+i+'"'),typeof e[i]=="function"&&(r[i]=e[i])}var a=Object.keys(r),f;process.env.NODE_ENV!=="production"&&(f={});var h;try{Xo(r)}catch(p){h=p}return function(l,u){if(l===void 0&&(l={}),h)throw h;if(process.env.NODE_ENV!=="production"){var g=Fo(l,r,u,f);g&&vn(g)}for(var m=!1,E={},v=0;v<a.length;v++){var d=a[v],S=r[d],T=l[d],k=S(T,u);if(typeof k>"u"){var P=u&&u.type;throw new Error(process.env.NODE_ENV==="production"?ne(14):"When called with an action of type "+(P?'"'+String(P)+'"':"(unknown type)")+', the slice reducer for key "'+d+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.')}E[d]=k,m=m||k!==T}return m=m||a.length!==Object.keys(l).length,m?E:l}}function kt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function Uo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),a=function(){throw new Error(process.env.NODE_ENV==="production"?ne(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},f={getState:i.getState,dispatch:function(){return a.apply(void 0,arguments)}},h=t.map(function(p){return p(f)});return a=kt.apply(void 0,h)(i.dispatch),fn(fn({},i),{},{dispatch:a})}}}function yn(e){var t=function(n){var i=n.dispatch,a=n.getState;return function(f){return function(h){return typeof h=="function"?h(i,a,e):f(h)}}};return t}var hr=yn();hr.withExtraArgument=yn;var gn=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),qo=function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,f;return f={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function h(l){return function(u){return p([l,u])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(u){l=[6,u],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},it=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},Ho=Object.defineProperty,Go=Object.defineProperties,Ko=Object.getOwnPropertyDescriptors,mn=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable,bn=function(e,t,r){return t in e?Ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},ze=function(e,t){for(var r in t||(t={}))Jo.call(t,r)&&bn(e,r,t[r]);if(mn)for(var n=0,i=mn(t);n<i.length;n++){var r=i[n];Zo.call(t,r)&&bn(e,r,t[r])}return e},pr=function(e,t){return Go(e,Ko(t))},Qo=function(e,t,r){return new Promise(function(n,i){var a=function(p){try{h(r.next(p))}catch(l){i(l)}},f=function(p){try{h(r.throw(p))}catch(l){i(l)}},h=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(a,f)};h((r=r.apply(e,t)).next())})},ei=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?kt:kt.apply(null,arguments)};function wn(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var r=t;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return t===r}var ti=function(e){return e&&typeof e.match=="function"};function We(e,t){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(t){var a=t.apply(void 0,n);if(!a)throw new Error("prepareAction did not return an object");return ze(ze({type:e,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:e,payload:n[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(n){return n.type===e},r}function ri(e){return typeof e=="function"&&"type"in e&&ti(e)}function ni(e){var t=e?(""+e).split("/"):[],r=t[t.length-1]||"actionCreator";return'Detected an action creator with type "'+(e||"unknown")+`" being dispatched.
91
+ */var Xr;function ho(){return Xr||(Xr=1,process.env.NODE_ENV!=="production"&&(function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.server_context"),p=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),v=!1,d=!1,S=!1,T=!1,k=!1,P;P=Symbol.for("react.module.reference");function N(z){return!!(typeof z=="string"||typeof z=="function"||z===r||z===i||k||z===n||z===l||z===u||T||z===E||v||d||S||typeof z=="object"&&z!==null&&(z.$$typeof===m||z.$$typeof===g||z.$$typeof===a||z.$$typeof===f||z.$$typeof===p||z.$$typeof===P||z.getModuleId!==void 0))}function c(z){if(typeof z=="object"&&z!==null){var de=z.$$typeof;switch(de){case e:var he=z.type;switch(he){case r:case i:case n:case l:case u:return he;default:var Ve=he&&he.$$typeof;switch(Ve){case h:case f:case p:case m:case g:case a:return Ve;default:return de}}case t:return de}}}var R=f,j=a,Y=e,Z=p,q=r,H=m,ie=g,G=t,ee=i,fe=n,Te=l,Se=u,ye=!1,be=!1;function we(z){return ye||(ye=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Me(z){return be||(be=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Le(z){return c(z)===f}function ke(z){return c(z)===a}function qe(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function Ye(z){return c(z)===p}function ge(z){return c(z)===r}function Ce(z){return c(z)===m}function _e(z){return c(z)===g}function ae(z){return c(z)===t}function se(z){return c(z)===i}function ce(z){return c(z)===n}function D(z){return c(z)===l}function le(z){return c(z)===u}B.ContextConsumer=R,B.ContextProvider=j,B.Element=Y,B.ForwardRef=Z,B.Fragment=q,B.Lazy=H,B.Memo=ie,B.Portal=G,B.Profiler=ee,B.StrictMode=fe,B.Suspense=Te,B.SuspenseList=Se,B.isAsyncMode=we,B.isConcurrentMode=Me,B.isContextConsumer=Le,B.isContextProvider=ke,B.isElement=qe,B.isForwardRef=Ye,B.isFragment=ge,B.isLazy=Ce,B.isMemo=_e,B.isPortal=ae,B.isProfiler=se,B.isStrictMode=ce,B.isSuspense=D,B.isSuspenseList=le,B.isValidElementType=N,B.typeOf=c})()),B}var Br;function po(){return Br||(Br=1,process.env.NODE_ENV==="production"?jt.exports=fo():jt.exports=ho()),jt.exports}po();function vo(){const e=ro();let t=null,r=null;return{clear(){t=null,r=null},notify(){e(()=>{let n=t;for(;n;)n.callback(),n=n.next})},get(){let n=[],i=t;for(;i;)n.push(i),i=i.next;return n},subscribe(n){let i=!0,a=r={callback:n,next:null,prev:r};return a.prev?a.prev.next=a:t=a,function(){!i||t===null||(i=!1,a.next?a.next.prev=a.prev:r=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}const Ur={notify(){},get:()=>[]};function yo(e,t){let r,n=Ur,i=0,a=!1;function f(d){u();const S=n.subscribe(d);let T=!1;return()=>{T||(T=!0,S(),g())}}function h(){n.notify()}function p(){v.onStateChange&&v.onStateChange()}function l(){return a}function u(){i++,r||(r=e.subscribe(p),n=vo())}function g(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=Ur)}function m(){a||(a=!0,u())}function E(){a&&(a=!1,g())}const v={addNestedSub:f,notifyNestedSubs:h,handleChangeWrapper:p,isSubscribed:l,trySubscribe:m,tryUnsubscribe:E,getListeners:()=>n};return v}const go=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?Oe.useLayoutEffect:Oe.useEffect;function mo({store:e,context:t,children:r,serverState:n,stabilityCheck:i="once",noopCheck:a="once"}){const f=Oe.useMemo(()=>{const l=yo(e);return{store:e,subscription:l,getServerState:n?()=>n:void 0,stabilityCheck:i,noopCheck:a}},[e,n,i,a]),h=Oe.useMemo(()=>e.getState(),[e]);go(()=>{const{subscription:l}=f;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),h!==e.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[f,h]);const p=t||Ne;return Oe.createElement(p.Provider,{value:f},r)}function qr(e=Ne){const t=e===Ne?zr:Gt(e);return function(){const{store:n}=t();return n}}const bo=qr();function wo(e=Ne){const t=e===Ne?bo:qr(e);return function(){return t().dispatch}}const Jt=wo();oo(Qn.useSyncExternalStoreWithSelector),to(Fn.unstable_batchedUpdates);const xo={en:{pointer:"Pointer",text:"Text",image:"Image",pencil:"Pencil",rectangle:"Rectangle",circle:"Circle",eraser:"Eraser",fitToView:"Fit to view",exportAsPng:"Export as PNG",moreShapes:"More Shapes",triangle:"Triangle",diamond:"Diamond",star:"Star",heart:"Heart",hexagon:"Hexagon",octagon:"Octagon",arrow:"Arrow",fontSize:"Font Size",fontColor:"Font Color",layerOrder:"Layer Order",bringToFront:"Bring to Front",sendToBack:"Send to Back",brushColor:"Brush Color",brushSize:"Brush Size",strokeColor:"Stroke Color",fillColor:"Fill Color",strokeWidth:"Stroke Width",language:"Language",english:"English",turkish:"Turkish"},tr:{pointer:"İşaretΓ§i",text:"Metin",image:"Resim",pencil:"Kalem",rectangle:"DikdΓΆrtgen",circle:"Daire",eraser:"Silgi",fitToView:"Ekrana sığdΔ±r",exportAsPng:"PNG olarak dışa aktar",moreShapes:"Daha Fazla Şekil",triangle:"Üçgen",diamond:"Elmas",star:"YΔ±ldΔ±z",heart:"Kalp",hexagon:"AltΔ±gen",octagon:"Sekizgen",arrow:"Ok",fontSize:"YazΔ± Boyutu",fontColor:"YazΔ± Rengi",layerOrder:"Katman SΔ±rasΔ±",bringToFront:"Γ–ne Getir",sendToBack:"Arkaya GΓΆnder",brushColor:"FΔ±rΓ§a Rengi",brushSize:"FΔ±rΓ§a Boyutu",strokeColor:"Γ‡izgi Rengi",fillColor:"Dolgu Rengi",strokeWidth:"Γ‡izgi KalΔ±nlığı",language:"Dil",english:"Δ°ngilizce",turkish:"TΓΌrkΓ§e"}},Hr=M.createContext(),Gr="whiteboard-language",Eo=()=>(navigator.language||navigator.userLanguage).startsWith("tr")?"tr":"en",So=()=>{const e=localStorage.getItem(Gr);return e&&(e==="en"||e==="tr")?e:Eo()},Co=({children:e})=>{const[t,r]=M.useState(So);M.useEffect(()=>{localStorage.setItem(Gr,t)},[t]);const n=a=>xo[t][a]||a,i=a=>{(a==="en"||a==="tr")&&r(a)};return w.jsx(Hr.Provider,{value:{language:t,t:n,changeLanguage:i},children:e})},Kr=()=>{const e=M.useContext(Hr);if(!e)throw new Error("useLanguage must be used within a LanguageProvider");return e};function te(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(process.env.NODE_ENV!=="production"){var i=No[e],a=i?typeof i=="function"?i.apply(null,r):i:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(f){return"'"+f+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Ae(e){return!!e&&!!e[K]}function je(e){var t;return!!e&&((function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===Ao})(e)||Array.isArray(e)||!!e[sn]||!!(!((t=e.constructor)===null||t===void 0)&&t[sn])||Zt(e)||Qt(e))}function Xe(e,t,r){r===void 0&&(r=!1),tt(e)===0?(r?Object.keys:ot)(e).forEach((function(n){r&&typeof n=="symbol"||t(n,e[n],e)})):e.forEach((function(n,i){return t(i,n,e)}))}function tt(e){var t=e[K];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Zt(e)?2:Qt(e)?3:0}function rt(e,t){return tt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function _o(e,t){return tt(e)===2?e.get(t):e[t]}function Jr(e,t,r){var n=tt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Zr(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Zt(e){return ko&&e instanceof Map}function Qt(e){return Ro&&e instanceof Set}function Ie(e){return e.o||e.t}function er(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=cn(e);delete t[K];for(var r=ot(t),n=0;n<r.length;n++){var i=r[n],a=t[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function tr(e,t){return t===void 0&&(t=!1),rr(e)||Ae(e)||!je(e)||(tt(e)>1&&(e.set=e.add=e.clear=e.delete=Oo),Object.freeze(e),t&&Xe(e,(function(r,n){return tr(n,!0)}),!0)),e}function Oo(){te(2)}function rr(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Ee(e){var t=fr[e];return t||te(18,e),t}function jo(e,t){fr[e]||(fr[e]=t)}function nr(){return process.env.NODE_ENV==="production"||nt||te(0),nt}function or(e,t){t&&(Ee("Patches"),e.u=[],e.s=[],e.v=t)}function Pt(e){ir(e),e.p.forEach(Po),e.p=null}function ir(e){e===nt&&(nt=e.l)}function Qr(e){return nt={p:[],l:nt,h:e,m:!0,_:0}}function Po(e){var t=e[K];t.i===0||t.i===1?t.j():t.g=!0}function ar(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.O||Ee("ES5").S(t,e,n),n?(r[K].P&&(Pt(t),te(4)),je(e)&&(e=Tt(t,e),t.l||Mt(t,e)),t.u&&Ee("Patches").M(r[K].t,e,t.u,t.s)):e=Tt(t,r,[]),Pt(t),t.u&&t.v(t.u,t.s),e!==an?e:void 0}function Tt(e,t,r){if(rr(t))return t;var n=t[K];if(!n)return Xe(t,(function(h,p){return en(e,n,t,h,p,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return Mt(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=er(n.k):n.o,a=i,f=!1;n.i===3&&(a=new Set(i),i.clear(),f=!0),Xe(a,(function(h,p){return en(e,n,i,h,p,r,f)})),Mt(e,i,!1),r&&e.u&&Ee("Patches").N(n,r,e.u,e.s)}return n.o}function en(e,t,r,n,i,a,f){if(process.env.NODE_ENV!=="production"&&i===r&&te(5),Ae(i)){var h=Tt(e,i,a&&t&&t.i!==3&&!rt(t.R,n)?a.concat(n):void 0);if(Jr(r,n,h),!Ae(h))return;e.m=!1}else f&&r.add(i);if(je(i)&&!rr(i)){if(!e.h.D&&e._<1)return;Tt(e,i),t&&t.A.l||Mt(e,i)}}function Mt(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&tr(t,r)}function sr(e,t){var r=e[K];return(r?Ie(r):e)[t]}function tn(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function De(e){e.P||(e.P=!0,e.l&&De(e.l))}function cr(e){e.o||(e.o=er(e.t))}function lr(e,t,r){var n=Zt(t)?Ee("MapSet").F(t,r):Qt(t)?Ee("MapSet").T(t,r):e.O?(function(i,a){var f=Array.isArray(i),h={i:f?1:0,A:a?a.A:nr(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},p=h,l=pt;f&&(p=[h],l=vt);var u=Proxy.revocable(p,l),g=u.revoke,m=u.proxy;return h.k=m,h.j=g,m})(t,r):Ee("ES5").J(t,r);return(r?r.A:nr()).p.push(n),n}function To(e){return Ae(e)||te(22,e),(function t(r){if(!je(r))return r;var n,i=r[K],a=tt(r);if(i){if(!i.P&&(i.i<4||!Ee("ES5").K(i)))return i.t;i.I=!0,n=rn(r,a),i.I=!1}else n=rn(r,a);return Xe(n,(function(f,h){i&&_o(i.t,f)===h||Jr(n,f,t(h))})),a===3?new Set(n):n})(e)}function rn(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return er(e)}function Mo(){function e(f,h){var p=a[f];return p?p.enumerable=h:a[f]=p={configurable:!0,enumerable:h,get:function(){var l=this[K];return process.env.NODE_ENV!=="production"&&i(l),pt.get(l,f)},set:function(l){var u=this[K];process.env.NODE_ENV!=="production"&&i(u),pt.set(u,f,l)}},p}function t(f){for(var h=f.length-1;h>=0;h--){var p=f[h][K];if(!p.P)switch(p.i){case 5:n(p)&&De(p);break;case 4:r(p)&&De(p)}}}function r(f){for(var h=f.t,p=f.k,l=ot(p),u=l.length-1;u>=0;u--){var g=l[u];if(g!==K){var m=h[g];if(m===void 0&&!rt(h,g))return!0;var E=p[g],v=E&&E[K];if(v?v.t!==m:!Zr(E,m))return!0}}var d=!!h[K];return l.length!==ot(h).length+(d?0:1)}function n(f){var h=f.k;if(h.length!==f.t.length)return!0;var p=Object.getOwnPropertyDescriptor(h,h.length-1);if(p&&!p.get)return!0;for(var l=0;l<h.length;l++)if(!h.hasOwnProperty(l))return!0;return!1}function i(f){f.g&&te(3,JSON.stringify(Ie(f)))}var a={};jo("ES5",{J:function(f,h){var p=Array.isArray(f),l=(function(g,m){if(g){for(var E=Array(m.length),v=0;v<m.length;v++)Object.defineProperty(E,""+v,e(v,!0));return E}var d=cn(m);delete d[K];for(var S=ot(d),T=0;T<S.length;T++){var k=S[T];d[k]=e(k,g||!!d[k].enumerable)}return Object.create(Object.getPrototypeOf(m),d)})(p,f),u={i:p?5:4,A:h?h.A:nr(),P:!1,I:!1,R:{},l:h,t:f,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,K,{value:u,writable:!0}),l},S:function(f,h,p){p?Ae(h)&&h[K].A===f&&t(f.p):(f.u&&(function l(u){if(u&&typeof u=="object"){var g=u[K];if(g){var m=g.t,E=g.k,v=g.R,d=g.i;if(d===4)Xe(E,(function(N){N!==K&&(m[N]!==void 0||rt(m,N)?v[N]||l(E[N]):(v[N]=!0,De(g)))})),Xe(m,(function(N){E[N]!==void 0||rt(E,N)||(v[N]=!1,De(g))}));else if(d===5){if(n(g)&&(De(g),v.length=!0),E.length<m.length)for(var S=E.length;S<m.length;S++)v[S]=!1;else for(var T=m.length;T<E.length;T++)v[T]=!0;for(var k=Math.min(E.length,m.length),P=0;P<k;P++)E.hasOwnProperty(P)||(v[P]=!0),v[P]===void 0&&l(E[P])}}}})(f.p[0]),t(f.p))},K:function(f){return f.i===4?r(f):n(f)}})}var nn,nt,ur=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ko=typeof Map<"u",Ro=typeof Set<"u",on=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",an=ur?Symbol.for("immer-nothing"):((nn={})["immer-nothing"]=!0,nn),sn=ur?Symbol.for("immer-draftable"):"__$immer_draftable",K=ur?Symbol.for("immer-state"):"__$immer_state",No={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Ao=""+Object.prototype.constructor,ot=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,cn=Object.getOwnPropertyDescriptors||function(e){var t={};return ot(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},fr={},pt={get:function(e,t){if(t===K)return e;var r=Ie(e);if(!rt(r,t))return(function(i,a,f){var h,p=tn(a,f);return p?"value"in p?p.value:(h=p.get)===null||h===void 0?void 0:h.call(i.k):void 0})(e,r,t);var n=r[t];return e.I||!je(n)?n:n===sr(e.t,t)?(cr(e),e.o[t]=lr(e.A.h,n,e)):n},has:function(e,t){return t in Ie(e)},ownKeys:function(e){return Reflect.ownKeys(Ie(e))},set:function(e,t,r){var n=tn(Ie(e),t);if(n!=null&&n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=sr(Ie(e),t),a=i==null?void 0:i[K];if(a&&a.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(Zr(r,i)&&(r!==void 0||rt(e.t,t)))return!0;cr(e),De(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return sr(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,cr(e),De(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Ie(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){te(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){te(12)}},vt={};Xe(pt,(function(e,t){vt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),vt.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&te(13),vt.set.call(this,e,t,void 0)},vt.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&te(14),pt.set.call(this,e[0],t,r,e[0])};var Io=(function(){function e(r){var n=this;this.O=on,this.D=!0,this.produce=function(i,a,f){if(typeof i=="function"&&typeof a!="function"){var h=a;a=i;var p=n;return function(d){var S=this;d===void 0&&(d=h);for(var T=arguments.length,k=Array(T>1?T-1:0),P=1;P<T;P++)k[P-1]=arguments[P];return p.produce(d,(function(N){var c;return(c=a).call.apply(c,[S,N].concat(k))}))}}var l;if(typeof a!="function"&&te(6),f!==void 0&&typeof f!="function"&&te(7),je(i)){var u=Qr(n),g=lr(n,i,void 0),m=!0;try{l=a(g),m=!1}finally{m?Pt(u):ir(u)}return typeof Promise<"u"&&l instanceof Promise?l.then((function(d){return or(u,f),ar(d,u)}),(function(d){throw Pt(u),d})):(or(u,f),ar(l,u))}if(!i||typeof i!="object"){if((l=a(i))===void 0&&(l=i),l===an&&(l=void 0),n.D&&tr(l,!0),f){var E=[],v=[];Ee("Patches").M(i,l,E,v),f(E,v)}return l}te(21,i)},this.produceWithPatches=function(i,a){if(typeof i=="function")return function(l){for(var u=arguments.length,g=Array(u>1?u-1:0),m=1;m<u;m++)g[m-1]=arguments[m];return n.produceWithPatches(l,(function(E){return i.apply(void 0,[E].concat(g))}))};var f,h,p=n.produce(i,a,(function(l,u){f=l,h=u}));return typeof Promise<"u"&&p instanceof Promise?p.then((function(l){return[l,f,h]})):[p,f,h]},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var t=e.prototype;return t.createDraft=function(r){je(r)||te(8),Ae(r)&&(r=To(r));var n=Qr(this),i=lr(this,r,void 0);return i[K].C=!0,ir(n),i},t.finishDraft=function(r,n){var i=r&&r[K];process.env.NODE_ENV!=="production"&&(i&&i.C||te(9),i.I&&te(10));var a=i.A;return or(a,n),ar(void 0,a)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!on&&te(20),this.O=r},t.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}i>-1&&(n=n.slice(i+1));var f=Ee("Patches").$;return Ae(r)?f(r,n):this.produce(r,(function(h){return f(h,n)}))},e})(),ue=new Io,ln=ue.produce;ue.produceWithPatches.bind(ue),ue.setAutoFreeze.bind(ue),ue.setUseProxies.bind(ue),ue.applyPatches.bind(ue),ue.createDraft.bind(ue),ue.finishDraft.bind(ue);function yt(e){"@babel/helpers - typeof";return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(e)}function Do(e,t){if(yt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(yt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zo(e){var t=Do(e,"string");return yt(t)=="symbol"?t:t+""}function Wo(e,t,r){return(t=zo(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function un(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?un(Object(r),!0).forEach(function(n){Wo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):un(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ne(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var dn=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),dr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Be={INIT:"@@redux/INIT"+dr(),REPLACE:"@@redux/REPLACE"+dr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+dr()}};function hn(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Lo(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if($o(e))return"date";if(Vo(e))return"error";var r=Yo(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Yo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Vo(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function $o(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ue(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Lo(e)),t}function pn(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ne(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?ne(1):"Expected the enhancer to be a function. Instead, received: '"+Ue(r)+"'");return r(pn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ne(2):"Expected the root reducer to be a function. Instead, received: '"+Ue(e)+"'");var i=e,a=t,f=[],h=f,p=!1;function l(){h===f&&(h=f.slice())}function u(){if(p)throw new Error(process.env.NODE_ENV==="production"?ne(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function g(d){if(typeof d!="function")throw new Error(process.env.NODE_ENV==="production"?ne(4):"Expected the listener to be a function. Instead, received: '"+Ue(d)+"'");if(p)throw new Error(process.env.NODE_ENV==="production"?ne(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var S=!0;return l(),h.push(d),function(){if(S){if(p)throw new Error(process.env.NODE_ENV==="production"?ne(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");S=!1,l();var k=h.indexOf(d);h.splice(k,1),f=null}}}function m(d){if(!hn(d))throw new Error(process.env.NODE_ENV==="production"?ne(7):"Actions must be plain objects. Instead, the actual type was: '"+Ue(d)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof d.type>"u")throw new Error(process.env.NODE_ENV==="production"?ne(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(p)throw new Error(process.env.NODE_ENV==="production"?ne(9):"Reducers may not dispatch actions.");try{p=!0,a=i(a,d)}finally{p=!1}for(var S=f=h,T=0;T<S.length;T++){var k=S[T];k()}return d}function E(d){if(typeof d!="function")throw new Error(process.env.NODE_ENV==="production"?ne(10):"Expected the nextReducer to be a function. Instead, received: '"+Ue(d));i=d,m({type:Be.REPLACE})}function v(){var d,S=g;return d={subscribe:function(k){if(typeof k!="object"||k===null)throw new Error(process.env.NODE_ENV==="production"?ne(11):"Expected the observer to be an object. Instead, received: '"+Ue(k)+"'");function P(){k.next&&k.next(u())}P();var N=S(P);return{unsubscribe:N}}},d[dn]=function(){return this},d}return m({type:Be.INIT}),n={dispatch:m,subscribe:g,getState:u,replaceReducer:E},n[dn]=v,n}function vn(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function Fo(e,t,r,n){var i=Object.keys(t),a=r&&r.type===Be.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(i.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!hn(e))return"The "+a+' has unexpected type of "'+Ue(e)+'". Expected argument to be an object with the following '+('keys: "'+i.join('", "')+'"');var f=Object.keys(e).filter(function(h){return!t.hasOwnProperty(h)&&!n[h]});if(f.forEach(function(h){n[h]=!0}),!(r&&r.type===Be.REPLACE)&&f.length>0)return"Unexpected "+(f.length>1?"keys":"key")+" "+('"'+f.join('", "')+'" found in '+a+". ")+"Expected to find one of the known reducer keys instead: "+('"'+i.join('", "')+'". Unexpected keys will be ignored.')}function Xo(e){Object.keys(e).forEach(function(t){var r=e[t],n=r(void 0,{type:Be.INIT});if(typeof n>"u")throw new Error(process.env.NODE_ENV==="production"?ne(12):'The slice reducer for key "'+t+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:Be.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?ne(13):'The slice reducer for key "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle '"+Be.INIT+`' or other actions in "redux/*" `)+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}function Bo(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var i=t[n];process.env.NODE_ENV!=="production"&&typeof e[i]>"u"&&vn('No reducer provided for key "'+i+'"'),typeof e[i]=="function"&&(r[i]=e[i])}var a=Object.keys(r),f;process.env.NODE_ENV!=="production"&&(f={});var h;try{Xo(r)}catch(p){h=p}return function(l,u){if(l===void 0&&(l={}),h)throw h;if(process.env.NODE_ENV!=="production"){var g=Fo(l,r,u,f);g&&vn(g)}for(var m=!1,E={},v=0;v<a.length;v++){var d=a[v],S=r[d],T=l[d],k=S(T,u);if(typeof k>"u"){var P=u&&u.type;throw new Error(process.env.NODE_ENV==="production"?ne(14):"When called with an action of type "+(P?'"'+String(P)+'"':"(unknown type)")+', the slice reducer for key "'+d+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.')}E[d]=k,m=m||k!==T}return m=m||a.length!==Object.keys(l).length,m?E:l}}function kt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function Uo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),a=function(){throw new Error(process.env.NODE_ENV==="production"?ne(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},f={getState:i.getState,dispatch:function(){return a.apply(void 0,arguments)}},h=t.map(function(p){return p(f)});return a=kt.apply(void 0,h)(i.dispatch),fn(fn({},i),{},{dispatch:a})}}}function yn(e){var t=function(n){var i=n.dispatch,a=n.getState;return function(f){return function(h){return typeof h=="function"?h(i,a,e):f(h)}}};return t}var hr=yn();hr.withExtraArgument=yn;var gn=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),qo=function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,f;return f={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function h(l){return function(u){return p([l,u])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(u){l=[6,u],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},it=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},Ho=Object.defineProperty,Go=Object.defineProperties,Ko=Object.getOwnPropertyDescriptors,mn=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable,bn=function(e,t,r){return t in e?Ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},ze=function(e,t){for(var r in t||(t={}))Jo.call(t,r)&&bn(e,r,t[r]);if(mn)for(var n=0,i=mn(t);n<i.length;n++){var r=i[n];Zo.call(t,r)&&bn(e,r,t[r])}return e},pr=function(e,t){return Go(e,Ko(t))},Qo=function(e,t,r){return new Promise(function(n,i){var a=function(p){try{h(r.next(p))}catch(l){i(l)}},f=function(p){try{h(r.throw(p))}catch(l){i(l)}},h=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(a,f)};h((r=r.apply(e,t)).next())})},ei=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?kt:kt.apply(null,arguments)};function wn(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var r=t;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return t===r}var ti=function(e){return e&&typeof e.match=="function"};function We(e,t){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(t){var a=t.apply(void 0,n);if(!a)throw new Error("prepareAction did not return an object");return ze(ze({type:e,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:e,payload:n[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(n){return n.type===e},r}function ri(e){return typeof e=="function"&&"type"in e&&ti(e)}function ni(e){var t=e?(""+e).split("/"):[],r=t[t.length-1]||"actionCreator";return'Detected an action creator with type "'+(e||"unknown")+`" being dispatched.
92
92
  Make sure you're calling the action creator before dispatching, i.e. \`dispatch(`+r+"())` instead of `dispatch("+r+")`. This is necessary even if the action has no payload."}function oi(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(n){return function(i){return n(i)}}};var t=e.isActionCreator,r=t===void 0?ri:t;return function(){return function(n){return function(i){return r(i)&&console.warn(ni(i.type)),n(i)}}}}function xn(e,t){var r=0;return{measureTime:function(n){var i=Date.now();try{return n()}finally{var a=Date.now();r+=a-i}},warnIfExceeded:function(){r>e&&console.warn(t+" took "+r+"ms, which is more than the warning threshold of "+e+`ms.
93
93
  If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.
94
94
  It is disabled in production builds, so you don't need to worry about that.`)}}}var ii=(function(e){gn(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},t.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(t.bind.apply(t,it([void 0],r[0].concat(this)))):new(t.bind.apply(t,it([void 0],r.concat(this))))},t})(Array),ai=(function(e){gn(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},t.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(t.bind.apply(t,it([void 0],r[0].concat(this)))):new(t.bind.apply(t,it([void 0],r.concat(this))))},t})(Array);function vr(e){return je(e)?ln(e,function(){}):e}var si=process.env.NODE_ENV==="production",En="Invariant failed";function Sn(e,t){if(!e)throw si?new Error(En):new Error(En+": "+(t||""))}function ci(e,t,r,n){return JSON.stringify(e,li(t,n),r)}function li(e,t){var r=[],n=[];return t||(t=function(i,a){return r[0]===a?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(a)).join(".")+"]"}),function(i,a){if(r.length>0){var f=r.indexOf(this);~f?r.splice(f+1):r.push(this),~f?n.splice(f,1/0,i):n.push(i),~r.indexOf(a)&&(a=t.call(this,i,a))}else r.push(a);return e==null?a:e.call(this,i,a)}}function ui(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function fi(e,t,r){var n=Cn(e,t,r);return{detectMutations:function(){return _n(e,t,n,r)}}}function Cn(e,t,r,n,i){t===void 0&&(t=[]),n===void 0&&(n=""),i===void 0&&(i=new Set);var a={value:r};if(!e(r)&&!i.has(r)){i.add(r),a.children={};for(var f in r){var h=n?n+"."+f:f;t.length&&t.indexOf(h)!==-1||(a.children[f]=Cn(e,t,r[f],h))}}return a}function _n(e,t,r,n,i,a){t===void 0&&(t=[]),i===void 0&&(i=!1),a===void 0&&(a="");var f=r?r.value:void 0,h=f===n;if(i&&!h&&!Number.isNaN(n))return{wasMutated:!0,path:a};if(e(f)||e(n))return{wasMutated:!1};var p={};for(var l in r.children)p[l]=!0;for(var l in n)p[l]=!0;var u=t.length>0,g=function(E){var v=a?a+"."+E:E;if(u){var d=t.some(function(T){return T instanceof RegExp?T.test(v):v===T});if(d)return"continue"}var S=_n(e,t,r.children[E],n[E],h,v);if(S.wasMutated)return{value:S}};for(var l in p){var m=g(l);if(typeof m=="object")return m.value}return{wasMutated:!1}}function di(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(p){return function(l){return p(l)}}};var t=e.isImmutable,r=t===void 0?ui:t,n=e.ignoredPaths,i=e.warnAfter,a=i===void 0?32:i,f=e.ignore;n=n||f;var h=fi.bind(null,r,n);return function(p){var l=p.getState,u=l(),g=h(u),m;return function(E){return function(v){var d=xn(a,"ImmutableStateInvariantMiddleware");d.measureTime(function(){u=l(),m=g.detectMutations(),g=h(u),Sn(!m.wasMutated,"A state mutation was detected between dispatches, in the path '"+(m.path||"")+"'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")});var S=E(v);return d.measureTime(function(){u=l(),m=g.detectMutations(),g=h(u),m.wasMutated&&Sn(!m.wasMutated,"A state mutation was detected inside a dispatch, in the path: "+(m.path||"")+". Take a look at the reducer(s) handling the action "+ci(v)+". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")}),d.warnIfExceeded(),S}}}}function On(e){var t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||wn(e)}function yr(e,t,r,n,i,a){t===void 0&&(t=""),r===void 0&&(r=On),i===void 0&&(i=[]);var f;if(!r(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||a!=null&&a.has(e))return!1;for(var h=n!=null?n(e):Object.entries(e),p=i.length>0,l=function(S,T){var k=t?t+"."+S:S;if(p){var P=i.some(function(N){return N instanceof RegExp?N.test(k):k===N});if(P)return"continue"}if(!r(T))return{value:{keyPath:k,value:T}};if(typeof T=="object"&&(f=yr(T,k,r,n,i,a),f))return{value:f}},u=0,g=h;u<g.length;u++){var m=g[u],E=m[0],v=m[1],d=l(E,v);if(typeof d=="object")return d.value}return a&&jn(e)&&a.add(e),!1}function jn(e){if(!Object.isFrozen(e))return!1;for(var t=0,r=Object.values(e);t<r.length;t++){var n=r[t];if(!(typeof n!="object"||n===null)&&!jn(n))return!1}return!0}function hi(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(P){return function(N){return P(N)}}};var t=e.isSerializable,r=t===void 0?On:t,n=e.getEntries,i=e.ignoredActions,a=i===void 0?[]:i,f=e.ignoredActionPaths,h=f===void 0?["meta.arg","meta.baseQueryMeta"]:f,p=e.ignoredPaths,l=p===void 0?[]:p,u=e.warnAfter,g=u===void 0?32:u,m=e.ignoreState,E=m===void 0?!1:m,v=e.ignoreActions,d=v===void 0?!1:v,S=e.disableCache,T=S===void 0?!1:S,k=!T&&WeakSet?new WeakSet:void 0;return function(P){return function(N){return function(c){var R=N(c),j=xn(g,"SerializableStateInvariantMiddleware");return!d&&!(a.length&&a.indexOf(c.type)!==-1)&&j.measureTime(function(){var Y=yr(c,"",r,n,h,k);if(Y){var Z=Y.keyPath,q=Y.value;console.error("A non-serializable value was detected in an action, in the path: `"+Z+"`. Value:",q,`
@@ -96,4 +96,4 @@ Take a look at the logic that dispatched this action: `,c,`
96
96
  (See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)`,`
97
97
  (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),E||(j.measureTime(function(){var Y=P.getState(),Z=yr(Y,"",r,n,l,k);if(Z){var q=Z.keyPath,H=Z.value;console.error("A non-serializable value was detected in the state, in the path: `"+q+"`. Value:",H,`
98
98
  Take a look at the reducer(s) handling this action type: `+c.type+`.
99
- (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),j.warnIfExceeded()),R}}}}function Rt(e){return typeof e=="boolean"}function pi(){return function(t){return vi(t)}}function vi(e){e===void 0&&(e={});var t=e.thunk,r=t===void 0?!0:t,n=e.immutableCheck,i=n===void 0?!0:n,a=e.serializableCheck,f=a===void 0?!0:a,h=e.actionCreatorCheck,p=h===void 0?!0:h,l=new ii;if(r&&(Rt(r)?l.push(hr):l.push(hr.withExtraArgument(r.extraArgument))),process.env.NODE_ENV!=="production"){if(i){var u={};Rt(i)||(u=i),l.unshift(di(u))}if(f){var g={};Rt(f)||(g=f),l.push(hi(g))}if(p){var m={};Rt(p)||(m=p),l.unshift(oi(m))}}return l}var gr=process.env.NODE_ENV==="production";function yi(e){var t=pi(),r=e||{},n=r.reducer,i=n===void 0?void 0:n,a=r.middleware,f=a===void 0?t():a,h=r.devTools,p=h===void 0?!0:h,l=r.preloadedState,u=l===void 0?void 0:l,g=r.enhancers,m=g===void 0?void 0:g,E;if(typeof i=="function")E=i;else if(wn(i))E=Bo(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var v=f;if(typeof v=="function"&&(v=v(t),!gr&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!gr&&v.some(function(N){return typeof N!="function"}))throw new Error("each middleware provided to configureStore must be a function");var d=Uo.apply(void 0,v),S=kt;p&&(S=ei(ze({trace:!gr},typeof p=="object"&&p)));var T=new ai(d),k=T;Array.isArray(m)?k=it([d],m):typeof m=="function"&&(k=m(T));var P=S.apply(void 0,k);return pn(E,u,P)}function Pn(e){var t={},r=[],n,i={addCase:function(a,f){if(process.env.NODE_ENV!=="production"){if(r.length>0)throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");if(n)throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`")}var h=typeof a=="string"?a:a.type;if(!h)throw new Error("`builder.addCase` cannot be called with an empty action type");if(h in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[h]=f,i},addMatcher:function(a,f){if(process.env.NODE_ENV!=="production"&&n)throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return r.push({matcher:a,reducer:f}),i},addDefaultCase:function(a){if(process.env.NODE_ENV!=="production"&&n)throw new Error("`builder.addDefaultCase` can only be called once");return n=a,i}};return e(i),[t,r,n]}function gi(e){return typeof e=="function"}var Tn=!1;function mi(e,t,r,n){r===void 0&&(r=[]),process.env.NODE_ENV!=="production"&&typeof t=="object"&&(Tn||(Tn=!0,console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer")));var i=typeof t=="function"?Pn(t):[t,r,n],a=i[0],f=i[1],h=i[2],p;if(gi(e))p=function(){return vr(e())};else{var l=vr(e);p=function(){return l}}function u(g,m){g===void 0&&(g=p());var E=it([a[m.type]],f.filter(function(v){var d=v.matcher;return d(m)}).map(function(v){var d=v.reducer;return d}));return E.filter(function(v){return!!v}).length===0&&(E=[h]),E.reduce(function(v,d){if(d)if(Ae(v)){var S=v,T=d(S,m);return T===void 0?v:T}else{if(je(v))return ln(v,function(k){return d(k,m)});var T=d(v,m);if(T===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return T}return v},g)}return u.getInitialState=p,u}var Mn=!1;function bi(e,t){return e+"/"+t}function wi(e){var t=e.name;typeof process<"u"&&process.env.NODE_ENV==="development"&&e.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");var r=typeof e.initialState=="function"?e.initialState:vr(e.initialState),n=e.reducers||{},i=Object.keys(n),a={},f={},h={};i.forEach(function(u){var g=n[u],m=bi(t,u),E,v;"reducer"in g?(E=g.reducer,v=g.prepare):E=g,a[u]=E,f[m]=E,h[u]=v?We(m,v):We(m)});function p(){process.env.NODE_ENV!=="production"&&typeof e.extraReducers=="object"&&(Mn||(Mn=!0,console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice")));var u=typeof e.extraReducers=="function"?Pn(e.extraReducers):[e.extraReducers],g=u[0],m=g===void 0?{}:g,E=u[1],v=E===void 0?[]:E,d=u[2],S=d===void 0?void 0:d,T=ze(ze({},m),f);return mi(r,function(k){for(var P in T)k.addCase(P,T[P]);for(var N=0,c=v;N<c.length;N++){var R=c[N];k.addMatcher(R.matcher,R.reducer)}S&&k.addDefaultCase(S)})}var l;return{name:t,reducer:function(u,g){return l||(l=p()),l(u,g)},actions:h,caseReducers:a,getInitialState:function(){return l||(l=p()),l.getInitialState()}}}var xi="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ei=function(e){e===void 0&&(e=21);for(var t="",r=e;r--;)t+=xi[Math.random()*64|0];return t},Si=["name","message","stack","code"],mr=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),kn=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),Ci=function(e){if(typeof e=="object"&&e!==null){for(var t={},r=0,n=Si;r<n.length;r++){var i=n[r];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}};(function(){function e(t,r,n){var i=We(t+"/fulfilled",function(u,g,m,E){return{payload:u,meta:pr(ze({},E||{}),{arg:m,requestId:g,requestStatus:"fulfilled"})}}),a=We(t+"/pending",function(u,g,m){return{payload:void 0,meta:pr(ze({},m||{}),{arg:g,requestId:u,requestStatus:"pending"})}}),f=We(t+"/rejected",function(u,g,m,E,v){return{payload:E,error:(n&&n.serializeError||Ci)(u||"Rejected"),meta:pr(ze({},v||{}),{arg:m,requestId:g,rejectedWithValue:!!E,requestStatus:"rejected",aborted:(u==null?void 0:u.name)==="AbortError",condition:(u==null?void 0:u.name)==="ConditionError"})}}),h=!1,p=typeof AbortController<"u"?AbortController:(function(){function u(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return u.prototype.abort=function(){process.env.NODE_ENV!=="production"&&(h||(h=!0,console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.")))},u})();function l(u){return function(g,m,E){var v=n!=null&&n.idGenerator?n.idGenerator(u):Ei(),d=new p,S;function T(P){S=P,d.abort()}var k=(function(){return Qo(this,null,function(){var P,N,c,R,j,Y,Z;return qo(this,function(q){switch(q.label){case 0:return q.trys.push([0,4,,5]),R=(P=n==null?void 0:n.condition)==null?void 0:P.call(n,u,{getState:m,extra:E}),Oi(R)?[4,R]:[3,2];case 1:R=q.sent(),q.label=2;case 2:if(R===!1||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return j=new Promise(function(H,ae){return d.signal.addEventListener("abort",function(){return ae({name:"AbortError",message:S||"Aborted"})})}),g(a(v,u,(N=n==null?void 0:n.getPendingMeta)==null?void 0:N.call(n,{requestId:v,arg:u},{getState:m,extra:E}))),[4,Promise.race([j,Promise.resolve(r(u,{dispatch:g,getState:m,extra:E,requestId:v,signal:d.signal,abort:T,rejectWithValue:function(H,ae){return new mr(H,ae)},fulfillWithValue:function(H,ae){return new kn(H,ae)}})).then(function(H){if(H instanceof mr)throw H;return H instanceof kn?i(H.payload,v,u,H.meta):i(H,v,u)})])];case 3:return c=q.sent(),[3,5];case 4:return Y=q.sent(),c=Y instanceof mr?f(null,v,u,Y.payload,Y.meta):f(Y,v,u),[3,5];case 5:return Z=n&&!n.dispatchConditionRejection&&f.match(c)&&c.meta.condition,Z||g(c),[2,c]}})})})();return Object.assign(k,{abort:T,requestId:v,arg:u,unwrap:function(){return k.then(_i)}})}}return Object.assign(l,{pending:a,rejected:f,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e})();function _i(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Oi(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var br="listenerMiddleware";We(br+"/add"),We(br+"/removeAll"),We(br+"/remove");var Rn;typeof queueMicrotask=="function"&&queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis),Mo();function ji(e){const t=[],r=new Set;for(const n of e){const i=n==null?void 0:n.id;if(i==null){t.push(n);continue}r.has(i)||(r.add(i),t.push(n))}return t}const wr=wi({name:"whiteboard",initialState:{grid:{size:20,color:"#ccc",enabled:!0},toolbar:{selectedTool:"pointer"},toolProperties:{pencil:{strokeColor:"#000000",lineWidth:4},rectangle:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},circle:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},triangle:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},diamond:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},star:{strokeColor:"#000000",fillColor:"#ffff00",lineWidth:2},heart:{strokeColor:"#000000",fillColor:"#ff6b6b",lineWidth:2},hexagon:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},octagon:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},arrow:{strokeColor:"#000000",fillColor:"#000000",lineWidth:2},text:{fontSize:16,fontColor:"#000000"}},elements:[],selectedElementId:null,viewport:{panX:0,panY:0,zoom:1},watermark:{text:"Nines Studios",url:"https://github.com/huzeyfecoskun",visible:!0},lock:{isLocked:!0,text:"Whiteboard drawing is only for moderator"}},reducers:{toggleGrid(e){e.grid.enabled=!e.grid.enabled},setGridSize(e,t){e.grid.size=t.payload},setGridColor(e,t){e.grid.color=t.payload},setSelectedTool(e,t){e.toolbar.selectedTool=t.payload},setToolProperty(e,t){const{tool:r,property:n,value:i}=t.payload;e.toolProperties[r]&&(e.toolProperties[r][n]=i)},addElement(e,t){const r=t.payload,n=r==null?void 0:r.id;n!=null&&e.elements.some(a=>(a==null?void 0:a.id)===n)||e.elements.push(r)},updateElement(e,t){const{id:r,updates:n}=t.payload,i=e.elements.findIndex(a=>a.id===r);i!==-1&&(e.elements[i]={...e.elements[i],...n})},removeElement(e,t){const r=t.payload;e.elements=e.elements.filter(n=>n.id!==r),e.selectedElementId===r&&(e.selectedElementId=null)},setSelectedElement(e,t){e.selectedElementId=t.payload},clearElements(e){e.elements=[]},setElements(e,t){const r=Array.isArray(t.payload)?t.payload:[];e.elements=ji(r),e.selectedElementId=null},setPan(e,t){e.viewport.panX=t.payload.x,e.viewport.panY=t.payload.y},setZoom(e,t){e.viewport.zoom=Math.max(.1,Math.min(5,t.payload))},resetViewport(e){e.viewport.panX=0,e.viewport.panY=0,e.viewport.zoom=1},bringToFront(e,t){const r=t.payload,n=e.elements.findIndex(i=>i.id===r);if(n!==-1&&n<e.elements.length-1){const[i]=e.elements.splice(n,1);e.elements.push(i)}},sendToBack(e,t){const r=t.payload,n=e.elements.findIndex(i=>i.id===r);if(n>0){const[i]=e.elements.splice(n,1);e.elements.unshift(i)}},fitToView(e,t){const{canvasWidth:r,canvasHeight:n,padding:i=50}=t.payload,a=e.elements;if(a.length===0){e.viewport.panX=0,e.viewport.panY=0,e.viewport.zoom=1;return}let f=1/0,h=1/0,p=-1/0,l=-1/0;a.forEach(c=>{c.type==="rectangle"?(f=Math.min(f,c.x),h=Math.min(h,c.y),p=Math.max(p,c.x+c.width),l=Math.max(l,c.y+c.height)):c.type==="circle"?(f=Math.min(f,c.centerX-c.radius),h=Math.min(h,c.centerY-c.radius),p=Math.max(p,c.centerX+c.radius),l=Math.max(l,c.centerY+c.radius)):c.type==="pencil"&&c.points.length>0?c.points.forEach(R=>{f=Math.min(f,R.x),h=Math.min(h,R.y),p=Math.max(p,R.x),l=Math.max(l,R.y)}):c.type==="triangle"||c.type==="diamond"||c.type==="hexagon"||c.type==="octagon"?(f=Math.min(f,c.x),h=Math.min(h,c.y),p=Math.max(p,c.x+c.width),l=Math.max(l,c.y+c.height)):c.type==="star"||c.type==="heart"?(f=Math.min(f,c.centerX-c.size),h=Math.min(h,c.centerY-c.size),p=Math.max(p,c.centerX+c.size),l=Math.max(l,c.centerY+c.size)):c.type==="arrow"&&(f=Math.min(f,c.startX,c.endX),h=Math.min(h,c.startY,c.endY),p=Math.max(p,c.startX,c.endX),l=Math.max(l,c.startY,c.endY))});const u=p-f,g=l-h;if(u<=0||g<=0)return;const m=r-i*2,E=n-i*2,v=m/u,d=E/g,S=Math.min(v,d,5),T=(f+p)/2,k=(h+l)/2,P=r/2-T*S,N=n/2-k*S;e.viewport.zoom=Math.max(.1,S),e.viewport.panX=P,e.viewport.panY=N},setLocked(e,t){e.lock.isLocked=t.payload,t.payload&&(e.toolbar.selectedTool="pointer",e.selectedElementId=null)},setWatermarkEnabled(e,t){e.watermark.visible=t.payload},setWatermarkText(e,t){e.watermark.text=t.payload}}}),{toggleGrid:_a,setGridSize:Oa,setGridColor:ja,setSelectedTool:Pe,setToolProperty:Pi,addElement:ve,updateElement:gt,removeElement:Ti,setSelectedElement:mt,clearElements:Nn,setElements:An,setPan:Mi,setZoom:ki,resetViewport:Pa,fitToView:Ri,bringToFront:Ni,sendToBack:Ai,setLocked:In,setWatermarkEnabled:Ii,setWatermarkText:Di}=wr.actions,zi=wr.actions,Dn=wr.reducer;let xr=null;const Wi=new Set(["rectangle","circle","pencil","triangle","diamond","star","heart","hexagon","octagon","arrow","text"]),Li=new Set(["strokeColor","fillColor","lineWidth","fontSize","fontColor","textColor"]),Yi=e=>{var t,r;if(!e||typeof e.type!="string"||e.type.startsWith("@@redux/"))return!1;if(e.type==="whiteboard/addElement"){const n=(t=e==null?void 0:e.payload)==null?void 0:t.type;return typeof n=="string"&&Wi.has(n)}if(e.type==="whiteboard/removeElement"||e.type==="whiteboard/clearElements"||e.type==="whiteboard/bringToFront"||e.type==="whiteboard/sendToBack")return!0;if(e.type==="whiteboard/setToolProperty"){const{tool:n,property:i}=(e==null?void 0:e.payload)??{};return typeof n!="string"||typeof i!="string"?!1:Li.has(i)}if(e.type==="whiteboard/updateElement"){const n=(r=e==null?void 0:e.payload)==null?void 0:r.updates;if(!n||typeof n!="object")return!1;const i=a=>Object.prototype.hasOwnProperty.call(n,a);return!!(i("text")||i("fontSize")||i("fontColor")||i("textColor")||i("strokeColor")||i("fillColor")||i("lineWidth")||i("x")||i("y")||i("centerX")||i("centerY")||i("startX")||i("startY")||i("endX")||i("endY")||i("points"))}return!1},Vi=e=>{xr=e},$i=e=>t=>r=>{var i;const n=t(r);return!((i=r.meta)!=null&&i.fromRemote)&&xr&&Yi(r)&&xr(r),n},zn=yi({reducer:{whiteboard:Dn},middleware:e=>e().concat($i)}),Fi=()=>{const e=oe(t=>t.whiteboard.watermark);return w.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:w.jsx("div",{className:"wb-watermark",children:e.text})})};var Wn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ln=M.createContext&&M.createContext(Wn),Xi=["attr","size","title"];function Bi(e,t){if(e==null)return{};var r=Ui(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ui(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Nt(){return Nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nt.apply(this,arguments)}function Yn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function At(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yn(Object(r),!0).forEach(function(n){qi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qi(e,t,r){return t=Hi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hi(e){var t=Gi(e,"string");return typeof t=="symbol"?t:t+""}function Gi(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vn(e){return e&&e.map((t,r)=>M.createElement(t.tag,At({key:r},t.attr),Vn(t.child)))}function Q(e){return t=>M.createElement(Ki,Nt({attr:At({},e.attr)},t),Vn(e.child))}function Ki(e){var t=r=>{var{attr:n,size:i,title:a}=e,f=Bi(e,Xi),h=i||r.size||"1em",p;return r.className&&(p=r.className),e.className&&(p=(p?p+" ":"")+e.className),M.createElement("svg",Nt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,f,{className:p,style:At(At({color:e.color||r.color},r.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),a&&M.createElement("title",null,a),e.children)};return Ln!==void 0?M.createElement(Ln.Consumer,null,r=>t(r)):t(Wn)}function Ji(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"},child:[]}]})(e)}function Zi(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"},child:[]}]})(e)}function Qi(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"},child:[]}]})(e)}function ea(e){return Q({attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"},child:[]}]})(e)}function ta(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"},child:[]}]})(e)}function ra(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"},child:[]}]})(e)}function na(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"},child:[]}]})(e)}function oa(e){return Q({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"},child:[]}]})(e)}function ia(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"},child:[]}]})(e)}function aa(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"},child:[]}]})(e)}function sa(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"},child:[]}]})(e)}function ca(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}function la(e){return Q({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const ua=({text:e})=>w.jsxs("div",{style:{position:"absolute",top:"10px",left:"10px",backgroundColor:"rgba(255, 68, 68, 0.9)",color:"white",padding:"8px 16px",borderRadius:"4px",display:"flex",alignItems:"center",gap:"8px",boxShadow:"0 2px 4px rgba(0,0,0,0.2)",zIndex:1e3,pointerEvents:"none",userSelect:"none",fontFamily:"sans-serif",fontSize:"14px",fontWeight:"500"},children:[w.jsx(na,{}),w.jsx("span",{children:e||"Locked"})]});function fa(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"},child:[]}]})(e)}function da(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M284.3 11.7c-15.6-15.6-40.9-15.6-56.6 0l-216 216c-15.6 15.6-15.6 40.9 0 56.6l216 216c15.6 15.6 40.9 15.6 56.6 0l216-216c15.6-15.6 15.6-40.9 0-56.6l-216-216z"},child:[]}]})(e)}function ha(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"},child:[]}]})(e)}function pa(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"},child:[]}]})(e)}function va(e){return Q({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l128 0 0 352c0 17.7 14.3 32 32 32s32-14.3 32-32l0-352 128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 32 32 32z"},child:[]}]})(e)}function ya(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 144c0-44.2 35.8-80 80-80c31.9 0 59.4 18.6 72.3 45.7c7.6 16 26.7 22.8 42.6 15.2s22.8-26.7 15.2-42.6C331 33.7 281.5 0 224 0C144.5 0 80 64.5 80 144l0 48-16 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-240 0 0-48z"},child:[]}]})(e)}function ga(e){return Q({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8.5.134a1 1 0 0 0-1 0l-6 3.577a1 1 0 0 0-.5.866v6.846a1 1 0 0 0 .5.866l6 3.577a1 1 0 0 0 1 0l6-3.577a1 1 0 0 0 .5-.866V4.577a1 1 0 0 0-.5-.866z"},child:[]}]})(e)}function ma(e){return Q({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.107 0a.5.5 0 0 1 .353.146l4.394 4.394a.5.5 0 0 1 .146.353v6.214a.5.5 0 0 1-.146.353l-4.394 4.394a.5.5 0 0 1-.353.146H4.893a.5.5 0 0 1-.353-.146L.146 11.46A.5.5 0 0 1 0 11.107V4.893a.5.5 0 0 1 .146-.353L4.54.146A.5.5 0 0 1 4.893 0z"},child:[]}]})(e)}const ba=({onExport:e,onFitToView:t,mode:r})=>{const n=Jt(),{t:i,language:a,changeLanguage:f}=Kr(),h=oe(R=>R.whiteboard.toolbar.selectedTool),p=oe(R=>R.whiteboard.lock.isLocked),[l,u]=M.useState(!1),[g,m]=M.useState(!1),E=M.useRef(null),v=M.useRef(null),d=M.useRef(null),S=M.useRef(null),T=M.useRef(null),k=R=>{const j=R.target.files[0];if(!j)return;const Y=new FileReader;Y.onload=Z=>{const q=new Image;q.onload=()=>{const H=Date.now().toString();n(ve({id:H,type:"image",x:100,y:100,width:q.width,height:q.height,src:Z.target.result})),n(Pe("pointer")),n(mt(H))},q.src=Z.target.result},Y.readAsDataURL(j),R.target.value=""};M.useEffect(()=>{const R=j=>{E.current&&!E.current.contains(j.target)&&v.current&&!v.current.contains(j.target)&&u(!1),S.current&&!S.current.contains(j.target)&&d.current&&!d.current.contains(j.target)&&m(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);const P=[{name:"triangle",icon:w.jsx(aa,{style:{transform:"rotate(-30deg)"}})},{name:"diamond",icon:w.jsx(da,{})},{name:"star",icon:w.jsx(la,{})},{name:"heart",icon:w.jsx(ta,{})},{name:"hexagon",icon:w.jsx(ga,{})},{name:"octagon",icon:w.jsx(ma,{})},{name:"arrow",icon:w.jsx(fa,{})}],N=R=>{n(Pe(R)),u(!1)},c=R=>{f(R),m(!1)};return w.jsxs("div",{className:"wb-toolbar",children:[w.jsx("button",{className:h==="pointer"?"wb-active":"",onClick:()=>n(Pe("pointer")),title:i("pointer"),disabled:p,children:w.jsx(oa,{})}),w.jsx("button",{className:h==="text"?"wb-active":"",onClick:()=>n(Pe("text")),title:i("text"),disabled:p,children:w.jsx(va,{})}),w.jsx("button",{onClick:()=>{var R;return(R=T.current)==null?void 0:R.click()},title:i("image"),disabled:p,children:w.jsx(ra,{})}),w.jsx("input",{type:"file",ref:T,style:{display:"none"},accept:"image/*",onChange:k}),w.jsx("button",{className:h==="pencil"?"wb-active":"",onClick:()=>n(Pe("pencil")),title:i("pencil"),disabled:p,children:w.jsx(ia,{})}),w.jsx("button",{className:h==="rectangle"?"wb-active":"",onClick:()=>n(Pe("rectangle")),title:i("rectangle"),disabled:p,children:w.jsx(ca,{})}),w.jsx("button",{className:h==="circle"?"wb-active":"",onClick:()=>n(Pe("circle")),title:i("circle"),disabled:p,children:w.jsx(Ji,{})}),w.jsxs("div",{className:"wb-ellipsis-container",children:[w.jsx("button",{ref:v,className:P.some(R=>R.name===h)?"wb-active":"",onClick:()=>u(!l),title:i("moreShapes"),disabled:p,children:w.jsx(ha,{})}),l&&w.jsxs("div",{className:"wb-shapes-popup",ref:E,children:[w.jsx("div",{className:"wb-shapes-popup-header",children:i("moreShapes")}),w.jsx("div",{className:"wb-shapes-popup-grid",children:P.map(R=>w.jsx("button",{className:h===R.name?"wb-active":"",onClick:()=>N(R.name),title:i(R.name),children:R.icon},R.name))})]})]}),w.jsx("button",{className:h==="eraser"?"wb-active":"",onClick:()=>n(Pe("eraser")),title:i("eraser"),disabled:p,children:w.jsx(Zi,{})}),w.jsx("button",{onClick:t,title:i("fitToView"),children:w.jsx(Qi,{})}),w.jsx("button",{onClick:e,title:i("exportAsPng"),children:w.jsx(sa,{})}),w.jsxs("div",{className:"wb-language-container",children:[w.jsx("button",{ref:d,onClick:()=>m(!g),title:i("language"),children:w.jsx(ea,{})}),g&&w.jsxs("div",{className:"wb-language-popup",ref:S,children:[w.jsx("div",{className:"wb-language-popup-header",children:i("language")}),w.jsxs("div",{className:"wb-language-options",children:[w.jsxs("button",{className:a==="en"?"wb-active":"",onClick:()=>c("en"),children:["πŸ‡ΊπŸ‡Έ ",i("english")]}),w.jsxs("button",{className:a==="tr"?"wb-active":"",onClick:()=>c("tr"),children:["πŸ‡ΉπŸ‡· ",i("turkish")]})]})]})]}),r==="moderator"&&w.jsx("button",{onClick:()=>n(In(!p)),title:p?"Unlock":"Lock",style:{color:p?"red":"inherit"},children:p?w.jsx(pa,{}):w.jsx(ya,{})})]})},wa=()=>{const e=Jt(),{t}=Kr(),r=oe(g=>g.whiteboard.toolbar.selectedTool),n=oe(g=>g.whiteboard.toolProperties),i=oe(g=>g.whiteboard.selectedElementId),a=oe(g=>g.whiteboard.elements),f=i?a.find(g=>g.id===i):null,h=(g,m,E)=>{e(Pi({tool:g,property:m,value:E}))},p=(g,m)=>{i&&e(gt({id:i,updates:{[g]:m}}))},l=()=>{i&&e(Ni(i))},u=()=>{i&&e(Ai(i))};if(r==="pointer"&&f&&f.type==="text")return w.jsxs("div",{className:"wb-prop-tools",children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fontSize")}),w.jsxs("select",{className:"font-size-selector",value:f.fontSize||16,onChange:g=>p("fontSize",parseInt(g.target.value)),children:[w.jsx("option",{value:"12",children:"12 px"}),w.jsx("option",{value:"14",children:"14 px"}),w.jsx("option",{value:"16",children:"16 px"}),w.jsx("option",{value:"18",children:"18 px"}),w.jsx("option",{value:"24",children:"24 px"}),w.jsx("option",{value:"32",children:"32 px"}),w.jsx("option",{value:"48",children:"48 px"}),w.jsx("option",{value:"64",children:"64 px"}),w.jsx("option",{value:"72",children:"72 px"})]})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fontColor")}),w.jsx("input",{type:"color",value:f.fontColor||"#000000",onChange:g=>p("fontColor",g.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("layerOrder")}),w.jsxs("div",{className:"wb-layer-buttons",children:[w.jsx("button",{onClick:l,title:t("bringToFront"),children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"white"})]})}),w.jsx("button",{onClick:u,title:t("sendToBack"),children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"white"})]})})]})]})]});if(r==="pointer"&&f){const g=["rectangle","circle","triangle","diamond","star","heart","hexagon","octagon","arrow"].includes(f.type),m=f.type==="pencil";return w.jsxs("div",{className:"wb-prop-tools",children:[g&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("strokeColor")}),w.jsx("input",{type:"color",value:f.strokeColor,onChange:E=>p("strokeColor",E.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fillColor")}),w.jsx("input",{type:"color",value:f.fillColor,onChange:E=>p("fillColor",E.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("strokeWidth")}),w.jsxs("select",{className:"stroke-width-selector",value:f.lineWidth,onChange:E=>p("lineWidth",parseInt(E.target.value)),children:[w.jsx("option",{value:"1",children:"1 px"}),w.jsx("option",{value:"2",children:"2 px"}),w.jsx("option",{value:"4",children:"4 px"}),w.jsx("option",{value:"8",children:"8 px"})]})]})]}),m&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("brushColor")}),w.jsx("input",{type:"color",value:f.strokeColor,onChange:E=>p("strokeColor",E.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("brushSize")}),w.jsxs("select",{className:"brush-size-selector",value:f.lineWidth,onChange:E=>p("lineWidth",parseInt(E.target.value)),children:[w.jsx("option",{value:"1",children:"1 px"}),w.jsx("option",{value:"2",children:"2 px"}),w.jsx("option",{value:"4",children:"4 px"}),w.jsx("option",{value:"8",children:"8 px"}),w.jsx("option",{value:"16",children:"16 px"})]})]})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("layerOrder")}),w.jsxs("div",{className:"wb-layer-buttons",children:[w.jsx("button",{onClick:l,title:t("bringToFront"),children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"white"})]})}),w.jsx("button",{onClick:u,title:t("sendToBack"),children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"white"})]})})]})]})]})}return w.jsxs("div",{className:"wb-prop-tools",children:[r==="text"&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fontSize")}),w.jsxs("select",{className:"font-size-selector",value:n.text.fontSize,onChange:g=>h("text","fontSize",parseInt(g.target.value)),children:[w.jsx("option",{value:"12",children:"12 px"}),w.jsx("option",{value:"14",children:"14 px"}),w.jsx("option",{value:"16",children:"16 px"}),w.jsx("option",{value:"18",children:"18 px"}),w.jsx("option",{value:"24",children:"24 px"}),w.jsx("option",{value:"32",children:"32 px"}),w.jsx("option",{value:"48",children:"48 px"}),w.jsx("option",{value:"64",children:"64 px"}),w.jsx("option",{value:"72",children:"72 px"})]})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fontColor")}),w.jsx("input",{type:"color",value:n.text.fontColor,onChange:g=>h("text","fontColor",g.target.value)})]})]}),r==="pencil"&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("brushColor")}),w.jsx("input",{type:"color",value:n.pencil.strokeColor,onChange:g=>h("pencil","strokeColor",g.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("brushSize")}),w.jsxs("select",{className:"brush-size-selector",value:n.pencil.lineWidth,onChange:g=>h("pencil","lineWidth",parseInt(g.target.value)),children:[w.jsx("option",{value:"1",children:"1 px"}),w.jsx("option",{value:"2",children:"2 px"}),w.jsx("option",{value:"4",children:"4 px"}),w.jsx("option",{value:"8",children:"8 px"}),w.jsx("option",{value:"16",children:"16 px"})]})]})]}),(r==="rectangle"||r==="circle"||r==="triangle"||r==="diamond"||r==="star"||r==="heart"||r==="hexagon"||r==="octagon"||r==="arrow")&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("strokeColor")}),w.jsx("input",{type:"color",value:n[r].strokeColor,onChange:g=>h(r,"strokeColor",g.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fillColor")}),w.jsx("input",{type:"color",value:n[r].fillColor,onChange:g=>h(r,"fillColor",g.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("strokeWidth")}),w.jsxs("select",{className:"stroke-width-selector",value:n[r].lineWidth,onChange:g=>h(r,"lineWidth",parseInt(g.target.value)),children:[w.jsx("option",{value:"1",children:"1 px"}),w.jsx("option",{value:"2",children:"2 px"}),w.jsx("option",{value:"4",children:"4 px"}),w.jsx("option",{value:"8",children:"8 px"})]})]})]})]})},$n=M.forwardRef(({onAction:e,watermark:t,isLocked:r,lockText:n,onLockChange:i,isWatermarkEnabled:a,watermarkText:f,mode:h},p)=>{var Vt;const l=M.useRef(null),u=Jt(),g=oe(s=>s.whiteboard.grid),m=oe(s=>s.whiteboard.toolbar.selectedTool),E=oe(s=>s.whiteboard.elements),v=oe(s=>s.whiteboard.viewport),d=oe(s=>s.whiteboard.toolProperties),S=oe(s=>s.whiteboard.selectedElementId),T=oe(s=>s.whiteboard.lock),k=T.isLocked,[P,N]=M.useState(!1),[c,R]=M.useState({x:0,y:0}),[j,Y]=M.useState({x:0,y:0}),[Z,q]=M.useState([]),[H,ae]=M.useState(!1),[G,ee]=M.useState({x:0,y:0}),[fe,Te]=M.useState(!1),[Se,ye]=M.useState(!1),[be,we]=M.useState(!1),[Me,Le]=M.useState({x:0,y:0}),[ke,qe]=M.useState({y:0,initialZoom:1}),[Ye,ge]=M.useState(!1),[Ce,_e]=M.useState({x:0,y:0}),[ie,se]=M.useState(""),[ce,D]=M.useState(null),le=M.useRef(null),z=M.useRef(null),de=M.useCallback(s=>{ce&&s.trim()&&(le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{ce&&s!==z.current&&(z.current=s,u(gt({id:ce,updates:{text:s}})))},150))},[u,ce]);M.useEffect(()=>()=>{le.current&&clearTimeout(le.current)},[]),M.useEffect(()=>{e&&Vi(e)},[e]),M.useImperativeHandle(p,()=>({canvas:l.current,applyAction:s=>{u({...s,meta:{...s.meta,fromRemote:!0}})},getElems:()=>E,getElements:()=>E,setElems:s=>{u({...An(s),meta:{fromRemote:!0}})},setElements:s=>{u({...An(s),meta:{fromRemote:!0}})},clearElems:()=>{u({...Nn(),meta:{fromRemote:!0}})},clearElements:()=>{u({...Nn(),meta:{fromRemote:!0}})}})),M.useEffect(()=>{r!==void 0&&r!==k&&u(In(r))},[r,k,u]),M.useEffect(()=>{i&&i(k)},[k,i]);const he=oe(s=>s.whiteboard.watermark);M.useEffect(()=>{a!==void 0&&a!==he.visible&&u(Ii(a))},[a,he.visible,u]),M.useEffect(()=>{f!==void 0&&f!==he.text&&u(Di(f))},[f,he.text,u]);const Ve=M.useCallback((s,b,C)=>{const o=s.canvas,y=o.width,x=o.height,O=Math.floor(-v.panX/v.zoom/b)*b,_=Math.floor(-v.panY/v.zoom/b)*b,A=Math.ceil((y/v.zoom-v.panX/v.zoom)/b)*b,W=Math.ceil((x/v.zoom-v.panY/v.zoom)/b)*b;s.strokeStyle=C,s.lineWidth=.5/v.zoom;for(let I=O;I<=A;I+=b)s.beginPath(),s.moveTo(I,_),s.lineTo(I,W),s.stroke();for(let I=_;I<=W;I+=b)s.beginPath(),s.moveTo(O,I),s.lineTo(A,I),s.stroke()},[v]),He=M.useCallback((s,b,C)=>{const o=Math.min(b.x,C.x),y=Math.min(b.y,C.y),x=Math.abs(C.x-b.x),O=Math.abs(C.y-b.y);s.strokeStyle="#0066cc",s.lineWidth=1,s.setLineDash([5,5]),s.strokeRect(o,y,x,O),s.fillStyle="rgba(0, 102, 204, 0.1)",s.fillRect(o,y,x,O),s.setLineDash([])},[]),at=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#000",strokeColor:_="#000",lineWidth:A=2}=b;s.fillStyle=O,s.fillRect(C,o,y,x),s.strokeStyle=_,s.lineWidth=A,s.strokeRect(C,o,y,x)},[]),Ge=M.useCallback((s,b)=>{const{centerX:C,centerY:o,radius:y,fillColor:x="#000",strokeColor:O="#000",lineWidth:_=2}=b;s.beginPath(),s.arc(C,o,y,0,Math.PI*2),s.fillStyle=x,s.fill(),s.strokeStyle=O,s.lineWidth=_,s.stroke()},[]),$e=M.useCallback((s,b)=>{const{points:C,strokeColor:o="#000",lineWidth:y=2}=b;if(!(C.length<2)){s.strokeStyle=o,s.lineWidth=y,s.lineCap="round",s.lineJoin="round",s.beginPath(),s.moveTo(C[0].x,C[0].y);for(let x=1;x<C.length;x++)s.lineTo(C[x].x,C[x].y);s.stroke()}},[]),It=M.useCallback((s,b)=>{const{x:C,y:o,text:y,fontSize:x=16,fontColor:O="#000"}=b;s.font=`${x}px sans-serif`,s.fillStyle=O,s.textBaseline="top",s.fillText(y,C,o)},[]),Ke=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#fff",strokeColor:_="#000",lineWidth:A=2}=b;s.beginPath(),s.moveTo(C+y/2,o),s.lineTo(C+y,o+x),s.lineTo(C,o+x),s.closePath(),s.fillStyle=O,s.fill(),s.strokeStyle=_,s.lineWidth=A,s.stroke()},[]),Je=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#fff",strokeColor:_="#000",lineWidth:A=2}=b;s.beginPath(),s.moveTo(C+y/2,o),s.lineTo(C+y,o+x/2),s.lineTo(C+y/2,o+x),s.lineTo(C,o+x/2),s.closePath(),s.fillStyle=O,s.fill(),s.strokeStyle=_,s.lineWidth=A,s.stroke()},[]),st=M.useCallback((s,b)=>{const{centerX:C,centerY:o,size:y,fillColor:x="#ffff00",strokeColor:O="#000",lineWidth:_=2}=b,A=5,W=y,I=y/2;s.beginPath();for(let U=0;U<A*2;U++){const V=U%2===0?W:I,L=Math.PI/A*U-Math.PI/2,J=C+Math.cos(L)*V,re=o+Math.sin(L)*V;U===0?s.moveTo(J,re):s.lineTo(J,re)}s.closePath(),s.fillStyle=x,s.fill(),s.strokeStyle=O,s.lineWidth=_,s.stroke()},[]),ct=M.useCallback((s,b)=>{const{centerX:C,centerY:o,size:y,fillColor:x="#ff6b6b",strokeColor:O="#000",lineWidth:_=2}=b;s.beginPath();const A=o-y/2;s.moveTo(C,A+y/4),s.bezierCurveTo(C-y/2,A,C-y,A+y/2,C,o+y/2),s.bezierCurveTo(C+y,A+y/2,C+y/2,A,C,A+y/4),s.fillStyle=x,s.fill(),s.strokeStyle=O,s.lineWidth=_,s.stroke()},[]),lt=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#fff",strokeColor:_="#000",lineWidth:A=2}=b,W=C+y/2,I=o+x/2,U=y/2,V=x/2;s.beginPath();for(let L=0;L<6;L++){const J=Math.PI/3*L-Math.PI/2,re=W+Math.cos(J)*U,xe=I+Math.sin(J)*V;L===0?s.moveTo(re,xe):s.lineTo(re,xe)}s.closePath(),s.fillStyle=O,s.fill(),s.strokeStyle=_,s.lineWidth=A,s.stroke()},[]),ut=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#fff",strokeColor:_="#000",lineWidth:A=2}=b,W=C+y/2,I=o+x/2,U=y/2,V=x/2;s.beginPath();for(let L=0;L<8;L++){const J=Math.PI/4*L-Math.PI/2,re=W+Math.cos(J)*U,xe=I+Math.sin(J)*V;L===0?s.moveTo(re,xe):s.lineTo(re,xe)}s.closePath(),s.fillStyle=O,s.fill(),s.strokeStyle=_,s.lineWidth=A,s.stroke()},[]),ft=M.useCallback((s,b)=>{const{startX:C,startY:o,endX:y,endY:x,fillColor:O="#000",strokeColor:_="#000",lineWidth:A=2}=b,W=15,I=Math.atan2(x-o,y-C);s.beginPath(),s.moveTo(C,o),s.lineTo(y,x),s.strokeStyle=_,s.lineWidth=A,s.stroke(),s.beginPath(),s.moveTo(y,x),s.lineTo(y-W*Math.cos(I-Math.PI/6),x-W*Math.sin(I-Math.PI/6)),s.lineTo(y-W*Math.cos(I+Math.PI/6),x-W*Math.sin(I+Math.PI/6)),s.closePath(),s.fillStyle=O,s.fill()},[]),dt=M.useRef({}),bt=M.useRef(null),ht=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,src:O}=b;if(dt.current[O]){const _=dt.current[O];_.complete&&s.drawImage(_,C,o,y,x)}else{const _=new Image;_.onload=()=>{dt.current[O]=_,bt.current&&bt.current()},_.src=O,dt.current[O]=_}},[]),Ze=M.useCallback((s,b)=>{switch(b.type){case"rectangle":at(s,b);break;case"circle":Ge(s,b);break;case"pencil":$e(s,b);break;case"text":It(s,b);break;case"triangle":Ke(s,b);break;case"diamond":Je(s,b);break;case"star":st(s,b);break;case"heart":ct(s,b);break;case"hexagon":lt(s,b);break;case"octagon":ut(s,b);break;case"arrow":ft(s,b);break;case"image":ht(s,b);break}},[at,Ge,$e,It,Ke,Je,st,ct,lt,ut,ft,ht]),Fe=M.useCallback(()=>{const s=l.current;if(!s)return;const b=document.createElement("canvas");b.width=s.width,b.height=s.height;const C=b.getContext("2d");C.fillStyle="#ffffff",C.fillRect(0,0,b.width,b.height),C.save(),C.translate(v.panX,v.panY),C.scale(v.zoom,v.zoom),E.forEach(x=>{Ze(C,x)}),C.restore();const o=b.toDataURL("image/png"),y=document.createElement("a");y.download=`whiteboard-${Date.now()}.png`,y.href=o,y.click()},[v,E,Ze]),wt=M.useCallback(()=>{const s=l.current;s&&u(Ri({canvasWidth:s.width,canvasHeight:s.height,padding:50}))},[u]),Qe=M.useCallback((s,b)=>{for(let C=E.length-1;C>=0;C--){const o=E[C];if(o.type==="rectangle"){if(s>=o.x&&s<=o.x+o.width&&b>=o.y&&b<=o.y+o.height)return o}else if(o.type==="circle"){if(Math.sqrt(Math.pow(s-o.centerX,2)+Math.pow(b-o.centerY,2))<=o.radius)return o}else if(o.type==="pencil")for(let x=1;x<o.points.length;x++){const O=o.points[x-1],_=o.points[x];if(xt(s,b,O.x,O.y,_.x,_.y)<=5)return o}else if(o.type==="text"){const y=o.fontSize||16,x=o.text.length*y*.6,O=y;if(s>=o.x&&s<=o.x+x&&b>=o.y&&b<=o.y+O)return o}else if(o.type==="triangle"||o.type==="diamond"||o.type==="hexagon"||o.type==="octagon"){if(s>=o.x&&s<=o.x+o.width&&b>=o.y&&b<=o.y+o.height)return o}else if(o.type==="star"||o.type==="heart"){if(Math.sqrt(Math.pow(s-o.centerX,2)+Math.pow(b-o.centerY,2))<=o.size)return o}else if(o.type==="arrow"){if(xt(s,b,o.startX,o.startY,o.endX,o.endY)<=10)return o}else if(o.type==="image"&&s>=o.x&&s<=o.x+o.width&&b>=o.y&&b<=o.y+o.height)return o}return null},[E]),xt=(s,b,C,o,y,x)=>{const O=s-C,_=b-o,A=y-C,W=x-o,I=O*A+_*W,U=A*A+W*W;let V=-1;U!==0&&(V=I/U);let L,J;V<0?(L=C,J=o):V>1?(L=y,J=x):(L=C+V*A,J=o+V*W);const re=s-L,xe=b-J;return Math.sqrt(re*re+xe*xe)},Dt=M.useCallback((s,b)=>{if(s.strokeStyle="#0066cc",s.lineWidth=2,s.setLineDash([5,5]),b.type==="rectangle")s.strokeRect(b.x-4,b.y-4,b.width+8,b.height+8);else if(b.type==="circle")s.beginPath(),s.arc(b.centerX,b.centerY,b.radius+4,0,Math.PI*2),s.stroke();else if(b.type==="pencil"&&b.points.length>0){const C=Math.min(...b.points.map(O=>O.x)),o=Math.max(...b.points.map(O=>O.x)),y=Math.min(...b.points.map(O=>O.y)),x=Math.max(...b.points.map(O=>O.y));s.strokeRect(C-4,y-4,o-C+8,x-y+8)}else if(b.type==="text"){const C=b.fontSize||16,o=b.text.length*C*.6,y=C;s.strokeRect(b.x-4,b.y-4,o+8,y+8)}else if(b.type==="triangle"||b.type==="diamond"||b.type==="hexagon"||b.type==="octagon")s.strokeRect(b.x-4,b.y-4,b.width+8,b.height+8);else if(b.type==="star"||b.type==="heart")s.beginPath(),s.arc(b.centerX,b.centerY,b.size+4,0,Math.PI*2),s.stroke();else if(b.type==="arrow"){const C=Math.min(b.startX,b.endX),o=Math.max(b.startX,b.endX),y=Math.min(b.startY,b.endY),x=Math.max(b.startY,b.endY);s.strokeRect(C-4,y-4,o-C+8,x-y+8)}else b.type==="image"&&s.strokeRect(b.x-4,b.y-4,b.width+8,b.height+8);s.setLineDash([])},[]),me=M.useCallback(()=>{const s=l.current;if(!s)return;const b=s.getContext("2d");b.clearRect(0,0,s.width,s.height),b.save(),b.translate(v.panX,v.panY),b.scale(v.zoom,v.zoom),g.enabled&&Ve(b,g.size,g.color),E.forEach(C=>{Ze(b,C),C.id===S&&Dt(b,C)}),b.restore()},[g,Ve,E,Ze,S,Dt,v]);M.useEffect(()=>{bt.current=me},[me]),M.useEffect(()=>{const s=l.current;if(!s)return;const b=s.parentElement;if(!b)return;const C=()=>{const y=b.getBoundingClientRect();s.width=y.width,s.height=y.height,me()};C();const o=new ResizeObserver(()=>{C()});return o.observe(b),()=>{o.disconnect()}},[me]),M.useEffect(()=>{me()},[me]),M.useEffect(()=>{const s=C=>{C.target.tagName==="INPUT"||C.target.tagName==="TEXTAREA"||C.code==="Space"&&!C.repeat&&(C.preventDefault(),Te(!0))},b=C=>{C.target.tagName==="INPUT"||C.target.tagName==="TEXTAREA"||C.code==="Space"&&(C.preventDefault(),Te(!1),ye(!1),we(!1))};return window.addEventListener("keydown",s),window.addEventListener("keyup",b),()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",b)}},[]);const Et=M.useCallback((s,b)=>({x:(s-v.panX)/v.zoom,y:(b-v.panY)/v.zoom}),[v]);M.useEffect(()=>{const s=l.current;if(!s||!P)return;const b=s.getContext("2d");if(me(),b.save(),b.translate(v.panX,v.panY),b.scale(v.zoom,v.zoom),m==="pointer")He(b,c,j);else if(m==="rectangle"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);at(b,{x:C,y:o,width:y,height:x,strokeColor:d.rectangle.strokeColor,fillColor:d.rectangle.fillColor,lineWidth:d.rectangle.lineWidth})}else if(m==="circle"){const C=c.x,o=c.y,y=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));Ge(b,{centerX:C,centerY:o,radius:y,strokeColor:d.circle.strokeColor,fillColor:d.circle.fillColor,lineWidth:d.circle.lineWidth})}else if(m==="pencil")$e(b,{points:Z,strokeColor:d.pencil.strokeColor,lineWidth:d.pencil.lineWidth});else if(m==="triangle"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);Ke(b,{x:C,y:o,width:y,height:x,strokeColor:d.triangle.strokeColor,fillColor:d.triangle.fillColor,lineWidth:d.triangle.lineWidth})}else if(m==="diamond"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);Je(b,{x:C,y:o,width:y,height:x,strokeColor:d.diamond.strokeColor,fillColor:d.diamond.fillColor,lineWidth:d.diamond.lineWidth})}else if(m==="star"){const C=c.x,o=c.y,y=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));st(b,{centerX:C,centerY:o,size:y,strokeColor:d.star.strokeColor,fillColor:d.star.fillColor,lineWidth:d.star.lineWidth})}else if(m==="heart"){const C=c.x,o=c.y,y=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));ct(b,{centerX:C,centerY:o,size:y,strokeColor:d.heart.strokeColor,fillColor:d.heart.fillColor,lineWidth:d.heart.lineWidth})}else if(m==="hexagon"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);lt(b,{x:C,y:o,width:y,height:x,strokeColor:d.hexagon.strokeColor,fillColor:d.hexagon.fillColor,lineWidth:d.hexagon.lineWidth})}else if(m==="octagon"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);ut(b,{x:C,y:o,width:y,height:x,strokeColor:d.octagon.strokeColor,fillColor:d.octagon.fillColor,lineWidth:d.octagon.lineWidth})}else m==="arrow"&&ft(b,{startX:c.x,startY:c.y,endX:j.x,endY:j.y,strokeColor:d.arrow.strokeColor,fillColor:d.arrow.fillColor,lineWidth:d.arrow.lineWidth});b.restore()},[P,m,c,j,Z,me,He,at,Ge,$e,Ke,Je,st,ct,lt,ut,ft,v,d]);const zt=s=>{const C=l.current.getBoundingClientRect(),o=s.clientX-C.left,y=s.clientY-C.top;if(k||Ye)return;if(fe){s.preventDefault(),s.button===0?(ye(!0),Le({x:o-v.panX,y:y-v.panY})):s.button===2&&(we(!0),qe({y,initialZoom:v.zoom}));return}const{x,y:O}=Et(o,y);if(m==="pointer"){const _=Qe(x,O);if(_)if(u(mt(_.id)),ae(!0),_.type==="rectangle")ee({x:x-_.x,y:O-_.y});else if(_.type==="circle")ee({x:x-_.centerX,y:O-_.centerY});else if(_.type==="pencil"){const A=Math.min(..._.points.map(I=>I.x)),W=Math.min(..._.points.map(I=>I.y));ee({x:x-A,y:O-W})}else _.type==="text"?ee({x:x-_.x,y:O-_.y}):_.type==="triangle"||_.type==="diamond"||_.type==="hexagon"||_.type==="octagon"?ee({x:x-_.x,y:O-_.y}):_.type==="star"||_.type==="heart"?ee({x:x-_.centerX,y:O-_.centerY}):_.type==="arrow"?ee({x:x-_.startX,y:O-_.startY}):_.type==="image"&&ee({x:x-_.x,y:O-_.y});else u(mt(null)),N(!0),R({x,y:O}),Y({x,y:O})}else if(m==="text"){const _=Date.now().toString();u(ve({id:_,type:"text",x,y:O,text:"Text",fontSize:d.text.fontSize,fontColor:d.text.fontColor})),u(Pe("pointer")),u(mt(_))}else if(m==="eraser"){const _=Qe(x,O);_&&u(Ti(_.id))}else u(mt(null)),N(!0),R({x,y:O}),Y({x,y:O}),m==="pencil"&&q([{x,y:O}])},Wt=s=>{const C=l.current.getBoundingClientRect(),o=s.clientX-C.left,y=s.clientY-C.top;if(Se){u(Mi({x:o-Me.x,y:y-Me.y}));return}if(be){const _=ke.y-y,W=ke.initialZoom*(1+_*.005);u(ki(W));return}const{x,y:O}=Et(o,y);if(H&&S){const _=E.find(W=>W.id===S);if(!_)return;let A={};if(_.type==="rectangle")A={x:x-G.x,y:O-G.y};else if(_.type==="circle")A={centerX:x-G.x,centerY:O-G.y};else if(_.type==="pencil"){const W=Math.min(..._.points.map(L=>L.x)),I=Math.min(..._.points.map(L=>L.y)),U=x-G.x-W,V=O-G.y-I;A={points:_.points.map(L=>({x:L.x+U,y:L.y+V}))}}else if(_.type==="text")A={x:x-G.x,y:O-G.y};else if(_.type==="triangle"||_.type==="diamond"||_.type==="hexagon"||_.type==="octagon")A={x:x-G.x,y:O-G.y};else if(_.type==="star"||_.type==="heart")A={centerX:x-G.x,centerY:O-G.y};else if(_.type==="arrow"){const W=_.endX-_.startX,I=_.endY-_.startY;A={startX:x-G.x,startY:O-G.y,endX:x-G.x+W,endY:O-G.y+I}}else _.type==="image"&&(A={x:x-G.x,y:O-G.y});u(gt({id:S,updates:A}));return}P&&(Y({x,y:O}),m==="pencil"&&q(_=>[..._,{x,y:O}]))},Lt=()=>{if(Se||be){ye(!1),we(!1);return}if(H){ae(!1);return}if(P){if(m==="pointer")me();else if(m==="rectangle"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"rectangle",x:s,y:b,width:C,height:o,strokeColor:d.rectangle.strokeColor,fillColor:d.rectangle.fillColor,lineWidth:d.rectangle.lineWidth}))}else if(m==="circle"){const s=c.x,b=c.y,C=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));C>0&&u(ve({id:Date.now().toString(),type:"circle",centerX:s,centerY:b,radius:C,strokeColor:d.circle.strokeColor,fillColor:d.circle.fillColor,lineWidth:d.circle.lineWidth}))}else if(m==="pencil")Z.length>1&&u(ve({id:Date.now().toString(),type:"pencil",points:[...Z],strokeColor:d.pencil.strokeColor,lineWidth:d.pencil.lineWidth})),q([]);else if(m==="triangle"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"triangle",x:s,y:b,width:C,height:o,strokeColor:d.triangle.strokeColor,fillColor:d.triangle.fillColor,lineWidth:d.triangle.lineWidth}))}else if(m==="diamond"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"diamond",x:s,y:b,width:C,height:o,strokeColor:d.diamond.strokeColor,fillColor:d.diamond.fillColor,lineWidth:d.diamond.lineWidth}))}else if(m==="star"){const s=c.x,b=c.y,C=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));C>0&&u(ve({id:Date.now().toString(),type:"star",centerX:s,centerY:b,size:C,strokeColor:d.star.strokeColor,fillColor:d.star.fillColor,lineWidth:d.star.lineWidth}))}else if(m==="heart"){const s=c.x,b=c.y,C=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));C>0&&u(ve({id:Date.now().toString(),type:"heart",centerX:s,centerY:b,size:C,strokeColor:d.heart.strokeColor,fillColor:d.heart.fillColor,lineWidth:d.heart.lineWidth}))}else if(m==="hexagon"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"hexagon",x:s,y:b,width:C,height:o,strokeColor:d.hexagon.strokeColor,fillColor:d.hexagon.fillColor,lineWidth:d.hexagon.lineWidth}))}else if(m==="octagon"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"octagon",x:s,y:b,width:C,height:o,strokeColor:d.octagon.strokeColor,fillColor:d.octagon.fillColor,lineWidth:d.octagon.lineWidth}))}else if(m==="arrow"){const s=j.x-c.x,b=j.y-c.y;Math.sqrt(s*s+b*b)>5&&u(ve({id:Date.now().toString(),type:"arrow",startX:c.x,startY:c.y,endX:j.x,endY:j.y,strokeColor:d.arrow.strokeColor,fillColor:d.arrow.fillColor,lineWidth:d.arrow.lineWidth}))}N(!1)}},Er=s=>{fe&&s.preventDefault()},Yt=()=>fe?Se?"grabbing":be?"ns-resize":"grab":"default";return w.jsxs("div",{id:"wb-canvas-container",style:{backgroundColor:"#fff",position:"relative",width:"100%",height:"100%"},children:[w.jsx("canvas",{ref:l,onMouseDown:zt,onMouseMove:Wt,onMouseUp:Lt,onMouseLeave:Lt,onDoubleClick:s=>{const C=l.current.getBoundingClientRect(),o=s.clientX-C.left,y=s.clientY-C.top,{x,y:O}=Et(o,y),_=Qe(x,O);_&&_.type==="text"&&(D(_.id),_e({x:_.x,y:_.y}),se(_.text),z.current=_.text,ge(!0))},onContextMenu:Er,style:{cursor:Yt()}}),k&&w.jsx(ua,{text:n||((Vt=t==null?void 0:t.lock)==null?void 0:Vt.text)||T.text}),Ye&&w.jsx("input",{type:"text",value:ie,onChange:s=>{const b=s.target.value;se(b),de(b)},onKeyDown:s=>{s.key==="Enter"&&ie.trim()?(ce&&(u(gt({id:ce,updates:{text:ie}})),z.current=ie),ge(!1),se(""),D(null)):s.key==="Escape"&&(ge(!1),se(""),D(null))},onBlur:()=>{ie.trim()&&ce&&(u(gt({id:ce,updates:{text:ie}})),z.current=ie),ge(!1),se(""),D(null)},onMouseDown:s=>s.stopPropagation(),autoFocus:!0,style:{position:"absolute",left:Ce.x*v.zoom+v.panX,top:Ce.y*v.zoom+v.panY,fontSize:d.text.fontSize*v.zoom,color:d.text.fontColor,background:"white",border:"2px solid #0066cc",outline:"none",fontFamily:"sans-serif",minWidth:"150px",padding:"4px 8px",zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.2)"}}),w.jsx(ba,{onExport:Fe,onFitToView:wt,mode:h}),w.jsx(wa,{}),he.visible&&w.jsx(Fi,{})]})}),xa=M.forwardRef((e,t)=>w.jsx(mo,{store:zn,children:w.jsx(Co,{children:w.jsx($n,{ref:t,...e})})}));pe.WhiteboardComponent=$n,pe.default=xa,pe.store=zn,pe.whiteboardActions=zi,pe.whiteboardReducer=Dn,Object.defineProperties(pe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
99
+ (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),j.warnIfExceeded()),R}}}}function Rt(e){return typeof e=="boolean"}function pi(){return function(t){return vi(t)}}function vi(e){e===void 0&&(e={});var t=e.thunk,r=t===void 0?!0:t,n=e.immutableCheck,i=n===void 0?!0:n,a=e.serializableCheck,f=a===void 0?!0:a,h=e.actionCreatorCheck,p=h===void 0?!0:h,l=new ii;if(r&&(Rt(r)?l.push(hr):l.push(hr.withExtraArgument(r.extraArgument))),process.env.NODE_ENV!=="production"){if(i){var u={};Rt(i)||(u=i),l.unshift(di(u))}if(f){var g={};Rt(f)||(g=f),l.push(hi(g))}if(p){var m={};Rt(p)||(m=p),l.unshift(oi(m))}}return l}var gr=process.env.NODE_ENV==="production";function yi(e){var t=pi(),r=e||{},n=r.reducer,i=n===void 0?void 0:n,a=r.middleware,f=a===void 0?t():a,h=r.devTools,p=h===void 0?!0:h,l=r.preloadedState,u=l===void 0?void 0:l,g=r.enhancers,m=g===void 0?void 0:g,E;if(typeof i=="function")E=i;else if(wn(i))E=Bo(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var v=f;if(typeof v=="function"&&(v=v(t),!gr&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!gr&&v.some(function(N){return typeof N!="function"}))throw new Error("each middleware provided to configureStore must be a function");var d=Uo.apply(void 0,v),S=kt;p&&(S=ei(ze({trace:!gr},typeof p=="object"&&p)));var T=new ai(d),k=T;Array.isArray(m)?k=it([d],m):typeof m=="function"&&(k=m(T));var P=S.apply(void 0,k);return pn(E,u,P)}function Pn(e){var t={},r=[],n,i={addCase:function(a,f){if(process.env.NODE_ENV!=="production"){if(r.length>0)throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");if(n)throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`")}var h=typeof a=="string"?a:a.type;if(!h)throw new Error("`builder.addCase` cannot be called with an empty action type");if(h in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[h]=f,i},addMatcher:function(a,f){if(process.env.NODE_ENV!=="production"&&n)throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return r.push({matcher:a,reducer:f}),i},addDefaultCase:function(a){if(process.env.NODE_ENV!=="production"&&n)throw new Error("`builder.addDefaultCase` can only be called once");return n=a,i}};return e(i),[t,r,n]}function gi(e){return typeof e=="function"}var Tn=!1;function mi(e,t,r,n){r===void 0&&(r=[]),process.env.NODE_ENV!=="production"&&typeof t=="object"&&(Tn||(Tn=!0,console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer")));var i=typeof t=="function"?Pn(t):[t,r,n],a=i[0],f=i[1],h=i[2],p;if(gi(e))p=function(){return vr(e())};else{var l=vr(e);p=function(){return l}}function u(g,m){g===void 0&&(g=p());var E=it([a[m.type]],f.filter(function(v){var d=v.matcher;return d(m)}).map(function(v){var d=v.reducer;return d}));return E.filter(function(v){return!!v}).length===0&&(E=[h]),E.reduce(function(v,d){if(d)if(Ae(v)){var S=v,T=d(S,m);return T===void 0?v:T}else{if(je(v))return ln(v,function(k){return d(k,m)});var T=d(v,m);if(T===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return T}return v},g)}return u.getInitialState=p,u}var Mn=!1;function bi(e,t){return e+"/"+t}function wi(e){var t=e.name;typeof process<"u"&&process.env.NODE_ENV==="development"&&e.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");var r=typeof e.initialState=="function"?e.initialState:vr(e.initialState),n=e.reducers||{},i=Object.keys(n),a={},f={},h={};i.forEach(function(u){var g=n[u],m=bi(t,u),E,v;"reducer"in g?(E=g.reducer,v=g.prepare):E=g,a[u]=E,f[m]=E,h[u]=v?We(m,v):We(m)});function p(){process.env.NODE_ENV!=="production"&&typeof e.extraReducers=="object"&&(Mn||(Mn=!0,console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice")));var u=typeof e.extraReducers=="function"?Pn(e.extraReducers):[e.extraReducers],g=u[0],m=g===void 0?{}:g,E=u[1],v=E===void 0?[]:E,d=u[2],S=d===void 0?void 0:d,T=ze(ze({},m),f);return mi(r,function(k){for(var P in T)k.addCase(P,T[P]);for(var N=0,c=v;N<c.length;N++){var R=c[N];k.addMatcher(R.matcher,R.reducer)}S&&k.addDefaultCase(S)})}var l;return{name:t,reducer:function(u,g){return l||(l=p()),l(u,g)},actions:h,caseReducers:a,getInitialState:function(){return l||(l=p()),l.getInitialState()}}}var xi="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ei=function(e){e===void 0&&(e=21);for(var t="",r=e;r--;)t+=xi[Math.random()*64|0];return t},Si=["name","message","stack","code"],mr=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),kn=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),Ci=function(e){if(typeof e=="object"&&e!==null){for(var t={},r=0,n=Si;r<n.length;r++){var i=n[r];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}};(function(){function e(t,r,n){var i=We(t+"/fulfilled",function(u,g,m,E){return{payload:u,meta:pr(ze({},E||{}),{arg:m,requestId:g,requestStatus:"fulfilled"})}}),a=We(t+"/pending",function(u,g,m){return{payload:void 0,meta:pr(ze({},m||{}),{arg:g,requestId:u,requestStatus:"pending"})}}),f=We(t+"/rejected",function(u,g,m,E,v){return{payload:E,error:(n&&n.serializeError||Ci)(u||"Rejected"),meta:pr(ze({},v||{}),{arg:m,requestId:g,rejectedWithValue:!!E,requestStatus:"rejected",aborted:(u==null?void 0:u.name)==="AbortError",condition:(u==null?void 0:u.name)==="ConditionError"})}}),h=!1,p=typeof AbortController<"u"?AbortController:(function(){function u(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return u.prototype.abort=function(){process.env.NODE_ENV!=="production"&&(h||(h=!0,console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.")))},u})();function l(u){return function(g,m,E){var v=n!=null&&n.idGenerator?n.idGenerator(u):Ei(),d=new p,S;function T(P){S=P,d.abort()}var k=(function(){return Qo(this,null,function(){var P,N,c,R,j,Y,Z;return qo(this,function(q){switch(q.label){case 0:return q.trys.push([0,4,,5]),R=(P=n==null?void 0:n.condition)==null?void 0:P.call(n,u,{getState:m,extra:E}),Oi(R)?[4,R]:[3,2];case 1:R=q.sent(),q.label=2;case 2:if(R===!1||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return j=new Promise(function(H,ie){return d.signal.addEventListener("abort",function(){return ie({name:"AbortError",message:S||"Aborted"})})}),g(a(v,u,(N=n==null?void 0:n.getPendingMeta)==null?void 0:N.call(n,{requestId:v,arg:u},{getState:m,extra:E}))),[4,Promise.race([j,Promise.resolve(r(u,{dispatch:g,getState:m,extra:E,requestId:v,signal:d.signal,abort:T,rejectWithValue:function(H,ie){return new mr(H,ie)},fulfillWithValue:function(H,ie){return new kn(H,ie)}})).then(function(H){if(H instanceof mr)throw H;return H instanceof kn?i(H.payload,v,u,H.meta):i(H,v,u)})])];case 3:return c=q.sent(),[3,5];case 4:return Y=q.sent(),c=Y instanceof mr?f(null,v,u,Y.payload,Y.meta):f(Y,v,u),[3,5];case 5:return Z=n&&!n.dispatchConditionRejection&&f.match(c)&&c.meta.condition,Z||g(c),[2,c]}})})})();return Object.assign(k,{abort:T,requestId:v,arg:u,unwrap:function(){return k.then(_i)}})}}return Object.assign(l,{pending:a,rejected:f,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e})();function _i(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Oi(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var br="listenerMiddleware";We(br+"/add"),We(br+"/removeAll"),We(br+"/remove");var Rn;typeof queueMicrotask=="function"&&queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis),Mo();function ji(e){const t=[],r=new Set;for(const n of e){const i=n==null?void 0:n.id;if(i==null){t.push(n);continue}r.has(i)||(r.add(i),t.push(n))}return t}const wr=wi({name:"whiteboard",initialState:{grid:{size:20,color:"#ccc",enabled:!0},toolbar:{selectedTool:"pointer"},toolProperties:{pencil:{strokeColor:"#000000",lineWidth:4},rectangle:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},circle:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},triangle:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},diamond:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},star:{strokeColor:"#000000",fillColor:"#ffff00",lineWidth:2},heart:{strokeColor:"#000000",fillColor:"#ff6b6b",lineWidth:2},hexagon:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},octagon:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},arrow:{strokeColor:"#000000",fillColor:"#000000",lineWidth:2},text:{fontSize:16,fontColor:"#000000"}},elements:[],selectedElementId:null,viewport:{panX:0,panY:0,zoom:1},watermark:{text:"Nines Studios",url:"https://github.com/huzeyfecoskun",visible:!0},lock:{isLocked:!0,text:"Whiteboard drawing is only for moderator"}},reducers:{toggleGrid(e){e.grid.enabled=!e.grid.enabled},setGridSize(e,t){e.grid.size=t.payload},setGridColor(e,t){e.grid.color=t.payload},setSelectedTool(e,t){e.toolbar.selectedTool=t.payload},setToolProperty(e,t){const{tool:r,property:n,value:i}=t.payload;e.toolProperties[r]&&(e.toolProperties[r][n]=i)},addElement(e,t){const r=t.payload,n=r==null?void 0:r.id;n!=null&&e.elements.some(a=>(a==null?void 0:a.id)===n)||e.elements.push(r)},updateElement(e,t){const{id:r,updates:n}=t.payload,i=e.elements.findIndex(a=>a.id===r);i!==-1&&(e.elements[i]={...e.elements[i],...n})},removeElement(e,t){const r=t.payload;e.elements=e.elements.filter(n=>n.id!==r),e.selectedElementId===r&&(e.selectedElementId=null)},setSelectedElement(e,t){e.selectedElementId=t.payload},clearElements(e){e.elements=[]},setElements(e,t){const r=Array.isArray(t.payload)?t.payload:[];e.elements=ji(r),e.selectedElementId=null},setPan(e,t){e.viewport.panX=t.payload.x,e.viewport.panY=t.payload.y},setZoom(e,t){e.viewport.zoom=Math.max(.1,Math.min(5,t.payload))},resetViewport(e){e.viewport.panX=0,e.viewport.panY=0,e.viewport.zoom=1},bringToFront(e,t){const r=t.payload,n=e.elements.findIndex(i=>i.id===r);if(n!==-1&&n<e.elements.length-1){const[i]=e.elements.splice(n,1);e.elements.push(i)}},sendToBack(e,t){const r=t.payload,n=e.elements.findIndex(i=>i.id===r);if(n>0){const[i]=e.elements.splice(n,1);e.elements.unshift(i)}},fitToView(e,t){const{canvasWidth:r,canvasHeight:n,padding:i=50}=t.payload,a=e.elements;if(a.length===0){e.viewport.panX=0,e.viewport.panY=0,e.viewport.zoom=1;return}let f=1/0,h=1/0,p=-1/0,l=-1/0;a.forEach(c=>{c.type==="rectangle"?(f=Math.min(f,c.x),h=Math.min(h,c.y),p=Math.max(p,c.x+c.width),l=Math.max(l,c.y+c.height)):c.type==="circle"?(f=Math.min(f,c.centerX-c.radius),h=Math.min(h,c.centerY-c.radius),p=Math.max(p,c.centerX+c.radius),l=Math.max(l,c.centerY+c.radius)):c.type==="pencil"&&c.points.length>0?c.points.forEach(R=>{f=Math.min(f,R.x),h=Math.min(h,R.y),p=Math.max(p,R.x),l=Math.max(l,R.y)}):c.type==="triangle"||c.type==="diamond"||c.type==="hexagon"||c.type==="octagon"?(f=Math.min(f,c.x),h=Math.min(h,c.y),p=Math.max(p,c.x+c.width),l=Math.max(l,c.y+c.height)):c.type==="star"||c.type==="heart"?(f=Math.min(f,c.centerX-c.size),h=Math.min(h,c.centerY-c.size),p=Math.max(p,c.centerX+c.size),l=Math.max(l,c.centerY+c.size)):c.type==="arrow"&&(f=Math.min(f,c.startX,c.endX),h=Math.min(h,c.startY,c.endY),p=Math.max(p,c.startX,c.endX),l=Math.max(l,c.startY,c.endY))});const u=p-f,g=l-h;if(u<=0||g<=0)return;const m=r-i*2,E=n-i*2,v=m/u,d=E/g,S=Math.min(v,d,5),T=(f+p)/2,k=(h+l)/2,P=r/2-T*S,N=n/2-k*S;e.viewport.zoom=Math.max(.1,S),e.viewport.panX=P,e.viewport.panY=N},setLocked(e,t){e.lock.isLocked=t.payload,t.payload&&(e.toolbar.selectedTool="pointer",e.selectedElementId=null)},setWatermarkEnabled(e,t){e.watermark.visible=t.payload},setWatermarkText(e,t){e.watermark.text=t.payload}}}),{toggleGrid:_a,setGridSize:Oa,setGridColor:ja,setSelectedTool:Pe,setToolProperty:Pi,addElement:ve,updateElement:gt,removeElement:Ti,setSelectedElement:mt,clearElements:Nn,setElements:An,setPan:Mi,setZoom:ki,resetViewport:Pa,fitToView:Ri,bringToFront:Ni,sendToBack:Ai,setLocked:In,setWatermarkEnabled:Ii,setWatermarkText:Di}=wr.actions,zi=wr.actions,Dn=wr.reducer;let xr=null;const Wi=new Set(["rectangle","circle","pencil","triangle","diamond","star","heart","hexagon","octagon","arrow","text"]),Li=new Set(["strokeColor","fillColor","lineWidth","fontSize","fontColor","textColor"]),Yi=e=>{var t,r;if(!e||typeof e.type!="string"||e.type.startsWith("@@redux/"))return!1;if(e.type==="whiteboard/addElement"){const n=(t=e==null?void 0:e.payload)==null?void 0:t.type;return typeof n=="string"&&Wi.has(n)}if(e.type==="whiteboard/removeElement"||e.type==="whiteboard/clearElements"||e.type==="whiteboard/bringToFront"||e.type==="whiteboard/sendToBack")return!0;if(e.type==="whiteboard/setToolProperty"){const{tool:n,property:i}=(e==null?void 0:e.payload)??{};return typeof n!="string"||typeof i!="string"?!1:Li.has(i)}if(e.type==="whiteboard/updateElement"){const n=(r=e==null?void 0:e.payload)==null?void 0:r.updates;if(!n||typeof n!="object")return!1;const i=a=>Object.prototype.hasOwnProperty.call(n,a);return!!(i("text")||i("fontSize")||i("fontColor")||i("textColor")||i("strokeColor")||i("fillColor")||i("lineWidth")||i("x")||i("y")||i("centerX")||i("centerY")||i("startX")||i("startY")||i("endX")||i("endY")||i("points"))}return!1},Vi=e=>{xr=e},$i=e=>t=>r=>{var i;const n=t(r);return!((i=r.meta)!=null&&i.fromRemote)&&xr&&Yi(r)&&xr(r),n},zn=yi({reducer:{whiteboard:Dn},middleware:e=>e().concat($i)}),Fi=()=>{const e=oe(t=>t.whiteboard.watermark);return w.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:w.jsx("div",{className:"wb-watermark",children:e.text})})};var Wn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ln=M.createContext&&M.createContext(Wn),Xi=["attr","size","title"];function Bi(e,t){if(e==null)return{};var r=Ui(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ui(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Nt(){return Nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nt.apply(this,arguments)}function Yn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function At(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yn(Object(r),!0).forEach(function(n){qi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qi(e,t,r){return t=Hi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hi(e){var t=Gi(e,"string");return typeof t=="symbol"?t:t+""}function Gi(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vn(e){return e&&e.map((t,r)=>M.createElement(t.tag,At({key:r},t.attr),Vn(t.child)))}function Q(e){return t=>M.createElement(Ki,Nt({attr:At({},e.attr)},t),Vn(e.child))}function Ki(e){var t=r=>{var{attr:n,size:i,title:a}=e,f=Bi(e,Xi),h=i||r.size||"1em",p;return r.className&&(p=r.className),e.className&&(p=(p?p+" ":"")+e.className),M.createElement("svg",Nt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,f,{className:p,style:At(At({color:e.color||r.color},r.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),a&&M.createElement("title",null,a),e.children)};return Ln!==void 0?M.createElement(Ln.Consumer,null,r=>t(r)):t(Wn)}function Ji(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"},child:[]}]})(e)}function Zi(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"},child:[]}]})(e)}function Qi(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"},child:[]}]})(e)}function ea(e){return Q({attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"},child:[]}]})(e)}function ta(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"},child:[]}]})(e)}function ra(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"},child:[]}]})(e)}function na(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"},child:[]}]})(e)}function oa(e){return Q({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"},child:[]}]})(e)}function ia(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"},child:[]}]})(e)}function aa(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"},child:[]}]})(e)}function sa(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"},child:[]}]})(e)}function ca(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}function la(e){return Q({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const ua=({text:e})=>w.jsxs("div",{style:{position:"absolute",top:"10px",left:"10px",backgroundColor:"rgba(255, 68, 68, 0.9)",color:"white",padding:"8px 16px",borderRadius:"4px",display:"flex",alignItems:"center",gap:"8px",boxShadow:"0 2px 4px rgba(0,0,0,0.2)",zIndex:1e3,pointerEvents:"none",userSelect:"none",fontFamily:"sans-serif",fontSize:"14px",fontWeight:"500"},children:[w.jsx(na,{}),w.jsx("span",{children:e||"Locked"})]});function fa(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"},child:[]}]})(e)}function da(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M284.3 11.7c-15.6-15.6-40.9-15.6-56.6 0l-216 216c-15.6 15.6-15.6 40.9 0 56.6l216 216c15.6 15.6 40.9 15.6 56.6 0l216-216c15.6-15.6 15.6-40.9 0-56.6l-216-216z"},child:[]}]})(e)}function ha(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"},child:[]}]})(e)}function pa(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"},child:[]}]})(e)}function va(e){return Q({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l128 0 0 352c0 17.7 14.3 32 32 32s32-14.3 32-32l0-352 128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 32 32 32z"},child:[]}]})(e)}function ya(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 144c0-44.2 35.8-80 80-80c31.9 0 59.4 18.6 72.3 45.7c7.6 16 26.7 22.8 42.6 15.2s22.8-26.7 15.2-42.6C331 33.7 281.5 0 224 0C144.5 0 80 64.5 80 144l0 48-16 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-240 0 0-48z"},child:[]}]})(e)}function ga(e){return Q({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8.5.134a1 1 0 0 0-1 0l-6 3.577a1 1 0 0 0-.5.866v6.846a1 1 0 0 0 .5.866l6 3.577a1 1 0 0 0 1 0l6-3.577a1 1 0 0 0 .5-.866V4.577a1 1 0 0 0-.5-.866z"},child:[]}]})(e)}function ma(e){return Q({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.107 0a.5.5 0 0 1 .353.146l4.394 4.394a.5.5 0 0 1 .146.353v6.214a.5.5 0 0 1-.146.353l-4.394 4.394a.5.5 0 0 1-.353.146H4.893a.5.5 0 0 1-.353-.146L.146 11.46A.5.5 0 0 1 0 11.107V4.893a.5.5 0 0 1 .146-.353L4.54.146A.5.5 0 0 1 4.893 0z"},child:[]}]})(e)}const ba=({onExport:e,onFitToView:t,mode:r})=>{const n=Jt(),{t:i,language:a,changeLanguage:f}=Kr(),h=oe(R=>R.whiteboard.toolbar.selectedTool),p=oe(R=>R.whiteboard.lock.isLocked),[l,u]=M.useState(!1),[g,m]=M.useState(!1),E=M.useRef(null),v=M.useRef(null),d=M.useRef(null),S=M.useRef(null),T=M.useRef(null),k=R=>{const j=R.target.files[0];if(!j)return;const Y=new FileReader;Y.onload=Z=>{const q=new Image;q.onload=()=>{const H=Date.now().toString();n(ve({id:H,type:"image",x:100,y:100,width:q.width,height:q.height,src:Z.target.result})),n(Pe("pointer")),n(mt(H))},q.src=Z.target.result},Y.readAsDataURL(j),R.target.value=""};M.useEffect(()=>{const R=j=>{E.current&&!E.current.contains(j.target)&&v.current&&!v.current.contains(j.target)&&u(!1),S.current&&!S.current.contains(j.target)&&d.current&&!d.current.contains(j.target)&&m(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);const P=[{name:"triangle",icon:w.jsx(aa,{style:{transform:"rotate(-30deg)"}})},{name:"diamond",icon:w.jsx(da,{})},{name:"star",icon:w.jsx(la,{})},{name:"heart",icon:w.jsx(ta,{})},{name:"hexagon",icon:w.jsx(ga,{})},{name:"octagon",icon:w.jsx(ma,{})},{name:"arrow",icon:w.jsx(fa,{})}],N=R=>{n(Pe(R)),u(!1)},c=R=>{f(R),m(!1)};return w.jsxs("div",{className:"wb-toolbar",children:[w.jsx("button",{className:h==="pointer"?"wb-active":"",onClick:()=>n(Pe("pointer")),title:i("pointer"),disabled:p,children:w.jsx(oa,{})}),w.jsx("button",{className:h==="text"?"wb-active":"",onClick:()=>n(Pe("text")),title:i("text"),disabled:p,children:w.jsx(va,{})}),w.jsx("button",{onClick:()=>{var R;return(R=T.current)==null?void 0:R.click()},title:i("image"),disabled:p,children:w.jsx(ra,{})}),w.jsx("input",{type:"file",ref:T,style:{display:"none"},accept:"image/*",onChange:k}),w.jsx("button",{className:h==="pencil"?"wb-active":"",onClick:()=>n(Pe("pencil")),title:i("pencil"),disabled:p,children:w.jsx(ia,{})}),w.jsx("button",{className:h==="rectangle"?"wb-active":"",onClick:()=>n(Pe("rectangle")),title:i("rectangle"),disabled:p,children:w.jsx(ca,{})}),w.jsx("button",{className:h==="circle"?"wb-active":"",onClick:()=>n(Pe("circle")),title:i("circle"),disabled:p,children:w.jsx(Ji,{})}),w.jsxs("div",{className:"wb-ellipsis-container",children:[w.jsx("button",{ref:v,className:P.some(R=>R.name===h)?"wb-active":"",onClick:()=>u(!l),title:i("moreShapes"),disabled:p,children:w.jsx(ha,{})}),l&&w.jsxs("div",{className:"wb-shapes-popup",ref:E,children:[w.jsx("div",{className:"wb-shapes-popup-header",children:i("moreShapes")}),w.jsx("div",{className:"wb-shapes-popup-grid",children:P.map(R=>w.jsx("button",{className:h===R.name?"wb-active":"",onClick:()=>N(R.name),title:i(R.name),children:R.icon},R.name))})]})]}),w.jsx("button",{className:h==="eraser"?"wb-active":"",onClick:()=>n(Pe("eraser")),title:i("eraser"),disabled:p,children:w.jsx(Zi,{})}),w.jsx("button",{onClick:t,title:i("fitToView"),children:w.jsx(Qi,{})}),w.jsx("button",{onClick:e,title:i("exportAsPng"),children:w.jsx(sa,{})}),w.jsxs("div",{className:"wb-language-container",children:[w.jsx("button",{ref:d,onClick:()=>m(!g),title:i("language"),children:w.jsx(ea,{})}),g&&w.jsxs("div",{className:"wb-language-popup",ref:S,children:[w.jsx("div",{className:"wb-language-popup-header",children:i("language")}),w.jsxs("div",{className:"wb-language-options",children:[w.jsxs("button",{className:a==="en"?"wb-active":"",onClick:()=>c("en"),children:["πŸ‡ΊπŸ‡Έ ",i("english")]}),w.jsxs("button",{className:a==="tr"?"wb-active":"",onClick:()=>c("tr"),children:["πŸ‡ΉπŸ‡· ",i("turkish")]})]})]})]}),r==="moderator"&&w.jsx("button",{onClick:()=>n(In(!p)),title:p?"Unlock":"Lock",style:{color:p?"red":"inherit"},children:p?w.jsx(pa,{}):w.jsx(ya,{})})]})},wa=()=>{const e=Jt(),{t}=Kr(),r=oe(g=>g.whiteboard.toolbar.selectedTool),n=oe(g=>g.whiteboard.toolProperties),i=oe(g=>g.whiteboard.selectedElementId),a=oe(g=>g.whiteboard.elements),f=i?a.find(g=>g.id===i):null,h=(g,m,E)=>{e(Pi({tool:g,property:m,value:E}))},p=(g,m)=>{i&&e(gt({id:i,updates:{[g]:m}}))},l=()=>{i&&e(Ni(i))},u=()=>{i&&e(Ai(i))};if(r==="pointer"&&f&&f.type==="text")return w.jsxs("div",{className:"wb-prop-tools",children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fontSize")}),w.jsxs("select",{className:"font-size-selector",value:f.fontSize||16,onChange:g=>p("fontSize",parseInt(g.target.value)),children:[w.jsx("option",{value:"12",children:"12 px"}),w.jsx("option",{value:"14",children:"14 px"}),w.jsx("option",{value:"16",children:"16 px"}),w.jsx("option",{value:"18",children:"18 px"}),w.jsx("option",{value:"24",children:"24 px"}),w.jsx("option",{value:"32",children:"32 px"}),w.jsx("option",{value:"48",children:"48 px"}),w.jsx("option",{value:"64",children:"64 px"}),w.jsx("option",{value:"72",children:"72 px"})]})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fontColor")}),w.jsx("input",{type:"color",value:f.fontColor||"#000000",onChange:g=>p("fontColor",g.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("layerOrder")}),w.jsxs("div",{className:"wb-layer-buttons",children:[w.jsx("button",{onClick:l,title:t("bringToFront"),children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"white"})]})}),w.jsx("button",{onClick:u,title:t("sendToBack"),children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"white"})]})})]})]})]});if(r==="pointer"&&f){const g=["rectangle","circle","triangle","diamond","star","heart","hexagon","octagon","arrow"].includes(f.type),m=f.type==="pencil";return w.jsxs("div",{className:"wb-prop-tools",children:[g&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("strokeColor")}),w.jsx("input",{type:"color",value:f.strokeColor,onChange:E=>p("strokeColor",E.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fillColor")}),w.jsx("input",{type:"color",value:f.fillColor,onChange:E=>p("fillColor",E.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("strokeWidth")}),w.jsxs("select",{className:"stroke-width-selector",value:f.lineWidth,onChange:E=>p("lineWidth",parseInt(E.target.value)),children:[w.jsx("option",{value:"1",children:"1 px"}),w.jsx("option",{value:"2",children:"2 px"}),w.jsx("option",{value:"4",children:"4 px"}),w.jsx("option",{value:"8",children:"8 px"})]})]})]}),m&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("brushColor")}),w.jsx("input",{type:"color",value:f.strokeColor,onChange:E=>p("strokeColor",E.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("brushSize")}),w.jsxs("select",{className:"brush-size-selector",value:f.lineWidth,onChange:E=>p("lineWidth",parseInt(E.target.value)),children:[w.jsx("option",{value:"1",children:"1 px"}),w.jsx("option",{value:"2",children:"2 px"}),w.jsx("option",{value:"4",children:"4 px"}),w.jsx("option",{value:"8",children:"8 px"}),w.jsx("option",{value:"16",children:"16 px"})]})]})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("layerOrder")}),w.jsxs("div",{className:"wb-layer-buttons",children:[w.jsx("button",{onClick:l,title:t("bringToFront"),children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"white"})]})}),w.jsx("button",{onClick:u,title:t("sendToBack"),children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"white"})]})})]})]})]})}return w.jsxs("div",{className:"wb-prop-tools",children:[r==="text"&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fontSize")}),w.jsxs("select",{className:"font-size-selector",value:n.text.fontSize,onChange:g=>h("text","fontSize",parseInt(g.target.value)),children:[w.jsx("option",{value:"12",children:"12 px"}),w.jsx("option",{value:"14",children:"14 px"}),w.jsx("option",{value:"16",children:"16 px"}),w.jsx("option",{value:"18",children:"18 px"}),w.jsx("option",{value:"24",children:"24 px"}),w.jsx("option",{value:"32",children:"32 px"}),w.jsx("option",{value:"48",children:"48 px"}),w.jsx("option",{value:"64",children:"64 px"}),w.jsx("option",{value:"72",children:"72 px"})]})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fontColor")}),w.jsx("input",{type:"color",value:n.text.fontColor,onChange:g=>h("text","fontColor",g.target.value)})]})]}),r==="pencil"&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("brushColor")}),w.jsx("input",{type:"color",value:n.pencil.strokeColor,onChange:g=>h("pencil","strokeColor",g.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("brushSize")}),w.jsxs("select",{className:"brush-size-selector",value:n.pencil.lineWidth,onChange:g=>h("pencil","lineWidth",parseInt(g.target.value)),children:[w.jsx("option",{value:"1",children:"1 px"}),w.jsx("option",{value:"2",children:"2 px"}),w.jsx("option",{value:"4",children:"4 px"}),w.jsx("option",{value:"8",children:"8 px"}),w.jsx("option",{value:"16",children:"16 px"})]})]})]}),(r==="rectangle"||r==="circle"||r==="triangle"||r==="diamond"||r==="star"||r==="heart"||r==="hexagon"||r==="octagon"||r==="arrow")&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("strokeColor")}),w.jsx("input",{type:"color",value:n[r].strokeColor,onChange:g=>h(r,"strokeColor",g.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fillColor")}),w.jsx("input",{type:"color",value:n[r].fillColor,onChange:g=>h(r,"fillColor",g.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("strokeWidth")}),w.jsxs("select",{className:"stroke-width-selector",value:n[r].lineWidth,onChange:g=>h(r,"lineWidth",parseInt(g.target.value)),children:[w.jsx("option",{value:"1",children:"1 px"}),w.jsx("option",{value:"2",children:"2 px"}),w.jsx("option",{value:"4",children:"4 px"}),w.jsx("option",{value:"8",children:"8 px"})]})]})]})]})},$n=M.forwardRef(({onAction:e,watermark:t,isLocked:r,lockText:n,onLockChange:i,isWatermarkEnabled:a,watermarkText:f,mode:h},p)=>{var Vt;const l=M.useRef(null),u=Jt(),g=oe(s=>s.whiteboard.grid),m=oe(s=>s.whiteboard.toolbar.selectedTool),E=oe(s=>s.whiteboard.elements),v=oe(s=>s.whiteboard.viewport),d=oe(s=>s.whiteboard.toolProperties),S=oe(s=>s.whiteboard.selectedElementId),T=oe(s=>s.whiteboard.lock),k=T.isLocked,[P,N]=M.useState(!1),[c,R]=M.useState({x:0,y:0}),[j,Y]=M.useState({x:0,y:0}),[Z,q]=M.useState([]),[H,ie]=M.useState(!1),[G,ee]=M.useState({x:0,y:0}),[fe,Te]=M.useState(!1),[Se,ye]=M.useState(!1),[be,we]=M.useState(!1),[Me,Le]=M.useState({x:0,y:0}),[ke,qe]=M.useState({y:0,initialZoom:1}),[Ye,ge]=M.useState(!1),[Ce,_e]=M.useState({x:0,y:0}),[ae,se]=M.useState(""),[ce,D]=M.useState(null),le=M.useRef(null),z=M.useRef(null),de=M.useCallback(s=>{ce&&s.trim()&&(le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{ce&&s!==z.current&&(z.current=s,u(gt({id:ce,updates:{text:s}})))},150))},[u,ce]);M.useEffect(()=>()=>{le.current&&clearTimeout(le.current)},[]),M.useEffect(()=>{e&&Vi(e)},[e]),M.useImperativeHandle(p,()=>({canvas:l.current,applyAction:s=>{u({...s,meta:{...s.meta,fromRemote:!0}})},getElems:()=>E,getElements:()=>E,setElems:s=>{u({...An(s),meta:{fromRemote:!0}})},setElements:s=>{u({...An(s),meta:{fromRemote:!0}})},clearElems:()=>{u({...Nn(),meta:{fromRemote:!0}})},clearElements:()=>{u({...Nn(),meta:{fromRemote:!0}})}})),M.useEffect(()=>{r!==void 0&&r!==k&&u(In(r))},[r,k,u]),M.useEffect(()=>{i&&i(k)},[k,i]);const he=oe(s=>s.whiteboard.watermark);M.useEffect(()=>{a!==void 0&&a!==he.visible&&u(Ii(a))},[a,he.visible,u]),M.useEffect(()=>{f!==void 0&&f!==he.text&&u(Di(f))},[f,he.text,u]);const Ve=M.useCallback((s,b,C)=>{const o=s.canvas,y=o.width,x=o.height,O=Math.floor(-v.panX/v.zoom/b)*b,_=Math.floor(-v.panY/v.zoom/b)*b,A=Math.ceil((y/v.zoom-v.panX/v.zoom)/b)*b,W=Math.ceil((x/v.zoom-v.panY/v.zoom)/b)*b;s.strokeStyle=C,s.lineWidth=.5/v.zoom;for(let I=O;I<=A;I+=b)s.beginPath(),s.moveTo(I,_),s.lineTo(I,W),s.stroke();for(let I=_;I<=W;I+=b)s.beginPath(),s.moveTo(O,I),s.lineTo(A,I),s.stroke()},[v]),He=M.useCallback((s,b,C)=>{const o=Math.min(b.x,C.x),y=Math.min(b.y,C.y),x=Math.abs(C.x-b.x),O=Math.abs(C.y-b.y);s.strokeStyle="#0066cc",s.lineWidth=1,s.setLineDash([5,5]),s.strokeRect(o,y,x,O),s.fillStyle="rgba(0, 102, 204, 0.1)",s.fillRect(o,y,x,O),s.setLineDash([])},[]),at=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#000",strokeColor:_="#000",lineWidth:A=2}=b;s.fillStyle=O,s.fillRect(C,o,y,x),s.strokeStyle=_,s.lineWidth=A,s.strokeRect(C,o,y,x)},[]),Ge=M.useCallback((s,b)=>{const{centerX:C,centerY:o,radius:y,fillColor:x="#000",strokeColor:O="#000",lineWidth:_=2}=b;s.beginPath(),s.arc(C,o,y,0,Math.PI*2),s.fillStyle=x,s.fill(),s.strokeStyle=O,s.lineWidth=_,s.stroke()},[]),$e=M.useCallback((s,b)=>{const{points:C,strokeColor:o="#000",lineWidth:y=2}=b;if(!(C.length<2)){s.strokeStyle=o,s.lineWidth=y,s.lineCap="round",s.lineJoin="round",s.beginPath(),s.moveTo(C[0].x,C[0].y);for(let x=1;x<C.length;x++)s.lineTo(C[x].x,C[x].y);s.stroke()}},[]),It=M.useCallback((s,b)=>{const{x:C,y:o,text:y,fontSize:x=16,fontColor:O="#000"}=b;s.font=`${x}px sans-serif`,s.fillStyle=O,s.textBaseline="top",s.fillText(y,C,o)},[]),Ke=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#fff",strokeColor:_="#000",lineWidth:A=2}=b;s.beginPath(),s.moveTo(C+y/2,o),s.lineTo(C+y,o+x),s.lineTo(C,o+x),s.closePath(),s.fillStyle=O,s.fill(),s.strokeStyle=_,s.lineWidth=A,s.stroke()},[]),Je=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#fff",strokeColor:_="#000",lineWidth:A=2}=b;s.beginPath(),s.moveTo(C+y/2,o),s.lineTo(C+y,o+x/2),s.lineTo(C+y/2,o+x),s.lineTo(C,o+x/2),s.closePath(),s.fillStyle=O,s.fill(),s.strokeStyle=_,s.lineWidth=A,s.stroke()},[]),st=M.useCallback((s,b)=>{const{centerX:C,centerY:o,size:y,fillColor:x="#ffff00",strokeColor:O="#000",lineWidth:_=2}=b,A=5,W=y,I=y/2;s.beginPath();for(let U=0;U<A*2;U++){const V=U%2===0?W:I,L=Math.PI/A*U-Math.PI/2,J=C+Math.cos(L)*V,re=o+Math.sin(L)*V;U===0?s.moveTo(J,re):s.lineTo(J,re)}s.closePath(),s.fillStyle=x,s.fill(),s.strokeStyle=O,s.lineWidth=_,s.stroke()},[]),ct=M.useCallback((s,b)=>{const{centerX:C,centerY:o,size:y,fillColor:x="#ff6b6b",strokeColor:O="#000",lineWidth:_=2}=b;s.beginPath();const A=o-y/2;s.moveTo(C,A+y/4),s.bezierCurveTo(C-y/2,A,C-y,A+y/2,C,o+y/2),s.bezierCurveTo(C+y,A+y/2,C+y/2,A,C,A+y/4),s.fillStyle=x,s.fill(),s.strokeStyle=O,s.lineWidth=_,s.stroke()},[]),lt=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#fff",strokeColor:_="#000",lineWidth:A=2}=b,W=C+y/2,I=o+x/2,U=y/2,V=x/2;s.beginPath();for(let L=0;L<6;L++){const J=Math.PI/3*L-Math.PI/2,re=W+Math.cos(J)*U,xe=I+Math.sin(J)*V;L===0?s.moveTo(re,xe):s.lineTo(re,xe)}s.closePath(),s.fillStyle=O,s.fill(),s.strokeStyle=_,s.lineWidth=A,s.stroke()},[]),ut=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#fff",strokeColor:_="#000",lineWidth:A=2}=b,W=C+y/2,I=o+x/2,U=y/2,V=x/2;s.beginPath();for(let L=0;L<8;L++){const J=Math.PI/4*L-Math.PI/2,re=W+Math.cos(J)*U,xe=I+Math.sin(J)*V;L===0?s.moveTo(re,xe):s.lineTo(re,xe)}s.closePath(),s.fillStyle=O,s.fill(),s.strokeStyle=_,s.lineWidth=A,s.stroke()},[]),ft=M.useCallback((s,b)=>{const{startX:C,startY:o,endX:y,endY:x,fillColor:O="#000",strokeColor:_="#000",lineWidth:A=2}=b,W=15,I=Math.atan2(x-o,y-C);s.beginPath(),s.moveTo(C,o),s.lineTo(y,x),s.strokeStyle=_,s.lineWidth=A,s.stroke(),s.beginPath(),s.moveTo(y,x),s.lineTo(y-W*Math.cos(I-Math.PI/6),x-W*Math.sin(I-Math.PI/6)),s.lineTo(y-W*Math.cos(I+Math.PI/6),x-W*Math.sin(I+Math.PI/6)),s.closePath(),s.fillStyle=O,s.fill()},[]),dt=M.useRef({}),bt=M.useRef(null),ht=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,src:O}=b;if(dt.current[O]){const _=dt.current[O];_.complete&&s.drawImage(_,C,o,y,x)}else{const _=new Image;_.onload=()=>{dt.current[O]=_,bt.current&&bt.current()},_.src=O,dt.current[O]=_}},[]),Ze=M.useCallback((s,b)=>{switch(b.type){case"rectangle":at(s,b);break;case"circle":Ge(s,b);break;case"pencil":$e(s,b);break;case"text":It(s,b);break;case"triangle":Ke(s,b);break;case"diamond":Je(s,b);break;case"star":st(s,b);break;case"heart":ct(s,b);break;case"hexagon":lt(s,b);break;case"octagon":ut(s,b);break;case"arrow":ft(s,b);break;case"image":ht(s,b);break}},[at,Ge,$e,It,Ke,Je,st,ct,lt,ut,ft,ht]),Fe=M.useCallback(()=>{const s=l.current;if(!s)return;const b=document.createElement("canvas");b.width=s.width,b.height=s.height;const C=b.getContext("2d");C.fillStyle="#ffffff",C.fillRect(0,0,b.width,b.height),C.save(),C.translate(v.panX,v.panY),C.scale(v.zoom,v.zoom),E.forEach(x=>{Ze(C,x)}),C.restore();const o=b.toDataURL("image/png"),y=document.createElement("a");y.download=`whiteboard-${Date.now()}.png`,y.href=o,y.click()},[v,E,Ze]),wt=M.useCallback(()=>{const s=l.current;s&&u(Ri({canvasWidth:s.width,canvasHeight:s.height,padding:50}))},[u]),Qe=M.useCallback((s,b)=>{for(let C=E.length-1;C>=0;C--){const o=E[C];if(o.type==="rectangle"){if(s>=o.x&&s<=o.x+o.width&&b>=o.y&&b<=o.y+o.height)return o}else if(o.type==="circle"){if(Math.sqrt(Math.pow(s-o.centerX,2)+Math.pow(b-o.centerY,2))<=o.radius)return o}else if(o.type==="pencil")for(let x=1;x<o.points.length;x++){const O=o.points[x-1],_=o.points[x];if(xt(s,b,O.x,O.y,_.x,_.y)<=5)return o}else if(o.type==="text"){const y=o.fontSize||16,x=o.text.length*y*.6,O=y;if(s>=o.x&&s<=o.x+x&&b>=o.y&&b<=o.y+O)return o}else if(o.type==="triangle"||o.type==="diamond"||o.type==="hexagon"||o.type==="octagon"){if(s>=o.x&&s<=o.x+o.width&&b>=o.y&&b<=o.y+o.height)return o}else if(o.type==="star"||o.type==="heart"){if(Math.sqrt(Math.pow(s-o.centerX,2)+Math.pow(b-o.centerY,2))<=o.size)return o}else if(o.type==="arrow"){if(xt(s,b,o.startX,o.startY,o.endX,o.endY)<=10)return o}else if(o.type==="image"&&s>=o.x&&s<=o.x+o.width&&b>=o.y&&b<=o.y+o.height)return o}return null},[E]),xt=(s,b,C,o,y,x)=>{const O=s-C,_=b-o,A=y-C,W=x-o,I=O*A+_*W,U=A*A+W*W;let V=-1;U!==0&&(V=I/U);let L,J;V<0?(L=C,J=o):V>1?(L=y,J=x):(L=C+V*A,J=o+V*W);const re=s-L,xe=b-J;return Math.sqrt(re*re+xe*xe)},Dt=M.useCallback((s,b)=>{if(s.strokeStyle="#0066cc",s.lineWidth=2,s.setLineDash([5,5]),b.type==="rectangle")s.strokeRect(b.x-4,b.y-4,b.width+8,b.height+8);else if(b.type==="circle")s.beginPath(),s.arc(b.centerX,b.centerY,b.radius+4,0,Math.PI*2),s.stroke();else if(b.type==="pencil"&&b.points.length>0){const C=Math.min(...b.points.map(O=>O.x)),o=Math.max(...b.points.map(O=>O.x)),y=Math.min(...b.points.map(O=>O.y)),x=Math.max(...b.points.map(O=>O.y));s.strokeRect(C-4,y-4,o-C+8,x-y+8)}else if(b.type==="text"){const C=b.fontSize||16,o=b.text.length*C*.6,y=C;s.strokeRect(b.x-4,b.y-4,o+8,y+8)}else if(b.type==="triangle"||b.type==="diamond"||b.type==="hexagon"||b.type==="octagon")s.strokeRect(b.x-4,b.y-4,b.width+8,b.height+8);else if(b.type==="star"||b.type==="heart")s.beginPath(),s.arc(b.centerX,b.centerY,b.size+4,0,Math.PI*2),s.stroke();else if(b.type==="arrow"){const C=Math.min(b.startX,b.endX),o=Math.max(b.startX,b.endX),y=Math.min(b.startY,b.endY),x=Math.max(b.startY,b.endY);s.strokeRect(C-4,y-4,o-C+8,x-y+8)}else b.type==="image"&&s.strokeRect(b.x-4,b.y-4,b.width+8,b.height+8);s.setLineDash([])},[]),me=M.useCallback(()=>{const s=l.current;if(!s)return;const b=s.getContext("2d");b.clearRect(0,0,s.width,s.height),b.save(),b.translate(v.panX,v.panY),b.scale(v.zoom,v.zoom),g.enabled&&Ve(b,g.size,g.color),E.forEach(C=>{Ze(b,C),C.id===S&&Dt(b,C)}),b.restore()},[g,Ve,E,Ze,S,Dt,v]);M.useEffect(()=>{bt.current=me},[me]),M.useEffect(()=>{const s=l.current;if(!s)return;const b=s.parentElement;if(!b)return;const C=()=>{const y=b.getBoundingClientRect();s.width=y.width,s.height=y.height,me()};C();const o=new ResizeObserver(()=>{C()});return o.observe(b),()=>{o.disconnect()}},[me]),M.useEffect(()=>{me()},[me]),M.useEffect(()=>{const s=C=>{C.target.tagName==="INPUT"||C.target.tagName==="TEXTAREA"||C.code==="Space"&&!C.repeat&&(C.preventDefault(),Te(!0))},b=C=>{C.target.tagName==="INPUT"||C.target.tagName==="TEXTAREA"||C.code==="Space"&&(C.preventDefault(),Te(!1),ye(!1),we(!1))};return window.addEventListener("keydown",s),window.addEventListener("keyup",b),()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",b)}},[]);const Et=M.useCallback((s,b)=>({x:(s-v.panX)/v.zoom,y:(b-v.panY)/v.zoom}),[v]);M.useEffect(()=>{const s=l.current;if(!s||!P)return;const b=s.getContext("2d");if(me(),b.save(),b.translate(v.panX,v.panY),b.scale(v.zoom,v.zoom),m==="pointer")He(b,c,j);else if(m==="rectangle"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);at(b,{x:C,y:o,width:y,height:x,strokeColor:d.rectangle.strokeColor,fillColor:d.rectangle.fillColor,lineWidth:d.rectangle.lineWidth})}else if(m==="circle"){const C=c.x,o=c.y,y=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));Ge(b,{centerX:C,centerY:o,radius:y,strokeColor:d.circle.strokeColor,fillColor:d.circle.fillColor,lineWidth:d.circle.lineWidth})}else if(m==="pencil")$e(b,{points:Z,strokeColor:d.pencil.strokeColor,lineWidth:d.pencil.lineWidth});else if(m==="triangle"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);Ke(b,{x:C,y:o,width:y,height:x,strokeColor:d.triangle.strokeColor,fillColor:d.triangle.fillColor,lineWidth:d.triangle.lineWidth})}else if(m==="diamond"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);Je(b,{x:C,y:o,width:y,height:x,strokeColor:d.diamond.strokeColor,fillColor:d.diamond.fillColor,lineWidth:d.diamond.lineWidth})}else if(m==="star"){const C=c.x,o=c.y,y=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));st(b,{centerX:C,centerY:o,size:y,strokeColor:d.star.strokeColor,fillColor:d.star.fillColor,lineWidth:d.star.lineWidth})}else if(m==="heart"){const C=c.x,o=c.y,y=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));ct(b,{centerX:C,centerY:o,size:y,strokeColor:d.heart.strokeColor,fillColor:d.heart.fillColor,lineWidth:d.heart.lineWidth})}else if(m==="hexagon"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);lt(b,{x:C,y:o,width:y,height:x,strokeColor:d.hexagon.strokeColor,fillColor:d.hexagon.fillColor,lineWidth:d.hexagon.lineWidth})}else if(m==="octagon"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);ut(b,{x:C,y:o,width:y,height:x,strokeColor:d.octagon.strokeColor,fillColor:d.octagon.fillColor,lineWidth:d.octagon.lineWidth})}else m==="arrow"&&ft(b,{startX:c.x,startY:c.y,endX:j.x,endY:j.y,strokeColor:d.arrow.strokeColor,fillColor:d.arrow.fillColor,lineWidth:d.arrow.lineWidth});b.restore()},[P,m,c,j,Z,me,He,at,Ge,$e,Ke,Je,st,ct,lt,ut,ft,v,d]);const zt=s=>{const C=l.current.getBoundingClientRect(),o=s.clientX-C.left,y=s.clientY-C.top;if(Ye)return;if(fe){s.preventDefault(),s.button===0?(ye(!0),Le({x:o-v.panX,y:y-v.panY})):s.button===2&&(we(!0),qe({y,initialZoom:v.zoom}));return}if(k)return;const{x,y:O}=Et(o,y);if(m==="pointer"){const _=Qe(x,O);if(_)if(u(mt(_.id)),ie(!0),_.type==="rectangle")ee({x:x-_.x,y:O-_.y});else if(_.type==="circle")ee({x:x-_.centerX,y:O-_.centerY});else if(_.type==="pencil"){const A=Math.min(..._.points.map(I=>I.x)),W=Math.min(..._.points.map(I=>I.y));ee({x:x-A,y:O-W})}else _.type==="text"?ee({x:x-_.x,y:O-_.y}):_.type==="triangle"||_.type==="diamond"||_.type==="hexagon"||_.type==="octagon"?ee({x:x-_.x,y:O-_.y}):_.type==="star"||_.type==="heart"?ee({x:x-_.centerX,y:O-_.centerY}):_.type==="arrow"?ee({x:x-_.startX,y:O-_.startY}):_.type==="image"&&ee({x:x-_.x,y:O-_.y});else u(mt(null)),N(!0),R({x,y:O}),Y({x,y:O})}else if(m==="text"){const _=Date.now().toString();u(ve({id:_,type:"text",x,y:O,text:"Text",fontSize:d.text.fontSize,fontColor:d.text.fontColor})),u(Pe("pointer")),u(mt(_))}else if(m==="eraser"){const _=Qe(x,O);_&&u(Ti(_.id))}else u(mt(null)),N(!0),R({x,y:O}),Y({x,y:O}),m==="pencil"&&q([{x,y:O}])},Wt=s=>{const C=l.current.getBoundingClientRect(),o=s.clientX-C.left,y=s.clientY-C.top;if(Se){u(Mi({x:o-Me.x,y:y-Me.y}));return}if(be){const _=ke.y-y,W=ke.initialZoom*(1+_*.005);u(ki(W));return}if(k)return;const{x,y:O}=Et(o,y);if(H&&S){const _=E.find(W=>W.id===S);if(!_)return;let A={};if(_.type==="rectangle")A={x:x-G.x,y:O-G.y};else if(_.type==="circle")A={centerX:x-G.x,centerY:O-G.y};else if(_.type==="pencil"){const W=Math.min(..._.points.map(L=>L.x)),I=Math.min(..._.points.map(L=>L.y)),U=x-G.x-W,V=O-G.y-I;A={points:_.points.map(L=>({x:L.x+U,y:L.y+V}))}}else if(_.type==="text")A={x:x-G.x,y:O-G.y};else if(_.type==="triangle"||_.type==="diamond"||_.type==="hexagon"||_.type==="octagon")A={x:x-G.x,y:O-G.y};else if(_.type==="star"||_.type==="heart")A={centerX:x-G.x,centerY:O-G.y};else if(_.type==="arrow"){const W=_.endX-_.startX,I=_.endY-_.startY;A={startX:x-G.x,startY:O-G.y,endX:x-G.x+W,endY:O-G.y+I}}else _.type==="image"&&(A={x:x-G.x,y:O-G.y});u(gt({id:S,updates:A}));return}P&&(Y({x,y:O}),m==="pencil"&&q(_=>[..._,{x,y:O}]))},Lt=()=>{if(Se||be){ye(!1),we(!1);return}if(k){ie(!1),N(!1);return}if(H){ie(!1);return}if(P){if(m==="pointer")me();else if(m==="rectangle"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"rectangle",x:s,y:b,width:C,height:o,strokeColor:d.rectangle.strokeColor,fillColor:d.rectangle.fillColor,lineWidth:d.rectangle.lineWidth}))}else if(m==="circle"){const s=c.x,b=c.y,C=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));C>0&&u(ve({id:Date.now().toString(),type:"circle",centerX:s,centerY:b,radius:C,strokeColor:d.circle.strokeColor,fillColor:d.circle.fillColor,lineWidth:d.circle.lineWidth}))}else if(m==="pencil")Z.length>1&&u(ve({id:Date.now().toString(),type:"pencil",points:[...Z],strokeColor:d.pencil.strokeColor,lineWidth:d.pencil.lineWidth})),q([]);else if(m==="triangle"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"triangle",x:s,y:b,width:C,height:o,strokeColor:d.triangle.strokeColor,fillColor:d.triangle.fillColor,lineWidth:d.triangle.lineWidth}))}else if(m==="diamond"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"diamond",x:s,y:b,width:C,height:o,strokeColor:d.diamond.strokeColor,fillColor:d.diamond.fillColor,lineWidth:d.diamond.lineWidth}))}else if(m==="star"){const s=c.x,b=c.y,C=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));C>0&&u(ve({id:Date.now().toString(),type:"star",centerX:s,centerY:b,size:C,strokeColor:d.star.strokeColor,fillColor:d.star.fillColor,lineWidth:d.star.lineWidth}))}else if(m==="heart"){const s=c.x,b=c.y,C=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));C>0&&u(ve({id:Date.now().toString(),type:"heart",centerX:s,centerY:b,size:C,strokeColor:d.heart.strokeColor,fillColor:d.heart.fillColor,lineWidth:d.heart.lineWidth}))}else if(m==="hexagon"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"hexagon",x:s,y:b,width:C,height:o,strokeColor:d.hexagon.strokeColor,fillColor:d.hexagon.fillColor,lineWidth:d.hexagon.lineWidth}))}else if(m==="octagon"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"octagon",x:s,y:b,width:C,height:o,strokeColor:d.octagon.strokeColor,fillColor:d.octagon.fillColor,lineWidth:d.octagon.lineWidth}))}else if(m==="arrow"){const s=j.x-c.x,b=j.y-c.y;Math.sqrt(s*s+b*b)>5&&u(ve({id:Date.now().toString(),type:"arrow",startX:c.x,startY:c.y,endX:j.x,endY:j.y,strokeColor:d.arrow.strokeColor,fillColor:d.arrow.fillColor,lineWidth:d.arrow.lineWidth}))}N(!1)}},Er=s=>{fe&&s.preventDefault()},Yt=()=>fe?Se?"grabbing":be?"ns-resize":"grab":"default";return w.jsxs("div",{id:"wb-canvas-container",style:{backgroundColor:"#fff",position:"relative",width:"100%",height:"100%"},children:[w.jsx("canvas",{ref:l,onMouseDown:zt,onMouseMove:Wt,onMouseUp:Lt,onMouseLeave:Lt,onDoubleClick:s=>{if(k)return;const C=l.current.getBoundingClientRect(),o=s.clientX-C.left,y=s.clientY-C.top,{x,y:O}=Et(o,y),_=Qe(x,O);_&&_.type==="text"&&(D(_.id),_e({x:_.x,y:_.y}),se(_.text),z.current=_.text,ge(!0))},onContextMenu:Er,style:{cursor:Yt()}}),k&&w.jsx(ua,{text:n||((Vt=t==null?void 0:t.lock)==null?void 0:Vt.text)||T.text}),Ye&&w.jsx("input",{type:"text",value:ae,onChange:s=>{const b=s.target.value;se(b),de(b)},onKeyDown:s=>{s.key==="Enter"&&ae.trim()?(ce&&(u(gt({id:ce,updates:{text:ae}})),z.current=ae),ge(!1),se(""),D(null)):s.key==="Escape"&&(ge(!1),se(""),D(null))},onBlur:()=>{ae.trim()&&ce&&(u(gt({id:ce,updates:{text:ae}})),z.current=ae),ge(!1),se(""),D(null)},onMouseDown:s=>s.stopPropagation(),autoFocus:!0,style:{position:"absolute",left:Ce.x*v.zoom+v.panX,top:Ce.y*v.zoom+v.panY,fontSize:d.text.fontSize*v.zoom,color:d.text.fontColor,background:"white",border:"2px solid #0066cc",outline:"none",fontFamily:"sans-serif",minWidth:"150px",padding:"4px 8px",zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.2)"}}),w.jsx(ba,{onExport:Fe,onFitToView:wt,mode:h}),w.jsx(wa,{}),he.visible&&w.jsx(Fi,{})]})}),xa=M.forwardRef((e,t)=>w.jsx(mo,{store:zn,children:w.jsx(Co,{children:w.jsx($n,{ref:t,...e})})}));pe.WhiteboardComponent=$n,pe.default=xa,pe.store=zn,pe.whiteboardActions=zi,pe.whiteboardReducer=Dn,Object.defineProperties(pe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "Nines Studios",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/huzeyfecoskun/whiteboard",
7
- "version": "0.0.8",
7
+ "version": "0.0.9",
8
8
  "type": "module",
9
9
  "main": "./dist/whiteboard.umd.js",
10
10
  "module": "./dist/whiteboard.es.js",