@ninesstudios/whiteboard 0.0.2 β†’ 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,30 +1,30 @@
1
- (function(xe,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],N):(xe=typeof globalThis<"u"?globalThis:xe||self,N(xe.Whiteboard={},xe.React,xe.ReactDOM))})(this,(function(xe,N,Vn){"use strict";function $n(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ke=$n(N);var Et={exports:{}},ot={};/*
1
+ (function(be,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],N):(be=typeof globalThis<"u"?globalThis:be||self,N(be.Whiteboard={},be.React,be.ReactDOM))})(this,(function(be,N,Vn){"use strict";function $n(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Me=$n(N);var St={exports:{}},tt={};/*
2
2
  object-assign
3
3
  (c) Sindre Sorhus
4
4
  @license MIT
5
- */var Vt,xr;function Er(){if(xr)return Vt;xr=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var c={},u=0;u<10;u++)c["_"+String.fromCharCode(u)]=u;var h=Object.getOwnPropertyNames(c).map(function(p){return c[p]});if(h.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(p){s[p]=p}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Vt=o()?Object.assign:function(i,c){for(var u,h=n(i),s,p=1;p<arguments.length;p++){u=Object(arguments[p]);for(var l in u)t.call(u,l)&&(h[l]=u[l]);if(e){s=e(u);for(var f=0;f<s.length;f++)r.call(u,s[f])&&(h[s[f]]=u[s[f]])}}return h},Vt}/** @license React v17.0.2
5
+ */var Yt,xr;function Er(){if(xr)return Yt;xr=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var l={},d=0;d<10;d++)l["_"+String.fromCharCode(d)]=d;var h=Object.getOwnPropertyNames(l).map(function(v){return l[v]});if(h.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(v){c[v]=v}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Yt=o()?Object.assign:function(i,l){for(var d,h=n(i),c,v=1;v<arguments.length;v++){d=Object(arguments[v]);for(var f in d)t.call(d,f)&&(h[f]=d[f]);if(e){c=e(d);for(var w=0;w<c.length;w++)r.call(d,c[w])&&(h[c[w]]=d[c[w]])}}return h},Yt}/** @license React v17.0.2
6
6
  * react-jsx-runtime.production.min.js
7
7
  *
8
8
  * Copyright (c) Facebook, Inc. and its affiliates.
9
9
  *
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
- */var Sr;function Fn(){if(Sr)return ot;Sr=1,Er();var e=N,t=60103;if(ot.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var r=Symbol.for;t=r("react.element"),ot.Fragment=r("react.fragment")}var n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o=Object.prototype.hasOwnProperty,i={key:!0,ref:!0,__self:!0,__source:!0};function c(u,h,s){var p,l={},f=null,b=null;s!==void 0&&(f=""+s),h.key!==void 0&&(f=""+h.key),h.ref!==void 0&&(b=h.ref);for(p in h)o.call(h,p)&&!i.hasOwnProperty(p)&&(l[p]=h[p]);if(u&&u.defaultProps)for(p in h=u.defaultProps,h)l[p]===void 0&&(l[p]=h[p]);return{$$typeof:t,type:u,key:f,ref:b,props:l,_owner:n.current}}return ot.jsx=c,ot.jsxs=c,ot}var $t={};/** @license React v17.0.2
12
+ */var Sr;function Fn(){if(Sr)return tt;Sr=1,Er();var e=N,t=60103;if(tt.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var r=Symbol.for;t=r("react.element"),tt.Fragment=r("react.fragment")}var n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o=Object.prototype.hasOwnProperty,i={key:!0,ref:!0,__self:!0,__source:!0};function l(d,h,c){var v,f={},w=null,p=null;c!==void 0&&(w=""+c),h.key!==void 0&&(w=""+h.key),h.ref!==void 0&&(p=h.ref);for(v in h)o.call(h,v)&&!i.hasOwnProperty(v)&&(f[v]=h[v]);if(d&&d.defaultProps)for(v in h=d.defaultProps,h)f[v]===void 0&&(f[v]=h[v]);return{$$typeof:t,type:d,key:w,ref:p,props:f,_owner:n.current}}return tt.jsx=l,tt.jsxs=l,tt}var Vt={};/** @license React v17.0.2
13
13
  * react-jsx-runtime.development.js
14
14
  *
15
15
  * Copyright (c) Facebook, Inc. and its affiliates.
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 Cr;function Xn(){return Cr||(Cr=1,(function(e){process.env.NODE_ENV!=="production"&&(function(){var t=N,r=Er(),n=60103,o=60106;e.Fragment=60107;var i=60108,c=60114,u=60109,h=60110,s=60112,p=60113,l=60120,f=60115,b=60116,w=60121,x=60122,S=60117,k=60129,C=60131;if(typeof Symbol=="function"&&Symbol.for){var M=Symbol.for;n=M("react.element"),o=M("react.portal"),e.Fragment=M("react.fragment"),i=M("react.strict_mode"),c=M("react.profiler"),u=M("react.provider"),h=M("react.context"),s=M("react.forward_ref"),p=M("react.suspense"),l=M("react.suspense_list"),f=M("react.memo"),b=M("react.lazy"),w=M("react.block"),x=M("react.server.block"),S=M("react.fundamental"),M("react.scope"),M("react.opaque.id"),k=M("react.debug_trace_mode"),M("react.offscreen"),C=M("react.legacy_hidden")}var m=typeof Symbol=="function"&&Symbol.iterator,g="@@iterator";function I(d){if(d===null||typeof d!="object")return null;var j=m&&d[m]||d[g];return typeof j=="function"?j:null}var V=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Y(d){{for(var j=arguments.length,R=new Array(j>1?j-1:0),W=1;W<j;W++)R[W-1]=arguments[W];ne("error",d,R)}}function ne(d,j,R){{var W=V.ReactDebugCurrentFrame,$=W.getStackAddendum();$!==""&&(j+="%s",R=R.concat([$]));var F=R.map(function(U){return""+U});F.unshift("Warning: "+j),Function.prototype.apply.call(console[d],console,F)}}var X=!1;function Q(d){return!!(typeof d=="string"||typeof d=="function"||d===e.Fragment||d===c||d===k||d===i||d===p||d===l||d===C||X||typeof d=="object"&&d!==null&&(d.$$typeof===b||d.$$typeof===f||d.$$typeof===u||d.$$typeof===h||d.$$typeof===s||d.$$typeof===S||d.$$typeof===w||d[0]===x))}function ce(d,j,R){var W=j.displayName||j.name||"";return d.displayName||(W!==""?R+"("+W+")":R)}function Ae(d){return d.displayName||"Context"}function se(d){if(d==null)return null;if(typeof d.tag=="number"&&Y("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case e.Fragment:return"Fragment";case o:return"Portal";case c:return"Profiler";case i:return"StrictMode";case p:return"Suspense";case l:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case h:var j=d;return Ae(j)+".Consumer";case u:var R=d;return Ae(R._context)+".Provider";case s:return ce(d,d.render,"ForwardRef");case f:return se(d.type);case w:return se(d._render);case b:{var W=d,$=W._payload,F=W._init;try{return se(F($))}catch{return null}}}return null}var he=0,je,Pe,Ee,De,Te,Ue,Ie;function Se(){}Se.__reactDisabledLog=!0;function qe(){{if(he===0){je=console.log,Pe=console.info,Ee=console.warn,De=console.error,Te=console.group,Ue=console.groupCollapsed,Ie=console.groupEnd;var d={configurable:!0,enumerable:!0,value:Se,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}he++}}function et(){{if(he--,he===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:r({},d,{value:je}),info:r({},d,{value:Pe}),warn:r({},d,{value:Ee}),error:r({},d,{value:De}),group:r({},d,{value:Te}),groupCollapsed:r({},d,{value:Ue}),groupEnd:r({},d,{value:Ie})})}he<0&&Y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=V.ReactCurrentDispatcher,ve;function ye(d,j,R){{if(ve===void 0)try{throw Error()}catch($){var W=$.stack.trim().match(/\n( *(at )?)/);ve=W&&W[1]||""}return`
20
- `+ve+d}}var be=!1,Ce;{var He=typeof WeakMap=="function"?WeakMap:Map;Ce=new He}function D(d,j){if(!d||be)return"";{var R=Ce.get(d);if(R!==void 0)return R}var W;be=!0;var $=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var F;F=pe.current,pe.current=null,qe();try{if(j){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(Le){W=Le}Reflect.construct(d,[],U)}else{try{U.call()}catch(Le){W=Le}d.call(U.prototype)}}else{try{throw Error()}catch(Le){W=Le}d()}}catch(Le){if(Le&&W&&typeof Le.stack=="string"){for(var B=Le.stack.split(`
21
- `),le=W.stack.split(`
22
- `),re=B.length-1,oe=le.length-1;re>=1&&oe>=0&&B[re]!==le[oe];)oe--;for(;re>=1&&oe>=0;re--,oe--)if(B[re]!==le[oe]){if(re!==1||oe!==1)do if(re--,oe--,oe<0||B[re]!==le[oe]){var We=`
23
- `+B[re].replace(" at new "," at ");return typeof d=="function"&&Ce.set(d,We),We}while(re>=1&&oe>=0);break}}}finally{be=!1,pe.current=F,et(),Error.prepareStackTrace=$}var vt=d?d.displayName||d.name:"",Yn=vt?ye(vt):"";return typeof d=="function"&&Ce.set(d,Yn),Yn}function ge(d,j,R){return D(d,!1)}function z(d){var j=d.prototype;return!!(j&&j.isReactComponent)}function fe(d,j,R){if(d==null)return"";if(typeof d=="function")return D(d,z(d));if(typeof d=="string")return ye(d);switch(d){case p:return ye("Suspense");case l:return ye("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case s:return ge(d.render);case f:return fe(d.type,j,R);case w:return ge(d._render);case b:{var W=d,$=W._payload,F=W._init;try{return fe(F($),j,R)}catch{}}}return""}var we={},Me=V.ReactDebugCurrentFrame;function ze(d){if(d){var j=d._owner,R=fe(d.type,d._source,j?j.type:null);Me.setExtraStackFrame(R)}else Me.setExtraStackFrame(null)}function ut(d,j,R,W,$){{var F=Function.call.bind(Object.prototype.hasOwnProperty);for(var U in d)if(F(d,U)){var B=void 0;try{if(typeof d[U]!="function"){var le=Error((W||"React class")+": "+R+" type `"+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[U]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw le.name="Invariant Violation",le}B=d[U](j,U,W,R,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(re){B=re}B&&!(B instanceof Error)&&(ze($),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).",W||"React class",R,U,typeof B),ze(null)),B instanceof Error&&!(B.message in we)&&(we[B.message]=!0,ze($),Y("Failed %s type: %s",R,B.message),ze(null))}}}var tt=V.ReactCurrentOwner,Ge=Object.prototype.hasOwnProperty,ft={key:!0,ref:!0,__self:!0,__source:!0},rt,dt;function Dt(d){if(Ge.call(d,"ref")){var j=Object.getOwnPropertyDescriptor(d,"ref").get;if(j&&j.isReactWarning)return!1}return d.ref!==void 0}function ht(d){if(Ge.call(d,"key")){var j=Object.getOwnPropertyDescriptor(d,"key").get;if(j&&j.isReactWarning)return!1}return d.key!==void 0}function wr(d,j){typeof d.ref=="string"&&tt.current}function wt(d,j){{var R=function(){rt||(rt=!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)",j))};R.isReactWarning=!0,Object.defineProperty(d,"key",{get:R,configurable:!0})}}function It(d,j){{var R=function(){dt||(dt=!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)",j))};R.isReactWarning=!0,Object.defineProperty(d,"ref",{get:R,configurable:!0})}}var zt=function(d,j,R,W,$,F,U){var B={$$typeof:n,type:d,key:j,ref:R,props:U,_owner:F};return B._store={},Object.defineProperty(B._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(B,"_self",{configurable:!1,enumerable:!1,writable:!1,value:W}),Object.defineProperty(B,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.freeze&&(Object.freeze(B.props),Object.freeze(B)),B};function _e(d,j,R,W,$){{var F,U={},B=null,le=null;R!==void 0&&(B=""+R),ht(j)&&(B=""+j.key),Dt(j)&&(le=j.ref,wr(j,$));for(F in j)Ge.call(j,F)&&!ft.hasOwnProperty(F)&&(U[F]=j[F]);if(d&&d.defaultProps){var re=d.defaultProps;for(F in re)U[F]===void 0&&(U[F]=re[F])}if(B||le){var oe=typeof d=="function"?d.displayName||d.name||"Unknown":d;B&&wt(U,oe),le&&It(U,oe)}return zt(d,B,le,$,W,tt.current,U)}}var nt=V.ReactCurrentOwner,Wt=V.ReactDebugCurrentFrame;function Ke(d){if(d){var j=d._owner,R=fe(d.type,d._source,j?j.type:null);Wt.setExtraStackFrame(R)}else Wt.setExtraStackFrame(null)}var pt;pt=!1;function xt(d){return typeof d=="object"&&d!==null&&d.$$typeof===n}function Lt(){{if(nt.current){var d=se(nt.current.type);if(d)return`
19
+ */var Cr;function Xn(){return Cr||(Cr=1,(function(e){process.env.NODE_ENV!=="production"&&(function(){var t=N,r=Er(),n=60103,o=60106;e.Fragment=60107;var i=60108,l=60114,d=60109,h=60110,c=60112,v=60113,f=60120,w=60115,p=60116,u=60121,x=60122,S=60117,T=60129,A=60131;if(typeof Symbol=="function"&&Symbol.for){var M=Symbol.for;n=M("react.element"),o=M("react.portal"),e.Fragment=M("react.fragment"),i=M("react.strict_mode"),l=M("react.profiler"),d=M("react.provider"),h=M("react.context"),c=M("react.forward_ref"),v=M("react.suspense"),f=M("react.suspense_list"),w=M("react.memo"),p=M("react.lazy"),u=M("react.block"),x=M("react.server.block"),S=M("react.fundamental"),M("react.scope"),M("react.opaque.id"),T=M("react.debug_trace_mode"),M("react.offscreen"),A=M("react.legacy_hidden")}var m=typeof Symbol=="function"&&Symbol.iterator,b="@@iterator";function _(s){if(s===null||typeof s!="object")return null;var O=m&&s[m]||s[b];return typeof O=="function"?O:null}var X=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function $(s){{for(var O=arguments.length,R=new Array(O>1?O-1:0),z=1;z<O;z++)R[z-1]=arguments[z];ee("error",s,R)}}function ee(s,O,R){{var z=X.ReactDebugCurrentFrame,F=z.getStackAddendum();F!==""&&(O+="%s",R=R.concat([F]));var L=R.map(function(Y){return""+Y});L.unshift("Warning: "+O),Function.prototype.apply.call(console[s],console,L)}}var ne=!1;function Z(s){return!!(typeof s=="string"||typeof s=="function"||s===e.Fragment||s===l||s===T||s===i||s===v||s===f||s===A||ne||typeof s=="object"&&s!==null&&(s.$$typeof===p||s.$$typeof===w||s.$$typeof===d||s.$$typeof===h||s.$$typeof===c||s.$$typeof===S||s.$$typeof===u||s[0]===x))}function G(s,O,R){var z=O.displayName||O.name||"";return s.displayName||(z!==""?R+"("+z+")":R)}function ue(s){return s.displayName||"Context"}function ae(s){if(s==null)return null;if(typeof s.tag=="number"&&$("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case e.Fragment:return"Fragment";case o:return"Portal";case l:return"Profiler";case i:return"StrictMode";case v:return"Suspense";case f:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case h:var O=s;return ue(O)+".Consumer";case d:var R=s;return ue(R._context)+".Provider";case c:return G(s,s.render,"ForwardRef");case w:return ae(s.type);case u:return ae(s._render);case p:{var z=s,F=z._payload,L=z._init;try{return ae(L(F))}catch{return null}}}return null}var ye=0,Se,Ce,ge,we,_e,Fe,Ne;function Xe(){}Xe.__reactDisabledLog=!0;function Be(){{if(ye===0){Se=console.log,Ce=console.info,ge=console.warn,we=console.error,_e=console.group,Fe=console.groupCollapsed,Ne=console.groupEnd;var s={configurable:!0,enumerable:!0,value:Xe,writable:!0};Object.defineProperties(console,{info:s,log:s,warn:s,error:s,group:s,groupCollapsed:s,groupEnd:s})}ye++}}function Oe(){{if(ye--,ye===0){var s={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:r({},s,{value:Se}),info:r({},s,{value:Ce}),warn:r({},s,{value:ge}),error:r({},s,{value:we}),group:r({},s,{value:_e}),groupCollapsed:r({},s,{value:Fe}),groupEnd:r({},s,{value:Ne})})}ye<0&&$("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var je=X.ReactCurrentDispatcher,Ae;function fe(s,O,R){{if(Ae===void 0)try{throw Error()}catch(F){var z=F.stack.trim().match(/\n( *(at )?)/);Ae=z&&z[1]||""}return`
20
+ `+Ae+s}}var he=!1,pe;{var Pe=typeof WeakMap=="function"?WeakMap:Map;pe=new Pe}function I(s,O){if(!s||he)return"";{var R=pe.get(s);if(R!==void 0)return R}var z;he=!0;var F=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var L;L=je.current,je.current=null,Be();try{if(O){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(Ie){z=Ie}Reflect.construct(s,[],Y)}else{try{Y.call()}catch(Ie){z=Ie}s.call(Y.prototype)}}else{try{throw Error()}catch(Ie){z=Ie}s()}}catch(Ie){if(Ie&&z&&typeof Ie.stack=="string"){for(var V=Ie.stack.split(`
21
+ `),J=z.stack.split(`
22
+ `),te=V.length-1,re=J.length-1;te>=1&&re>=0&&V[te]!==J[re];)re--;for(;te>=1&&re>=0;te--,re--)if(V[te]!==J[re]){if(te!==1||re!==1)do if(te--,re--,re<0||V[te]!==J[re]){var De=`
23
+ `+V[te].replace(" at new "," at ");return typeof s=="function"&&pe.set(s,De),De}while(te>=1&&re>=0);break}}}finally{he=!1,je.current=L,Oe(),Error.prepareStackTrace=F}var ht=s?s.displayName||s.name:"",Yn=ht?fe(ht):"";return typeof s=="function"&&pe.set(s,Yn),Yn}function xe(s,O,R){return I(s,!1)}function W(s){var O=s.prototype;return!!(O&&O.isReactComponent)}function se(s,O,R){if(s==null)return"";if(typeof s=="function")return I(s,W(s));if(typeof s=="string")return fe(s);switch(s){case v:return fe("Suspense");case f:return fe("SuspenseList")}if(typeof s=="object")switch(s.$$typeof){case c:return xe(s.render);case w:return se(s.type,O,R);case u:return xe(s._render);case p:{var z=s,F=z._payload,L=z._init;try{return se(L(F),O,R)}catch{}}}return""}var me={},Te=X.ReactDebugCurrentFrame;function Ke(s){if(s){var O=s._owner,R=se(s.type,s._source,O?O.type:null);Te.setExtraStackFrame(R)}else Te.setExtraStackFrame(null)}function st(s,O,R,z,F){{var L=Function.call.bind(Object.prototype.hasOwnProperty);for(var Y in s)if(L(s,Y)){var V=void 0;try{if(typeof s[Y]!="function"){var J=Error((z||"React class")+": "+R+" type `"+Y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[Y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw J.name="Invariant Violation",J}V=s[Y](O,Y,z,R,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(te){V=te}V&&!(V instanceof Error)&&(Ke(F),$("%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).",z||"React class",R,Y,typeof V),Ke(null)),V instanceof Error&&!(V.message in me)&&(me[V.message]=!0,Ke(F),$("Failed %s type: %s",R,V.message),Ke(null))}}}var Je=X.ReactCurrentOwner,Ue=Object.prototype.hasOwnProperty,ct={key:!0,ref:!0,__self:!0,__source:!0},Ze,Qe;function lt(s){if(Ue.call(s,"ref")){var O=Object.getOwnPropertyDescriptor(s,"ref").get;if(O&&O.isReactWarning)return!1}return s.ref!==void 0}function ut(s){if(Ue.call(s,"key")){var O=Object.getOwnPropertyDescriptor(s,"key").get;if(O&&O.isReactWarning)return!1}return s.key!==void 0}function mt(s,O){typeof s.ref=="string"&&Je.current}function It(s,O){{var R=function(){Ze||(Ze=!0,$("%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)",O))};R.isReactWarning=!0,Object.defineProperty(s,"key",{get:R,configurable:!0})}}function ft(s,O){{var R=function(){Qe||(Qe=!0,$("%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)",O))};R.isReactWarning=!0,Object.defineProperty(s,"ref",{get:R,configurable:!0})}}var br=function(s,O,R,z,F,L,Y){var V={$$typeof:n,type:s,key:O,ref:R,props:Y,_owner:L};return V._store={},Object.defineProperty(V._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(V,"_self",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.defineProperty(V,"_source",{configurable:!1,enumerable:!1,writable:!1,value:F}),Object.freeze&&(Object.freeze(V.props),Object.freeze(V)),V};function bt(s,O,R,z,F){{var L,Y={},V=null,J=null;R!==void 0&&(V=""+R),ut(O)&&(V=""+O.key),lt(O)&&(J=O.ref,mt(O,F));for(L in O)Ue.call(O,L)&&!ct.hasOwnProperty(L)&&(Y[L]=O[L]);if(s&&s.defaultProps){var te=s.defaultProps;for(L in te)Y[L]===void 0&&(Y[L]=te[L])}if(V||J){var re=typeof s=="function"?s.displayName||s.name||"Unknown":s;V&&It(Y,re),J&&ft(Y,re)}return br(s,V,J,F,z,Je.current,Y)}}var dt=X.ReactCurrentOwner,wt=X.ReactDebugCurrentFrame;function ce(s){if(s){var O=s._owner,R=se(s.type,s._source,O?O.type:null);wt.setExtraStackFrame(R)}else wt.setExtraStackFrame(null)}var et;et=!1;function xt(s){return typeof s=="object"&&s!==null&&s.$$typeof===n}function zt(){{if(dt.current){var s=ae(dt.current.type);if(s)return`
24
24
 
25
- Check the render method of \``+d+"`."}return""}}function Yt(d){return""}var a={};function v(d){{var j=Lt();if(!j){var R=typeof d=="string"?d:d.displayName||d.name;R&&(j=`
25
+ Check the render method of \``+s+"`."}return""}}function Wt(s){return""}var Lt={};function wr(s){{var O=zt();if(!O){var R=typeof s=="string"?s:s.displayName||s.name;R&&(O=`
26
26
 
27
- Check the top-level render call using <`+R+">.")}return j}}function _(d,j){{if(!d._store||d._store.validated||d.key!=null)return;d._store.validated=!0;var R=v(j);if(a[R])return;a[R]=!0;var W="";d&&d._owner&&d._owner!==nt.current&&(W=" It was passed a child from "+se(d._owner.type)+"."),Ke(d),Y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',R,W),Ke(null)}}function E(d,j){{if(typeof d!="object")return;if(Array.isArray(d))for(var R=0;R<d.length;R++){var W=d[R];xt(W)&&_(W,j)}else if(xt(d))d._store&&(d._store.validated=!0);else if(d){var $=I(d);if(typeof $=="function"&&$!==d.entries)for(var F=$.call(d),U;!(U=F.next()).done;)xt(U.value)&&_(U.value,j)}}}function T(d){{var j=d.type;if(j==null||typeof j=="string")return;var R;if(typeof j=="function")R=j.propTypes;else if(typeof j=="object"&&(j.$$typeof===s||j.$$typeof===f))R=j.propTypes;else return;if(R){var W=se(j);ut(R,d.props,"prop",W,d)}else if(j.PropTypes!==void 0&&!pt){pt=!0;var $=se(j);Y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",$||"Unknown")}typeof j.getDefaultProps=="function"&&!j.getDefaultProps.isReactClassApproved&&Y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function P(d){{for(var j=Object.keys(d.props),R=0;R<j.length;R++){var W=j[R];if(W!=="children"&&W!=="key"){Ke(d),Y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",W),Ke(null);break}}d.ref!==null&&(Ke(d),Y("Invalid attribute `ref` supplied to `React.Fragment`."),Ke(null))}}function A(d,j,R,W,$,F){{var U=Q(d);if(!U){var B="";(d===void 0||typeof d=="object"&&d!==null&&Object.keys(d).length===0)&&(B+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var le=Yt();le?B+=le:B+=Lt();var re;d===null?re="null":Array.isArray(d)?re="array":d!==void 0&&d.$$typeof===n?(re="<"+(se(d.type)||"Unknown")+" />",B=" Did you accidentally export a JSX literal instead of a component?"):re=typeof d,Y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",re,B)}var oe=_e(d,j,R,$,F);if(oe==null)return oe;if(U){var We=j.children;if(We!==void 0)if(W)if(Array.isArray(We)){for(var vt=0;vt<We.length;vt++)E(We[vt],d);Object.freeze&&Object.freeze(We)}else Y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else E(We,d)}return d===e.Fragment?P(oe):T(oe),oe}}function O(d,j,R){return A(d,j,R,!0)}function L(d,j,R){return A(d,j,R,!1)}var Z=L,q=O;e.jsx=Z,e.jsxs=q})()})($t)),$t}var _r;function Bn(){return _r||(_r=1,process.env.NODE_ENV==="production"?Et.exports=Fn():Et.exports=Xn()),Et.exports}var y=Bn(),St={exports:{}},Ft={};/**
27
+ Check the top-level render call using <`+R+">.")}return O}}function Et(s,O){{if(!s._store||s._store.validated||s.key!=null)return;s._store.validated=!0;var R=wr(O);if(Lt[R])return;Lt[R]=!0;var z="";s&&s._owner&&s._owner!==dt.current&&(z=" It was passed a child from "+ae(s._owner.type)+"."),ce(s),$('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',R,z),ce(null)}}function a(s,O){{if(typeof s!="object")return;if(Array.isArray(s))for(var R=0;R<s.length;R++){var z=s[R];xt(z)&&Et(z,O)}else if(xt(s))s._store&&(s._store.validated=!0);else if(s){var F=_(s);if(typeof F=="function"&&F!==s.entries)for(var L=F.call(s),Y;!(Y=L.next()).done;)xt(Y.value)&&Et(Y.value,O)}}}function y(s){{var O=s.type;if(O==null||typeof O=="string")return;var R;if(typeof O=="function")R=O.propTypes;else if(typeof O=="object"&&(O.$$typeof===c||O.$$typeof===w))R=O.propTypes;else return;if(R){var z=ae(O);st(R,s.props,"prop",z,s)}else if(O.PropTypes!==void 0&&!et){et=!0;var F=ae(O);$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",F||"Unknown")}typeof O.getDefaultProps=="function"&&!O.getDefaultProps.isReactClassApproved&&$("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function C(s){{for(var O=Object.keys(s.props),R=0;R<O.length;R++){var z=O[R];if(z!=="children"&&z!=="key"){ce(s),$("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",z),ce(null);break}}s.ref!==null&&(ce(s),$("Invalid attribute `ref` supplied to `React.Fragment`."),ce(null))}}function E(s,O,R,z,F,L){{var Y=Z(s);if(!Y){var V="";(s===void 0||typeof s=="object"&&s!==null&&Object.keys(s).length===0)&&(V+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var J=Wt();J?V+=J:V+=zt();var te;s===null?te="null":Array.isArray(s)?te="array":s!==void 0&&s.$$typeof===n?(te="<"+(ae(s.type)||"Unknown")+" />",V=" Did you accidentally export a JSX literal instead of a component?"):te=typeof s,$("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",te,V)}var re=bt(s,O,R,F,L);if(re==null)return re;if(Y){var De=O.children;if(De!==void 0)if(z)if(Array.isArray(De)){for(var ht=0;ht<De.length;ht++)a(De[ht],s);Object.freeze&&Object.freeze(De)}else $("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else a(De,s)}return s===e.Fragment?C(re):y(re),re}}function k(s,O,R){return E(s,O,R,!0)}function P(s,O,R){return E(s,O,R,!1)}var D=P,j=k;e.jsx=D,e.jsxs=j})()})(Vt)),Vt}var _r;function Bn(){return _r||(_r=1,process.env.NODE_ENV==="production"?St.exports=Fn():St.exports=Xn()),St.exports}var g=Bn(),Ct={exports:{}},$t={};/**
28
28
  * @license React
29
29
  * use-sync-external-store-shim.production.js
30
30
  *
@@ -32,7 +32,7 @@ Check the top-level render call using <`+R+">.")}return j}}function _(d,j){{if(!
32
32
  *
33
33
  * This source code is licensed under the MIT license found in the
34
34
  * LICENSE file in the root directory of this source tree.
35
- */var Or;function Un(){if(Or)return Ft;Or=1;var e=N;function t(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,i=e.useLayoutEffect,c=e.useDebugValue;function u(l,f){var b=f(),w=n({inst:{value:b,getSnapshot:f}}),x=w[0].inst,S=w[1];return i(function(){x.value=b,x.getSnapshot=f,h(x)&&S({inst:x})},[l,b,f]),o(function(){return h(x)&&S({inst:x}),l(function(){h(x)&&S({inst:x})})},[l]),c(b),b}function h(l){var f=l.getSnapshot;l=l.value;try{var b=f();return!r(l,b)}catch{return!0}}function s(l,f){return f()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:u;return Ft.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Ft}var Xt={};/**
35
+ */var Or;function Un(){if(Or)return $t;Or=1;var e=N;function t(f,w){return f===w&&(f!==0||1/f===1/w)||f!==f&&w!==w}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function d(f,w){var p=w(),u=n({inst:{value:p,getSnapshot:w}}),x=u[0].inst,S=u[1];return i(function(){x.value=p,x.getSnapshot=w,h(x)&&S({inst:x})},[f,p,w]),o(function(){return h(x)&&S({inst:x}),f(function(){h(x)&&S({inst:x})})},[f]),l(p),p}function h(f){var w=f.getSnapshot;f=f.value;try{var p=w();return!r(f,p)}catch{return!0}}function c(f,w){return w()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:d;return $t.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,$t}var Ft={};/**
36
36
  * @license React
37
37
  * use-sync-external-store-shim.development.js
38
38
  *
@@ -40,7 +40,7 @@ Check the top-level render call using <`+R+">.")}return j}}function _(d,j){{if(!
40
40
  *
41
41
  * This source code is licensed under the MIT license found in the
42
42
  * LICENSE file in the root directory of this source tree.
43
- */var jr;function qn(){return jr||(jr=1,process.env.NODE_ENV!=="production"&&(function(){function e(b,w){return b===w&&(b!==0||1/b===1/w)||b!==b&&w!==w}function t(b,w){p||o.startTransition===void 0||(p=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var x=w();if(!l){var S=w();i(x,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}S=c({inst:{value:x,getSnapshot:w}});var k=S[0].inst,C=S[1];return h(function(){k.value=x,k.getSnapshot=w,r(k)&&C({inst:k})},[b,x,w]),u(function(){return r(k)&&C({inst:k}),b(function(){r(k)&&C({inst:k})})},[b]),s(x),x}function r(b){var w=b.getSnapshot;b=b.value;try{var x=w();return!i(b,x)}catch{return!0}}function n(b,w){return w()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=N,i=typeof Object.is=="function"?Object.is:e,c=o.useState,u=o.useEffect,h=o.useLayoutEffect,s=o.useDebugValue,p=!1,l=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;Xt.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Xt}var Pr;function Bt(){return Pr||(Pr=1,process.env.NODE_ENV==="production"?St.exports=Un():St.exports=qn()),St.exports}Bt();var Ct={exports:{}},Ut={};/**
43
+ */var jr;function qn(){return jr||(jr=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,u){return p===u&&(p!==0||1/p===1/u)||p!==p&&u!==u}function t(p,u){v||o.startTransition===void 0||(v=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var x=u();if(!f){var S=u();i(x,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}S=l({inst:{value:x,getSnapshot:u}});var T=S[0].inst,A=S[1];return h(function(){T.value=x,T.getSnapshot=u,r(T)&&A({inst:T})},[p,x,u]),d(function(){return r(T)&&A({inst:T}),p(function(){r(T)&&A({inst:T})})},[p]),c(x),x}function r(p){var u=p.getSnapshot;p=p.value;try{var x=u();return!i(p,x)}catch{return!0}}function n(p,u){return u()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=N,i=typeof Object.is=="function"?Object.is:e,l=o.useState,d=o.useEffect,h=o.useLayoutEffect,c=o.useDebugValue,v=!1,f=!1,w=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;Ft.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:w,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Ft}var Pr;function Xt(){return Pr||(Pr=1,process.env.NODE_ENV==="production"?Ct.exports=Un():Ct.exports=qn()),Ct.exports}Xt();var _t={exports:{}},Bt={};/**
44
44
  * @license React
45
45
  * use-sync-external-store-shim/with-selector.production.js
46
46
  *
@@ -48,7 +48,7 @@ Check the top-level render call using <`+R+">.")}return j}}function _(d,j){{if(!
48
48
  *
49
49
  * This source code is licensed under the MIT license found in the
50
50
  * LICENSE file in the root directory of this source tree.
51
- */var Tr;function Hn(){if(Tr)return Ut;Tr=1;var e=N,t=Bt();function r(s,p){return s===p&&(s!==0||1/s===1/p)||s!==s&&p!==p}var n=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,i=e.useRef,c=e.useEffect,u=e.useMemo,h=e.useDebugValue;return Ut.useSyncExternalStoreWithSelector=function(s,p,l,f,b){var w=i(null);if(w.current===null){var x={hasValue:!1,value:null};w.current=x}else x=w.current;w=u(function(){function k(I){if(!C){if(C=!0,M=I,I=f(I),b!==void 0&&x.hasValue){var V=x.value;if(b(V,I))return m=V}return m=I}if(V=m,n(M,I))return V;var Y=f(I);return b!==void 0&&b(V,Y)?(M=I,V):(M=I,m=Y)}var C=!1,M,m,g=l===void 0?null:l;return[function(){return k(p())},g===null?void 0:function(){return k(g())}]},[p,l,f,b]);var S=o(s,w[0],w[1]);return c(function(){x.hasValue=!0,x.value=S},[S]),h(S),S},Ut}var qt={};/**
51
+ */var Tr;function Hn(){if(Tr)return Bt;Tr=1;var e=N,t=Xt();function r(c,v){return c===v&&(c!==0||1/c===1/v)||c!==c&&v!==v}var n=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,d=e.useMemo,h=e.useDebugValue;return Bt.useSyncExternalStoreWithSelector=function(c,v,f,w,p){var u=i(null);if(u.current===null){var x={hasValue:!1,value:null};u.current=x}else x=u.current;u=d(function(){function T(_){if(!A){if(A=!0,M=_,_=w(_),p!==void 0&&x.hasValue){var X=x.value;if(p(X,_))return m=X}return m=_}if(X=m,n(M,_))return X;var $=w(_);return p!==void 0&&p(X,$)?(M=_,X):(M=_,m=$)}var A=!1,M,m,b=f===void 0?null:f;return[function(){return T(v())},b===null?void 0:function(){return T(b())}]},[v,f,w,p]);var S=o(c,u[0],u[1]);return l(function(){x.hasValue=!0,x.value=S},[S]),h(S),S},Bt}var Ut={};/**
52
52
  * @license React
53
53
  * use-sync-external-store-shim/with-selector.development.js
54
54
  *
@@ -56,23 +56,23 @@ Check the top-level render call using <`+R+">.")}return j}}function _(d,j){{if(!
56
56
  *
57
57
  * This source code is licensed under the MIT license found in the
58
58
  * LICENSE file in the root directory of this source tree.
59
- */var Mr;function Gn(){return Mr||(Mr=1,process.env.NODE_ENV!=="production"&&(function(){function e(s,p){return s===p&&(s!==0||1/s===1/p)||s!==s&&p!==p}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=N,r=Bt(),n=typeof Object.is=="function"?Object.is:e,o=r.useSyncExternalStore,i=t.useRef,c=t.useEffect,u=t.useMemo,h=t.useDebugValue;qt.useSyncExternalStoreWithSelector=function(s,p,l,f,b){var w=i(null);if(w.current===null){var x={hasValue:!1,value:null};w.current=x}else x=w.current;w=u(function(){function k(I){if(!C){if(C=!0,M=I,I=f(I),b!==void 0&&x.hasValue){var V=x.value;if(b(V,I))return m=V}return m=I}if(V=m,n(M,I))return V;var Y=f(I);return b!==void 0&&b(V,Y)?(M=I,V):(M=I,m=Y)}var C=!1,M,m,g=l===void 0?null:l;return[function(){return k(p())},g===null?void 0:function(){return k(g())}]},[p,l,f,b]);var S=o(s,w[0],w[1]);return c(function(){x.hasValue=!0,x.value=S},[S]),h(S),S},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),qt}var kr;function Kn(){return kr||(kr=1,process.env.NODE_ENV==="production"?Ct.exports=Hn():Ct.exports=Gn()),Ct.exports}var Jn=Kn();function Zn(e){e()}let Rr=Zn;const Qn=e=>Rr=e,eo=()=>Rr,Nr=Symbol.for("react-redux-context"),Ar=typeof globalThis<"u"?globalThis:{};function to(){var e;if(!ke.createContext)return{};const t=(e=Ar[Nr])!=null?e:Ar[Nr]=new Map;let r=t.get(ke.createContext);return r||(r=ke.createContext(null),process.env.NODE_ENV!=="production"&&(r.displayName="ReactRedux"),t.set(ke.createContext,r)),r}const Ye=to();function Ht(e=Ye){return function(){const r=N.useContext(e);if(process.env.NODE_ENV!=="production"&&!r)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return r}}const Dr=Ht();let Ir=()=>{throw new Error("uSES not initialized!")};const ro=e=>{Ir=e},no=(e,t)=>e===t;function oo(e=Ye){const t=e===Ye?Dr:Ht(e);return function(n,o={}){const{equalityFn:i=no,stabilityCheck:c=void 0,noopCheck:u=void 0}=typeof o=="function"?{equalityFn:o}:o;if(process.env.NODE_ENV!=="production"){if(!n)throw new Error("You must pass a selector to useSelector");if(typeof n!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof i!="function")throw new Error("You must pass a function as an equality function to useSelector")}const{store:h,subscription:s,getServerState:p,stabilityCheck:l,noopCheck:f}=t(),b=N.useRef(!0),w=N.useCallback({[n.name](S){const k=n(S);if(process.env.NODE_ENV!=="production"){const C=typeof c>"u"?l:c;if(C==="always"||C==="once"&&b.current){const m=n(S);if(!i(k,m)){let g;try{throw new Error}catch(I){({stack:g}=I)}console.warn("Selector "+(n.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
60
- Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,{state:S,selected:k,selected2:m,stack:g})}}const M=typeof u>"u"?f:u;if((M==="always"||M==="once"&&b.current)&&k===S){let m;try{throw new Error}catch(g){({stack:m}=g)}console.warn("Selector "+(n.name||"unknown")+` returned the root state when called. This can lead to unnecessary rerenders.
61
- Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:m})}b.current&&(b.current=!1)}return k}}[n.name],[n,l,c]),x=Ir(s.addNestedSub,h.getState,p||h.getState,w,i);return N.useDebugValue(x),x}}const ue=oo();var _t={exports:{}},H={};/** @license React v16.13.1
59
+ */var Mr;function Gn(){return Mr||(Mr=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,v){return c===v&&(c!==0||1/c===1/v)||c!==c&&v!==v}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=N,r=Xt(),n=typeof Object.is=="function"?Object.is:e,o=r.useSyncExternalStore,i=t.useRef,l=t.useEffect,d=t.useMemo,h=t.useDebugValue;Ut.useSyncExternalStoreWithSelector=function(c,v,f,w,p){var u=i(null);if(u.current===null){var x={hasValue:!1,value:null};u.current=x}else x=u.current;u=d(function(){function T(_){if(!A){if(A=!0,M=_,_=w(_),p!==void 0&&x.hasValue){var X=x.value;if(p(X,_))return m=X}return m=_}if(X=m,n(M,_))return X;var $=w(_);return p!==void 0&&p(X,$)?(M=_,X):(M=_,m=$)}var A=!1,M,m,b=f===void 0?null:f;return[function(){return T(v())},b===null?void 0:function(){return T(b())}]},[v,f,w,p]);var S=o(c,u[0],u[1]);return l(function(){x.hasValue=!0,x.value=S},[S]),h(S),S},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Ut}var kr;function Kn(){return kr||(kr=1,process.env.NODE_ENV==="production"?_t.exports=Hn():_t.exports=Gn()),_t.exports}var Jn=Kn();function Zn(e){e()}let Rr=Zn;const Qn=e=>Rr=e,eo=()=>Rr,Nr=Symbol.for("react-redux-context"),Ar=typeof globalThis<"u"?globalThis:{};function to(){var e;if(!Me.createContext)return{};const t=(e=Ar[Nr])!=null?e:Ar[Nr]=new Map;let r=t.get(Me.createContext);return r||(r=Me.createContext(null),process.env.NODE_ENV!=="production"&&(r.displayName="ReactRedux"),t.set(Me.createContext,r)),r}const ze=to();function qt(e=ze){return function(){const r=N.useContext(e);if(process.env.NODE_ENV!=="production"&&!r)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return r}}const Dr=qt();let Ir=()=>{throw new Error("uSES not initialized!")};const ro=e=>{Ir=e},no=(e,t)=>e===t;function oo(e=ze){const t=e===ze?Dr:qt(e);return function(n,o={}){const{equalityFn:i=no,stabilityCheck:l=void 0,noopCheck:d=void 0}=typeof o=="function"?{equalityFn:o}:o;if(process.env.NODE_ENV!=="production"){if(!n)throw new Error("You must pass a selector to useSelector");if(typeof n!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof i!="function")throw new Error("You must pass a function as an equality function to useSelector")}const{store:h,subscription:c,getServerState:v,stabilityCheck:f,noopCheck:w}=t(),p=N.useRef(!0),u=N.useCallback({[n.name](S){const T=n(S);if(process.env.NODE_ENV!=="production"){const A=typeof l>"u"?f:l;if(A==="always"||A==="once"&&p.current){const m=n(S);if(!i(T,m)){let b;try{throw new Error}catch(_){({stack:b}=_)}console.warn("Selector "+(n.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
60
+ Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,{state:S,selected:T,selected2:m,stack:b})}}const M=typeof d>"u"?w:d;if((M==="always"||M==="once"&&p.current)&&T===S){let m;try{throw new Error}catch(b){({stack:m}=b)}console.warn("Selector "+(n.name||"unknown")+` returned the root state when called. This can lead to unnecessary rerenders.
61
+ Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:m})}p.current&&(p.current=!1)}return T}}[n.name],[n,f,l]),x=Ir(c.addNestedSub,h.getState,v||h.getState,u,i);return N.useDebugValue(x),x}}const le=oo();var Ot={exports:{}},B={};/** @license React v16.13.1
62
62
  * react-is.production.min.js
63
63
  *
64
64
  * Copyright (c) Facebook, Inc. and its affiliates.
65
65
  *
66
66
  * This source code is licensed under the MIT license found in the
67
67
  * LICENSE file in the root directory of this source tree.
68
- */var zr;function io(){if(zr)return H;zr=1;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,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,b=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,k=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function M(g){if(typeof g=="object"&&g!==null){var I=g.$$typeof;switch(I){case t:switch(g=g.type,g){case h:case s:case n:case i:case o:case l:return g;default:switch(g=g&&g.$$typeof,g){case u:case p:case w:case b:case c:return g;default:return I}}case r:return I}}}function m(g){return M(g)===s}return H.AsyncMode=h,H.ConcurrentMode=s,H.ContextConsumer=u,H.ContextProvider=c,H.Element=t,H.ForwardRef=p,H.Fragment=n,H.Lazy=w,H.Memo=b,H.Portal=r,H.Profiler=i,H.StrictMode=o,H.Suspense=l,H.isAsyncMode=function(g){return m(g)||M(g)===h},H.isConcurrentMode=m,H.isContextConsumer=function(g){return M(g)===u},H.isContextProvider=function(g){return M(g)===c},H.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},H.isForwardRef=function(g){return M(g)===p},H.isFragment=function(g){return M(g)===n},H.isLazy=function(g){return M(g)===w},H.isMemo=function(g){return M(g)===b},H.isPortal=function(g){return M(g)===r},H.isProfiler=function(g){return M(g)===i},H.isStrictMode=function(g){return M(g)===o},H.isSuspense=function(g){return M(g)===l},H.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===n||g===s||g===i||g===o||g===l||g===f||typeof g=="object"&&g!==null&&(g.$$typeof===w||g.$$typeof===b||g.$$typeof===c||g.$$typeof===u||g.$$typeof===p||g.$$typeof===S||g.$$typeof===k||g.$$typeof===C||g.$$typeof===x)},H.typeOf=M,H}var G={};/** @license React v16.13.1
68
+ */var zr;function io(){if(zr)return B;zr=1;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,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,d=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,v=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,u=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,T=e?Symbol.for("react.responder"):60118,A=e?Symbol.for("react.scope"):60119;function M(b){if(typeof b=="object"&&b!==null){var _=b.$$typeof;switch(_){case t:switch(b=b.type,b){case h:case c:case n:case i:case o:case f:return b;default:switch(b=b&&b.$$typeof,b){case d:case v:case u:case p:case l:return b;default:return _}}case r:return _}}}function m(b){return M(b)===c}return B.AsyncMode=h,B.ConcurrentMode=c,B.ContextConsumer=d,B.ContextProvider=l,B.Element=t,B.ForwardRef=v,B.Fragment=n,B.Lazy=u,B.Memo=p,B.Portal=r,B.Profiler=i,B.StrictMode=o,B.Suspense=f,B.isAsyncMode=function(b){return m(b)||M(b)===h},B.isConcurrentMode=m,B.isContextConsumer=function(b){return M(b)===d},B.isContextProvider=function(b){return M(b)===l},B.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},B.isForwardRef=function(b){return M(b)===v},B.isFragment=function(b){return M(b)===n},B.isLazy=function(b){return M(b)===u},B.isMemo=function(b){return M(b)===p},B.isPortal=function(b){return M(b)===r},B.isProfiler=function(b){return M(b)===i},B.isStrictMode=function(b){return M(b)===o},B.isSuspense=function(b){return M(b)===f},B.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===c||b===i||b===o||b===f||b===w||typeof b=="object"&&b!==null&&(b.$$typeof===u||b.$$typeof===p||b.$$typeof===l||b.$$typeof===d||b.$$typeof===v||b.$$typeof===S||b.$$typeof===T||b.$$typeof===A||b.$$typeof===x)},B.typeOf=M,B}var U={};/** @license React v16.13.1
69
69
  * react-is.development.js
70
70
  *
71
71
  * Copyright (c) Facebook, Inc. and its affiliates.
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 Wr;function ao(){return Wr||(Wr=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,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,b=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,k=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function M(D){return typeof D=="string"||typeof D=="function"||D===n||D===s||D===i||D===o||D===l||D===f||typeof D=="object"&&D!==null&&(D.$$typeof===w||D.$$typeof===b||D.$$typeof===c||D.$$typeof===u||D.$$typeof===p||D.$$typeof===S||D.$$typeof===k||D.$$typeof===C||D.$$typeof===x)}function m(D){if(typeof D=="object"&&D!==null){var ge=D.$$typeof;switch(ge){case t:var z=D.type;switch(z){case h:case s:case n:case i:case o:case l:return z;default:var fe=z&&z.$$typeof;switch(fe){case u:case p:case w:case b:case c:return fe;default:return ge}}case r:return ge}}}var g=h,I=s,V=u,Y=c,ne=t,X=p,Q=n,ce=w,Ae=b,se=r,he=i,je=o,Pe=l,Ee=!1;function De(D){return Ee||(Ee=!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.")),Te(D)||m(D)===h}function Te(D){return m(D)===s}function Ue(D){return m(D)===u}function Ie(D){return m(D)===c}function Se(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function qe(D){return m(D)===p}function et(D){return m(D)===n}function pe(D){return m(D)===w}function ve(D){return m(D)===b}function ye(D){return m(D)===r}function be(D){return m(D)===i}function Ce(D){return m(D)===o}function He(D){return m(D)===l}G.AsyncMode=g,G.ConcurrentMode=I,G.ContextConsumer=V,G.ContextProvider=Y,G.Element=ne,G.ForwardRef=X,G.Fragment=Q,G.Lazy=ce,G.Memo=Ae,G.Portal=se,G.Profiler=he,G.StrictMode=je,G.Suspense=Pe,G.isAsyncMode=De,G.isConcurrentMode=Te,G.isContextConsumer=Ue,G.isContextProvider=Ie,G.isElement=Se,G.isForwardRef=qe,G.isFragment=et,G.isLazy=pe,G.isMemo=ve,G.isPortal=ye,G.isProfiler=be,G.isStrictMode=Ce,G.isSuspense=He,G.isValidElementType=M,G.typeOf=m})()),G}var Lr;function so(){return Lr||(Lr=1,process.env.NODE_ENV==="production"?_t.exports=io():_t.exports=ao()),_t.exports}var Gt,Yr;function co(){if(Yr)return Gt;Yr=1;var e=so(),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},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};i[e.ForwardRef]=n,i[e.Memo]=o;function c(w){return e.isMemo(w)?o:i[w.$$typeof]||t}var u=Object.defineProperty,h=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,l=Object.getPrototypeOf,f=Object.prototype;function b(w,x,S){if(typeof x!="string"){if(f){var k=l(x);k&&k!==f&&b(w,k,S)}var C=h(x);s&&(C=C.concat(s(x)));for(var M=c(w),m=c(x),g=0;g<C.length;++g){var I=C[g];if(!r[I]&&!(S&&S[I])&&!(m&&m[I])&&!(M&&M[I])){var V=p(x,I);try{u(w,I,V)}catch{}}}}return w}return Gt=b,Gt}co();var Ot={exports:{}},K={};/**
75
+ */var Wr;function ao(){return Wr||(Wr=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,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,d=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,v=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,u=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,T=e?Symbol.for("react.responder"):60118,A=e?Symbol.for("react.scope"):60119;function M(I){return typeof I=="string"||typeof I=="function"||I===n||I===c||I===i||I===o||I===f||I===w||typeof I=="object"&&I!==null&&(I.$$typeof===u||I.$$typeof===p||I.$$typeof===l||I.$$typeof===d||I.$$typeof===v||I.$$typeof===S||I.$$typeof===T||I.$$typeof===A||I.$$typeof===x)}function m(I){if(typeof I=="object"&&I!==null){var xe=I.$$typeof;switch(xe){case t:var W=I.type;switch(W){case h:case c:case n:case i:case o:case f:return W;default:var se=W&&W.$$typeof;switch(se){case d:case v:case u:case p:case l:return se;default:return xe}}case r:return xe}}}var b=h,_=c,X=d,$=l,ee=t,ne=v,Z=n,G=u,ue=p,ae=r,ye=i,Se=o,Ce=f,ge=!1;function we(I){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.")),_e(I)||m(I)===h}function _e(I){return m(I)===c}function Fe(I){return m(I)===d}function Ne(I){return m(I)===l}function Xe(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function Be(I){return m(I)===v}function Oe(I){return m(I)===n}function je(I){return m(I)===u}function Ae(I){return m(I)===p}function fe(I){return m(I)===r}function he(I){return m(I)===i}function pe(I){return m(I)===o}function Pe(I){return m(I)===f}U.AsyncMode=b,U.ConcurrentMode=_,U.ContextConsumer=X,U.ContextProvider=$,U.Element=ee,U.ForwardRef=ne,U.Fragment=Z,U.Lazy=G,U.Memo=ue,U.Portal=ae,U.Profiler=ye,U.StrictMode=Se,U.Suspense=Ce,U.isAsyncMode=we,U.isConcurrentMode=_e,U.isContextConsumer=Fe,U.isContextProvider=Ne,U.isElement=Xe,U.isForwardRef=Be,U.isFragment=Oe,U.isLazy=je,U.isMemo=Ae,U.isPortal=fe,U.isProfiler=he,U.isStrictMode=pe,U.isSuspense=Pe,U.isValidElementType=M,U.typeOf=m})()),U}var Lr;function so(){return Lr||(Lr=1,process.env.NODE_ENV==="production"?Ot.exports=io():Ot.exports=ao()),Ot.exports}var Ht,Yr;function co(){if(Yr)return Ht;Yr=1;var e=so(),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},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};i[e.ForwardRef]=n,i[e.Memo]=o;function l(u){return e.isMemo(u)?o:i[u.$$typeof]||t}var d=Object.defineProperty,h=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,v=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,w=Object.prototype;function p(u,x,S){if(typeof x!="string"){if(w){var T=f(x);T&&T!==w&&p(u,T,S)}var A=h(x);c&&(A=A.concat(c(x)));for(var M=l(u),m=l(x),b=0;b<A.length;++b){var _=A[b];if(!r[_]&&!(S&&S[_])&&!(m&&m[_])&&!(M&&M[_])){var X=v(x,_);try{d(u,_,X)}catch{}}}}return u}return Ht=p,Ht}co();var jt={exports:{}},q={};/**
76
76
  * @license React
77
77
  * react-is.production.min.js
78
78
  *
@@ -80,7 +80,7 @@ Selectors that return the entire state are almost certainly a mistake, as they w
80
80
  *
81
81
  * This source code is licensed under the MIT license found in the
82
82
  * LICENSE file in the root directory of this source tree.
83
- */var Vr;function lo(){if(Vr)return K;Vr=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),h=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),w;w=Symbol.for("react.module.reference");function x(S){if(typeof S=="object"&&S!==null){var k=S.$$typeof;switch(k){case e:switch(S=S.type,S){case r:case o:case n:case s:case p:return S;default:switch(S=S&&S.$$typeof,S){case u:case c:case h:case f:case l:case i:return S;default:return k}}case t:return k}}}return K.ContextConsumer=c,K.ContextProvider=i,K.Element=e,K.ForwardRef=h,K.Fragment=r,K.Lazy=f,K.Memo=l,K.Portal=t,K.Profiler=o,K.StrictMode=n,K.Suspense=s,K.SuspenseList=p,K.isAsyncMode=function(){return!1},K.isConcurrentMode=function(){return!1},K.isContextConsumer=function(S){return x(S)===c},K.isContextProvider=function(S){return x(S)===i},K.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},K.isForwardRef=function(S){return x(S)===h},K.isFragment=function(S){return x(S)===r},K.isLazy=function(S){return x(S)===f},K.isMemo=function(S){return x(S)===l},K.isPortal=function(S){return x(S)===t},K.isProfiler=function(S){return x(S)===o},K.isStrictMode=function(S){return x(S)===n},K.isSuspense=function(S){return x(S)===s},K.isSuspenseList=function(S){return x(S)===p},K.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===o||S===n||S===s||S===p||S===b||typeof S=="object"&&S!==null&&(S.$$typeof===f||S.$$typeof===l||S.$$typeof===i||S.$$typeof===c||S.$$typeof===h||S.$$typeof===w||S.getModuleId!==void 0)},K.typeOf=x,K}var J={};/**
83
+ */var Vr;function lo(){if(Vr)return q;Vr=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.server_context"),h=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");function x(S){if(typeof S=="object"&&S!==null){var T=S.$$typeof;switch(T){case e:switch(S=S.type,S){case r:case o:case n:case c:case v:return S;default:switch(S=S&&S.$$typeof,S){case d:case l:case h:case w:case f:case i:return S;default:return T}}case t:return T}}}return q.ContextConsumer=l,q.ContextProvider=i,q.Element=e,q.ForwardRef=h,q.Fragment=r,q.Lazy=w,q.Memo=f,q.Portal=t,q.Profiler=o,q.StrictMode=n,q.Suspense=c,q.SuspenseList=v,q.isAsyncMode=function(){return!1},q.isConcurrentMode=function(){return!1},q.isContextConsumer=function(S){return x(S)===l},q.isContextProvider=function(S){return x(S)===i},q.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},q.isForwardRef=function(S){return x(S)===h},q.isFragment=function(S){return x(S)===r},q.isLazy=function(S){return x(S)===w},q.isMemo=function(S){return x(S)===f},q.isPortal=function(S){return x(S)===t},q.isProfiler=function(S){return x(S)===o},q.isStrictMode=function(S){return x(S)===n},q.isSuspense=function(S){return x(S)===c},q.isSuspenseList=function(S){return x(S)===v},q.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===o||S===n||S===c||S===v||S===p||typeof S=="object"&&S!==null&&(S.$$typeof===w||S.$$typeof===f||S.$$typeof===i||S.$$typeof===l||S.$$typeof===h||S.$$typeof===u||S.getModuleId!==void 0)},q.typeOf=x,q}var H={};/**
84
84
  * @license React
85
85
  * react-is.development.js
86
86
  *
@@ -88,12 +88,12 @@ 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 $r;function uo(){return $r||($r=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"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),h=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),w=!1,x=!1,S=!1,k=!1,C=!1,M;M=Symbol.for("react.module.reference");function m(z){return!!(typeof z=="string"||typeof z=="function"||z===r||z===o||C||z===n||z===s||z===p||k||z===b||w||x||S||typeof z=="object"&&z!==null&&(z.$$typeof===f||z.$$typeof===l||z.$$typeof===i||z.$$typeof===c||z.$$typeof===h||z.$$typeof===M||z.getModuleId!==void 0))}function g(z){if(typeof z=="object"&&z!==null){var fe=z.$$typeof;switch(fe){case e:var we=z.type;switch(we){case r:case o:case n:case s:case p:return we;default:var Me=we&&we.$$typeof;switch(Me){case u:case c:case h:case f:case l:case i:return Me;default:return fe}}case t:return fe}}}var I=c,V=i,Y=e,ne=h,X=r,Q=f,ce=l,Ae=t,se=o,he=n,je=s,Pe=p,Ee=!1,De=!1;function Te(z){return Ee||(Ee=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Ue(z){return De||(De=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Ie(z){return g(z)===c}function Se(z){return g(z)===i}function qe(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function et(z){return g(z)===h}function pe(z){return g(z)===r}function ve(z){return g(z)===f}function ye(z){return g(z)===l}function be(z){return g(z)===t}function Ce(z){return g(z)===o}function He(z){return g(z)===n}function D(z){return g(z)===s}function ge(z){return g(z)===p}J.ContextConsumer=I,J.ContextProvider=V,J.Element=Y,J.ForwardRef=ne,J.Fragment=X,J.Lazy=Q,J.Memo=ce,J.Portal=Ae,J.Profiler=se,J.StrictMode=he,J.Suspense=je,J.SuspenseList=Pe,J.isAsyncMode=Te,J.isConcurrentMode=Ue,J.isContextConsumer=Ie,J.isContextProvider=Se,J.isElement=qe,J.isForwardRef=et,J.isFragment=pe,J.isLazy=ve,J.isMemo=ye,J.isPortal=be,J.isProfiler=Ce,J.isStrictMode=He,J.isSuspense=D,J.isSuspenseList=ge,J.isValidElementType=m,J.typeOf=g})()),J}var Fr;function fo(){return Fr||(Fr=1,process.env.NODE_ENV==="production"?Ot.exports=lo():Ot.exports=uo()),Ot.exports}fo();function ho(){const e=eo();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=[],o=t;for(;o;)n.push(o),o=o.next;return n},subscribe(n){let o=!0,i=r={callback:n,next:null,prev:r};return i.prev?i.prev.next=i:t=i,function(){!o||t===null||(o=!1,i.next?i.next.prev=i.prev:r=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}const Xr={notify(){},get:()=>[]};function po(e,t){let r,n=Xr,o=0,i=!1;function c(x){p();const S=n.subscribe(x);let k=!1;return()=>{k||(k=!0,S(),l())}}function u(){n.notify()}function h(){w.onStateChange&&w.onStateChange()}function s(){return i}function p(){o++,r||(r=e.subscribe(h),n=ho())}function l(){o--,r&&o===0&&(r(),r=void 0,n.clear(),n=Xr)}function f(){i||(i=!0,p())}function b(){i&&(i=!1,l())}const w={addNestedSub:c,notifyNestedSubs:u,handleChangeWrapper:h,isSubscribed:s,trySubscribe:f,tryUnsubscribe:b,getListeners:()=>n};return w}const vo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?ke.useLayoutEffect:ke.useEffect;function yo({store:e,context:t,children:r,serverState:n,stabilityCheck:o="once",noopCheck:i="once"}){const c=ke.useMemo(()=>{const s=po(e);return{store:e,subscription:s,getServerState:n?()=>n:void 0,stabilityCheck:o,noopCheck:i}},[e,n,o,i]),u=ke.useMemo(()=>e.getState(),[e]);vo(()=>{const{subscription:s}=c;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),u!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[c,u]);const h=t||Ye;return ke.createElement(h.Provider,{value:c},r)}function Br(e=Ye){const t=e===Ye?Dr:Ht(e);return function(){const{store:n}=t();return n}}const go=Br();function mo(e=Ye){const t=e===Ye?go:Br(e);return function(){return t().dispatch}}const Kt=mo();ro(Jn.useSyncExternalStoreWithSelector),Qn(Vn.unstable_batchedUpdates);const bo={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"}},Ur=N.createContext(),qr="whiteboard-language",wo=()=>(navigator.language||navigator.userLanguage).startsWith("tr")?"tr":"en",xo=()=>{const e=localStorage.getItem(qr);return e&&(e==="en"||e==="tr")?e:wo()},Eo=({children:e})=>{const[t,r]=N.useState(xo);N.useEffect(()=>{localStorage.setItem(qr,t)},[t]);const n=i=>bo[t][i]||i,o=i=>{(i==="en"||i==="tr")&&r(i)};return y.jsx(Ur.Provider,{value:{language:t,t:n,changeLanguage:o},children:e})},Hr=()=>{const e=N.useContext(Ur);if(!e)throw new Error("useLanguage must be used within a LanguageProvider");return e};function ie(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 o=ko[e],i=o?typeof o=="function"?o.apply(null,r):o:"unknown error nr: "+e;throw Error("[Immer] "+i)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(c){return"'"+c+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Ve(e){return!!e&&!!e[ee]}function Re(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 o=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return o===Object||typeof o=="function"&&Function.toString.call(o)===Ro})(e)||Array.isArray(e)||!!e[on]||!!(!((t=e.constructor)===null||t===void 0)&&t[on])||Jt(e)||Zt(e))}function Je(e,t,r){r===void 0&&(r=!1),it(e)===0?(r?Object.keys:ct)(e).forEach((function(n){r&&typeof n=="symbol"||t(n,e[n],e)})):e.forEach((function(n,o){return t(o,n,e)}))}function it(e){var t=e[ee];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Jt(e)?2:Zt(e)?3:0}function at(e,t){return it(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function So(e,t){return it(e)===2?e.get(t):e[t]}function Gr(e,t,r){var n=it(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Kr(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Jt(e){return To&&e instanceof Map}function Zt(e){return Mo&&e instanceof Set}function $e(e){return e.o||e.t}function Qt(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=an(e);delete t[ee];for(var r=ct(t),n=0;n<r.length;n++){var o=r[n],i=t[o];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function er(e,t){return t===void 0&&(t=!1),tr(e)||Ve(e)||!Re(e)||(it(e)>1&&(e.set=e.add=e.clear=e.delete=Co),Object.freeze(e),t&&Je(e,(function(r,n){return er(n,!0)}),!0)),e}function Co(){ie(2)}function tr(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Oe(e){var t=ur[e];return t||ie(18,e),t}function _o(e,t){ur[e]||(ur[e]=t)}function rr(){return process.env.NODE_ENV==="production"||st||ie(0),st}function nr(e,t){t&&(Oe("Patches"),e.u=[],e.s=[],e.v=t)}function jt(e){or(e),e.p.forEach(Oo),e.p=null}function or(e){e===st&&(st=e.l)}function Jr(e){return st={p:[],l:st,h:e,m:!0,_:0}}function Oo(e){var t=e[ee];t.i===0||t.i===1?t.j():t.g=!0}function ir(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.O||Oe("ES5").S(t,e,n),n?(r[ee].P&&(jt(t),ie(4)),Re(e)&&(e=Pt(t,e),t.l||Tt(t,e)),t.u&&Oe("Patches").M(r[ee].t,e,t.u,t.s)):e=Pt(t,r,[]),jt(t),t.u&&t.v(t.u,t.s),e!==nn?e:void 0}function Pt(e,t,r){if(tr(t))return t;var n=t[ee];if(!n)return Je(t,(function(u,h){return Zr(e,n,t,u,h,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return Tt(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=n.i===4||n.i===5?n.o=Qt(n.k):n.o,i=o,c=!1;n.i===3&&(i=new Set(o),o.clear(),c=!0),Je(i,(function(u,h){return Zr(e,n,o,u,h,r,c)})),Tt(e,o,!1),r&&e.u&&Oe("Patches").N(n,r,e.u,e.s)}return n.o}function Zr(e,t,r,n,o,i,c){if(process.env.NODE_ENV!=="production"&&o===r&&ie(5),Ve(o)){var u=Pt(e,o,i&&t&&t.i!==3&&!at(t.R,n)?i.concat(n):void 0);if(Gr(r,n,u),!Ve(u))return;e.m=!1}else c&&r.add(o);if(Re(o)&&!tr(o)){if(!e.h.D&&e._<1)return;Pt(e,o),t&&t.A.l||Tt(e,o)}}function Tt(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&er(t,r)}function ar(e,t){var r=e[ee];return(r?$e(r):e)[t]}function Qr(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 Fe(e){e.P||(e.P=!0,e.l&&Fe(e.l))}function sr(e){e.o||(e.o=Qt(e.t))}function cr(e,t,r){var n=Jt(t)?Oe("MapSet").F(t,r):Zt(t)?Oe("MapSet").T(t,r):e.O?(function(o,i){var c=Array.isArray(o),u={i:c?1:0,A:i?i.A:rr(),P:!1,I:!1,R:{},l:i,t:o,k:null,o:null,j:null,C:!1},h=u,s=yt;c&&(h=[u],s=gt);var p=Proxy.revocable(h,s),l=p.revoke,f=p.proxy;return u.k=f,u.j=l,f})(t,r):Oe("ES5").J(t,r);return(r?r.A:rr()).p.push(n),n}function jo(e){return Ve(e)||ie(22,e),(function t(r){if(!Re(r))return r;var n,o=r[ee],i=it(r);if(o){if(!o.P&&(o.i<4||!Oe("ES5").K(o)))return o.t;o.I=!0,n=en(r,i),o.I=!1}else n=en(r,i);return Je(n,(function(c,u){o&&So(o.t,c)===u||Gr(n,c,t(u))})),i===3?new Set(n):n})(e)}function en(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Qt(e)}function Po(){function e(c,u){var h=i[c];return h?h.enumerable=u:i[c]=h={configurable:!0,enumerable:u,get:function(){var s=this[ee];return process.env.NODE_ENV!=="production"&&o(s),yt.get(s,c)},set:function(s){var p=this[ee];process.env.NODE_ENV!=="production"&&o(p),yt.set(p,c,s)}},h}function t(c){for(var u=c.length-1;u>=0;u--){var h=c[u][ee];if(!h.P)switch(h.i){case 5:n(h)&&Fe(h);break;case 4:r(h)&&Fe(h)}}}function r(c){for(var u=c.t,h=c.k,s=ct(h),p=s.length-1;p>=0;p--){var l=s[p];if(l!==ee){var f=u[l];if(f===void 0&&!at(u,l))return!0;var b=h[l],w=b&&b[ee];if(w?w.t!==f:!Kr(b,f))return!0}}var x=!!u[ee];return s.length!==ct(u).length+(x?0:1)}function n(c){var u=c.k;if(u.length!==c.t.length)return!0;var h=Object.getOwnPropertyDescriptor(u,u.length-1);if(h&&!h.get)return!0;for(var s=0;s<u.length;s++)if(!u.hasOwnProperty(s))return!0;return!1}function o(c){c.g&&ie(3,JSON.stringify($e(c)))}var i={};_o("ES5",{J:function(c,u){var h=Array.isArray(c),s=(function(l,f){if(l){for(var b=Array(f.length),w=0;w<f.length;w++)Object.defineProperty(b,""+w,e(w,!0));return b}var x=an(f);delete x[ee];for(var S=ct(x),k=0;k<S.length;k++){var C=S[k];x[C]=e(C,l||!!x[C].enumerable)}return Object.create(Object.getPrototypeOf(f),x)})(h,c),p={i:h?5:4,A:u?u.A:rr(),P:!1,I:!1,R:{},l:u,t:c,k:s,o:null,g:!1,C:!1};return Object.defineProperty(s,ee,{value:p,writable:!0}),s},S:function(c,u,h){h?Ve(u)&&u[ee].A===c&&t(c.p):(c.u&&(function s(p){if(p&&typeof p=="object"){var l=p[ee];if(l){var f=l.t,b=l.k,w=l.R,x=l.i;if(x===4)Je(b,(function(m){m!==ee&&(f[m]!==void 0||at(f,m)?w[m]||s(b[m]):(w[m]=!0,Fe(l)))})),Je(f,(function(m){b[m]!==void 0||at(b,m)||(w[m]=!1,Fe(l))}));else if(x===5){if(n(l)&&(Fe(l),w.length=!0),b.length<f.length)for(var S=b.length;S<f.length;S++)w[S]=!1;else for(var k=f.length;k<b.length;k++)w[k]=!0;for(var C=Math.min(b.length,f.length),M=0;M<C;M++)b.hasOwnProperty(M)||(w[M]=!0),w[M]===void 0&&s(b[M])}}}})(c.p[0]),t(c.p))},K:function(c){return c.i===4?r(c):n(c)}})}var tn,st,lr=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",To=typeof Map<"u",Mo=typeof Set<"u",rn=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",nn=lr?Symbol.for("immer-nothing"):((tn={})["immer-nothing"]=!0,tn),on=lr?Symbol.for("immer-draftable"):"__$immer_draftable",ee=lr?Symbol.for("immer-state"):"__$immer_state",ko={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"},Ro=""+Object.prototype.constructor,ct=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,an=Object.getOwnPropertyDescriptors||function(e){var t={};return ct(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},ur={},yt={get:function(e,t){if(t===ee)return e;var r=$e(e);if(!at(r,t))return(function(o,i,c){var u,h=Qr(i,c);return h?"value"in h?h.value:(u=h.get)===null||u===void 0?void 0:u.call(o.k):void 0})(e,r,t);var n=r[t];return e.I||!Re(n)?n:n===ar(e.t,t)?(sr(e),e.o[t]=cr(e.A.h,n,e)):n},has:function(e,t){return t in $e(e)},ownKeys:function(e){return Reflect.ownKeys($e(e))},set:function(e,t,r){var n=Qr($e(e),t);if(n!=null&&n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=ar($e(e),t),i=o==null?void 0:o[ee];if(i&&i.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(Kr(r,o)&&(r!==void 0||at(e.t,t)))return!0;sr(e),Fe(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 ar(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,sr(e),Fe(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=$e(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){ie(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){ie(12)}},gt={};Je(yt,(function(e,t){gt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),gt.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ie(13),gt.set.call(this,e,t,void 0)},gt.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ie(14),yt.set.call(this,e[0],t,r,e[0])};var No=(function(){function e(r){var n=this;this.O=rn,this.D=!0,this.produce=function(o,i,c){if(typeof o=="function"&&typeof i!="function"){var u=i;i=o;var h=n;return function(x){var S=this;x===void 0&&(x=u);for(var k=arguments.length,C=Array(k>1?k-1:0),M=1;M<k;M++)C[M-1]=arguments[M];return h.produce(x,(function(m){var g;return(g=i).call.apply(g,[S,m].concat(C))}))}}var s;if(typeof i!="function"&&ie(6),c!==void 0&&typeof c!="function"&&ie(7),Re(o)){var p=Jr(n),l=cr(n,o,void 0),f=!0;try{s=i(l),f=!1}finally{f?jt(p):or(p)}return typeof Promise<"u"&&s instanceof Promise?s.then((function(x){return nr(p,c),ir(x,p)}),(function(x){throw jt(p),x})):(nr(p,c),ir(s,p))}if(!o||typeof o!="object"){if((s=i(o))===void 0&&(s=o),s===nn&&(s=void 0),n.D&&er(s,!0),c){var b=[],w=[];Oe("Patches").M(o,s,b,w),c(b,w)}return s}ie(21,o)},this.produceWithPatches=function(o,i){if(typeof o=="function")return function(s){for(var p=arguments.length,l=Array(p>1?p-1:0),f=1;f<p;f++)l[f-1]=arguments[f];return n.produceWithPatches(s,(function(b){return o.apply(void 0,[b].concat(l))}))};var c,u,h=n.produce(o,i,(function(s,p){c=s,u=p}));return typeof Promise<"u"&&h instanceof Promise?h.then((function(s){return[s,c,u]})):[h,c,u]},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){Re(r)||ie(8),Ve(r)&&(r=jo(r));var n=Jr(this),o=cr(this,r,void 0);return o[ee].C=!0,or(n),o},t.finishDraft=function(r,n){var o=r&&r[ee];process.env.NODE_ENV!=="production"&&(o&&o.C||ie(9),o.I&&ie(10));var i=o.A;return nr(i,n),ir(void 0,i)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!rn&&ie(20),this.O=r},t.applyPatches=function(r,n){var o;for(o=n.length-1;o>=0;o--){var i=n[o];if(i.path.length===0&&i.op==="replace"){r=i.value;break}}o>-1&&(n=n.slice(o+1));var c=Oe("Patches").$;return Ve(r)?c(r,n):this.produce(r,(function(u){return c(u,n)}))},e})(),de=new No,sn=de.produce;de.produceWithPatches.bind(de),de.setAutoFreeze.bind(de),de.setUseProxies.bind(de),de.applyPatches.bind(de),de.createDraft.bind(de),de.finishDraft.bind(de);function mt(e){"@babel/helpers - typeof";return mt=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},mt(e)}function Ao(e,t){if(mt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(mt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Do(e){var t=Ao(e,"string");return mt(t)=="symbol"?t:t+""}function Io(e,t,r){return(t=Do(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ln(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cn(Object(r),!0).forEach(function(n){Io(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ae(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 un=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),fr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Ze={INIT:"@@redux/INIT"+fr(),REPLACE:"@@redux/REPLACE"+fr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+fr()}};function fn(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 zo(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(Yo(e))return"date";if(Lo(e))return"error";var r=Wo(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 Wo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Lo(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Yo(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Qe(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=zo(e)),t}function dn(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"?ae(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"?ae(1):"Expected the enhancer to be a function. Instead, received: '"+Qe(r)+"'");return r(dn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ae(2):"Expected the root reducer to be a function. Instead, received: '"+Qe(e)+"'");var o=e,i=t,c=[],u=c,h=!1;function s(){u===c&&(u=c.slice())}function p(){if(h)throw new Error(process.env.NODE_ENV==="production"?ae(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 i}function l(x){if(typeof x!="function")throw new Error(process.env.NODE_ENV==="production"?ae(4):"Expected the listener to be a function. Instead, received: '"+Qe(x)+"'");if(h)throw new Error(process.env.NODE_ENV==="production"?ae(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 s(),u.push(x),function(){if(S){if(h)throw new Error(process.env.NODE_ENV==="production"?ae(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,s();var C=u.indexOf(x);u.splice(C,1),c=null}}}function f(x){if(!fn(x))throw new Error(process.env.NODE_ENV==="production"?ae(7):"Actions must be plain objects. Instead, the actual type was: '"+Qe(x)+"'. 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 x.type>"u")throw new Error(process.env.NODE_ENV==="production"?ae(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(h)throw new Error(process.env.NODE_ENV==="production"?ae(9):"Reducers may not dispatch actions.");try{h=!0,i=o(i,x)}finally{h=!1}for(var S=c=u,k=0;k<S.length;k++){var C=S[k];C()}return x}function b(x){if(typeof x!="function")throw new Error(process.env.NODE_ENV==="production"?ae(10):"Expected the nextReducer to be a function. Instead, received: '"+Qe(x));o=x,f({type:Ze.REPLACE})}function w(){var x,S=l;return x={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?ae(11):"Expected the observer to be an object. Instead, received: '"+Qe(C)+"'");function M(){C.next&&C.next(p())}M();var m=S(M);return{unsubscribe:m}}},x[un]=function(){return this},x}return f({type:Ze.INIT}),n={dispatch:f,subscribe:l,getState:p,replaceReducer:b},n[un]=w,n}function hn(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function Vo(e,t,r,n){var o=Object.keys(t),i=r&&r.type===Ze.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(o.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(!fn(e))return"The "+i+' has unexpected type of "'+Qe(e)+'". Expected argument to be an object with the following '+('keys: "'+o.join('", "')+'"');var c=Object.keys(e).filter(function(u){return!t.hasOwnProperty(u)&&!n[u]});if(c.forEach(function(u){n[u]=!0}),!(r&&r.type===Ze.REPLACE)&&c.length>0)return"Unexpected "+(c.length>1?"keys":"key")+" "+('"'+c.join('", "')+'" found in '+i+". ")+"Expected to find one of the known reducer keys instead: "+('"'+o.join('", "')+'". Unexpected keys will be ignored.')}function $o(e){Object.keys(e).forEach(function(t){var r=e[t],n=r(void 0,{type:Ze.INIT});if(typeof n>"u")throw new Error(process.env.NODE_ENV==="production"?ae(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:Ze.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?ae(13):'The slice reducer for key "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle '"+Ze.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 Fo(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var o=t[n];process.env.NODE_ENV!=="production"&&typeof e[o]>"u"&&hn('No reducer provided for key "'+o+'"'),typeof e[o]=="function"&&(r[o]=e[o])}var i=Object.keys(r),c;process.env.NODE_ENV!=="production"&&(c={});var u;try{$o(r)}catch(h){u=h}return function(s,p){if(s===void 0&&(s={}),u)throw u;if(process.env.NODE_ENV!=="production"){var l=Vo(s,r,p,c);l&&hn(l)}for(var f=!1,b={},w=0;w<i.length;w++){var x=i[w],S=r[x],k=s[x],C=S(k,p);if(typeof C>"u"){var M=p&&p.type;throw new Error(process.env.NODE_ENV==="production"?ae(14):"When called with an action of type "+(M?'"'+String(M)+'"':"(unknown type)")+', the slice reducer for key "'+x+'" 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.')}b[x]=C,f=f||C!==k}return f=f||i.length!==Object.keys(s).length,f?b:s}}function Mt(){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,o){return function(){return n(o.apply(void 0,arguments))}})}function Xo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return function(){var o=n.apply(void 0,arguments),i=function(){throw new Error(process.env.NODE_ENV==="production"?ae(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},c={getState:o.getState,dispatch:function(){return i.apply(void 0,arguments)}},u=t.map(function(h){return h(c)});return i=Mt.apply(void 0,u)(o.dispatch),ln(ln({},o),{},{dispatch:i})}}}function pn(e){var t=function(n){var o=n.dispatch,i=n.getState;return function(c){return function(u){return typeof u=="function"?u(o,i,e):c(u)}}};return t}var dr=pn();dr.withExtraArgument=pn;var vn=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},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)}})(),Bo=function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(s){return function(p){return h([s,p])}}function h(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(p){s=[6,p],o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}},lt=function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Uo=Object.defineProperty,qo=Object.defineProperties,Ho=Object.getOwnPropertyDescriptors,yn=Object.getOwnPropertySymbols,Go=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable,gn=function(e,t,r){return t in e?Uo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},Xe=function(e,t){for(var r in t||(t={}))Go.call(t,r)&&gn(e,r,t[r]);if(yn)for(var n=0,o=yn(t);n<o.length;n++){var r=o[n];Ko.call(t,r)&&gn(e,r,t[r])}return e},hr=function(e,t){return qo(e,Ho(t))},Jo=function(e,t,r){return new Promise(function(n,o){var i=function(h){try{u(r.next(h))}catch(s){o(s)}},c=function(h){try{u(r.throw(h))}catch(s){o(s)}},u=function(h){return h.done?n(h.value):Promise.resolve(h.value).then(i,c)};u((r=r.apply(e,t)).next())})},Zo=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Mt:Mt.apply(null,arguments)};function mn(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 Qo=function(e){return e&&typeof e.match=="function"};function Be(e,t){function r(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(t){var i=t.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return Xe(Xe({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.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 ei(e){return typeof e=="function"&&"type"in e&&Qo(e)}function ti(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 $r;function uo(){return $r||($r=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"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.server_context"),h=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),u=!1,x=!1,S=!1,T=!1,A=!1,M;M=Symbol.for("react.module.reference");function m(W){return!!(typeof W=="string"||typeof W=="function"||W===r||W===o||A||W===n||W===c||W===v||T||W===p||u||x||S||typeof W=="object"&&W!==null&&(W.$$typeof===w||W.$$typeof===f||W.$$typeof===i||W.$$typeof===l||W.$$typeof===h||W.$$typeof===M||W.getModuleId!==void 0))}function b(W){if(typeof W=="object"&&W!==null){var se=W.$$typeof;switch(se){case e:var me=W.type;switch(me){case r:case o:case n:case c:case v:return me;default:var Te=me&&me.$$typeof;switch(Te){case d:case l:case h:case w:case f:case i:return Te;default:return se}}case t:return se}}}var _=l,X=i,$=e,ee=h,ne=r,Z=w,G=f,ue=t,ae=o,ye=n,Se=c,Ce=v,ge=!1,we=!1;function _e(W){return ge||(ge=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Fe(W){return we||(we=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Ne(W){return b(W)===l}function Xe(W){return b(W)===i}function Be(W){return typeof W=="object"&&W!==null&&W.$$typeof===e}function Oe(W){return b(W)===h}function je(W){return b(W)===r}function Ae(W){return b(W)===w}function fe(W){return b(W)===f}function he(W){return b(W)===t}function pe(W){return b(W)===o}function Pe(W){return b(W)===n}function I(W){return b(W)===c}function xe(W){return b(W)===v}H.ContextConsumer=_,H.ContextProvider=X,H.Element=$,H.ForwardRef=ee,H.Fragment=ne,H.Lazy=Z,H.Memo=G,H.Portal=ue,H.Profiler=ae,H.StrictMode=ye,H.Suspense=Se,H.SuspenseList=Ce,H.isAsyncMode=_e,H.isConcurrentMode=Fe,H.isContextConsumer=Ne,H.isContextProvider=Xe,H.isElement=Be,H.isForwardRef=Oe,H.isFragment=je,H.isLazy=Ae,H.isMemo=fe,H.isPortal=he,H.isProfiler=pe,H.isStrictMode=Pe,H.isSuspense=I,H.isSuspenseList=xe,H.isValidElementType=m,H.typeOf=b})()),H}var Fr;function fo(){return Fr||(Fr=1,process.env.NODE_ENV==="production"?jt.exports=lo():jt.exports=uo()),jt.exports}fo();function ho(){const e=eo();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=[],o=t;for(;o;)n.push(o),o=o.next;return n},subscribe(n){let o=!0,i=r={callback:n,next:null,prev:r};return i.prev?i.prev.next=i:t=i,function(){!o||t===null||(o=!1,i.next?i.next.prev=i.prev:r=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}const Xr={notify(){},get:()=>[]};function po(e,t){let r,n=Xr,o=0,i=!1;function l(x){v();const S=n.subscribe(x);let T=!1;return()=>{T||(T=!0,S(),f())}}function d(){n.notify()}function h(){u.onStateChange&&u.onStateChange()}function c(){return i}function v(){o++,r||(r=e.subscribe(h),n=ho())}function f(){o--,r&&o===0&&(r(),r=void 0,n.clear(),n=Xr)}function w(){i||(i=!0,v())}function p(){i&&(i=!1,f())}const u={addNestedSub:l,notifyNestedSubs:d,handleChangeWrapper:h,isSubscribed:c,trySubscribe:w,tryUnsubscribe:p,getListeners:()=>n};return u}const vo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?Me.useLayoutEffect:Me.useEffect;function yo({store:e,context:t,children:r,serverState:n,stabilityCheck:o="once",noopCheck:i="once"}){const l=Me.useMemo(()=>{const c=po(e);return{store:e,subscription:c,getServerState:n?()=>n:void 0,stabilityCheck:o,noopCheck:i}},[e,n,o,i]),d=Me.useMemo(()=>e.getState(),[e]);vo(()=>{const{subscription:c}=l;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),d!==e.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[l,d]);const h=t||ze;return Me.createElement(h.Provider,{value:l},r)}function Br(e=ze){const t=e===ze?Dr:qt(e);return function(){const{store:n}=t();return n}}const go=Br();function mo(e=ze){const t=e===ze?go:Br(e);return function(){return t().dispatch}}const Gt=mo();ro(Jn.useSyncExternalStoreWithSelector),Qn(Vn.unstable_batchedUpdates);const bo={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"}},Ur=N.createContext(),qr="whiteboard-language",wo=()=>(navigator.language||navigator.userLanguage).startsWith("tr")?"tr":"en",xo=()=>{const e=localStorage.getItem(qr);return e&&(e==="en"||e==="tr")?e:wo()},Eo=({children:e})=>{const[t,r]=N.useState(xo);N.useEffect(()=>{localStorage.setItem(qr,t)},[t]);const n=i=>bo[t][i]||i,o=i=>{(i==="en"||i==="tr")&&r(i)};return g.jsx(Ur.Provider,{value:{language:t,t:n,changeLanguage:o},children:e})},Hr=()=>{const e=N.useContext(Ur);if(!e)throw new Error("useLanguage must be used within a LanguageProvider");return e};function oe(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 o=ko[e],i=o?typeof o=="function"?o.apply(null,r):o:"unknown error nr: "+e;throw Error("[Immer] "+i)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(l){return"'"+l+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function We(e){return!!e&&!!e[K]}function ke(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 o=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return o===Object||typeof o=="function"&&Function.toString.call(o)===Ro})(e)||Array.isArray(e)||!!e[on]||!!(!((t=e.constructor)===null||t===void 0)&&t[on])||Kt(e)||Jt(e))}function qe(e,t,r){r===void 0&&(r=!1),rt(e)===0?(r?Object.keys:it)(e).forEach((function(n){r&&typeof n=="symbol"||t(n,e[n],e)})):e.forEach((function(n,o){return t(o,n,e)}))}function rt(e){var t=e[K];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Kt(e)?2:Jt(e)?3:0}function nt(e,t){return rt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function So(e,t){return rt(e)===2?e.get(t):e[t]}function Gr(e,t,r){var n=rt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Kr(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Kt(e){return To&&e instanceof Map}function Jt(e){return Mo&&e instanceof Set}function Le(e){return e.o||e.t}function Zt(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=an(e);delete t[K];for(var r=it(t),n=0;n<r.length;n++){var o=r[n],i=t[o];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Qt(e,t){return t===void 0&&(t=!1),er(e)||We(e)||!ke(e)||(rt(e)>1&&(e.set=e.add=e.clear=e.delete=Co),Object.freeze(e),t&&qe(e,(function(r,n){return Qt(n,!0)}),!0)),e}function Co(){oe(2)}function er(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Ee(e){var t=lr[e];return t||oe(18,e),t}function _o(e,t){lr[e]||(lr[e]=t)}function tr(){return process.env.NODE_ENV==="production"||ot||oe(0),ot}function rr(e,t){t&&(Ee("Patches"),e.u=[],e.s=[],e.v=t)}function Pt(e){nr(e),e.p.forEach(Oo),e.p=null}function nr(e){e===ot&&(ot=e.l)}function Jr(e){return ot={p:[],l:ot,h:e,m:!0,_:0}}function Oo(e){var t=e[K];t.i===0||t.i===1?t.j():t.g=!0}function or(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),oe(4)),ke(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!==nn?e:void 0}function Tt(e,t,r){if(er(t))return t;var n=t[K];if(!n)return qe(t,(function(d,h){return Zr(e,n,t,d,h,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 o=n.i===4||n.i===5?n.o=Zt(n.k):n.o,i=o,l=!1;n.i===3&&(i=new Set(o),o.clear(),l=!0),qe(i,(function(d,h){return Zr(e,n,o,d,h,r,l)})),Mt(e,o,!1),r&&e.u&&Ee("Patches").N(n,r,e.u,e.s)}return n.o}function Zr(e,t,r,n,o,i,l){if(process.env.NODE_ENV!=="production"&&o===r&&oe(5),We(o)){var d=Tt(e,o,i&&t&&t.i!==3&&!nt(t.R,n)?i.concat(n):void 0);if(Gr(r,n,d),!We(d))return;e.m=!1}else l&&r.add(o);if(ke(o)&&!er(o)){if(!e.h.D&&e._<1)return;Tt(e,o),t&&t.A.l||Mt(e,o)}}function Mt(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&Qt(t,r)}function ir(e,t){var r=e[K];return(r?Le(r):e)[t]}function Qr(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 Ye(e){e.P||(e.P=!0,e.l&&Ye(e.l))}function ar(e){e.o||(e.o=Zt(e.t))}function sr(e,t,r){var n=Kt(t)?Ee("MapSet").F(t,r):Jt(t)?Ee("MapSet").T(t,r):e.O?(function(o,i){var l=Array.isArray(o),d={i:l?1:0,A:i?i.A:tr(),P:!1,I:!1,R:{},l:i,t:o,k:null,o:null,j:null,C:!1},h=d,c=pt;l&&(h=[d],c=vt);var v=Proxy.revocable(h,c),f=v.revoke,w=v.proxy;return d.k=w,d.j=f,w})(t,r):Ee("ES5").J(t,r);return(r?r.A:tr()).p.push(n),n}function jo(e){return We(e)||oe(22,e),(function t(r){if(!ke(r))return r;var n,o=r[K],i=rt(r);if(o){if(!o.P&&(o.i<4||!Ee("ES5").K(o)))return o.t;o.I=!0,n=en(r,i),o.I=!1}else n=en(r,i);return qe(n,(function(l,d){o&&So(o.t,l)===d||Gr(n,l,t(d))})),i===3?new Set(n):n})(e)}function en(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Zt(e)}function Po(){function e(l,d){var h=i[l];return h?h.enumerable=d:i[l]=h={configurable:!0,enumerable:d,get:function(){var c=this[K];return process.env.NODE_ENV!=="production"&&o(c),pt.get(c,l)},set:function(c){var v=this[K];process.env.NODE_ENV!=="production"&&o(v),pt.set(v,l,c)}},h}function t(l){for(var d=l.length-1;d>=0;d--){var h=l[d][K];if(!h.P)switch(h.i){case 5:n(h)&&Ye(h);break;case 4:r(h)&&Ye(h)}}}function r(l){for(var d=l.t,h=l.k,c=it(h),v=c.length-1;v>=0;v--){var f=c[v];if(f!==K){var w=d[f];if(w===void 0&&!nt(d,f))return!0;var p=h[f],u=p&&p[K];if(u?u.t!==w:!Kr(p,w))return!0}}var x=!!d[K];return c.length!==it(d).length+(x?0:1)}function n(l){var d=l.k;if(d.length!==l.t.length)return!0;var h=Object.getOwnPropertyDescriptor(d,d.length-1);if(h&&!h.get)return!0;for(var c=0;c<d.length;c++)if(!d.hasOwnProperty(c))return!0;return!1}function o(l){l.g&&oe(3,JSON.stringify(Le(l)))}var i={};_o("ES5",{J:function(l,d){var h=Array.isArray(l),c=(function(f,w){if(f){for(var p=Array(w.length),u=0;u<w.length;u++)Object.defineProperty(p,""+u,e(u,!0));return p}var x=an(w);delete x[K];for(var S=it(x),T=0;T<S.length;T++){var A=S[T];x[A]=e(A,f||!!x[A].enumerable)}return Object.create(Object.getPrototypeOf(w),x)})(h,l),v={i:h?5:4,A:d?d.A:tr(),P:!1,I:!1,R:{},l:d,t:l,k:c,o:null,g:!1,C:!1};return Object.defineProperty(c,K,{value:v,writable:!0}),c},S:function(l,d,h){h?We(d)&&d[K].A===l&&t(l.p):(l.u&&(function c(v){if(v&&typeof v=="object"){var f=v[K];if(f){var w=f.t,p=f.k,u=f.R,x=f.i;if(x===4)qe(p,(function(m){m!==K&&(w[m]!==void 0||nt(w,m)?u[m]||c(p[m]):(u[m]=!0,Ye(f)))})),qe(w,(function(m){p[m]!==void 0||nt(p,m)||(u[m]=!1,Ye(f))}));else if(x===5){if(n(f)&&(Ye(f),u.length=!0),p.length<w.length)for(var S=p.length;S<w.length;S++)u[S]=!1;else for(var T=w.length;T<p.length;T++)u[T]=!0;for(var A=Math.min(p.length,w.length),M=0;M<A;M++)p.hasOwnProperty(M)||(u[M]=!0),u[M]===void 0&&c(p[M])}}}})(l.p[0]),t(l.p))},K:function(l){return l.i===4?r(l):n(l)}})}var tn,ot,cr=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",To=typeof Map<"u",Mo=typeof Set<"u",rn=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",nn=cr?Symbol.for("immer-nothing"):((tn={})["immer-nothing"]=!0,tn),on=cr?Symbol.for("immer-draftable"):"__$immer_draftable",K=cr?Symbol.for("immer-state"):"__$immer_state",ko={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"},Ro=""+Object.prototype.constructor,it=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,an=Object.getOwnPropertyDescriptors||function(e){var t={};return it(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},lr={},pt={get:function(e,t){if(t===K)return e;var r=Le(e);if(!nt(r,t))return(function(o,i,l){var d,h=Qr(i,l);return h?"value"in h?h.value:(d=h.get)===null||d===void 0?void 0:d.call(o.k):void 0})(e,r,t);var n=r[t];return e.I||!ke(n)?n:n===ir(e.t,t)?(ar(e),e.o[t]=sr(e.A.h,n,e)):n},has:function(e,t){return t in Le(e)},ownKeys:function(e){return Reflect.ownKeys(Le(e))},set:function(e,t,r){var n=Qr(Le(e),t);if(n!=null&&n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=ir(Le(e),t),i=o==null?void 0:o[K];if(i&&i.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(Kr(r,o)&&(r!==void 0||nt(e.t,t)))return!0;ar(e),Ye(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 ir(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,ar(e),Ye(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Le(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){oe(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){oe(12)}},vt={};qe(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))&&oe(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))&&oe(14),pt.set.call(this,e[0],t,r,e[0])};var No=(function(){function e(r){var n=this;this.O=rn,this.D=!0,this.produce=function(o,i,l){if(typeof o=="function"&&typeof i!="function"){var d=i;i=o;var h=n;return function(x){var S=this;x===void 0&&(x=d);for(var T=arguments.length,A=Array(T>1?T-1:0),M=1;M<T;M++)A[M-1]=arguments[M];return h.produce(x,(function(m){var b;return(b=i).call.apply(b,[S,m].concat(A))}))}}var c;if(typeof i!="function"&&oe(6),l!==void 0&&typeof l!="function"&&oe(7),ke(o)){var v=Jr(n),f=sr(n,o,void 0),w=!0;try{c=i(f),w=!1}finally{w?Pt(v):nr(v)}return typeof Promise<"u"&&c instanceof Promise?c.then((function(x){return rr(v,l),or(x,v)}),(function(x){throw Pt(v),x})):(rr(v,l),or(c,v))}if(!o||typeof o!="object"){if((c=i(o))===void 0&&(c=o),c===nn&&(c=void 0),n.D&&Qt(c,!0),l){var p=[],u=[];Ee("Patches").M(o,c,p,u),l(p,u)}return c}oe(21,o)},this.produceWithPatches=function(o,i){if(typeof o=="function")return function(c){for(var v=arguments.length,f=Array(v>1?v-1:0),w=1;w<v;w++)f[w-1]=arguments[w];return n.produceWithPatches(c,(function(p){return o.apply(void 0,[p].concat(f))}))};var l,d,h=n.produce(o,i,(function(c,v){l=c,d=v}));return typeof Promise<"u"&&h instanceof Promise?h.then((function(c){return[c,l,d]})):[h,l,d]},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){ke(r)||oe(8),We(r)&&(r=jo(r));var n=Jr(this),o=sr(this,r,void 0);return o[K].C=!0,nr(n),o},t.finishDraft=function(r,n){var o=r&&r[K];process.env.NODE_ENV!=="production"&&(o&&o.C||oe(9),o.I&&oe(10));var i=o.A;return rr(i,n),or(void 0,i)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!rn&&oe(20),this.O=r},t.applyPatches=function(r,n){var o;for(o=n.length-1;o>=0;o--){var i=n[o];if(i.path.length===0&&i.op==="replace"){r=i.value;break}}o>-1&&(n=n.slice(o+1));var l=Ee("Patches").$;return We(r)?l(r,n):this.produce(r,(function(d){return l(d,n)}))},e})(),de=new No,sn=de.produce;de.produceWithPatches.bind(de),de.setAutoFreeze.bind(de),de.setUseProxies.bind(de),de.applyPatches.bind(de),de.createDraft.bind(de),de.finishDraft.bind(de);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 Ao(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 Do(e){var t=Ao(e,"string");return yt(t)=="symbol"?t:t+""}function Io(e,t,r){return(t=Do(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ln(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cn(Object(r),!0).forEach(function(n){Io(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ie(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 un=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),ur=function(){return Math.random().toString(36).substring(7).split("").join(".")},He={INIT:"@@redux/INIT"+ur(),REPLACE:"@@redux/REPLACE"+ur(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ur()}};function fn(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 zo(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(Yo(e))return"date";if(Lo(e))return"error";var r=Wo(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 Wo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Lo(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Yo(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ge(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=zo(e)),t}function dn(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"?ie(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"?ie(1):"Expected the enhancer to be a function. Instead, received: '"+Ge(r)+"'");return r(dn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ie(2):"Expected the root reducer to be a function. Instead, received: '"+Ge(e)+"'");var o=e,i=t,l=[],d=l,h=!1;function c(){d===l&&(d=l.slice())}function v(){if(h)throw new Error(process.env.NODE_ENV==="production"?ie(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 i}function f(x){if(typeof x!="function")throw new Error(process.env.NODE_ENV==="production"?ie(4):"Expected the listener to be a function. Instead, received: '"+Ge(x)+"'");if(h)throw new Error(process.env.NODE_ENV==="production"?ie(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 c(),d.push(x),function(){if(S){if(h)throw new Error(process.env.NODE_ENV==="production"?ie(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,c();var A=d.indexOf(x);d.splice(A,1),l=null}}}function w(x){if(!fn(x))throw new Error(process.env.NODE_ENV==="production"?ie(7):"Actions must be plain objects. Instead, the actual type was: '"+Ge(x)+"'. 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 x.type>"u")throw new Error(process.env.NODE_ENV==="production"?ie(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(h)throw new Error(process.env.NODE_ENV==="production"?ie(9):"Reducers may not dispatch actions.");try{h=!0,i=o(i,x)}finally{h=!1}for(var S=l=d,T=0;T<S.length;T++){var A=S[T];A()}return x}function p(x){if(typeof x!="function")throw new Error(process.env.NODE_ENV==="production"?ie(10):"Expected the nextReducer to be a function. Instead, received: '"+Ge(x));o=x,w({type:He.REPLACE})}function u(){var x,S=f;return x={subscribe:function(A){if(typeof A!="object"||A===null)throw new Error(process.env.NODE_ENV==="production"?ie(11):"Expected the observer to be an object. Instead, received: '"+Ge(A)+"'");function M(){A.next&&A.next(v())}M();var m=S(M);return{unsubscribe:m}}},x[un]=function(){return this},x}return w({type:He.INIT}),n={dispatch:w,subscribe:f,getState:v,replaceReducer:p},n[un]=u,n}function hn(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function Vo(e,t,r,n){var o=Object.keys(t),i=r&&r.type===He.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(o.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(!fn(e))return"The "+i+' has unexpected type of "'+Ge(e)+'". Expected argument to be an object with the following '+('keys: "'+o.join('", "')+'"');var l=Object.keys(e).filter(function(d){return!t.hasOwnProperty(d)&&!n[d]});if(l.forEach(function(d){n[d]=!0}),!(r&&r.type===He.REPLACE)&&l.length>0)return"Unexpected "+(l.length>1?"keys":"key")+" "+('"'+l.join('", "')+'" found in '+i+". ")+"Expected to find one of the known reducer keys instead: "+('"'+o.join('", "')+'". Unexpected keys will be ignored.')}function $o(e){Object.keys(e).forEach(function(t){var r=e[t],n=r(void 0,{type:He.INIT});if(typeof n>"u")throw new Error(process.env.NODE_ENV==="production"?ie(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:He.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?ie(13):'The slice reducer for key "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle '"+He.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 Fo(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var o=t[n];process.env.NODE_ENV!=="production"&&typeof e[o]>"u"&&hn('No reducer provided for key "'+o+'"'),typeof e[o]=="function"&&(r[o]=e[o])}var i=Object.keys(r),l;process.env.NODE_ENV!=="production"&&(l={});var d;try{$o(r)}catch(h){d=h}return function(c,v){if(c===void 0&&(c={}),d)throw d;if(process.env.NODE_ENV!=="production"){var f=Vo(c,r,v,l);f&&hn(f)}for(var w=!1,p={},u=0;u<i.length;u++){var x=i[u],S=r[x],T=c[x],A=S(T,v);if(typeof A>"u"){var M=v&&v.type;throw new Error(process.env.NODE_ENV==="production"?ie(14):"When called with an action of type "+(M?'"'+String(M)+'"':"(unknown type)")+', the slice reducer for key "'+x+'" 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.')}p[x]=A,w=w||A!==T}return w=w||i.length!==Object.keys(c).length,w?p:c}}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,o){return function(){return n(o.apply(void 0,arguments))}})}function Xo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return function(){var o=n.apply(void 0,arguments),i=function(){throw new Error(process.env.NODE_ENV==="production"?ie(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},l={getState:o.getState,dispatch:function(){return i.apply(void 0,arguments)}},d=t.map(function(h){return h(l)});return i=kt.apply(void 0,d)(o.dispatch),ln(ln({},o),{},{dispatch:i})}}}function pn(e){var t=function(n){var o=n.dispatch,i=n.getState;return function(l){return function(d){return typeof d=="function"?d(o,i,e):l(d)}}};return t}var fr=pn();fr.withExtraArgument=pn;var vn=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},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)}})(),Bo=function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,l;return l={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function d(c){return function(v){return h([c,v])}}function h(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(v){c=[6,v],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},at=function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Uo=Object.defineProperty,qo=Object.defineProperties,Ho=Object.getOwnPropertyDescriptors,yn=Object.getOwnPropertySymbols,Go=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable,gn=function(e,t,r){return t in e?Uo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},Ve=function(e,t){for(var r in t||(t={}))Go.call(t,r)&&gn(e,r,t[r]);if(yn)for(var n=0,o=yn(t);n<o.length;n++){var r=o[n];Ko.call(t,r)&&gn(e,r,t[r])}return e},dr=function(e,t){return qo(e,Ho(t))},Jo=function(e,t,r){return new Promise(function(n,o){var i=function(h){try{d(r.next(h))}catch(c){o(c)}},l=function(h){try{d(r.throw(h))}catch(c){o(c)}},d=function(h){return h.done?n(h.value):Promise.resolve(h.value).then(i,l)};d((r=r.apply(e,t)).next())})},Zo=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 mn(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 Qo=function(e){return e&&typeof e.match=="function"};function $e(e,t){function r(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(t){var i=t.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return Ve(Ve({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.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 ei(e){return typeof e=="function"&&"type"in e&&Qo(e)}function ti(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 ri(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(n){return function(o){return n(o)}}};var t=e.isActionCreator,r=t===void 0?ei:t;return function(){return function(n){return function(o){return r(o)&&console.warn(ti(o.type)),n(o)}}}}function bn(e,t){var r=0;return{measureTime:function(n){var o=Date.now();try{return n()}finally{var i=Date.now();r+=i-o}},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
- It is disabled in production builds, so you don't need to worry about that.`)}}}var ni=(function(e){vn(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=e.apply(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}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,lt([void 0],r[0].concat(this)))):new(t.bind.apply(t,lt([void 0],r.concat(this))))},t})(Array),oi=(function(e){vn(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=e.apply(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}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,lt([void 0],r[0].concat(this)))):new(t.bind.apply(t,lt([void 0],r.concat(this))))},t})(Array);function pr(e){return Re(e)?sn(e,function(){}):e}var ii=process.env.NODE_ENV==="production",wn="Invariant failed";function xn(e,t){if(!e)throw ii?new Error(wn):new Error(wn+": "+(t||""))}function ai(e,t,r,n){return JSON.stringify(e,si(t,n),r)}function si(e,t){var r=[],n=[];return t||(t=function(o,i){return r[0]===i?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(i)).join(".")+"]"}),function(o,i){if(r.length>0){var c=r.indexOf(this);~c?r.splice(c+1):r.push(this),~c?n.splice(c,1/0,o):n.push(o),~r.indexOf(i)&&(i=t.call(this,o,i))}else r.push(i);return e==null?i:e.call(this,o,i)}}function ci(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function li(e,t,r){var n=En(e,t,r);return{detectMutations:function(){return Sn(e,t,n,r)}}}function En(e,t,r,n,o){t===void 0&&(t=[]),n===void 0&&(n=""),o===void 0&&(o=new Set);var i={value:r};if(!e(r)&&!o.has(r)){o.add(r),i.children={};for(var c in r){var u=n?n+"."+c:c;t.length&&t.indexOf(u)!==-1||(i.children[c]=En(e,t,r[c],u))}}return i}function Sn(e,t,r,n,o,i){t===void 0&&(t=[]),o===void 0&&(o=!1),i===void 0&&(i="");var c=r?r.value:void 0,u=c===n;if(o&&!u&&!Number.isNaN(n))return{wasMutated:!0,path:i};if(e(c)||e(n))return{wasMutated:!1};var h={};for(var s in r.children)h[s]=!0;for(var s in n)h[s]=!0;var p=t.length>0,l=function(b){var w=i?i+"."+b:b;if(p){var x=t.some(function(k){return k instanceof RegExp?k.test(w):w===k});if(x)return"continue"}var S=Sn(e,t,r.children[b],n[b],u,w);if(S.wasMutated)return{value:S}};for(var s in h){var f=l(s);if(typeof f=="object")return f.value}return{wasMutated:!1}}function ui(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(h){return function(s){return h(s)}}};var t=e.isImmutable,r=t===void 0?ci:t,n=e.ignoredPaths,o=e.warnAfter,i=o===void 0?32:o,c=e.ignore;n=n||c;var u=li.bind(null,r,n);return function(h){var s=h.getState,p=s(),l=u(p),f;return function(b){return function(w){var x=bn(i,"ImmutableStateInvariantMiddleware");x.measureTime(function(){p=s(),f=l.detectMutations(),l=u(p),xn(!f.wasMutated,"A state mutation was detected between dispatches, in the path '"+(f.path||"")+"'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")});var S=b(w);return x.measureTime(function(){p=s(),f=l.detectMutations(),l=u(p),f.wasMutated&&xn(!f.wasMutated,"A state mutation was detected inside a dispatch, in the path: "+(f.path||"")+". Take a look at the reducer(s) handling the action "+ai(w)+". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")}),x.warnIfExceeded(),S}}}}function Cn(e){var t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||mn(e)}function vr(e,t,r,n,o,i){t===void 0&&(t=""),r===void 0&&(r=Cn),o===void 0&&(o=[]);var c;if(!r(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||i!=null&&i.has(e))return!1;for(var u=n!=null?n(e):Object.entries(e),h=o.length>0,s=function(S,k){var C=t?t+"."+S:S;if(h){var M=o.some(function(m){return m instanceof RegExp?m.test(C):C===m});if(M)return"continue"}if(!r(k))return{value:{keyPath:C,value:k}};if(typeof k=="object"&&(c=vr(k,C,r,n,o,i),c))return{value:c}},p=0,l=u;p<l.length;p++){var f=l[p],b=f[0],w=f[1],x=s(b,w);if(typeof x=="object")return x.value}return i&&_n(e)&&i.add(e),!1}function _n(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)&&!_n(n))return!1}return!0}function fi(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(M){return function(m){return M(m)}}};var t=e.isSerializable,r=t===void 0?Cn:t,n=e.getEntries,o=e.ignoredActions,i=o===void 0?[]:o,c=e.ignoredActionPaths,u=c===void 0?["meta.arg","meta.baseQueryMeta"]:c,h=e.ignoredPaths,s=h===void 0?[]:h,p=e.warnAfter,l=p===void 0?32:p,f=e.ignoreState,b=f===void 0?!1:f,w=e.ignoreActions,x=w===void 0?!1:w,S=e.disableCache,k=S===void 0?!1:S,C=!k&&WeakSet?new WeakSet:void 0;return function(M){return function(m){return function(g){var I=m(g),V=bn(l,"SerializableStateInvariantMiddleware");return!x&&!(i.length&&i.indexOf(g.type)!==-1)&&V.measureTime(function(){var Y=vr(g,"",r,n,u,C);if(Y){var ne=Y.keyPath,X=Y.value;console.error("A non-serializable value was detected in an action, in the path: `"+ne+"`. Value:",X,`
95
- Take a look at the logic that dispatched this action: `,g,`
94
+ It is disabled in production builds, so you don't need to worry about that.`)}}}var ni=(function(e){vn(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=e.apply(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}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,at([void 0],r[0].concat(this)))):new(t.bind.apply(t,at([void 0],r.concat(this))))},t})(Array),oi=(function(e){vn(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=e.apply(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}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,at([void 0],r[0].concat(this)))):new(t.bind.apply(t,at([void 0],r.concat(this))))},t})(Array);function hr(e){return ke(e)?sn(e,function(){}):e}var ii=process.env.NODE_ENV==="production",wn="Invariant failed";function xn(e,t){if(!e)throw ii?new Error(wn):new Error(wn+": "+(t||""))}function ai(e,t,r,n){return JSON.stringify(e,si(t,n),r)}function si(e,t){var r=[],n=[];return t||(t=function(o,i){return r[0]===i?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(i)).join(".")+"]"}),function(o,i){if(r.length>0){var l=r.indexOf(this);~l?r.splice(l+1):r.push(this),~l?n.splice(l,1/0,o):n.push(o),~r.indexOf(i)&&(i=t.call(this,o,i))}else r.push(i);return e==null?i:e.call(this,o,i)}}function ci(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function li(e,t,r){var n=En(e,t,r);return{detectMutations:function(){return Sn(e,t,n,r)}}}function En(e,t,r,n,o){t===void 0&&(t=[]),n===void 0&&(n=""),o===void 0&&(o=new Set);var i={value:r};if(!e(r)&&!o.has(r)){o.add(r),i.children={};for(var l in r){var d=n?n+"."+l:l;t.length&&t.indexOf(d)!==-1||(i.children[l]=En(e,t,r[l],d))}}return i}function Sn(e,t,r,n,o,i){t===void 0&&(t=[]),o===void 0&&(o=!1),i===void 0&&(i="");var l=r?r.value:void 0,d=l===n;if(o&&!d&&!Number.isNaN(n))return{wasMutated:!0,path:i};if(e(l)||e(n))return{wasMutated:!1};var h={};for(var c in r.children)h[c]=!0;for(var c in n)h[c]=!0;var v=t.length>0,f=function(p){var u=i?i+"."+p:p;if(v){var x=t.some(function(T){return T instanceof RegExp?T.test(u):u===T});if(x)return"continue"}var S=Sn(e,t,r.children[p],n[p],d,u);if(S.wasMutated)return{value:S}};for(var c in h){var w=f(c);if(typeof w=="object")return w.value}return{wasMutated:!1}}function ui(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(h){return function(c){return h(c)}}};var t=e.isImmutable,r=t===void 0?ci:t,n=e.ignoredPaths,o=e.warnAfter,i=o===void 0?32:o,l=e.ignore;n=n||l;var d=li.bind(null,r,n);return function(h){var c=h.getState,v=c(),f=d(v),w;return function(p){return function(u){var x=bn(i,"ImmutableStateInvariantMiddleware");x.measureTime(function(){v=c(),w=f.detectMutations(),f=d(v),xn(!w.wasMutated,"A state mutation was detected between dispatches, in the path '"+(w.path||"")+"'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")});var S=p(u);return x.measureTime(function(){v=c(),w=f.detectMutations(),f=d(v),w.wasMutated&&xn(!w.wasMutated,"A state mutation was detected inside a dispatch, in the path: "+(w.path||"")+". Take a look at the reducer(s) handling the action "+ai(u)+". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")}),x.warnIfExceeded(),S}}}}function Cn(e){var t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||mn(e)}function pr(e,t,r,n,o,i){t===void 0&&(t=""),r===void 0&&(r=Cn),o===void 0&&(o=[]);var l;if(!r(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||i!=null&&i.has(e))return!1;for(var d=n!=null?n(e):Object.entries(e),h=o.length>0,c=function(S,T){var A=t?t+"."+S:S;if(h){var M=o.some(function(m){return m instanceof RegExp?m.test(A):A===m});if(M)return"continue"}if(!r(T))return{value:{keyPath:A,value:T}};if(typeof T=="object"&&(l=pr(T,A,r,n,o,i),l))return{value:l}},v=0,f=d;v<f.length;v++){var w=f[v],p=w[0],u=w[1],x=c(p,u);if(typeof x=="object")return x.value}return i&&_n(e)&&i.add(e),!1}function _n(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)&&!_n(n))return!1}return!0}function fi(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(M){return function(m){return M(m)}}};var t=e.isSerializable,r=t===void 0?Cn:t,n=e.getEntries,o=e.ignoredActions,i=o===void 0?[]:o,l=e.ignoredActionPaths,d=l===void 0?["meta.arg","meta.baseQueryMeta"]:l,h=e.ignoredPaths,c=h===void 0?[]:h,v=e.warnAfter,f=v===void 0?32:v,w=e.ignoreState,p=w===void 0?!1:w,u=e.ignoreActions,x=u===void 0?!1:u,S=e.disableCache,T=S===void 0?!1:S,A=!T&&WeakSet?new WeakSet:void 0;return function(M){return function(m){return function(b){var _=m(b),X=bn(f,"SerializableStateInvariantMiddleware");return!x&&!(i.length&&i.indexOf(b.type)!==-1)&&X.measureTime(function(){var $=pr(b,"",r,n,d,A);if($){var ee=$.keyPath,ne=$.value;console.error("A non-serializable value was detected in an action, in the path: `"+ee+"`. Value:",ne,`
95
+ Take a look at the logic that dispatched this action: `,b,`
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
- (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),b||(V.measureTime(function(){var Y=M.getState(),ne=vr(Y,"",r,n,s,C);if(ne){var X=ne.keyPath,Q=ne.value;console.error("A non-serializable value was detected in the state, in the path: `"+X+"`. Value:",Q,`
98
- Take a look at the reducer(s) handling this action type: `+g.type+`.
99
- (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),V.warnIfExceeded()),I}}}}function kt(e){return typeof e=="boolean"}function di(){return function(t){return hi(t)}}function hi(e){e===void 0&&(e={});var t=e.thunk,r=t===void 0?!0:t,n=e.immutableCheck,o=n===void 0?!0:n,i=e.serializableCheck,c=i===void 0?!0:i,u=e.actionCreatorCheck,h=u===void 0?!0:u,s=new ni;if(r&&(kt(r)?s.push(dr):s.push(dr.withExtraArgument(r.extraArgument))),process.env.NODE_ENV!=="production"){if(o){var p={};kt(o)||(p=o),s.unshift(ui(p))}if(c){var l={};kt(c)||(l=c),s.push(fi(l))}if(h){var f={};kt(h)||(f=h),s.unshift(ri(f))}}return s}var yr=process.env.NODE_ENV==="production";function pi(e){var t=di(),r=e||{},n=r.reducer,o=n===void 0?void 0:n,i=r.middleware,c=i===void 0?t():i,u=r.devTools,h=u===void 0?!0:u,s=r.preloadedState,p=s===void 0?void 0:s,l=r.enhancers,f=l===void 0?void 0:l,b;if(typeof o=="function")b=o;else if(mn(o))b=Fo(o);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 w=c;if(typeof w=="function"&&(w=w(t),!yr&&!Array.isArray(w)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!yr&&w.some(function(m){return typeof m!="function"}))throw new Error("each middleware provided to configureStore must be a function");var x=Xo.apply(void 0,w),S=Mt;h&&(S=Zo(Xe({trace:!yr},typeof h=="object"&&h)));var k=new oi(x),C=k;Array.isArray(f)?C=lt([x],f):typeof f=="function"&&(C=f(k));var M=S.apply(void 0,C);return dn(b,p,M)}function On(e){var t={},r=[],n,o={addCase:function(i,c){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 u=typeof i=="string"?i:i.type;if(!u)throw new Error("`builder.addCase` cannot be called with an empty action type");if(u in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[u]=c,o},addMatcher:function(i,c){if(process.env.NODE_ENV!=="production"&&n)throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return r.push({matcher:i,reducer:c}),o},addDefaultCase:function(i){if(process.env.NODE_ENV!=="production"&&n)throw new Error("`builder.addDefaultCase` can only be called once");return n=i,o}};return e(o),[t,r,n]}function vi(e){return typeof e=="function"}var jn=!1;function yi(e,t,r,n){r===void 0&&(r=[]),process.env.NODE_ENV!=="production"&&typeof t=="object"&&(jn||(jn=!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 o=typeof t=="function"?On(t):[t,r,n],i=o[0],c=o[1],u=o[2],h;if(vi(e))h=function(){return pr(e())};else{var s=pr(e);h=function(){return s}}function p(l,f){l===void 0&&(l=h());var b=lt([i[f.type]],c.filter(function(w){var x=w.matcher;return x(f)}).map(function(w){var x=w.reducer;return x}));return b.filter(function(w){return!!w}).length===0&&(b=[u]),b.reduce(function(w,x){if(x)if(Ve(w)){var S=w,k=x(S,f);return k===void 0?w:k}else{if(Re(w))return sn(w,function(C){return x(C,f)});var k=x(w,f);if(k===void 0){if(w===null)return w;throw Error("A case reducer on a non-draftable value must not return undefined")}return k}return w},l)}return p.getInitialState=h,p}var Pn=!1;function gi(e,t){return e+"/"+t}function mi(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:pr(e.initialState),n=e.reducers||{},o=Object.keys(n),i={},c={},u={};o.forEach(function(p){var l=n[p],f=gi(t,p),b,w;"reducer"in l?(b=l.reducer,w=l.prepare):b=l,i[p]=b,c[f]=b,u[p]=w?Be(f,w):Be(f)});function h(){process.env.NODE_ENV!=="production"&&typeof e.extraReducers=="object"&&(Pn||(Pn=!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 p=typeof e.extraReducers=="function"?On(e.extraReducers):[e.extraReducers],l=p[0],f=l===void 0?{}:l,b=p[1],w=b===void 0?[]:b,x=p[2],S=x===void 0?void 0:x,k=Xe(Xe({},f),c);return yi(r,function(C){for(var M in k)C.addCase(M,k[M]);for(var m=0,g=w;m<g.length;m++){var I=g[m];C.addMatcher(I.matcher,I.reducer)}S&&C.addDefaultCase(S)})}var s;return{name:t,reducer:function(p,l){return s||(s=h()),s(p,l)},actions:u,caseReducers:i,getInitialState:function(){return s||(s=h()),s.getInitialState()}}}var bi="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",wi=function(e){e===void 0&&(e=21);for(var t="",r=e;r--;)t+=bi[Math.random()*64|0];return t},xi=["name","message","stack","code"],gr=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),Tn=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),Ei=function(e){if(typeof e=="object"&&e!==null){for(var t={},r=0,n=xi;r<n.length;r++){var o=n[r];typeof e[o]=="string"&&(t[o]=e[o])}return t}return{message:String(e)}};(function(){function e(t,r,n){var o=Be(t+"/fulfilled",function(p,l,f,b){return{payload:p,meta:hr(Xe({},b||{}),{arg:f,requestId:l,requestStatus:"fulfilled"})}}),i=Be(t+"/pending",function(p,l,f){return{payload:void 0,meta:hr(Xe({},f||{}),{arg:l,requestId:p,requestStatus:"pending"})}}),c=Be(t+"/rejected",function(p,l,f,b,w){return{payload:b,error:(n&&n.serializeError||Ei)(p||"Rejected"),meta:hr(Xe({},w||{}),{arg:f,requestId:l,rejectedWithValue:!!b,requestStatus:"rejected",aborted:(p==null?void 0:p.name)==="AbortError",condition:(p==null?void 0:p.name)==="ConditionError"})}}),u=!1,h=typeof AbortController<"u"?AbortController:(function(){function p(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return p.prototype.abort=function(){process.env.NODE_ENV!=="production"&&(u||(u=!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'.")))},p})();function s(p){return function(l,f,b){var w=n!=null&&n.idGenerator?n.idGenerator(p):wi(),x=new h,S;function k(M){S=M,x.abort()}var C=(function(){return Jo(this,null,function(){var M,m,g,I,V,Y,ne;return Bo(this,function(X){switch(X.label){case 0:return X.trys.push([0,4,,5]),I=(M=n==null?void 0:n.condition)==null?void 0:M.call(n,p,{getState:f,extra:b}),Ci(I)?[4,I]:[3,2];case 1:I=X.sent(),X.label=2;case 2:if(I===!1||x.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return V=new Promise(function(Q,ce){return x.signal.addEventListener("abort",function(){return ce({name:"AbortError",message:S||"Aborted"})})}),l(i(w,p,(m=n==null?void 0:n.getPendingMeta)==null?void 0:m.call(n,{requestId:w,arg:p},{getState:f,extra:b}))),[4,Promise.race([V,Promise.resolve(r(p,{dispatch:l,getState:f,extra:b,requestId:w,signal:x.signal,abort:k,rejectWithValue:function(Q,ce){return new gr(Q,ce)},fulfillWithValue:function(Q,ce){return new Tn(Q,ce)}})).then(function(Q){if(Q instanceof gr)throw Q;return Q instanceof Tn?o(Q.payload,w,p,Q.meta):o(Q,w,p)})])];case 3:return g=X.sent(),[3,5];case 4:return Y=X.sent(),g=Y instanceof gr?c(null,w,p,Y.payload,Y.meta):c(Y,w,p),[3,5];case 5:return ne=n&&!n.dispatchConditionRejection&&c.match(g)&&g.meta.condition,ne||l(g),[2,g]}})})})();return Object.assign(C,{abort:k,requestId:w,arg:p,unwrap:function(){return C.then(Si)}})}}return Object.assign(s,{pending:i,rejected:c,fulfilled:o,typePrefix:t})}return e.withTypes=function(){return e},e})();function Si(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Ci(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var mr="listenerMiddleware";Be(mr+"/add"),Be(mr+"/removeAll"),Be(mr+"/remove");var Mn;typeof queueMicrotask=="function"&&queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis),Po();const kn=mi({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:o}=t.payload;e.toolProperties[r]&&(e.toolProperties[r][n]=o)},addElement(e,t){e.elements.push(t.payload)},updateElement(e,t){const{id:r,updates:n}=t.payload,o=e.elements.findIndex(i=>i.id===r);o!==-1&&(e.elements[o]={...e.elements[o],...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=[]},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(o=>o.id===r);if(n!==-1&&n<e.elements.length-1){const[o]=e.elements.splice(n,1);e.elements.push(o)}},sendToBack(e,t){const r=t.payload,n=e.elements.findIndex(o=>o.id===r);if(n>0){const[o]=e.elements.splice(n,1);e.elements.unshift(o)}},fitToView(e,t){const{canvasWidth:r,canvasHeight:n,padding:o=50}=t.payload,i=e.elements;if(i.length===0){e.viewport.panX=0,e.viewport.panY=0,e.viewport.zoom=1;return}let c=1/0,u=1/0,h=-1/0,s=-1/0;i.forEach(g=>{g.type==="rectangle"?(c=Math.min(c,g.x),u=Math.min(u,g.y),h=Math.max(h,g.x+g.width),s=Math.max(s,g.y+g.height)):g.type==="circle"?(c=Math.min(c,g.centerX-g.radius),u=Math.min(u,g.centerY-g.radius),h=Math.max(h,g.centerX+g.radius),s=Math.max(s,g.centerY+g.radius)):g.type==="pencil"&&g.points.length>0?g.points.forEach(I=>{c=Math.min(c,I.x),u=Math.min(u,I.y),h=Math.max(h,I.x),s=Math.max(s,I.y)}):g.type==="triangle"||g.type==="diamond"||g.type==="hexagon"||g.type==="octagon"?(c=Math.min(c,g.x),u=Math.min(u,g.y),h=Math.max(h,g.x+g.width),s=Math.max(s,g.y+g.height)):g.type==="star"||g.type==="heart"?(c=Math.min(c,g.centerX-g.size),u=Math.min(u,g.centerY-g.size),h=Math.max(h,g.centerX+g.size),s=Math.max(s,g.centerY+g.size)):g.type==="arrow"&&(c=Math.min(c,g.startX,g.endX),u=Math.min(u,g.startY,g.endY),h=Math.max(h,g.startX,g.endX),s=Math.max(s,g.startY,g.endY))});const p=h-c,l=s-u;if(p<=0||l<=0)return;const f=r-o*2,b=n-o*2,w=f/p,x=b/l,S=Math.min(w,x,5),k=(c+h)/2,C=(u+s)/2,M=r/2-k*S,m=n/2-C*S;e.viewport.zoom=Math.max(.1,S),e.viewport.panX=M,e.viewport.panY=m},setLocked(e,t){e.lock.isLocked=t.payload,t.payload&&(e.toolbar.selectedTool="pointer",e.selectedElementId=null)}}}),{setSelectedTool:Ne,setToolProperty:_i,addElement:me,updateElement:Rt,removeElement:Oi,setSelectedElement:bt,setPan:ji,setZoom:Pi,fitToView:Ti,bringToFront:Mi,sendToBack:ki,setLocked:Rn}=kn.actions,Nn=kn.reducer;let br=null;const Ri=e=>{br=e},Ni=e=>t=>r=>{var o;const n=t(r);return!((o=r.meta)!=null&&o.fromRemote)&&br&&br(r),n},An=pi({reducer:{whiteboard:Nn},middleware:e=>e().concat(Ni)}),Ai=()=>{const e=ue(t=>t.whiteboard.watermark);return y.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:y.jsx("div",{className:"watermark",children:e.text})})};var Dn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},In=N.createContext&&N.createContext(Dn),Di=["attr","size","title"];function Ii(e,t){if(e==null)return{};var r=zi(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zi(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 zn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).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?zn(Object(r),!0).forEach(function(n){Wi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wi(e,t,r){return t=Li(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Li(e){var t=Yi(e,"string");return typeof t=="symbol"?t:t+""}function Yi(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 Wn(e){return e&&e.map((t,r)=>N.createElement(t.tag,At({key:r},t.attr),Wn(t.child)))}function te(e){return t=>N.createElement(Vi,Nt({attr:At({},e.attr)},t),Wn(e.child))}function Vi(e){var t=r=>{var{attr:n,size:o,title:i}=e,c=Ii(e,Di),u=o||r.size||"1em",h;return r.className&&(h=r.className),e.className&&(h=(h?h+" ":"")+e.className),N.createElement("svg",Nt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,c,{className:h,style:At(At({color:e.color||r.color},r.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),i&&N.createElement("title",null,i),e.children)};return In!==void 0?N.createElement(In.Consumer,null,r=>t(r)):t(Dn)}function $i(e){return te({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 Fi(e){return te({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 Xi(e){return te({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 Bi(e){return te({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 Ui(e){return te({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 qi(e){return te({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 Hi(e){return te({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 Gi(e){return te({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 Ki(e){return te({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 Ji(e){return te({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 Zi(e){return te({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 Qi(e){return te({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 ea(e){return te({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 ta=({text:e})=>y.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:[y.jsx(Hi,{}),y.jsx("span",{children:e||"Locked"})]});function ra(e){return te({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 na(e){return te({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 oa(e){return te({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 ia(e){return te({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 aa(e){return te({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 sa(e){return te({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 ca(e){return te({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 la(e){return te({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 ua=({onExport:e})=>{const t=Kt(),{t:r,language:n,changeLanguage:o}=Hr(),i=ue(m=>m.whiteboard.toolbar.selectedTool),c=ue(m=>m.whiteboard.lock.isLocked),[u,h]=N.useState(!1),[s,p]=N.useState(!1),l=N.useRef(null),f=N.useRef(null),b=N.useRef(null),w=N.useRef(null),x=N.useRef(null),S=m=>{const g=m.target.files[0];if(!g)return;const I=new FileReader;I.onload=V=>{const Y=new Image;Y.onload=()=>{const ne=Date.now().toString();t(me({id:ne,type:"image",x:100,y:100,width:Y.width,height:Y.height,src:V.target.result})),t(Ne("pointer")),t(bt(ne))},Y.src=V.target.result},I.readAsDataURL(g),m.target.value=""};N.useEffect(()=>{const m=g=>{l.current&&!l.current.contains(g.target)&&f.current&&!f.current.contains(g.target)&&h(!1),w.current&&!w.current.contains(g.target)&&b.current&&!b.current.contains(g.target)&&p(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const k=[{name:"triangle",icon:y.jsx(Ji,{style:{transform:"rotate(-30deg)"}})},{name:"diamond",icon:y.jsx(na,{})},{name:"star",icon:y.jsx(ea,{})},{name:"heart",icon:y.jsx(Ui,{})},{name:"hexagon",icon:y.jsx(ca,{})},{name:"octagon",icon:y.jsx(la,{})},{name:"arrow",icon:y.jsx(ra,{})}],C=m=>{t(Ne(m)),h(!1)},M=m=>{o(m),p(!1)};return y.jsxs("div",{className:"toolbar",children:[y.jsx("button",{className:i==="pointer"?"active":"",onClick:()=>t(Ne("pointer")),title:r("pointer"),disabled:c,children:y.jsx(Gi,{})}),y.jsx("button",{className:i==="text"?"active":"",onClick:()=>t(Ne("text")),title:r("text"),disabled:c,children:y.jsx(aa,{})}),y.jsx("button",{onClick:()=>{var m;return(m=x.current)==null?void 0:m.click()},title:r("image"),disabled:c,children:y.jsx(qi,{})}),y.jsx("input",{type:"file",ref:x,style:{display:"none"},accept:"image/*",onChange:S}),y.jsx("button",{className:i==="pencil"?"active":"",onClick:()=>t(Ne("pencil")),title:r("pencil"),disabled:c,children:y.jsx(Ki,{})}),y.jsx("button",{className:i==="rectangle"?"active":"",onClick:()=>t(Ne("rectangle")),title:r("rectangle"),disabled:c,children:y.jsx(Qi,{})}),y.jsx("button",{className:i==="circle"?"active":"",onClick:()=>t(Ne("circle")),title:r("circle"),disabled:c,children:y.jsx($i,{})}),y.jsxs("div",{className:"ellipsis-container",children:[y.jsx("button",{ref:f,className:k.some(m=>m.name===i)?"active":"",onClick:()=>h(!u),title:r("moreShapes"),disabled:c,children:y.jsx(oa,{})}),u&&y.jsxs("div",{className:"shapes-popup",ref:l,children:[y.jsx("div",{className:"shapes-popup-header",children:r("moreShapes")}),y.jsx("div",{className:"shapes-popup-grid",children:k.map(m=>y.jsx("button",{className:i===m.name?"active":"",onClick:()=>C(m.name),title:r(m.name),children:m.icon},m.name))})]})]}),y.jsx("button",{className:i==="eraser"?"active":"",onClick:()=>t(Ne("eraser")),title:r("eraser"),disabled:c,children:y.jsx(Fi,{})}),y.jsx("button",{onClick:()=>t(Ti({canvasWidth:window.innerWidth,canvasHeight:window.innerHeight,padding:50})),title:r("fitToView"),children:y.jsx(Xi,{})}),y.jsx("button",{onClick:e,title:r("exportAsPng"),children:y.jsx(Zi,{})}),y.jsxs("div",{className:"language-container",children:[y.jsx("button",{ref:b,onClick:()=>p(!s),title:r("language"),children:y.jsx(Bi,{})}),s&&y.jsxs("div",{className:"language-popup",ref:w,children:[y.jsx("div",{className:"language-popup-header",children:r("language")}),y.jsxs("div",{className:"language-options",children:[y.jsxs("button",{className:n==="en"?"active":"",onClick:()=>M("en"),children:["πŸ‡ΊπŸ‡Έ ",r("english")]}),y.jsxs("button",{className:n==="tr"?"active":"",onClick:()=>M("tr"),children:["πŸ‡ΉπŸ‡· ",r("turkish")]})]})]})]}),y.jsx("button",{onClick:()=>t(Rn(!c)),title:c?"Unlock":"Lock",style:{color:c?"red":"inherit"},children:c?y.jsx(ia,{}):y.jsx(sa,{})})]})},fa=()=>{const e=Kt(),{t}=Hr(),r=ue(l=>l.whiteboard.toolbar.selectedTool),n=ue(l=>l.whiteboard.toolProperties),o=ue(l=>l.whiteboard.selectedElementId),i=ue(l=>l.whiteboard.elements),c=o?i.find(l=>l.id===o):null,u=(l,f,b)=>{e(_i({tool:l,property:f,value:b}))},h=(l,f)=>{o&&e(Rt({id:o,updates:{[l]:f}}))},s=()=>{o&&e(Mi(o))},p=()=>{o&&e(ki(o))};if(r==="pointer"&&c&&c.type==="text")return y.jsxs("div",{className:"prop-tools",children:[y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("fontSize")}),y.jsxs("select",{className:"font-size-selector",value:c.fontSize||16,onChange:l=>h("fontSize",parseInt(l.target.value)),children:[y.jsx("option",{value:"12",children:"12 px"}),y.jsx("option",{value:"14",children:"14 px"}),y.jsx("option",{value:"16",children:"16 px"}),y.jsx("option",{value:"18",children:"18 px"}),y.jsx("option",{value:"24",children:"24 px"}),y.jsx("option",{value:"32",children:"32 px"}),y.jsx("option",{value:"48",children:"48 px"}),y.jsx("option",{value:"64",children:"64 px"}),y.jsx("option",{value:"72",children:"72 px"})]})]}),y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("fontColor")}),y.jsx("input",{type:"color",value:c.fontColor||"#000000",onChange:l=>h("fontColor",l.target.value)})]}),y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("layerOrder")}),y.jsxs("div",{className:"layer-buttons",children:[y.jsx("button",{onClick:s,title:t("bringToFront"),children:y.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[y.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),y.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"white"})]})}),y.jsx("button",{onClick:p,title:t("sendToBack"),children:y.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[y.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),y.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"white"})]})})]})]})]});if(r==="pointer"&&c){const l=["rectangle","circle","triangle","diamond","star","heart","hexagon","octagon","arrow"].includes(c.type),f=c.type==="pencil";return y.jsxs("div",{className:"prop-tools",children:[l&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("strokeColor")}),y.jsx("input",{type:"color",value:c.strokeColor,onChange:b=>h("strokeColor",b.target.value)})]}),y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("fillColor")}),y.jsx("input",{type:"color",value:c.fillColor,onChange:b=>h("fillColor",b.target.value)})]}),y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("strokeWidth")}),y.jsxs("select",{className:"stroke-width-selector",value:c.lineWidth,onChange:b=>h("lineWidth",parseInt(b.target.value)),children:[y.jsx("option",{value:"1",children:"1 px"}),y.jsx("option",{value:"2",children:"2 px"}),y.jsx("option",{value:"4",children:"4 px"}),y.jsx("option",{value:"8",children:"8 px"})]})]})]}),f&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("brushColor")}),y.jsx("input",{type:"color",value:c.strokeColor,onChange:b=>h("strokeColor",b.target.value)})]}),y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("brushSize")}),y.jsxs("select",{className:"brush-size-selector",value:c.lineWidth,onChange:b=>h("lineWidth",parseInt(b.target.value)),children:[y.jsx("option",{value:"1",children:"1 px"}),y.jsx("option",{value:"2",children:"2 px"}),y.jsx("option",{value:"4",children:"4 px"}),y.jsx("option",{value:"8",children:"8 px"}),y.jsx("option",{value:"16",children:"16 px"})]})]})]}),y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("layerOrder")}),y.jsxs("div",{className:"layer-buttons",children:[y.jsx("button",{onClick:s,title:t("bringToFront"),children:y.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[y.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),y.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"white"})]})}),y.jsx("button",{onClick:p,title:t("sendToBack"),children:y.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[y.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),y.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"white"})]})})]})]})]})}return y.jsxs("div",{className:"prop-tools",children:[r==="text"&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("fontSize")}),y.jsxs("select",{className:"font-size-selector",value:n.text.fontSize,onChange:l=>u("text","fontSize",parseInt(l.target.value)),children:[y.jsx("option",{value:"12",children:"12 px"}),y.jsx("option",{value:"14",children:"14 px"}),y.jsx("option",{value:"16",children:"16 px"}),y.jsx("option",{value:"18",children:"18 px"}),y.jsx("option",{value:"24",children:"24 px"}),y.jsx("option",{value:"32",children:"32 px"}),y.jsx("option",{value:"48",children:"48 px"}),y.jsx("option",{value:"64",children:"64 px"}),y.jsx("option",{value:"72",children:"72 px"})]})]}),y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("fontColor")}),y.jsx("input",{type:"color",value:n.text.fontColor,onChange:l=>u("text","fontColor",l.target.value)})]})]}),r==="pencil"&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("brushColor")}),y.jsx("input",{type:"color",value:n.pencil.strokeColor,onChange:l=>u("pencil","strokeColor",l.target.value)})]}),y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("brushSize")}),y.jsxs("select",{className:"brush-size-selector",value:n.pencil.lineWidth,onChange:l=>u("pencil","lineWidth",parseInt(l.target.value)),children:[y.jsx("option",{value:"1",children:"1 px"}),y.jsx("option",{value:"2",children:"2 px"}),y.jsx("option",{value:"4",children:"4 px"}),y.jsx("option",{value:"8",children:"8 px"}),y.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")&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("strokeColor")}),y.jsx("input",{type:"color",value:n[r].strokeColor,onChange:l=>u(r,"strokeColor",l.target.value)})]}),y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("fillColor")}),y.jsx("input",{type:"color",value:n[r].fillColor,onChange:l=>u(r,"fillColor",l.target.value)})]}),y.jsxs("div",{className:"prop-tool-item",children:[y.jsx("span",{children:t("strokeWidth")}),y.jsxs("select",{className:"stroke-width-selector",value:n[r].lineWidth,onChange:l=>u(r,"lineWidth",parseInt(l.target.value)),children:[y.jsx("option",{value:"1",children:"1 px"}),y.jsx("option",{value:"2",children:"2 px"}),y.jsx("option",{value:"4",children:"4 px"}),y.jsx("option",{value:"8",children:"8 px"})]})]})]})]})},Ln=N.forwardRef(({onAction:e,watermark:t,isLocked:r,lockText:n,onLockChange:o},i)=>{var Yt;const c=N.useRef(null),u=Kt(),h=ue(a=>a.whiteboard.grid),s=ue(a=>a.whiteboard.toolbar.selectedTool),p=ue(a=>a.whiteboard.elements),l=ue(a=>a.whiteboard.viewport),f=ue(a=>a.whiteboard.toolProperties),b=ue(a=>a.whiteboard.selectedElementId),w=ue(a=>a.whiteboard.lock),x=w.isLocked,[S,k]=N.useState(!1),[C,M]=N.useState({x:0,y:0}),[m,g]=N.useState({x:0,y:0}),[I,V]=N.useState([]),[Y,ne]=N.useState(!1),[X,Q]=N.useState({x:0,y:0}),[ce,Ae]=N.useState(!1),[se,he]=N.useState(!1),[je,Pe]=N.useState(!1),[Ee,De]=N.useState({x:0,y:0}),[Te,Ue]=N.useState({y:0,initialZoom:1}),[Ie,Se]=N.useState(!1),[qe,et]=N.useState({x:0,y:0}),[pe,ve]=N.useState(""),[ye,be]=N.useState(null);N.useEffect(()=>{e&&Ri(e)},[e]),N.useImperativeHandle(i,()=>({canvas:c.current,applyAction:a=>{u({...a,meta:{...a.meta,fromRemote:!0}})}})),N.useEffect(()=>{r!==void 0&&r!==x&&u(Rn(r))},[r,x,u]),N.useEffect(()=>{o&&o(x)},[x,o]);const Ce=N.useCallback((a,v,_)=>{const E=a.canvas,T=E.width,P=E.height,A=Math.floor(-l.panX/l.zoom/v)*v,O=Math.floor(-l.panY/l.zoom/v)*v,L=Math.ceil((T/l.zoom-l.panX/l.zoom)/v)*v,Z=Math.ceil((P/l.zoom-l.panY/l.zoom)/v)*v;a.strokeStyle=_,a.lineWidth=.5/l.zoom;for(let q=A;q<=L;q+=v)a.beginPath(),a.moveTo(q,O),a.lineTo(q,Z),a.stroke();for(let q=O;q<=Z;q+=v)a.beginPath(),a.moveTo(A,q),a.lineTo(L,q),a.stroke()},[l]),He=N.useCallback((a,v,_)=>{const E=Math.min(v.x,_.x),T=Math.min(v.y,_.y),P=Math.abs(_.x-v.x),A=Math.abs(_.y-v.y);a.strokeStyle="#0066cc",a.lineWidth=1,a.setLineDash([5,5]),a.strokeRect(E,T,P,A),a.fillStyle="rgba(0, 102, 204, 0.1)",a.fillRect(E,T,P,A),a.setLineDash([])},[]),D=N.useCallback((a,v)=>{const{x:_,y:E,width:T,height:P,fillColor:A="#000",strokeColor:O="#000",lineWidth:L=2}=v;a.fillStyle=A,a.fillRect(_,E,T,P),a.strokeStyle=O,a.lineWidth=L,a.strokeRect(_,E,T,P)},[]),ge=N.useCallback((a,v)=>{const{centerX:_,centerY:E,radius:T,fillColor:P="#000",strokeColor:A="#000",lineWidth:O=2}=v;a.beginPath(),a.arc(_,E,T,0,Math.PI*2),a.fillStyle=P,a.fill(),a.strokeStyle=A,a.lineWidth=O,a.stroke()},[]),z=N.useCallback((a,v)=>{const{points:_,strokeColor:E="#000",lineWidth:T=2}=v;if(!(_.length<2)){a.strokeStyle=E,a.lineWidth=T,a.lineCap="round",a.lineJoin="round",a.beginPath(),a.moveTo(_[0].x,_[0].y);for(let P=1;P<_.length;P++)a.lineTo(_[P].x,_[P].y);a.stroke()}},[]),fe=N.useCallback((a,v)=>{const{x:_,y:E,text:T,fontSize:P=16,fontColor:A="#000"}=v;a.font=`${P}px sans-serif`,a.fillStyle=A,a.textBaseline="top",a.fillText(T,_,E)},[]),we=N.useCallback((a,v)=>{const{x:_,y:E,width:T,height:P,fillColor:A="#fff",strokeColor:O="#000",lineWidth:L=2}=v;a.beginPath(),a.moveTo(_+T/2,E),a.lineTo(_+T,E+P),a.lineTo(_,E+P),a.closePath(),a.fillStyle=A,a.fill(),a.strokeStyle=O,a.lineWidth=L,a.stroke()},[]),Me=N.useCallback((a,v)=>{const{x:_,y:E,width:T,height:P,fillColor:A="#fff",strokeColor:O="#000",lineWidth:L=2}=v;a.beginPath(),a.moveTo(_+T/2,E),a.lineTo(_+T,E+P/2),a.lineTo(_+T/2,E+P),a.lineTo(_,E+P/2),a.closePath(),a.fillStyle=A,a.fill(),a.strokeStyle=O,a.lineWidth=L,a.stroke()},[]),ze=N.useCallback((a,v)=>{const{centerX:_,centerY:E,size:T,fillColor:P="#ffff00",strokeColor:A="#000",lineWidth:O=2}=v,L=5,Z=T,q=T/2;a.beginPath();for(let d=0;d<L*2;d++){const j=d%2===0?Z:q,R=Math.PI/L*d-Math.PI/2,W=_+Math.cos(R)*j,$=E+Math.sin(R)*j;d===0?a.moveTo(W,$):a.lineTo(W,$)}a.closePath(),a.fillStyle=P,a.fill(),a.strokeStyle=A,a.lineWidth=O,a.stroke()},[]),ut=N.useCallback((a,v)=>{const{centerX:_,centerY:E,size:T,fillColor:P="#ff6b6b",strokeColor:A="#000",lineWidth:O=2}=v;a.beginPath();const L=E-T/2;a.moveTo(_,L+T/4),a.bezierCurveTo(_-T/2,L,_-T,L+T/2,_,E+T/2),a.bezierCurveTo(_+T,L+T/2,_+T/2,L,_,L+T/4),a.fillStyle=P,a.fill(),a.strokeStyle=A,a.lineWidth=O,a.stroke()},[]),tt=N.useCallback((a,v)=>{const{x:_,y:E,width:T,height:P,fillColor:A="#fff",strokeColor:O="#000",lineWidth:L=2}=v,Z=_+T/2,q=E+P/2,d=T/2,j=P/2;a.beginPath();for(let R=0;R<6;R++){const W=Math.PI/3*R-Math.PI/2,$=Z+Math.cos(W)*d,F=q+Math.sin(W)*j;R===0?a.moveTo($,F):a.lineTo($,F)}a.closePath(),a.fillStyle=A,a.fill(),a.strokeStyle=O,a.lineWidth=L,a.stroke()},[]),Ge=N.useCallback((a,v)=>{const{x:_,y:E,width:T,height:P,fillColor:A="#fff",strokeColor:O="#000",lineWidth:L=2}=v,Z=_+T/2,q=E+P/2,d=T/2,j=P/2;a.beginPath();for(let R=0;R<8;R++){const W=Math.PI/4*R-Math.PI/2,$=Z+Math.cos(W)*d,F=q+Math.sin(W)*j;R===0?a.moveTo($,F):a.lineTo($,F)}a.closePath(),a.fillStyle=A,a.fill(),a.strokeStyle=O,a.lineWidth=L,a.stroke()},[]),ft=N.useCallback((a,v)=>{const{startX:_,startY:E,endX:T,endY:P,fillColor:A="#000",strokeColor:O="#000",lineWidth:L=2}=v,Z=15,q=Math.atan2(P-E,T-_);a.beginPath(),a.moveTo(_,E),a.lineTo(T,P),a.strokeStyle=O,a.lineWidth=L,a.stroke(),a.beginPath(),a.moveTo(T,P),a.lineTo(T-Z*Math.cos(q-Math.PI/6),P-Z*Math.sin(q-Math.PI/6)),a.lineTo(T-Z*Math.cos(q+Math.PI/6),P-Z*Math.sin(q+Math.PI/6)),a.closePath(),a.fillStyle=A,a.fill()},[]),rt=N.useRef({}),dt=N.useRef(null),Dt=N.useCallback((a,v)=>{const{x:_,y:E,width:T,height:P,src:A}=v;if(rt.current[A]){const O=rt.current[A];O.complete&&a.drawImage(O,_,E,T,P)}else{const O=new Image;O.onload=()=>{rt.current[A]=O,dt.current&&dt.current()},O.src=A,rt.current[A]=O}},[]),ht=N.useCallback((a,v)=>{switch(v.type){case"rectangle":D(a,v);break;case"circle":ge(a,v);break;case"pencil":z(a,v);break;case"text":fe(a,v);break;case"triangle":we(a,v);break;case"diamond":Me(a,v);break;case"star":ze(a,v);break;case"heart":ut(a,v);break;case"hexagon":tt(a,v);break;case"octagon":Ge(a,v);break;case"arrow":ft(a,v);break;case"image":Dt(a,v);break}},[D,ge,z,fe,we,Me,ze,ut,tt,Ge,ft,Dt]),wr=N.useCallback(()=>{const a=c.current;if(!a)return;const v=document.createElement("canvas");v.width=a.width,v.height=a.height;const _=v.getContext("2d");_.fillStyle="#ffffff",_.fillRect(0,0,v.width,v.height),_.save(),_.translate(l.panX,l.panY),_.scale(l.zoom,l.zoom),p.forEach(P=>{ht(_,P)}),_.restore();const E=v.toDataURL("image/png"),T=document.createElement("a");T.download=`whiteboard-${Date.now()}.png`,T.href=E,T.click()},[l,p,ht]),wt=N.useCallback((a,v)=>{for(let _=p.length-1;_>=0;_--){const E=p[_];if(E.type==="rectangle"){if(a>=E.x&&a<=E.x+E.width&&v>=E.y&&v<=E.y+E.height)return E}else if(E.type==="circle"){if(Math.sqrt(Math.pow(a-E.centerX,2)+Math.pow(v-E.centerY,2))<=E.radius)return E}else if(E.type==="pencil")for(let P=1;P<E.points.length;P++){const A=E.points[P-1],O=E.points[P];if(It(a,v,A.x,A.y,O.x,O.y)<=5)return E}else if(E.type==="text"){const T=E.fontSize||16,P=E.text.length*T*.6,A=T;if(a>=E.x&&a<=E.x+P&&v>=E.y&&v<=E.y+A)return E}else if(E.type==="triangle"||E.type==="diamond"||E.type==="hexagon"||E.type==="octagon"){if(a>=E.x&&a<=E.x+E.width&&v>=E.y&&v<=E.y+E.height)return E}else if(E.type==="star"||E.type==="heart"){if(Math.sqrt(Math.pow(a-E.centerX,2)+Math.pow(v-E.centerY,2))<=E.size)return E}else if(E.type==="arrow"){if(It(a,v,E.startX,E.startY,E.endX,E.endY)<=10)return E}else if(E.type==="image"&&a>=E.x&&a<=E.x+E.width&&v>=E.y&&v<=E.y+E.height)return E}return null},[p]),It=(a,v,_,E,T,P)=>{const A=a-_,O=v-E,L=T-_,Z=P-E,q=A*L+O*Z,d=L*L+Z*Z;let j=-1;d!==0&&(j=q/d);let R,W;j<0?(R=_,W=E):j>1?(R=T,W=P):(R=_+j*L,W=E+j*Z);const $=a-R,F=v-W;return Math.sqrt($*$+F*F)},zt=N.useCallback((a,v)=>{if(a.strokeStyle="#0066cc",a.lineWidth=2,a.setLineDash([5,5]),v.type==="rectangle")a.strokeRect(v.x-4,v.y-4,v.width+8,v.height+8);else if(v.type==="circle")a.beginPath(),a.arc(v.centerX,v.centerY,v.radius+4,0,Math.PI*2),a.stroke();else if(v.type==="pencil"&&v.points.length>0){const _=Math.min(...v.points.map(A=>A.x)),E=Math.max(...v.points.map(A=>A.x)),T=Math.min(...v.points.map(A=>A.y)),P=Math.max(...v.points.map(A=>A.y));a.strokeRect(_-4,T-4,E-_+8,P-T+8)}else if(v.type==="text"){const _=v.fontSize||16,E=v.text.length*_*.6,T=_;a.strokeRect(v.x-4,v.y-4,E+8,T+8)}else if(v.type==="triangle"||v.type==="diamond"||v.type==="hexagon"||v.type==="octagon")a.strokeRect(v.x-4,v.y-4,v.width+8,v.height+8);else if(v.type==="star"||v.type==="heart")a.beginPath(),a.arc(v.centerX,v.centerY,v.size+4,0,Math.PI*2),a.stroke();else if(v.type==="arrow"){const _=Math.min(v.startX,v.endX),E=Math.max(v.startX,v.endX),T=Math.min(v.startY,v.endY),P=Math.max(v.startY,v.endY);a.strokeRect(_-4,T-4,E-_+8,P-T+8)}else v.type==="image"&&a.strokeRect(v.x-4,v.y-4,v.width+8,v.height+8);a.setLineDash([])},[]),_e=N.useCallback(()=>{const a=c.current;if(!a)return;const v=a.getContext("2d");v.clearRect(0,0,a.width,a.height),v.save(),v.translate(l.panX,l.panY),v.scale(l.zoom,l.zoom),h.enabled&&Ce(v,h.size,h.color),p.forEach(_=>{ht(v,_),_.id===b&&zt(v,_)}),v.restore()},[h,Ce,p,ht,b,zt,l]);N.useEffect(()=>{dt.current=_e},[_e]),N.useEffect(()=>{const a=c.current;if(!a)return;const v=()=>{a.width=window.innerWidth,a.height=window.innerHeight,_e()};return v(),window.addEventListener("resize",v),()=>{window.removeEventListener("resize",v)}},[_e]),N.useEffect(()=>{_e()},[_e]),N.useEffect(()=>{const a=_=>{_.target.tagName==="INPUT"||_.target.tagName==="TEXTAREA"||_.code==="Space"&&!_.repeat&&(_.preventDefault(),Ae(!0))},v=_=>{_.target.tagName==="INPUT"||_.target.tagName==="TEXTAREA"||_.code==="Space"&&(_.preventDefault(),Ae(!1),he(!1),Pe(!1))};return window.addEventListener("keydown",a),window.addEventListener("keyup",v),()=>{window.removeEventListener("keydown",a),window.removeEventListener("keyup",v)}},[]);const nt=N.useCallback((a,v)=>({x:(a-l.panX)/l.zoom,y:(v-l.panY)/l.zoom}),[l]);N.useEffect(()=>{const a=c.current;if(!a||!S)return;const v=a.getContext("2d");if(_e(),v.save(),v.translate(l.panX,l.panY),v.scale(l.zoom,l.zoom),s==="pointer")He(v,C,m);else if(s==="rectangle"){const _=Math.min(C.x,m.x),E=Math.min(C.y,m.y),T=Math.abs(m.x-C.x),P=Math.abs(m.y-C.y);D(v,{x:_,y:E,width:T,height:P,strokeColor:f.rectangle.strokeColor,fillColor:f.rectangle.fillColor,lineWidth:f.rectangle.lineWidth})}else if(s==="circle"){const _=C.x,E=C.y,T=Math.sqrt(Math.pow(m.x-C.x,2)+Math.pow(m.y-C.y,2));ge(v,{centerX:_,centerY:E,radius:T,strokeColor:f.circle.strokeColor,fillColor:f.circle.fillColor,lineWidth:f.circle.lineWidth})}else if(s==="pencil")z(v,{points:I,strokeColor:f.pencil.strokeColor,lineWidth:f.pencil.lineWidth});else if(s==="triangle"){const _=Math.min(C.x,m.x),E=Math.min(C.y,m.y),T=Math.abs(m.x-C.x),P=Math.abs(m.y-C.y);we(v,{x:_,y:E,width:T,height:P,strokeColor:f.triangle.strokeColor,fillColor:f.triangle.fillColor,lineWidth:f.triangle.lineWidth})}else if(s==="diamond"){const _=Math.min(C.x,m.x),E=Math.min(C.y,m.y),T=Math.abs(m.x-C.x),P=Math.abs(m.y-C.y);Me(v,{x:_,y:E,width:T,height:P,strokeColor:f.diamond.strokeColor,fillColor:f.diamond.fillColor,lineWidth:f.diamond.lineWidth})}else if(s==="star"){const _=C.x,E=C.y,T=Math.sqrt(Math.pow(m.x-C.x,2)+Math.pow(m.y-C.y,2));ze(v,{centerX:_,centerY:E,size:T,strokeColor:f.star.strokeColor,fillColor:f.star.fillColor,lineWidth:f.star.lineWidth})}else if(s==="heart"){const _=C.x,E=C.y,T=Math.sqrt(Math.pow(m.x-C.x,2)+Math.pow(m.y-C.y,2));ut(v,{centerX:_,centerY:E,size:T,strokeColor:f.heart.strokeColor,fillColor:f.heart.fillColor,lineWidth:f.heart.lineWidth})}else if(s==="hexagon"){const _=Math.min(C.x,m.x),E=Math.min(C.y,m.y),T=Math.abs(m.x-C.x),P=Math.abs(m.y-C.y);tt(v,{x:_,y:E,width:T,height:P,strokeColor:f.hexagon.strokeColor,fillColor:f.hexagon.fillColor,lineWidth:f.hexagon.lineWidth})}else if(s==="octagon"){const _=Math.min(C.x,m.x),E=Math.min(C.y,m.y),T=Math.abs(m.x-C.x),P=Math.abs(m.y-C.y);Ge(v,{x:_,y:E,width:T,height:P,strokeColor:f.octagon.strokeColor,fillColor:f.octagon.fillColor,lineWidth:f.octagon.lineWidth})}else s==="arrow"&&ft(v,{startX:C.x,startY:C.y,endX:m.x,endY:m.y,strokeColor:f.arrow.strokeColor,fillColor:f.arrow.fillColor,lineWidth:f.arrow.lineWidth});v.restore()},[S,s,C,m,I,_e,He,D,ge,z,we,Me,ze,ut,tt,Ge,ft,l,f]);const Wt=a=>{const _=c.current.getBoundingClientRect(),E=a.clientX-_.left,T=a.clientY-_.top;if(x||Ie)return;if(ce){a.preventDefault(),a.button===0?(he(!0),De({x:E-l.panX,y:T-l.panY})):a.button===2&&(Pe(!0),Ue({y:T,initialZoom:l.zoom}));return}const{x:P,y:A}=nt(E,T);if(s==="pointer"){const O=wt(P,A);if(O)if(u(bt(O.id)),ne(!0),O.type==="rectangle")Q({x:P-O.x,y:A-O.y});else if(O.type==="circle")Q({x:P-O.centerX,y:A-O.centerY});else if(O.type==="pencil"){const L=Math.min(...O.points.map(q=>q.x)),Z=Math.min(...O.points.map(q=>q.y));Q({x:P-L,y:A-Z})}else O.type==="text"?Q({x:P-O.x,y:A-O.y}):O.type==="triangle"||O.type==="diamond"||O.type==="hexagon"||O.type==="octagon"?Q({x:P-O.x,y:A-O.y}):O.type==="star"||O.type==="heart"?Q({x:P-O.centerX,y:A-O.centerY}):O.type==="arrow"?Q({x:P-O.startX,y:A-O.startY}):O.type==="image"&&Q({x:P-O.x,y:A-O.y});else u(bt(null)),k(!0),M({x:P,y:A}),g({x:P,y:A})}else if(s==="text"){const O=Date.now().toString();u(me({id:O,type:"text",x:P,y:A,text:"Text",fontSize:f.text.fontSize,fontColor:f.text.fontColor})),u(Ne("pointer")),u(bt(O))}else if(s==="eraser"){const O=wt(P,A);O&&u(Oi(O.id))}else u(bt(null)),k(!0),M({x:P,y:A}),g({x:P,y:A}),s==="pencil"&&V([{x:P,y:A}])},Ke=a=>{const _=c.current.getBoundingClientRect(),E=a.clientX-_.left,T=a.clientY-_.top;if(se){u(ji({x:E-Ee.x,y:T-Ee.y}));return}if(je){const O=Te.y-T,Z=Te.initialZoom*(1+O*.005);u(Pi(Z));return}const{x:P,y:A}=nt(E,T);if(Y&&b){const O=p.find(Z=>Z.id===b);if(!O)return;let L={};if(O.type==="rectangle")L={x:P-X.x,y:A-X.y};else if(O.type==="circle")L={centerX:P-X.x,centerY:A-X.y};else if(O.type==="pencil"){const Z=Math.min(...O.points.map(R=>R.x)),q=Math.min(...O.points.map(R=>R.y)),d=P-X.x-Z,j=A-X.y-q;L={points:O.points.map(R=>({x:R.x+d,y:R.y+j}))}}else if(O.type==="text")L={x:P-X.x,y:A-X.y};else if(O.type==="triangle"||O.type==="diamond"||O.type==="hexagon"||O.type==="octagon")L={x:P-X.x,y:A-X.y};else if(O.type==="star"||O.type==="heart")L={centerX:P-X.x,centerY:A-X.y};else if(O.type==="arrow"){const Z=O.endX-O.startX,q=O.endY-O.startY;L={startX:P-X.x,startY:A-X.y,endX:P-X.x+Z,endY:A-X.y+q}}else O.type==="image"&&(L={x:P-X.x,y:A-X.y});u(Rt({id:b,updates:L}));return}S&&(g({x:P,y:A}),s==="pencil"&&V(O=>[...O,{x:P,y:A}]))},pt=()=>{if(se||je){he(!1),Pe(!1);return}if(Y){ne(!1);return}if(S){if(s==="pointer")_e();else if(s==="rectangle"){const a=Math.min(C.x,m.x),v=Math.min(C.y,m.y),_=Math.abs(m.x-C.x),E=Math.abs(m.y-C.y);_>0&&E>0&&u(me({id:Date.now().toString(),type:"rectangle",x:a,y:v,width:_,height:E,strokeColor:f.rectangle.strokeColor,fillColor:f.rectangle.fillColor,lineWidth:f.rectangle.lineWidth}))}else if(s==="circle"){const a=C.x,v=C.y,_=Math.sqrt(Math.pow(m.x-C.x,2)+Math.pow(m.y-C.y,2));_>0&&u(me({id:Date.now().toString(),type:"circle",centerX:a,centerY:v,radius:_,strokeColor:f.circle.strokeColor,fillColor:f.circle.fillColor,lineWidth:f.circle.lineWidth}))}else if(s==="pencil")I.length>1&&u(me({id:Date.now().toString(),type:"pencil",points:[...I],strokeColor:f.pencil.strokeColor,lineWidth:f.pencil.lineWidth})),V([]);else if(s==="triangle"){const a=Math.min(C.x,m.x),v=Math.min(C.y,m.y),_=Math.abs(m.x-C.x),E=Math.abs(m.y-C.y);_>0&&E>0&&u(me({id:Date.now().toString(),type:"triangle",x:a,y:v,width:_,height:E,strokeColor:f.triangle.strokeColor,fillColor:f.triangle.fillColor,lineWidth:f.triangle.lineWidth}))}else if(s==="diamond"){const a=Math.min(C.x,m.x),v=Math.min(C.y,m.y),_=Math.abs(m.x-C.x),E=Math.abs(m.y-C.y);_>0&&E>0&&u(me({id:Date.now().toString(),type:"diamond",x:a,y:v,width:_,height:E,strokeColor:f.diamond.strokeColor,fillColor:f.diamond.fillColor,lineWidth:f.diamond.lineWidth}))}else if(s==="star"){const a=C.x,v=C.y,_=Math.sqrt(Math.pow(m.x-C.x,2)+Math.pow(m.y-C.y,2));_>0&&u(me({id:Date.now().toString(),type:"star",centerX:a,centerY:v,size:_,strokeColor:f.star.strokeColor,fillColor:f.star.fillColor,lineWidth:f.star.lineWidth}))}else if(s==="heart"){const a=C.x,v=C.y,_=Math.sqrt(Math.pow(m.x-C.x,2)+Math.pow(m.y-C.y,2));_>0&&u(me({id:Date.now().toString(),type:"heart",centerX:a,centerY:v,size:_,strokeColor:f.heart.strokeColor,fillColor:f.heart.fillColor,lineWidth:f.heart.lineWidth}))}else if(s==="hexagon"){const a=Math.min(C.x,m.x),v=Math.min(C.y,m.y),_=Math.abs(m.x-C.x),E=Math.abs(m.y-C.y);_>0&&E>0&&u(me({id:Date.now().toString(),type:"hexagon",x:a,y:v,width:_,height:E,strokeColor:f.hexagon.strokeColor,fillColor:f.hexagon.fillColor,lineWidth:f.hexagon.lineWidth}))}else if(s==="octagon"){const a=Math.min(C.x,m.x),v=Math.min(C.y,m.y),_=Math.abs(m.x-C.x),E=Math.abs(m.y-C.y);_>0&&E>0&&u(me({id:Date.now().toString(),type:"octagon",x:a,y:v,width:_,height:E,strokeColor:f.octagon.strokeColor,fillColor:f.octagon.fillColor,lineWidth:f.octagon.lineWidth}))}else if(s==="arrow"){const a=m.x-C.x,v=m.y-C.y;Math.sqrt(a*a+v*v)>5&&u(me({id:Date.now().toString(),type:"arrow",startX:C.x,startY:C.y,endX:m.x,endY:m.y,strokeColor:f.arrow.strokeColor,fillColor:f.arrow.fillColor,lineWidth:f.arrow.lineWidth}))}k(!1)}},xt=a=>{ce&&a.preventDefault()},Lt=()=>ce?se?"grabbing":je?"ns-resize":"grab":"default";return y.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[y.jsx("canvas",{ref:c,onMouseDown:Wt,onMouseMove:Ke,onMouseUp:pt,onMouseLeave:pt,onDoubleClick:a=>{const _=c.current.getBoundingClientRect(),E=a.clientX-_.left,T=a.clientY-_.top,{x:P,y:A}=nt(E,T),O=wt(P,A);O&&O.type==="text"&&(be(O.id),et({x:O.x,y:O.y}),ve(O.text),Se(!0))},onContextMenu:xt,style:{cursor:Lt()}}),x&&y.jsx(ta,{text:n||((Yt=t==null?void 0:t.lock)==null?void 0:Yt.text)||w.text}),Ie&&y.jsx("input",{type:"text",value:pe,onChange:a=>ve(a.target.value),onKeyDown:a=>{a.key==="Enter"&&pe.trim()?(ye&&u(Rt({id:ye,updates:{text:pe}})),Se(!1),ve(""),be(null)):a.key==="Escape"&&(Se(!1),ve(""),be(null))},onBlur:()=>{pe.trim()&&ye&&u(Rt({id:ye,updates:{text:pe}})),Se(!1),ve(""),be(null)},onMouseDown:a=>a.stopPropagation(),autoFocus:!0,style:{position:"absolute",left:qe.x*l.zoom+l.panX,top:qe.y*l.zoom+l.panY,fontSize:f.text.fontSize*l.zoom,color:f.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)"}}),y.jsx(ua,{onExport:wr}),y.jsx(fa,{}),y.jsx(Ai,{})]})}),da=e=>y.jsx(yo,{store:An,children:y.jsx(Eo,{children:y.jsx(Ln,{...e})})});xe.WhiteboardComponent=Ln,xe.default=da,xe.store=An,xe.whiteboardReducer=Nn,Object.defineProperties(xe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
97
+ (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),p||(X.measureTime(function(){var $=M.getState(),ee=pr($,"",r,n,c,A);if(ee){var ne=ee.keyPath,Z=ee.value;console.error("A non-serializable value was detected in the state, in the path: `"+ne+"`. Value:",Z,`
98
+ Take a look at the reducer(s) handling this action type: `+b.type+`.
99
+ (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),X.warnIfExceeded()),_}}}}function Rt(e){return typeof e=="boolean"}function di(){return function(t){return hi(t)}}function hi(e){e===void 0&&(e={});var t=e.thunk,r=t===void 0?!0:t,n=e.immutableCheck,o=n===void 0?!0:n,i=e.serializableCheck,l=i===void 0?!0:i,d=e.actionCreatorCheck,h=d===void 0?!0:d,c=new ni;if(r&&(Rt(r)?c.push(fr):c.push(fr.withExtraArgument(r.extraArgument))),process.env.NODE_ENV!=="production"){if(o){var v={};Rt(o)||(v=o),c.unshift(ui(v))}if(l){var f={};Rt(l)||(f=l),c.push(fi(f))}if(h){var w={};Rt(h)||(w=h),c.unshift(ri(w))}}return c}var vr=process.env.NODE_ENV==="production";function pi(e){var t=di(),r=e||{},n=r.reducer,o=n===void 0?void 0:n,i=r.middleware,l=i===void 0?t():i,d=r.devTools,h=d===void 0?!0:d,c=r.preloadedState,v=c===void 0?void 0:c,f=r.enhancers,w=f===void 0?void 0:f,p;if(typeof o=="function")p=o;else if(mn(o))p=Fo(o);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 u=l;if(typeof u=="function"&&(u=u(t),!vr&&!Array.isArray(u)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!vr&&u.some(function(m){return typeof m!="function"}))throw new Error("each middleware provided to configureStore must be a function");var x=Xo.apply(void 0,u),S=kt;h&&(S=Zo(Ve({trace:!vr},typeof h=="object"&&h)));var T=new oi(x),A=T;Array.isArray(w)?A=at([x],w):typeof w=="function"&&(A=w(T));var M=S.apply(void 0,A);return dn(p,v,M)}function On(e){var t={},r=[],n,o={addCase:function(i,l){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 d=typeof i=="string"?i:i.type;if(!d)throw new Error("`builder.addCase` cannot be called with an empty action type");if(d in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[d]=l,o},addMatcher:function(i,l){if(process.env.NODE_ENV!=="production"&&n)throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return r.push({matcher:i,reducer:l}),o},addDefaultCase:function(i){if(process.env.NODE_ENV!=="production"&&n)throw new Error("`builder.addDefaultCase` can only be called once");return n=i,o}};return e(o),[t,r,n]}function vi(e){return typeof e=="function"}var jn=!1;function yi(e,t,r,n){r===void 0&&(r=[]),process.env.NODE_ENV!=="production"&&typeof t=="object"&&(jn||(jn=!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 o=typeof t=="function"?On(t):[t,r,n],i=o[0],l=o[1],d=o[2],h;if(vi(e))h=function(){return hr(e())};else{var c=hr(e);h=function(){return c}}function v(f,w){f===void 0&&(f=h());var p=at([i[w.type]],l.filter(function(u){var x=u.matcher;return x(w)}).map(function(u){var x=u.reducer;return x}));return p.filter(function(u){return!!u}).length===0&&(p=[d]),p.reduce(function(u,x){if(x)if(We(u)){var S=u,T=x(S,w);return T===void 0?u:T}else{if(ke(u))return sn(u,function(A){return x(A,w)});var T=x(u,w);if(T===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return T}return u},f)}return v.getInitialState=h,v}var Pn=!1;function gi(e,t){return e+"/"+t}function mi(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:hr(e.initialState),n=e.reducers||{},o=Object.keys(n),i={},l={},d={};o.forEach(function(v){var f=n[v],w=gi(t,v),p,u;"reducer"in f?(p=f.reducer,u=f.prepare):p=f,i[v]=p,l[w]=p,d[v]=u?$e(w,u):$e(w)});function h(){process.env.NODE_ENV!=="production"&&typeof e.extraReducers=="object"&&(Pn||(Pn=!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 v=typeof e.extraReducers=="function"?On(e.extraReducers):[e.extraReducers],f=v[0],w=f===void 0?{}:f,p=v[1],u=p===void 0?[]:p,x=v[2],S=x===void 0?void 0:x,T=Ve(Ve({},w),l);return yi(r,function(A){for(var M in T)A.addCase(M,T[M]);for(var m=0,b=u;m<b.length;m++){var _=b[m];A.addMatcher(_.matcher,_.reducer)}S&&A.addDefaultCase(S)})}var c;return{name:t,reducer:function(v,f){return c||(c=h()),c(v,f)},actions:d,caseReducers:i,getInitialState:function(){return c||(c=h()),c.getInitialState()}}}var bi="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",wi=function(e){e===void 0&&(e=21);for(var t="",r=e;r--;)t+=bi[Math.random()*64|0];return t},xi=["name","message","stack","code"],yr=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),Tn=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),Ei=function(e){if(typeof e=="object"&&e!==null){for(var t={},r=0,n=xi;r<n.length;r++){var o=n[r];typeof e[o]=="string"&&(t[o]=e[o])}return t}return{message:String(e)}};(function(){function e(t,r,n){var o=$e(t+"/fulfilled",function(v,f,w,p){return{payload:v,meta:dr(Ve({},p||{}),{arg:w,requestId:f,requestStatus:"fulfilled"})}}),i=$e(t+"/pending",function(v,f,w){return{payload:void 0,meta:dr(Ve({},w||{}),{arg:f,requestId:v,requestStatus:"pending"})}}),l=$e(t+"/rejected",function(v,f,w,p,u){return{payload:p,error:(n&&n.serializeError||Ei)(v||"Rejected"),meta:dr(Ve({},u||{}),{arg:w,requestId:f,rejectedWithValue:!!p,requestStatus:"rejected",aborted:(v==null?void 0:v.name)==="AbortError",condition:(v==null?void 0:v.name)==="ConditionError"})}}),d=!1,h=typeof AbortController<"u"?AbortController:(function(){function v(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return v.prototype.abort=function(){process.env.NODE_ENV!=="production"&&(d||(d=!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'.")))},v})();function c(v){return function(f,w,p){var u=n!=null&&n.idGenerator?n.idGenerator(v):wi(),x=new h,S;function T(M){S=M,x.abort()}var A=(function(){return Jo(this,null,function(){var M,m,b,_,X,$,ee;return Bo(this,function(ne){switch(ne.label){case 0:return ne.trys.push([0,4,,5]),_=(M=n==null?void 0:n.condition)==null?void 0:M.call(n,v,{getState:w,extra:p}),Ci(_)?[4,_]:[3,2];case 1:_=ne.sent(),ne.label=2;case 2:if(_===!1||x.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return X=new Promise(function(Z,G){return x.signal.addEventListener("abort",function(){return G({name:"AbortError",message:S||"Aborted"})})}),f(i(u,v,(m=n==null?void 0:n.getPendingMeta)==null?void 0:m.call(n,{requestId:u,arg:v},{getState:w,extra:p}))),[4,Promise.race([X,Promise.resolve(r(v,{dispatch:f,getState:w,extra:p,requestId:u,signal:x.signal,abort:T,rejectWithValue:function(Z,G){return new yr(Z,G)},fulfillWithValue:function(Z,G){return new Tn(Z,G)}})).then(function(Z){if(Z instanceof yr)throw Z;return Z instanceof Tn?o(Z.payload,u,v,Z.meta):o(Z,u,v)})])];case 3:return b=ne.sent(),[3,5];case 4:return $=ne.sent(),b=$ instanceof yr?l(null,u,v,$.payload,$.meta):l($,u,v),[3,5];case 5:return ee=n&&!n.dispatchConditionRejection&&l.match(b)&&b.meta.condition,ee||f(b),[2,b]}})})})();return Object.assign(A,{abort:T,requestId:u,arg:v,unwrap:function(){return A.then(Si)}})}}return Object.assign(c,{pending:i,rejected:l,fulfilled:o,typePrefix:t})}return e.withTypes=function(){return e},e})();function Si(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Ci(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var gr="listenerMiddleware";$e(gr+"/add"),$e(gr+"/removeAll"),$e(gr+"/remove");var Mn;typeof queueMicrotask=="function"&&queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis),Po();const kn=mi({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:o}=t.payload;e.toolProperties[r]&&(e.toolProperties[r][n]=o)},addElement(e,t){e.elements.push(t.payload)},updateElement(e,t){const{id:r,updates:n}=t.payload,o=e.elements.findIndex(i=>i.id===r);o!==-1&&(e.elements[o]={...e.elements[o],...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=[]},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(o=>o.id===r);if(n!==-1&&n<e.elements.length-1){const[o]=e.elements.splice(n,1);e.elements.push(o)}},sendToBack(e,t){const r=t.payload,n=e.elements.findIndex(o=>o.id===r);if(n>0){const[o]=e.elements.splice(n,1);e.elements.unshift(o)}},fitToView(e,t){const{canvasWidth:r,canvasHeight:n,padding:o=50}=t.payload,i=e.elements;if(i.length===0){e.viewport.panX=0,e.viewport.panY=0,e.viewport.zoom=1;return}let l=1/0,d=1/0,h=-1/0,c=-1/0;i.forEach(b=>{b.type==="rectangle"?(l=Math.min(l,b.x),d=Math.min(d,b.y),h=Math.max(h,b.x+b.width),c=Math.max(c,b.y+b.height)):b.type==="circle"?(l=Math.min(l,b.centerX-b.radius),d=Math.min(d,b.centerY-b.radius),h=Math.max(h,b.centerX+b.radius),c=Math.max(c,b.centerY+b.radius)):b.type==="pencil"&&b.points.length>0?b.points.forEach(_=>{l=Math.min(l,_.x),d=Math.min(d,_.y),h=Math.max(h,_.x),c=Math.max(c,_.y)}):b.type==="triangle"||b.type==="diamond"||b.type==="hexagon"||b.type==="octagon"?(l=Math.min(l,b.x),d=Math.min(d,b.y),h=Math.max(h,b.x+b.width),c=Math.max(c,b.y+b.height)):b.type==="star"||b.type==="heart"?(l=Math.min(l,b.centerX-b.size),d=Math.min(d,b.centerY-b.size),h=Math.max(h,b.centerX+b.size),c=Math.max(c,b.centerY+b.size)):b.type==="arrow"&&(l=Math.min(l,b.startX,b.endX),d=Math.min(d,b.startY,b.endY),h=Math.max(h,b.startX,b.endX),c=Math.max(c,b.startY,b.endY))});const v=h-l,f=c-d;if(v<=0||f<=0)return;const w=r-o*2,p=n-o*2,u=w/v,x=p/f,S=Math.min(u,x,5),T=(l+h)/2,A=(d+c)/2,M=r/2-T*S,m=n/2-A*S;e.viewport.zoom=Math.max(.1,S),e.viewport.panX=M,e.viewport.panY=m},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}}}),{setSelectedTool:Re,setToolProperty:_i,addElement:ve,updateElement:Nt,removeElement:Oi,setSelectedElement:gt,setPan:ji,setZoom:Pi,fitToView:Ti,bringToFront:Mi,sendToBack:ki,setLocked:Rn,setWatermarkEnabled:Ri,setWatermarkText:Ni}=kn.actions,Nn=kn.reducer;let mr=null;const Ai=e=>{mr=e},Di=e=>t=>r=>{var o;const n=t(r);return!((o=r.meta)!=null&&o.fromRemote)&&mr&&mr(r),n},An=pi({reducer:{whiteboard:Nn},middleware:e=>e().concat(Di)}),Ii=()=>{const e=le(t=>t.whiteboard.watermark);return g.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:g.jsx("div",{className:"wb-watermark",children:e.text})})};var Dn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},In=N.createContext&&N.createContext(Dn),zi=["attr","size","title"];function Wi(e,t){if(e==null)return{};var r=Li(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Li(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 At(){return At=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},At.apply(this,arguments)}function zn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Dt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zn(Object(r),!0).forEach(function(n){Yi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Yi(e,t,r){return t=Vi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vi(e){var t=$i(e,"string");return typeof t=="symbol"?t:t+""}function $i(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 Wn(e){return e&&e.map((t,r)=>N.createElement(t.tag,Dt({key:r},t.attr),Wn(t.child)))}function Q(e){return t=>N.createElement(Fi,At({attr:Dt({},e.attr)},t),Wn(e.child))}function Fi(e){var t=r=>{var{attr:n,size:o,title:i}=e,l=Wi(e,zi),d=o||r.size||"1em",h;return r.className&&(h=r.className),e.className&&(h=(h?h+" ":"")+e.className),N.createElement("svg",At({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,l,{className:h,style:Dt(Dt({color:e.color||r.color},r.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),i&&N.createElement("title",null,i),e.children)};return In!==void 0?N.createElement(In.Consumer,null,r=>t(r)):t(Dn)}function Xi(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 Bi(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 Ui(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 qi(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 Hi(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 Gi(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 Ki(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 Ji(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 Zi(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 Qi(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 ea(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 ta(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 ra(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 na=({text:e})=>g.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:[g.jsx(Ki,{}),g.jsx("span",{children:e||"Locked"})]});function oa(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 ia(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 aa(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 sa(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 ca(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 la(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 ua(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 fa(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 da=({onExport:e})=>{const t=Gt(),{t:r,language:n,changeLanguage:o}=Hr(),i=le(m=>m.whiteboard.toolbar.selectedTool),l=le(m=>m.whiteboard.lock.isLocked),[d,h]=N.useState(!1),[c,v]=N.useState(!1),f=N.useRef(null),w=N.useRef(null),p=N.useRef(null),u=N.useRef(null),x=N.useRef(null),S=m=>{const b=m.target.files[0];if(!b)return;const _=new FileReader;_.onload=X=>{const $=new Image;$.onload=()=>{const ee=Date.now().toString();t(ve({id:ee,type:"image",x:100,y:100,width:$.width,height:$.height,src:X.target.result})),t(Re("pointer")),t(gt(ee))},$.src=X.target.result},_.readAsDataURL(b),m.target.value=""};N.useEffect(()=>{const m=b=>{f.current&&!f.current.contains(b.target)&&w.current&&!w.current.contains(b.target)&&h(!1),u.current&&!u.current.contains(b.target)&&p.current&&!p.current.contains(b.target)&&v(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const T=[{name:"triangle",icon:g.jsx(Qi,{style:{transform:"rotate(-30deg)"}})},{name:"diamond",icon:g.jsx(ia,{})},{name:"star",icon:g.jsx(ra,{})},{name:"heart",icon:g.jsx(Hi,{})},{name:"hexagon",icon:g.jsx(ua,{})},{name:"octagon",icon:g.jsx(fa,{})},{name:"arrow",icon:g.jsx(oa,{})}],A=m=>{t(Re(m)),h(!1)},M=m=>{o(m),v(!1)};return g.jsxs("div",{className:"wb-toolbar",children:[g.jsx("button",{className:i==="pointer"?"wb-active":"",onClick:()=>t(Re("pointer")),title:r("pointer"),disabled:l,children:g.jsx(Ji,{})}),g.jsx("button",{className:i==="text"?"wb-active":"",onClick:()=>t(Re("text")),title:r("text"),disabled:l,children:g.jsx(ca,{})}),g.jsx("button",{onClick:()=>{var m;return(m=x.current)==null?void 0:m.click()},title:r("image"),disabled:l,children:g.jsx(Gi,{})}),g.jsx("input",{type:"file",ref:x,style:{display:"none"},accept:"image/*",onChange:S}),g.jsx("button",{className:i==="pencil"?"wb-active":"",onClick:()=>t(Re("pencil")),title:r("pencil"),disabled:l,children:g.jsx(Zi,{})}),g.jsx("button",{className:i==="rectangle"?"wb-active":"",onClick:()=>t(Re("rectangle")),title:r("rectangle"),disabled:l,children:g.jsx(ta,{})}),g.jsx("button",{className:i==="circle"?"wb-active":"",onClick:()=>t(Re("circle")),title:r("circle"),disabled:l,children:g.jsx(Xi,{})}),g.jsxs("div",{className:"wb-ellipsis-container",children:[g.jsx("button",{ref:w,className:T.some(m=>m.name===i)?"wb-active":"",onClick:()=>h(!d),title:r("moreShapes"),disabled:l,children:g.jsx(aa,{})}),d&&g.jsxs("div",{className:"wb-shapes-popup",ref:f,children:[g.jsx("div",{className:"wb-shapes-popup-header",children:r("moreShapes")}),g.jsx("div",{className:"wb-shapes-popup-grid",children:T.map(m=>g.jsx("button",{className:i===m.name?"wb-active":"",onClick:()=>A(m.name),title:r(m.name),children:m.icon},m.name))})]})]}),g.jsx("button",{className:i==="eraser"?"wb-active":"",onClick:()=>t(Re("eraser")),title:r("eraser"),disabled:l,children:g.jsx(Bi,{})}),g.jsx("button",{onClick:()=>t(Ti({canvasWidth:window.innerWidth,canvasHeight:window.innerHeight,padding:50})),title:r("fitToView"),children:g.jsx(Ui,{})}),g.jsx("button",{onClick:e,title:r("exportAsPng"),children:g.jsx(ea,{})}),g.jsxs("div",{className:"wb-language-container",children:[g.jsx("button",{ref:p,onClick:()=>v(!c),title:r("language"),children:g.jsx(qi,{})}),c&&g.jsxs("div",{className:"wb-language-popup",ref:u,children:[g.jsx("div",{className:"wb-language-popup-header",children:r("language")}),g.jsxs("div",{className:"wb-language-options",children:[g.jsxs("button",{className:n==="en"?"wb-active":"",onClick:()=>M("en"),children:["πŸ‡ΊπŸ‡Έ ",r("english")]}),g.jsxs("button",{className:n==="tr"?"wb-active":"",onClick:()=>M("tr"),children:["πŸ‡ΉπŸ‡· ",r("turkish")]})]})]})]}),g.jsx("button",{onClick:()=>t(Rn(!l)),title:l?"Unlock":"Lock",style:{color:l?"red":"inherit"},children:l?g.jsx(sa,{}):g.jsx(la,{})})]})},ha=()=>{const e=Gt(),{t}=Hr(),r=le(f=>f.whiteboard.toolbar.selectedTool),n=le(f=>f.whiteboard.toolProperties),o=le(f=>f.whiteboard.selectedElementId),i=le(f=>f.whiteboard.elements),l=o?i.find(f=>f.id===o):null,d=(f,w,p)=>{e(_i({tool:f,property:w,value:p}))},h=(f,w)=>{o&&e(Nt({id:o,updates:{[f]:w}}))},c=()=>{o&&e(Mi(o))},v=()=>{o&&e(ki(o))};if(r==="pointer"&&l&&l.type==="text")return g.jsxs("div",{className:"wb-prop-tools",children:[g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("fontSize")}),g.jsxs("select",{className:"font-size-selector",value:l.fontSize||16,onChange:f=>h("fontSize",parseInt(f.target.value)),children:[g.jsx("option",{value:"12",children:"12 px"}),g.jsx("option",{value:"14",children:"14 px"}),g.jsx("option",{value:"16",children:"16 px"}),g.jsx("option",{value:"18",children:"18 px"}),g.jsx("option",{value:"24",children:"24 px"}),g.jsx("option",{value:"32",children:"32 px"}),g.jsx("option",{value:"48",children:"48 px"}),g.jsx("option",{value:"64",children:"64 px"}),g.jsx("option",{value:"72",children:"72 px"})]})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("fontColor")}),g.jsx("input",{type:"color",value:l.fontColor||"#000000",onChange:f=>h("fontColor",f.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("layerOrder")}),g.jsxs("div",{className:"wb-layer-buttons",children:[g.jsx("button",{onClick:c,title:t("bringToFront"),children:g.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),g.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"white"})]})}),g.jsx("button",{onClick:v,title:t("sendToBack"),children:g.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),g.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"white"})]})})]})]})]});if(r==="pointer"&&l){const f=["rectangle","circle","triangle","diamond","star","heart","hexagon","octagon","arrow"].includes(l.type),w=l.type==="pencil";return g.jsxs("div",{className:"wb-prop-tools",children:[f&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("strokeColor")}),g.jsx("input",{type:"color",value:l.strokeColor,onChange:p=>h("strokeColor",p.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("fillColor")}),g.jsx("input",{type:"color",value:l.fillColor,onChange:p=>h("fillColor",p.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("strokeWidth")}),g.jsxs("select",{className:"stroke-width-selector",value:l.lineWidth,onChange:p=>h("lineWidth",parseInt(p.target.value)),children:[g.jsx("option",{value:"1",children:"1 px"}),g.jsx("option",{value:"2",children:"2 px"}),g.jsx("option",{value:"4",children:"4 px"}),g.jsx("option",{value:"8",children:"8 px"})]})]})]}),w&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("brushColor")}),g.jsx("input",{type:"color",value:l.strokeColor,onChange:p=>h("strokeColor",p.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("brushSize")}),g.jsxs("select",{className:"brush-size-selector",value:l.lineWidth,onChange:p=>h("lineWidth",parseInt(p.target.value)),children:[g.jsx("option",{value:"1",children:"1 px"}),g.jsx("option",{value:"2",children:"2 px"}),g.jsx("option",{value:"4",children:"4 px"}),g.jsx("option",{value:"8",children:"8 px"}),g.jsx("option",{value:"16",children:"16 px"})]})]})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("layerOrder")}),g.jsxs("div",{className:"wb-layer-buttons",children:[g.jsx("button",{onClick:c,title:t("bringToFront"),children:g.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),g.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"white"})]})}),g.jsx("button",{onClick:v,title:t("sendToBack"),children:g.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),g.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"white"})]})})]})]})]})}return g.jsxs("div",{className:"wb-prop-tools",children:[r==="text"&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("fontSize")}),g.jsxs("select",{className:"font-size-selector",value:n.text.fontSize,onChange:f=>d("text","fontSize",parseInt(f.target.value)),children:[g.jsx("option",{value:"12",children:"12 px"}),g.jsx("option",{value:"14",children:"14 px"}),g.jsx("option",{value:"16",children:"16 px"}),g.jsx("option",{value:"18",children:"18 px"}),g.jsx("option",{value:"24",children:"24 px"}),g.jsx("option",{value:"32",children:"32 px"}),g.jsx("option",{value:"48",children:"48 px"}),g.jsx("option",{value:"64",children:"64 px"}),g.jsx("option",{value:"72",children:"72 px"})]})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("fontColor")}),g.jsx("input",{type:"color",value:n.text.fontColor,onChange:f=>d("text","fontColor",f.target.value)})]})]}),r==="pencil"&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("brushColor")}),g.jsx("input",{type:"color",value:n.pencil.strokeColor,onChange:f=>d("pencil","strokeColor",f.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("brushSize")}),g.jsxs("select",{className:"brush-size-selector",value:n.pencil.lineWidth,onChange:f=>d("pencil","lineWidth",parseInt(f.target.value)),children:[g.jsx("option",{value:"1",children:"1 px"}),g.jsx("option",{value:"2",children:"2 px"}),g.jsx("option",{value:"4",children:"4 px"}),g.jsx("option",{value:"8",children:"8 px"}),g.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")&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("strokeColor")}),g.jsx("input",{type:"color",value:n[r].strokeColor,onChange:f=>d(r,"strokeColor",f.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("fillColor")}),g.jsx("input",{type:"color",value:n[r].fillColor,onChange:f=>d(r,"fillColor",f.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:t("strokeWidth")}),g.jsxs("select",{className:"stroke-width-selector",value:n[r].lineWidth,onChange:f=>d(r,"lineWidth",parseInt(f.target.value)),children:[g.jsx("option",{value:"1",children:"1 px"}),g.jsx("option",{value:"2",children:"2 px"}),g.jsx("option",{value:"4",children:"4 px"}),g.jsx("option",{value:"8",children:"8 px"})]})]})]})]})},Ln=N.forwardRef(({onAction:e,watermark:t,isLocked:r,lockText:n,onLockChange:o,isWatermarkEnabled:i,watermarkText:l},d)=>{var Et;const h=N.useRef(null),c=Gt(),v=le(a=>a.whiteboard.grid),f=le(a=>a.whiteboard.toolbar.selectedTool),w=le(a=>a.whiteboard.elements),p=le(a=>a.whiteboard.viewport),u=le(a=>a.whiteboard.toolProperties),x=le(a=>a.whiteboard.selectedElementId),S=le(a=>a.whiteboard.lock),T=S.isLocked,[A,M]=N.useState(!1),[m,b]=N.useState({x:0,y:0}),[_,X]=N.useState({x:0,y:0}),[$,ee]=N.useState([]),[ne,Z]=N.useState(!1),[G,ue]=N.useState({x:0,y:0}),[ae,ye]=N.useState(!1),[Se,Ce]=N.useState(!1),[ge,we]=N.useState(!1),[_e,Fe]=N.useState({x:0,y:0}),[Ne,Xe]=N.useState({y:0,initialZoom:1}),[Be,Oe]=N.useState(!1),[je,Ae]=N.useState({x:0,y:0}),[fe,he]=N.useState(""),[pe,Pe]=N.useState(null);N.useEffect(()=>{e&&Ai(e)},[e]),N.useImperativeHandle(d,()=>({canvas:h.current,applyAction:a=>{c({...a,meta:{...a.meta,fromRemote:!0}})}})),N.useEffect(()=>{r!==void 0&&r!==T&&c(Rn(r))},[r,T,c]),N.useEffect(()=>{o&&o(T)},[T,o]);const I=le(a=>a.whiteboard.watermark);N.useEffect(()=>{i!==void 0&&i!==I.visible&&c(Ri(i))},[i,I.visible,c]),N.useEffect(()=>{l!==void 0&&l!==I.text&&c(Ni(l))},[l,I.text,c]);const xe=N.useCallback((a,y,C)=>{const E=a.canvas,k=E.width,P=E.height,D=Math.floor(-p.panX/p.zoom/y)*y,j=Math.floor(-p.panY/p.zoom/y)*y,s=Math.ceil((k/p.zoom-p.panX/p.zoom)/y)*y,O=Math.ceil((P/p.zoom-p.panY/p.zoom)/y)*y;a.strokeStyle=C,a.lineWidth=.5/p.zoom;for(let R=D;R<=s;R+=y)a.beginPath(),a.moveTo(R,j),a.lineTo(R,O),a.stroke();for(let R=j;R<=O;R+=y)a.beginPath(),a.moveTo(D,R),a.lineTo(s,R),a.stroke()},[p]),W=N.useCallback((a,y,C)=>{const E=Math.min(y.x,C.x),k=Math.min(y.y,C.y),P=Math.abs(C.x-y.x),D=Math.abs(C.y-y.y);a.strokeStyle="#0066cc",a.lineWidth=1,a.setLineDash([5,5]),a.strokeRect(E,k,P,D),a.fillStyle="rgba(0, 102, 204, 0.1)",a.fillRect(E,k,P,D),a.setLineDash([])},[]),se=N.useCallback((a,y)=>{const{x:C,y:E,width:k,height:P,fillColor:D="#000",strokeColor:j="#000",lineWidth:s=2}=y;a.fillStyle=D,a.fillRect(C,E,k,P),a.strokeStyle=j,a.lineWidth=s,a.strokeRect(C,E,k,P)},[]),me=N.useCallback((a,y)=>{const{centerX:C,centerY:E,radius:k,fillColor:P="#000",strokeColor:D="#000",lineWidth:j=2}=y;a.beginPath(),a.arc(C,E,k,0,Math.PI*2),a.fillStyle=P,a.fill(),a.strokeStyle=D,a.lineWidth=j,a.stroke()},[]),Te=N.useCallback((a,y)=>{const{points:C,strokeColor:E="#000",lineWidth:k=2}=y;if(!(C.length<2)){a.strokeStyle=E,a.lineWidth=k,a.lineCap="round",a.lineJoin="round",a.beginPath(),a.moveTo(C[0].x,C[0].y);for(let P=1;P<C.length;P++)a.lineTo(C[P].x,C[P].y);a.stroke()}},[]),Ke=N.useCallback((a,y)=>{const{x:C,y:E,text:k,fontSize:P=16,fontColor:D="#000"}=y;a.font=`${P}px sans-serif`,a.fillStyle=D,a.textBaseline="top",a.fillText(k,C,E)},[]),st=N.useCallback((a,y)=>{const{x:C,y:E,width:k,height:P,fillColor:D="#fff",strokeColor:j="#000",lineWidth:s=2}=y;a.beginPath(),a.moveTo(C+k/2,E),a.lineTo(C+k,E+P),a.lineTo(C,E+P),a.closePath(),a.fillStyle=D,a.fill(),a.strokeStyle=j,a.lineWidth=s,a.stroke()},[]),Je=N.useCallback((a,y)=>{const{x:C,y:E,width:k,height:P,fillColor:D="#fff",strokeColor:j="#000",lineWidth:s=2}=y;a.beginPath(),a.moveTo(C+k/2,E),a.lineTo(C+k,E+P/2),a.lineTo(C+k/2,E+P),a.lineTo(C,E+P/2),a.closePath(),a.fillStyle=D,a.fill(),a.strokeStyle=j,a.lineWidth=s,a.stroke()},[]),Ue=N.useCallback((a,y)=>{const{centerX:C,centerY:E,size:k,fillColor:P="#ffff00",strokeColor:D="#000",lineWidth:j=2}=y,s=5,O=k,R=k/2;a.beginPath();for(let z=0;z<s*2;z++){const F=z%2===0?O:R,L=Math.PI/s*z-Math.PI/2,Y=C+Math.cos(L)*F,V=E+Math.sin(L)*F;z===0?a.moveTo(Y,V):a.lineTo(Y,V)}a.closePath(),a.fillStyle=P,a.fill(),a.strokeStyle=D,a.lineWidth=j,a.stroke()},[]),ct=N.useCallback((a,y)=>{const{centerX:C,centerY:E,size:k,fillColor:P="#ff6b6b",strokeColor:D="#000",lineWidth:j=2}=y;a.beginPath();const s=E-k/2;a.moveTo(C,s+k/4),a.bezierCurveTo(C-k/2,s,C-k,s+k/2,C,E+k/2),a.bezierCurveTo(C+k,s+k/2,C+k/2,s,C,s+k/4),a.fillStyle=P,a.fill(),a.strokeStyle=D,a.lineWidth=j,a.stroke()},[]),Ze=N.useCallback((a,y)=>{const{x:C,y:E,width:k,height:P,fillColor:D="#fff",strokeColor:j="#000",lineWidth:s=2}=y,O=C+k/2,R=E+P/2,z=k/2,F=P/2;a.beginPath();for(let L=0;L<6;L++){const Y=Math.PI/3*L-Math.PI/2,V=O+Math.cos(Y)*z,J=R+Math.sin(Y)*F;L===0?a.moveTo(V,J):a.lineTo(V,J)}a.closePath(),a.fillStyle=D,a.fill(),a.strokeStyle=j,a.lineWidth=s,a.stroke()},[]),Qe=N.useCallback((a,y)=>{const{x:C,y:E,width:k,height:P,fillColor:D="#fff",strokeColor:j="#000",lineWidth:s=2}=y,O=C+k/2,R=E+P/2,z=k/2,F=P/2;a.beginPath();for(let L=0;L<8;L++){const Y=Math.PI/4*L-Math.PI/2,V=O+Math.cos(Y)*z,J=R+Math.sin(Y)*F;L===0?a.moveTo(V,J):a.lineTo(V,J)}a.closePath(),a.fillStyle=D,a.fill(),a.strokeStyle=j,a.lineWidth=s,a.stroke()},[]),lt=N.useCallback((a,y)=>{const{startX:C,startY:E,endX:k,endY:P,fillColor:D="#000",strokeColor:j="#000",lineWidth:s=2}=y,O=15,R=Math.atan2(P-E,k-C);a.beginPath(),a.moveTo(C,E),a.lineTo(k,P),a.strokeStyle=j,a.lineWidth=s,a.stroke(),a.beginPath(),a.moveTo(k,P),a.lineTo(k-O*Math.cos(R-Math.PI/6),P-O*Math.sin(R-Math.PI/6)),a.lineTo(k-O*Math.cos(R+Math.PI/6),P-O*Math.sin(R+Math.PI/6)),a.closePath(),a.fillStyle=D,a.fill()},[]),ut=N.useRef({}),mt=N.useRef(null),It=N.useCallback((a,y)=>{const{x:C,y:E,width:k,height:P,src:D}=y;if(ut.current[D]){const j=ut.current[D];j.complete&&a.drawImage(j,C,E,k,P)}else{const j=new Image;j.onload=()=>{ut.current[D]=j,mt.current&&mt.current()},j.src=D,ut.current[D]=j}},[]),ft=N.useCallback((a,y)=>{switch(y.type){case"rectangle":se(a,y);break;case"circle":me(a,y);break;case"pencil":Te(a,y);break;case"text":Ke(a,y);break;case"triangle":st(a,y);break;case"diamond":Je(a,y);break;case"star":Ue(a,y);break;case"heart":ct(a,y);break;case"hexagon":Ze(a,y);break;case"octagon":Qe(a,y);break;case"arrow":lt(a,y);break;case"image":It(a,y);break}},[se,me,Te,Ke,st,Je,Ue,ct,Ze,Qe,lt,It]),br=N.useCallback(()=>{const a=h.current;if(!a)return;const y=document.createElement("canvas");y.width=a.width,y.height=a.height;const C=y.getContext("2d");C.fillStyle="#ffffff",C.fillRect(0,0,y.width,y.height),C.save(),C.translate(p.panX,p.panY),C.scale(p.zoom,p.zoom),w.forEach(P=>{ft(C,P)}),C.restore();const E=y.toDataURL("image/png"),k=document.createElement("a");k.download=`whiteboard-${Date.now()}.png`,k.href=E,k.click()},[p,w,ft]),bt=N.useCallback((a,y)=>{for(let C=w.length-1;C>=0;C--){const E=w[C];if(E.type==="rectangle"){if(a>=E.x&&a<=E.x+E.width&&y>=E.y&&y<=E.y+E.height)return E}else if(E.type==="circle"){if(Math.sqrt(Math.pow(a-E.centerX,2)+Math.pow(y-E.centerY,2))<=E.radius)return E}else if(E.type==="pencil")for(let P=1;P<E.points.length;P++){const D=E.points[P-1],j=E.points[P];if(dt(a,y,D.x,D.y,j.x,j.y)<=5)return E}else if(E.type==="text"){const k=E.fontSize||16,P=E.text.length*k*.6,D=k;if(a>=E.x&&a<=E.x+P&&y>=E.y&&y<=E.y+D)return E}else if(E.type==="triangle"||E.type==="diamond"||E.type==="hexagon"||E.type==="octagon"){if(a>=E.x&&a<=E.x+E.width&&y>=E.y&&y<=E.y+E.height)return E}else if(E.type==="star"||E.type==="heart"){if(Math.sqrt(Math.pow(a-E.centerX,2)+Math.pow(y-E.centerY,2))<=E.size)return E}else if(E.type==="arrow"){if(dt(a,y,E.startX,E.startY,E.endX,E.endY)<=10)return E}else if(E.type==="image"&&a>=E.x&&a<=E.x+E.width&&y>=E.y&&y<=E.y+E.height)return E}return null},[w]),dt=(a,y,C,E,k,P)=>{const D=a-C,j=y-E,s=k-C,O=P-E,R=D*s+j*O,z=s*s+O*O;let F=-1;z!==0&&(F=R/z);let L,Y;F<0?(L=C,Y=E):F>1?(L=k,Y=P):(L=C+F*s,Y=E+F*O);const V=a-L,J=y-Y;return Math.sqrt(V*V+J*J)},wt=N.useCallback((a,y)=>{if(a.strokeStyle="#0066cc",a.lineWidth=2,a.setLineDash([5,5]),y.type==="rectangle")a.strokeRect(y.x-4,y.y-4,y.width+8,y.height+8);else if(y.type==="circle")a.beginPath(),a.arc(y.centerX,y.centerY,y.radius+4,0,Math.PI*2),a.stroke();else if(y.type==="pencil"&&y.points.length>0){const C=Math.min(...y.points.map(D=>D.x)),E=Math.max(...y.points.map(D=>D.x)),k=Math.min(...y.points.map(D=>D.y)),P=Math.max(...y.points.map(D=>D.y));a.strokeRect(C-4,k-4,E-C+8,P-k+8)}else if(y.type==="text"){const C=y.fontSize||16,E=y.text.length*C*.6,k=C;a.strokeRect(y.x-4,y.y-4,E+8,k+8)}else if(y.type==="triangle"||y.type==="diamond"||y.type==="hexagon"||y.type==="octagon")a.strokeRect(y.x-4,y.y-4,y.width+8,y.height+8);else if(y.type==="star"||y.type==="heart")a.beginPath(),a.arc(y.centerX,y.centerY,y.size+4,0,Math.PI*2),a.stroke();else if(y.type==="arrow"){const C=Math.min(y.startX,y.endX),E=Math.max(y.startX,y.endX),k=Math.min(y.startY,y.endY),P=Math.max(y.startY,y.endY);a.strokeRect(C-4,k-4,E-C+8,P-k+8)}else y.type==="image"&&a.strokeRect(y.x-4,y.y-4,y.width+8,y.height+8);a.setLineDash([])},[]),ce=N.useCallback(()=>{const a=h.current;if(!a)return;const y=a.getContext("2d");y.clearRect(0,0,a.width,a.height),y.save(),y.translate(p.panX,p.panY),y.scale(p.zoom,p.zoom),v.enabled&&xe(y,v.size,v.color),w.forEach(C=>{ft(y,C),C.id===x&&wt(y,C)}),y.restore()},[v,xe,w,ft,x,wt,p]);N.useEffect(()=>{mt.current=ce},[ce]),N.useEffect(()=>{const a=h.current;if(!a)return;const y=()=>{a.width=window.innerWidth,a.height=window.innerHeight,ce()};return y(),window.addEventListener("resize",y),()=>{window.removeEventListener("resize",y)}},[ce]),N.useEffect(()=>{ce()},[ce]),N.useEffect(()=>{const a=C=>{C.target.tagName==="INPUT"||C.target.tagName==="TEXTAREA"||C.code==="Space"&&!C.repeat&&(C.preventDefault(),ye(!0))},y=C=>{C.target.tagName==="INPUT"||C.target.tagName==="TEXTAREA"||C.code==="Space"&&(C.preventDefault(),ye(!1),Ce(!1),we(!1))};return window.addEventListener("keydown",a),window.addEventListener("keyup",y),()=>{window.removeEventListener("keydown",a),window.removeEventListener("keyup",y)}},[]);const et=N.useCallback((a,y)=>({x:(a-p.panX)/p.zoom,y:(y-p.panY)/p.zoom}),[p]);N.useEffect(()=>{const a=h.current;if(!a||!A)return;const y=a.getContext("2d");if(ce(),y.save(),y.translate(p.panX,p.panY),y.scale(p.zoom,p.zoom),f==="pointer")W(y,m,_);else if(f==="rectangle"){const C=Math.min(m.x,_.x),E=Math.min(m.y,_.y),k=Math.abs(_.x-m.x),P=Math.abs(_.y-m.y);se(y,{x:C,y:E,width:k,height:P,strokeColor:u.rectangle.strokeColor,fillColor:u.rectangle.fillColor,lineWidth:u.rectangle.lineWidth})}else if(f==="circle"){const C=m.x,E=m.y,k=Math.sqrt(Math.pow(_.x-m.x,2)+Math.pow(_.y-m.y,2));me(y,{centerX:C,centerY:E,radius:k,strokeColor:u.circle.strokeColor,fillColor:u.circle.fillColor,lineWidth:u.circle.lineWidth})}else if(f==="pencil")Te(y,{points:$,strokeColor:u.pencil.strokeColor,lineWidth:u.pencil.lineWidth});else if(f==="triangle"){const C=Math.min(m.x,_.x),E=Math.min(m.y,_.y),k=Math.abs(_.x-m.x),P=Math.abs(_.y-m.y);st(y,{x:C,y:E,width:k,height:P,strokeColor:u.triangle.strokeColor,fillColor:u.triangle.fillColor,lineWidth:u.triangle.lineWidth})}else if(f==="diamond"){const C=Math.min(m.x,_.x),E=Math.min(m.y,_.y),k=Math.abs(_.x-m.x),P=Math.abs(_.y-m.y);Je(y,{x:C,y:E,width:k,height:P,strokeColor:u.diamond.strokeColor,fillColor:u.diamond.fillColor,lineWidth:u.diamond.lineWidth})}else if(f==="star"){const C=m.x,E=m.y,k=Math.sqrt(Math.pow(_.x-m.x,2)+Math.pow(_.y-m.y,2));Ue(y,{centerX:C,centerY:E,size:k,strokeColor:u.star.strokeColor,fillColor:u.star.fillColor,lineWidth:u.star.lineWidth})}else if(f==="heart"){const C=m.x,E=m.y,k=Math.sqrt(Math.pow(_.x-m.x,2)+Math.pow(_.y-m.y,2));ct(y,{centerX:C,centerY:E,size:k,strokeColor:u.heart.strokeColor,fillColor:u.heart.fillColor,lineWidth:u.heart.lineWidth})}else if(f==="hexagon"){const C=Math.min(m.x,_.x),E=Math.min(m.y,_.y),k=Math.abs(_.x-m.x),P=Math.abs(_.y-m.y);Ze(y,{x:C,y:E,width:k,height:P,strokeColor:u.hexagon.strokeColor,fillColor:u.hexagon.fillColor,lineWidth:u.hexagon.lineWidth})}else if(f==="octagon"){const C=Math.min(m.x,_.x),E=Math.min(m.y,_.y),k=Math.abs(_.x-m.x),P=Math.abs(_.y-m.y);Qe(y,{x:C,y:E,width:k,height:P,strokeColor:u.octagon.strokeColor,fillColor:u.octagon.fillColor,lineWidth:u.octagon.lineWidth})}else f==="arrow"&&lt(y,{startX:m.x,startY:m.y,endX:_.x,endY:_.y,strokeColor:u.arrow.strokeColor,fillColor:u.arrow.fillColor,lineWidth:u.arrow.lineWidth});y.restore()},[A,f,m,_,$,ce,W,se,me,Te,st,Je,Ue,ct,Ze,Qe,lt,p,u]);const xt=a=>{const C=h.current.getBoundingClientRect(),E=a.clientX-C.left,k=a.clientY-C.top;if(T||Be)return;if(ae){a.preventDefault(),a.button===0?(Ce(!0),Fe({x:E-p.panX,y:k-p.panY})):a.button===2&&(we(!0),Xe({y:k,initialZoom:p.zoom}));return}const{x:P,y:D}=et(E,k);if(f==="pointer"){const j=bt(P,D);if(j)if(c(gt(j.id)),Z(!0),j.type==="rectangle")ue({x:P-j.x,y:D-j.y});else if(j.type==="circle")ue({x:P-j.centerX,y:D-j.centerY});else if(j.type==="pencil"){const s=Math.min(...j.points.map(R=>R.x)),O=Math.min(...j.points.map(R=>R.y));ue({x:P-s,y:D-O})}else j.type==="text"?ue({x:P-j.x,y:D-j.y}):j.type==="triangle"||j.type==="diamond"||j.type==="hexagon"||j.type==="octagon"?ue({x:P-j.x,y:D-j.y}):j.type==="star"||j.type==="heart"?ue({x:P-j.centerX,y:D-j.centerY}):j.type==="arrow"?ue({x:P-j.startX,y:D-j.startY}):j.type==="image"&&ue({x:P-j.x,y:D-j.y});else c(gt(null)),M(!0),b({x:P,y:D}),X({x:P,y:D})}else if(f==="text"){const j=Date.now().toString();c(ve({id:j,type:"text",x:P,y:D,text:"Text",fontSize:u.text.fontSize,fontColor:u.text.fontColor})),c(Re("pointer")),c(gt(j))}else if(f==="eraser"){const j=bt(P,D);j&&c(Oi(j.id))}else c(gt(null)),M(!0),b({x:P,y:D}),X({x:P,y:D}),f==="pencil"&&ee([{x:P,y:D}])},zt=a=>{const C=h.current.getBoundingClientRect(),E=a.clientX-C.left,k=a.clientY-C.top;if(Se){c(ji({x:E-_e.x,y:k-_e.y}));return}if(ge){const j=Ne.y-k,O=Ne.initialZoom*(1+j*.005);c(Pi(O));return}const{x:P,y:D}=et(E,k);if(ne&&x){const j=w.find(O=>O.id===x);if(!j)return;let s={};if(j.type==="rectangle")s={x:P-G.x,y:D-G.y};else if(j.type==="circle")s={centerX:P-G.x,centerY:D-G.y};else if(j.type==="pencil"){const O=Math.min(...j.points.map(L=>L.x)),R=Math.min(...j.points.map(L=>L.y)),z=P-G.x-O,F=D-G.y-R;s={points:j.points.map(L=>({x:L.x+z,y:L.y+F}))}}else if(j.type==="text")s={x:P-G.x,y:D-G.y};else if(j.type==="triangle"||j.type==="diamond"||j.type==="hexagon"||j.type==="octagon")s={x:P-G.x,y:D-G.y};else if(j.type==="star"||j.type==="heart")s={centerX:P-G.x,centerY:D-G.y};else if(j.type==="arrow"){const O=j.endX-j.startX,R=j.endY-j.startY;s={startX:P-G.x,startY:D-G.y,endX:P-G.x+O,endY:D-G.y+R}}else j.type==="image"&&(s={x:P-G.x,y:D-G.y});c(Nt({id:x,updates:s}));return}A&&(X({x:P,y:D}),f==="pencil"&&ee(j=>[...j,{x:P,y:D}]))},Wt=()=>{if(Se||ge){Ce(!1),we(!1);return}if(ne){Z(!1);return}if(A){if(f==="pointer")ce();else if(f==="rectangle"){const a=Math.min(m.x,_.x),y=Math.min(m.y,_.y),C=Math.abs(_.x-m.x),E=Math.abs(_.y-m.y);C>0&&E>0&&c(ve({id:Date.now().toString(),type:"rectangle",x:a,y,width:C,height:E,strokeColor:u.rectangle.strokeColor,fillColor:u.rectangle.fillColor,lineWidth:u.rectangle.lineWidth}))}else if(f==="circle"){const a=m.x,y=m.y,C=Math.sqrt(Math.pow(_.x-m.x,2)+Math.pow(_.y-m.y,2));C>0&&c(ve({id:Date.now().toString(),type:"circle",centerX:a,centerY:y,radius:C,strokeColor:u.circle.strokeColor,fillColor:u.circle.fillColor,lineWidth:u.circle.lineWidth}))}else if(f==="pencil")$.length>1&&c(ve({id:Date.now().toString(),type:"pencil",points:[...$],strokeColor:u.pencil.strokeColor,lineWidth:u.pencil.lineWidth})),ee([]);else if(f==="triangle"){const a=Math.min(m.x,_.x),y=Math.min(m.y,_.y),C=Math.abs(_.x-m.x),E=Math.abs(_.y-m.y);C>0&&E>0&&c(ve({id:Date.now().toString(),type:"triangle",x:a,y,width:C,height:E,strokeColor:u.triangle.strokeColor,fillColor:u.triangle.fillColor,lineWidth:u.triangle.lineWidth}))}else if(f==="diamond"){const a=Math.min(m.x,_.x),y=Math.min(m.y,_.y),C=Math.abs(_.x-m.x),E=Math.abs(_.y-m.y);C>0&&E>0&&c(ve({id:Date.now().toString(),type:"diamond",x:a,y,width:C,height:E,strokeColor:u.diamond.strokeColor,fillColor:u.diamond.fillColor,lineWidth:u.diamond.lineWidth}))}else if(f==="star"){const a=m.x,y=m.y,C=Math.sqrt(Math.pow(_.x-m.x,2)+Math.pow(_.y-m.y,2));C>0&&c(ve({id:Date.now().toString(),type:"star",centerX:a,centerY:y,size:C,strokeColor:u.star.strokeColor,fillColor:u.star.fillColor,lineWidth:u.star.lineWidth}))}else if(f==="heart"){const a=m.x,y=m.y,C=Math.sqrt(Math.pow(_.x-m.x,2)+Math.pow(_.y-m.y,2));C>0&&c(ve({id:Date.now().toString(),type:"heart",centerX:a,centerY:y,size:C,strokeColor:u.heart.strokeColor,fillColor:u.heart.fillColor,lineWidth:u.heart.lineWidth}))}else if(f==="hexagon"){const a=Math.min(m.x,_.x),y=Math.min(m.y,_.y),C=Math.abs(_.x-m.x),E=Math.abs(_.y-m.y);C>0&&E>0&&c(ve({id:Date.now().toString(),type:"hexagon",x:a,y,width:C,height:E,strokeColor:u.hexagon.strokeColor,fillColor:u.hexagon.fillColor,lineWidth:u.hexagon.lineWidth}))}else if(f==="octagon"){const a=Math.min(m.x,_.x),y=Math.min(m.y,_.y),C=Math.abs(_.x-m.x),E=Math.abs(_.y-m.y);C>0&&E>0&&c(ve({id:Date.now().toString(),type:"octagon",x:a,y,width:C,height:E,strokeColor:u.octagon.strokeColor,fillColor:u.octagon.fillColor,lineWidth:u.octagon.lineWidth}))}else if(f==="arrow"){const a=_.x-m.x,y=_.y-m.y;Math.sqrt(a*a+y*y)>5&&c(ve({id:Date.now().toString(),type:"arrow",startX:m.x,startY:m.y,endX:_.x,endY:_.y,strokeColor:u.arrow.strokeColor,fillColor:u.arrow.fillColor,lineWidth:u.arrow.lineWidth}))}M(!1)}},Lt=a=>{ae&&a.preventDefault()},wr=()=>ae?Se?"grabbing":ge?"ns-resize":"grab":"default";return g.jsxs("div",{style:{backgroundColor:"#fff",position:"relative",width:"100%",height:"100%"},children:[g.jsx("canvas",{ref:h,onMouseDown:xt,onMouseMove:zt,onMouseUp:Wt,onMouseLeave:Wt,onDoubleClick:a=>{const C=h.current.getBoundingClientRect(),E=a.clientX-C.left,k=a.clientY-C.top,{x:P,y:D}=et(E,k),j=bt(P,D);j&&j.type==="text"&&(Pe(j.id),Ae({x:j.x,y:j.y}),he(j.text),Oe(!0))},onContextMenu:Lt,style:{cursor:wr()}}),T&&g.jsx(na,{text:n||((Et=t==null?void 0:t.lock)==null?void 0:Et.text)||S.text}),Be&&g.jsx("input",{type:"text",value:fe,onChange:a=>he(a.target.value),onKeyDown:a=>{a.key==="Enter"&&fe.trim()?(pe&&c(Nt({id:pe,updates:{text:fe}})),Oe(!1),he(""),Pe(null)):a.key==="Escape"&&(Oe(!1),he(""),Pe(null))},onBlur:()=>{fe.trim()&&pe&&c(Nt({id:pe,updates:{text:fe}})),Oe(!1),he(""),Pe(null)},onMouseDown:a=>a.stopPropagation(),autoFocus:!0,style:{position:"absolute",left:je.x*p.zoom+p.panX,top:je.y*p.zoom+p.panY,fontSize:u.text.fontSize*p.zoom,color:u.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)"}}),g.jsx(da,{onExport:br}),g.jsx(ha,{}),I.visible&&g.jsx(Ii,{})]})}),pa=e=>g.jsx(yo,{store:An,children:g.jsx(Eo,{children:g.jsx(Ln,{...e})})});be.WhiteboardComponent=Ln,be.default=pa,be.store=An,be.whiteboardReducer=Nn,Object.defineProperties(be,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));