nectar/modules/chess/pkg/index.js
2023-12-18 20:24:19 -05:00

88 lines
267 KiB
JavaScript

var vh=Object.defineProperty;var yh=(e,t,n)=>t in e?vh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ee=(e,t,n)=>(yh(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function vc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yc={exports:{}},ai={},Sc={exports:{}},z={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Qr=Symbol.for("react.element"),Sh=Symbol.for("react.portal"),wh=Symbol.for("react.fragment"),kh=Symbol.for("react.strict_mode"),Eh=Symbol.for("react.profiler"),Ch=Symbol.for("react.provider"),xh=Symbol.for("react.context"),_h=Symbol.for("react.forward_ref"),Oh=Symbol.for("react.suspense"),Th=Symbol.for("react.memo"),Dh=Symbol.for("react.lazy"),Pu=Symbol.iterator;function Ph(e){return e===null||typeof e!="object"?null:(e=Pu&&e[Pu]||e["@@iterator"],typeof e=="function"?e:null)}var wc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},kc=Object.assign,Ec={};function Yn(e,t,n){this.props=e,this.context=t,this.refs=Ec,this.updater=n||wc}Yn.prototype.isReactComponent={};Yn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Yn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Cc(){}Cc.prototype=Yn.prototype;function Cl(e,t,n){this.props=e,this.context=t,this.refs=Ec,this.updater=n||wc}var xl=Cl.prototype=new Cc;xl.constructor=Cl;kc(xl,Yn.prototype);xl.isPureReactComponent=!0;var Iu=Array.isArray,xc=Object.prototype.hasOwnProperty,_l={current:null},_c={key:!0,ref:!0,__self:!0,__source:!0};function Oc(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)xc.call(t,r)&&!_c.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var u=Array(l),a=0;a<l;a++)u[a]=arguments[a+2];o.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Qr,type:e,key:i,ref:s,props:o,_owner:_l.current}}function Ih(e,t){return{$$typeof:Qr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ol(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qr}function jh(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ju=/\/+/g;function Fi(e,t){return typeof e=="object"&&e!==null&&e.key!=null?jh(""+e.key):t.toString(36)}function xo(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Qr:case Sh:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Fi(s,0):r,Iu(o)?(n="",e!=null&&(n=e.replace(ju,"$&/")+"/"),xo(o,t,n,"",function(a){return a})):o!=null&&(Ol(o)&&(o=Ih(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(ju,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Iu(e))for(var l=0;l<e.length;l++){i=e[l];var u=r+Fi(i,l);s+=xo(i,t,n,u,o)}else if(u=Ph(e),typeof u=="function")for(e=u.call(e),l=0;!(i=e.next()).done;)i=i.value,u=r+Fi(i,l++),s+=xo(i,t,n,u,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function no(e,t,n){if(e==null)return e;var r=[],o=0;return xo(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Lh(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ee={current:null},_o={transition:null},Nh={ReactCurrentDispatcher:Ee,ReactCurrentBatchConfig:_o,ReactCurrentOwner:_l};z.Children={map:no,forEach:function(e,t,n){no(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return no(e,function(){t++}),t},toArray:function(e){return no(e,function(t){return t})||[]},only:function(e){if(!Ol(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};z.Component=Yn;z.Fragment=wh;z.Profiler=Eh;z.PureComponent=Cl;z.StrictMode=kh;z.Suspense=Oh;z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Nh;z.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=kc({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=_l.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)xc.call(t,u)&&!_c.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var a=0;a<u;a++)l[a]=arguments[a+2];r.children=l}return{$$typeof:Qr,type:e.type,key:o,ref:i,props:r,_owner:s}};z.createContext=function(e){return e={$$typeof:xh,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Ch,_context:e},e.Consumer=e};z.createElement=Oc;z.createFactory=function(e){var t=Oc.bind(null,e);return t.type=e,t};z.createRef=function(){return{current:null}};z.forwardRef=function(e){return{$$typeof:_h,render:e}};z.isValidElement=Ol;z.lazy=function(e){return{$$typeof:Dh,_payload:{_status:-1,_result:e},_init:Lh}};z.memo=function(e,t){return{$$typeof:Th,type:e,compare:t===void 0?null:t}};z.startTransition=function(e){var t=_o.transition;_o.transition={};try{e()}finally{_o.transition=t}};z.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};z.useCallback=function(e,t){return Ee.current.useCallback(e,t)};z.useContext=function(e){return Ee.current.useContext(e)};z.useDebugValue=function(){};z.useDeferredValue=function(e){return Ee.current.useDeferredValue(e)};z.useEffect=function(e,t){return Ee.current.useEffect(e,t)};z.useId=function(){return Ee.current.useId()};z.useImperativeHandle=function(e,t,n){return Ee.current.useImperativeHandle(e,t,n)};z.useInsertionEffect=function(e,t){return Ee.current.useInsertionEffect(e,t)};z.useLayoutEffect=function(e,t){return Ee.current.useLayoutEffect(e,t)};z.useMemo=function(e,t){return Ee.current.useMemo(e,t)};z.useReducer=function(e,t,n){return Ee.current.useReducer(e,t,n)};z.useRef=function(e){return Ee.current.useRef(e)};z.useState=function(e){return Ee.current.useState(e)};z.useSyncExternalStore=function(e,t,n){return Ee.current.useSyncExternalStore(e,t,n)};z.useTransition=function(){return Ee.current.useTransition()};z.version="18.2.0";Sc.exports=z;var C=Sc.exports;const Mh=vc(C);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Rh=C,Ah=Symbol.for("react.element"),bh=Symbol.for("react.fragment"),zh=Object.prototype.hasOwnProperty,$h=Rh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Fh={key:!0,ref:!0,__self:!0,__source:!0};function Tc(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)zh.call(t,r)&&!Fh.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Ah,type:e,key:i,ref:s,props:o,_owner:$h.current}}ai.Fragment=bh;ai.jsx=Tc;ai.jsxs=Tc;yc.exports=ai;var S=yc.exports,Cs={},Dc={exports:{}},be={},Pc={exports:{}},Ic={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function t(D,L){var R=D.length;D.push(L);e:for(;0<R;){var U=R-1>>>1,Y=D[U];if(0<o(Y,L))D[U]=L,D[R]=Y,R=U;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var L=D[0],R=D.pop();if(R!==L){D[0]=R;e:for(var U=0,Y=D.length,lt=Y>>>1;U<lt;){var b=2*(U+1)-1,_t=D[b],Je=b+1,$e=D[Je];if(0>o(_t,R))Je<Y&&0>o($e,_t)?(D[U]=$e,D[Je]=R,U=Je):(D[U]=_t,D[b]=R,U=b);else if(Je<Y&&0>o($e,R))D[U]=$e,D[Je]=R,U=Je;else break e}}return L}function o(D,L){var R=D.sortIndex-L.sortIndex;return R!==0?R:D.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],a=[],p=1,m=null,d=3,g=!1,v=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function f(D){for(var L=n(a);L!==null;){if(L.callback===null)r(a);else if(L.startTime<=D)r(a),L.sortIndex=L.expirationTime,t(u,L);else break;L=n(a)}}function k(D){if(y=!1,f(D),!v)if(n(u)!==null)v=!0,en(x);else{var L=n(a);L!==null&&tn(k,L.startTime-D)}}function x(D,L){v=!1,y&&(y=!1,h(T),T=-1),g=!0;var R=d;try{for(f(L),m=n(u);m!==null&&(!(m.expirationTime>L)||D&&!re());){var U=m.callback;if(typeof U=="function"){m.callback=null,d=m.priorityLevel;var Y=U(m.expirationTime<=L);L=e.unstable_now(),typeof Y=="function"?m.callback=Y:m===n(u)&&r(u),f(L)}else r(u);m=n(u)}if(m!==null)var lt=!0;else{var b=n(a);b!==null&&tn(k,b.startTime-L),lt=!1}return lt}finally{m=null,d=R,g=!1}}var _=!1,O=null,T=-1,j=5,I=-1;function re(){return!(e.unstable_now()-I<j)}function he(){if(O!==null){var D=e.unstable_now();I=D;var L=!0;try{L=O(!0,D)}finally{L?Se():(_=!1,O=null)}}else _=!1}var Se;if(typeof c=="function")Se=function(){c(he)};else if(typeof MessageChannel<"u"){var Pe=new MessageChannel,Zt=Pe.port2;Pe.port1.onmessage=he,Se=function(){Zt.postMessage(null)}}else Se=function(){w(he,0)};function en(D){O=D,_||(_=!0,Se())}function tn(D,L){T=w(function(){D(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_continueExecution=function(){v||g||(v=!0,en(x))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(D){switch(d){case 1:case 2:case 3:var L=3;break;default:L=d}var R=d;d=L;try{return D()}finally{d=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,L){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var R=d;d=D;try{return L()}finally{d=R}},e.unstable_scheduleCallback=function(D,L,R){var U=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?U+R:U):R=U,D){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=R+Y,D={id:p++,callback:L,priorityLevel:D,startTime:R,expirationTime:Y,sortIndex:-1},R>U?(D.sortIndex=R,t(a,D),n(u)===null&&D===n(a)&&(y?(h(T),T=-1):y=!0,tn(k,R-U))):(D.sortIndex=Y,t(u,D),v||g||(v=!0,en(x))),D},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(D){var L=d;return function(){var R=d;d=L;try{return D.apply(this,arguments)}finally{d=R}}}})(Ic);Pc.exports=Ic;var Uh=Pc.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var jc=C,Ae=Uh;function E(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Lc=new Set,Or={};function yn(e,t){Hn(e,t),Hn(e+"Capture",t)}function Hn(e,t){for(Or[e]=t,e=0;e<t.length;e++)Lc.add(t[e])}var St=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xs=Object.prototype.hasOwnProperty,Hh=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Lu={},Nu={};function Bh(e){return xs.call(Nu,e)?!0:xs.call(Lu,e)?!1:Hh.test(e)?Nu[e]=!0:(Lu[e]=!0,!1)}function Wh(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function qh(e,t,n,r){if(t===null||typeof t>"u"||Wh(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ce(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var fe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){fe[e]=new Ce(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];fe[t]=new Ce(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){fe[e]=new Ce(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){fe[e]=new Ce(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){fe[e]=new Ce(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){fe[e]=new Ce(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){fe[e]=new Ce(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){fe[e]=new Ce(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){fe[e]=new Ce(e,5,!1,e.toLowerCase(),null,!1,!1)});var Tl=/[\-:]([a-z])/g;function Dl(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Tl,Dl);fe[t]=new Ce(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Tl,Dl);fe[t]=new Ce(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Tl,Dl);fe[t]=new Ce(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){fe[e]=new Ce(e,1,!1,e.toLowerCase(),null,!1,!1)});fe.xlinkHref=new Ce("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){fe[e]=new Ce(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pl(e,t,n,r){var o=fe.hasOwnProperty(t)?fe[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(qh(t,n,o,r)&&(n=null),r||o===null?Bh(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ct=jc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ro=Symbol.for("react.element"),xn=Symbol.for("react.portal"),_n=Symbol.for("react.fragment"),Il=Symbol.for("react.strict_mode"),_s=Symbol.for("react.profiler"),Nc=Symbol.for("react.provider"),Mc=Symbol.for("react.context"),jl=Symbol.for("react.forward_ref"),Os=Symbol.for("react.suspense"),Ts=Symbol.for("react.suspense_list"),Ll=Symbol.for("react.memo"),Lt=Symbol.for("react.lazy"),Rc=Symbol.for("react.offscreen"),Mu=Symbol.iterator;function er(e){return e===null||typeof e!="object"?null:(e=Mu&&e[Mu]||e["@@iterator"],typeof e=="function"?e:null)}var G=Object.assign,Ui;function cr(e){if(Ui===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ui=t&&t[1]||""}return`
`+Ui+e}var Hi=!1;function Bi(e,t){if(!e||Hi)return"";Hi=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(a){var r=a}Reflect.construct(e,[],t)}else{try{t.call()}catch(a){r=a}e.call(t.prototype)}else{try{throw Error()}catch(a){r=a}e()}}catch(a){if(a&&r&&typeof a.stack=="string"){for(var o=a.stack.split(`
`),i=r.stack.split(`
`),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var u=`
`+o[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=l);break}}}finally{Hi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?cr(e):""}function Qh(e){switch(e.tag){case 5:return cr(e.type);case 16:return cr("Lazy");case 13:return cr("Suspense");case 19:return cr("SuspenseList");case 0:case 2:case 15:return e=Bi(e.type,!1),e;case 11:return e=Bi(e.type.render,!1),e;case 1:return e=Bi(e.type,!0),e;default:return""}}function Ds(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _n:return"Fragment";case xn:return"Portal";case _s:return"Profiler";case Il:return"StrictMode";case Os:return"Suspense";case Ts:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Mc:return(e.displayName||"Context")+".Consumer";case Nc:return(e._context.displayName||"Context")+".Provider";case jl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ll:return t=e.displayName||null,t!==null?t:Ds(e.type)||"Memo";case Lt:t=e._payload,e=e._init;try{return Ds(e(t))}catch{}}return null}function Kh(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ds(t);case 8:return t===Il?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ac(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Vh(e){var t=Ac(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function oo(e){e._valueTracker||(e._valueTracker=Vh(e))}function bc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ac(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function zo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ps(e,t){var n=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ru(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function zc(e,t){t=t.checked,t!=null&&Pl(e,"checked",t,!1)}function Is(e,t){zc(e,t);var n=Vt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?js(e,t.type,n):t.hasOwnProperty("defaultValue")&&js(e,t.type,Vt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Au(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function js(e,t,n){(t!=="number"||zo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var dr=Array.isArray;function An(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Vt(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ls(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(E(91));return G({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function bu(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(E(92));if(dr(n)){if(1<n.length)throw Error(E(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Vt(n)}}function $c(e,t){var n=Vt(t.value),r=Vt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function zu(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Fc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ns(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Fc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var io,Uc=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(io=io||document.createElement("div"),io.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=io.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Tr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var gr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Gh=["Webkit","ms","Moz","O"];Object.keys(gr).forEach(function(e){Gh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),gr[t]=gr[e]})});function Hc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||gr.hasOwnProperty(e)&&gr[e]?(""+t).trim():t+"px"}function Bc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Hc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Yh=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ms(e,t){if(t){if(Yh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(E(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(E(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(E(61))}if(t.style!=null&&typeof t.style!="object")throw Error(E(62))}}function Rs(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var As=null;function Nl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bs=null,bn=null,zn=null;function $u(e){if(e=Gr(e)){if(typeof bs!="function")throw Error(E(280));var t=e.stateNode;t&&(t=pi(t),bs(e.stateNode,e.type,t))}}function Wc(e){bn?zn?zn.push(e):zn=[e]:bn=e}function qc(){if(bn){var e=bn,t=zn;if(zn=bn=null,$u(e),t)for(e=0;e<t.length;e++)$u(t[e])}}function Qc(e,t){return e(t)}function Kc(){}var Wi=!1;function Vc(e,t,n){if(Wi)return e(t,n);Wi=!0;try{return Qc(e,t,n)}finally{Wi=!1,(bn!==null||zn!==null)&&(Kc(),qc())}}function Dr(e,t){var n=e.stateNode;if(n===null)return null;var r=pi(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(E(231,t,typeof n));return n}var zs=!1;if(St)try{var tr={};Object.defineProperty(tr,"passive",{get:function(){zs=!0}}),window.addEventListener("test",tr,tr),window.removeEventListener("test",tr,tr)}catch{zs=!1}function Xh(e,t,n,r,o,i,s,l,u){var a=Array.prototype.slice.call(arguments,3);try{t.apply(n,a)}catch(p){this.onError(p)}}var mr=!1,$o=null,Fo=!1,$s=null,Jh={onError:function(e){mr=!0,$o=e}};function Zh(e,t,n,r,o,i,s,l,u){mr=!1,$o=null,Xh.apply(Jh,arguments)}function ep(e,t,n,r,o,i,s,l,u){if(Zh.apply(this,arguments),mr){if(mr){var a=$o;mr=!1,$o=null}else throw Error(E(198));Fo||(Fo=!0,$s=a)}}function Sn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Gc(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Fu(e){if(Sn(e)!==e)throw Error(E(188))}function tp(e){var t=e.alternate;if(!t){if(t=Sn(e),t===null)throw Error(E(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Fu(o),e;if(i===r)return Fu(o),t;i=i.sibling}throw Error(E(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(E(189))}}if(n.alternate!==r)throw Error(E(190))}if(n.tag!==3)throw Error(E(188));return n.stateNode.current===n?e:t}function Yc(e){return e=tp(e),e!==null?Xc(e):null}function Xc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Xc(e);if(t!==null)return t;e=e.sibling}return null}var Jc=Ae.unstable_scheduleCallback,Uu=Ae.unstable_cancelCallback,np=Ae.unstable_shouldYield,rp=Ae.unstable_requestPaint,J=Ae.unstable_now,op=Ae.unstable_getCurrentPriorityLevel,Ml=Ae.unstable_ImmediatePriority,Zc=Ae.unstable_UserBlockingPriority,Uo=Ae.unstable_NormalPriority,ip=Ae.unstable_LowPriority,ed=Ae.unstable_IdlePriority,ci=null,dt=null;function sp(e){if(dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(ci,e,void 0,(e.current.flags&128)===128)}catch{}}var ot=Math.clz32?Math.clz32:ap,lp=Math.log,up=Math.LN2;function ap(e){return e>>>=0,e===0?32:31-(lp(e)/up|0)|0}var so=64,lo=4194304;function fr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ho(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=fr(l):(i&=s,i!==0&&(r=fr(i)))}else s=n&~o,s!==0?r=fr(s):i!==0&&(r=fr(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ot(t),o=1<<n,r|=e[n],t&=~o;return r}function cp(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function dp(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-ot(i),l=1<<s,u=o[s];u===-1?(!(l&n)||l&r)&&(o[s]=cp(l,t)):u<=t&&(e.expiredLanes|=l),i&=~l}}function Fs(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function td(){var e=so;return so<<=1,!(so&4194240)&&(so=64),e}function qi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Kr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ot(t),e[t]=n}function fp(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-ot(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Rl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ot(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var F=0;function nd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var rd,Al,od,id,sd,Us=!1,uo=[],$t=null,Ft=null,Ut=null,Pr=new Map,Ir=new Map,Rt=[],hp="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Hu(e,t){switch(e){case"focusin":case"focusout":$t=null;break;case"dragenter":case"dragleave":Ft=null;break;case"mouseover":case"mouseout":Ut=null;break;case"pointerover":case"pointerout":Pr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ir.delete(t.pointerId)}}function nr(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Gr(t),t!==null&&Al(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function pp(e,t,n,r,o){switch(t){case"focusin":return $t=nr($t,e,t,n,r,o),!0;case"dragenter":return Ft=nr(Ft,e,t,n,r,o),!0;case"mouseover":return Ut=nr(Ut,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Pr.set(i,nr(Pr.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Ir.set(i,nr(Ir.get(i)||null,e,t,n,r,o)),!0}return!1}function ld(e){var t=on(e.target);if(t!==null){var n=Sn(t);if(n!==null){if(t=n.tag,t===13){if(t=Gc(n),t!==null){e.blockedOn=t,sd(e.priority,function(){od(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Oo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Hs(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);As=r,n.target.dispatchEvent(r),As=null}else return t=Gr(n),t!==null&&Al(t),e.blockedOn=n,!1;t.shift()}return!0}function Bu(e,t,n){Oo(e)&&n.delete(t)}function gp(){Us=!1,$t!==null&&Oo($t)&&($t=null),Ft!==null&&Oo(Ft)&&(Ft=null),Ut!==null&&Oo(Ut)&&(Ut=null),Pr.forEach(Bu),Ir.forEach(Bu)}function rr(e,t){e.blockedOn===t&&(e.blockedOn=null,Us||(Us=!0,Ae.unstable_scheduleCallback(Ae.unstable_NormalPriority,gp)))}function jr(e){function t(o){return rr(o,e)}if(0<uo.length){rr(uo[0],e);for(var n=1;n<uo.length;n++){var r=uo[n];r.blockedOn===e&&(r.blockedOn=null)}}for($t!==null&&rr($t,e),Ft!==null&&rr(Ft,e),Ut!==null&&rr(Ut,e),Pr.forEach(t),Ir.forEach(t),n=0;n<Rt.length;n++)r=Rt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Rt.length&&(n=Rt[0],n.blockedOn===null);)ld(n),n.blockedOn===null&&Rt.shift()}var $n=Ct.ReactCurrentBatchConfig,Bo=!0;function mp(e,t,n,r){var o=F,i=$n.transition;$n.transition=null;try{F=1,bl(e,t,n,r)}finally{F=o,$n.transition=i}}function vp(e,t,n,r){var o=F,i=$n.transition;$n.transition=null;try{F=4,bl(e,t,n,r)}finally{F=o,$n.transition=i}}function bl(e,t,n,r){if(Bo){var o=Hs(e,t,n,r);if(o===null)ts(e,t,r,Wo,n),Hu(e,r);else if(pp(o,e,t,n,r))r.stopPropagation();else if(Hu(e,r),t&4&&-1<hp.indexOf(e)){for(;o!==null;){var i=Gr(o);if(i!==null&&rd(i),i=Hs(e,t,n,r),i===null&&ts(e,t,r,Wo,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else ts(e,t,r,null,n)}}var Wo=null;function Hs(e,t,n,r){if(Wo=null,e=Nl(r),e=on(e),e!==null)if(t=Sn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Gc(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Wo=e,null}function ud(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(op()){case Ml:return 1;case Zc:return 4;case Uo:case ip:return 16;case ed:return 536870912;default:return 16}default:return 16}}var bt=null,zl=null,To=null;function ad(){if(To)return To;var e,t=zl,n=t.length,r,o="value"in bt?bt.value:bt.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return To=o.slice(e,1<r?1-r:void 0)}function Do(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ao(){return!0}function Wu(){return!1}function ze(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ao:Wu,this.isPropagationStopped=Wu,this}return G(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ao)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ao)},persist:function(){},isPersistent:ao}),t}var Xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$l=ze(Xn),Vr=G({},Xn,{view:0,detail:0}),yp=ze(Vr),Qi,Ki,or,di=G({},Vr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fl,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==or&&(or&&e.type==="mousemove"?(Qi=e.screenX-or.screenX,Ki=e.screenY-or.screenY):Ki=Qi=0,or=e),Qi)},movementY:function(e){return"movementY"in e?e.movementY:Ki}}),qu=ze(di),Sp=G({},di,{dataTransfer:0}),wp=ze(Sp),kp=G({},Vr,{relatedTarget:0}),Vi=ze(kp),Ep=G({},Xn,{animationName:0,elapsedTime:0,pseudoElement:0}),Cp=ze(Ep),xp=G({},Xn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_p=ze(xp),Op=G({},Xn,{data:0}),Qu=ze(Op),Tp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dp={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Pp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ip(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Pp[e])?!!t[e]:!1}function Fl(){return Ip}var jp=G({},Vr,{key:function(e){if(e.key){var t=Tp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Do(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Dp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fl,charCode:function(e){return e.type==="keypress"?Do(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Do(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Lp=ze(jp),Np=G({},di,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ku=ze(Np),Mp=G({},Vr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fl}),Rp=ze(Mp),Ap=G({},Xn,{propertyName:0,elapsedTime:0,pseudoElement:0}),bp=ze(Ap),zp=G({},di,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),$p=ze(zp),Fp=[9,13,27,32],Ul=St&&"CompositionEvent"in window,vr=null;St&&"documentMode"in document&&(vr=document.documentMode);var Up=St&&"TextEvent"in window&&!vr,cd=St&&(!Ul||vr&&8<vr&&11>=vr),Vu=String.fromCharCode(32),Gu=!1;function dd(e,t){switch(e){case"keyup":return Fp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var On=!1;function Hp(e,t){switch(e){case"compositionend":return fd(t);case"keypress":return t.which!==32?null:(Gu=!0,Vu);case"textInput":return e=t.data,e===Vu&&Gu?null:e;default:return null}}function Bp(e,t){if(On)return e==="compositionend"||!Ul&&dd(e,t)?(e=ad(),To=zl=bt=null,On=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return cd&&t.locale!=="ko"?null:t.data;default:return null}}var Wp={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Yu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Wp[e.type]:t==="textarea"}function hd(e,t,n,r){Wc(r),t=qo(t,"onChange"),0<t.length&&(n=new $l("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var yr=null,Lr=null;function qp(e){xd(e,0)}function fi(e){var t=Pn(e);if(bc(t))return e}function Qp(e,t){if(e==="change")return t}var pd=!1;if(St){var Gi;if(St){var Yi="oninput"in document;if(!Yi){var Xu=document.createElement("div");Xu.setAttribute("oninput","return;"),Yi=typeof Xu.oninput=="function"}Gi=Yi}else Gi=!1;pd=Gi&&(!document.documentMode||9<document.documentMode)}function Ju(){yr&&(yr.detachEvent("onpropertychange",gd),Lr=yr=null)}function gd(e){if(e.propertyName==="value"&&fi(Lr)){var t=[];hd(t,Lr,e,Nl(e)),Vc(qp,t)}}function Kp(e,t,n){e==="focusin"?(Ju(),yr=t,Lr=n,yr.attachEvent("onpropertychange",gd)):e==="focusout"&&Ju()}function Vp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fi(Lr)}function Gp(e,t){if(e==="click")return fi(t)}function Yp(e,t){if(e==="input"||e==="change")return fi(t)}function Xp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var st=typeof Object.is=="function"?Object.is:Xp;function Nr(e,t){if(st(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!xs.call(t,o)||!st(e[o],t[o]))return!1}return!0}function Zu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ea(e,t){var n=Zu(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Zu(n)}}function md(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?md(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vd(){for(var e=window,t=zo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=zo(e.document)}return t}function Hl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Jp(e){var t=vd(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&md(n.ownerDocument.documentElement,n)){if(r!==null&&Hl(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=ea(n,i);var s=ea(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Zp=St&&"documentMode"in document&&11>=document.documentMode,Tn=null,Bs=null,Sr=null,Ws=!1;function ta(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ws||Tn==null||Tn!==zo(r)||(r=Tn,"selectionStart"in r&&Hl(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sr&&Nr(Sr,r)||(Sr=r,r=qo(Bs,"onSelect"),0<r.length&&(t=new $l("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Tn)))}function co(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Dn={animationend:co("Animation","AnimationEnd"),animationiteration:co("Animation","AnimationIteration"),animationstart:co("Animation","AnimationStart"),transitionend:co("Transition","TransitionEnd")},Xi={},yd={};St&&(yd=document.createElement("div").style,"AnimationEvent"in window||(delete Dn.animationend.animation,delete Dn.animationiteration.animation,delete Dn.animationstart.animation),"TransitionEvent"in window||delete Dn.transitionend.transition);function hi(e){if(Xi[e])return Xi[e];if(!Dn[e])return e;var t=Dn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in yd)return Xi[e]=t[n];return e}var Sd=hi("animationend"),wd=hi("animationiteration"),kd=hi("animationstart"),Ed=hi("transitionend"),Cd=new Map,na="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Yt(e,t){Cd.set(e,t),yn(t,[e])}for(var Ji=0;Ji<na.length;Ji++){var Zi=na[Ji],e0=Zi.toLowerCase(),t0=Zi[0].toUpperCase()+Zi.slice(1);Yt(e0,"on"+t0)}Yt(Sd,"onAnimationEnd");Yt(wd,"onAnimationIteration");Yt(kd,"onAnimationStart");Yt("dblclick","onDoubleClick");Yt("focusin","onFocus");Yt("focusout","onBlur");Yt(Ed,"onTransitionEnd");Hn("onMouseEnter",["mouseout","mouseover"]);Hn("onMouseLeave",["mouseout","mouseover"]);Hn("onPointerEnter",["pointerout","pointerover"]);Hn("onPointerLeave",["pointerout","pointerover"]);yn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));yn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));yn("onBeforeInput",["compositionend","keypress","textInput","paste"]);yn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));yn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));yn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),n0=new Set("cancel close invalid load scroll toggle".split(" ").concat(hr));function ra(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,ep(r,t,void 0,e),e.currentTarget=null}function xd(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],u=l.instance,a=l.currentTarget;if(l=l.listener,u!==i&&o.isPropagationStopped())break e;ra(o,l,a),i=u}else for(s=0;s<r.length;s++){if(l=r[s],u=l.instance,a=l.currentTarget,l=l.listener,u!==i&&o.isPropagationStopped())break e;ra(o,l,a),i=u}}}if(Fo)throw e=$s,Fo=!1,$s=null,e}function W(e,t){var n=t[Gs];n===void 0&&(n=t[Gs]=new Set);var r=e+"__bubble";n.has(r)||(_d(t,e,2,!1),n.add(r))}function es(e,t,n){var r=0;t&&(r|=4),_d(n,e,r,t)}var fo="_reactListening"+Math.random().toString(36).slice(2);function Mr(e){if(!e[fo]){e[fo]=!0,Lc.forEach(function(n){n!=="selectionchange"&&(n0.has(n)||es(n,!1,e),es(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fo]||(t[fo]=!0,es("selectionchange",!1,t))}}function _d(e,t,n,r){switch(ud(t)){case 1:var o=mp;break;case 4:o=vp;break;default:o=bl}n=o.bind(null,t,n,e),o=void 0,!zs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function ts(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var u=s.tag;if((u===3||u===4)&&(u=s.stateNode.containerInfo,u===o||u.nodeType===8&&u.parentNode===o))return;s=s.return}for(;l!==null;){if(s=on(l),s===null)return;if(u=s.tag,u===5||u===6){r=i=s;continue e}l=l.parentNode}}r=r.return}Vc(function(){var a=i,p=Nl(n),m=[];e:{var d=Cd.get(e);if(d!==void 0){var g=$l,v=e;switch(e){case"keypress":if(Do(n)===0)break e;case"keydown":case"keyup":g=Lp;break;case"focusin":v="focus",g=Vi;break;case"focusout":v="blur",g=Vi;break;case"beforeblur":case"afterblur":g=Vi;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=qu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=wp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=Rp;break;case Sd:case wd:case kd:g=Cp;break;case Ed:g=bp;break;case"scroll":g=yp;break;case"wheel":g=$p;break;case"copy":case"cut":case"paste":g=_p;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Ku}var y=(t&4)!==0,w=!y&&e==="scroll",h=y?d!==null?d+"Capture":null:d;y=[];for(var c=a,f;c!==null;){f=c;var k=f.stateNode;if(f.tag===5&&k!==null&&(f=k,h!==null&&(k=Dr(c,h),k!=null&&y.push(Rr(c,k,f)))),w)break;c=c.return}0<y.length&&(d=new g(d,v,null,n,p),m.push({event:d,listeners:y}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",d&&n!==As&&(v=n.relatedTarget||n.fromElement)&&(on(v)||v[wt]))break e;if((g||d)&&(d=p.window===p?p:(d=p.ownerDocument)?d.defaultView||d.parentWindow:window,g?(v=n.relatedTarget||n.toElement,g=a,v=v?on(v):null,v!==null&&(w=Sn(v),v!==w||v.tag!==5&&v.tag!==6)&&(v=null)):(g=null,v=a),g!==v)){if(y=qu,k="onMouseLeave",h="onMouseEnter",c="mouse",(e==="pointerout"||e==="pointerover")&&(y=Ku,k="onPointerLeave",h="onPointerEnter",c="pointer"),w=g==null?d:Pn(g),f=v==null?d:Pn(v),d=new y(k,c+"leave",g,n,p),d.target=w,d.relatedTarget=f,k=null,on(p)===a&&(y=new y(h,c+"enter",v,n,p),y.target=f,y.relatedTarget=w,k=y),w=k,g&&v)t:{for(y=g,h=v,c=0,f=y;f;f=En(f))c++;for(f=0,k=h;k;k=En(k))f++;for(;0<c-f;)y=En(y),c--;for(;0<f-c;)h=En(h),f--;for(;c--;){if(y===h||h!==null&&y===h.alternate)break t;y=En(y),h=En(h)}y=null}else y=null;g!==null&&oa(m,d,g,y,!1),v!==null&&w!==null&&oa(m,w,v,y,!0)}}e:{if(d=a?Pn(a):window,g=d.nodeName&&d.nodeName.toLowerCase(),g==="select"||g==="input"&&d.type==="file")var x=Qp;else if(Yu(d))if(pd)x=Yp;else{x=Vp;var _=Kp}else(g=d.nodeName)&&g.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(x=Gp);if(x&&(x=x(e,a))){hd(m,x,n,p);break e}_&&_(e,d,a),e==="focusout"&&(_=d._wrapperState)&&_.controlled&&d.type==="number"&&js(d,"number",d.value)}switch(_=a?Pn(a):window,e){case"focusin":(Yu(_)||_.contentEditable==="true")&&(Tn=_,Bs=a,Sr=null);break;case"focusout":Sr=Bs=Tn=null;break;case"mousedown":Ws=!0;break;case"contextmenu":case"mouseup":case"dragend":Ws=!1,ta(m,n,p);break;case"selectionchange":if(Zp)break;case"keydown":case"keyup":ta(m,n,p)}var O;if(Ul)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else On?dd(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(cd&&n.locale!=="ko"&&(On||T!=="onCompositionStart"?T==="onCompositionEnd"&&On&&(O=ad()):(bt=p,zl="value"in bt?bt.value:bt.textContent,On=!0)),_=qo(a,T),0<_.length&&(T=new Qu(T,e,null,n,p),m.push({event:T,listeners:_}),O?T.data=O:(O=fd(n),O!==null&&(T.data=O)))),(O=Up?Hp(e,n):Bp(e,n))&&(a=qo(a,"onBeforeInput"),0<a.length&&(p=new Qu("onBeforeInput","beforeinput",null,n,p),m.push({event:p,listeners:a}),p.data=O))}xd(m,t)})}function Rr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qo(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Dr(e,n),i!=null&&r.unshift(Rr(e,i,o)),i=Dr(e,t),i!=null&&r.push(Rr(e,i,o))),e=e.return}return r}function En(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function oa(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,u=l.alternate,a=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&a!==null&&(l=a,o?(u=Dr(n,i),u!=null&&s.unshift(Rr(n,u,l))):o||(u=Dr(n,i),u!=null&&s.push(Rr(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var r0=/\r\n?/g,o0=/\u0000|\uFFFD/g;function ia(e){return(typeof e=="string"?e:""+e).replace(r0,`
`).replace(o0,"")}function ho(e,t,n){if(t=ia(t),ia(e)!==t&&n)throw Error(E(425))}function Qo(){}var qs=null,Qs=null;function Ks(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Vs=typeof setTimeout=="function"?setTimeout:void 0,i0=typeof clearTimeout=="function"?clearTimeout:void 0,sa=typeof Promise=="function"?Promise:void 0,s0=typeof queueMicrotask=="function"?queueMicrotask:typeof sa<"u"?function(e){return sa.resolve(null).then(e).catch(l0)}:Vs;function l0(e){setTimeout(function(){throw e})}function ns(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),jr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);jr(t)}function Ht(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function la(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Jn=Math.random().toString(36).slice(2),ct="__reactFiber$"+Jn,Ar="__reactProps$"+Jn,wt="__reactContainer$"+Jn,Gs="__reactEvents$"+Jn,u0="__reactListeners$"+Jn,a0="__reactHandles$"+Jn;function on(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[wt]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=la(e);e!==null;){if(n=e[ct])return n;e=la(e)}return t}e=n,n=e.parentNode}return null}function Gr(e){return e=e[ct]||e[wt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Pn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(E(33))}function pi(e){return e[Ar]||null}var Ys=[],In=-1;function Xt(e){return{current:e}}function q(e){0>In||(e.current=Ys[In],Ys[In]=null,In--)}function H(e,t){In++,Ys[In]=e.current,e.current=t}var Gt={},ye=Xt(Gt),Oe=Xt(!1),dn=Gt;function Bn(e,t){var n=e.type.contextTypes;if(!n)return Gt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Te(e){return e=e.childContextTypes,e!=null}function Ko(){q(Oe),q(ye)}function ua(e,t,n){if(ye.current!==Gt)throw Error(E(168));H(ye,t),H(Oe,n)}function Od(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(E(108,Kh(e)||"Unknown",o));return G({},n,r)}function Vo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gt,dn=ye.current,H(ye,e),H(Oe,Oe.current),!0}function aa(e,t,n){var r=e.stateNode;if(!r)throw Error(E(169));n?(e=Od(e,t,dn),r.__reactInternalMemoizedMergedChildContext=e,q(Oe),q(ye),H(ye,e)):q(Oe),H(Oe,n)}var gt=null,gi=!1,rs=!1;function Td(e){gt===null?gt=[e]:gt.push(e)}function c0(e){gi=!0,Td(e)}function Jt(){if(!rs&&gt!==null){rs=!0;var e=0,t=F;try{var n=gt;for(F=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}gt=null,gi=!1}catch(o){throw gt!==null&&(gt=gt.slice(e+1)),Jc(Ml,Jt),o}finally{F=t,rs=!1}}return null}var jn=[],Ln=0,Go=null,Yo=0,qe=[],Qe=0,fn=null,mt=1,vt="";function nn(e,t){jn[Ln++]=Yo,jn[Ln++]=Go,Go=e,Yo=t}function Dd(e,t,n){qe[Qe++]=mt,qe[Qe++]=vt,qe[Qe++]=fn,fn=e;var r=mt;e=vt;var o=32-ot(r)-1;r&=~(1<<o),n+=1;var i=32-ot(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,mt=1<<32-ot(t)+o|n<<o|r,vt=i+e}else mt=1<<i|n<<o|r,vt=e}function Bl(e){e.return!==null&&(nn(e,1),Dd(e,1,0))}function Wl(e){for(;e===Go;)Go=jn[--Ln],jn[Ln]=null,Yo=jn[--Ln],jn[Ln]=null;for(;e===fn;)fn=qe[--Qe],qe[Qe]=null,vt=qe[--Qe],qe[Qe]=null,mt=qe[--Qe],qe[Qe]=null}var Re=null,Me=null,Q=!1,rt=null;function Pd(e,t){var n=Ve(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function ca(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Re=e,Me=Ht(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Re=e,Me=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=fn!==null?{id:mt,overflow:vt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ve(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Re=e,Me=null,!0):!1;default:return!1}}function Xs(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Js(e){if(Q){var t=Me;if(t){var n=t;if(!ca(e,t)){if(Xs(e))throw Error(E(418));t=Ht(n.nextSibling);var r=Re;t&&ca(e,t)?Pd(r,n):(e.flags=e.flags&-4097|2,Q=!1,Re=e)}}else{if(Xs(e))throw Error(E(418));e.flags=e.flags&-4097|2,Q=!1,Re=e}}}function da(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Re=e}function po(e){if(e!==Re)return!1;if(!Q)return da(e),Q=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ks(e.type,e.memoizedProps)),t&&(t=Me)){if(Xs(e))throw Id(),Error(E(418));for(;t;)Pd(e,t),t=Ht(t.nextSibling)}if(da(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(E(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Me=Ht(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Me=null}}else Me=Re?Ht(e.stateNode.nextSibling):null;return!0}function Id(){for(var e=Me;e;)e=Ht(e.nextSibling)}function Wn(){Me=Re=null,Q=!1}function ql(e){rt===null?rt=[e]:rt.push(e)}var d0=Ct.ReactCurrentBatchConfig;function tt(e,t){if(e&&e.defaultProps){t=G({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Xo=Xt(null),Jo=null,Nn=null,Ql=null;function Kl(){Ql=Nn=Jo=null}function Vl(e){var t=Xo.current;q(Xo),e._currentValue=t}function Zs(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Fn(e,t){Jo=e,Ql=Nn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_e=!0),e.firstContext=null)}function Ye(e){var t=e._currentValue;if(Ql!==e)if(e={context:e,memoizedValue:t,next:null},Nn===null){if(Jo===null)throw Error(E(308));Nn=e,Jo.dependencies={lanes:0,firstContext:e}}else Nn=Nn.next=e;return t}var sn=null;function Gl(e){sn===null?sn=[e]:sn.push(e)}function jd(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Gl(t)):(n.next=o.next,o.next=n),t.interleaved=n,kt(e,r)}function kt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Nt=!1;function Yl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ld(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function yt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,kt(e,n)}return o=r.interleaved,o===null?(t.next=t,Gl(r)):(t.next=o.next,o.next=t),r.interleaved=t,kt(e,n)}function Po(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rl(e,n)}}function fa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Zo(e,t,n,r){var o=e.updateQueue;Nt=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var u=l,a=u.next;u.next=null,s===null?i=a:s.next=a,s=u;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==s&&(l===null?p.firstBaseUpdate=a:l.next=a,p.lastBaseUpdate=u))}if(i!==null){var m=o.baseState;s=0,p=a=u=null,l=i;do{var d=l.lane,g=l.eventTime;if((r&d)===d){p!==null&&(p=p.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,y=l;switch(d=t,g=n,y.tag){case 1:if(v=y.payload,typeof v=="function"){m=v.call(g,m,d);break e}m=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=y.payload,d=typeof v=="function"?v.call(g,m,d):v,d==null)break e;m=G({},m,d);break e;case 2:Nt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,d=o.effects,d===null?o.effects=[l]:d.push(l))}else g={eventTime:g,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(a=p=g,u=m):p=p.next=g,s|=d;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;d=l,l=d.next,d.next=null,o.lastBaseUpdate=d,o.shared.pending=null}}while(1);if(p===null&&(u=m),o.baseState=u,o.firstBaseUpdate=a,o.lastBaseUpdate=p,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);pn|=s,e.lanes=s,e.memoizedState=m}}function ha(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(E(191,o));o.call(r)}}}var Nd=new jc.Component().refs;function el(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:G({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var mi={isMounted:function(e){return(e=e._reactInternals)?Sn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ke(),o=qt(e),i=yt(r,o);i.payload=t,n!=null&&(i.callback=n),t=Bt(e,i,o),t!==null&&(it(t,e,o,r),Po(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ke(),o=qt(e),i=yt(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Bt(e,i,o),t!==null&&(it(t,e,o,r),Po(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ke(),r=qt(e),o=yt(n,r);o.tag=2,t!=null&&(o.callback=t),t=Bt(e,o,r),t!==null&&(it(t,e,r,n),Po(t,e,r))}};function pa(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Nr(n,r)||!Nr(o,i):!0}function Md(e,t,n){var r=!1,o=Gt,i=t.contextType;return typeof i=="object"&&i!==null?i=Ye(i):(o=Te(t)?dn:ye.current,r=t.contextTypes,i=(r=r!=null)?Bn(e,o):Gt),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=mi,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function ga(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&mi.enqueueReplaceState(t,t.state,null)}function tl(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=Nd,Yl(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Ye(i):(i=Te(t)?dn:ye.current,o.context=Bn(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(el(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&mi.enqueueReplaceState(o,o.state,null),Zo(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ir(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(E(309));var r=n.stateNode}if(!r)throw Error(E(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;l===Nd&&(l=o.refs={}),s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(E(284));if(!n._owner)throw Error(E(290,e))}return e}function go(e,t){throw e=Object.prototype.toString.call(t),Error(E(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ma(e){var t=e._init;return t(e._payload)}function Rd(e){function t(h,c){if(e){var f=h.deletions;f===null?(h.deletions=[c],h.flags|=16):f.push(c)}}function n(h,c){if(!e)return null;for(;c!==null;)t(h,c),c=c.sibling;return null}function r(h,c){for(h=new Map;c!==null;)c.key!==null?h.set(c.key,c):h.set(c.index,c),c=c.sibling;return h}function o(h,c){return h=Qt(h,c),h.index=0,h.sibling=null,h}function i(h,c,f){return h.index=f,e?(f=h.alternate,f!==null?(f=f.index,f<c?(h.flags|=2,c):f):(h.flags|=2,c)):(h.flags|=1048576,c)}function s(h){return e&&h.alternate===null&&(h.flags|=2),h}function l(h,c,f,k){return c===null||c.tag!==6?(c=cs(f,h.mode,k),c.return=h,c):(c=o(c,f),c.return=h,c)}function u(h,c,f,k){var x=f.type;return x===_n?p(h,c,f.props.children,k,f.key):c!==null&&(c.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Lt&&ma(x)===c.type)?(k=o(c,f.props),k.ref=ir(h,c,f),k.return=h,k):(k=Ro(f.type,f.key,f.props,null,h.mode,k),k.ref=ir(h,c,f),k.return=h,k)}function a(h,c,f,k){return c===null||c.tag!==4||c.stateNode.containerInfo!==f.containerInfo||c.stateNode.implementation!==f.implementation?(c=ds(f,h.mode,k),c.return=h,c):(c=o(c,f.children||[]),c.return=h,c)}function p(h,c,f,k,x){return c===null||c.tag!==7?(c=an(f,h.mode,k,x),c.return=h,c):(c=o(c,f),c.return=h,c)}function m(h,c,f){if(typeof c=="string"&&c!==""||typeof c=="number")return c=cs(""+c,h.mode,f),c.return=h,c;if(typeof c=="object"&&c!==null){switch(c.$$typeof){case ro:return f=Ro(c.type,c.key,c.props,null,h.mode,f),f.ref=ir(h,null,c),f.return=h,f;case xn:return c=ds(c,h.mode,f),c.return=h,c;case Lt:var k=c._init;return m(h,k(c._payload),f)}if(dr(c)||er(c))return c=an(c,h.mode,f,null),c.return=h,c;go(h,c)}return null}function d(h,c,f,k){var x=c!==null?c.key:null;if(typeof f=="string"&&f!==""||typeof f=="number")return x!==null?null:l(h,c,""+f,k);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case ro:return f.key===x?u(h,c,f,k):null;case xn:return f.key===x?a(h,c,f,k):null;case Lt:return x=f._init,d(h,c,x(f._payload),k)}if(dr(f)||er(f))return x!==null?null:p(h,c,f,k,null);go(h,f)}return null}function g(h,c,f,k,x){if(typeof k=="string"&&k!==""||typeof k=="number")return h=h.get(f)||null,l(c,h,""+k,x);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case ro:return h=h.get(k.key===null?f:k.key)||null,u(c,h,k,x);case xn:return h=h.get(k.key===null?f:k.key)||null,a(c,h,k,x);case Lt:var _=k._init;return g(h,c,f,_(k._payload),x)}if(dr(k)||er(k))return h=h.get(f)||null,p(c,h,k,x,null);go(c,k)}return null}function v(h,c,f,k){for(var x=null,_=null,O=c,T=c=0,j=null;O!==null&&T<f.length;T++){O.index>T?(j=O,O=null):j=O.sibling;var I=d(h,O,f[T],k);if(I===null){O===null&&(O=j);break}e&&O&&I.alternate===null&&t(h,O),c=i(I,c,T),_===null?x=I:_.sibling=I,_=I,O=j}if(T===f.length)return n(h,O),Q&&nn(h,T),x;if(O===null){for(;T<f.length;T++)O=m(h,f[T],k),O!==null&&(c=i(O,c,T),_===null?x=O:_.sibling=O,_=O);return Q&&nn(h,T),x}for(O=r(h,O);T<f.length;T++)j=g(O,h,T,f[T],k),j!==null&&(e&&j.alternate!==null&&O.delete(j.key===null?T:j.key),c=i(j,c,T),_===null?x=j:_.sibling=j,_=j);return e&&O.forEach(function(re){return t(h,re)}),Q&&nn(h,T),x}function y(h,c,f,k){var x=er(f);if(typeof x!="function")throw Error(E(150));if(f=x.call(f),f==null)throw Error(E(151));for(var _=x=null,O=c,T=c=0,j=null,I=f.next();O!==null&&!I.done;T++,I=f.next()){O.index>T?(j=O,O=null):j=O.sibling;var re=d(h,O,I.value,k);if(re===null){O===null&&(O=j);break}e&&O&&re.alternate===null&&t(h,O),c=i(re,c,T),_===null?x=re:_.sibling=re,_=re,O=j}if(I.done)return n(h,O),Q&&nn(h,T),x;if(O===null){for(;!I.done;T++,I=f.next())I=m(h,I.value,k),I!==null&&(c=i(I,c,T),_===null?x=I:_.sibling=I,_=I);return Q&&nn(h,T),x}for(O=r(h,O);!I.done;T++,I=f.next())I=g(O,h,T,I.value,k),I!==null&&(e&&I.alternate!==null&&O.delete(I.key===null?T:I.key),c=i(I,c,T),_===null?x=I:_.sibling=I,_=I);return e&&O.forEach(function(he){return t(h,he)}),Q&&nn(h,T),x}function w(h,c,f,k){if(typeof f=="object"&&f!==null&&f.type===_n&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case ro:e:{for(var x=f.key,_=c;_!==null;){if(_.key===x){if(x=f.type,x===_n){if(_.tag===7){n(h,_.sibling),c=o(_,f.props.children),c.return=h,h=c;break e}}else if(_.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Lt&&ma(x)===_.type){n(h,_.sibling),c=o(_,f.props),c.ref=ir(h,_,f),c.return=h,h=c;break e}n(h,_);break}else t(h,_);_=_.sibling}f.type===_n?(c=an(f.props.children,h.mode,k,f.key),c.return=h,h=c):(k=Ro(f.type,f.key,f.props,null,h.mode,k),k.ref=ir(h,c,f),k.return=h,h=k)}return s(h);case xn:e:{for(_=f.key;c!==null;){if(c.key===_)if(c.tag===4&&c.stateNode.containerInfo===f.containerInfo&&c.stateNode.implementation===f.implementation){n(h,c.sibling),c=o(c,f.children||[]),c.return=h,h=c;break e}else{n(h,c);break}else t(h,c);c=c.sibling}c=ds(f,h.mode,k),c.return=h,h=c}return s(h);case Lt:return _=f._init,w(h,c,_(f._payload),k)}if(dr(f))return v(h,c,f,k);if(er(f))return y(h,c,f,k);go(h,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,c!==null&&c.tag===6?(n(h,c.sibling),c=o(c,f),c.return=h,h=c):(n(h,c),c=cs(f,h.mode,k),c.return=h,h=c),s(h)):n(h,c)}return w}var qn=Rd(!0),Ad=Rd(!1),Yr={},ft=Xt(Yr),br=Xt(Yr),zr=Xt(Yr);function ln(e){if(e===Yr)throw Error(E(174));return e}function Xl(e,t){switch(H(zr,t),H(br,e),H(ft,Yr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ns(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ns(t,e)}q(ft),H(ft,t)}function Qn(){q(ft),q(br),q(zr)}function bd(e){ln(zr.current);var t=ln(ft.current),n=Ns(t,e.type);t!==n&&(H(br,e),H(ft,n))}function Jl(e){br.current===e&&(q(ft),q(br))}var K=Xt(0);function ei(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var os=[];function Zl(){for(var e=0;e<os.length;e++)os[e]._workInProgressVersionPrimary=null;os.length=0}var Io=Ct.ReactCurrentDispatcher,is=Ct.ReactCurrentBatchConfig,hn=0,V=null,te=null,le=null,ti=!1,wr=!1,$r=0,f0=0;function pe(){throw Error(E(321))}function eu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!st(e[n],t[n]))return!1;return!0}function tu(e,t,n,r,o,i){if(hn=i,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Io.current=e===null||e.memoizedState===null?m0:v0,e=n(r,o),wr){i=0;do{if(wr=!1,$r=0,25<=i)throw Error(E(301));i+=1,le=te=null,t.updateQueue=null,Io.current=y0,e=n(r,o)}while(wr)}if(Io.current=ni,t=te!==null&&te.next!==null,hn=0,le=te=V=null,ti=!1,t)throw Error(E(300));return e}function nu(){var e=$r!==0;return $r=0,e}function at(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return le===null?V.memoizedState=le=e:le=le.next=e,le}function Xe(){if(te===null){var e=V.alternate;e=e!==null?e.memoizedState:null}else e=te.next;var t=le===null?V.memoizedState:le.next;if(t!==null)le=t,te=e;else{if(e===null)throw Error(E(310));te=e,e={memoizedState:te.memoizedState,baseState:te.baseState,baseQueue:te.baseQueue,queue:te.queue,next:null},le===null?V.memoizedState=le=e:le=le.next=e}return le}function Fr(e,t){return typeof t=="function"?t(e):t}function ss(e){var t=Xe(),n=t.queue;if(n===null)throw Error(E(311));n.lastRenderedReducer=e;var r=te,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,u=null,a=i;do{var p=a.lane;if((hn&p)===p)u!==null&&(u=u.next={lane:0,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null}),r=a.hasEagerState?a.eagerState:e(r,a.action);else{var m={lane:p,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null};u===null?(l=u=m,s=r):u=u.next=m,V.lanes|=p,pn|=p}a=a.next}while(a!==null&&a!==i);u===null?s=r:u.next=l,st(r,t.memoizedState)||(_e=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,V.lanes|=i,pn|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ls(e){var t=Xe(),n=t.queue;if(n===null)throw Error(E(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);st(i,t.memoizedState)||(_e=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function zd(){}function $d(e,t){var n=V,r=Xe(),o=t(),i=!st(r.memoizedState,o);if(i&&(r.memoizedState=o,_e=!0),r=r.queue,ru(Hd.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||le!==null&&le.memoizedState.tag&1){if(n.flags|=2048,Ur(9,Ud.bind(null,n,r,o,t),void 0,null),ue===null)throw Error(E(349));hn&30||Fd(n,t,o)}return o}function Fd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t={lastEffect:null,stores:null},V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ud(e,t,n,r){t.value=n,t.getSnapshot=r,Bd(t)&&Wd(e)}function Hd(e,t,n){return n(function(){Bd(t)&&Wd(e)})}function Bd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!st(e,n)}catch{return!0}}function Wd(e){var t=kt(e,1);t!==null&&it(t,e,1,-1)}function va(e){var t=at();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:e},t.queue=e,e=e.dispatch=g0.bind(null,V,e),[t.memoizedState,e]}function Ur(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=V.updateQueue,t===null?(t={lastEffect:null,stores:null},V.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function qd(){return Xe().memoizedState}function jo(e,t,n,r){var o=at();V.flags|=e,o.memoizedState=Ur(1|t,n,void 0,r===void 0?null:r)}function vi(e,t,n,r){var o=Xe();r=r===void 0?null:r;var i=void 0;if(te!==null){var s=te.memoizedState;if(i=s.destroy,r!==null&&eu(r,s.deps)){o.memoizedState=Ur(t,n,i,r);return}}V.flags|=e,o.memoizedState=Ur(1|t,n,i,r)}function ya(e,t){return jo(8390656,8,e,t)}function ru(e,t){return vi(2048,8,e,t)}function Qd(e,t){return vi(4,2,e,t)}function Kd(e,t){return vi(4,4,e,t)}function Vd(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Gd(e,t,n){return n=n!=null?n.concat([e]):null,vi(4,4,Vd.bind(null,t,e),n)}function ou(){}function Yd(e,t){var n=Xe();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&eu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xd(e,t){var n=Xe();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&eu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Jd(e,t,n){return hn&21?(st(n,t)||(n=td(),V.lanes|=n,pn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,_e=!0),e.memoizedState=n)}function h0(e,t){var n=F;F=n!==0&&4>n?n:4,e(!0);var r=is.transition;is.transition={};try{e(!1),t()}finally{F=n,is.transition=r}}function Zd(){return Xe().memoizedState}function p0(e,t,n){var r=qt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ef(e))tf(t,n);else if(n=jd(e,t,n,r),n!==null){var o=ke();it(n,e,r,o),nf(n,t,r)}}function g0(e,t,n){var r=qt(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ef(e))tf(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,st(l,s)){var u=t.interleaved;u===null?(o.next=o,Gl(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}n=jd(e,t,o,r),n!==null&&(o=ke(),it(n,e,r,o),nf(n,t,r))}}function ef(e){var t=e.alternate;return e===V||t!==null&&t===V}function tf(e,t){wr=ti=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function nf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rl(e,n)}}var ni={readContext:Ye,useCallback:pe,useContext:pe,useEffect:pe,useImperativeHandle:pe,useInsertionEffect:pe,useLayoutEffect:pe,useMemo:pe,useReducer:pe,useRef:pe,useState:pe,useDebugValue:pe,useDeferredValue:pe,useTransition:pe,useMutableSource:pe,useSyncExternalStore:pe,useId:pe,unstable_isNewReconciler:!1},m0={readContext:Ye,useCallback:function(e,t){return at().memoizedState=[e,t===void 0?null:t],e},useContext:Ye,useEffect:ya,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,jo(4194308,4,Vd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return jo(4194308,4,e,t)},useInsertionEffect:function(e,t){return jo(4,2,e,t)},useMemo:function(e,t){var n=at();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=at();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=p0.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=at();return e={current:e},t.memoizedState=e},useState:va,useDebugValue:ou,useDeferredValue:function(e){return at().memoizedState=e},useTransition:function(){var e=va(!1),t=e[0];return e=h0.bind(null,e[1]),at().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=V,o=at();if(Q){if(n===void 0)throw Error(E(407));n=n()}else{if(n=t(),ue===null)throw Error(E(349));hn&30||Fd(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,ya(Hd.bind(null,r,i,e),[e]),r.flags|=2048,Ur(9,Ud.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=at(),t=ue.identifierPrefix;if(Q){var n=vt,r=mt;n=(r&~(1<<32-ot(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=$r++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=f0++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},v0={readContext:Ye,useCallback:Yd,useContext:Ye,useEffect:ru,useImperativeHandle:Gd,useInsertionEffect:Qd,useLayoutEffect:Kd,useMemo:Xd,useReducer:ss,useRef:qd,useState:function(){return ss(Fr)},useDebugValue:ou,useDeferredValue:function(e){var t=Xe();return Jd(t,te.memoizedState,e)},useTransition:function(){var e=ss(Fr)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:zd,useSyncExternalStore:$d,useId:Zd,unstable_isNewReconciler:!1},y0={readContext:Ye,useCallback:Yd,useContext:Ye,useEffect:ru,useImperativeHandle:Gd,useInsertionEffect:Qd,useLayoutEffect:Kd,useMemo:Xd,useReducer:ls,useRef:qd,useState:function(){return ls(Fr)},useDebugValue:ou,useDeferredValue:function(e){var t=Xe();return te===null?t.memoizedState=e:Jd(t,te.memoizedState,e)},useTransition:function(){var e=ls(Fr)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:zd,useSyncExternalStore:$d,useId:Zd,unstable_isNewReconciler:!1};function Kn(e,t){try{var n="",r=t;do n+=Qh(r),r=r.return;while(r);var o=n}catch(i){o=`
Error generating stack: `+i.message+`
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function us(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function nl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var S0=typeof WeakMap=="function"?WeakMap:Map;function rf(e,t,n){n=yt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){oi||(oi=!0,fl=r),nl(e,t)},n}function of(e,t,n){n=yt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){nl(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){nl(e,t),typeof r!="function"&&(Wt===null?Wt=new Set([this]):Wt.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Sa(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new S0;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=N0.bind(null,e,t,n),t.then(e,e))}function wa(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ka(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=yt(-1,1),t.tag=2,Bt(n,t,1))),n.lanes|=1),e)}var w0=Ct.ReactCurrentOwner,_e=!1;function we(e,t,n,r){t.child=e===null?Ad(t,null,n,r):qn(t,e.child,n,r)}function Ea(e,t,n,r,o){n=n.render;var i=t.ref;return Fn(t,o),r=tu(e,t,n,r,i,o),n=nu(),e!==null&&!_e?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Et(e,t,o)):(Q&&n&&Bl(t),t.flags|=1,we(e,t,r,o),t.child)}function Ca(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!fu(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,sf(e,t,i,r,o)):(e=Ro(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Nr,n(s,r)&&e.ref===t.ref)return Et(e,t,o)}return t.flags|=1,e=Qt(i,r),e.ref=t.ref,e.return=t,t.child=e}function sf(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Nr(i,r)&&e.ref===t.ref)if(_e=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(_e=!0);else return t.lanes=e.lanes,Et(e,t,o)}return rl(e,t,n,r,o)}function lf(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},H(Rn,Ne),Ne|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,H(Rn,Ne),Ne|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,H(Rn,Ne),Ne|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,H(Rn,Ne),Ne|=r;return we(e,t,o,n),t.child}function uf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function rl(e,t,n,r,o){var i=Te(n)?dn:ye.current;return i=Bn(t,i),Fn(t,o),n=tu(e,t,n,r,i,o),r=nu(),e!==null&&!_e?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Et(e,t,o)):(Q&&r&&Bl(t),t.flags|=1,we(e,t,n,o),t.child)}function xa(e,t,n,r,o){if(Te(n)){var i=!0;Vo(t)}else i=!1;if(Fn(t,o),t.stateNode===null)Lo(e,t),Md(t,n,r),tl(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var u=s.context,a=n.contextType;typeof a=="object"&&a!==null?a=Ye(a):(a=Te(n)?dn:ye.current,a=Bn(t,a));var p=n.getDerivedStateFromProps,m=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function";m||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||u!==a)&&ga(t,s,r,a),Nt=!1;var d=t.memoizedState;s.state=d,Zo(t,r,s,o),u=t.memoizedState,l!==r||d!==u||Oe.current||Nt?(typeof p=="function"&&(el(t,n,p,r),u=t.memoizedState),(l=Nt||pa(t,n,l,r,d,u,a))?(m||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=a,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Ld(e,t),l=t.memoizedProps,a=t.type===t.elementType?l:tt(t.type,l),s.props=a,m=t.pendingProps,d=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=Ye(u):(u=Te(n)?dn:ye.current,u=Bn(t,u));var g=n.getDerivedStateFromProps;(p=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==m||d!==u)&&ga(t,s,r,u),Nt=!1,d=t.memoizedState,s.state=d,Zo(t,r,s,o);var v=t.memoizedState;l!==m||d!==v||Oe.current||Nt?(typeof g=="function"&&(el(t,n,g,r),v=t.memoizedState),(a=Nt||pa(t,n,a,r,d,v,u)||!1)?(p||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),s.props=r,s.state=v,s.context=u,r=a):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return ol(e,t,n,r,i,o)}function ol(e,t,n,r,o,i){uf(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&aa(t,n,!1),Et(e,t,i);r=t.stateNode,w0.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=qn(t,e.child,null,i),t.child=qn(t,null,l,i)):we(e,t,l,i),t.memoizedState=r.state,o&&aa(t,n,!0),t.child}function af(e){var t=e.stateNode;t.pendingContext?ua(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ua(e,t.context,!1),Xl(e,t.containerInfo)}function _a(e,t,n,r,o){return Wn(),ql(o),t.flags|=256,we(e,t,n,r),t.child}var il={dehydrated:null,treeContext:null,retryLane:0};function sl(e){return{baseLanes:e,cachePool:null,transitions:null}}function cf(e,t,n){var r=t.pendingProps,o=K.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),H(K,o&1),e===null)return Js(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=wi(s,r,0,null),e=an(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=sl(n),t.memoizedState=il,e):iu(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return k0(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var u={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Qt(o,u),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=Qt(l,i):(i=an(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?sl(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=il,r}return i=e.child,e=i.sibling,r=Qt(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function iu(e,t){return t=wi({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function mo(e,t,n,r){return r!==null&&ql(r),qn(t,e.child,null,n),e=iu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function k0(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=us(Error(E(422))),mo(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=wi({mode:"visible",children:r.children},o,0,null),i=an(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&qn(t,e.child,null,s),t.child.memoizedState=sl(s),t.memoizedState=il,i);if(!(t.mode&1))return mo(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(E(419)),r=us(i,r,void 0),mo(e,t,s,r)}if(l=(s&e.childLanes)!==0,_e||l){if(r=ue,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,kt(e,o),it(r,e,o,-1))}return du(),r=us(Error(E(421))),mo(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=M0.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Me=Ht(o.nextSibling),Re=t,Q=!0,rt=null,e!==null&&(qe[Qe++]=mt,qe[Qe++]=vt,qe[Qe++]=fn,mt=e.id,vt=e.overflow,fn=t),t=iu(t,r.children),t.flags|=4096,t)}function Oa(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zs(e.return,t,n)}function as(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function df(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(we(e,t,r.children,n),r=K.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Oa(e,n,t);else if(e.tag===19)Oa(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(H(K,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&ei(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),as(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&ei(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}as(t,!0,n,null,i);break;case"together":as(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Lo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Et(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),pn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(E(153));if(t.child!==null){for(e=t.child,n=Qt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Qt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function E0(e,t,n){switch(t.tag){case 3:af(t),Wn();break;case 5:bd(t);break;case 1:Te(t.type)&&Vo(t);break;case 4:Xl(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;H(Xo,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(H(K,K.current&1),t.flags|=128,null):n&t.child.childLanes?cf(e,t,n):(H(K,K.current&1),e=Et(e,t,n),e!==null?e.sibling:null);H(K,K.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return df(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),H(K,K.current),r)break;return null;case 22:case 23:return t.lanes=0,lf(e,t,n)}return Et(e,t,n)}var ff,ll,hf,pf;ff=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ll=function(){};hf=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ln(ft.current);var i=null;switch(n){case"input":o=Ps(e,o),r=Ps(e,r),i=[];break;case"select":o=G({},o,{value:void 0}),r=G({},r,{value:void 0}),i=[];break;case"textarea":o=Ls(e,o),r=Ls(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Qo)}Ms(n,r);var s;n=null;for(a in o)if(!r.hasOwnProperty(a)&&o.hasOwnProperty(a)&&o[a]!=null)if(a==="style"){var l=o[a];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else a!=="dangerouslySetInnerHTML"&&a!=="children"&&a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Or.hasOwnProperty(a)?i||(i=[]):(i=i||[]).push(a,null));for(a in r){var u=r[a];if(l=o!=null?o[a]:void 0,r.hasOwnProperty(a)&&u!==l&&(u!=null||l!=null))if(a==="style")if(l){for(s in l)!l.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&l[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(i||(i=[]),i.push(a,n)),n=u;else a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(i=i||[]).push(a,u)):a==="children"?typeof u!="string"&&typeof u!="number"||(i=i||[]).push(a,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&(Or.hasOwnProperty(a)?(u!=null&&a==="onScroll"&&W("scroll",e),i||l===u||(i=[])):(i=i||[]).push(a,u))}n&&(i=i||[]).push("style",n);var a=i;(t.updateQueue=a)&&(t.flags|=4)}};pf=function(e,t,n,r){n!==r&&(t.flags|=4)};function sr(e,t){if(!Q)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ge(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function C0(e,t,n){var r=t.pendingProps;switch(Wl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ge(t),null;case 1:return Te(t.type)&&Ko(),ge(t),null;case 3:return r=t.stateNode,Qn(),q(Oe),q(ye),Zl(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(po(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,rt!==null&&(gl(rt),rt=null))),ll(e,t),ge(t),null;case 5:Jl(t);var o=ln(zr.current);if(n=t.type,e!==null&&t.stateNode!=null)hf(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(E(166));return ge(t),null}if(e=ln(ft.current),po(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[ct]=t,r[Ar]=i,e=(t.mode&1)!==0,n){case"dialog":W("cancel",r),W("close",r);break;case"iframe":case"object":case"embed":W("load",r);break;case"video":case"audio":for(o=0;o<hr.length;o++)W(hr[o],r);break;case"source":W("error",r);break;case"img":case"image":case"link":W("error",r),W("load",r);break;case"details":W("toggle",r);break;case"input":Ru(r,i),W("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},W("invalid",r);break;case"textarea":bu(r,i),W("invalid",r)}Ms(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&ho(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&ho(r.textContent,l,e),o=["children",""+l]):Or.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&W("scroll",r)}switch(n){case"input":oo(r),Au(r,i,!0);break;case"textarea":oo(r),zu(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Qo)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Fc(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[ct]=t,e[Ar]=r,ff(e,t,!1,!1),t.stateNode=e;e:{switch(s=Rs(n,r),n){case"dialog":W("cancel",e),W("close",e),o=r;break;case"iframe":case"object":case"embed":W("load",e),o=r;break;case"video":case"audio":for(o=0;o<hr.length;o++)W(hr[o],e);o=r;break;case"source":W("error",e),o=r;break;case"img":case"image":case"link":W("error",e),W("load",e),o=r;break;case"details":W("toggle",e),o=r;break;case"input":Ru(e,r),o=Ps(e,r),W("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=G({},r,{value:void 0}),W("invalid",e);break;case"textarea":bu(e,r),o=Ls(e,r),W("invalid",e);break;default:o=r}Ms(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var u=l[i];i==="style"?Bc(e,u):i==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Uc(e,u)):i==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Tr(e,u):typeof u=="number"&&Tr(e,""+u):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Or.hasOwnProperty(i)?u!=null&&i==="onScroll"&&W("scroll",e):u!=null&&Pl(e,i,u,s))}switch(n){case"input":oo(e),Au(e,r,!1);break;case"textarea":oo(e),zu(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Vt(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?An(e,!!r.multiple,i,!1):r.defaultValue!=null&&An(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Qo)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ge(t),null;case 6:if(e&&t.stateNode!=null)pf(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(E(166));if(n=ln(zr.current),ln(ft.current),po(t)){if(r=t.stateNode,n=t.memoizedProps,r[ct]=t,(i=r.nodeValue!==n)&&(e=Re,e!==null))switch(e.tag){case 3:ho(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ho(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ct]=t,t.stateNode=r}return ge(t),null;case 13:if(q(K),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Q&&Me!==null&&t.mode&1&&!(t.flags&128))Id(),Wn(),t.flags|=98560,i=!1;else if(i=po(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(E(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(E(317));i[ct]=t}else Wn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ge(t),i=!1}else rt!==null&&(gl(rt),rt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||K.current&1?ne===0&&(ne=3):du())),t.updateQueue!==null&&(t.flags|=4),ge(t),null);case 4:return Qn(),ll(e,t),e===null&&Mr(t.stateNode.containerInfo),ge(t),null;case 10:return Vl(t.type._context),ge(t),null;case 17:return Te(t.type)&&Ko(),ge(t),null;case 19:if(q(K),i=t.memoizedState,i===null)return ge(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)sr(i,!1);else{if(ne!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ei(e),s!==null){for(t.flags|=128,sr(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return H(K,K.current&1|2),t.child}e=e.sibling}i.tail!==null&&J()>Vn&&(t.flags|=128,r=!0,sr(i,!1),t.lanes=4194304)}else{if(!r)if(e=ei(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),sr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Q)return ge(t),null}else 2*J()-i.renderingStartTime>Vn&&n!==1073741824&&(t.flags|=128,r=!0,sr(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=J(),t.sibling=null,n=K.current,H(K,r?n&1|2:n&1),t):(ge(t),null);case 22:case 23:return cu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ne&1073741824&&(ge(t),t.subtreeFlags&6&&(t.flags|=8192)):ge(t),null;case 24:return null;case 25:return null}throw Error(E(156,t.tag))}function x0(e,t){switch(Wl(t),t.tag){case 1:return Te(t.type)&&Ko(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qn(),q(Oe),q(ye),Zl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jl(t),null;case 13:if(q(K),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(E(340));Wn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(K),null;case 4:return Qn(),null;case 10:return Vl(t.type._context),null;case 22:case 23:return cu(),null;case 24:return null;default:return null}}var vo=!1,ve=!1,_0=typeof WeakSet=="function"?WeakSet:Set,P=null;function Mn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){X(e,t,r)}else n.current=null}function ul(e,t,n){try{n()}catch(r){X(e,t,r)}}var Ta=!1;function O0(e,t){if(qs=Bo,e=vd(),Hl(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,u=-1,a=0,p=0,m=e,d=null;t:for(;;){for(var g;m!==n||o!==0&&m.nodeType!==3||(l=s+o),m!==i||r!==0&&m.nodeType!==3||(u=s+r),m.nodeType===3&&(s+=m.nodeValue.length),(g=m.firstChild)!==null;)d=m,m=g;for(;;){if(m===e)break t;if(d===n&&++a===o&&(l=s),d===i&&++p===r&&(u=s),(g=m.nextSibling)!==null)break;m=d,d=m.parentNode}m=g}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qs={focusedElem:e,selectionRange:n},Bo=!1,P=t;P!==null;)if(t=P,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,P=e;else for(;P!==null;){t=P;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,w=v.memoizedState,h=t.stateNode,c=h.getSnapshotBeforeUpdate(t.elementType===t.type?y:tt(t.type,y),w);h.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(E(163))}}catch(k){X(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,P=e;break}P=t.return}return v=Ta,Ta=!1,v}function kr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&ul(t,n,i)}o=o.next}while(o!==r)}}function yi(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function al(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function gf(e){var t=e.alternate;t!==null&&(e.alternate=null,gf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ct],delete t[Ar],delete t[Gs],delete t[u0],delete t[a0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function mf(e){return e.tag===5||e.tag===3||e.tag===4}function Da(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qo));else if(r!==4&&(e=e.child,e!==null))for(cl(e,t,n),e=e.sibling;e!==null;)cl(e,t,n),e=e.sibling}function dl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(dl(e,t,n),e=e.sibling;e!==null;)dl(e,t,n),e=e.sibling}var ce=null,nt=!1;function Pt(e,t,n){for(n=n.child;n!==null;)vf(e,t,n),n=n.sibling}function vf(e,t,n){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(ci,n)}catch{}switch(n.tag){case 5:ve||Mn(n,t);case 6:var r=ce,o=nt;ce=null,Pt(e,t,n),ce=r,nt=o,ce!==null&&(nt?(e=ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ce.removeChild(n.stateNode));break;case 18:ce!==null&&(nt?(e=ce,n=n.stateNode,e.nodeType===8?ns(e.parentNode,n):e.nodeType===1&&ns(e,n),jr(e)):ns(ce,n.stateNode));break;case 4:r=ce,o=nt,ce=n.stateNode.containerInfo,nt=!0,Pt(e,t,n),ce=r,nt=o;break;case 0:case 11:case 14:case 15:if(!ve&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&ul(n,t,s),o=o.next}while(o!==r)}Pt(e,t,n);break;case 1:if(!ve&&(Mn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){X(n,t,l)}Pt(e,t,n);break;case 21:Pt(e,t,n);break;case 22:n.mode&1?(ve=(r=ve)||n.memoizedState!==null,Pt(e,t,n),ve=r):Pt(e,t,n);break;default:Pt(e,t,n)}}function Pa(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _0),t.forEach(function(r){var o=R0.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function et(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:ce=l.stateNode,nt=!1;break e;case 3:ce=l.stateNode.containerInfo,nt=!0;break e;case 4:ce=l.stateNode.containerInfo,nt=!0;break e}l=l.return}if(ce===null)throw Error(E(160));vf(i,s,o),ce=null,nt=!1;var u=o.alternate;u!==null&&(u.return=null),o.return=null}catch(a){X(o,t,a)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)yf(t,e),t=t.sibling}function yf(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(et(t,e),ut(e),r&4){try{kr(3,e,e.return),yi(3,e)}catch(y){X(e,e.return,y)}try{kr(5,e,e.return)}catch(y){X(e,e.return,y)}}break;case 1:et(t,e),ut(e),r&512&&n!==null&&Mn(n,n.return);break;case 5:if(et(t,e),ut(e),r&512&&n!==null&&Mn(n,n.return),e.flags&32){var o=e.stateNode;try{Tr(o,"")}catch(y){X(e,e.return,y)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&zc(o,i),Rs(l,s);var a=Rs(l,i);for(s=0;s<u.length;s+=2){var p=u[s],m=u[s+1];p==="style"?Bc(o,m):p==="dangerouslySetInnerHTML"?Uc(o,m):p==="children"?Tr(o,m):Pl(o,p,m,a)}switch(l){case"input":Is(o,i);break;case"textarea":$c(o,i);break;case"select":var d=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var g=i.value;g!=null?An(o,!!i.multiple,g,!1):d!==!!i.multiple&&(i.defaultValue!=null?An(o,!!i.multiple,i.defaultValue,!0):An(o,!!i.multiple,i.multiple?[]:"",!1))}o[Ar]=i}catch(y){X(e,e.return,y)}}break;case 6:if(et(t,e),ut(e),r&4){if(e.stateNode===null)throw Error(E(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(y){X(e,e.return,y)}}break;case 3:if(et(t,e),ut(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{jr(t.containerInfo)}catch(y){X(e,e.return,y)}break;case 4:et(t,e),ut(e);break;case 13:et(t,e),ut(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(uu=J())),r&4&&Pa(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(ve=(a=ve)||p,et(t,e),ve=a):et(t,e),ut(e),r&8192){if(a=e.memoizedState!==null,(e.stateNode.isHidden=a)&&!p&&e.mode&1)for(P=e,p=e.child;p!==null;){for(m=P=p;P!==null;){switch(d=P,g=d.child,d.tag){case 0:case 11:case 14:case 15:kr(4,d,d.return);break;case 1:Mn(d,d.return);var v=d.stateNode;if(typeof v.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(y){X(r,n,y)}}break;case 5:Mn(d,d.return);break;case 22:if(d.memoizedState!==null){ja(m);continue}}g!==null?(g.return=d,P=g):ja(m)}p=p.sibling}e:for(p=null,m=e;;){if(m.tag===5){if(p===null){p=m;try{o=m.stateNode,a?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=m.stateNode,u=m.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=Hc("display",s))}catch(y){X(e,e.return,y)}}}else if(m.tag===6){if(p===null)try{m.stateNode.nodeValue=a?"":m.memoizedProps}catch(y){X(e,e.return,y)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;p===m&&(p=null),m=m.return}p===m&&(p=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:et(t,e),ut(e),r&4&&Pa(e);break;case 21:break;default:et(t,e),ut(e)}}function ut(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(mf(n)){var r=n;break e}n=n.return}throw Error(E(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Tr(o,""),r.flags&=-33);var i=Da(e);dl(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Da(e);cl(e,l,s);break;default:throw Error(E(161))}}catch(u){X(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function T0(e,t,n){P=e,Sf(e)}function Sf(e,t,n){for(var r=(e.mode&1)!==0;P!==null;){var o=P,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||vo;if(!s){var l=o.alternate,u=l!==null&&l.memoizedState!==null||ve;l=vo;var a=ve;if(vo=s,(ve=u)&&!a)for(P=o;P!==null;)s=P,u=s.child,s.tag===22&&s.memoizedState!==null?La(o):u!==null?(u.return=s,P=u):La(o);for(;i!==null;)P=i,Sf(i),i=i.sibling;P=o,vo=l,ve=a}Ia(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,P=i):Ia(e)}}function Ia(e){for(;P!==null;){var t=P;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ve||yi(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ve)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:tt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&ha(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ha(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var a=t.alternate;if(a!==null){var p=a.memoizedState;if(p!==null){var m=p.dehydrated;m!==null&&jr(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(E(163))}ve||t.flags&512&&al(t)}catch(d){X(t,t.return,d)}}if(t===e){P=null;break}if(n=t.sibling,n!==null){n.return=t.return,P=n;break}P=t.return}}function ja(e){for(;P!==null;){var t=P;if(t===e){P=null;break}var n=t.sibling;if(n!==null){n.return=t.return,P=n;break}P=t.return}}function La(e){for(;P!==null;){var t=P;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{yi(4,t)}catch(u){X(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(u){X(t,o,u)}}var i=t.return;try{al(t)}catch(u){X(t,i,u)}break;case 5:var s=t.return;try{al(t)}catch(u){X(t,s,u)}}}catch(u){X(t,t.return,u)}if(t===e){P=null;break}var l=t.sibling;if(l!==null){l.return=t.return,P=l;break}P=t.return}}var D0=Math.ceil,ri=Ct.ReactCurrentDispatcher,su=Ct.ReactCurrentOwner,Ge=Ct.ReactCurrentBatchConfig,$=0,ue=null,Z=null,de=0,Ne=0,Rn=Xt(0),ne=0,Hr=null,pn=0,Si=0,lu=0,Er=null,xe=null,uu=0,Vn=1/0,pt=null,oi=!1,fl=null,Wt=null,yo=!1,zt=null,ii=0,Cr=0,hl=null,No=-1,Mo=0;function ke(){return $&6?J():No!==-1?No:No=J()}function qt(e){return e.mode&1?$&2&&de!==0?de&-de:d0.transition!==null?(Mo===0&&(Mo=td()),Mo):(e=F,e!==0||(e=window.event,e=e===void 0?16:ud(e.type)),e):1}function it(e,t,n,r){if(50<Cr)throw Cr=0,hl=null,Error(E(185));Kr(e,n,r),(!($&2)||e!==ue)&&(e===ue&&(!($&2)&&(Si|=n),ne===4&&At(e,de)),De(e,r),n===1&&$===0&&!(t.mode&1)&&(Vn=J()+500,gi&&Jt()))}function De(e,t){var n=e.callbackNode;dp(e,t);var r=Ho(e,e===ue?de:0);if(r===0)n!==null&&Uu(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Uu(n),t===1)e.tag===0?c0(Na.bind(null,e)):Td(Na.bind(null,e)),s0(function(){!($&6)&&Jt()}),n=null;else{switch(nd(r)){case 1:n=Ml;break;case 4:n=Zc;break;case 16:n=Uo;break;case 536870912:n=ed;break;default:n=Uo}n=Tf(n,wf.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function wf(e,t){if(No=-1,Mo=0,$&6)throw Error(E(327));var n=e.callbackNode;if(Un()&&e.callbackNode!==n)return null;var r=Ho(e,e===ue?de:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=si(e,r);else{t=r;var o=$;$|=2;var i=Ef();(ue!==e||de!==t)&&(pt=null,Vn=J()+500,un(e,t));do try{j0();break}catch(l){kf(e,l)}while(1);Kl(),ri.current=i,$=o,Z!==null?t=0:(ue=null,de=0,t=ne)}if(t!==0){if(t===2&&(o=Fs(e),o!==0&&(r=o,t=pl(e,o))),t===1)throw n=Hr,un(e,0),At(e,r),De(e,J()),n;if(t===6)At(e,r);else{if(o=e.current.alternate,!(r&30)&&!P0(o)&&(t=si(e,r),t===2&&(i=Fs(e),i!==0&&(r=i,t=pl(e,i))),t===1))throw n=Hr,un(e,0),At(e,r),De(e,J()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(E(345));case 2:rn(e,xe,pt);break;case 3:if(At(e,r),(r&130023424)===r&&(t=uu+500-J(),10<t)){if(Ho(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){ke(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Vs(rn.bind(null,e,xe,pt),t);break}rn(e,xe,pt);break;case 4:if(At(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-ot(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=J()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*D0(r/1960))-r,10<r){e.timeoutHandle=Vs(rn.bind(null,e,xe,pt),r);break}rn(e,xe,pt);break;case 5:rn(e,xe,pt);break;default:throw Error(E(329))}}}return De(e,J()),e.callbackNode===n?wf.bind(null,e):null}function pl(e,t){var n=Er;return e.current.memoizedState.isDehydrated&&(un(e,t).flags|=256),e=si(e,t),e!==2&&(t=xe,xe=n,t!==null&&gl(t)),e}function gl(e){xe===null?xe=e:xe.push.apply(xe,e)}function P0(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!st(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function At(e,t){for(t&=~lu,t&=~Si,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ot(t),r=1<<n;e[n]=-1,t&=~r}}function Na(e){if($&6)throw Error(E(327));Un();var t=Ho(e,0);if(!(t&1))return De(e,J()),null;var n=si(e,t);if(e.tag!==0&&n===2){var r=Fs(e);r!==0&&(t=r,n=pl(e,r))}if(n===1)throw n=Hr,un(e,0),At(e,t),De(e,J()),n;if(n===6)throw Error(E(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,rn(e,xe,pt),De(e,J()),null}function au(e,t){var n=$;$|=1;try{return e(t)}finally{$=n,$===0&&(Vn=J()+500,gi&&Jt())}}function gn(e){zt!==null&&zt.tag===0&&!($&6)&&Un();var t=$;$|=1;var n=Ge.transition,r=F;try{if(Ge.transition=null,F=1,e)return e()}finally{F=r,Ge.transition=n,$=t,!($&6)&&Jt()}}function cu(){Ne=Rn.current,q(Rn)}function un(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,i0(n)),Z!==null)for(n=Z.return;n!==null;){var r=n;switch(Wl(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ko();break;case 3:Qn(),q(Oe),q(ye),Zl();break;case 5:Jl(r);break;case 4:Qn();break;case 13:q(K);break;case 19:q(K);break;case 10:Vl(r.type._context);break;case 22:case 23:cu()}n=n.return}if(ue=e,Z=e=Qt(e.current,null),de=Ne=t,ne=0,Hr=null,lu=Si=pn=0,xe=Er=null,sn!==null){for(t=0;t<sn.length;t++)if(n=sn[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}sn=null}return e}function kf(e,t){do{var n=Z;try{if(Kl(),Io.current=ni,ti){for(var r=V.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ti=!1}if(hn=0,le=te=V=null,wr=!1,$r=0,su.current=null,n===null||n.return===null){ne=1,Hr=t,Z=null;break}e:{var i=e,s=n.return,l=n,u=t;if(t=de,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var a=u,p=l,m=p.tag;if(!(p.mode&1)&&(m===0||m===11||m===15)){var d=p.alternate;d?(p.updateQueue=d.updateQueue,p.memoizedState=d.memoizedState,p.lanes=d.lanes):(p.updateQueue=null,p.memoizedState=null)}var g=wa(s);if(g!==null){g.flags&=-257,ka(g,s,l,i,t),g.mode&1&&Sa(i,a,t),t=g,u=a;var v=t.updateQueue;if(v===null){var y=new Set;y.add(u),t.updateQueue=y}else v.add(u);break e}else{if(!(t&1)){Sa(i,a,t),du();break e}u=Error(E(426))}}else if(Q&&l.mode&1){var w=wa(s);if(w!==null){!(w.flags&65536)&&(w.flags|=256),ka(w,s,l,i,t),ql(Kn(u,l));break e}}i=u=Kn(u,l),ne!==4&&(ne=2),Er===null?Er=[i]:Er.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var h=rf(i,u,t);fa(i,h);break e;case 1:l=u;var c=i.type,f=i.stateNode;if(!(i.flags&128)&&(typeof c.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Wt===null||!Wt.has(f)))){i.flags|=65536,t&=-t,i.lanes|=t;var k=of(i,l,t);fa(i,k);break e}}i=i.return}while(i!==null)}xf(n)}catch(x){t=x,Z===n&&n!==null&&(Z=n=n.return);continue}break}while(1)}function Ef(){var e=ri.current;return ri.current=ni,e===null?ni:e}function du(){(ne===0||ne===3||ne===2)&&(ne=4),ue===null||!(pn&268435455)&&!(Si&268435455)||At(ue,de)}function si(e,t){var n=$;$|=2;var r=Ef();(ue!==e||de!==t)&&(pt=null,un(e,t));do try{I0();break}catch(o){kf(e,o)}while(1);if(Kl(),$=n,ri.current=r,Z!==null)throw Error(E(261));return ue=null,de=0,ne}function I0(){for(;Z!==null;)Cf(Z)}function j0(){for(;Z!==null&&!np();)Cf(Z)}function Cf(e){var t=Of(e.alternate,e,Ne);e.memoizedProps=e.pendingProps,t===null?xf(e):Z=t,su.current=null}function xf(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=x0(n,t),n!==null){n.flags&=32767,Z=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ne=6,Z=null;return}}else if(n=C0(n,t,Ne),n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);ne===0&&(ne=5)}function rn(e,t,n){var r=F,o=Ge.transition;try{Ge.transition=null,F=1,L0(e,t,n,r)}finally{Ge.transition=o,F=r}return null}function L0(e,t,n,r){do Un();while(zt!==null);if($&6)throw Error(E(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(E(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(fp(e,i),e===ue&&(Z=ue=null,de=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||yo||(yo=!0,Tf(Uo,function(){return Un(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Ge.transition,Ge.transition=null;var s=F;F=1;var l=$;$|=4,su.current=null,O0(e,n),yf(n,e),Jp(Qs),Bo=!!qs,Qs=qs=null,e.current=n,T0(n),rp(),$=l,F=s,Ge.transition=i}else e.current=n;if(yo&&(yo=!1,zt=e,ii=o),i=e.pendingLanes,i===0&&(Wt=null),sp(n.stateNode),De(e,J()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(oi)throw oi=!1,e=fl,fl=null,e;return ii&1&&e.tag!==0&&Un(),i=e.pendingLanes,i&1?e===hl?Cr++:(Cr=0,hl=e):Cr=0,Jt(),null}function Un(){if(zt!==null){var e=nd(ii),t=Ge.transition,n=F;try{if(Ge.transition=null,F=16>e?16:e,zt===null)var r=!1;else{if(e=zt,zt=null,ii=0,$&6)throw Error(E(331));var o=$;for($|=4,P=e.current;P!==null;){var i=P,s=i.child;if(P.flags&16){var l=i.deletions;if(l!==null){for(var u=0;u<l.length;u++){var a=l[u];for(P=a;P!==null;){var p=P;switch(p.tag){case 0:case 11:case 15:kr(8,p,i)}var m=p.child;if(m!==null)m.return=p,P=m;else for(;P!==null;){p=P;var d=p.sibling,g=p.return;if(gf(p),p===a){P=null;break}if(d!==null){d.return=g,P=d;break}P=g}}}var v=i.alternate;if(v!==null){var y=v.child;if(y!==null){v.child=null;do{var w=y.sibling;y.sibling=null,y=w}while(y!==null)}}P=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,P=s;else e:for(;P!==null;){if(i=P,i.flags&2048)switch(i.tag){case 0:case 11:case 15:kr(9,i,i.return)}var h=i.sibling;if(h!==null){h.return=i.return,P=h;break e}P=i.return}}var c=e.current;for(P=c;P!==null;){s=P;var f=s.child;if(s.subtreeFlags&2064&&f!==null)f.return=s,P=f;else e:for(s=c;P!==null;){if(l=P,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:yi(9,l)}}catch(x){X(l,l.return,x)}if(l===s){P=null;break e}var k=l.sibling;if(k!==null){k.return=l.return,P=k;break e}P=l.return}}if($=o,Jt(),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(ci,e)}catch{}r=!0}return r}finally{F=n,Ge.transition=t}}return!1}function Ma(e,t,n){t=Kn(n,t),t=rf(e,t,1),e=Bt(e,t,1),t=ke(),e!==null&&(Kr(e,1,t),De(e,t))}function X(e,t,n){if(e.tag===3)Ma(e,e,n);else for(;t!==null;){if(t.tag===3){Ma(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Wt===null||!Wt.has(r))){e=Kn(n,e),e=of(t,e,1),t=Bt(t,e,1),e=ke(),t!==null&&(Kr(t,1,e),De(t,e));break}}t=t.return}}function N0(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ke(),e.pingedLanes|=e.suspendedLanes&n,ue===e&&(de&n)===n&&(ne===4||ne===3&&(de&130023424)===de&&500>J()-uu?un(e,0):lu|=n),De(e,t)}function _f(e,t){t===0&&(e.mode&1?(t=lo,lo<<=1,!(lo&130023424)&&(lo=4194304)):t=1);var n=ke();e=kt(e,t),e!==null&&(Kr(e,t,n),De(e,n))}function M0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_f(e,n)}function R0(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(E(314))}r!==null&&r.delete(t),_f(e,n)}var Of;Of=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Oe.current)_e=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return _e=!1,E0(e,t,n);_e=!!(e.flags&131072)}else _e=!1,Q&&t.flags&1048576&&Dd(t,Yo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Lo(e,t),e=t.pendingProps;var o=Bn(t,ye.current);Fn(t,n),o=tu(null,t,r,e,o,n);var i=nu();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Te(r)?(i=!0,Vo(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Yl(t),o.updater=mi,t.stateNode=o,o._reactInternals=t,tl(t,r,e,n),t=ol(null,t,r,!0,i,n)):(t.tag=0,Q&&i&&Bl(t),we(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Lo(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=b0(r),e=tt(r,e),o){case 0:t=rl(null,t,r,e,n);break e;case 1:t=xa(null,t,r,e,n);break e;case 11:t=Ea(null,t,r,e,n);break e;case 14:t=Ca(null,t,r,tt(r.type,e),n);break e}throw Error(E(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:tt(r,o),rl(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:tt(r,o),xa(e,t,r,o,n);case 3:e:{if(af(t),e===null)throw Error(E(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Ld(e,t),Zo(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Kn(Error(E(423)),t),t=_a(e,t,r,n,o);break e}else if(r!==o){o=Kn(Error(E(424)),t),t=_a(e,t,r,n,o);break e}else for(Me=Ht(t.stateNode.containerInfo.firstChild),Re=t,Q=!0,rt=null,n=Ad(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Wn(),r===o){t=Et(e,t,n);break e}we(e,t,r,n)}t=t.child}return t;case 5:return bd(t),e===null&&Js(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Ks(r,o)?s=null:i!==null&&Ks(r,i)&&(t.flags|=32),uf(e,t),we(e,t,s,n),t.child;case 6:return e===null&&Js(t),null;case 13:return cf(e,t,n);case 4:return Xl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=qn(t,null,r,n):we(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:tt(r,o),Ea(e,t,r,o,n);case 7:return we(e,t,t.pendingProps,n),t.child;case 8:return we(e,t,t.pendingProps.children,n),t.child;case 12:return we(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,H(Xo,r._currentValue),r._currentValue=s,i!==null)if(st(i.value,s)){if(i.children===o.children&&!Oe.current){t=Et(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=yt(-1,n&-n),u.tag=2;var a=i.updateQueue;if(a!==null){a=a.shared;var p=a.pending;p===null?u.next=u:(u.next=p.next,p.next=u),a.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Zs(i.return,n,t),l.lanes|=n;break}u=u.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(E(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Zs(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}we(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Fn(t,n),o=Ye(o),r=r(o),t.flags|=1,we(e,t,r,n),t.child;case 14:return r=t.type,o=tt(r,t.pendingProps),o=tt(r.type,o),Ca(e,t,r,o,n);case 15:return sf(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:tt(r,o),Lo(e,t),t.tag=1,Te(r)?(e=!0,Vo(t)):e=!1,Fn(t,n),Md(t,r,o),tl(t,r,o,n),ol(null,t,r,!0,e,n);case 19:return df(e,t,n);case 22:return lf(e,t,n)}throw Error(E(156,t.tag))};function Tf(e,t){return Jc(e,t)}function A0(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ve(e,t,n,r){return new A0(e,t,n,r)}function fu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function b0(e){if(typeof e=="function")return fu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===jl)return 11;if(e===Ll)return 14}return 2}function Qt(e,t){var n=e.alternate;return n===null?(n=Ve(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ro(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")fu(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case _n:return an(n.children,o,i,t);case Il:s=8,o|=8;break;case _s:return e=Ve(12,n,t,o|2),e.elementType=_s,e.lanes=i,e;case Os:return e=Ve(13,n,t,o),e.elementType=Os,e.lanes=i,e;case Ts:return e=Ve(19,n,t,o),e.elementType=Ts,e.lanes=i,e;case Rc:return wi(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Nc:s=10;break e;case Mc:s=9;break e;case jl:s=11;break e;case Ll:s=14;break e;case Lt:s=16,r=null;break e}throw Error(E(130,e==null?e:typeof e,""))}return t=Ve(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function an(e,t,n,r){return e=Ve(7,e,r,t),e.lanes=n,e}function wi(e,t,n,r){return e=Ve(22,e,r,t),e.elementType=Rc,e.lanes=n,e.stateNode={isHidden:!1},e}function cs(e,t,n){return e=Ve(6,e,null,t),e.lanes=n,e}function ds(e,t,n){return t=Ve(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function z0(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qi(0),this.expirationTimes=qi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qi(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function hu(e,t,n,r,o,i,s,l,u){return e=new z0(e,t,n,l,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ve(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yl(i),e}function $0(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Df(e){if(!e)return Gt;e=e._reactInternals;e:{if(Sn(e)!==e||e.tag!==1)throw Error(E(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Te(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(E(171))}if(e.tag===1){var n=e.type;if(Te(n))return Od(e,n,t)}return t}function Pf(e,t,n,r,o,i,s,l,u){return e=hu(n,r,!0,e,o,i,s,l,u),e.context=Df(null),n=e.current,r=ke(),o=qt(n),i=yt(r,o),i.callback=t??null,Bt(n,i,o),e.current.lanes=o,Kr(e,o,r),De(e,r),e}function ki(e,t,n,r){var o=t.current,i=ke(),s=qt(o);return n=Df(n),t.context===null?t.context=n:t.pendingContext=n,t=yt(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Bt(o,t,s),e!==null&&(it(e,o,s,i),Po(e,o,s)),s}function li(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ra(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pu(e,t){Ra(e,t),(e=e.alternate)&&Ra(e,t)}function F0(){return null}var If=typeof reportError=="function"?reportError:function(e){console.error(e)};function gu(e){this._internalRoot=e}Ei.prototype.render=gu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(E(409));ki(e,t,null,null)};Ei.prototype.unmount=gu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gn(function(){ki(null,e,null,null)}),t[wt]=null}};function Ei(e){this._internalRoot=e}Ei.prototype.unstable_scheduleHydration=function(e){if(e){var t=id();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rt.length&&t!==0&&t<Rt[n].priority;n++);Rt.splice(n,0,e),n===0&&ld(e)}};function mu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ci(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Aa(){}function U0(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var a=li(s);i.call(a)}}var s=Pf(t,r,e,0,null,!1,!1,"",Aa);return e._reactRootContainer=s,e[wt]=s.current,Mr(e.nodeType===8?e.parentNode:e),gn(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var a=li(u);l.call(a)}}var u=hu(e,0,!1,null,null,!1,!1,"",Aa);return e._reactRootContainer=u,e[wt]=u.current,Mr(e.nodeType===8?e.parentNode:e),gn(function(){ki(t,u,n,r)}),u}function xi(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var u=li(s);l.call(u)}}ki(t,s,e,o)}else s=U0(n,t,e,o,r);return li(s)}rd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=fr(t.pendingLanes);n!==0&&(Rl(t,n|1),De(t,J()),!($&6)&&(Vn=J()+500,Jt()))}break;case 13:gn(function(){var r=kt(e,1);if(r!==null){var o=ke();it(r,e,1,o)}}),pu(e,1)}};Al=function(e){if(e.tag===13){var t=kt(e,134217728);if(t!==null){var n=ke();it(t,e,134217728,n)}pu(e,134217728)}};od=function(e){if(e.tag===13){var t=qt(e),n=kt(e,t);if(n!==null){var r=ke();it(n,e,t,r)}pu(e,t)}};id=function(){return F};sd=function(e,t){var n=F;try{return F=e,t()}finally{F=n}};bs=function(e,t,n){switch(t){case"input":if(Is(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=pi(r);if(!o)throw Error(E(90));bc(r),Is(r,o)}}}break;case"textarea":$c(e,n);break;case"select":t=n.value,t!=null&&An(e,!!n.multiple,t,!1)}};Qc=au;Kc=gn;var H0={usingClientEntryPoint:!1,Events:[Gr,Pn,pi,Wc,qc,au]},lr={findFiberByHostInstance:on,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},B0={bundleType:lr.bundleType,version:lr.version,rendererPackageName:lr.rendererPackageName,rendererConfig:lr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ct.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Yc(e),e===null?null:e.stateNode},findFiberByHostInstance:lr.findFiberByHostInstance||F0,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var So=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!So.isDisabled&&So.supportsFiber)try{ci=So.inject(B0),dt=So}catch{}}be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H0;be.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mu(t))throw Error(E(200));return $0(e,t,null,n)};be.createRoot=function(e,t){if(!mu(e))throw Error(E(299));var n=!1,r="",o=If;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=hu(e,1,!1,null,null,n,!1,r,o),e[wt]=t.current,Mr(e.nodeType===8?e.parentNode:e),new gu(t)};be.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(E(188)):(e=Object.keys(e).join(","),Error(E(268,e)));return e=Yc(t),e=e===null?null:e.stateNode,e};be.flushSync=function(e){return gn(e)};be.hydrate=function(e,t,n){if(!Ci(t))throw Error(E(200));return xi(null,e,t,!0,n)};be.hydrateRoot=function(e,t,n){if(!mu(e))throw Error(E(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=If;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Pf(t,null,e,1,n??null,o,!1,i,s),e[wt]=t.current,Mr(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Ei(t)};be.render=function(e,t,n){if(!Ci(t))throw Error(E(200));return xi(null,e,t,!1,n)};be.unmountComponentAtNode=function(e){if(!Ci(e))throw Error(E(40));return e._reactRootContainer?(gn(function(){xi(null,null,e,!1,function(){e._reactRootContainer=null,e[wt]=null})}),!0):!1};be.unstable_batchedUpdates=au;be.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ci(n))throw Error(E(200));if(e==null||e._reactInternals===void 0)throw Error(E(38));return xi(e,t,n,!1,r)};be.version="18.2.0-next-9e3b772b8-20220608";function jf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jf)}catch(e){console.error(e)}}jf(),Dc.exports=be;var W0=Dc.exports,ba=W0;Cs.createRoot=ba.createRoot,Cs.hydrateRoot=ba.hydrateRoot;/**
* @license
* Copyright (c) 2023, Jeff Hlywa (jhlywa@gmail.com)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/const me="w",We="b",ie="p",ml="n",Ao="b",pr="r",Mt="q",se="k",fs="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",je=-1,q0={NORMAL:"n",CAPTURE:"c",BIG_PAWN:"b",EP_CAPTURE:"e",PROMOTION:"p",KSIDE_CASTLE:"k",QSIDE_CASTLE:"q"},N={NORMAL:1,CAPTURE:2,BIG_PAWN:4,EP_CAPTURE:8,PROMOTION:16,KSIDE_CASTLE:32,QSIDE_CASTLE:64},A={a8:0,b8:1,c8:2,d8:3,e8:4,f8:5,g8:6,h8:7,a7:16,b7:17,c7:18,d7:19,e7:20,f7:21,g7:22,h7:23,a6:32,b6:33,c6:34,d6:35,e6:36,f6:37,g6:38,h6:39,a5:48,b5:49,c5:50,d5:51,e5:52,f5:53,g5:54,h5:55,a4:64,b4:65,c4:66,d4:67,e4:68,f4:69,g4:70,h4:71,a3:80,b3:81,c3:82,d3:83,e3:84,f3:85,g3:86,h3:87,a2:96,b2:97,c2:98,d2:99,e2:100,f2:101,g2:102,h2:103,a1:112,b1:113,c1:114,d1:115,e1:116,f1:117,g1:118,h1:119},hs={b:[16,32,17,15],w:[-16,-32,-17,-15]},za={n:[-18,-33,-31,-14,18,33,31,14],b:[-17,-15,17,15],r:[-16,1,16,-1],q:[-17,-16,-15,1,17,16,15,-1],k:[-17,-16,-15,1,17,16,15,-1]},Q0=[20,0,0,0,0,0,0,24,0,0,0,0,0,0,20,0,0,20,0,0,0,0,0,24,0,0,0,0,0,20,0,0,0,0,20,0,0,0,0,24,0,0,0,0,20,0,0,0,0,0,0,20,0,0,0,24,0,0,0,20,0,0,0,0,0,0,0,0,20,0,0,24,0,0,20,0,0,0,0,0,0,0,0,0,0,20,2,24,2,20,0,0,0,0,0,0,0,0,0,0,0,2,53,56,53,2,0,0,0,0,0,0,24,24,24,24,24,24,56,0,56,24,24,24,24,24,24,0,0,0,0,0,0,2,53,56,53,2,0,0,0,0,0,0,0,0,0,0,0,20,2,24,2,20,0,0,0,0,0,0,0,0,0,0,20,0,0,24,0,0,20,0,0,0,0,0,0,0,0,20,0,0,0,24,0,0,0,20,0,0,0,0,0,0,20,0,0,0,0,24,0,0,0,0,20,0,0,0,0,20,0,0,0,0,0,24,0,0,0,0,0,20,0,0,20,0,0,0,0,0,0,24,0,0,0,0,0,0,20],K0=[17,0,0,0,0,0,0,16,0,0,0,0,0,0,15,0,0,17,0,0,0,0,0,16,0,0,0,0,0,15,0,0,0,0,17,0,0,0,0,16,0,0,0,0,15,0,0,0,0,0,0,17,0,0,0,16,0,0,0,15,0,0,0,0,0,0,0,0,17,0,0,16,0,0,15,0,0,0,0,0,0,0,0,0,0,17,0,16,0,15,0,0,0,0,0,0,0,0,0,0,0,0,17,16,15,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-15,-16,-17,0,0,0,0,0,0,0,0,0,0,0,0,-15,0,-16,0,-17,0,0,0,0,0,0,0,0,0,0,-15,0,0,-16,0,0,-17,0,0,0,0,0,0,0,0,-15,0,0,0,-16,0,0,0,-17,0,0,0,0,0,0,-15,0,0,0,0,-16,0,0,0,0,-17,0,0,0,0,-15,0,0,0,0,0,-16,0,0,0,0,0,-17,0,0,-15,0,0,0,0,0,0,-16,0,0,0,0,0,0,-17],V0={p:1,n:2,b:4,r:8,q:16,k:32},G0="pnbrqkPNBRQK",$a=[ml,Ao,pr,Mt],Y0=7,X0=6,J0=1,Z0=0,wo={[se]:N.KSIDE_CASTLE,[Mt]:N.QSIDE_CASTLE},It={w:[{square:A.a1,flag:N.QSIDE_CASTLE},{square:A.h1,flag:N.KSIDE_CASTLE}],b:[{square:A.a8,flag:N.QSIDE_CASTLE},{square:A.h8,flag:N.KSIDE_CASTLE}]},eg={b:J0,w:X0},tg=["1-0","0-1","1/2-1/2","*"];function cn(e){return e>>4}function Br(e){return e&15}function Lf(e){return"0123456789".indexOf(e)!==-1}function Le(e){const t=Br(e),n=cn(e);return"abcdefgh".substring(t,t+1)+"87654321".substring(n,n+1)}function ur(e){return e===me?We:me}function ng(e){const t=e.split(/\s+/);if(t.length!==6)return{ok:!1,error:"Invalid FEN: must contain six space-delimited fields"};const n=parseInt(t[5],10);if(isNaN(n)||n<=0)return{ok:!1,error:"Invalid FEN: move number must be a positive integer"};const r=parseInt(t[4],10);if(isNaN(r)||r<0)return{ok:!1,error:"Invalid FEN: half move counter number must be a non-negative integer"};if(!/^(-|[abcdefgh][36])$/.test(t[3]))return{ok:!1,error:"Invalid FEN: en-passant square is invalid"};if(/[^kKqQ-]/.test(t[2]))return{ok:!1,error:"Invalid FEN: castling availability is invalid"};if(!/^(w|b)$/.test(t[1]))return{ok:!1,error:"Invalid FEN: side-to-move is invalid"};const o=t[0].split("/");if(o.length!==8)return{ok:!1,error:"Invalid FEN: piece data does not contain 8 '/'-delimited rows"};for(let s=0;s<o.length;s++){let l=0,u=!1;for(let a=0;a<o[s].length;a++)if(Lf(o[s][a])){if(u)return{ok:!1,error:"Invalid FEN: piece data is invalid (consecutive number)"};l+=parseInt(o[s][a],10),u=!0}else{if(!/^[prnbqkPRNBQK]$/.test(o[s][a]))return{ok:!1,error:"Invalid FEN: piece data is invalid (invalid piece)"};l+=1,u=!1}if(l!==8)return{ok:!1,error:"Invalid FEN: piece data is invalid (too many squares in rank)"}}if(t[3][1]=="3"&&t[1]=="w"||t[3][1]=="6"&&t[1]=="b")return{ok:!1,error:"Invalid FEN: illegal en-passant square"};const i=[{color:"white",regex:/K/g},{color:"black",regex:/k/g}];for(const{color:s,regex:l}of i){if(!l.test(t[0]))return{ok:!1,error:`Invalid FEN: missing ${s} king`};if((t[0].match(l)||[]).length>1)return{ok:!1,error:`Invalid FEN: too many ${s} kings`}}return{ok:!0}}function rg(e,t){const n=e.from,r=e.to,o=e.piece;let i=0,s=0,l=0;for(let u=0,a=t.length;u<a;u++){const p=t[u].from,m=t[u].to,d=t[u].piece;o===d&&n!==p&&r===m&&(i++,cn(n)===cn(p)&&s++,Br(n)===Br(p)&&l++)}return i>0?s>0&&l>0?Le(n):l>0?Le(n).charAt(1):Le(n).charAt(0):""}function jt(e,t,n,r,o,i=void 0,s=N.NORMAL){const l=cn(r);if(o===ie&&(l===Y0||l===Z0))for(let u=0;u<$a.length;u++){const a=$a[u];e.push({color:t,from:n,to:r,piece:o,captured:i,promotion:a,flags:s|N.PROMOTION})}else e.push({color:t,from:n,to:r,piece:o,captured:i,flags:s})}function Fa(e){let t=e.charAt(0);return t>="a"&&t<="h"?e.match(/[a-h]\d.*[a-h]\d/)?void 0:ie:(t=t.toLowerCase(),t==="o"?se:t)}function ps(e){return e.replace(/=/,"").replace(/[+#]?[?!]*$/,"")}class og{constructor(t=fs){ee(this,"_board",new Array(128));ee(this,"_turn",me);ee(this,"_header",{});ee(this,"_kings",{w:je,b:je});ee(this,"_epSquare",-1);ee(this,"_halfMoves",0);ee(this,"_moveNumber",0);ee(this,"_history",[]);ee(this,"_comments",{});ee(this,"_castling",{w:0,b:0});this.load(t)}clear(t=!1){this._board=new Array(128),this._kings={w:je,b:je},this._turn=me,this._castling={w:0,b:0},this._epSquare=je,this._halfMoves=0,this._moveNumber=1,this._history=[],this._comments={},this._header=t?this._header:{},this._updateSetup(this.fen())}removeHeader(t){t in this._header&&delete this._header[t]}load(t,n=!1){let r=t.split(/\s+/);if(r.length>=2&&r.length<6){const u=["-","-","0","1"];t=r.concat(u.slice(-(6-r.length))).join(" ")}r=t.split(/\s+/);const{ok:o,error:i}=ng(t);if(!o)throw new Error(i);const s=r[0];let l=0;this.clear(n);for(let u=0;u<s.length;u++){const a=s.charAt(u);if(a==="/")l+=8;else if(Lf(a))l+=parseInt(a,10);else{const p=a<"a"?me:We;this.put({type:a.toLowerCase(),color:p},Le(l)),l++}}this._turn=r[1],r[2].indexOf("K")>-1&&(this._castling.w|=N.KSIDE_CASTLE),r[2].indexOf("Q")>-1&&(this._castling.w|=N.QSIDE_CASTLE),r[2].indexOf("k")>-1&&(this._castling.b|=N.KSIDE_CASTLE),r[2].indexOf("q")>-1&&(this._castling.b|=N.QSIDE_CASTLE),this._epSquare=r[3]==="-"?je:A[r[3]],this._halfMoves=parseInt(r[4],10),this._moveNumber=parseInt(r[5],10),this._updateSetup(this.fen())}fen(){var i,s;let t=0,n="";for(let l=A.a8;l<=A.h1;l++){if(this._board[l]){t>0&&(n+=t,t=0);const{color:u,type:a}=this._board[l];n+=u===me?a.toUpperCase():a.toLowerCase()}else t++;l+1&136&&(t>0&&(n+=t),l!==A.h1&&(n+="/"),t=0,l+=8)}let r="";this._castling[me]&N.KSIDE_CASTLE&&(r+="K"),this._castling[me]&N.QSIDE_CASTLE&&(r+="Q"),this._castling[We]&N.KSIDE_CASTLE&&(r+="k"),this._castling[We]&N.QSIDE_CASTLE&&(r+="q"),r=r||"-";let o="-";if(this._epSquare!==je){const l=this._epSquare+(this._turn===me?16:-16),u=[l+1,l-1];for(const a of u){if(a&136)continue;const p=this._turn;if(((i=this._board[a])==null?void 0:i.color)===p&&((s=this._board[a])==null?void 0:s.type)===ie){this._makeMove({color:p,from:a,to:this._epSquare,piece:ie,captured:ie,flags:N.EP_CAPTURE});const m=!this._isKingAttacked(p);if(this._undoMove(),m){o=Le(this._epSquare);break}}}}return[n,this._turn,r,o,this._halfMoves,this._moveNumber].join(" ")}_updateSetup(t){this._history.length>0||(t!==fs?(this._header.SetUp="1",this._header.FEN=t):(delete this._header.SetUp,delete this._header.FEN))}reset(){this.load(fs)}get(t){return this._board[A[t]]||!1}put({type:t,color:n},r){if(G0.indexOf(t.toLowerCase())===-1||!(r in A))return!1;const o=A[r];return t==se&&!(this._kings[n]==je||this._kings[n]==o)?!1:(this._board[o]={type:t,color:n},t===se&&(this._kings[n]=o),this._updateCastlingRights(),this._updateEnPassantSquare(),this._updateSetup(this.fen()),!0)}remove(t){const n=this.get(t);return delete this._board[A[t]],n&&n.type===se&&(this._kings[n.color]=je),this._updateCastlingRights(),this._updateEnPassantSquare(),this._updateSetup(this.fen()),n}_updateCastlingRights(){var r,o,i,s,l,u,a,p,m,d,g,v;const t=((r=this._board[A.e1])==null?void 0:r.type)===se&&((o=this._board[A.e1])==null?void 0:o.color)===me,n=((i=this._board[A.e8])==null?void 0:i.type)===se&&((s=this._board[A.e8])==null?void 0:s.color)===We;(!t||((l=this._board[A.a1])==null?void 0:l.type)!==pr||((u=this._board[A.a1])==null?void 0:u.color)!==me)&&(this._castling.w&=~N.QSIDE_CASTLE),(!t||((a=this._board[A.h1])==null?void 0:a.type)!==pr||((p=this._board[A.h1])==null?void 0:p.color)!==me)&&(this._castling.w&=~N.KSIDE_CASTLE),(!n||((m=this._board[A.a8])==null?void 0:m.type)!==pr||((d=this._board[A.a8])==null?void 0:d.color)!==We)&&(this._castling.b&=~N.QSIDE_CASTLE),(!n||((g=this._board[A.h8])==null?void 0:g.type)!==pr||((v=this._board[A.h8])==null?void 0:v.color)!==We)&&(this._castling.b&=~N.KSIDE_CASTLE)}_updateEnPassantSquare(){var i,s;if(this._epSquare===je)return;const t=this._epSquare+(this._turn===me?-16:16),n=this._epSquare+(this._turn===me?16:-16),r=[n+1,n-1];if(this._board[t]!==null||this._board[this._epSquare]!==null||((i=this._board[n])==null?void 0:i.color)!==ur(this._turn)||((s=this._board[n])==null?void 0:s.type)!==ie){this._epSquare=je;return}const o=l=>{var u,a;return!(l&136)&&((u=this._board[l])==null?void 0:u.color)===this._turn&&((a=this._board[l])==null?void 0:a.type)===ie};r.some(o)||(this._epSquare=je)}_attacked(t,n){for(let r=A.a8;r<=A.h1;r++){if(r&136){r+=7;continue}if(this._board[r]===void 0||this._board[r].color!==t)continue;const o=this._board[r],i=r-n;if(i===0)continue;const s=i+119;if(Q0[s]&V0[o.type]){if(o.type===ie){if(i>0){if(o.color===me)return!0}else if(o.color===We)return!0;continue}if(o.type==="n"||o.type==="k")return!0;const l=K0[s];let u=r+l,a=!1;for(;u!==n;){if(this._board[u]!=null){a=!0;break}u+=l}if(!a)return!0}}return!1}_isKingAttacked(t){const n=this._kings[t];return n===-1?!1:this._attacked(ur(t),n)}isAttacked(t,n){return this._attacked(n,A[t])}isCheck(){return this._isKingAttacked(this._turn)}inCheck(){return this.isCheck()}isCheckmate(){return this.isCheck()&&this._moves().length===0}isStalemate(){return!this.isCheck()&&this._moves().length===0}isInsufficientMaterial(){const t={b:0,n:0,r:0,q:0,k:0,p:0},n=[];let r=0,o=0;for(let i=A.a8;i<=A.h1;i++){if(o=(o+1)%2,i&136){i+=7;continue}const s=this._board[i];s&&(t[s.type]=s.type in t?t[s.type]+1:1,s.type===Ao&&n.push(o),r++)}if(r===2)return!0;if(r===3&&(t[Ao]===1||t[ml]===1))return!0;if(r===t[Ao]+2){let i=0;const s=n.length;for(let l=0;l<s;l++)i+=n[l];if(i===0||i===s)return!0}return!1}isThreefoldRepetition(){const t=[],n={};let r=!1;for(;;){const o=this._undoMove();if(!o)break;t.push(o)}for(;;){const o=this.fen().split(" ").slice(0,4).join(" ");n[o]=o in n?n[o]+1:1,n[o]>=3&&(r=!0);const i=t.pop();if(i)this._makeMove(i);else break}return r}isDraw(){return this._halfMoves>=100||this.isStalemate()||this.isInsufficientMaterial()||this.isThreefoldRepetition()}isGameOver(){return this.isCheckmate()||this.isStalemate()||this.isDraw()}moves({verbose:t=!1,square:n=void 0,piece:r=void 0}={}){const o=this._moves({square:n,piece:r});return t?o.map(i=>this._makePretty(i)):o.map(i=>this._moveToSan(i,o))}_moves({legal:t=!0,piece:n=void 0,square:r=void 0}={}){var g;const o=r?r.toLowerCase():void 0,i=n==null?void 0:n.toLowerCase(),s=[],l=this._turn,u=ur(l);let a=A.a8,p=A.h1,m=!1;if(o)if(o in A)a=p=A[o],m=!0;else return[];for(let v=a;v<=p;v++){if(v&136){v+=7;continue}if(!this._board[v]||this._board[v].color===u)continue;const{type:y}=this._board[v];let w;if(y===ie){if(i&&i!==y)continue;w=v+hs[l][0],this._board[w]||(jt(s,l,v,w,ie),w=v+hs[l][1],eg[l]===cn(v)&&!this._board[w]&&jt(s,l,v,w,ie,void 0,N.BIG_PAWN));for(let h=2;h<4;h++)w=v+hs[l][h],!(w&136)&&(((g=this._board[w])==null?void 0:g.color)===u?jt(s,l,v,w,ie,this._board[w].type,N.CAPTURE):w===this._epSquare&&jt(s,l,v,w,ie,ie,N.EP_CAPTURE))}else{if(i&&i!==y)continue;for(let h=0,c=za[y].length;h<c;h++){const f=za[y][h];for(w=v;w+=f,!(w&136);){if(!this._board[w])jt(s,l,v,w,y);else{if(this._board[w].color===l)break;jt(s,l,v,w,y,this._board[w].type,N.CAPTURE);break}if(y===ml||y===se)break}}}}if((i===void 0||i===se)&&(!m||p===this._kings[l])){if(this._castling[l]&N.KSIDE_CASTLE){const v=this._kings[l],y=v+2;!this._board[v+1]&&!this._board[y]&&!this._attacked(u,this._kings[l])&&!this._attacked(u,v+1)&&!this._attacked(u,y)&&jt(s,l,this._kings[l],y,se,void 0,N.KSIDE_CASTLE)}if(this._castling[l]&N.QSIDE_CASTLE){const v=this._kings[l],y=v-2;!this._board[v-1]&&!this._board[v-2]&&!this._board[v-3]&&!this._attacked(u,this._kings[l])&&!this._attacked(u,v-1)&&!this._attacked(u,y)&&jt(s,l,this._kings[l],y,se,void 0,N.QSIDE_CASTLE)}}if(!t||this._kings[l]===-1)return s;const d=[];for(let v=0,y=s.length;v<y;v++)this._makeMove(s[v]),this._isKingAttacked(l)||d.push(s[v]),this._undoMove();return d}move(t,{strict:n=!1}={}){let r=null;if(typeof t=="string")r=this._moveFromSan(t,n);else if(typeof t=="object"){const i=this._moves();for(let s=0,l=i.length;s<l;s++)if(t.from===Le(i[s].from)&&t.to===Le(i[s].to)&&(!("promotion"in i[s])||t.promotion===i[s].promotion)){r=i[s];break}}if(!r)throw typeof t=="string"?new Error(`Invalid move: ${t}`):new Error(`Invalid move: ${JSON.stringify(t)}`);const o=this._makePretty(r);return this._makeMove(r),o}_push(t){this._history.push({move:t,kings:{b:this._kings.b,w:this._kings.w},turn:this._turn,castling:{b:this._castling.b,w:this._castling.w},epSquare:this._epSquare,halfMoves:this._halfMoves,moveNumber:this._moveNumber})}_makeMove(t){const n=this._turn,r=ur(n);if(this._push(t),this._board[t.to]=this._board[t.from],delete this._board[t.from],t.flags&N.EP_CAPTURE&&(this._turn===We?delete this._board[t.to-16]:delete this._board[t.to+16]),t.promotion&&(this._board[t.to]={type:t.promotion,color:n}),this._board[t.to].type===se){if(this._kings[n]=t.to,t.flags&N.KSIDE_CASTLE){const o=t.to-1,i=t.to+1;this._board[o]=this._board[i],delete this._board[i]}else if(t.flags&N.QSIDE_CASTLE){const o=t.to+1,i=t.to-2;this._board[o]=this._board[i],delete this._board[i]}this._castling[n]=0}if(this._castling[n]){for(let o=0,i=It[n].length;o<i;o++)if(t.from===It[n][o].square&&this._castling[n]&It[n][o].flag){this._castling[n]^=It[n][o].flag;break}}if(this._castling[r]){for(let o=0,i=It[r].length;o<i;o++)if(t.to===It[r][o].square&&this._castling[r]&It[r][o].flag){this._castling[r]^=It[r][o].flag;break}}t.flags&N.BIG_PAWN?n===We?this._epSquare=t.to-16:this._epSquare=t.to+16:this._epSquare=je,t.piece===ie?this._halfMoves=0:t.flags&(N.CAPTURE|N.EP_CAPTURE)?this._halfMoves=0:this._halfMoves++,n===We&&this._moveNumber++,this._turn=r}undo(){const t=this._undoMove();return t?this._makePretty(t):null}_undoMove(){const t=this._history.pop();if(t===void 0)return null;const n=t.move;this._kings=t.kings,this._turn=t.turn,this._castling=t.castling,this._epSquare=t.epSquare,this._halfMoves=t.halfMoves,this._moveNumber=t.moveNumber;const r=this._turn,o=ur(r);if(this._board[n.from]=this._board[n.to],this._board[n.from].type=n.piece,delete this._board[n.to],n.captured)if(n.flags&N.EP_CAPTURE){let i;r===We?i=n.to-16:i=n.to+16,this._board[i]={type:ie,color:o}}else this._board[n.to]={type:n.captured,color:o};if(n.flags&(N.KSIDE_CASTLE|N.QSIDE_CASTLE)){let i,s;n.flags&N.KSIDE_CASTLE?(i=n.to+1,s=n.to-1):(i=n.to-2,s=n.to+1),this._board[i]=this._board[s],delete this._board[s]}return n}pgn({newline:t=`
`,maxWidth:n=0}={}){const r=[];let o=!1;for(const d in this._header)r.push("["+d+' "'+this._header[d]+'"]'+t),o=!0;o&&this._history.length&&r.push(t);const i=d=>{const g=this._comments[this.fen()];if(typeof g<"u"){const v=d.length>0?" ":"";d=`${d}${v}{${g}}`}return d},s=[];for(;this._history.length>0;)s.push(this._undoMove());const l=[];let u="";for(s.length===0&&l.push(i(""));s.length>0;){u=i(u);const d=s.pop();if(!d)break;if(!this._history.length&&d.color==="b"){const g=`${this._moveNumber}. ...`;u=u?`${u} ${g}`:g}else d.color==="w"&&(u.length&&l.push(u),u=this._moveNumber+".");u=u+" "+this._moveToSan(d,this._moves({legal:!0})),this._makeMove(d)}if(u.length&&l.push(i(u)),typeof this._header.Result<"u"&&l.push(this._header.Result),n===0)return r.join("")+l.join(" ");const a=function(){return r.length>0&&r[r.length-1]===" "?(r.pop(),!0):!1},p=function(d,g){for(const v of g.split(" "))if(v){if(d+v.length>n){for(;a();)d--;r.push(t),d=0}r.push(v),d+=v.length,r.push(" "),d++}return a()&&d--,d};let m=0;for(let d=0;d<l.length;d++){if(m+l[d].length>n&&l[d].includes("{")){m=p(m,l[d]);continue}m+l[d].length>n&&d!==0?(r[r.length-1]===" "&&r.pop(),r.push(t),m=0):d!==0&&(r.push(" "),m++),r.push(l[d]),m+=l[d].length}return r.join("")}header(...t){for(let n=0;n<t.length;n+=2)typeof t[n]=="string"&&typeof t[n+1]=="string"&&(this._header[t[n]]=t[n+1]);return this._header}loadPgn(t,{strict:n=!1,newlineChar:r=`\r?
`}={}){function o(f){return f.replace(/\\/g,"\\")}function i(f){const k={},x=f.split(new RegExp(o(r)));let _="",O="";for(let T=0;T<x.length;T++){const j=/^\s*\[\s*([A-Za-z]+)\s*"(.*)"\s*\]\s*$/;_=x[T].replace(j,"$1"),O=x[T].replace(j,"$2"),_.trim().length>0&&(k[_]=O)}return k}t=t.trim();const l=new RegExp("^(\\[((?:"+o(r)+")|.)*\\])((?:\\s*"+o(r)+"){2}|(?:\\s*"+o(r)+")*$)").exec(t),u=l&&l.length>=2?l[1]:"";this.reset();const a=i(u);let p="";for(const f in a)f.toLowerCase()==="fen"&&(p=a[f]),this.header(f,a[f]);if(!n)p&&this.load(p,!0);else if(a.SetUp==="1"){if(!("FEN"in a))throw new Error("Invalid PGN: FEN tag must be supplied with SetUp tag");this.load(a.FEN,!0)}function m(f){return Array.from(f).map(function(k){return k.charCodeAt(0)<128?k.charCodeAt(0).toString(16):encodeURIComponent(k).replace(/%/g,"").toLowerCase()}).join("")}function d(f){return f.length==0?"":decodeURIComponent("%"+(f.match(/.{1,2}/g)||[]).join("%"))}const g=function(f){return f=f.replace(new RegExp(o(r),"g")," "),`{${m(f.slice(1,f.length-1))}}`},v=function(f){if(f.startsWith("{")&&f.endsWith("}"))return d(f.slice(1,f.length-1))};let y=t.replace(u,"").replace(new RegExp(`({[^}]*})+?|;([^${o(r)}]*)`,"g"),function(f,k,x){return k!==void 0?g(k):" "+g(`{${x.slice(1)}}`)}).replace(new RegExp(o(r),"g")," ");const w=/(\([^()]+\))+?/g;for(;w.test(y);)y=y.replace(w,"");y=y.replace(/\d+\.(\.\.)?/g,""),y=y.replace(/\.\.\./g,""),y=y.replace(/\$\d+/g,"");let h=y.trim().split(new RegExp(/\s+/));h=h.filter(f=>f!=="");let c="";for(let f=0;f<h.length;f++){const k=v(h[f]);if(k!==void 0){this._comments[this.fen()]=k;continue}const x=this._moveFromSan(h[f],n);if(x==null)if(tg.indexOf(h[f])>-1)c=h[f];else throw new Error(`Invalid move in PGN: ${h[f]}`);else c="",this._makeMove(x)}c&&Object.keys(this._header).length&&!this._header.Result&&this.header("Result",c)}_moveToSan(t,n){let r="";if(t.flags&N.KSIDE_CASTLE)r="O-O";else if(t.flags&N.QSIDE_CASTLE)r="O-O-O";else{if(t.piece!==ie){const o=rg(t,n);r+=t.piece.toUpperCase()+o}t.flags&(N.CAPTURE|N.EP_CAPTURE)&&(t.piece===ie&&(r+=Le(t.from)[0]),r+="x"),r+=Le(t.to),t.promotion&&(r+="="+t.promotion.toUpperCase())}return this._makeMove(t),this.isCheck()&&(this.isCheckmate()?r+="#":r+="+"),this._undoMove(),r}_moveFromSan(t,n=!1){const r=ps(t);let o=Fa(r),i=this._moves({legal:!0,piece:o});for(let d=0,g=i.length;d<g;d++)if(r===ps(this._moveToSan(i[d],i)))return i[d];if(n)return null;let s,l,u,a,p,m=!1;if(l=r.match(/([pnbrqkPNBRQK])?([a-h][1-8])x?-?([a-h][1-8])([qrbnQRBN])?/),l?(s=l[1],u=l[2],a=l[3],p=l[4],u.length==1&&(m=!0)):(l=r.match(/([pnbrqkPNBRQK])?([a-h]?[1-8]?)x?-?([a-h][1-8])([qrbnQRBN])?/),l&&(s=l[1],u=l[2],a=l[3],p=l[4],u.length==1&&(m=!0))),o=Fa(r),i=this._moves({legal:!0,piece:s||o}),!a)return null;for(let d=0,g=i.length;d<g;d++)if(u){if((!s||s.toLowerCase()==i[d].piece)&&A[u]==i[d].from&&A[a]==i[d].to&&(!p||p.toLowerCase()==i[d].promotion))return i[d];if(m){const v=Le(i[d].from);if((!s||s.toLowerCase()==i[d].piece)&&A[a]==i[d].to&&(u==v[0]||u==v[1])&&(!p||p.toLowerCase()==i[d].promotion))return i[d]}}else if(r===ps(this._moveToSan(i[d],i)).replace("x",""))return i[d];return null}ascii(){let t=` +------------------------+
`;for(let n=A.a8;n<=A.h1;n++){if(Br(n)===0&&(t+=" "+"87654321"[cn(n)]+" |"),this._board[n]){const r=this._board[n].type,i=this._board[n].color===me?r.toUpperCase():r.toLowerCase();t+=" "+i+" "}else t+=" . ";n+1&136&&(t+=`|
`,n+=8)}return t+=` +------------------------+
`,t+=" a b c d e f g h",t}perft(t){const n=this._moves({legal:!1});let r=0;const o=this._turn;for(let i=0,s=n.length;i<s;i++)this._makeMove(n[i]),this._isKingAttacked(o)||(t-1>0?r+=this.perft(t-1):r++),this._undoMove();return r}_makePretty(t){const{color:n,piece:r,from:o,to:i,flags:s,captured:l,promotion:u}=t;let a="";for(const g in N)N[g]&s&&(a+=q0[g]);const p=Le(o),m=Le(i),d={color:n,piece:r,from:p,to:m,san:this._moveToSan(t,this._moves({legal:!0})),flags:a,lan:p+m,before:this.fen(),after:""};return this._makeMove(t),d.after=this.fen(),this._undoMove(),l&&(d.captured=l),u&&(d.promotion=u,d.lan+=u),d}turn(){return this._turn}board(){const t=[];let n=[];for(let r=A.a8;r<=A.h1;r++)this._board[r]==null?n.push(null):n.push({square:Le(r),type:this._board[r].type,color:this._board[r].color}),r+1&136&&(t.push(n),n=[],r+=8);return t}squareColor(t){if(t in A){const n=A[t];return(cn(n)+Br(n))%2===0?"light":"dark"}return null}history({verbose:t=!1}={}){const n=[],r=[];for(;this._history.length>0;)n.push(this._undoMove());for(;;){const o=n.pop();if(!o)break;t?r.push(this._makePretty(o)):r.push(this._moveToSan(o,this._moves())),this._makeMove(o)}return r}_pruneComments(){const t=[],n={},r=o=>{o in this._comments&&(n[o]=this._comments[o])};for(;this._history.length>0;)t.push(this._undoMove());for(r(this.fen());;){const o=t.pop();if(!o)break;this._makeMove(o),r(this.fen())}this._comments=n}getComment(){return this._comments[this.fen()]}setComment(t){this._comments[this.fen()]=t.replace("{","[").replace("}","]")}deleteComment(){const t=this._comments[this.fen()];return delete this._comments[this.fen()],t}getComments(){return this._pruneComments(),Object.keys(this._comments).map(t=>({fen:t,comment:this._comments[t]}))}deleteComments(){return this._pruneComments(),Object.keys(this._comments).map(t=>{const n=this._comments[t];return delete this._comments[t],{fen:t,comment:n}})}setCastlingRights(t,n){for(const o of[se,Mt])n[o]!==void 0&&(n[o]?this._castling[t]|=wo[o]:this._castling[t]&=~wo[o]);this._updateCastlingRights();const r=this.getCastlingRights(t);return(n[se]===void 0||n[se]===r[se])&&(n[Mt]===void 0||n[Mt]===r[Mt])}getCastlingRights(t){return{[se]:(this._castling[t]&wo[se])!==0,[Mt]:(this._castling[t]&wo[Mt])!==0}}moveNumber(){return this._moveNumber}}const Nf=C.createContext({dragDropManager:void 0});function Be(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 Ua=typeof Symbol=="function"&&Symbol.observable||"@@observable",gs=function(){return Math.random().toString(36).substring(7).split("").join(".")},Ha={INIT:"@@redux/INIT"+gs(),REPLACE:"@@redux/REPLACE"+gs(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+gs()}};function Mf(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Be(0));if(typeof t=="function"&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!="function")throw new Error(Be(1));return n(Mf)(e,t)}if(typeof e!="function")throw new Error(Be(2));var o=e,i=t,s=[],l=s,u=!1;function a(){l===s&&(l=s.slice())}function p(){if(u)throw new Error(Be(3));return i}function m(g){if(typeof g!="function")throw new Error(Be(4));if(u)throw new Error(Be(5));var v=!0;return a(),l.push(g),function(){if(v){if(u)throw new Error(Be(6));v=!1,a();var y=l.indexOf(g);l.splice(y,1),s=null}}}function d(g){if(!function(w){if(typeof w!="object"||w===null)return!1;for(var h=w;Object.getPrototypeOf(h)!==null;)h=Object.getPrototypeOf(h);return Object.getPrototypeOf(w)===h}(g))throw new Error(Be(7));if(g.type===void 0)throw new Error(Be(8));if(u)throw new Error(Be(9));try{u=!0,i=o(i,g)}finally{u=!1}for(var v=s=l,y=0;y<v.length;y++)(0,v[y])();return g}return d({type:Ha.INIT}),(r={dispatch:d,subscribe:m,getState:p,replaceReducer:function(g){if(typeof g!="function")throw new Error(Be(10));o=g,d({type:Ha.REPLACE})}})[Ua]=function(){var g,v=m;return(g={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(Be(11));function w(){y.next&&y.next(p())}return w(),{unsubscribe:v(w)}}})[Ua]=function(){return this},g},r}function M(e,t,...n){if(typeof process<"u"&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let r;if(t===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let o=0;r=new Error(t.replace(/%s/g,function(){return n[o++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function Rf(e){return typeof e=="object"}const vu="dnd-core/INIT_COORDS",yu="dnd-core/BEGIN_DRAG",Af="dnd-core/PUBLISH_DRAG_SOURCE",_i="dnd-core/HOVER",Su="dnd-core/DROP",wu="dnd-core/END_DRAG";function Ba(e,t){return{type:vu,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const ig={type:vu,payload:{clientOffset:null,sourceClientOffset:null}};function sg(e){return function(t=[],n={publishSource:!0}){const{publishSource:r=!0,clientOffset:o,getSourceClientOffset:i}=n,s=e.getMonitor(),l=e.getRegistry();e.dispatch(Ba(o)),function(d,g,v){M(!g.isDragging(),"Cannot call beginDrag while dragging."),d.forEach(function(y){M(v.getSource(y),"Expected sourceIds to be registered.")})}(t,s,l);const u=function(d,g){let v=null;for(let y=d.length-1;y>=0;y--)if(g.canDragSource(d[y])){v=d[y];break}return v}(t,s);if(u==null)return void e.dispatch(ig);let a=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");(function(d){M(typeof d=="function","When clientOffset is provided, getSourceClientOffset must be a function.")})(i),a=i(u)}e.dispatch(Ba(o,a));const p=l.getSource(u).beginDrag(s,u);if(p==null)return;(function(d){M(Rf(d),"Item must be an object.")})(p),l.pinSource(u);const m=l.getSourceType(u);return{type:yu,payload:{itemType:m,item:p,sourceId:u,clientOffset:o||null,sourceClientOffset:a||null,isSourcePublic:!!r}}}}function lg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ug(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){lg(e,o,n[o])})}return e}function ag(e){return function(t={}){const n=e.getMonitor(),r=e.getRegistry();(function(i){M(i.isDragging(),"Cannot call drop while not dragging."),M(!i.didDrop(),"Cannot call drop twice during one drag operation.")})(n),function(i){const s=i.getTargetIds().filter(i.canDropOnTarget,i);return s.reverse(),s}(n).forEach((i,s)=>{const l=function(a,p,m,d){const g=m.getTarget(a);let v=g?g.drop(d,a):void 0;return function(y){M(y===void 0||Rf(y),"Drop result must either be an object or undefined.")}(v),v===void 0&&(v=p===0?{}:d.getDropResult()),v}(i,s,r,n),u={type:Su,payload:{dropResult:ug({},t,l)}};e.dispatch(u)})}}function cg(e){return function(){const t=e.getMonitor(),n=e.getRegistry();(function(o){M(o.isDragging(),"Cannot call endDrag while not dragging.")})(t);const r=t.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:wu}}}function vl(e,t){return t===null?e===null:Array.isArray(e)?e.some(n=>n===t):e===t}function dg(e){return function(t,{clientOffset:n}={}){(function(s){M(Array.isArray(s),"Expected targetIds to be an array.")})(t);const r=t.slice(0),o=e.getMonitor(),i=e.getRegistry();return function(s,l,u){for(let a=s.length-1;a>=0;a--){const p=s[a];vl(l.getTargetType(p),u)||s.splice(a,1)}}(r,i,o.getItemType()),function(s,l,u){M(l.isDragging(),"Cannot call hover while not dragging."),M(!l.didDrop(),"Cannot call hover after drop.");for(let a=0;a<s.length;a++){const p=s[a];M(s.lastIndexOf(p)===a,"Expected targetIds to be unique in the passed array."),M(u.getTarget(p),"Expected targetIds to be registered.")}}(r,o,i),function(s,l,u){s.forEach(function(a){u.getTarget(a).hover(l,a)})}(r,o,i),{type:_i,payload:{targetIds:r,clientOffset:n||null}}}}function fg(e){return function(){if(e.getMonitor().isDragging())return{type:Af}}}class hg{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:n}=this.store,r=function(o){return{beginDrag:sg(o),publishDragSource:fg(o),hover:dg(o),drop:ag(o),endDrag:cg(o)}}(this);return Object.keys(r).reduce((o,i)=>{const s=r[i];var l;return o[i]=(l=s,(...u)=>{const a=l.apply(t,u);a!==void 0&&n(a)}),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}}function Wa(e,t){return{x:e.x-t.x,y:e.y-t.y}}const xr=[],ku=[];xr.__IS_NONE__=!0,ku.__IS_ALL__=!0;class pg{subscribeToStateChange(t,n={}){const{handlerIds:r}=n;M(typeof t=="function","listener must be a function."),M(r===void 0||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let o=this.store.getState().stateId;return this.store.subscribe(()=>{const i=this.store.getState(),s=i.stateId;try{s===o||s===o+1&&!function(u,a){return u!==xr&&(u===ku||a===void 0||(p=u,a.filter(m=>p.indexOf(m)>-1)).length>0);var p}(i.dirtyHandlerIds,r)||t()}finally{o=s}})}subscribeToOffsetChange(t){M(typeof t=="function","listener must be a function.");let n=this.store.getState().dragOffset;return this.store.subscribe(()=>{const r=this.store.getState().dragOffset;r!==n&&(n=r,t())})}canDragSource(t){if(!t)return!1;const n=this.registry.getSource(t);return M(n,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()&&n.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const n=this.registry.getTarget(t);return M(n,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop()?!1:vl(this.registry.getTargetType(t),this.getItemType())&&n.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const n=this.registry.getSource(t,!0);return M(n,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic()?!1:this.registry.getSourceType(t)===this.getItemType()&&n.isDragging(this,t)}isOverTarget(t,n={shallow:!1}){if(!t)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const o=this.registry.getTargetType(t),i=this.getItemType();if(i&&!vl(o,i))return!1;const s=this.getTargetIds();if(!s.length)return!1;const l=s.indexOf(t);return r?l===s.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(t){const{clientOffset:n,initialClientOffset:r,initialSourceClientOffset:o}=t;return n&&r&&o?Wa((s=o,{x:(i=n).x+s.x,y:i.y+s.y}),r):null;var i,s}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(t){const{clientOffset:n,initialClientOffset:r}=t;return n&&r?Wa(n,r):null}(this.store.getState().dragOffset)}constructor(t,n){this.store=t,this.registry=n}}const qa=typeof global<"u"?global:self,Qa=qa.MutationObserver||qa.WebKitMutationObserver;function bf(e){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}const gg=typeof Qa=="function"?function(e){let t=1;const n=new Qa(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:bf;class mg{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}const zf=new class{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let n=0,r=e.length-this.index;n<r;n++)e[n]=e[n+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=gg(this.flush),this.requestErrorThrow=bf(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},vg=new class{create(e){const t=this.freeTasks,n=t.length?t.pop():new mg(this.onError,r=>t[t.length]=r);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}(zf.registerPendingError),Eu="dnd-core/ADD_SOURCE",Cu="dnd-core/ADD_TARGET",xu="dnd-core/REMOVE_SOURCE",Oi="dnd-core/REMOVE_TARGET";function yl(e,t){t&&Array.isArray(e)?e.forEach(n=>yl(n,!1)):M(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ke;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ke||(Ke={}));let yg=0;function Sg(e){const t=(yg++).toString();switch(e){case Ke.SOURCE:return`S${t}`;case Ke.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Ka(e){switch(e[0]){case"S":return Ke.SOURCE;case"T":return Ke.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Va(e,t){const n=e.entries();let r=!1;do{const{done:o,value:[,i]}=n.next();if(i===t)return!0;r=!!o}while(!r);return!1}class wg{addSource(t,n){yl(t),function(o){M(typeof o.canDrag=="function","Expected canDrag to be a function."),M(typeof o.beginDrag=="function","Expected beginDrag to be a function."),M(typeof o.endDrag=="function","Expected endDrag to be a function.")}(n);const r=this.addHandler(Ke.SOURCE,t,n);return this.store.dispatch(function(o){return{type:Eu,payload:{sourceId:o}}}(r)),r}addTarget(t,n){yl(t,!0),function(o){M(typeof o.canDrop=="function","Expected canDrop to be a function."),M(typeof o.hover=="function","Expected hover to be a function."),M(typeof o.drop=="function","Expected beginDrag to be a function.")}(n);const r=this.addHandler(Ke.TARGET,t,n);return this.store.dispatch(function(o){return{type:Cu,payload:{targetId:o}}}(r)),r}containsHandler(t){return Va(this.dragSources,t)||Va(this.dropTargets,t)}getSource(t,n=!1){return M(this.isSourceId(t),"Expected a valid source ID."),n&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return M(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return M(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return M(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Ka(t)===Ke.SOURCE}isTargetId(t){return Ka(t)===Ke.TARGET}removeSource(t){var n;M(this.getSource(t),"Expected an existing source."),this.store.dispatch(function(r){return{type:xu,payload:{sourceId:r}}}(t)),n=()=>{this.dragSources.delete(t),this.types.delete(t)},zf.enqueueTask(vg.create(n))}removeTarget(t){M(this.getTarget(t),"Expected an existing target."),this.store.dispatch(function(n){return{type:Oi,payload:{targetId:n}}}(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const n=this.getSource(t);M(n,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=n}unpinSource(){M(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,n,r){const o=Sg(t);return this.types.set(o,n),t===Ke.SOURCE?this.dragSources.set(o,r):t===Ke.TARGET&&this.dropTargets.set(o,r),o}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const kg=(e,t)=>e===t;function Eg(e=xr,t){switch(t.type){case _i:break;case Eu:case Cu:case Oi:case xu:return xr;default:return ku}const{targetIds:n=[],prevTargetIds:r=[]}=t.payload,o=function(l,u){const a=new Map,p=d=>{a.set(d,a.has(d)?a.get(d)+1:1)};l.forEach(p),u.forEach(p);const m=[];return a.forEach((d,g)=>{d===1&&m.push(g)}),m}(n,r);if(!(o.length>0||!function(l,u,a=kg){if(l.length!==u.length)return!1;for(let p=0;p<l.length;++p)if(!a(l[p],u[p]))return!1;return!0}(n,r)))return xr;const i=r[r.length-1],s=n[n.length-1];return i!==s&&(i&&o.push(i),s&&o.push(s)),o}function Cg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ga={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function xg(e=Ga,t){const{payload:n}=t;switch(t.type){case vu:case yu:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case _i:return r=e.clientOffset,o=n.clientOffset,!r&&!o||r&&o&&r.x===o.x&&r.y===o.y?e:function(i){for(var s=1;s<arguments.length;s++){var l=arguments[s]!=null?arguments[s]:{},u=Object.keys(l);typeof Object.getOwnPropertySymbols=="function"&&(u=u.concat(Object.getOwnPropertySymbols(l).filter(function(a){return Object.getOwnPropertyDescriptor(l,a).enumerable}))),u.forEach(function(a){Cg(i,a,l[a])})}return i}({},e,{clientOffset:n.clientOffset});case wu:case Su:return Ga;default:return e}var r,o}function _g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){_g(e,o,n[o])})}return e}const Og={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Tg(e=Og,t){const{payload:n}=t;switch(t.type){case yu:return Cn({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Af:return Cn({},e,{isSourcePublic:!0});case _i:return Cn({},e,{targetIds:n.targetIds});case Oi:return e.targetIds.indexOf(n.targetId)===-1?e:Cn({},e,{targetIds:(r=e.targetIds,o=n.targetId,r.filter(i=>i!==o))});case Su:return Cn({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case wu:return Cn({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}var r,o}function Dg(e=0,t){switch(t.type){case Eu:case Cu:return e+1;case xu:case Oi:return e-1;default:return e}}function Pg(e=0){return e+1}function Ig(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Ig(e,o,n[o])})}return e}function Lg(e={},t){return{dirtyHandlerIds:Eg(e.dirtyHandlerIds,{type:t.type,payload:jg({},t.payload,{prevTargetIds:(n=e,r="dragOperation.targetIds",o=[],r.split(".").reduce((i,s)=>i&&i[s]?i[s]:o||null,n))})}),dragOffset:xg(e.dragOffset,t),refCount:Dg(e.refCount,t),dragOperation:Tg(e.dragOperation,t),stateId:Pg(e.stateId)};var n,r,o}function Ng(e,t=void 0,n={},r=!1){const o=function(u){const a=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Mf(Lg,u&&a&&a({name:"dnd-core",instanceId:"dnd-core"}))}(r),i=new pg(o,new wg(o)),s=new hg(o,i),l=e(s,t,n);return s.receiveBackend(l),s}function Mg(e,t){if(e==null)return{};var n,r,o=function(s,l){if(s==null)return{};var u,a,p={},m=Object.keys(s);for(a=0;a<m.length;a++)u=m[a],l.indexOf(u)>=0||(p[u]=s[u]);return p}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}let Ya=0;const ko=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Rg=C.memo(function(e){var{children:t}=e,n=Mg(e,["children"]);const[r,o]=function(i){if("manager"in i)return[{dragDropManager:i.manager},!1];const s=function(u,a=Xa(),p,m){const d=a;return d[ko]||(d[ko]={dragDropManager:Ng(u,a,p,m)}),d[ko]}(i.backend,i.context,i.options,i.debugMode),l=!i.context;return[s,l]}(n);return C.useEffect(()=>{if(o){const i=Xa();return++Ya,()=>{--Ya==0&&(i[ko]=null)}}},[]),S.jsx(Nf.Provider,{value:r,children:t})});function Xa(){return typeof global<"u"?global:window}var Ag=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;o--!=0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;o--!=0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!=0;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n};const mn=typeof window<"u"?C.useLayoutEffect:C.useEffect;function $f(e,t,n){const[r,o]=C.useState(()=>t(e)),i=C.useCallback(()=>{const s=t(e);Ag(r,s)||(o(s),n&&n())},[r,e,n]);return mn(i),[r,i]}function Ff(e,t,n){return function(r,o,i){const[s,l]=$f(r,o,i);return mn(function(){const u=r.getHandlerId();if(u!=null)return r.subscribeToStateChange(l,{handlerIds:[u]})},[r,l]),s}(t,e||(()=>({})),()=>n.reconnect())}function Uf(e,t){const n=[...t||[]];return t==null&&typeof e!="function"&&n.push(e),C.useMemo(()=>typeof e=="function"?e():e,n)}function bg(e){return C.useMemo(()=>e.hooks.dragSource(),[e])}function zg(e){return C.useMemo(()=>e.hooks.dragPreview(),[e])}let ms=!1,vs=!1;class $g{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){M(!ms,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return ms=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{ms=!1}}isDragging(){if(!this.sourceId)return!1;M(!vs,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return vs=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{vs=!1}}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,n){return this.internalMonitor.isOverTarget(t,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let ys=!1;class Fg{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}canDrop(){if(!this.targetId)return!1;M(!ys,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return ys=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{ys=!1}}isOver(t){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function Sl(e,t,n,r){let o=n?n.call(r,e,t):void 0;if(o!==void 0)return!!o;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let u=0;u<i.length;u++){const a=i[u];if(!l(a))return!1;const p=e[a],m=t[a];if(o=n?n.call(r,p,m,a):void 0,o===!1||o===void 0&&p!==m)return!1}return!0}function wl(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ug(e){return(t=null,n=null)=>{if(!C.isValidElement(t)){const o=t;return e(o,n),o}const r=t;return function(o){if(typeof o.type=="string")return;const i=o.type.displayName||o.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${i} into a <div>, or turn it into a drag source or a drop target itself.`)}(r),function(o,i){const s=o.ref;return M(typeof s!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),C.cloneElement(o,s?{ref:l=>{Ja(s,l),Ja(i,l)}}:{ref:i})}(r,n?o=>e(o,n):e)}}function Hf(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{const o=Ug(r);t[n]=()=>o}}),t}function Ja(e,t){typeof e=="function"?e(t):e.current=t}class Hg{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?t?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),n):(this.lastConnectedDragSource=t,n):n}reconnectDragPreview(t=!1){const n=this.dragPreview,r=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();r&&this.disconnectDragPreview(),this.handlerId&&(n?r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions)):this.lastConnectedDragPreview=n)}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Sl(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Sl(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=Hf({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,wl(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,wl(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class Bg{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const n=this.dropTarget;this.handlerId&&(n?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions)):this.lastConnectedDropTarget=n)}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Sl(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=Hf({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,wl(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function vn(){const{dragDropManager:e}=C.useContext(Nf);return M(e!=null,"Expected drag drop context"),e}class Wg{beginDrag(){const t=this.spec,n=this.monitor;let r=null;return r=typeof t.item=="object"?t.item:typeof t.item=="function"?t.item(n):{},r??null}canDrag(){const t=this.spec,n=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag!="function"||t.canDrag(n)}isDragging(t,n){const r=this.spec,o=this.monitor,{isDragging:i}=r;return i?i(o):n===t.getSourceId()}endDrag(){const t=this.spec,n=this.monitor,r=this.connector,{end:o}=t;o&&o(n.getItem(),n),r.reconnect()}constructor(t,n,r){this.spec=t,this.monitor=n,this.connector=r}}function qg(e,t,n){const r=vn(),o=function(s,l,u){const a=C.useMemo(()=>new Wg(s,l,u),[l,u]);return C.useEffect(()=>{a.spec=s},[s]),a}(e,t,n),i=function(s){return C.useMemo(()=>{const l=s.type;return M(l!=null,"spec.type must be defined"),l},[s])}(e);mn(function(){if(i!=null){const[s,l]=function(u,a,p){const m=p.getRegistry(),d=m.addSource(u,a);return[d,()=>m.removeSource(d)]}(i,o,r);return t.receiveHandlerId(s),n.receiveHandlerId(s),l}},[r,t,n,o,i])}function Qg(e,t){const n=Uf(e,t);M(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=function(){const i=vn();return C.useMemo(()=>new $g(i),[i])}(),o=function(i,s){const l=vn(),u=C.useMemo(()=>new Hg(l.getBackend()),[l]);return mn(()=>(u.dragSourceOptions=i||null,u.reconnect(),()=>u.disconnectDragSource()),[u,i]),mn(()=>(u.dragPreviewOptions=s||null,u.reconnect(),()=>u.disconnectDragPreview()),[u,s]),u}(n.options,n.previewOptions);return qg(n,r,o),[Ff(n.collect,r,o),bg(o),zg(o)]}function Kg(e){return C.useMemo(()=>e.hooks.dropTarget(),[e])}class Vg{canDrop(){const t=this.spec,n=this.monitor;return!t.canDrop||t.canDrop(n.getItem(),n)}hover(){const t=this.spec,n=this.monitor;t.hover&&t.hover(n.getItem(),n)}drop(){const t=this.spec,n=this.monitor;if(t.drop)return t.drop(n.getItem(),n)}constructor(t,n){this.spec=t,this.monitor=n}}function Gg(e,t,n){const r=vn(),o=function(s,l){const u=C.useMemo(()=>new Vg(s,l),[l]);return C.useEffect(()=>{u.spec=s},[s]),u}(e,t),i=function(s){const{accept:l}=s;return C.useMemo(()=>(M(s.accept!=null,"accept must be defined"),Array.isArray(l)?l:[l]),[l])}(e);mn(function(){const[s,l]=function(u,a,p){const m=p.getRegistry(),d=m.addTarget(u,a);return[d,()=>m.removeTarget(d)]}(i,o,r);return t.receiveHandlerId(s),n.receiveHandlerId(s),l},[r,t,o,n,i.map(s=>s.toString()).join("|")])}function Yg(e,t){const n=Uf(e,t),r=function(){const i=vn();return C.useMemo(()=>new Fg(i),[i])}(),o=function(i){const s=vn(),l=C.useMemo(()=>new Bg(s.getBackend()),[s]);return mn(()=>(l.dropTargetOptions=i||null,l.reconnect(),()=>l.disconnectDropTarget()),[i]),l}(n.options);return Gg(n,r,o),[Ff(n.collect,r,o),Kg(o)]}function Bf(e){let t=null;return()=>(t==null&&(t=e()),t)}class Xg{enter(t){const n=this.entered.length;return this.entered=function(r,o){const i=new Set,s=u=>i.add(u);r.forEach(s),o.forEach(s);const l=[];return i.forEach(u=>l.push(u)),l}(this.entered.filter(r=>this.isNodeInDocument(r)&&(!r.contains||r.contains(t))),[t]),n===0&&this.entered.length>0}leave(t){const n=this.entered.length;var r,o;return this.entered=(r=this.entered.filter(this.isNodeInDocument),o=t,r.filter(i=>i!==o)),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Jg{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get:()=>(console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null)})})}loadDataTransfer(t){if(t){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const o=this.config.exposeProperties[r];o!=null&&(n[r]={value:o(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,n){return n===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const Wf="__NATIVE_FILE__",qf="__NATIVE_URL__",Qf="__NATIVE_TEXT__",Kf="__NATIVE_HTML__";var Za=Object.freeze({__proto__:null,FILE:Wf,HTML:Kf,TEXT:Qf,URL:qf});function Ss(e,t,n){const r=t.reduce((o,i)=>o||e.getData(i),"");return r??n}const kl={[Wf]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[Kf]:{exposeProperties:{html:(e,t)=>Ss(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[qf]:{exposeProperties:{urls:(e,t)=>Ss(e,t,"").split(`
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[Qf]:{exposeProperties:{text:(e,t)=>Ss(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function ws(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(kl).filter(n=>{const r=kl[n];return!!(r!=null&&r.matchesTypes)&&r.matchesTypes.some(o=>t.indexOf(o)>-1)})[0]||null}const Zg=Bf(()=>/firefox/i.test(navigator.userAgent)),ec=Bf(()=>!!window.safari);class tc{interpolate(t){const{xs:n,ys:r,c1s:o,c2s:i,c3s:s}=this;let l=n.length-1;if(t===n[l])return r[l];let u,a=0,p=s.length-1;for(;a<=p;){u=Math.floor(.5*(a+p));const g=n[u];if(g<t)a=u+1;else{if(!(g>t))return r[u];p=u-1}}l=Math.max(0,p);const m=t-n[l],d=m*m;return r[l]+o[l]*m+i[l]*d+s[l]*m*d}constructor(t,n){const{length:r}=t,o=[];for(let g=0;g<r;g++)o.push(g);o.sort((g,v)=>t[g]<t[v]?-1:1);const i=[],s=[];let l,u;for(let g=0;g<r-1;g++)l=t[g+1]-t[g],u=n[g+1]-n[g],i.push(l),s.push(u/l);const a=[s[0]];for(let g=0;g<i.length-1;g++){const v=s[g],y=s[g+1];if(v*y<=0)a.push(0);else{l=i[g];const w=i[g+1],h=l+w;a.push(3*h/((h+w)/v+(h+l)/y))}}a.push(s[s.length-1]);const p=[],m=[];let d;for(let g=0;g<a.length-1;g++){d=s[g];const v=a[g],y=1/i[g],w=v+a[g+1]-d-d;p.push((d-v-w)*y),m.push(w*y*y)}this.xs=t,this.ys=n,this.c1s=a,this.c2s=p,this.c3s=m}}const e1=1;function Vf(e){const t=e.nodeType===e1?e:e.parentElement;if(!t)return null;const{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function Eo(e){return{x:e.clientX,y:e.clientY}}function t1(e,t,n,r,o){const i=(s=t).nodeName==="IMG"&&(Zg()||!(!((l=document.documentElement)===null||l===void 0)&&l.contains(s)));var s,l;const u=Vf(i?e:t),a={x:n.x-u.x,y:n.y-u.y},{offsetWidth:p,offsetHeight:m}=e,{anchorX:d,anchorY:g}=r,{dragPreviewWidth:v,dragPreviewHeight:y}=function(f,k,x,_){let O=f?k.width:x,T=f?k.height:_;return ec()&&f&&(T/=window.devicePixelRatio,O/=window.devicePixelRatio),{dragPreviewWidth:O,dragPreviewHeight:T}}(i,t,p,m),{offsetX:w,offsetY:h}=o,c=h===0||h;return{x:w===0||w?w:new tc([0,.5,1],[a.x,a.x/p*v,a.x+v-p]).interpolate(d),y:c?h:(()=>{let f=new tc([0,.5,1],[a.y,a.y/m*y,a.y+y-m]).interpolate(g);return ec()&&i&&(f+=(window.devicePixelRatio-1)*y),f})()}}let Co;function n1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){n1(e,o,n[o])})}return e}class r1{profile(){var t,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;var n;t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&((n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)))}connectDragPreview(t,n,r){return this.sourcePreviewNodeOptions.set(t,r),this.sourcePreviewNodes.set(t,n),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,n,r){this.sourceNodes.set(t,n),this.sourceNodeOptions.set(t,r);const o=s=>this.handleDragStart(s,t),i=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",o),n.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),n.removeEventListener("dragstart",o),n.removeEventListener("selectstart",i),n.setAttribute("draggable","false")}}connectDropTarget(t,n){const r=s=>this.handleDragEnter(s,t),o=s=>this.handleDragOver(s,t),i=s=>this.handleDrop(s,t);return n.addEventListener("dragenter",r),n.addEventListener("dragover",o),n.addEventListener("drop",i),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",o),n.removeEventListener("drop",i)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(t);return nc({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId();return nc({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(t)||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Za).some(n=>Za[n]===t)}beginDragNativeItem(t,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(r,o){const i=kl[r];if(!i)throw new Error(`native type ${r} has no configuration`);const s=new Jg(i);return s.loadDataTransfer(o),s}(t,n),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t,this.mouseMoveTimeoutTimer=setTimeout(()=>{var n;return(n=this.rootElement)===null||n===void 0?void 0:n.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){var t;return this.currentDragSourceNode=null,this.rootElement&&((t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,n){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(t,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(t,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(t,n){this.dropTargetIds.unshift(n)}constructor(t,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=o=>{const i=this.sourceNodes.get(o);return i&&Vf(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=o=>!!(o&&this.document&&this.document.body&&this.document.body.contains(o)),this.endDragIfSourceWasRemovedFromDOM=()=>{const o=this.currentDragSourceNode;o==null||this.isNodeInDocument(o)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=o=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(o||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=o=>{if(o.defaultPrevented)return;const{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;const s=Eo(o);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:l}=o,u=ws(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const p=this.monitor.getSourceId(),m=this.sourceNodes.get(p),d=this.sourcePreviewNodes.get(p)||m;if(d){const{anchorX:g,anchorY:v,offsetX:y,offsetY:w}=this.getCurrentSourcePreviewNodeOptions(),h=t1(m,d,s,{anchorX:g,anchorY:v},{offsetX:y,offsetY:w});l.setDragImage(d,h.x,h.y)}}try{l==null||l.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(o.target);const{captureDraggingState:a}=this.getCurrentSourcePreviewNodeOptions();a?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(u)this.beginDragNativeItem(u);else{if(l&&!l.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=o=>{var i;if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()&&((i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(o.dataTransfer)),!this.enterLeaveCounter.enter(o.target)||this.monitor.isDragging())return;const{dataTransfer:s}=o,l=ws(s);l&&this.beginDragNativeItem(l,s)},this.handleTopDragEnter=o=>{const{dragEnterTargetIds:i}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=o.altKey,i.length>0&&this.actions.hover(i,{clientOffset:Eo(o)}),i.some(s=>this.monitor.canDropOnTarget(s))&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=o=>{var i;this.dragOverTargetIds=[],this.isDraggingNativeItem()&&((i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(o.dataTransfer))},this.handleTopDragOver=o=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return o.preventDefault(),void(o.dataTransfer&&(o.dataTransfer.dropEffect="none"));this.altKeyPressed=o.altKey,this.lastClientOffset=Eo(o),this.scheduleHover(i),(i||[]).some(s=>this.monitor.canDropOnTarget(s))?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=o=>{this.isDraggingNativeItem()&&o.preventDefault(),this.enterLeaveCounter.leave(o.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=o=>{var i;this.dropTargetIds=[],this.isDraggingNativeItem()?(o.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(o.dataTransfer)):ws(o.dataTransfer)&&o.preventDefault(),this.enterLeaveCounter.reset()},this.handleTopDrop=o=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:Eo(o)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=o=>{const i=o.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(o.preventDefault(),i.dragDrop()))},this.options=new class{get window(){return this.globalContext?this.globalContext:typeof window<"u"?window:void 0}get document(){var o;return!((o=this.globalContext)===null||o===void 0)&&o.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var o;return((o=this.optionsArgs)===null||o===void 0?void 0:o.rootElement)||this.window}constructor(o,i){this.ownerDocument=null,this.globalContext=o,this.optionsArgs=i}}(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Xg(this.isNodeInDocument)}}const o1=function(e,t,n){return new r1(e,t,n)};var Kt;(function(e){e.mouse="mouse",e.touch="touch",e.keyboard="keyboard"})(Kt||(Kt={}));class i1{get delay(){var t;return(t=this.args.delay)!==null&&t!==void 0?t:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var t;return(t=this.args.ignoreContextMenu)!==null&&t!==void 0&&t}get enableHoverOutsideTarget(){var t;return(t=this.args.enableHoverOutsideTarget)!==null&&t!==void 0&&t}get enableKeyboardEvents(){var t;return(t=this.args.enableKeyboardEvents)!==null&&t!==void 0&&t}get enableMouseEvents(){var t;return(t=this.args.enableMouseEvents)!==null&&t!==void 0&&t}get enableTouchEvents(){var t;return(t=this.args.enableTouchEvents)===null||t===void 0||t}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var t,n,r,o;return(o=(r=(t=this.args)===null||t===void 0?void 0:t.delayTouchStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&o!==void 0?o:0}get delayMouseStart(){var t,n,r,o;return(o=(r=(t=this.args)===null||t===void 0?void 0:t.delayMouseStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&o!==void 0?o:0}get window(){return this.context&&this.context.window?this.context.window:typeof window<"u"?window:void 0}get document(){var t;return!((t=this.context)===null||t===void 0)&&t.document?this.context.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.args)===null||t===void 0?void 0:t.rootElement)||this.document}constructor(t,n){this.args=t,this.context=n}}const s1=1,l1=0;function ks(e){return e.button===void 0||e.button===l1}function Gf(e){return!!e.targetTouches}function ui(e,t){return Gf(e)?function(n,r){return n.targetTouches.length===1?ui(n.targetTouches[0]):r&&n.touches.length===1&&n.touches[0].target===r.target?ui(n.touches[0]):void 0}(e,t):{x:e.clientX,y:e.clientY}}const rc=(()=>{let e=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get:()=>(e=!0,!0)}))}catch{}return e})(),ar={[Kt.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Kt.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Kt.keyboard]:{keydown:"keydown"}};class _r{profile(){var t;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((t=this.dragOverTargetIds)===null||t===void 0?void 0:t.length)||0}}get document(){return this.options.document}setup(){const t=this.options.rootElement;t&&(M(!_r.isSetUp,"Cannot have two Touch backends at the same time."),_r.isSetUp=!0,this.addEventListener(t,"start",this.getTopMoveStartHandler()),this.addEventListener(t,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(t,"move",this.handleTopMove),this.addEventListener(t,"move",this.handleTopMoveCapture,!0),this.addEventListener(t,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(t,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(t,"keydown",this.handleCancelOnEscape,!0))}teardown(){const t=this.options.rootElement;t&&(_r.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(t,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(t,"start",this.handleTopMoveStart),this.removeEventListener(t,"move",this.handleTopMoveCapture,!0),this.removeEventListener(t,"move",this.handleTopMove),this.removeEventListener(t,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(t,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(t,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(t,n,r,o=!1){const i=rc?{capture:o,passive:!1}:o;this.listenerTypes.forEach(function(s){const l=ar[s][n];l&&t.addEventListener(l,r,i)})}removeEventListener(t,n,r,o=!1){const i=rc?{capture:o,passive:!1}:o;this.listenerTypes.forEach(function(s){const l=ar[s][n];l&&t.removeEventListener(l,r,i)})}connectDragSource(t,n){const r=this.handleMoveStart.bind(this,t);return this.sourceNodes.set(t,n),this.addEventListener(n,"start",r),()=>{this.sourceNodes.delete(t),this.removeEventListener(n,"start",r)}}connectDragPreview(t,n,r){return this.sourcePreviewNodeOptions.set(t,r),this.sourcePreviewNodes.set(t,n),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDropTarget(t,n){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const o=i=>{if(!this.document||!r||!this.monitor.isDragging())return;let s;switch(i.type){case ar.mouse.move:s={x:i.clientX,y:i.clientY};break;case ar.touch.move:var l,u;s={x:((l=i.touches[0])===null||l===void 0?void 0:l.clientX)||0,y:((u=i.touches[0])===null||u===void 0?void 0:u.clientY)||0}}const a=s!=null?this.document.elementFromPoint(s.x,s.y):void 0,p=a&&n.contains(a);return a===n||p?this.handleMove(i,t):void 0};return this.addEventListener(this.document.body,"move",o),this.targetNodes.set(t,n),()=>{this.document&&(this.targetNodes.delete(t),this.removeEventListener(this.document.body,"move",o))}}getTopMoveStartHandler(){return this.options.delayTouchStart||this.options.delayMouseStart?this.handleTopMoveStartDelay:this.handleTopMoveStart}installSourceNodeRemovalObserver(t){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=t,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{t&&!t.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),t&&t.parentElement&&this.draggedSourceNodeRemovalObserver.observe(t.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(t,n,r){this.getSourceClientOffset=o=>{const i=this.sourceNodes.get(o);return i&&function(s){const l=s.nodeType===1?s:s.parentElement;if(!l)return;const{top:u,left:a}=l.getBoundingClientRect();return{x:a,y:u}}(i)},this.handleTopMoveStartCapture=o=>{ks(o)&&(this.moveStartSourceIds=[])},this.handleMoveStart=o=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(o)},this.handleTopMoveStart=o=>{if(!ks(o))return;const i=ui(o);i&&(Gf(o)&&(this.lastTargetTouchFallback=o.targetTouches[0]),this._mouseClientOffset=i),this.waitingForDelay=!1},this.handleTopMoveStartDelay=o=>{if(!ks(o))return;const i=o.type===ar.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,o),i),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(o,i)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(i)},this.handleTopMove=o=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:i,dragOverTargetIds:s}=this,l=this.options.enableHoverOutsideTarget,u=ui(o,this.lastTargetTouchFallback);if(!u)return;if(this._isScrolling||!this.monitor.isDragging()&&function(c,f,k,x,_){if(!_)return!1;const O=180*Math.atan2(x-f,k-c)/Math.PI+180;for(let T=0;T<_.length;++T){const j=_[T];if(j&&(j.start==null||O>=j.start)&&(j.end==null||O<=j.end))return!0}return!1}(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,u.x,u.y,this.options.scrollAngleRanges))return void(this._isScrolling=!0);var a,p,m,d;if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&i&&(a=this._mouseClientOffset.x||0,p=this._mouseClientOffset.y||0,m=u.x,d=u.y,Math.sqrt(Math.pow(Math.abs(m-a),2)+Math.pow(Math.abs(d-p),2))>(this.options.touchSlop?this.options.touchSlop:0))&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(i,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const g=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(g),this.actions.publishDragSource(),o.cancelable&&o.preventDefault();const v=(s||[]).map(c=>this.targetNodes.get(c)).filter(c=>!!c),y=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(u.x,u.y,v):this.document.elementsFromPoint(u.x,u.y),w=[];for(const c in y){if(!y.hasOwnProperty(c))continue;let f=y[c];for(f!=null&&w.push(f);f;)f=f.parentElement,f&&w.indexOf(f)===-1&&w.push(f)}const h=w.filter(c=>v.indexOf(c)>-1).map(c=>this._getDropTargetId(c)).filter(c=>!!c).filter((c,f,k)=>k.indexOf(c)===f);if(l)for(const c in this.targetNodes){const f=this.targetNodes.get(c);if(g&&f&&f.contains(g)&&h.indexOf(c)===-1){h.unshift(c);break}}h.reverse(),this.actions.hover(h,{clientOffset:u})},this._getDropTargetId=o=>{const i=this.targetNodes.keys();let s=i.next();for(;s.done===!1;){const l=s.value;if(o===this.targetNodes.get(l))return l;s=i.next()}},this.handleTopMoveEndCapture=o=>{this._isScrolling=!1,this.lastTargetTouchFallback=void 0,function(i){return i.buttons===void 0||(i.buttons&s1)==0}(o)&&(this.monitor.isDragging()&&!this.monitor.didDrop()?(o.cancelable&&o.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()):this.moveStartSourceIds=void 0)},this.handleCancelOnEscape=o=>{o.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new i1(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Kt.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Kt.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Kt.keyboard)}}const u1=function(e,t={},n={}){return new _r(e,t,n)},Wr="abcdefgh".split(""),bo={a8:"bR",b8:"bN",c8:"bB",d8:"bQ",e8:"bK",f8:"bB",g8:"bN",h8:"bR",a7:"bP",b7:"bP",c7:"bP",d7:"bP",e7:"bP",f7:"bP",g7:"bP",h7:"bP",a2:"wP",b2:"wP",c2:"wP",d2:"wP",e2:"wP",f2:"wP",g2:"wP",h2:"wP",a1:"wR",b1:"wN",c1:"wB",d1:"wQ",e1:"wK",f1:"wB",g1:"wN",h1:"wR"},a1={a:0,b:1,c:2,d:3,e:4,f:5,g:6,h:7},c1={a:7,b:6,c:5,d:4,e:3,f:2,g:1,h:0},d1=[7,6,5,4,3,2,1,0],f1=[0,1,2,3,4,5,6,7],oc={wP:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"45",height:"45"},{children:S.jsx("path",{d:"m 22.5,9 c -2.21,0 -4,1.79 -4,4 0,0.89 0.29,1.71 0.78,2.38 C 17.33,16.5 16,18.59 16,21 c 0,2.03 0.94,3.84 2.41,5.03 C 15.41,27.09 11,31.58 11,39.5 H 34 C 34,31.58 29.59,27.09 26.59,26.03 28.06,24.84 29,23.03 29,21 29,18.59 27.67,16.5 25.72,15.38 26.21,14.71 26.5,13.89 26.5,13 c 0,-2.21 -1.79,-4 -4,-4 z",style:{opacity:"1",fill:"#ffffff",fillOpacity:"1",fillRule:"nonzero",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"miter",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"}})})),wR:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"45",height:"45"},{children:S.jsxs("g",Object.assign({style:{opacity:"1",fill:"#ffffff",fillOpacity:"1",fillRule:"evenodd",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"}},{children:[S.jsx("path",{d:"M 9,39 L 36,39 L 36,36 L 9,36 L 9,39 z ",style:{strokeLinecap:"butt"}}),S.jsx("path",{d:"M 12,36 L 12,32 L 33,32 L 33,36 L 12,36 z ",style:{strokeLinecap:"butt"}}),S.jsx("path",{d:"M 11,14 L 11,9 L 15,9 L 15,11 L 20,11 L 20,9 L 25,9 L 25,11 L 30,11 L 30,9 L 34,9 L 34,14",style:{strokeLinecap:"butt"}}),S.jsx("path",{d:"M 34,14 L 31,17 L 14,17 L 11,14"}),S.jsx("path",{d:"M 31,17 L 31,29.5 L 14,29.5 L 14,17",style:{strokeLinecap:"butt",strokeLinejoin:"miter"}}),S.jsx("path",{d:"M 31,29.5 L 32.5,32 L 12.5,32 L 14,29.5"}),S.jsx("path",{d:"M 11,14 L 34,14",style:{fill:"none",stroke:"#000000",strokeLinejoin:"miter"}})]}))})),wN:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"45",height:"45"},{children:S.jsxs("g",Object.assign({style:{opacity:"1",fill:"none",fillOpacity:"1",fillRule:"evenodd",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"}},{children:[S.jsx("path",{d:"M 22,10 C 32.5,11 38.5,18 38,39 L 15,39 C 15,30 25,32.5 23,18",style:{fill:"#ffffff",stroke:"#000000"}}),S.jsx("path",{d:"M 24,18 C 24.38,20.91 18.45,25.37 16,27 C 13,29 13.18,31.34 11,31 C 9.958,30.06 12.41,27.96 11,28 C 10,28 11.19,29.23 10,30 C 9,30 5.997,31 6,26 C 6,24 12,14 12,14 C 12,14 13.89,12.1 14,10.5 C 13.27,9.506 13.5,8.5 13.5,7.5 C 14.5,6.5 16.5,10 16.5,10 L 18.5,10 C 18.5,10 19.28,8.008 21,7 C 22,7 22,10 22,10",style:{fill:"#ffffff",stroke:"#000000"}}),S.jsx("path",{d:"M 9.5 25.5 A 0.5 0.5 0 1 1 8.5,25.5 A 0.5 0.5 0 1 1 9.5 25.5 z",style:{fill:"#000000",stroke:"#000000"}}),S.jsx("path",{d:"M 15 15.5 A 0.5 1.5 0 1 1 14,15.5 A 0.5 1.5 0 1 1 15 15.5 z",transform:"matrix(0.866,0.5,-0.5,0.866,9.693,-5.173)",style:{fill:"#000000",stroke:"#000000"}})]}))})),wB:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"45",height:"45"},{children:S.jsxs("g",Object.assign({style:{opacity:"1",fill:"none",fillRule:"evenodd",fillOpacity:"1",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"}},{children:[S.jsxs("g",Object.assign({style:{fill:"#ffffff",stroke:"#000000",strokeLinecap:"butt"}},{children:[S.jsx("path",{d:"M 9,36 C 12.39,35.03 19.11,36.43 22.5,34 C 25.89,36.43 32.61,35.03 36,36 C 36,36 37.65,36.54 39,38 C 38.32,38.97 37.35,38.99 36,38.5 C 32.61,37.53 25.89,38.96 22.5,37.5 C 19.11,38.96 12.39,37.53 9,38.5 C 7.65,38.99 6.68,38.97 6,38 C 7.35,36.54 9,36 9,36 z"}),S.jsx("path",{d:"M 15,32 C 17.5,34.5 27.5,34.5 30,32 C 30.5,30.5 30,30 30,30 C 30,27.5 27.5,26 27.5,26 C 33,24.5 33.5,14.5 22.5,10.5 C 11.5,14.5 12,24.5 17.5,26 C 17.5,26 15,27.5 15,30 C 15,30 14.5,30.5 15,32 z"}),S.jsx("path",{d:"M 25 8 A 2.5 2.5 0 1 1 20,8 A 2.5 2.5 0 1 1 25 8 z"})]})),S.jsx("path",{d:"M 17.5,26 L 27.5,26 M 15,30 L 30,30 M 22.5,15.5 L 22.5,20.5 M 20,18 L 25,18",style:{fill:"none",stroke:"#000000",strokeLinejoin:"miter"}})]}))})),wQ:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"45",height:"45"},{children:S.jsxs("g",Object.assign({style:{fill:"#ffffff",stroke:"#000000",strokeWidth:"1.5",strokeLinejoin:"round"}},{children:[S.jsx("path",{d:"M 9,26 C 17.5,24.5 30,24.5 36,26 L 38.5,13.5 L 31,25 L 30.7,10.9 L 25.5,24.5 L 22.5,10 L 19.5,24.5 L 14.3,10.9 L 14,25 L 6.5,13.5 L 9,26 z"}),S.jsx("path",{d:"M 9,26 C 9,28 10.5,28 11.5,30 C 12.5,31.5 12.5,31 12,33.5 C 10.5,34.5 11,36 11,36 C 9.5,37.5 11,38.5 11,38.5 C 17.5,39.5 27.5,39.5 34,38.5 C 34,38.5 35.5,37.5 34,36 C 34,36 34.5,34.5 33,33.5 C 32.5,31 32.5,31.5 33.5,30 C 34.5,28 36,28 36,26 C 27.5,24.5 17.5,24.5 9,26 z"}),S.jsx("path",{d:"M 11.5,30 C 15,29 30,29 33.5,30",style:{fill:"none"}}),S.jsx("path",{d:"M 12,33.5 C 18,32.5 27,32.5 33,33.5",style:{fill:"none"}}),S.jsx("circle",{cx:"6",cy:"12",r:"2"}),S.jsx("circle",{cx:"14",cy:"9",r:"2"}),S.jsx("circle",{cx:"22.5",cy:"8",r:"2"}),S.jsx("circle",{cx:"31",cy:"9",r:"2"}),S.jsx("circle",{cx:"39",cy:"12",r:"2"})]}))})),wK:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"45",height:"45"},{children:S.jsxs("g",Object.assign({style:{fill:"none",fillOpacity:"1",fillRule:"evenodd",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"}},{children:[S.jsx("path",{d:"M 22.5,11.63 L 22.5,6",style:{fill:"none",stroke:"#000000",strokeLinejoin:"miter"}}),S.jsx("path",{d:"M 20,8 L 25,8",style:{fill:"none",stroke:"#000000",strokeLinejoin:"miter"}}),S.jsx("path",{d:"M 22.5,25 C 22.5,25 27,17.5 25.5,14.5 C 25.5,14.5 24.5,12 22.5,12 C 20.5,12 19.5,14.5 19.5,14.5 C 18,17.5 22.5,25 22.5,25",style:{fill:"#ffffff",stroke:"#000000",strokeLinecap:"butt",strokeLinejoin:"miter"}}),S.jsx("path",{d:"M 12.5,37 C 18,40.5 27,40.5 32.5,37 L 32.5,30 C 32.5,30 41.5,25.5 38.5,19.5 C 34.5,13 25,16 22.5,23.5 L 22.5,27 L 22.5,23.5 C 20,16 10.5,13 6.5,19.5 C 3.5,25.5 12.5,30 12.5,30 L 12.5,37",style:{fill:"#ffffff",stroke:"#000000"}}),S.jsx("path",{d:"M 12.5,30 C 18,27 27,27 32.5,30",style:{fill:"none",stroke:"#000000"}}),S.jsx("path",{d:"M 12.5,33.5 C 18,30.5 27,30.5 32.5,33.5",style:{fill:"none",stroke:"#000000"}}),S.jsx("path",{d:"M 12.5,37 C 18,34 27,34 32.5,37",style:{fill:"none",stroke:"#000000"}})]}))})),bP:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"45",height:"45"},{children:S.jsx("path",{d:"m 22.5,9 c -2.21,0 -4,1.79 -4,4 0,0.89 0.29,1.71 0.78,2.38 C 17.33,16.5 16,18.59 16,21 c 0,2.03 0.94,3.84 2.41,5.03 C 15.41,27.09 11,31.58 11,39.5 H 34 C 34,31.58 29.59,27.09 26.59,26.03 28.06,24.84 29,23.03 29,21 29,18.59 27.67,16.5 25.72,15.38 26.21,14.71 26.5,13.89 26.5,13 c 0,-2.21 -1.79,-4 -4,-4 z",style:{opacity:"1",fill:"#000000",fillOpacity:"1",fillRule:"nonzero",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"miter",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"}})})),bR:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"45",height:"45"},{children:S.jsxs("g",Object.assign({style:{opacity:"1",fill:"#000000",fillOpacity:"1",fillRule:"evenodd",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"}},{children:[S.jsx("path",{d:"M 9,39 L 36,39 L 36,36 L 9,36 L 9,39 z ",style:{strokeLinecap:"butt"}}),S.jsx("path",{d:"M 12.5,32 L 14,29.5 L 31,29.5 L 32.5,32 L 12.5,32 z ",style:{strokeLinecap:"butt"}}),S.jsx("path",{d:"M 12,36 L 12,32 L 33,32 L 33,36 L 12,36 z ",style:{strokeLinecap:"butt"}}),S.jsx("path",{d:"M 14,29.5 L 14,16.5 L 31,16.5 L 31,29.5 L 14,29.5 z ",style:{strokeLinecap:"butt",strokeLinejoin:"miter"}}),S.jsx("path",{d:"M 14,16.5 L 11,14 L 34,14 L 31,16.5 L 14,16.5 z ",style:{strokeLinecap:"butt"}}),S.jsx("path",{d:"M 11,14 L 11,9 L 15,9 L 15,11 L 20,11 L 20,9 L 25,9 L 25,11 L 30,11 L 30,9 L 34,9 L 34,14 L 11,14 z ",style:{strokeLinecap:"butt"}}),S.jsx("path",{d:"M 12,35.5 L 33,35.5 L 33,35.5",style:{fill:"none",stroke:"#ffffff",strokeWidth:"1",strokeLinejoin:"miter"}}),S.jsx("path",{d:"M 13,31.5 L 32,31.5",style:{fill:"none",stroke:"#ffffff",strokeWidth:"1",strokeLinejoin:"miter"}}),S.jsx("path",{d:"M 14,29.5 L 31,29.5",style:{fill:"none",stroke:"#ffffff",strokeWidth:"1",strokeLinejoin:"miter"}}),S.jsx("path",{d:"M 14,16.5 L 31,16.5",style:{fill:"none",stroke:"#ffffff",strokeWidth:"1",strokeLinejoin:"miter"}}),S.jsx("path",{d:"M 11,14 L 34,14",style:{fill:"none",stroke:"#ffffff",strokeWidth:"1",strokeLinejoin:"miter"}})]}))})),bN:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"45",height:"45"},{children:S.jsxs("g",Object.assign({style:{opacity:"1",fill:"none",fillOpacity:"1",fillRule:"evenodd",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"}},{children:[S.jsx("path",{d:"M 22,10 C 32.5,11 38.5,18 38,39 L 15,39 C 15,30 25,32.5 23,18",style:{fill:"#000000",stroke:"#000000"}}),S.jsx("path",{d:"M 24,18 C 24.38,20.91 18.45,25.37 16,27 C 13,29 13.18,31.34 11,31 C 9.958,30.06 12.41,27.96 11,28 C 10,28 11.19,29.23 10,30 C 9,30 5.997,31 6,26 C 6,24 12,14 12,14 C 12,14 13.89,12.1 14,10.5 C 13.27,9.506 13.5,8.5 13.5,7.5 C 14.5,6.5 16.5,10 16.5,10 L 18.5,10 C 18.5,10 19.28,8.008 21,7 C 22,7 22,10 22,10",style:{fill:"#000000",stroke:"#000000"}}),S.jsx("path",{d:"M 9.5 25.5 A 0.5 0.5 0 1 1 8.5,25.5 A 0.5 0.5 0 1 1 9.5 25.5 z",style:{fill:"#ffffff",stroke:"#ffffff"}}),S.jsx("path",{d:"M 15 15.5 A 0.5 1.5 0 1 1 14,15.5 A 0.5 1.5 0 1 1 15 15.5 z",transform:"matrix(0.866,0.5,-0.5,0.866,9.693,-5.173)",style:{fill:"#ffffff",stroke:"#ffffff"}}),S.jsx("path",{d:"M 24.55,10.4 L 24.1,11.85 L 24.6,12 C 27.75,13 30.25,14.49 32.5,18.75 C 34.75,23.01 35.75,29.06 35.25,39 L 35.2,39.5 L 37.45,39.5 L 37.5,39 C 38,28.94 36.62,22.15 34.25,17.66 C 31.88,13.17 28.46,11.02 25.06,10.5 L 24.55,10.4 z ",style:{fill:"#ffffff",stroke:"none"}})]}))})),bB:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"45",height:"45"},{children:S.jsxs("g",Object.assign({style:{opacity:"1",fill:"none",fillRule:"evenodd",fillOpacity:"1",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"}},{children:[S.jsxs("g",Object.assign({style:{fill:"#000000",stroke:"#000000",strokeLinecap:"butt"}},{children:[S.jsx("path",{d:"M 9,36 C 12.39,35.03 19.11,36.43 22.5,34 C 25.89,36.43 32.61,35.03 36,36 C 36,36 37.65,36.54 39,38 C 38.32,38.97 37.35,38.99 36,38.5 C 32.61,37.53 25.89,38.96 22.5,37.5 C 19.11,38.96 12.39,37.53 9,38.5 C 7.65,38.99 6.68,38.97 6,38 C 7.35,36.54 9,36 9,36 z"}),S.jsx("path",{d:"M 15,32 C 17.5,34.5 27.5,34.5 30,32 C 30.5,30.5 30,30 30,30 C 30,27.5 27.5,26 27.5,26 C 33,24.5 33.5,14.5 22.5,10.5 C 11.5,14.5 12,24.5 17.5,26 C 17.5,26 15,27.5 15,30 C 15,30 14.5,30.5 15,32 z"}),S.jsx("path",{d:"M 25 8 A 2.5 2.5 0 1 1 20,8 A 2.5 2.5 0 1 1 25 8 z"})]})),S.jsx("path",{d:"M 17.5,26 L 27.5,26 M 15,30 L 30,30 M 22.5,15.5 L 22.5,20.5 M 20,18 L 25,18",style:{fill:"none",stroke:"#ffffff",strokeLinejoin:"miter"}})]}))})),bQ:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"45",height:"45"},{children:S.jsxs("g",Object.assign({style:{fill:"#000000",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}},{children:[S.jsx("path",{d:"M 9,26 C 17.5,24.5 30,24.5 36,26 L 38.5,13.5 L 31,25 L 30.7,10.9 L 25.5,24.5 L 22.5,10 L 19.5,24.5 L 14.3,10.9 L 14,25 L 6.5,13.5 L 9,26 z",style:{strokeLinecap:"butt",fill:"#000000"}}),S.jsx("path",{d:"m 9,26 c 0,2 1.5,2 2.5,4 1,1.5 1,1 0.5,3.5 -1.5,1 -1,2.5 -1,2.5 -1.5,1.5 0,2.5 0,2.5 6.5,1 16.5,1 23,0 0,0 1.5,-1 0,-2.5 0,0 0.5,-1.5 -1,-2.5 -0.5,-2.5 -0.5,-2 0.5,-3.5 1,-2 2.5,-2 2.5,-4 -8.5,-1.5 -18.5,-1.5 -27,0 z"}),S.jsx("path",{d:"M 11.5,30 C 15,29 30,29 33.5,30"}),S.jsx("path",{d:"m 12,33.5 c 6,-1 15,-1 21,0"}),S.jsx("circle",{cx:"6",cy:"12",r:"2"}),S.jsx("circle",{cx:"14",cy:"9",r:"2"}),S.jsx("circle",{cx:"22.5",cy:"8",r:"2"}),S.jsx("circle",{cx:"31",cy:"9",r:"2"}),S.jsx("circle",{cx:"39",cy:"12",r:"2"}),S.jsx("path",{d:"M 11,38.5 A 35,35 1 0 0 34,38.5",style:{fill:"none",stroke:"#000000",strokeLinecap:"butt"}}),S.jsxs("g",Object.assign({style:{fill:"none",stroke:"#ffffff"}},{children:[S.jsx("path",{d:"M 11,29 A 35,35 1 0 1 34,29"}),S.jsx("path",{d:"M 12.5,31.5 L 32.5,31.5"}),S.jsx("path",{d:"M 11.5,34.5 A 35,35 1 0 0 33.5,34.5"}),S.jsx("path",{d:"M 10.5,37.5 A 35,35 1 0 0 34.5,37.5"})]}))]}))})),bK:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"45",height:"45"},{children:S.jsxs("g",Object.assign({style:{fill:"none",fillOpacity:"1",fillRule:"evenodd",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"}},{children:[S.jsx("path",{d:"M 22.5,11.63 L 22.5,6",style:{fill:"none",stroke:"#000000",strokeLinejoin:"miter"},id:"path6570"}),S.jsx("path",{d:"M 22.5,25 C 22.5,25 27,17.5 25.5,14.5 C 25.5,14.5 24.5,12 22.5,12 C 20.5,12 19.5,14.5 19.5,14.5 C 18,17.5 22.5,25 22.5,25",style:{fill:"#000000",fillOpacity:"1",strokeLinecap:"butt",strokeLinejoin:"miter"}}),S.jsx("path",{d:"M 12.5,37 C 18,40.5 27,40.5 32.5,37 L 32.5,30 C 32.5,30 41.5,25.5 38.5,19.5 C 34.5,13 25,16 22.5,23.5 L 22.5,27 L 22.5,23.5 C 20,16 10.5,13 6.5,19.5 C 3.5,25.5 12.5,30 12.5,30 L 12.5,37",style:{fill:"#000000",stroke:"#000000"}}),S.jsx("path",{d:"M 20,8 L 25,8",style:{fill:"none",stroke:"#000000",strokeLinejoin:"miter"}}),S.jsx("path",{d:"M 32,29.5 C 32,29.5 40.5,25.5 38.03,19.85 C 34.15,14 25,18 22.5,24.5 L 22.5,26.6 L 22.5,24.5 C 20,18 10.85,14 6.97,19.85 C 4.5,25.5 13,29.5 13,29.5",style:{fill:"none",stroke:"#ffffff"}}),S.jsx("path",{d:"M 12.5,30 C 18,27 27,27 32.5,30 M 12.5,33.5 C 18,30.5 27,30.5 32.5,33.5 M 12.5,37 C 18,34 27,34 32.5,37",style:{fill:"none",stroke:"#ffffff"}})]}))}))};function El(e,t,n){const r=t/8,o=e==="white"?d1:f1;return{x:(e==="white"?a1:c1)[n[0]]*r+r/2,y:o[parseInt(n[1],10)-1]*r+r/2}}function ic(e){let t=!1;return Object.keys(bo).forEach(n=>{e[n]!==bo[n]&&(t=!0)}),Object.keys(e).forEach(n=>{bo[n]!==e[n]&&(t=!0)}),t}function sc(e){return e==="start"?bo:typeof e=="string"?function(t){if(!function(i){i=i.replace(/ .+$/,""),i=function(l){return l.replace(/8/g,"11111111").replace(/7/g,"1111111").replace(/6/g,"111111").replace(/5/g,"11111").replace(/4/g,"1111").replace(/3/g,"111").replace(/2/g,"11")}(i);const s=i.split("/");if(s.length!==8)return!1;for(let l=0;l<8;l++)if(s[l].length!==8||s[l].search(/[^kqrnbpKQRNBP1]/)!==-1)return!1;return!0}(t))return{};const n=(t=t.replace(/ .+$/,"")).split("/"),r={};let o=8;for(let i=0;i<8;i++){const s=n[i].split("");let l=0;for(let u=0;u<s.length;u++)s[u].search(/[1-8]/)!==-1?l+=parseInt(s[u],10):(r[Wr[l]+o]=h1(s[u]),l+=1);o-=1}return r}(e):e}function h1(e){return e.toLowerCase()===e?"b"+e.toUpperCase():"w"+e.toUpperCase()}const Yf=C.createContext({}),xt=()=>C.useContext(Yf),p1=C.forwardRef(({animationDuration:e=300,areArrowsAllowed:t=!0,arePiecesDraggable:n=!0,arePremovesAllowed:r=!1,boardOrientation:o="white",boardWidth:i,children:s,clearPremovesOnRightClick:l=!0,customArrows:u,customArrowColor:a="rgb(255,170,0)",customBoardStyle:p,customDarkSquareStyle:m={backgroundColor:"#B58863"},customDropSquareStyle:d={boxShadow:"inset 0 0 1px 6px rgba(255,255,255,0.75)"},customLightSquareStyle:g={backgroundColor:"#F0D9B5"},customPieces:v,customPremoveDarkSquareStyle:y={backgroundColor:"#A42323"},customPremoveLightSquareStyle:w={backgroundColor:"#BD2828"},customSquare:h="div",customSquareStyles:c,dropOffBoardAction:f="snapback",id:k=0,isDraggablePiece:x=()=>!0,getPositionObject:_=()=>{},onArrowsChange:O=()=>{},onDragOverSquare:T=()=>{},onMouseOutSquare:j=()=>{},onMouseOverSquare:I=()=>{},onPieceClick:re=()=>{},onPieceDragBegin:he=()=>{},onPieceDragEnd:Se=()=>{},onPieceDrop:Pe=()=>!0,onPromotionCheck:Zt=($e,Ot,Xr)=>(Xr==="wP"&&$e[1]==="7"&&Ot[1]==="8"||Xr==="bP"&&$e[1]==="2"&&Ot[1]==="1")&&Math.abs($e.charCodeAt(0)-Ot.charCodeAt(0))<=1,onPromotionPieceSelect:en,onSquareClick:tn=()=>{},onSquareRightClick:D=()=>{},position:L="start",promotionDialogVariant:R="default",promotionToSquare:U=null,showBoardNotation:Y=!0,showPromotionDialog:lt=!1,snapToCursor:b=!0,autoPromoteToQueen:_t=!1},Je)=>{const[$e,Ot]=C.useState(sc(L)),[Xr,rh]=C.useState({removed:{},added:{}}),[Di,wn]=C.useState(void 0),[oh,Pi]=C.useState(lt&&!_t),[ih,_u]=C.useState(null),[sh,Ii]=C.useState(U),[Ou,ji]=C.useState([]),Tt=C.useRef(Ou),[Li,Jr]=C.useState(),[lh,uh]=C.useState(Object.assign(Object.assign({},oc),v)),[ah,Ni]=C.useState(!1),[Mi,ch]=C.useState(),[Zr,eo]=C.useState(!1);C.useImperativeHandle(Je,()=>({clearPremoves(B=!0){to(B)}})),C.useEffect(()=>{uh(Object.assign(Object.assign({},oc),v))},[v]),C.useEffect(()=>{Pi(lt),Ii(U)},[U,lt]),C.useEffect(()=>{var B,oe,ae;bi();const Fe=sc(L),Ze=function(He,Dt){const Zn={removed:{},added:{}};return Object.keys(He).forEach(Ie=>{Dt[Ie]!==He[Ie]&&(Zn.removed[Ie]=He[Ie])}),Object.keys(Dt).forEach(Ie=>{He[Ie]!==Dt[Ie]&&(Zn.added[Ie]=Dt[Ie])}),Zn}($e,Fe),Ue=((B=Object.keys(Ze.added))===null||B===void 0?void 0:B.length)<=2?(ae=(oe=Object.entries(Ze.added))===null||oe===void 0?void 0:oe[0])===null||ae===void 0?void 0:ae[1][0]:void 0;if(Zr)Ot(Fe),eo(!1),r&&Ai(Ue),Mi&&clearTimeout(Mi);else if(ah)Ot(Fe),eo(!1),r&&Ai(Ue);else{ic(Fe)&&Di!==void 0?wn(Ue):ic(Fe)?wn(void 0):wn("b"),rh(Ze),eo(!0);const He=setTimeout(()=>{Ot(Fe),eo(!1),r&&Ai(Ue)},e);ch(He)}return Ni(!1),_(Fe),Ri(),()=>{clearTimeout(Mi)}},[L]);const{arrows:dh,newArrow:fh,clearArrows:Ri,drawNewArrow:hh,onArrowDrawEnd:ph}=((B,oe=!0,ae,Fe)=>{const[Ze,Ue]=C.useState([]),[He,Dt]=C.useState([]),[Zn,Ie]=C.useState();C.useEffect(()=>{Array.isArray(B)&&Ue(B==null?void 0:B.filter(ht=>ht[0]!==ht[1]))},[B]),C.useEffect(()=>{ae==null||ae(He)},[He]);const Tu=[...He,...Ze];return{arrows:Tu,newArrow:Zn,clearArrows:function(){Dt([]),Ie(void 0)},drawNewArrow:(ht,kn)=>{oe&&Ie([ht,kn,Fe])},setArrows:Dt,onArrowDrawEnd:(ht,kn)=>{if(ht===kn)return;let Du;const mh=[ht,kn,Fe];Du=Tu.every(([zi,$i])=>!(zi===ht&&$i===kn))?[...He,mh]:He.filter(([zi,$i])=>!(zi===ht&&$i===kn)),Ie(void 0),Dt(Du)}}})(u,t,O,a);function Ai(B){if(Tt.current.length===0)return;const oe=Tt.current[0];if(oe.piece[0]!==void 0&&oe.piece[0]!==B&&Pe.length)if(wn(oe.piece[0]),Ni(!0),Pe(oe.sourceSq,oe.targetSq,oe.piece)){const ae=[...Tt.current];ae.shift(),Tt.current=ae,ji([...ae])}else to()}function to(B=!0){B&&wn(void 0),Tt.current=[],ji([])}function bi(){_u(null),Ii(null),Pi(!1)}const gh={animationDuration:e,arePiecesDraggable:n,arePremovesAllowed:r,boardOrientation:o,boardWidth:i,customArrowColor:a,customBoardStyle:p,customDarkSquareStyle:m,customDropSquareStyle:d,customLightSquareStyle:g,customPremoveDarkSquareStyle:y,customPremoveLightSquareStyle:w,customSquare:h,customSquareStyles:c,id:k,isDraggablePiece:x,onDragOverSquare:T,onMouseOutSquare:j,onMouseOverSquare:I,onPieceClick:re,onPieceDragBegin:he,onPieceDragEnd:Se,onPieceDrop:Pe,onPromotionCheck:Zt,onPromotionPieceSelect:en,onSquareClick:tn,showBoardNotation:Y,snapToCursor:b,promotionDialogVariant:R,arrows:dh,newArrow:fh,onArrowDrawEnd:ph,chessPieces:lh,clearArrows:Ri,drawNewArrow:hh,clearCurrentRightClickDown:function(){Jr(void 0)},currentPosition:$e,handleSetPosition:function(B,oe,ae,Fe){if(B===oe)return;if(Ri(),r&&Zr||r&&(Di===ae[0]||Tt.current.filter(Ue=>Ue.piece[0]===ae[0]).length>0)){const Ue=[...Tt.current];return Ue.push({sourceSq:B,targetSq:oe,piece:ae}),Tt.current=Ue,ji([...Ue]),void bi()}if(!r&&Zr)return;const Ze=Object.assign({},$e);Ni(!!Fe),wn(ae[0]),Pe.length?Pe(B,oe,ae)||to():(f!=="trash"||oe||delete Ze[B],delete Ze[B],Ze[oe]=ae,Ot(Ze)),bi(),_(Ze)},isWaitingForAnimation:Zr,lastPieceColour:Di,onRightClickDown:function(B){Jr(B)},onRightClickUp:function(B){if(Li){if(Li===B)return Jr(void 0),l&&to(!1),void D(B)}else Jr(void 0)},positionDifferences:Xr,promoteFromSquare:ih,promoteToSquare:sh,premoves:Ou,setPromoteFromSquare:_u,setPromoteToSquare:Ii,setShowPromoteDialog:Pi,showPromoteDialog:oh,autoPromoteToQueen:_t,currentRightClickDown:Li};return S.jsx(Yf.Provider,Object.assign({value:gh},{children:s}))});function g1({row:e,col:t}){const{boardOrientation:n,boardWidth:r,customDarkSquareStyle:o,customLightSquareStyle:i}=xt(),s=i.backgroundColor,l=o.backgroundColor,u=t===0,a=e===7;function p(){return n==="white"?8-e:e+1}function m(){return n==="black"?Wr[7-t]:Wr[t]}return u&&a?S.jsxs(S.Fragment,{children:[S.jsx("div",Object.assign({style:Object.assign(Object.assign({zIndex:3,position:"absolute"},{color:s}),uc(r))},{children:p()})),S.jsx("div",Object.assign({style:Object.assign(Object.assign({zIndex:3,position:"absolute"},{color:s}),lc(r))},{children:m()}))]}):a?S.jsx("div",Object.assign({style:Object.assign(Object.assign({userSelect:"none",zIndex:3,position:"absolute"},{color:t%2!=0?l:s}),lc(r))},{children:m()})):u?S.jsx("div",Object.assign({style:Object.assign(Object.assign({userSelect:"none",zIndex:3,position:"absolute"},{color:e%2==0?l:s}),uc(r))},{children:p()})):null}const lc=e=>({alignSelf:"flex-end",paddingLeft:e/8-e/48,fontSize:e/48}),uc=e=>({alignSelf:"flex-start",paddingRight:e/8-e/48,fontSize:e/48});function ac({isPremovedPiece:e=!1,piece:t,square:n,squares:r}){const{animationDuration:o,arePiecesDraggable:i,arePremovesAllowed:s,boardWidth:l,boardOrientation:u,chessPieces:a,currentPosition:p,id:m,isDraggablePiece:d,isWaitingForAnimation:g,onPieceClick:v,onPieceDragBegin:y,onPieceDragEnd:w,positionDifferences:h,premoves:c}=xt(),[f,k]=C.useState({opacity:1,zIndex:5,touchAction:"none",cursor:i&&d({piece:t,sourceSquare:n})?"-webkit-grab":"default"}),[{canDrag:x,isDragging:_},O,T]=Qg(()=>({type:"piece",item:()=>(y(t,n),{piece:t,square:n,id:m}),end:()=>w(t,n),collect:j=>({canDrag:d({piece:t,sourceSquare:n}),isDragging:!!j.isDragging()})}),[t,n,p,m]);return T((Co||(Co=new Image,Co.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Co),{captureDraggingState:!0}),C.useEffect(()=>{k(j=>Object.assign(Object.assign({},j),{opacity:_?0:1}))},[_]),C.useEffect(()=>{if(!s)return;let j=!1;!e&&c.find(I=>I.targetSq===n)&&(j=!0),c.find(I=>I.sourceSq===n&&I.piece===t)&&(j=!0),k(I=>Object.assign(Object.assign({},I),{display:j?"none":"unset"}))},[p,c]),C.useEffect(()=>{var j;const I=(j=h.removed)===null||j===void 0?void 0:j[n];if(!h.added)return;const re=Object.entries(h.added).find(([he,Se])=>Se===I||(I==null?void 0:I[1])==="P"&&(he[1]==="1"||he[1]==="8"));if(g&&I&&re&&!e){const he=n,Se=re[0];if(he&&Se){const Pe=l/8;k(Zt=>Object.assign(Object.assign({},Zt),{transform:`translate(${(u==="black"?-1:1)*(Se.charCodeAt(0)-he.charCodeAt(0))*Pe}px, ${(u==="black"?-1:1)*(Number(he[1])-Number(Se[1]))*Pe}px)`,transition:`transform ${o}ms`,zIndex:6}))}}},[h]),C.useEffect(()=>{const{sourceSq:j}={sourceSq:r[n]};j&&k(I=>Object.assign(Object.assign({},I),{transform:"translate(0px, 0px)",transition:"transform 0ms"}))},[p]),C.useEffect(()=>{k(j=>Object.assign(Object.assign({},j),{cursor:i&&d({piece:t,sourceSquare:n})?"-webkit-grab":"default"}))},[n,p,i]),S.jsx("div",Object.assign({ref:i&&x?O:null,onClick:()=>v(t),"data-piece":t,style:f},{children:typeof a[t]=="function"?a[t]({squareWidth:l/8,isDragging:_,square:n}):S.jsx("svg",Object.assign({viewBox:"1 1 43 43",width:l/8,height:l/8},{children:S.jsx("g",{children:a[t]})}))}))}function m1({square:e,squareColor:t,setSquares:n,squareHasPremove:r,children:o}){const i=C.useRef(null),{autoPromoteToQueen:s,boardWidth:l,boardOrientation:u,clearArrows:a,currentPosition:p,currentRightClickDown:m,customBoardStyle:d,customDarkSquareStyle:g,customDropSquareStyle:v,customLightSquareStyle:y,customPremoveDarkSquareStyle:w,customPremoveLightSquareStyle:h,customSquare:c,customSquareStyles:f,drawNewArrow:k,handleSetPosition:x,isWaitingForAnimation:_,lastPieceColour:O,onArrowDrawEnd:T,onDragOverSquare:j,onMouseOutSquare:I,onMouseOverSquare:re,onPieceDrop:he,onPromotionCheck:Se,onRightClickDown:Pe,onRightClickUp:Zt,onSquareClick:en,setPromoteFromSquare:tn,setPromoteToSquare:D,setShowPromoteDialog:L}=xt(),[{isOver:R},U]=Yg(()=>({accept:"piece",drop:Y,collect:b=>({isOver:!!b.isOver()})}),[e,p,he,_,O]);function Y(b){Se(b.square,e,b.piece)?s?x(b.square,e,b.piece[0]==="w"?"wQ":"bQ"):(tn(b.square),D(e),L(!0)):x(b.square,e,b.piece,!0)}C.useEffect(()=>{if(i.current){const{x:b,y:_t}=i.current.getBoundingClientRect();n(Je=>Object.assign(Object.assign({},Je),{[e]:{x:b,y:_t}}))}},[l,u]);const lt=Object.assign(Object.assign(Object.assign(Object.assign({},v1(e,u,d)),t==="black"?g:y),r&&(t==="black"?w:h)),R&&v);return S.jsx("div",Object.assign({ref:U,style:lt,"data-square-color":t,"data-square":e,onMouseOver:b=>{b.buttons===2&&m&&k(m,e),b.relatedTarget&&b.currentTarget.contains(b.relatedTarget)||re(e)},onMouseOut:b=>{b.relatedTarget&&b.currentTarget.contains(b.relatedTarget)||I(e)},onMouseDown:b=>{b.button===2&&Pe(e)},onMouseUp:b=>{b.button===2&&(m&&T(m,e),Zt(e))},onDragEnter:()=>j(e),onClick:()=>{en(e),a()},onContextMenu:b=>{b.preventDefault()}},{children:S.jsx(c,typeof c=="string"?Object.assign({ref:i,style:Object.assign(Object.assign(Object.assign({},dc(l)),cc),!r&&(f==null?void 0:f[e]))},{children:o}):Object.assign({ref:i,square:e,squareColor:t,style:Object.assign(Object.assign(Object.assign({},dc(l)),cc),!r&&(f==null?void 0:f[e]))},{children:o}))}))}const cc={display:"flex",justifyContent:"center"},dc=e=>({width:e/8,height:e/8}),v1=(e,t,n)=>n!=null&&n.borderRadius?e==="a1"?t==="white"?{borderBottomLeftRadius:n.borderRadius}:{borderTopRightRadius:n.borderRadius}:e==="a8"?t==="white"?{borderTopLeftRadius:n.borderRadius}:{borderBottomRightRadius:n.borderRadius}:e==="h1"?t==="white"?{borderBottomRightRadius:n.borderRadius}:{borderTopLeftRadius:n.borderRadius}:e==="h8"?t==="white"?{borderTopRightRadius:n.borderRadius}:{borderBottomLeftRadius:n.borderRadius}:{}:{};function y1(){const[e,t]=C.useState({}),{boardOrientation:n,boardWidth:r,currentPosition:o,id:i,premoves:s,showBoardNotation:l}=xt();return S.jsx("div",Object.assign({"data-boardid":i},{children:[...Array(8)].map((u,a)=>S.jsx("div",Object.assign({style:{display:"flex",flexWrap:"nowrap",width:r}},{children:[...Array(8)].map((p,m)=>{const d=n==="black"?Wr[7-m]+(a+1):Wr[m]+(8-a),g=m%2==a%2?"white":"black",v=s.find(w=>w.sourceSq===d||w.targetSq===d),y=s.find(w=>w.targetSq===d);return S.jsxs(m1,Object.assign({square:d,squareColor:g,setSquares:t,squareHasPremove:!!v},{children:[o[d]&&S.jsx(ac,{piece:o[d],square:d,squares:e}),y&&S.jsx(ac,{isPremovedPiece:!0,piece:y.piece,square:d,squares:e}),l&&S.jsx(g1,{row:a,col:m})]}),`${m}${a}`)})}),a.toString()))}))}const S1=()=>{const{arrows:e,newArrow:t,boardOrientation:n,boardWidth:r,customArrowColor:o}=xt(),i=[...e,t].filter(Boolean);return S.jsx("svg",Object.assign({width:r,height:r,style:{position:"absolute",top:"0",left:"0",pointerEvents:"none",zIndex:"10"}},{children:i.map((s,l)=>{const[u,a,p]=s;if(u===a)return null;const m=El(n,r,u),d=El(n,r,a);let g=r/32;const v=l===e.length;e.some(f=>f[0]!==u&&f[1]===a)&&!v&&(g=r/16);const y=d.x-m.x,w=d.y-m.y,h=Math.hypot(w,y),c={x:m.x+y*(h-g)/h,y:m.y+w*(h-g)/h};return S.jsxs(C.Fragment,{children:[S.jsx("marker",Object.assign({id:`arrowhead-${l}`,markerWidth:"2",markerHeight:"2.5",refX:"1.25",refY:"1.25",orient:"auto"},{children:S.jsx("polygon",{points:"0.3 0, 2 1.25, 0.3 2.5",fill:p??o})})),S.jsx("line",{x1:m.x,y1:m.y,x2:c.x,y2:c.y,opacity:v?"0.5":"0.65",stroke:p??o,strokeWidth:v?.9*r/40:r/40,markerEnd:`url(#arrowhead-${l})`})]},`${u}-${a}${v?"-active":""}`)})}))};function w1({option:e}){const[t,n]=C.useState(!1),{boardWidth:r,chessPieces:o,customDarkSquareStyle:i,customLightSquareStyle:s,handleSetPosition:l,onPromotionPieceSelect:u,promoteFromSquare:a,promoteToSquare:p,promotionDialogVariant:m}=xt(),d=()=>{switch(e[1]){case"Q":return i.backgroundColor;case"R":return s.backgroundColor;case"N":return m==="default"?s.backgroundColor:i.backgroundColor;case"B":return m==="default"?i.backgroundColor:s.backgroundColor}};return S.jsx("div",Object.assign({onClick:()=>{u!=null&&u.length?u(e):l(a,p,e,!0)},onMouseOver:()=>n(!0),onMouseOut:()=>n(!1),"data-piece":e,style:{cursor:"pointer",backgroundColor:t?d():`${d()}aa`,borderRadius:"4px",transition:"all 0.1s ease-out"}},{children:typeof o[e]=="function"?S.jsx("div",Object.assign({style:{transition:"all 0.1s ease-out",transform:t?"scale(1)":"scale(0.85)"}},{children:o[e]({squareWidth:r/8,isDragging:!1})})):S.jsx("svg",Object.assign({viewBox:"1 1 43 43",width:r/8,height:r/8,style:{transition:"all 0.1s ease-out",transform:t?"scale(1)":"scale(0.85)"}},{children:S.jsx("g",{children:o[e]})}))}))}function k1(){const{boardOrientation:e,boardWidth:t,promotionDialogVariant:n,promoteToSquare:r}=xt(),o=(r==null?void 0:r[1])==="1"?"b":"w",i=[`${o??"w"}Q`,`${o??"w"}R`,`${o??"w"}N`,`${o??"w"}B`],s={default:{display:"grid",gridTemplateColumns:"1fr 1fr",transform:`translate(${-t/8}px, ${-t/8}px)`},vertical:{transform:`translate(${-t/16}px, ${-t/16}px)`},modal:{display:"flex",justifyContent:"center",alignItems:"center",transform:`translate(0px, ${3*t/8}px)`,width:"100%",height:t/4+"px",top:0,backgroundColor:"white",left:0}},l=El(e,t,r||"a8");return S.jsx("div",Object.assign({style:Object.assign({position:"absolute",top:`${l==null?void 0:l.y}px`,left:`${l==null?void 0:l.x}px`,zIndex:1e3},s[n]),title:"Choose promotion piece"},{children:i.map(u=>S.jsx(w1,{option:u},u))}))}const E1={whiteKing:S.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",version:"1.1",style:{shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",imageRendering:"crisp-edges"},viewBox:"0 0 4210 12970",x:"0px",y:"0px",fillRule:"evenodd",clipRule:"evenodd",width:"250",height:"250"},{children:S.jsx("g",{children:S.jsx("path",{style:{fill:"black",fillRule:"nonzero"},d:"M2105 0c169,0 286,160 249,315l200 0c-172,266 -231,479 -256,792 315,-24 530,-86 792,-255l0 897c-265,-171 -479,-231 -792,-256 18,234 75,495 185,682l339 0c233,0 369,269 225,456l545 0 -595 1916c130,94 158,275 59,402 465,0 416,568 51,568l-334 0 465 2867 332 0c250,0 381,306 199,485 162,63 273,220 273,399l0 633 168 0 0 475c-1403,0 -2807,0 -4210,0l0 -475 167 0 0 -633c0,-179 112,-336 274,-399 -181,-178 -52,-485 199,-485l332 0 465 -2867 -335 0c-353,0 -418,-568 51,-568 -98,-127 -70,-308 59,-402l-594 -1916c181,0 363,0 545,0 -144,-187 -9,-456 225,-456l339 0c110,-187 167,-448 185,-682 -315,25 -530,87 -793,256l0 -897c266,171 480,231 793,255 -25,-315 -87,-529 -256,-792l199 0c-36,-155 81,-315 250,-315zm-1994 10012l0 253 3988 0 0 -253c-1330,0 -2659,0 -3988,0zm484 -1060c-174,0 -316,142 -316,316l0 633 3652 0 0 -633c0,-174 -142,-316 -316,-316 -1007,0 -2013,0 -3020,0zm45 -457c-230,0 -225,345 0,345l2930 0c230,0 225,-345 0,-345 -977,0 -1953,0 -2930,0zm2020 -2978l-1111 0 -465 2867 2041 0 -465 -2867zm-1558 -456c-229,0 -224,345 0,345 669,0 1337,0 2005,0 230,0 225,-345 0,-345 -668,0 -1336,0 -2005,0zm1730 -457l-1454 0c-229,0 -224,345 0,345l1454 0c229,0 224,-345 0,-345zm-2064 -1862l544 1751c529,0 1057,0 1586,0l544 -1751c-892,0 -1783,0 -2674,0zm1085 -567l504 0c-126,-247 -163,-526 -177,-800 273,15 553,52 800,177l0 -504c-247,126 -527,163 -800,177 14,-273 51,-552 177,-799 -168,0 -336,0 -504,0 125,247 162,526 177,799 -274,-14 -553,-51 -800,-177l0 504c247,-125 527,-162 800,-177 -15,274 -52,553 -177,800zm969 111l-1434 0c-230,0 -225,345 0,345l1434 0c230,0 225,-345 0,-345zm-717 -2175c-105,0 -175,109 -133,204l266 0c42,-96 -30,-205 -133,-204z"})})}))};function C1({children:e}){try{return S.jsx(S.Fragment,{children:e})}catch(t){return console.log(t),S.jsx(Xf,{showError:!0})}}function Xf({showError:e=!1}){return S.jsxs("div",Object.assign({style:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},{children:[S.jsx("div",Object.assign({style:{width:250,height:250,transform:"rotate(90deg)"}},{children:E1.whiteKing})),e&&S.jsx("h1",{children:"Something went wrong"})]}))}function x1(){const e=C.useRef(null),{boardWidth:t,clearCurrentRightClickDown:n,onPromotionPieceSelect:r,setShowPromoteDialog:o,showPromoteDialog:i,customBoardStyle:s}=xt();return C.useEffect(()=>{function l(u){e.current&&!e.current.contains(u.target)&&n()}return document.addEventListener("mouseup",l),()=>{document.removeEventListener("mouseup",l)}},[]),t?S.jsx("div",Object.assign({style:{perspective:"1000px"}},{children:S.jsxs("div",Object.assign({ref:e,style:Object.assign(Object.assign({position:"relative"},_1(t)),s)},{children:[S.jsx(y1,{}),S.jsx(S1,{}),i&&S.jsxs(S.Fragment,{children:[S.jsx("div",{onClick:()=>{o(!1),r==null||r()},style:{position:"absolute",top:"0",left:"0",zIndex:"100",backgroundColor:"rgba(22,21,18,.7)",width:t,height:t}}),S.jsx(k1,{})]})]}))})):S.jsx(Xf,{})}const _1=e=>({cursor:"default",height:e,width:e});function O1(){const{boardWidth:e,chessPieces:t,id:n,snapToCursor:r}=xt(),o=function(p){const m=vn().getMonitor(),[d,g]=$f(m,p);return C.useEffect(()=>m.subscribeToOffsetChange(g)),C.useEffect(()=>m.subscribeToStateChange(g)),d}(p=>({item:p.getItem(),clientOffset:p.getClientOffset(),sourceClientOffset:p.getSourceClientOffset(),isDragging:p.isDragging()})),{isDragging:i,item:s,clientOffset:l,sourceClientOffset:u}=o,a=C.useCallback((p,m)=>{if(!p||!m)return{display:"none"};let{x:d,y:g}=r?p:m;if(r){const y=e/8/2;d-=y,g-=y}const v=`translate(${d}px, ${g}px)`;return{transform:v,WebkitTransform:v,touchAction:"none"}},[e,r]);return i&&s.id===n?S.jsx("div",Object.assign({style:{position:"fixed",pointerEvents:"none",zIndex:10,left:0,top:0}},{children:S.jsx("div",Object.assign({style:a(l,u)},{children:typeof t[s.piece]=="function"?t[s.piece]({squareWidth:e/8,isDragging:!0}):S.jsx("svg",Object.assign({viewBox:"1 1 43 43",width:e/8,height:e/8},{children:S.jsx("g",{children:t[s.piece]})}))}))})):null}const T1=C.forwardRef((e,t)=>{const{customDndBackend:n,customDndBackendOptions:r}=e,o=function(y,w){var h={};for(var c in y)Object.prototype.hasOwnProperty.call(y,c)&&w.indexOf(c)<0&&(h[c]=y[c]);if(y!=null&&typeof Object.getOwnPropertySymbols=="function"){var f=0;for(c=Object.getOwnPropertySymbols(y);f<c.length;f++)w.indexOf(c[f])<0&&Object.prototype.propertyIsEnumerable.call(y,c[f])&&(h[c[f]]=y[c[f]])}return h}(e,["customDndBackend","customDndBackendOptions"]),[i,s]=C.useState(),[l,u]=C.useState(!1),[a,p]=C.useState(!1),[m,d]=C.useState(e.boardWidth),g=C.useRef(null);C.useEffect(()=>{p("ontouchstart"in window),u(!0),s(window)},[]),C.useEffect(()=>{var y;if(e.boardWidth===void 0&&(!((y=g.current)===null||y===void 0)&&y.offsetWidth)){const w=new ResizeObserver(()=>{var h;d((h=g.current)===null||h===void 0?void 0:h.offsetWidth)});return w.observe(g.current),()=>{w.disconnect()}}},[g.current,i]);const v=n||(a?u1:o1);return l&&i?S.jsx(C1,{children:S.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",width:"100%"}},{children:[S.jsx("div",{ref:g,style:{width:"100%"}}),S.jsx(Rg,Object.assign({backend:v,context:i,options:n?r:void 0},{children:m&&S.jsxs(p1,Object.assign({boardWidth:m},o,{ref:t},{children:[S.jsx(O1,{}),S.jsx(x1,{})]}))}))]}))}):null});function fc(e){const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].trim();if(r.startsWith(e))return r.substring(e.length+1)}}function D1(e){const t=JSON.stringify(e);return new TextEncoder().encode(t)}function P1(e){return new Promise((t,n)=>{const r=new FileReader;r.onerror=n,r.onload=function(o){const i=o.target.result,s=new Uint8Array(i);t(s)},r.readAsArrayBuffer(e)})}class I1{constructor({nodeId:t,processId:n,uri:r="ws://"+window.location.host+window.location.pathname,onMessage:o=()=>null,onOpen:i=()=>null,onClose:s=()=>null,onError:l=()=>null}){ee(this,"nodeId");ee(this,"processId");ee(this,"_secret");ee(this,"_cipher");ee(this,"_decipher");ee(this,"_ws");ee(this,"send",t=>{this._ws.send(D1(t))});ee(this,"fetchJson",async(t,n)=>(console.log("Fetching JSON:",t),await(await fetch(t,n)).json()));this._secret=void 0,this.processId=n,this.nodeId=t,this._ws=new WebSocket(r),this._ws.onmessage=async u=>{if(console.log("Received websocket message:",u.data),typeof u.data=="string")o(u.data);else if(u.data instanceof Blob){const a=await P1(u.data),p=new TextDecoder().decode(a);o(p)}},this._ws.onopen=u=>{console.log(`${t}`,fc(`uqbar-auth_${t}`),fc(`uqbar-ws-auth_${t}`)),i(u)},this._ws.onclose=s,this._ws.onerror=l}}const hc=e=>{let t;const n=new Set,r=(u,a)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const m=t;t=a??typeof p!="object"?p:Object.assign({},t,p),n.forEach(d=>d(t,m))}},o=()=>t,l={setState:r,getState:o,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{n.clear()}};return t=e(r,o,l),l},j1=e=>e?hc(e):hc;var Jf={exports:{}},Zf={},eh={exports:{}},th={};/**
* @license React
* use-sync-external-store-shim.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Gn=C;function L1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var N1=typeof Object.is=="function"?Object.is:L1,M1=Gn.useState,R1=Gn.useEffect,A1=Gn.useLayoutEffect,b1=Gn.useDebugValue;function z1(e,t){var n=t(),r=M1({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return A1(function(){o.value=n,o.getSnapshot=t,Es(o)&&i({inst:o})},[e,n,t]),R1(function(){return Es(o)&&i({inst:o}),e(function(){Es(o)&&i({inst:o})})},[e]),b1(n),n}function Es(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!N1(e,n)}catch{return!0}}function $1(e,t){return t()}var F1=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$1:z1;th.useSyncExternalStore=Gn.useSyncExternalStore!==void 0?Gn.useSyncExternalStore:F1;eh.exports=th;var U1=eh.exports;/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ti=C,H1=U1;function B1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var W1=typeof Object.is=="function"?Object.is:B1,q1=H1.useSyncExternalStore,Q1=Ti.useRef,K1=Ti.useEffect,V1=Ti.useMemo,G1=Ti.useDebugValue;Zf.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=Q1(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=V1(function(){function u(g){if(!a){if(a=!0,p=g,g=r(g),o!==void 0&&s.hasValue){var v=s.value;if(o(v,g))return m=v}return m=g}if(v=m,W1(p,g))return v;var y=r(g);return o!==void 0&&o(v,y)?v:(p=g,m=y)}var a=!1,p,m,d=n===void 0?null:n;return[function(){return u(t())},d===null?void 0:function(){return u(d())}]},[t,n,r,o]);var l=q1(e,i[0],i[1]);return K1(function(){s.hasValue=!0,s.value=l},[l]),G1(l),l};Jf.exports=Zf;var Y1=Jf.exports;const X1=vc(Y1),{useSyncExternalStoreWithSelector:J1}=X1;function Z1(e,t=e.getState,n){const r=J1(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return C.useDebugValue(r),r}const pc=e=>{const t=typeof e=="function"?j1(e):e,n=(r,o)=>Z1(t,r,o);return Object.assign(n,t),n},em=e=>e?pc(e):pc;function nh(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var i;const s=u=>u===null?null:JSON.parse(u,t==null?void 0:t.reviver),l=(i=n.getItem(o))!=null?i:null;return l instanceof Promise?l.then(s):s(l)},setItem:(o,i)=>n.setItem(o,JSON.stringify(i,t==null?void 0:t.replacer)),removeItem:o=>n.removeItem(o)}}const qr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return qr(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return qr(r)(n)}}}},tm=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:w=>w,version:0,merge:(w,h)=>({...h,...w}),...t},s=!1;const l=new Set,u=new Set;let a;try{a=i.getStorage()}catch{}if(!a)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...w)},r,o);const p=qr(i.serialize),m=()=>{const w=i.partialize({...r()});let h;const c=p({state:w,version:i.version}).then(f=>a.setItem(i.name,f)).catch(f=>{h=f});if(h)throw h;return c},d=o.setState;o.setState=(w,h)=>{d(w,h),m()};const g=e((...w)=>{n(...w),m()},r,o);let v;const y=()=>{var w;if(!a)return;s=!1,l.forEach(c=>c(r()));const h=((w=i.onRehydrateStorage)==null?void 0:w.call(i,r()))||void 0;return qr(a.getItem.bind(a))(i.name).then(c=>{if(c)return i.deserialize(c)}).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==i.version){if(i.migrate)return i.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var f;return v=i.merge(c,(f=r())!=null?f:g),n(v,!0),m()}).then(()=>{h==null||h(v,void 0),s=!0,u.forEach(c=>c(v))}).catch(c=>{h==null||h(void 0,c)})};return o.persist={setOptions:w=>{i={...i,...w},w.getStorage&&(a=w.getStorage())},clearStorage:()=>{a==null||a.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>y(),hasHydrated:()=>s,onHydrate:w=>(l.add(w),()=>{l.delete(w)}),onFinishHydration:w=>(u.add(w),()=>{u.delete(w)})},y(),v||g},nm=(e,t)=>(n,r,o)=>{let i={storage:nh(()=>localStorage),partialize:y=>y,version:0,merge:(y,w)=>({...w,...y}),...t},s=!1;const l=new Set,u=new Set;let a=i.storage;if(!a)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...y)},r,o);const p=()=>{const y=i.partialize({...r()});return a.setItem(i.name,{state:y,version:i.version})},m=o.setState;o.setState=(y,w)=>{m(y,w),p()};const d=e((...y)=>{n(...y),p()},r,o);let g;const v=()=>{var y,w;if(!a)return;s=!1,l.forEach(c=>{var f;return c((f=r())!=null?f:d)});const h=((w=i.onRehydrateStorage)==null?void 0:w.call(i,(y=r())!=null?y:d))||void 0;return qr(a.getItem.bind(a))(i.name).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==i.version){if(i.migrate)return i.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var f;return g=i.merge(c,(f=r())!=null?f:d),n(g,!0),p()}).then(()=>{h==null||h(g,void 0),g=r(),s=!0,u.forEach(c=>c(g))}).catch(c=>{h==null||h(void 0,c)})};return o.persist={setOptions:y=>{i={...i,...y},y.storage&&(a=y.storage)},clearStorage:()=>{a==null||a.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:y=>(l.add(y),()=>{l.delete(y)}),onFinishHydration:y=>(u.add(y),()=>{u.delete(y)})},i.skipHydration||v(),g||d},rm=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?tm(e,t):nm(e,t),om=rm,im=em()(om((e,t)=>({games:{},handleWsMessage:n=>{const{kind:r,data:o}=JSON.parse(n);console.log(r,o),r==="game_update"&&e({games:{...t().games,[o.id]:o}})},set:e}),{name:"chess",storage:nh(()=>localStorage)}));let gc=!1;const mc=(e,t)=>(e.turns||0)%2===0?t===e.white:t===e.black;function sm(){const{games:e,handleWsMessage:t,set:n}=im(),[r,o]=C.useState("new"),[i,s]=C.useState(""),l=C.useMemo(()=>e[r]?{...e[r],game:new og(e[r].board)}:void 0,[e,r]),u=C.useMemo(()=>((l==null?void 0:l.turns)||0)%2===0?`${l==null?void 0:l.white} (white)`:`${l==null?void 0:l.black} (black)`,[l]);C.useEffect(()=>{gc||(gc=!0,new I1({nodeId:window.our.node,processId:window.our.process,onMessage:t})),fetch(`/${window.our.process}/games`).then(g=>g.json()).then(g=>{n({games:g})}).catch(console.error)},[]);const a=C.useCallback(async g=>{g.preventDefault();try{const v=await fetch(`/${window.our.process}/games`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:i})}).then(w=>{if(w.status===409)throw e[i]?o(i):alert("Game already exists, please refresh the page and select it."),new Error("Game already exists");if(w.status===503)throw alert(`${i} may be offline, please confirm it is online and try again.`),new Error("Player offline");if(w.status===400)throw alert("Please enter a valid player ID"),new Error("Invalid player ID");if(w.status>399)throw alert("There was an error creating the game. Please try again."),new Error("Error creating game");return w.json()}),y={...e};y[v.id]=v,n({games:y}),o(i),s("")}catch(v){console.error(v)}},[e,i,s,n]),p=C.useCallback((g,v)=>{if(!l||!mc(l,window.our.node))return!1;const y={from:g,to:v,promotion:"q"},w={...l};if(w.game.move(y)===null)return!1;w.board=w.game.fen();const c={...e};return c[l.id]=w,n({games:c}),fetch(`/${window.our.process}/games`,{method:"PUT",body:JSON.stringify({id:l.id,move:g+v})}).then(f=>f.json()).then(f=>{const k={...e};k[l.id]=f,n({games:k})}).catch(f=>{console.error(f),alert("There was an error making your move. Please try again");const k={...e},x={...l};x.game.undo(),k[l.id]=x,n({games:k})}),!0},[l,e,n]),m=C.useCallback(g=>{g.preventDefault(),g.stopPropagation(),l&&window.confirm("Are you sure you want to resign this game?")&&fetch(`/${window.our.process}/games?id=${l.id}`,{method:"DELETE"}).then(v=>v.json()).then(v=>{const y={...e};y[l.id]=v,n({games:y})}).catch(v=>{console.error(v),alert("There was an error resigning the game. Please try again")})},[l]),d=C.useCallback(async g=>{if(g.preventDefault(),g.stopPropagation(),!!l)try{const v=await fetch(`/${window.our.process}/games`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:l.id})}).then(w=>w.json()),y={...e};y[v.id]=v,n({games:y})}catch(v){console.error(v),alert("You could not create the game. Please make sure your current game with this player (if any) has ended and try again.")}},[l]);return S.jsx("div",{className:"flex flex-col justify-center items-center",children:S.jsxs("div",{className:"flex flex-col justify-center",style:{maxHeight:"100vh",maxWidth:"800px",width:"100%",position:"relative"},children:[S.jsx("a",{href:"/",className:"absolute top-6 left-0 m-4",style:{fontSize:24,color:"white"},onClick:g=>{g.preventDefault()},children:"◀ Back"}),S.jsx("h1",{className:"m-4",children:"Chess by Uqbar"}),S.jsxs("div",{className:"flex flex-row justify-center items-center h-screen border rounded",children:[Object.keys(e).length>0&&S.jsxs("div",{className:"flex flex-col border-r",style:{width:"25%",height:"100%"},children:[S.jsx("h3",{className:"m-2",children:"Games"}),S.jsx("button",{className:"bg-green-600 hover:bg-green-800 text-white font-bold py-2 px-4 m-2 rounded",onClick:()=>o("new"),children:"New"}),S.jsx("div",{className:"flex flex-col overflow-scroll",children:Object.values(e).map(g=>S.jsx("div",{onClick:()=>o(g==null?void 0:g.id),className:`game-entry m-2 ${r!==(g==null?void 0:g.id)&&mc(g,window.our.node)?"is-turn":""} ${r===(g==null?void 0:g.id)?"selected":""} ${g!=null&&g.ended?"ended":""}`,children:g==null?void 0:g.id},g==null?void 0:g.id))})]}),S.jsx("div",{className:"flex flex-col justify-center items-center",style:{width:"75%"},children:r==="new"||!l?S.jsxs(S.Fragment,{children:[S.jsx("h2",{className:"mb-2",children:"Start New Game"}),S.jsx("h4",{className:"mb-2",children:"(game creator will be white)"}),S.jsxs("form",{onSubmit:a,className:"flex flex-col justify-center mb-40",style:{maxWidth:400},children:[S.jsx("label",{className:"mb-2",style:{alignSelf:"flex-start",fontWeight:"600"},children:"Player ID"}),S.jsx("input",{className:"border rounded p-2 mb-2",style:{color:"black"},type:"text",placeholder:"Player ID",value:i,onChange:g=>s(g.target.value)}),S.jsx("button",{className:"bg-green-600 hover:bg-green-800 text-white font-bold py-2 px-4 rounded",type:"submit",children:"Start Game"})]})]}):S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex flex-row justify-between items-center w-full px-4 pb-2",children:[S.jsx("h3",{children:r}),S.jsx("h4",{children:l!=null&&l.ended?"Game Ended":`Turn: ${u}`}),l!=null&&l.ended?S.jsx("button",{className:"bg-green-600 hover:bg-green-800 text-white font-bold py-1 px-4 rounded",onClick:d,children:"Rematch"}):S.jsx("button",{className:"bg-green-600 hover:bg-green-800 text-white font-bold py-1 px-4 rounded",onClick:m,children:"Resign"})]}),S.jsx(T1,{position:l==null?void 0:l.game.fen(),onPieceDrop:p,boardOrientation:(l==null?void 0:l.white)===window.our.node?"white":"black"})]})})]})]})})}Cs.createRoot(document.getElementById("root")).render(S.jsx(Mh.StrictMode,{children:S.jsx(sm,{})}));