Files
furniture/dist/assets/index-CikQ7moU.js
T
2026-10-17 12:56:49 -04:00

41 lines
584 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&O(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function E(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&O(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=E,D=function(){ne.postMessage(null)}}else D=function(){_(E,0)};function O(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,O(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var O=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function k(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,A(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(O,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(te(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(O,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+re(a,u),c+=A(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+re(a,u++),c+=A(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return A(k(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ie(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ae(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var j=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function oe(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,j)}catch(e){j(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function se(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else oe(se.bind(null,e))}var M={map:ie,forEach:function(e,t,n){ie(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ie(e,function(){t++}),t},toArray:function(e){return ie(e,function(e){return e})||[]},only:function(e){if(!te(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=M,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=se,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ee.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=te,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ae}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=oe,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),h=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=d(),n=p(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function ee(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var E=Object.assign,D=Symbol.for(`react.element`),te=Symbol.for(`react.transitional.element`),ne=Symbol.for(`react.portal`),O=Symbol.for(`react.fragment`),re=Symbol.for(`react.strict_mode`),k=Symbol.for(`react.profiler`),A=Symbol.for(`react.consumer`),ie=Symbol.for(`react.context`),ae=Symbol.for(`react.forward_ref`),j=Symbol.for(`react.suspense`),oe=Symbol.for(`react.suspense_list`),se=Symbol.for(`react.memo`),M=Symbol.for(`react.lazy`),ce=Symbol.for(`react.activity`),le=Symbol.for(`react.legacy_hidden`),ue=Symbol.for(`react.memo_cache_sentinel`),de=Symbol.for(`react.view_transition`),fe=Symbol.for(`react.recoverable`),pe=Symbol.iterator;function me(e){return typeof e!=`object`||!e?null:(e=pe&&e[pe]||e[`@@iterator`],typeof e==`function`?e:null)}var he=Symbol.for(`react.client.reference`);function ge(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case O:return`Fragment`;case k:return`Profiler`;case re:return`StrictMode`;case j:return`Suspense`;case oe:return`SuspenseList`;case ce:return`Activity`;case de:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ne:return`Portal`;case ie:return e.displayName||`Context`;case A:return(e._context.displayName||`Context`)+`.Consumer`;case ae:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case se:return t=e.displayName||null,t===null?ge(e.type)||`Memo`:t;case M:t=e._payload,e=e._init;try{return ge(e(t))}catch{}}return null}var _e=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},be=[],xe=-1;function Se(e){return{current:e}}function Ce(e){0>xe||(e.current=be[xe],be[xe]=null,xe--)}function P(e,t){xe++,be[xe]=e.current,e.current=t}var we=Se(null),Te=Se(null),Ee=Se(null),De=Se(null);function Oe(e,t){switch(P(Ee,t),P(Te,e),P(we,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ce(we),P(we,e)}function ke(){Ce(we),Ce(Te),Ce(Ee)}function Ae(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,P(De,e)),t=we.current;var n=dp(t,e.type);t!==n&&(P(Te,e),P(we,n))}function je(e){Te.current===e&&(Ce(we),Ce(Te)),De.current===e&&(Ce(De),sh._currentValue=ye)}var Me,F;function Ne(e){if(Me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Me=t&&t[1]||``,F=-1<e.stack.indexOf(`
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
`+Me+e+F}var Pe=!1;function Fe(e,t){if(!e||Pe)return``;Pe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
`),l=s.split(`
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ne(n):``}function Ie(e,t){switch(e.tag){case 26:case 27:case 5:return Ne(e.type);case 16:return Ne(`Lazy`);case 13:return e.child!==t&&t!==null?Ne(`Suspense Fallback`):Ne(`Suspense`);case 19:return Ne(`SuspenseList`);case 0:case 15:return Fe(e.type,!1);case 11:return Fe(e.type.render,!1);case 1:return Fe(e.type,!0);case 31:return Ne(`Activity`);case 30:return Ne(`ViewTransition`);default:return``}}function Le(e){try{var t=``,n=null;do t+=Ie(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
Error generating stack: `+e.message+`
`+e.stack}}var Re=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,Be=t.unstable_cancelCallback,Ve=t.unstable_shouldYield,He=t.unstable_requestPaint,Ue=t.unstable_now,We=t.unstable_getCurrentPriorityLevel,Ge=t.unstable_ImmediatePriority,Ke=t.unstable_UserBlockingPriority,I=t.unstable_NormalPriority,qe=t.unstable_LowPriority,Je=t.unstable_IdlePriority,Ye=t.log,Xe=t.unstable_setDisableYieldValue,Ze=null,Qe=null;function $e(e){if(typeof Ye==`function`&&Xe(e),Qe&&typeof Qe.setStrictMode==`function`)try{Qe.setStrictMode(Ze,e)}catch{}}var et=Math.clz32?Math.clz32:rt,tt=Math.log,nt=Math.LN2;function rt(e){return e>>>=0,e===0?32:31-(tt(e)/nt|0)|0}var it=256,at=262144,ot=4194304;function st(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ct(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=st(n))):i=st(o):i=st(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=st(n))):i=st(o)):i=st(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function lt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-et(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ft(){var e=ot;return ot<<=1,!(ot&62914560)&&(ot=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ht(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-et(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&gt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function gt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-et(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vt(e,t){var n=t&-t;return n=n&42?1:yt(n),(n&(e.suspendedLanes|t))===0?n:0}function yt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=ve.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function St(e,t){var n=ve.p;try{return ve.p=e,t()}finally{ve.p=n}}var Ct=Math.random().toString(36).slice(2),L=`__reactFiber$`+Ct,wt=`__reactProps$`+Ct,Tt=`__reactContainer$`+Ct,Et=`__reactEvents$`+Ct,Dt=`__reactListeners$`+Ct,Ot=`__reactHandles$`+Ct,kt=`__reactResources$`+Ct,At=`__reactMarker$`+Ct,jt=`__reactLoad$`+Ct;function Mt(e){delete e[L],delete e[wt],delete e[Dt],delete e[Ot]}function Nt(e){var t;if(t=e[L])return t;for(var n=e.parentNode;n;){if(t=n[Tt]||n[L]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[L])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Pt(e){if(e=e[L]||e[Tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function It(e){var t=e[kt];return t||=e[kt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Lt(e){e[At]=!0}function Rt(e){e[jt]=void 0}var zt=new Set,Bt={};function Vt(e,t){R(e,t),R(e+`Capture`,t)}function R(e,t){for(Bt[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var Ht=RegExp(`^[: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]*$`),Ut={},Wt={};function Gt(e){return Re.call(Wt,e)?!0:Re.call(Ut,e)?!1:Ht.test(e)?Wt[e]=!0:(Ut[e]=!0,!1)}var z=!1;function Kt(){var e=z;return z=!1,e}function qt(e,t,n){if(Gt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Jt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Yt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Xt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function B(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Zt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qt(e){if(!e._valueTracker){var t=B(e)?`checked`:`value`;e._valueTracker=Zt(e,t,``+e[t])}}function $t(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=B(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var en=/[\n"\\]/g;function tn(e){return e.replace(en,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function nn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Xt(t)):e.value!==``+Xt(t)&&(e.value=``+Xt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):an(e,Xt(n)):o===`number`&&e.value==t?an(e,Xt(e.value)):an(e,Xt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Xt(s):e.removeAttribute(`name`)}function rn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Qt(e);return}n=n==null?``:``+Xt(n),t=t==null?n:``+Xt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Qt(e)}function an(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function on(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Xt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function V(e,t,n){t!=null&&(t=``+Xt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Xt(n)}function sn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(_e(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Xt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Qt(e)}function cn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ln=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function un(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||ln.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function dn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,z=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(un(e,a,r),z=!0)}else for(var o in t)t.hasOwnProperty(o)&&un(e,o,t[o])}function fn(e){if(e.indexOf(`-`)===-1)return!1;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 pn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),mn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function hn(e){return mn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function gn(){}var _n=null;function vn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yn=null,bn=null;function xn(e){var t=Pt(e);if(t&&(e=t.stateNode)){var n=e[wt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(nn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+tn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[wt]||null;if(!a)throw Error(i(90));nn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&$t(r)}break a;case`textarea`:V(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&on(e,!!n.multiple,t,!1)}}}var Sn=!1;function Cn(e,t,n){if(Sn)return e(t,n);Sn=!0;try{return e(t)}finally{if(Sn=!1,(yn!==null||bn!==null)&&(Id(),yn&&(t=yn,e=bn,bn=yn=null,xn(t),e)))for(t=0;t<e.length;t++)xn(e[t])}}function H(e,t){var n=e.stateNode;if(n===null)return null;var r=n[wt]||null;if(r===null)return null;n=r[t];a: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 a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var wn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Tn=!1;if(wn)try{var En={};Object.defineProperty(En,"passive",{get:function(){Tn=!0}}),window.addEventListener(`test`,En,En),window.removeEventListener(`test`,En,En)}catch{Tn=!1}var Dn=null,On=null,kn=null;function An(){if(kn)return kn;var e,t=On,n=t.length,r,i=`value`in Dn?Dn.value:Dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return kn=i.slice(e,1<r?1-r:void 0)}function jn(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 Mn(){return!0}function Nn(){return!1}function Pn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Mn:Nn,this.isPropagationStopped=Nn,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Mn)},persist:function(){},isPersistent:Mn}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},In=Pn(Fn),Ln=E({},Fn,{view:0,detail:0}),Rn=Pn(Ln),zn,Bn,Vn,Hn=E({},Ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$n,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!==Vn&&(Vn&&e.type===`mousemove`?(zn=e.screenX-Vn.screenX,Bn=e.screenY-Vn.screenY):Bn=zn=0,Vn=e),zn)},movementY:function(e){return`movementY`in e?e.movementY:Bn}}),Un=Pn(Hn),Wn=Pn(E({},Hn,{dataTransfer:0})),Gn=Pn(E({},Ln,{relatedTarget:0})),Kn=Pn(E({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0})),qn=Pn(E({},Fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Jn=Pn(E({},Fn,{data:0})),Yn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Xn={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`},Zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zn[e])?!!t[e]:!1}function $n(){return Qn}var er=Pn(E({},Ln,{key:function(e){if(e.key){var t=Yn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=jn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Xn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$n,charCode:function(e){return e.type===`keypress`?jn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?jn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),tr=Pn(E({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),nr=Pn(E({},Fn,{submitter:0})),rr=Pn(E({},Ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$n})),ir=Pn(E({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ar=Pn(E({},Hn,{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})),or=Pn(E({},Fn,{newState:0,oldState:0,source:0})),sr=[9,13,27,32],cr=wn&&`CompositionEvent`in window,lr=null;wn&&`documentMode`in document&&(lr=document.documentMode);var ur=wn&&`TextEvent`in window&&!lr,dr=wn&&(!cr||lr&&8<lr&&11>=lr),fr=` `,pr=!1;function mr(e,t){switch(e){case`keyup`:return sr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function hr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var gr=!1;function _r(e,t){switch(e){case`compositionend`:return hr(t);case`keypress`:return t.which===32?(pr=!0,fr):null;case`textInput`:return e=t.data,e===fr&&pr?null:e;default:return null}}function vr(e,t){if(gr)return e===`compositionend`||!cr&&mr(e,t)?(e=An(),kn=On=Dn=null,gr=!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 dr&&t.locale!==`ko`?null:t.data;default:return null}}var yr={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 br(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!yr[e.type]:t===`textarea`}function xr(e,t,n,r){yn?bn?bn.push(r):bn=[r]:yn=r,t=qf(t,`onChange`),0<t.length&&(n=new In(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Sr=null,Cr=null;function wr(e){zf(e,0)}function Tr(e){if($t(Ft(e)))return e}function U(e,t){if(e===`change`)return t}var Er=!1;if(wn){var Dr;if(wn){var Or=`oninput`in document;if(!Or){var kr=document.createElement(`div`);kr.setAttribute(`oninput`,`return;`),Or=typeof kr.oninput==`function`}Dr=Or}else Dr=!1;Er=Dr&&(!document.documentMode||9<document.documentMode)}function Ar(){Sr&&(Sr.detachEvent(`onpropertychange`,jr),Cr=Sr=null)}function jr(e){if(e.propertyName===`value`&&Tr(Cr)){var t=[];xr(t,Cr,e,vn(e)),Cn(wr,t)}}function Mr(e,t,n){e===`focusin`?(Ar(),Sr=t,Cr=n,Sr.attachEvent(`onpropertychange`,jr)):e===`focusout`&&Ar()}function Nr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Tr(Cr)}function Pr(e,t){if(e===`click`)return Tr(t)}function Fr(e,t){if(e===`input`||e===`change`)return Tr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function Rr(e,t){if(Lr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)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 i=n[r];if(!Re.call(t,i)||!Lr(e[i],t[i]))return!1}return!0}function zr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vr(e,t){var n=Br(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}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Br(n)}}function Hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ur(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=zr(e.document)}return t}function Wr(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`)}var Gr=wn&&`documentMode`in document&&11>=document.documentMode,Kr=null,qr=null,Jr=null,Yr=!1;function Xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yr||Kr==null||Kr!==zr(r)||(r=Kr,`selectionStart`in r&&Wr(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}),Jr&&Rr(Jr,r)||(Jr=r,r=qf(qr,`onSelect`),0<r.length&&(t=new In(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Qr={animationend:Zr(`Animation`,`AnimationEnd`),animationiteration:Zr(`Animation`,`AnimationIteration`),animationstart:Zr(`Animation`,`AnimationStart`),transitionrun:Zr(`Transition`,`TransitionRun`),transitionstart:Zr(`Transition`,`TransitionStart`),transitioncancel:Zr(`Transition`,`TransitionCancel`),transitionend:Zr(`Transition`,`TransitionEnd`)},$r={},ei={};wn&&(ei=document.createElement(`div`).style,`AnimationEvent`in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),`TransitionEvent`in window||delete Qr.transitionend.transition);function ti(e){if($r[e])return $r[e];if(!Qr[e])return e;var t=Qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ei)return $r[e]=t[n];return e}var ni=ti(`animationend`),ri=ti(`animationiteration`),ii=ti(`animationstart`),ai=ti(`transitionrun`),oi=ti(`transitionstart`),si=ti(`transitioncancel`),ci=ti(`transitionend`),li=new Map,ui=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);ui.push(`scrollEnd`);function di(e,t){li.set(e,t),Vt(t,[e])}var fi=0;function pi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=_d.identifierPrefix;var n=fi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function mi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Td;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function hi(e,t){return e=mi(e),t=mi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var gi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},_i=[],vi=0,yi=0;function bi(){for(var e=vi,t=yi=vi=0;t<e;){var n=_i[t];_i[t++]=null;var r=_i[t];_i[t++]=null;var i=_i[t];_i[t++]=null;var a=_i[t];if(_i[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&wi(n,i,a)}}function xi(e,t,n,r){_i[vi++]=e,_i[vi++]=t,_i[vi++]=n,_i[vi++]=r,yi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Si(e,t,n,r){return xi(e,t,n,r),Ti(e)}function Ci(e,t){return xi(e,null,null,t),Ti(e)}function wi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-et(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ti(e){if(50<Ed)throw Ed=0,Dd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ei={};function Di(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.refCleanup=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 Oi(e,t,n,r){return new Di(e,t,n,r)}function ki(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ai(e,t){var n=e.alternate;return n===null?(n=Oi(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&1206910976,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.refCleanup=e.refCleanup,n}function ji(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Mi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ki(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,we.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ce:return e=Oi(31,n,t,a),e.elementType=ce,e.lanes=o,e;case O:return Ni(n.children,a,o,t);case re:s=8,a|=24;break;case k:return e=Oi(12,n,t,a|2),e.elementType=k,e.lanes=o,e;case j:return e=Oi(13,n,t,a),e.elementType=j,e.lanes=o,e;case oe:return e=Oi(19,n,t,a),e.elementType=oe,e.lanes=o,e;case le:case de:return e=a|32,e=Oi(30,n,t,e),e.elementType=de,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ie:s=10;break a;case A:s=9;break a;case ae:s=11;break a;case se:s=14;break a;case M:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ni(e,t,n,r){return e=Oi(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=Oi(6,e,null,t),e.lanes=n,e}function Fi(e){var t=Oi(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=Oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Li=new WeakMap;function Ri(e,t){if(typeof e==`object`&&e){var n=Li.get(e);return n===void 0?(t={value:e,source:t,stack:Le(t)},Li.set(e,t),t):n}return{value:e,source:t,stack:Le(t)}}var zi=[],Bi=0,Vi=null,Hi=0,Ui=[],Wi=0,Gi=null,Ki=1,qi=``;function Ji(e,t){zi[Bi++]=Hi,zi[Bi++]=Vi,Vi=e,Hi=t}function Yi(e,t,n){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Gi=e;var r=Ki;e=qi;var i=32-et(r)-1;r&=~(1<<i),n+=1;var a=32-et(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ki=1<<32-et(t)+i|n<<i|r,qi=a+e}else Ki=1<<a|n<<i|r,qi=e}function Xi(e){e.return!==null&&(Ji(e,1),Yi(e,1,0))}function W(e){for(;e===Vi;)Vi=zi[--Bi],zi[Bi]=null,Hi=zi[--Bi],zi[Bi]=null;for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,qi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null}function Zi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Ki=t.id,qi=t.overflow,Gi=e}var Qi=null,$i=null,G=!1,ea=null,ta=!1,na=Error(i(519));function ra(e){throw la(Ri(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),na}function ia(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[L]=e,t[wt]=r,n){case`dialog`:Bf(`cancel`,t),Bf(`close`,t);break;case`iframe`:case`object`:case`embed`:Bf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Lf.length;n++)Bf(Lf[n],t);break;case`source`:Bf(`error`,t);break;case`img`:case`image`:case`link`:Bf(`error`,t),Bf(`load`,t);break;case`details`:Bf(`toggle`,t);break;case`input`:Bf(`invalid`,t),rn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Bf(`invalid`,t);break;case`textarea`:Bf(`invalid`,t),sn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&(Bf(`beforetoggle`,t),Bf(`toggle`,t)),r.onScroll!=null&&Bf(`scroll`,t),r.onScrollEnd!=null&&Bf(`scrollend`,t),r.onClick!=null&&(t.onclick=gn),t=!0):t=!1,t||ra(e,!0)}function aa(e){for(Qi=e.return;Qi;)switch(Qi.tag){case 5:case 31:case 13:ta=!1;return;case 27:case 3:ta=!0;return;default:Qi=Qi.return}}function oa(e){if(e!==Qi)return!1;if(!G)return aa(e),G=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&$i&&ra(e),aa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=dm(e)}else t===27?(t=$i,Sp(e.type)?(e=um,um=null,$i=e):$i=t):$i=Qi?lm(e.stateNode.nextSibling):null;return!0}function sa(){$i=Qi=null,G=!1}function ca(){var e=ea;return e!==null&&(ld===null?ld=e:ld.push.apply(ld,e),ea=null),e}function la(e){ea===null?ea=[e]:ea.push(e)}var ua=Se(null),da=null,fa=null;function pa(e,t,n){P(ua,t._currentValue),t._currentValue=n}function K(e){e._currentValue=ua.current,Ce(ua)}function ma(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ha(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ma(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ma(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ma(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ga(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Lr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===De.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&ha(t,e,n,r),t.flags|=262144,e!==null}function _a(e){for(e=e.firstContext;e!==null;){if(!Lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function va(e){da=e,fa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ya(e){return xa(da,e)}function ba(e,t){return da===null&&va(e),xa(e,t)}function xa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},fa===null){if(e===null)throw Error(i(308));fa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fa=fa.next=t;return n}var Sa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ca=t.unstable_scheduleCallback,wa=t.unstable_NormalPriority,Ta={$$typeof:ie,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ea(){return{controller:new Sa,data:new Map,refCount:0}}function Da(e){e.refCount--,e.refCount===0&&Ca(wa,function(){e.controller.abort()})}function Oa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var ka=null;function Aa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var ja=null,q=0,Ma=0,Na=null;function Pa(e,t){if(ja===null){var n=ja=[];q=0,Ma=Mf(),Na={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return q++,t.then(Fa,Fa),t}function Fa(){if(--q===0&&(ka=null,ja!==null)){Na!==null&&(Na.status=`fulfilled`);var e=ja;ja=null,Ma=0,Na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ia(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var La=N.S;N.S=function(e,t){if(fd=Ue(),typeof t==`object`&&t&&typeof t.then==`function`&&Pa(e,t),ka!==null)for(var n=vf;n!==null;)Oa(n,ka),n=n.next;if(n=e.types,n!==null){for(var r=vf;r!==null;)Oa(r,n),r=r.next;if(Ma!==0){r=ka,r===null&&(r=ka=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}La!==null&&La(e,t)};var Ra=Se(null);function za(){var e=Ra.current;return e===null?Xu.pooledCache:e}function Ba(e,t){t===null?P(Ra,Ra.current):P(Ra,t.pool)}function Va(){var e=za();return e===null?null:{parent:Ta._currentValue,pool:e}}var Ha=Error(i(460)),Ua=Error(i(474)),Wa=Error(i(542)),Ga={then:function(){}};function Ka(e){return e=e.status,e===`fulfilled`||e===`rejected`}function qa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(gn,gn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Za(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(gn,gn);else{if(e=Xu,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Za(e),e}throw Ya=t,Ha}}function Ja(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ya=e,Ha):e}}var Ya=null;function Xa(){if(Ya===null)throw Error(i(459));var e=Ya;return Ya=null,e}function Za(e){if(e===Ha||e===Wa)throw Error(i(483))}var Qa=null,$a=0;function eo(e){var t=$a;return $a+=1,Qa===null&&(Qa=[]),qa(Qa,e,t)}function to(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function no(e,t){throw t.$$typeof===D?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ro(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===O?(e=d(e,t,n.props.children,r,n.key),to(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===M&&Ja(i)===t.type)?(t=a(t,n.props),to(t,n),t.return=e,t):(t=Mi(n.type,n.key,n.props,null,e.mode,r),to(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ii(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ni(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case te:return n=Mi(t.type,t.key,t.props,null,e.mode,n),to(n,t),n.return=e,n;case ne:return t=Ii(t,e.mode,n),t.return=e,t;case M:return t=Ja(t),f(e,t,n)}if(_e(t)||me(t))return t=Ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,eo(t),n);if(t.$$typeof===ie)return f(e,ba(e,t),n);no(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case te:return n.key===i?l(e,t,n,r):null;case ne:return n.key===i?u(e,t,n,r):null;case M:return n=Ja(n),p(e,t,n,r)}if(_e(n)||me(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,eo(n),r);if(n.$$typeof===ie)return p(e,t,ba(e,n),r);no(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case te:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ne:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case M:return r=Ja(r),m(e,t,n,r,i)}if(_e(r)||me(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,eo(r),i);if(r.$$typeof===ie)return m(e,t,n,ba(t,r),i);no(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),G&&Ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return G&&Ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),G&&Ji(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),G&&Ji(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return G&&Ji(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),G&&Ji(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===O&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case te:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===O){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),to(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===M&&Ja(l)===r.type){n(e,r.sibling),c=a(r,o.props),to(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=Ni(o.props.children,e.mode,c,o.key),to(c,o),c.return=e,e=c):(c=Mi(o.type,o.key,o.props,null,e.mode,c),to(c,o),c.return=e,e=c)}return s(e);case ne:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ii(o,e.mode,c),c.return=e,e=c}return s(e);case M:return o=Ja(o),_(e,r,o,c)}if(_e(o))return h(e,r,o,c);if(me(o)){if(l=me(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,eo(o),c);if(o.$$typeof===ie)return _(e,r,ba(e,o),c);no(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{$a=0;var i=_(e,t,n,r);return Qa=null,i}catch(t){if(t===Ha||t===Wa)throw t;var a=Oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var io=ro(!0),ao=ro(!1),oo=!1;function so(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function co(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function lo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Yu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ti(e),wi(e,null,n),t}return xi(e,r,t,n),Ti(e)}function fo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}function po(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var mo=!1;function J(){if(mo){var e=Na;if(e!==null)throw e}}function ho(e,t,n,r){mo=!1;var i=e.updateQueue;oo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Z&f)===f:(r&f)===f){f!==0&&f===Ma&&(mo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=E({},d,f);break a;case 2:oo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),rd|=o,e.lanes=o,e.memoizedState=d}}function go(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function _o(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)go(n[e],t)}var vo=Se(null),yo=Se(0);function bo(e,t){e=td,P(yo,e),P(vo,t),td=e|t.baseLanes}function xo(){P(yo,td),P(vo,vo.current)}function So(){td=yo.current,Ce(vo),Ce(yo)}var Co=Se(null),wo=null;function To(e){var t=e.alternate;P(Ao,Ao.current&1),P(Co,e),wo===null&&(t===null||vo.current!==null||t.memoizedState!==null)&&(wo=e)}function Eo(e){P(Ao,Ao.current),P(Co,e),wo===null&&(wo=e)}function Do(e){e.tag===22?(P(Ao,Ao.current),P(Co,e),wo===null&&(wo=e)):Oo()}function Oo(){P(Ao,Ao.current),P(Co,Co.current)}function ko(e){Ce(Co),wo===e&&(wo=null),Ce(Ao)}var Ao=Se(0);function jo(e,t){P(Co,Co.current),P(Ao,t)}function Mo(e){Ce(Ao),Ce(Co),wo===e&&(wo=null)}function No(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Po=0,Y=null,Fo=null,Io=null,Lo=!1,Ro=!1,X=!1,zo=0,Bo=0,Vo=null,Ho=0;function Uo(){throw Error(i(321))}function Wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Go(e,t,n,r,i,a){return Po=a,Y=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?cc:lc,X=!1,a=n(r,i),X=!1,Ro&&(a=qo(t,n,r,i)),Ko(e),a}function Ko(e){N.H=sc;var t=Fo!==null&&Fo.next!==null;if(Po=0,Io=Fo=Y=null,Lo=!1,Bo=0,Vo=null,t)throw Error(i(300));e===null||Ec||(e=e.dependencies,e!==null&&_a(e)&&(Ec=!0))}function qo(e,t,n,r){Y=e;var a=0;do{if(Ro&&(Vo=null),Bo=0,Ro=!1,25<=a)throw Error(i(301));if(a+=1,Io=Fo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=uc,o=t(n,r)}while(Ro);return o}function Jo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?ts(t):t,e=e.useState()[0],(Fo===null?null:Fo.memoizedState)!==e&&(Y.flags|=1024),t}function Yo(){var e=zo!==0;return zo=0,e}function Xo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Zo(e){if(Lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lo=!1}Po=0,Io=Fo=Y=null,Ro=!1,Bo=zo=0,Vo=null}function Qo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Io===null?Y.memoizedState=Io=e:Io=Io.next=e,Io}function $o(){if(Fo===null){var e=Y.alternate;e=e===null?null:e.memoizedState}else e=Fo.next;var t=Io===null?Y.memoizedState:Io.next;if(t!==null)Io=t,Fo=e;else{if(e===null)throw Y.alternate===null?Error(i(467)):Error(i(310));Fo=e,e={memoizedState:Fo.memoizedState,baseState:Fo.baseState,baseQueue:Fo.baseQueue,queue:Fo.queue,next:null},Io===null?Y.memoizedState=Io=e:Io=Io.next=e}return Io}function es(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ts(e){var t=Bo;return Bo+=1,Vo===null&&(Vo=[]),e=qa(Vo,e,t),t=Y,(Io===null?t.memoizedState:Io.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?cc:lc),e}function ns(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ts(e);if(e.$$typeof===fe)return;if(e.$$typeof===ie)return ya(e)}throw Error(i(438,String(e)))}function rs(e){var t=null,n=Y.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Y.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=es(),Y.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ue;return t.index++,n}function is(e,t){return typeof t==`function`?t(e):t}function as(e){return os($o(),Fo,e)}function os(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Po&f)===f:(Z&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ma&&(d=!0);else if((Po&p)===p){u=u.next,p===Ma&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Y.lanes|=p,rd|=p;f=u.action,X&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Y.lanes|=f,rd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Lr(o,e.memoizedState)&&(Ec=!0,d&&(n=Na,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ss(e){var t=$o(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Lr(o,t.memoizedState)||(Ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function cs(e,t,n){var r=Y,a=$o(),o=G;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Lr((Fo||a).memoizedState,n);if(s&&(a.memoizedState=n,Ec=!0),a=a.queue,Ns(ds.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Io!==null&&!!(Io.memoizedState.tag&1),Os(e?9:8,{destroy:void 0},us.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(i(349));o||Po&127||ls(r,t,n)}return n}function ls(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Y.updateQueue,t===null?(t=es(),Y.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function us(e,t,n,r){t.value=n,t.getSnapshot=r,fs(t)&&ps(e)}function ds(e,t,n){return n(function(){fs(t)&&ps(e)})}function fs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function ps(e){var t=Ci(e,2);t!==null&&jd(t,e,2)}function ms(e){var t=Qo();if(typeof e==`function`){var n=e;if(e=n(),X){$e(!0);try{n()}finally{$e(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:e},t}function hs(e,t,n,r){return e.baseState=n,os(e,Fo,typeof r==`function`?r:is)}function gs(e,t,n,r,a){if(ic(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,_s(t,o)):(o.next=n.next,t.pending=n.next=o)}}function _s(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};o.types=a===null?null:a.types,N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),vs(e,t,s)}catch(n){bs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),vs(e,t,a)}catch(n){bs(e,t,n)}}function vs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ys(e,t,n)},function(n){return bs(e,t,n)}):ys(e,t,n)}function ys(e,t,n){t.status=`fulfilled`,t.value=n,xs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,_s(e,n)))}function bs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,xs(t),t=t.next;while(t!==r)}e.action=null}function xs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ss(e,t){return t}function Cs(e,t){if(G){var n=Xu.formState;if(n!==null){a:{var r=Y;if(G){if($i){b:{for(var i=$i,a=ta;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){$i=lm(i.nextSibling),r=i.data===`F!`;break a}}ra(r)}r=!1}r&&(t=n[0])}}return n=Qo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ss,lastRenderedState:t},n.queue=r,n=tc.bind(null,Y,r),r.dispatch=n,r=ms(!1),a=rc.bind(null,Y,!1,r.queue),r=Qo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=gs.bind(null,Y,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ws(e){return Ts($o(),Fo,e)}function Ts(e,t,n){if(t=os(e,t,Ss)[0],e=as(is)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ts(t)}catch(e){throw e===Ha?Wa:e}else r=t;t=$o();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Y.flags|=2048,Os(9,{destroy:void 0},Es.bind(null,i,n),null)),[r,a,e]}function Es(e,t){e.action=t}function Ds(e){var t=$o(),n=Fo;if(n!==null)return Ts(t,n,e);$o(),t=t.memoizedState,n=$o();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Os(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Y.updateQueue,t===null&&(t=es(),Y.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ks(){return $o().memoizedState}function As(e,t,n,r){var i=Qo();Y.flags|=e,i.memoizedState=Os(1|t,{destroy:void 0},n,r===void 0?null:r)}function js(e,t,n,r){var i=$o();r=r===void 0?null:r;var a=i.memoizedState.inst;Fo!==null&&r!==null&&Wo(r,Fo.memoizedState.deps)?i.memoizedState=Os(t,a,n,r):(Y.flags|=e,i.memoizedState=Os(1|t,a,n,r))}function Ms(e,t){As(8390656,8,e,t)}function Ns(e,t){js(2048,8,e,t)}function Ps(e){Y.flags|=4;var t=Y.updateQueue;if(t===null)t=es(),Y.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Fs(e){var t=$o().memoizedState;return Ps({ref:t,nextImpl:e}),function(){if(Yu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Is(e,t){return js(4,2,e,t)}function Ls(e,t){return js(4,4,e,t)}function Rs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function zs(e,t,n){n=n==null?null:n.concat([e]),js(4,4,Rs.bind(null,t,e),n)}function Bs(){}function Vs(e,t){var n=$o();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Hs(e,t){var n=$o();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Wo(t,r[1]))return r[0];if(r=e(),X){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r}function Us(e,t,n){return n===void 0||Po&1073741824&&!(Z&261930)?e.memoizedState=t:(e.memoizedState=n,e=kd(),Y.lanes|=e,rd|=e,n)}function Ws(e,t,n,r){return Lr(n,t)?n:vo.current===null?!(Po&106)||Po&1073741824&&!(Z&261930)?(Ec=!0,e.memoizedState=n):(e=kd(),Y.lanes|=e,rd|=e,t):(e=Us(e,n,r),Lr(e,t)||(Ec=!0),e)}function Gs(e,t,n,r,i){var a=ve.p;ve.p=a!==0&&8>a?a:8;var o=N.T,s={};s.types=o===null?null:o.types,N.T=s,rc(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?nc(e,t,Ia(c,r),Od(e)):nc(e,t,r,Od(e))}catch(n){nc(e,t,{then:function(){},status:`rejected`,reason:n},Od())}finally{ve.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function Ks(){}function qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Js(e).queue;Gs(e,a,t,ye,n===null?Ks:function(){return Ys(e),n(r)})}function Js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:ye},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ys(e){var t=Js(e);t.next===null&&(t=e.alternate.memoizedState),nc(e,t.next.queue,{},Od())}function Xs(){return ya(sh)}function Zs(){return $o().memoizedState}function Qs(){return $o().memoizedState}function $s(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Od();e=lo(n);var r=uo(t,e,n);r!==null&&(jd(r,t,n),fo(r,t,n)),t={cache:Ea()},e.payload=t;return}t=t.return}}function ec(e,t,n){var r=Od();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ic(e)?ac(t,n):(n=Si(e,t,n,r),n!==null&&(jd(n,e,r),oc(n,t,r)))}function tc(e,t,n){nc(e,t,n,Od())}function nc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ic(e))ac(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Lr(s,o))return xi(e,t,i,0),Xu===null&&bi(),!1}catch{}if(n=Si(e,t,i,r),n!==null)return jd(n,e,r),oc(n,t,r),!0}return!1}function rc(e,t,n,r){if(r={lane:2,revertLane:Mf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ic(e)){if(t)throw Error(i(479))}else t=Si(e,n,r,2),t!==null&&jd(t,e,2)}function ic(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function ac(e,t){Ro=Lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}var sc={readContext:ya,use:ns,useCallback:Uo,useContext:Uo,useEffect:Uo,useImperativeHandle:Uo,useLayoutEffect:Uo,useInsertionEffect:Uo,useMemo:Uo,useReducer:Uo,useRef:Uo,useState:Uo,useDebugValue:Uo,useDeferredValue:Uo,useTransition:Uo,useSyncExternalStore:Uo,useId:Uo,useHostTransitionStatus:Uo,useFormState:Uo,useActionState:Uo,useOptimistic:Uo,useMemoCache:Uo,useCacheRefresh:Uo,useEffectEvent:Uo},cc={readContext:ya,use:ns,useCallback:function(e,t){return Qo().memoizedState=[e,t===void 0?null:t],e},useContext:ya,useEffect:Ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),As(4194308,4,Rs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return As(4194308,4,e,t)},useInsertionEffect:function(e,t){As(4,2,e,t)},useMemo:function(e,t){var n=Qo();t=t===void 0?null:t;var r=e();if(X){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Qo();if(n!==void 0){var i=n(t);if(X){$e(!0);try{n(t)}finally{$e(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ec.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=Qo();return e={current:e},t.memoizedState=e},useState:function(e){e=ms(e);var t=e.queue,n=tc.bind(null,Y,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Bs,useDeferredValue:function(e,t){return Us(Qo(),e,t)},useTransition:function(){var e=ms(!1);return e=Gs.bind(null,Y,e.queue,!0,!1),Qo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Y,a=Qo();if(G){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xu===null)throw Error(i(349));Z&127||ls(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ms(ds.bind(null,r,o,e),[e]),r.flags|=2048,Os(9,{destroy:void 0},us.bind(null,r,o,n,t),null),n},useId:function(){var e=Qo(),t=Xu.identifierPrefix;if(G){var n=qi,r=Ki;n=(r&~(1<<32-et(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=zo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Ho++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Xs,useFormState:Cs,useActionState:Cs,useOptimistic:function(e){var t=Qo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=rc.bind(null,Y,!0,n),n.dispatch=t,[e,t]},useMemoCache:rs,useCacheRefresh:function(){return Qo().memoizedState=$s.bind(null,Y)},useEffectEvent:function(e){var t=Qo(),n={impl:e};return t.memoizedState=n,function(){if(Yu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},lc={readContext:ya,use:ns,useCallback:Vs,useContext:ya,useEffect:Ns,useImperativeHandle:zs,useInsertionEffect:Is,useLayoutEffect:Ls,useMemo:Hs,useReducer:as,useRef:ks,useState:function(){return as(is)},useDebugValue:Bs,useDeferredValue:function(e,t){return Ws($o(),Fo.memoizedState,e,t)},useTransition:function(){var e=as(is)[0],t=$o().memoizedState;return[typeof e==`boolean`?e:ts(e),t]},useSyncExternalStore:cs,useId:Zs,useHostTransitionStatus:Xs,useFormState:ws,useActionState:ws,useOptimistic:function(e,t){return hs($o(),Fo,e,t)},useMemoCache:rs,useCacheRefresh:Qs,useEffectEvent:Fs},uc={readContext:ya,use:ns,useCallback:Vs,useContext:ya,useEffect:Ns,useImperativeHandle:zs,useInsertionEffect:Is,useLayoutEffect:Ls,useMemo:Hs,useReducer:ss,useRef:ks,useState:function(){return ss(is)},useDebugValue:Bs,useDeferredValue:function(e,t){var n=$o();return Fo===null?Us(n,e,t):Ws(n,Fo.memoizedState,e,t)},useTransition:function(){var e=ss(is)[0],t=$o().memoizedState;return[typeof e==`boolean`?e:ts(e),t]},useSyncExternalStore:cs,useId:Zs,useHostTransitionStatus:Xs,useFormState:Ds,useActionState:Ds,useOptimistic:function(e,t){var n=$o();return Fo===null?(n.baseState=e,[e,n.queue.dispatch]):hs(n,Fo,e,t)},useMemoCache:rs,useCacheRefresh:Qs,useEffectEvent:Fs};function dc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:E({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var fc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Od(),i=lo(r);i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(jd(t,e,r),fo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Od(),i=lo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(jd(t,e,r),fo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Od(),r=lo(n);r.tag=2,t!=null&&(r.callback=t),t=uo(e,r,n),t!==null&&(jd(t,e,n),fo(t,e,n))}};function pc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Rr(n,r)||!Rr(i,a):!0}function mc(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&&fc.enqueueReplaceState(t,t.state,null)}function hc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=E({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function gc(e){gi(e)}function _c(e){console.error(e)}function vc(e){gi(e)}function yc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function bc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function xc(e,t,n){return n=lo(n),n.tag=3,n.payload={element:null},n.callback=function(){yc(e,t)},n}function Sc(e){return e=lo(e),e.tag=3,e}function Cc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){bc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){bc(t,n,r),typeof i!=`function`&&(hd===null?hd=new Set([this]):hd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function wc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ga(t,n,a,!0),n=Co.current,n!==null){switch(n.tag){case 31:case 13:case 19:return wo===null?Ud():n.alternate===null&&nd===0&&(nd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ga?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ff(e,r,a)),!1;case 22:return n.flags|=65536,r===Ga?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ff(e,r,a)),!1}throw Error(i(435,n.tag))}return ff(e,r,a),Ud(),!1}if(G)return t=Co.current,t===null?(r!==na&&(t=Error(i(423),{cause:r}),la(Ri(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ri(r,n),a=xc(e.stateNode,r,a),po(e,a),nd!==4&&(nd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==na&&(e=Error(i(422),{cause:r}),la(Ri(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ri(o,n),cd===null?cd=[o]:cd.push(o),nd!==4&&(nd=2),t===null)return!0;r=Ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=xc(n.stateNode,r,e),po(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(hd===null||!hd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Sc(a),Cc(a,e,n,r),po(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Tc=Error(i(461)),Ec=!1;function Dc(e,t,n,r){t.child=e===null?ao(t,null,n,r):io(t,e.child,n,r)}function Oc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return va(t),r=Go(e,t,n,o,a,i),s=Yo(),e!==null&&!Ec?(Xo(e,t,i),nl(e,t,i)):(G&&s&&Xi(t),t.flags|=1,Dc(e,t,r,i),t.child)}function kc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ki(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Ac(e,t,a,r,i)):(e=Mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!rl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return nl(e,t,i)}return t.flags|=1,e=Ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref){if(Ec=!1,t.pendingProps=r=a,rl(e,i))e.flags&131072&&(Ec=!0);else return t.lanes=e.lanes,nl(e,t,i)}}return Rc(e,t,n,r,i)}function jc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Nc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ba(t,a===null?null:a.cachePool),a===null?xo():bo(t,a),Do(t);else return r=t.lanes=536870912,Nc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ba(t,null),xo(),Oo()):(Ba(t,a.cachePool),bo(t,a),Oo(),t.memoizedState=null);return Dc(e,t,i,n),t.child}function Mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Nc(e,t,n,r,i){var a=za();return a=a===null?null:{parent:Ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ba(t,null),xo(),Do(t),e!==null&&ga(e,t,r,!0),t.childLanes=i,null}function Pc(e,t){return t=qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Fc(e,t,n){return io(t,e.child,null,n),e=Pc(t,t.pendingProps),e.flags|=2,ko(t),t.memoizedState=null,e}function Ic(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(G){if(r.mode===`hidden`)return e=Pc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Mc(null,e);if(Eo(t),(e=$i)?(e=am(e,ta),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ra(t);return t.lanes=536870912,null}return Pc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Eo(t),a){if(t.flags&256)t.flags&=-257,t=Fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ec||ga(e,t,n,!1),a=(n&e.childLanes)!==0,Ec||a){if(vo.current===null){if(r=Xu,r!==null&&(s=vt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ci(e,s),jd(r,e,s),Tc;Ud()}t=Fc(e,t,n)}else e=o.treeContext,$i=lm(s.nextSibling),Qi=t,G=!0,ea=null,ta=!1,e!==null&&Zi(t,e),t=Pc(t,r),t.flags|=134221824;return t}return e=Ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Lc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Rc(e,t,n,r,i){return va(t),n=Go(e,t,n,r,void 0,i),r=Yo(),e!==null&&!Ec?(Xo(e,t,i),nl(e,t,i)):(G&&r&&Xi(t),t.flags|=1,Dc(e,t,n,i),t.child)}function zc(e,t,n,r,i,a){return va(t),t.updateQueue=null,n=qo(t,r,n,i),Ko(e),r=Yo(),e!==null&&!Ec?(Xo(e,t,a),nl(e,t,a)):(G&&r&&Xi(t),t.flags|=1,Dc(e,t,n,a),t.child)}function Bc(e,t,n,r,i){if(va(t),t.stateNode===null){var a=Ei,o=n.contextType;typeof o==`object`&&o&&(a=ya(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=fc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},so(t),o=n.contextType,a.context=typeof o==`object`&&o?ya(o):Ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(dc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&fc.enqueueReplaceState(a,a.state,null),ho(t,r,a,i),J(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=hc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ei,typeof u==`object`&&u&&(o=ya(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&mc(t,a,r,o),oo=!1;var f=t.memoizedState;a.state=f,ho(t,r,a,i),J(),l=t.memoizedState,s||f!==l||oo?(typeof d==`function`&&(dc(t,n,d,r),l=t.memoizedState),(c=oo||pc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,co(e,t),o=t.memoizedProps,u=hc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ei,typeof l==`object`&&l&&(c=ya(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&mc(t,a,r,c),oo=!1,f=t.memoizedState,a.state=f,ho(t,r,a,i),J();var p=t.memoizedState;o!==d||f!==p||oo||e!==null&&e.dependencies!==null&&_a(e.dependencies)?(typeof s==`function`&&(dc(t,n,s,r),p=t.memoizedState),(u=oo||pc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&_a(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Lc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=io(t,e.child,null,i),t.child=io(t,null,n,i)):Dc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=nl(e,t,i),e}function Vc(e,t,n,r){return sa(),t.flags|=256,Dc(e,t,n,r),t.child}var Hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uc(e){return{baseLanes:e,cachePool:Va()}}function Wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=od),e}function Gc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ao.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(G){if(i?To(t):Oo(),(e=$i)?(e=am(e,ta),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ra(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Oo(),i=t.mode,a=qc({mode:`hidden`,children:a},i),r=Ni(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Uc(n),r.childLanes=Wc(e,o,n),t.memoizedState=Hc,Mc(null,r)):(To(t),Kc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Yc(e,t,a,o,r,c,s,n)}return i?(Oo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ai(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ni(i,a,n,null),i.flags|=2):i=Ai(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Mc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Uc(n):(a=i.cachePool,a===null?a=Va():(s=Ta._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Wc(e,o,n),t.memoizedState=Hc,Mc(e.child,r)):(To(t),n=e.child,e=n.sibling,n=Ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Kc(e,t){return t=qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function qc(e,t){return e=Oi(22,e,null,t),e.lanes=0,e}function Jc(e,t,n){return io(t,e.child,null,n),e=Kc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Yc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(To(t),t.flags&=-257,Jc(e,t,c)):t.memoizedState===null?(Oo(),o=a.fallback,s=t.mode,a=qc({mode:`visible`,children:a.children},s),o=Ni(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,io(t,e.child,null,c),a=t.child,a.memoizedState=Uc(c),a.childLanes=Wc(e,r,c),t.memoizedState=Hc,Mc(null,a)):(Oo(),t.child=e.child,t.flags|=128,null);if(To(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,la({value:a,source:null,stack:null})),Jc(e,t,c)}if(Ec||ga(e,t,c,!1),r=(c&e.childLanes)!==0,Ec||r){if(vo.current!==null)return Jc(e,t,c);if(r=Xu,r!==null&&(a=vt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ci(e,a),jd(r,e,a),Tc;return om(o)||Ud(),Jc(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,$i=lm(o.nextSibling),Qi=t,G=!0,ea=null,ta=!1,e!==null&&Zi(t,e),t=Kc(t,a.children),t.flags|=134221824,t)}function Xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ma(e.return,t,n)}function Zc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&No(n)===null&&(t=e),e=e.sibling}return t}function Qc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function $c(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function el(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ao.current;if(t.flags&128)return jo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,jo(t,o),i===`backwards`&&e!==null?($c(e),Dc(e,t,r,n),$c(e)):Dc(e,t,r,n),r=G?Hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xc(e,n,t);else if(e.tag===19)Xc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=Zc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,$c(t)),Qc(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&No(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Qc(t,!0,n,null,a,r);break;case`together`:Qc(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Zc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Qc(t,!1,i,n,a,r)}return t.child}function tl(e,t,n){var r=t.pendingProps;return pa(t,t.type,r.value),Dc(e,t,r.children,n),t.child}function nl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),rd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ga(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function rl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&_a(e)))}function il(e,t,n){switch(t.tag){case 3:Oe(t,t.stateNode.containerInfo),pa(t,Ta,e.memoizedState.cache),sa();break;case 27:case 5:Ae(t);break;case 4:Oe(t,t.stateNode.containerInfo);break;case 10:pa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return To(t),t.flags|=128,null;r=ga(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Gc(e,t,n):(To(t),e=nl(e,t,n),e===null?null:e.sibling)}To(t);break;case 19:if(t.flags&128)return el(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ga(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return el(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),jo(t,Ao.current),r)break;return null;case 22:return t.lanes=0,jc(e,t,n,t.pendingProps);case 24:pa(t,Ta,e.memoizedState.cache)}return nl(e,t,n)}function al(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ec=!0;else{if(!rl(e,n)&&!(t.flags&128))return Ec=!1,il(e,t,n);Ec=!!(e.flags&131072)}}else Ec=!1,G&&t.flags&1048576&&Yi(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ja(t.elementType),t.type=e,typeof e==`function`)ki(e)?(r=hc(e,r),t.tag=1,t=Bc(null,t,e,r,n)):(t.tag=0,t=Rc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ae){t.tag=11,t=Oc(null,t,e,r,n);break a}if(a===se){t.tag=14,t=kc(null,t,e,r,n);break a}if(a===ie){t.tag=10,t.type=e,t=tl(null,t,n);break a}}throw t=ge(e)||e,Error(i(306,t,``))}}return t;case 0:return Rc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=hc(r,t.pendingProps),Bc(e,t,r,a,n);case 3:a:{if(Oe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,co(e,t),ho(t,r,null,n);var s=t.memoizedState;if(r=s.cache,pa(t,Ta,r),r!==o.cache&&ha(t,[Ta],n,!0),J(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Vc(e,t,r,n);break a}if(r!==a){a=Ri(Error(i(424)),t),la(a),t=Vc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for($i=lm(e.firstChild),Qi=t,G=!0,ea=null,ta=!0,n=ao(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(sa(),r===a){t=nl(e,t,n);break a}Dc(e,t,r,n)}t=t.child}return t;case 26:return Lc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:G||(t.stateNode=fp(t.type,t.pendingProps,Ee.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ae(t),e===null&&G&&(r=t.stateNode=hm(t.type,t.pendingProps,Ee.current),Qi=t,ta=!0,a=$i,Sp(t.type)?(um=a,$i=lm(r.firstChild)):$i=a),Dc(e,t,t.pendingProps.children,n),Lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&G&&((a=r=$i)&&(r=rm(r,t.type,t.pendingProps,ta),r===null?a=!1:(t.stateNode=r,Qi=t,$i=lm(r.firstChild),ta=!1,a=!0)),a||ra(t)),Ae(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(a,o)?r=null:s!==null&&pp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Go(e,t,Jo,null,null,n),sh._currentValue=a),Lc(e,t),Dc(e,t,r,n),t.child;case 6:return e===null&&G&&((e=n=$i)&&(n=im(n,t.pendingProps,ta),n===null?e=!1:(t.stateNode=n,Qi=t,$i=null,e=!0)),e||ra(t)),null;case 13:return Gc(e,t,n);case 4:return Oe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=io(t,null,r,n):Dc(e,t,r,n),t.child;case 11:return Oc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Lc(e,t),Dc(e,t,r,n),t.child;case 8:return Dc(e,t,t.pendingProps.children,n),t.child;case 12:return Dc(e,t,t.pendingProps.children,n),t.child;case 10:return tl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,va(t),a=ya(a),r=r(a),t.flags|=1,Dc(e,t,r,n),t.child;case 14:return kc(e,t,t.type,t.pendingProps,n);case 15:return Ac(e,t,t.type,t.pendingProps,n);case 19:return el(e,t,n);case 31:return Ic(e,t,n);case 22:return jc(e,t,n,t.pendingProps);case 24:return va(t),r=ya(Ta),e===null?(a=za(),a===null&&(a=Xu,o=Ea(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},so(t),pa(t,Ta,a)):((e.lanes&n)!==0&&(co(e,t),ho(t,null,null,n),J()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,pa(t,Ta,r),r!==a.cache&&ha(t,[Ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),pa(t,Ta,r))),Dc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:G&&Xi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Lc(e,t),Dc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ol(e){e.flags|=4}function sl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Bd())e.flags|=8192;else throw Ya=Ga,Ua}}else e.flags&=-16777217}function cl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Bd())e.flags|=8192;else throw Ya=Ga,Ua}}function ll(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,sd|=t)}function ul(e,t){if(!G)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function dl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function fl(e,t,n){var r=t.pendingProps;switch(W(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dl(t),null;case 1:return dl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),K(Ta),ke(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(oa(t)?ol(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ca())),dl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ol(t),o===null?(dl(t),sl(t,a,null,r,n)):(dl(t),cl(t,o))):o?o===e.memoizedState?(dl(t),t.flags&=-16777217):(ol(t),dl(t),cl(t,o)):(e=e.memoizedProps,e!==r&&ol(t),dl(t),sl(t,a,e,r,n)),null;case 27:if(je(t),n=Ee.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}e=we.current,oa(t)?ia(t,e):(e=hm(a,r,n),t.stateNode=e,ol(t))}return dl(t),t.subtreeFlags&=-33554433,null;case 5:if(je(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}if(o=we.current,oa(t))ia(t,o);else{var s=lp(Ee.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[L]=t,o[wt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ol(t)}}return dl(t),t.subtreeFlags&=-33554433,sl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ee.current,oa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Qi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[L]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||ra(t,!0)}else e=lp(e).createTextNode(r),e[L]=t,t.stateNode=e}return dl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=oa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[L]=t}else sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),e=!1}else n=ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ko(t),t):(ko(t),null);if(t.flags&128)throw Error(i(558))}return dl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=oa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[L]=t}else sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),a=!1}else a=ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ko(t),t):(ko(t),null)}return ko(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ll(t,t.updateQueue),dl(t),null);case 4:return ke(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,dl(t),null;case 10:return K(t.type),dl(t),null;case 19:if(Mo(t),r=t.memoizedState,r===null)return dl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ul(r,!1);else{if(nd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=No(e),o!==null){for(t.flags|=128,ul(r,!1),e=o.updateQueue,t.updateQueue=e,ll(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return jo(t,Ao.current&1|2),G&&Ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ue()>pd&&(t.flags|=128,a=!0,ul(r,!1),t.lanes=4194304)}}else{if(!a){if(e=No(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ll(t,e),ul(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!G)return dl(t),null}else 2*Ue()-r.renderingStartTime>pd&&n!==536870912&&(t.flags|=128,a=!0,ul(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ue(),e.sibling=null,o=Ao.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||G?jo(t,o):(n=o,P(Co,t),P(Ao,n),wo===null&&(wo=t)),G&&Ji(t,r.treeForkCount),e}return dl(t),null;case 22:case 23:return ko(t),So(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(dl(t),t.subtreeFlags&6&&(t.flags|=8192)):dl(t),n=t.updateQueue,n!==null&&ll(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Ce(Ra),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),K(Ta),dl(t),null;case 25:return null;case 30:return t.flags|=33554432,dl(t),null}throw Error(i(156,t.tag))}function pl(e,t){switch(W(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return K(Ta),ke(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return je(t),null;case 31:if(t.memoizedState!==null){if(ko(t),t.alternate===null)throw Error(i(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ko(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Mo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ke(),null;case 10:return K(t.type),null;case 22:case 23:return ko(t),So(),e!==null&&Ce(Ra),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return K(Ta),null;case 25:return null;default:return null}}function ml(e,t){switch(W(t),t.tag){case 3:K(Ta),ke();break;case 26:case 27:case 5:je(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&ko(t);break;case 13:ko(t);break;case 19:Mo(t);break;case 10:K(t.type);break;case 22:case 23:ko(t),So(),e!==null&&Ce(Ra);break;case 24:K(Ta)}}function hl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){df(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){df(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){df(t,t.return,e)}}function _l(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{_o(t,n)}catch(t){df(e,e.return,t)}}}function vl(e,t,n){n.props=hc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){df(e,t,n)}}function yl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=pi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);m(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){df(e,t,n)}}function bl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){df(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){df(e,t,n)}else n.current=null}}function xl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Sl(e){for(var t=e.return;t!==null&&(Tl(t)&&em(e.stateNode,t.stateNode),!wl(t));)t=t.return}function Cl(e){for(var t=e.return;t!==null&&(Tl(t)&&tm(e.stateNode,t.stateNode),!wl(t));)t=t.return}function wl(e){return e.tag===5||e.tag===3||e.tag===27}function Tl(e){return e&&e.tag===7&&e.stateNode!==null}function El(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){df(e,e.return,t)}}function Dl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[wt]=t}catch(t){df(e,e.return,t)}}function Ol(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function kl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ol(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.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Al(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gn)),xl(e,r),z=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Al(e,t,n,r),e=e.sibling;e!==null;)Al(e,t,n,r),e=e.sibling}function jl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),xl(e,r),z=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[L]=e,t[wt]=n}catch(t){df(e,e.return,t)}}var Nl=!1,Pl=null;function Fl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Nl=!0)}var Il=null;function Ll(){var e=Il;return Il=null,e}var Rl=0;function zl(e,t,n,r,i){return Rl=0,Bl(e.child,t,n,r,i)}function Bl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Nl=!0,Tp(o,Rl===0?t:t+`_`+Rl,n),Rl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Bl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Vl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Vl(e.child,t)),e=e.sibling}function Hl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Hl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=hi(t.default,t.share),t!==`none`&&(zl(e,n,t,null,!1)||Vl(e.child,!1))}e=e.sibling}}function Ul(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=pi(r,n),a=hi(r.default,n.paired?r.share:r.enter);a===`none`?Hl(e):zl(e,i,a,null,!1)?(Hl(e),n.paired||t||Ad(e,r.onEnter)):Vl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ul(e,t),e=e.sibling;else Hl(e)}function Wl(e){if(Pl!==null&&Pl.size!==0){var t=Pl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=hi(n.default,n.share);if(a!==`none`&&(zl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ad(e,n.onShare)):Vl(e.child,!1)),t.delete(r),t.size===0)break}}}Wl(e)}e=e.sibling}}}function Gl(e){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode),r=Pl===null?void 0:Pl.get(n),i=hi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(zl(e,n,i,null,!1)?r===void 0?Ad(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Pl.delete(n),Ad(e,t.onShare)):Vl(e.child,!1)),Pl!==null&&Wl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e),e=e.sibling;else Pl!==null&&Wl(e)}function Kl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode);t=hi(t.default,t.update),e.flags&=-5,t!==`none`&&zl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Kl(e);e=e.sibling}}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Vl(e.child,!1))}ql(e)}e=e.sibling}}function Jl(e){if(e.tag===30)e.stateNode.paired=null,Vl(e.child,!1),ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else ql(e)}function Yl(e){for(e=e.child;e!==null;)e.tag===30?Vl(e.child,!1):e.subtreeFlags&33554432&&Yl(e),e=e.sibling}function Xl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Rl<a.length){var l=a[Rl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Rl===0?n:n+`_`+Rl,i),s&&e.flags&4||(Il===null&&(Il=[]),Il.push(c,Rl===0?r:r+`_`+Rl,t.memoizedProps)),Rl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Xl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Zl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=pi(n,r),a=hi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Rl=0,i=Xl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ad(e,n.onUpdate))}else e.subtreeFlags&33554432&&Zl(e,t);e=e.sibling}}var Ql=!1,$l=!1,eu=!1,tu=!1,nu=typeof WeakSet==`function`?WeakSet:Set,ru=null,iu=!1,au=!1,ou=!1,su=!1;function cu(e,t,n){if(e=e.containerInfo,sp=gh,e=Ur(e),Wr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,ru=t,t=n?9270:1024;ru!==null;){if(e=ru,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Gl(r[a]);if(e.alternate===null&&e.flags&2)n&&Fl(e),lu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Gl(r),lu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Fl(e),lu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ru=r):(n&&Kl(e),lu(n))}}Pl=null}function lu(e){for(;ru!==null;){var t=ru,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=hc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){df(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=pi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=hi(a.default,a.update),a!==`none`&&zl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,ru=r;break}ru=t.return}}function uu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Au(e,n),r&4&&hl(5,n);break;case 1:if(Au(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){df(n,n.return,e)}else{var i=hc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){df(n,n.return,e)}}}r&64&&_l(n),r&512&&yl(n,n.return);break;case 3:if(Au(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{_o(e,t)}catch(e){df(n,n.return,e)}}break;case 27:t===null&&r&4&&Ml(n);case 26:case 5:Au(e,n),t===null&&r&4&&El(n),r&512&&yl(n,n.return);break;case 12:Au(e,n);break;case 31:Au(e,n),r&4&&yu(e,n);break;case 13:Au(e,n),r&4&&bu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=hf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||Ql,!r){var a=t!==null&&t.memoizedState!==null||$l;t=Ql,i=$l,Ql=r,($l=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Mu(e,n,r)):Au(e,n),Ql=t,$l=i}break;case 30:Au(e,n),r&512&&yl(n,n.return);break;case 7:r&512&&yl(n,n.return);default:Au(e,n)}}function du(e,t){for(e=e.child;e!==null;)fu(e,t),e=e.sibling}function fu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){df(e,e.return,t)}pu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,z=!0}catch(t){df(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){df(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&du(e,t);break;default:du(e,t)}}function pu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:fu(n,r);break a;case 22:n.memoizedState===null&&pu(n,r);break a;default:pu(n,r)}}e=e.sibling}}function mu(e){var t=e.alternate;t!==null&&(e.alternate=null,mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var hu=null,gu=!1;function _u(e,t,n){for(n=n.child;n!==null;)vu(e,t,n),n=n.sibling}function vu(e,t,n){if(Qe&&typeof Qe.onCommitFiberUnmount==`function`)try{Qe.onCommitFiberUnmount(Ze,n)}catch{}switch(n.tag){case 26:$l||bl(n,t),_u(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!$l&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$l||bl(n,t),Cl(n);var r=hu,i=gu;Sp(n.type)&&(hu=n.stateNode,gu=!1),_u(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),hu=r,gu=i;break;case 5:$l||bl(n,t),Cl(n);case 6:if(n.tag===6&&Cl(n),r=hu,i=gu,hu=null,_u(e,t,n),hu=r,gu=i,hu!==null){if(gu)try{(hu.nodeType===9?hu.body:hu.nodeName===`HTML`?hu.ownerDocument.body:hu).removeChild(n.stateNode),z=!0}catch(e){df(n,t,e)}else try{hu.removeChild(n.stateNode),z=!0}catch(e){df(n,t,e)}}break;case 18:hu!==null&&(gu?(e=hu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(hu,n.stateNode));break;case 4:r=hu,i=gu,hu=n.stateNode.containerInfo,gu=!0,_u(e,t,n),hu=r,gu=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),$l||gl(4,n,t),_u(e,t,n);break;case 1:$l||(bl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&vl(n,t,r)),_u(e,t,n);break;case 21:_u(e,t,n);break;case 22:$l=(r=$l)||n.memoizedState!==null,_u(e,t,n),$l=r;break;case 30:bl(n,t),_u(e,t,n);break;case 7:$l||bl(n,t),_u(e,t,n);break;default:_u(e,t,n)}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){df(t,t.return,e)}}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){df(t,t.return,e)}}function xu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nu),t;default:throw Error(i(435,e.tag))}}function Su(e,t){var n=xu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=gf.bind(null,e,t);t.then(r,r)}})}function Cu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){hu=l.stateNode,gu=!1;break a}break;case 5:hu=l.stateNode,gu=!1;break a;case 3:case 4:hu=l.stateNode.containerInfo,gu=!0;break a}l=l.return}if(hu===null)throw Error(i(160));vu(s,c,o),hu=null,gu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tu(t,e,n),t=t.sibling}var wu=null;function Tu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Cu(t,e,n),Eu(e),a&4&&(gl(3,e,e.return),hl(3,e),gl(5,e,e.return));break;case 1:Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),a&64&&Ql&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=wu,Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(Ql)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[At]||r[L]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),np(r,t,n),r[L]=e,Lt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[L]=e,Lt(r),t=r}e.stateNode=t}}else Ql||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Dl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||$l||t.parentNode.removeChild(t)):a.count--,n===null?Ql||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),r!==null&&a&4&&Dl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=eu,eu=!1,Cu(t,e,n),eu=o,Eu(e),a&512&&($l||r===null||bl(r,r.return)),e.flags&32){t=e.stateNode;try{cn(t,``),z=!0}catch(t){df(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Dl(e,t,r===null?t:r.memoizedProps)),a&1024&&(tu=!0);break;case 6:if(Cu(t,e,n),Eu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,z=!0}catch(t){df(e,e.return,t)}}break;case 3:if(z=!1,Wm=null,o=wu,wu=bm(t.containerInfo),Cu(t,e,n),wu=o,Eu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){df(e,e.return,t)}tu&&(tu=!1,Du(e)),z=!1;break;case 4:a=eu,eu=Ql,r=Kt(),o=wu,wu=bm(e.stateNode.containerInfo),Cu(t,e,n),Eu(e),wu=o,z&&au&&(ou=!0),z=r,eu=a;break;case 12:Cu(t,e,n),Eu(e);break;case 31:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 13:Cu(t,e,n),Eu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(dd=Ue()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Ql,l=$l,u=eu;Ql=c||o,eu=u||o,$l=l||s,Cu(t,e,n),$l=l,eu=u,Ql=c,Eu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Ql||$l||(t=s||$l,n=Ql,r=$l,Ql=o||Ql,$l=t,ju(e,2),Ql=n,$l=r),!o&&eu||du(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Su(e,n))));break;case 19:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 30:a&512&&($l||r===null||bl(r,r.return)),a=Kt(),o=au,s=(n&335544064)===n,c=e.memoizedProps,au=s&&hi(c.default,c.update)!==`none`,Cu(t,e,n),Eu(e),s&&r!==null&&z&&(e.flags|=4),au=o,z=a;break;case 21:break;case 7:a&512&&($l||r===null||bl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Cu(t,e,n),Eu(e)}}function Eu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ol(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Tl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(wl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;jl(e,kl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(cn(l,``),n.flags&=-33),jl(e,kl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Al(e,kl(e),u,s);break;default:throw Error(i(161))}}catch(t){df(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Du(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Du(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Ou(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ku(t,e),t=t.sibling;else Zl(t,!1)}function ku(e,t){var n=e.alternate;if(n===null)Ul(e,!1);else switch(e.tag){case 3:if(su=iu=!1,Ll(),Ou(t,e),!iu&&!ou){if(e=Il,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),su=!0}Il=null;break;case 5:Ou(t,e);break;case 4:r=iu,iu=!1,Ou(t,e),iu&&(ou=!0),iu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ou(t,e):Ul(e,!1));break;case 30:r=iu,i=Ll(),iu=!1,Ou(t,e),iu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=pi(a,o),o=pi(n.memoizedProps,o);var s=hi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Rl=0,t=Xl(e,n,t,o,s,a,!0),Rl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ad(e,e.memoizedProps.onUpdate),Il=i):i!==null&&(i.push.apply(i,Il),Il=i),iu=e.flags&32?!0:r;break;default:Ou(t,e)}}function Au(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uu(e,t.alternate,t),t=t.sibling}function ju(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:gl(4,n,n.return),ju(n,r);break;case 1:bl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&vl(n,n.return,i),ju(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:bl(n,n.return),n.tag!==5&&n.tag!==27||Cl(n),ju(n,r);break;case 6:Cl(n);break;case 26:bl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||$l||i.parentNode.removeChild(i),ju(n,r);break;case 22:n.memoizedState===null&&ju(n,r);break;case 30:bl(n,n.return),ju(n,r);break;case 7:bl(n,n.return);default:ju(n,r)}e=e.sibling}}function Mu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Mu(i,a,n),hl(4,a);break;case 1:if(Mu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){df(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)go(l[i],c)}catch(e){df(r,r.return,e)}}s&&o&64&&_l(a),yl(a,a.return);break;case 27:n&2&&Ml(a);case 5:a.tag!==5&&a.tag!==27||Sl(a),Mu(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 6:Sl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Ql||Km(bm(c.ownerDocument),a.type,c),Mu(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 12:Mu(i,a,n);break;case 31:Mu(i,a,n),s&&o&4&&yu(i,a);break;case 13:Mu(i,a,n),s&&o&4&&bu(i,a);break;case 22:a.memoizedState===null&&Mu(i,a,n),yl(a,a.return);break;case 30:Mu(i,a,n),yl(a,a.return);break;case 7:yl(a,a.return);default:Mu(i,a,n)}t=t.sibling}}function Nu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Da(n))}function Pu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Da(e))}function Fu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Iu(e,t,n,r),t=t.sibling;else i&&Yl(t)}function Iu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Jl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Fu(e,t,n,r),a&2048&&hl(9,t);break;case 1:Fu(e,t,n,r);break;case 3:Fu(e,t,n,r),i&&su&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Da(a)));break;case 12:if(a&2048){Fu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){df(t,t.return,e)}}else Fu(e,t,n,r);break;case 31:Fu(e,t,n,r);break;case 13:Fu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Jl(t),o._visibility&2?Fu(e,t,n,r):(o._visibility|=2,Lu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Jl(s),o._visibility&2?Fu(e,t,n,r):Ru(e,t)),a&2048&&Nu(s,t);break;case 24:Fu(e,t,n,r),a&2048&&Pu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Vl(a.child,!0),Vl(t.child,!0))),Fu(e,t,n,r);break;default:Fu(e,t,n,r)}}function Lu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Lu(a,o,s,c,i),hl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Lu(a,o,s,c,i)):u._visibility&2?Lu(a,o,s,c,i):Ru(a,o),i&&l&2048&&Nu(o.alternate,o);break;case 24:Lu(a,o,s,c,i),i&&l&2048&&Pu(o.alternate,o);break;default:Lu(a,o,s,c,i)}t=t.sibling}}function Ru(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ru(n,r),i&2048&&Nu(r.alternate,r);break;case 24:Ru(n,r),i&2048&&Pu(r.alternate,r);break;default:Ru(n,r)}t=t.sibling}}var zu=8192;function Bu(e,t,n){if(e.subtreeFlags&zu)for(e=e.child;e!==null;)Vu(e,t,n),e=e.sibling}function Vu(e,t,n){switch(e.tag){case 26:Bu(e,t,n),e.flags&zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,wu,e.memoizedState,e.memoizedProps));break;case 5:Bu(e,t,n),e.flags&zu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=wu;wu=bm(e.stateNode.containerInfo),Bu(e,t,n),wu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=zu,zu=16777216,Bu(e,t,n),zu=r):Bu(e,t,n));break;case 30:if((e.flags&zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Pl===null&&(Pl=new Map),Pl.set(r,i)}Bu(e,t,n);break;default:Bu(e,t,n)}}function Hu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Uu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Wu(e),e=e.sibling}function Wu(e){switch(e.tag){case 0:case 11:case 15:Uu(e),e.flags&2048&&gl(9,e,e.return);break;case 3:Uu(e);break;case 12:Uu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gu(e)):Uu(e);break;default:Uu(e)}}function Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gl(8,t,t.return),Gu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Gu(t));break;default:Gu(t)}e=e.sibling}}function Ku(e,t){for(;ru!==null;){var n=ru;switch(n.tag){case 0:case 11:case 15:gl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Da(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ru=r;else a:for(n=e;ru!==null;){r=ru;var i=r.sibling,a=r.return;if(mu(r),r===n){ru=null;break a}if(i!==null){i.return=a,ru=i;break a}ru=a}}}var qu={getCacheForType:function(e){var t=ya(Ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ya(Ta).controller.signal}},Ju=typeof WeakMap==`function`?WeakMap:Map,Yu=0,Xu=null,Zu=null,Z=0,Q=0,Qu=null,$u=!1,$=!1,ed=!1,td=0,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=null,ld=null,ud=!1,dd=0,fd=0,pd=1/0,md=null,hd=null,gd=0,_d=null,vd=null,yd=0,bd=0,xd=null,Sd=null,Cd=null,wd=null,Td=null,Ed=0,Dd=null;function Od(){return Yu&2&&Z!==0?Z&-Z:N.T===null?xt():Mf()}function kd(){if(od===0){if(!(Z&536870912)||G){var e=at;at<<=1,!(at&3932160)&&(at=262144),od=e}else od=536870912}return e=Co.current,e!==null&&(e.flags|=32),od}function Ad(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(pi(e.memoizedProps,n))),wd===null&&(wd=[]),wd.push(t.bind(null,r))}}function jd(e,t,n){(e===Xu&&(Q===2||Q===9)||e.cancelPendingCommit!==null)&&(Rd(e,0),Fd(e,Z,od,!1)),mt(e,n),(!(Yu&2)||e!==Xu)&&(e===Xu&&(!(Yu&2)&&(id|=n),nd===4&&Fd(e,Z,od,!1)),wf(e))}function Md(e,t,n){if(Yu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||lt(e,t),a=r?Kd(e,t):Wd(e,t,!0),o=r;do{if(a===0){$&&!r&&Fd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Pd(n))a=Wd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=cd;var l=c.current.memoizedState.isDehydrated;if(l&&(Rd(c,s).flags|=256),s=Wd(c,s,!1),s!==2&&s!==6){if(ed&&!l){c.errorRecoveryDisabledLanes|=o,id|=o,a=4;break a}o=ld,ld=a,o!==null&&(ld===null?ld=o:ld.push.apply(ld,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Rd(e,0),Fd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Fd(r,t,od,!$u);break a;case 2:ld=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=dd+300-Ue(),10<a)){if(Fd(r,t,od,!$u),ct(r,0,!0)!==0)break a;yd=t,r.timeoutHandle=gp(Nd.bind(null,r,n,ld,md,ud,t,od,id,sd,$u,o,`Throttled`,-0,0),a);break a}Nd(r,n,ld,md,ud,t,od,id,sd,$u,o,null,-0,0)}break}}while(1);wf(e)}function Nd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gn},Pl=null,Vu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?dd-Ue():(a&4194048)===a?fd-Ue():0,m=eh(d,m),m!==null)?(yd=a,e.cancelPendingCommit=m($d.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Fd(e,a,o,!l)):$d(e,t,a,n,r,i,o,s,c,l,u,d)}function Pd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Lr(a(),i))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 Fd(e,t,n,r){t=ut(e,t),t&=~ad,t&=~id,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-et(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&gt(e,n,t)}function Id(){return Yu&6?!0:(Tf(0,!1),!1)}function Ld(){if(Zu!==null){if(Q===0)var e=Zu.return;else e=Zu,fa=da=null,Zo(e),Qa=null,$a=0,e=Zu;for(;e!==null;)ml(e.alternate,e),e=e.return;Zu=null}}function Rd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),yd=0,Ld(),Xu=e,Zu=n=Ai(e.current,null),Z=t,Q=0,Qu=null,$u=!1,$=lt(e,t),ed=!1,sd=od=ad=id=rd=nd=0,ld=cd=null,ud=!1,td=ut(e,t),bi(),n}function zd(e,t){Y=null,N.H=sc,t===Ha||t===Wa?(t=Xa(),Q=3):t===Ua?(t=Xa(),Q=4):Q=t===Tc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Qu=t,Zu===null&&(nd=1,yc(e,Ri(t,e.current)))}function Bd(){var e=Co.current;return e===null?!0:(Z&4194048)===Z?wo===null:(Z&62914560)===Z||Z&536870912?e===wo:!1}function Vd(){var e=N.H;return N.H=sc,e===null?sc:e}function Hd(){var e=N.A;return N.A=qu,e}function Ud(){nd=4,$u||(Z&4194048)!==Z&&Co.current!==null||($=!0),!(rd&134217727)&&!(id&134217727)||Xu===null||Fd(Xu,Z,od,!1)}function Wd(e,t,n){var r=Yu;Yu|=2;var i=Vd(),a=Hd();(Xu!==e||Z!==t)&&(md=null,Rd(e,t)),t=!1;var o=nd;a:do try{if(Q!==0&&Zu!==null){var s=Zu,c=Qu;switch(Q){case 8:Ld(),o=6;break a;case 3:case 2:case 9:case 6:Co.current===null&&(t=!0);var l=Q;if(Q=0,Qu=null,Xd(e,s,c,l),n&&$){o=0;break a}break;default:l=Q,Q=0,Qu=null,Xd(e,s,c,l)}}Gd(),o=nd;break}catch(t){zd(e,t)}while(1);return t&&e.shellSuspendCounter++,fa=da=null,Yu=r,N.H=i,N.A=a,Zu===null&&(Xu=null,Z=0,bi()),o}function Gd(){for(;Zu!==null;)Jd(Zu)}function Kd(e,t){var n=Yu;Yu|=2;var r=Vd(),a=Hd();Xu!==e||Z!==t?(md=null,pd=Ue()+500,Rd(e,t)):$=lt(e,t);a:do try{if(Q!==0&&Zu!==null){t=Zu;var o=Qu;b:switch(Q){case 1:Q=0,Qu=null,Xd(e,t,o,1);break;case 2:case 9:if(Ka(o)){Q=0,Qu=null,Yd(t);break}t=function(){Q!==2&&Q!==9||Xu!==e||(Q=7),wf(e)},o.then(t,t);break a;case 3:Q=7;break a;case 4:Q=5;break a;case 7:Ka(o)?(Q=0,Qu=null,Yd(t)):(Q=0,Qu=null,Xd(e,t,o,7));break;case 5:var s=null;switch(Zu.tag){case 26:s=Zu.memoizedState;case 5:case 27:var c=Zu;if(s?Ym(s):c.stateNode.complete){Q=0,Qu=null;var l=c.sibling;if(l!==null)Zu=l;else{var u=c.return;u===null?Zu=null:(Zu=u,Zd(u))}break b}}Q=0,Qu=null,Xd(e,t,o,5);break;case 6:Q=0,Qu=null,Xd(e,t,o,6);break;case 8:Ld(),nd=6;break a;default:throw Error(i(462))}}qd();break}catch(t){zd(e,t)}while(1);return fa=da=null,N.H=r,N.A=a,Yu=n,Zu===null?(Xu=null,Z=0,bi(),nd):0}function qd(){for(;Zu!==null&&!Ve();)Jd(Zu)}function Jd(e){var t=al(e.alternate,e,td);e.memoizedProps=e.pendingProps,t===null?Zd(e):Zu=t}function Yd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=zc(n,t,t.pendingProps,t.type,void 0,Z);break;case 11:t=zc(n,t,t.pendingProps,t.type.render,t.ref,Z);break;case 5:Zo(t);var r=t;r===Qi&&(G?(aa(r),r.tag===5&&r.stateNode!=null&&($i=r.stateNode)):(aa(r),G=!0));default:ml(n,t),t=Zu=ji(t,td),t=al(n,t,td)}e.memoizedProps=e.pendingProps,t===null?Zd(e):Zu=t}function Xd(e,t,n,r){fa=da=null,Zo(t),Qa=null,$a=0;var i=t.return;try{if(wc(e,i,t,n,Z)){nd=1,yc(e,Ri(n,e.current)),Zu=null;return}}catch(t){if(i!==null)throw Zu=i,t;nd=1,yc(e,Ri(n,e.current)),Zu=null;return}t.flags&32768?(G||r===1?e=!0:$||Z&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=Co.current,r!==null&&r.tag===13&&(r.flags|=16384))),Qd(t,e)):Zd(t)}function Zd(e){var t=e;do{if(t.flags&32768){Qd(t,$u);return}e=t.return;var n=fl(t.alternate,t,td);if(n!==null){Zu=n;return}if(t=t.sibling,t!==null){Zu=t;return}Zu=t=e}while(t!==null);nd===0&&(nd=5)}function Qd(e,t){do{var n=pl(e.alternate,e);if(n!==null){n.flags&=32767,Zu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Zu=e;return}Zu=e=n}while(e!==null);nd=6,Zu=null}function $d(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do cf();while(gd!==0);if(Yu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Xu&&(Zu=Xu=null,Z=0),vd=t,_d=e,yd=n,xd=a,Sd=r,ef(e,t,n,s,c,l,f)}}function ef(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(bd=s,s|=yi,ht(e,n,s,r,i,a),wd=null,(n&335544064)===n?(Td=Aa(e),r=10262):(Td=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,_f(I,function(){return lf(),null})):(e.callbackNode=null,e.callbackPriority=0),Nl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,i=ve.p,ve.p=2,a=Yu,Yu|=4;try{cu(e,t,n)}finally{Yu=a,ve.p=i,N.T=r}}gd=1,Nl?Cd=Mp(o,e.containerInfo,Td,rf,af,nf,of,lf,tf,null,null):(rf(),af(),of())}function tf(e){if(gd!==0){var t=_d.onRecoverableError;t(e,{componentStack:null})}}function nf(){gd===3&&(gd=0,ku(vd,_d),gd=4)}function rf(){if(gd===1){gd=0;var e=_d,t=vd,n=yd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=N.T,N.T=null;var i=ve.p;ve.p=2;var a=Yu;Yu|=4;try{au=ou=!1,Tu(t,e,n),n=cp;var o=Ur(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Hr(s.ownerDocument.documentElement,s)){if(c!==null&&Wr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Vr(s,h),v=Vr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{Yu=a,ve.p=i,N.T=r}}e.current=t,gd=2}}function af(){if(gd===2){gd=0;var e=_d,t=vd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=ve.p;ve.p=2;var i=Yu;Yu|=4;try{uu(e,t.alternate,t)}finally{Yu=i,ve.p=r,N.T=n}}gd=3}}function of(){if(gd===4||gd===3){gd=0;var e=Cd;Cd=null,He();var t=_d,n=vd,r=yd,i=Sd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?gd=5:(gd=0,vd=_d=null,sf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(hd=null),bt(r),n=n.stateNode,Qe&&typeof Qe.onCommitFiberRoot==`function`)try{Qe.onCommitFiberRoot(Ze,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=N.T,a=ve.p,ve.p=2,N.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{N.T=n,ve.p=a}}if(i=wd,o=Td,Td=null,i!==null&&(wd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);yd&3&&cf(),wf(t),a=t.pendingLanes,r&261930&&a&42?t===Dd?Ed++:(Ed=0,Dd=t):(Ed=0,Dd=null),Tf(0,!1)}}function sf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Da(t)))}function cf(){return Cd!==null&&(Cd.skipTransition(),Cd=null),rf(),af(),of(),lf()}function lf(){if(gd!==5)return!1;var e=_d,t=bd;bd=0;var n=bt(yd),r=N.T,a=ve.p;try{ve.p=32>n?32:n,N.T=null,n=xd,xd=null;var o=_d,s=yd;if(gd=0,vd=_d=null,yd=0,Yu&6)throw Error(i(331));var c=Yu;if(Yu|=4,Wu(o.current),Iu(o,o.current,s,n),Yu=c,Tf(0,!1),Qe&&typeof Qe.onPostCommitFiberRoot==`function`)try{Qe.onPostCommitFiberRoot(Ze,o)}catch{}return!0}finally{ve.p=a,N.T=r,sf(e,t)}}function uf(e,t,n){t=Ri(n,t),t=xc(e.stateNode,t,2),e=uo(e,t,2),e!==null&&(mt(e,2),wf(e))}function df(e,t,n){if(e.tag===3)uf(e,e,n);else for(;t!==null;){if(t.tag===3){uf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(hd===null||!hd.has(r))){e=Ri(n,e),n=Sc(2),r=uo(t,n,2),r!==null&&(Cc(n,r,t,e),mt(r,2),wf(r));break}}t=t.return}}function ff(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ju;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ed=!0,i.add(n),e=pf.bind(null,e,t,n),t.then(e,e))}function pf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Z&n)===n&&(nd===4||nd===3&&(Z&62914560)===Z&&300>Ue()-dd?Yu&2?ad|=n:Rd(e,0):ad|=n,sd===Z&&(sd=0)),wf(e)}function mf(e,t){t===0&&(t=ft()),e=Ci(e,t),e!==null&&(mt(e,t),wf(e))}function hf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mf(e,n)}function gf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),mf(e,n)}function _f(e,t){return ze(e,t)}var vf=null,yf=null,bf=!1,xf=!1,Sf=!1,Cf=0;function wf(e){e!==yf&&e.next===null&&(yf===null?vf=yf=e:yf=yf.next=e),xf=!0,bf||(bf=!0,jf())}function Tf(e,t){if(!Sf&&xf){Sf=!0;do for(var n=!1,r=vf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-et(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Af(r,a))}else a=Z,a=ct(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||lt(r,a)||(n=!0,Af(r,a))}r=r.next}while(n);Sf=!1}}function Ef(){Df()}function Df(){xf=bf=!1;var e=0;Cf!==0&&hp()&&(e=Cf);for(var t=Ue(),n=null,r=vf;r!==null;){var i=r.next,a=Of(r,t);a===0?(r.next=null,n===null?vf=i:n.next=i,i===null&&(yf=n)):(n=r,(e!==0||a&3)&&(xf=!0)),r=i}gd!==0&&gd!==5||Tf(e,!1),Cf!==0&&(Cf=0)}function Of(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-et(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Z,n=ct(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Q===2||Q===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||lt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Be(r),bt(n)){case 2:case 8:n=Ke;break;case 32:n=I;break;case 268435456:n=Je;break;default:n=I}return r=kf.bind(null,e),n=ze(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Be(r),e.callbackPriority=2,e.callbackNode=null,2}function kf(e,t){if(gd!==0&&gd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(cf()&&e.callbackNode!==n)return null;var r=Z;return r=ct(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Md(e,r,t),Of(e,Ue()),e.callbackNode!=null&&e.callbackNode===n?kf.bind(null,e):null)}function Af(e,t){if(cf())return null;Md(e,t,!0)}function jf(){bp(function(){Yu&6?ze(Ge,Ef):Df()})}function Mf(){if(Cf===0){var e=Ma;e===0&&(e=it,it<<=1,!(it&261888)&&(it=256)),Cf=e}return Cf}function Nf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:hn(e)}function Pf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Nf((i[wt]||null).action),o=r.submitter;o&&(t=(t=o[wt]||null)?Nf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new In(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Cf!==0){var e=new FormData(i,o);qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ff=0;Ff<ui.length;Ff++){var If=ui[Ff];di(If.toLowerCase(),`on`+(If[0].toUpperCase()+If.slice(1)))}di(ni,`onAnimationEnd`),di(ri,`onAnimationIteration`),di(ii,`onAnimationStart`),di(`dblclick`,`onDoubleClick`),di(`focusin`,`onFocus`),di(`focusout`,`onBlur`),di(ai,`onTransitionRun`),di(oi,`onTransitionStart`),di(si,`onTransitionCancel`),di(ci,`onTransitionEnd`),R(`onMouseEnter`,[`mouseout`,`mouseover`]),R(`onMouseLeave`,[`mouseout`,`mouseover`]),R(`onPointerEnter`,[`pointerout`,`pointerover`]),R(`onPointerLeave`,[`pointerout`,`pointerover`]),Vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Lf=`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(` `),Rf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Lf));function zf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){gi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){gi(e)}i.currentTarget=null,a=c}}}}function Bf(e,t){var n=t[Et];n===void 0&&(n=t[Et]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,zt.forEach(function(t){t!==`selectionchange`&&(Rf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!Tn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Nt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Cn(function(){var r=a,i=vn(n),s=[];a:{var c=li.get(e);if(c!==void 0){var l=In,u=e;switch(e){case`keypress`:if(jn(n)===0)break a;case`keydown`:case`keyup`:l=er;break;case`focusin`:u=`focus`,l=Gn;break;case`focusout`:u=`blur`,l=Gn;break;case`beforeblur`:case`afterblur`:l=Gn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Un;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=rr;break;case ni:case ri:case ii:l=Kn;break;case ci:l=ir;break;case`scroll`:case`scrollend`:l=Rn;break;case`wheel`:l=ar;break;case`copy`:case`cut`:case`paste`:l=qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=tr;break;case`submit`:l=nr;break;case`toggle`:case`beforetoggle`:l=or}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=H(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==_n&&(u=n.relatedTarget||n.fromElement)&&(Nt(u)||u[Tt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Nt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Un,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=tr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ft(c),h=l==null?u:Ft(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Nt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?ee(c,l,Jf):null,c!==null&&Yf(s,u,c,d,!1),l!==null&&f!==null&&Yf(s,f,l,d,!0)))}a:{if(c=r?Ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=U;else if(br(c)){if(Er)_=Fr;else{_=Nr;var v=Mr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&fn(r.elementType)&&(_=U):_=Pr;if(_&&=_(e,r)){xr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ft(r):window,e){case`focusin`:(br(v)||v.contentEditable===`true`)&&(Kr=v,qr=r,Jr=null);break;case`focusout`:Jr=qr=Kr=null;break;case`mousedown`:Yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Yr=!1,Xr(s,n,i);break;case`selectionchange`:if(Gr)break;case`keydown`:case`keyup`:Xr(s,n,i)}var y;if(cr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else gr?mr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(dr&&n.locale!==`ko`&&(gr||b!==`onCompositionStart`?b===`onCompositionEnd`&&gr&&(y=An()):(Dn=i,On=`value`in Dn?Dn.value:Dn.textContent,gr=!0)),v=qf(r,b),0<v.length&&(b=new Jn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=hr(n),y!==null&&(b.data=y)))),(y=ur?_r(e,n):vr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Jn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Pf(s,e,r,n,i)}zf(s,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=H(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=H(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=H(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=H(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||cn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&cn(e,``+r);else return;break;case`className`:Jt(e,`class`,r);break;case`tabIndex`:Jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Jt(e,n,r);break;case`style`:dn(e,r,o);return;case`data`:if(t!==`object`){Jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=hn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,a.name,a,null),ep(e,t,`formEncType`,a.formEncType,a,null),ep(e,t,`formMethod`,a.formMethod,a,null),ep(e,t,`formTarget`,a.formTarget,a,null)):(ep(e,t,`encType`,a.encType,a,null),ep(e,t,`method`,a.method,a,null),ep(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=hn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=gn);return;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=hn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Bf(`beforetoggle`,e),Bf(`toggle`,e),qt(e,`popover`,r);break;case`xlinkActuate`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:qt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=pn.get(n)||n,qt(e,n,r);else return}z=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:dn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)cn(e,r);else if(typeof r==`number`||typeof r==`bigint`)cn(e,``+r);else return;break;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=gn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}z=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):qt(e,n,r)}return}z=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Bf(`error`,e),Bf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ep(e,t,o,s,n,null)}}a&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:Bf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:ep(e,t,r,d,n,null)}}rn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Bf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&on(e,!!r,n,!0):on(e,!!r,t,!1);return;case`textarea`:for(s in Bf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:ep(e,t,s,c,n,null)}sn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Bf(`cancel`,e),Bf(`close`,e);break;case`iframe`:case`object`:Bf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Lf.length;r++)Bf(Lf[r],e);break;case`image`:Bf(`error`,e),Bf(`load`,e);break;case`details`:Bf(`toggle`,e);break;case`embed`:case`source`:case`link`:Bf(`error`,e),Bf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ep(e,t,u,r,n,null)}return;default:if(fn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(z=!0),o=m;break;case`name`:m!==f&&(z=!0),a=m;break;case`checked`:m!==f&&(z=!0),u=m;break;case`defaultChecked`:m!==f&&(z=!0),d=m;break;case`value`:m!==f&&(z=!0),s=m;break;case`defaultValue`:m!==f&&(z=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}nn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ep(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(z=!0),p=o;break;case`defaultValue`:o!==l&&(z=!0),c=o;break;case`multiple`:o!==l&&(z=!0),s=o;default:o!==l&&ep(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?on(e,!!n,n?[]:``,!1):on(e,!!n,t,!0)):on(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(z=!0),p=a;break;case`defaultValue`:a!==o&&(z=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ep(e,t,s,a,r,o)}V(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(z=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(fn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[L]=r,n[wt]=t,np(n,e,t),Lt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:E({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=ee(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=ee(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Zp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[At])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===gn&&(e.onclick=null),Mt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=ve.d;ve.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Id();return e||t}function Cm(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?Ys(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=tn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+tn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+tn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+tn(n.imageSizes)+`"]`)):i+=`[href="`+tn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=E({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+tn(r)+`"][href="`+tn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=E({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=It(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=E({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Lt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=It(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=E({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Lt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=It(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=E({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Lt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=Ee.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=It(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=It(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=It(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+tn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),np(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+tn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+tn(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var a=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Lt(a),a):(r=n,(a=vm.get(o))&&(r=E({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Lt(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[At]||a[L]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:ie,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Oi(3,null,null,t),e.current=a,a.stateNode=e,t=Ea(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},so(a),e}function uh(e){return e?(e=Ei,e):Ei}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=lo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=uo(e,r,t),n!==null&&(jd(n,e,t),fo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Ci(e,67108864);t!==null&&jd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Od();t=yt(t);var n=Ci(e,t);n!==null&&jd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=N.T;N.T=null;var a=ve.p;try{ve.p=2,yh(e,t,n,r)}finally{ve.p=a,N.T=i}}function vh(e,t,n,r){var i=N.T;N.T=null;var a=ve.p;try{ve.p=8,yh(e,t,n,r)}finally{ve.p=a,N.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-et(o);s.entanglements[1]|=c,o&=~c}wf(a),!(Yu&6)&&(pd=Ue()+500,Tf(0,!1))}}break;case 31:case 13:s=Ci(a,2),s!==null&&jd(s,a,2),Id(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=vn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Nt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 xh=e,null}function Ch(e){switch(e){case`beforetoggle`: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`seeked`:case`submit`:case`toggle`: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`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(We()){case Ge:return 2;case Ke:return 8;case I:case qe:return 32;case Je:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Pt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Nt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,St(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,St(e.priority,function(){hh(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 Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);_n=r,n.target.dispatchEvent(r),_n=null}else return t=Pt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[wt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,Od(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Id(),t[Tt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.1`)throw Error(i(527,Kh,`19.3.1`));ve.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ze=Jh.inject(qh),Qe=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=gc,s=_c,c=vc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[Tt]=t.current,Uf(e),new Wh(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(p(),1),y=_(),b=(e,t,n)=>Math.max(1,Math.min(t/e.width,n/e.height)),x=1.2,S={width:10,height:8,doors:[{id:`door-1`,wall:`bottom`,offset:8.8/2,width:x,isLoading:!1}],screens:[],obstacles:[]},C={min:3,max:60},w={min:.7,max:4},T={min:1,max:12},ee={min:.2,max:10},E=.6,D=.3,te=1e-6,ne=[`top`,`bottom`,`left`,`right`],O=(e,t)=>t===`top`||t===`bottom`?e.width:e.height;function re(e,t,n,r,i){switch(t){case`top`:return{x:n,y:0,width:r,height:i};case`bottom`:return{x:n,y:e.height-i,width:r,height:i};case`left`:return{x:0,y:n,width:i,height:r};case`right`:return{x:e.width-i,y:n,width:i,height:r}}}var k=(e,t)=>re(e,t.wall,t.offset,t.width,t.width),A=(e,t)=>[re(e,t.wall,t.offset,t.width,E),k(e,t)],ie=(e,t)=>re(e,t.wall,t.offset,t.width,D);function ae(e){return[...e.doors.flatMap(t=>A(e,t)),...e.screens.map(t=>ie(e,t)),...e.obstacles]}var j=(e,t,n)=>Math.min(Math.max(e,t),n);function oe(e){let t=(e.rotation??0)*Math.PI/180,n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),i=e.width*n+e.height*r,a=e.width*r+e.height*n,o=e.x+e.width/2,s=e.y+e.height/2;return{x:o-i/2,y:s-a/2,width:i,height:a}}function se(e,t){let n=oe(e),r=j(n.x,0,t.width-n.width)-n.x,i=j(n.y,0,t.height-n.height)-n.y;return{...e,x:e.x+r,y:e.y+i}}function M(e,t){let n=1e-9;return e.x<t.x+t.width-n&&e.x+e.width>t.x+n&&e.y<t.y+t.height-n&&e.y+e.height>t.y+n}function ce(e,t){let n=1e-9;return e.x>=-1e-9&&e.y>=-1e-9&&e.x+e.width<=t.width+n&&e.y+e.height<=t.height+n}function le(e,t,n,r){let i=oe(e);return ce(i,n)&&!t.some(e=>e.id!==r&&M(i,oe(e)))&&!ae(n).some(e=>M(i,e))}function ue(e,t,n,r){let i={...e,...t};return t.x===void 0&&t.y===void 0&&(i.x=e.x+e.width/2-i.width/2,i.y=e.y+e.height/2-i.height/2),i=se(i,r),le(i,n,r,e.id)?i:null}var de=(e,t)=>t.kind===`door`?A(e,{id:t.id,wall:t.wall,offset:t.offset,width:t.width,isLoading:!1}):[re(e,t.wall,t.offset,t.width,D)];function fe(e,t,n){if(n.offset<-1e-6||n.offset+n.width>O(e,n.wall)+te||[...e.doors.filter(e=>e.id!==n.id),...e.screens.filter(e=>e.id!==n.id)].some(e=>e.wall===n.wall&&n.offset<e.offset+e.width-te&&n.offset+n.width>e.offset+te))return!1;let r=t.map(oe);return de(e,n).every(t=>ce(t,e)&&!r.some(e=>M(t,e))&&!e.obstacles.some(e=>M(t,e)))}function pe(e,t,n){return!ce(n,e)||t.some(e=>M(n,oe(e)))||e.obstacles.some(e=>e.id!==n.id&&M(n,e))?!1:![...e.doors.flatMap(t=>A(e,t)),...e.screens.map(t=>ie(e,t))].some(e=>M(n,e))}function me(e,t){return e.doors.length<1||e.screens.length>2?!1:[...e.doors.map(e=>({...e,kind:`door`})),...e.screens.map(e=>({...e,kind:`screen`}))].every(n=>fe(e,t,n))&&e.obstacles.every(n=>pe(e,t,n))&&t.every(n=>le(n,t,e,n.id))}var he=e=>Math.ceil(e*10-1e-6)/10;function ge(e,t){let n=C.min,r=C.min,i=e=>{n=Math.max(n,e.x+e.width),r=Math.max(r,e.y+e.height)};t.map(oe).forEach(i),e.obstacles.forEach(i);let a=e=>{e.wall===`top`||e.wall===`bottom`?n=Math.max(n,e.offset+e.width):r=Math.max(r,e.offset+e.width)};e.screens.forEach(a);for(let t of e.doors)a(t),t.wall===`top`||t.wall===`bottom`?r=Math.max(r,t.width):n=Math.max(n,t.width);return{width:he(n),height:he(r)}}function _e(e,t,n){let r={...e,...n};return r.width<C.min-te||r.height<C.min-te?null:me(r,t)?r:null}function N(e,t,n,r,i){let a=O(e,r),o=(a-i)/2;for(let s=0;s*.1<=a;s++)for(let a of s===0?[1]:[1,-1]){let c=Math.round((o+a*s*.1)*100)/100;if(fe(e,t,{id:`__new`,kind:n,wall:r,offset:c,width:i}))return c}return null}function ve(e,t,n,r){let i=(e.width-n)/2,a=(e.height-r)/2,o=.25,s=[];for(let t=0;t<=e.width-n+te;t+=o)for(let n=0;n<=e.height-r+te;n+=o)s.push({x:t,y:n,d:Math.hypot(t-i,n-a)});if(s.sort((e,t)=>e.d-t.d),pe(e,t,{x:i,y:a,width:n,height:r,id:`__new`}))return{x:i,y:a};for(let i of s)if(pe(e,t,{id:`__new`,x:i.x,y:i.y,width:n,height:r}))return{x:i.x,y:i.y};return null}var ye=.5;function be(e,t,n,r){if(t===`right`)return{...e,width:j(n-e.x,ye,r.width-e.x)};let i=e.x+e.width,a=j(n,0,i-ye);return{...e,x:a,width:i-a}}var xe=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Se=e=>typeof e==`number`&&Number.isFinite(e),Ce=(e,t)=>e>=t.min-1e-6&&e<=t.max+1e-6,P=e=>Math.round(e*10)/10;function we(e){let{width:t,height:n,doors:r,screens:i,obstacles:a}=e;return JSON.stringify({width:t,height:n,doors:r,screens:i,obstacles:a},null,2)}function Te(e){let t;try{t=JSON.parse(e)}catch{return{ok:!1,error:`Not valid JSON.`}}if(!xe(t))return{ok:!1,error:`Expected a JSON object with width, height, doors, screens and obstacles.`};let n=e=>({ok:!1,error:e});if(!Se(t.width)||!Se(t.height))return n(`width and height must be numbers.`);if(!Ce(t.width,C)||!Ce(t.height,C))return n(`Room width and height must be between ${C.min} and ${C.max} m.`);if(!Array.isArray(t.doors)||!Array.isArray(t.screens)||!Array.isArray(t.obstacles))return n(`doors, screens and obstacles must all be arrays.`);let r=new Set,i=(e,t)=>typeof e!=`string`||!e?`${t}: id must be a non-empty string.`:r.has(e)?`${t}: duplicate id "${e}".`:(r.add(e),null),a=e=>typeof e==`string`&&ne.includes(e),o=[];for(let[e,r]of t.doors.entries()){let t=`Door ${e+1}`;if(!xe(r))return n(`${t} must be an object.`);let s=i(r.id,t);if(s)return n(s);if(!a(r.wall))return n(`${t}: wall must be top, bottom, left or right.`);if(!Se(r.offset)||!Se(r.width))return n(`${t}: offset and width must be numbers.`);if(!Ce(r.width,w))return n(`${t}: width must be ${w.min}-${w.max} m.`);if(typeof r.isLoading!=`boolean`)return n(`${t}: isLoading must be true or false.`);o.push({id:r.id,wall:r.wall,offset:r.offset,width:r.width,isLoading:r.isLoading})}if(o.length<1)return n(`A room needs at least one door.`);if(t.screens.length>2)return n(`At most 2 screens are allowed.`);let s=[];for(let[e,r]of t.screens.entries()){let t=`Screen ${e+1}`;if(!xe(r))return n(`${t} must be an object.`);let o=i(r.id,t);if(o)return n(o);if(!a(r.wall))return n(`${t}: wall must be top, bottom, left or right.`);if(!Se(r.offset)||!Se(r.width))return n(`${t}: offset and width must be numbers.`);if(!Ce(r.width,T))return n(`${t}: width must be ${T.min}-${T.max} m.`);s.push({id:r.id,wall:r.wall,offset:r.offset,width:r.width})}let c=[];for(let[e,r]of t.obstacles.entries()){let t=`Obstacle ${e+1}`;if(!xe(r))return n(`${t} must be an object.`);let a=i(r.id,t);if(a)return n(a);if(!Se(r.x)||!Se(r.y)||!Se(r.width)||!Se(r.height))return n(`${t}: x, y, width and height must be numbers.`);if(!Ce(r.width,ee)||!Ce(r.height,ee))return n(`${t}: size must be ${ee.min}-${ee.max} m.`);c.push({id:r.id,x:r.x,y:r.y,width:r.width,height:r.height})}let l={width:P(t.width),height:P(t.height),doors:o,screens:s,obstacles:c};return me(l,[])?{ok:!0,room:l}:n(`The doors, screens and obstacles don't fit together (overlap or outside the room).`)}var Ee=[{id:`chair`,name:`Chair`,shape:`chair`,defaultWidth:.5,defaultHeight:.5,isTable:!1,rotatable:!1,available:20},{id:`table`,name:`Table`,shape:`table`,defaultWidth:1.8,defaultHeight:.8,isTable:!0,rotatable:!0,available:6,seatsPerUnit:8},{id:`screen`,name:`Screen`,shape:`screen`,defaultWidth:2,defaultHeight:.2,isTable:!1,rotatable:!0,available:2}],De={room:S,items:[],configs:Object.fromEntries(Ee.map(e=>[e.id,e])),typeOrder:Ee.map(e=>e.id)};function Oe(e,t){switch(t.kind){case`add`:{let n=e.configs[t.type],r={id:t.id,type:t.type,x:t.x,y:t.y,width:n.defaultWidth,height:n.defaultHeight,rotation:0,locked:!1};return{...e,items:[...e.items,r]}}case`move`:return{...e,items:e.items.map(e=>e.id===t.id?{...e,x:t.x,y:t.y}:e)};case`update`:return{...e,items:e.items.map(e=>e.id===t.id?{...e,...t.patch}:e)};case`setRoom`:return{...e,room:t.room,items:t.clearItems?[]:e.items};case`remove`:return{...e,items:e.items.filter(e=>e.id!==t.id)};case`setAvailable`:return{...e,configs:{...e.configs,[t.type]:{...e.configs[t.type],available:t.value}}};case`setSeats`:return{...e,configs:{...e.configs,[t.type]:{...e.configs[t.type],seatsPerUnit:t.value}}};case`addConfig`:return{...e,configs:{...e.configs,[t.config.id]:t.config},typeOrder:[...e.typeOrder,t.config.id]}}}var ke=(e,t)=>e.filter(e=>e.type===t).length,Ae=(e,t,n)=>n-ke(e,t),je=(e,t)=>e.seatsOverride??t.seatsPerUnit,Me=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),F=o(((e,t)=>{t.exports=Me()}))();function Ne({size:e=36}){return(0,F.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 36 36`,children:[(0,F.jsx)(`rect`,{x:`4`,y:`4`,width:`28`,height:`28`,rx:`3`,fill:`#8fb4d9`,stroke:`#3b3b3b`,strokeWidth:`1.5`}),(0,F.jsx)(`rect`,{x:`4`,y:`4`,width:`28`,height:`8`,rx:`3`,fill:`#4a6f96`})]})}function Pe({size:e=36}){return(0,F.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 36 36`,children:(0,F.jsx)(`rect`,{x:`2`,y:`9`,width:`32`,height:`18`,rx:`3`,fill:`#d9b382`,stroke:`#3b3b3b`,strokeWidth:`1.5`})})}function Fe({size:e=36}){return(0,F.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 36 36`,children:[(0,F.jsx)(`rect`,{x:`2`,y:`14`,width:`32`,height:`8`,rx:`2`,fill:`#2d3748`,stroke:`#3b3b3b`,strokeWidth:`1.5`}),(0,F.jsx)(`rect`,{x:`4`,y:`16`,width:`28`,height:`4`,fill:`#63b3ed`})]})}function Ie({shape:e,size:t}){return e===`table`?(0,F.jsx)(Pe,{size:t}):e===`screen`?(0,F.jsx)(Fe,{size:t}):(0,F.jsx)(Ne,{size:t})}var Le=5,Re={width:`100%`,height:84,boxSizing:`border-box`,background:`#fff`,border:`1px solid #cfcfcf`,borderRadius:8,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:6,cursor:`grab`,userSelect:`none`,touchAction:`none`,font:`12px system-ui, sans-serif`,color:`#444`},ze=152,Be=600;function Ve({config:e,remaining:t,onStartDrag:n,onOpenMenu:r}){let i=e.id,a=t<=0,o=e=>{e.preventDefault();let{clientX:t,clientY:o}=e,s=!1,c=e=>{s||a||Math.hypot(e.clientX-t,e.clientY-o)>=Le&&(s=!0,u(),n(i,e.clientX,e.clientY))},l=e=>{u(),(Math.hypot(e.clientX-t,e.clientY-o)<Le||a)&&r(i)},u=()=>{window.removeEventListener(`pointermove`,c),window.removeEventListener(`pointerup`,l)};window.addEventListener(`pointermove`,c),window.addEventListener(`pointerup`,l)};return(0,F.jsxs)(`div`,{role:`button`,"aria-label":`${e.name} (${t} remaining)`,style:{...Re,position:`relative`,opacity:a?.45:1,filter:a?`grayscale(1)`:void 0,cursor:a?`pointer`:`grab`},onPointerDown:o,children:[(0,F.jsx)(`span`,{style:{position:`absolute`,top:6,right:6,minWidth:20,height:20,padding:`0 6px`,boxSizing:`border-box`,borderRadius:10,background:a?`#888`:`#2b2b2b`,color:`#fff`,font:`600 11px/20px system-ui, sans-serif`,textAlign:`center`},children:t}),(0,F.jsx)(Ie,{shape:e.shape}),e.name]})}function He({onClick:e}){return(0,F.jsxs)(`div`,{role:`button`,"aria-label":`New custom furniture`,onClick:e,style:{...Re,border:`1.5px dashed #9a9a9a`,background:`transparent`,cursor:`pointer`},children:[(0,F.jsx)(`span`,{style:{font:`300 30px/30px system-ui, sans-serif`,color:`#666`},children:`+`}),`Custom`]})}function Ue({types:e,remaining:t,onStartDrag:n,onOpenMenu:r,onNewCustom:i,header:a,panel:o}){let[s,c]=(0,v.useState)(264);return(0,F.jsxs)(`aside`,{style:{position:`relative`,width:s,flexShrink:0,borderRight:`1px solid #d4d4d4`,background:`#ececec`},children:[(0,F.jsxs)(`div`,{style:{height:`100%`,boxSizing:`border-box`,overflowY:`auto`,padding:16,display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(84px, 1fr))`,alignContent:`start`,gap:12},children:[a,o??(0,F.jsxs)(F.Fragment,{children:[e.map(e=>(0,F.jsx)(Ve,{config:e,remaining:t[e.id],onStartDrag:n,onOpenMenu:r},e.id)),(0,F.jsx)(He,{onClick:i})]})]}),(0,F.jsx)(`div`,{onPointerDown:e=>{e.preventDefault();let t=e.clientX,n=s,r=e=>c(Math.min(Be,Math.max(ze,n+e.clientX-t))),i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)},style:{position:`absolute`,top:0,right:-3,width:6,height:`100%`,cursor:`col-resize`,touchAction:`none`}})]})}var We=Math.PI/180;function Ge(){return typeof window<`u`&&({}.toString.call(window)===`[object Window]`||{}.toString.call(window)===`[object global]`)}var Ke=typeof global<`u`?global:typeof window<`u`?window:typeof WorkerGlobalScope<`u`?self:{},I={_global:Ke,version:`10.9.0`,isBrowser:Ge(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return I.angleDeg?e*We:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_renderBackend:`web`,legacyTextRendering:!1,pixelRatio:typeof window<`u`&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return I.DD.isDragging},isTransforming(){return I.Transformer?.isTransforming()??!1},isDragReady(){return!!I.DD.node},releaseCanvasOnDestroy:!0,document:Ke.document,_injectGlobal(e){Ke.Konva!==void 0&&console.error(`Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment.`),Ke.Konva=e}},qe=new Set,Je=(e,t=!1)=>{I[e.prototype.getClassName()]=e,t&&qe.add(e)};I._injectGlobal(I);var Ye=`Konva.js unsupported environment.
Looks like you are trying to use Konva.js in Node.js environment (or in a Web Worker), because "document" object is undefined.
To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
bash: npm install canvas
js: import "konva/canvas-backend";
or
bash: npm install skia-canvas
js: import "konva/skia-backend";
`,Xe=()=>{if(typeof document>`u`)throw Error(Ye)},Ze=class e{constructor(e){this.dirty=!1,this.m=e?e.slice():[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new e(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){let t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}_getTransformedRect(e){let[t,n,r,i,a,o]=this.m,s=e.x,c=e.y,l=e.x+e.width,u=e.y+e.height,d=[t*s+r*c+a,t*l+r*c+a,t*l+r*u+a,t*s+r*u+a],f=[n*s+i*c+o,n*l+i*c+o,n*l+i*u+o,n*s+i*u+o],p=Math.min(d[0],d[1],d[2],d[3]),m=Math.min(f[0],f[1],f[2],f[3]);return{x:p,y:m,width:Math.max(d[0],d[1],d[2],d[3])-p,height:Math.max(f[0],f[1],f[2],f[3])-m}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,i=this.m[1]*t+this.m[3]*n,a=this.m[0]*-n+this.m[2]*t,o=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=a,this.m[3]=o,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){let n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,i=this.m[2]+this.m[0]*e,a=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=a,this}multiply(e){let t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],i=this.m[1]*e.m[2]+this.m[3]*e.m[3],a=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],o=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=a,this.m[5]=o,this}isInvertible(){return this.m[0]*this.m[3]-this.m[1]*this.m[2]!==0}invert(){let e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,i=this.m[0]*e,a=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),o=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=a,this.m[5]=o,this}getMatrix(){return this.m}decompose(){let e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],i=this.m[4],a=this.m[5],o=e*r-t*n,s={x:i,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||t!=0){let i=Math.sqrt(e*e+t*t);s.rotation=t>0?Math.acos(e/i):-Math.acos(e/i),s.scaleX=i,s.scaleY=o/i,s.skewX=o&&(e*n+t*r)/o,s.skewY=0}else if(n!=0||r!=0){let i=Math.sqrt(n*n+r*r);s.rotation=Math.PI/2-(r>0?Math.acos(-n/i):-Math.acos(n/i)),s.scaleX=o/i,s.scaleY=i,s.skewX=0,s.skewY=o&&(e*n+t*r)/o}return s.rotation=L._getRotation(s.rotation),s}},Qe=`[object Array]`,$e=`[object Number]`,et=`[object String]`,tt=`[object Boolean]`,nt=Math.PI/180,rt=180/Math.PI,it=`#`,at=``,ot=`0`,st=`Konva warning: `,ct=`Konva error: `,lt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[0,0,0,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},ut=null,dt=typeof window<`u`?window:{},ft=new WeakMap,pt=(e,t)=>{typeof e.requestAnimationFrame==`function`?e.requestAnimationFrame(t):typeof requestAnimationFrame<`u`?requestAnimationFrame(t):setTimeout(t,16)},mt=new Map,ht=Object.getPrototypeOf(Int8Array),gt=e=>{let t=e.trim();return t.indexOf(`,`)===-1?t.split(/\s*\/\s*|\s+/):t.split(/\s*,\s*/)},_t=`[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?`,vt=RegExp(`^(${_t})(%?)$`,`i`),yt=(e,t)=>{let n=vt.exec(e);if(!n)return NaN;let r=n[2]?Number(n[1])/100*t:Number(n[1]);return Math.min(Math.max(r,0),t)},bt=/^#[0-9a-f]+$/i,xt=RegExp(`^(${_t})(deg|grad|rad|turn)?$`,`i`),St={deg:1,grad:.9,rad:rt,turn:360};function Ct(e,t){return Math.min(Math.max(e||0,0),t)}var L={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===Qe},_isNumber(e){return Object.prototype.toString.call(e)===$e&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===et},_isBoolean(e){return Object.prototype.toString.call(e)===tt},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!=`string`)return!1;let t=e[0];return t===`#`||t===`.`||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e,t){let n=t&&!t.closed&&t||dt,r=ft.get(n);r||(r=[],ft.set(n,r),pt(n,function(){ft.delete(n),r.forEach(function(e){e()})})),r.push(e)},createCanvasElement(){Xe();let e=document.createElement(`canvas`);try{e.style=e.style||{}}catch{}return e},createImageElement(){return Xe(),document.createElement(`img`)},_urlToImage(e,t,n){let r=L.createImageElement();r.onload=function(){t(r)},r.onerror=e=>{n?.(e instanceof Error?e:Error(`Unable to load image.`))},r.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(it,at);let t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){let e=(Math.random()*16777215|0).toString(16);for(;e.length<6;)e=ot+e;return it+e},isCanvasFarblingActive(){if(ut!==null)return ut;if(typeof document>`u`)return ut=!1,!1;let e=this.createCanvasElement();e.width=10,e.height=10;let t=e.getContext(`2d`,{willReadFrequently:!0});t.clearRect(0,0,10,10),t.fillStyle=`#282828`,t.fillRect(0,0,10,10);let n=t.getImageData(0,0,10,10).data,r=!1;for(let e=0;e<100;e++)if(n[e*4]!==40||n[e*4+1]!==40||n[e*4+2]!==40||n[e*4+3]!==255){r=!0;break}return ut=r,this.releaseCanvas(e),ut},getHitColor(){let e=()=>Math.random()*256|0;return this.getHitColorKey(e(),e(),e())},getHitColorKey(e,t,n){let r=this.isCanvasFarblingActive()?5:3,i=e=>Math.round(e/r)*r;return it+this._rgbToHex(i(e),i(t),i(n))},getSnappedHexColor(e){let{r:t,g:n,b:r}=this._hexToRgb(e);return this.getHitColorKey(t,n,r)},getRGB(e){let{r:t=0,g:n=0,b:r=0}=L.colorToRGBA(e)??{};return{r:t,g:n,b:r}},colorToRGBA(e){e=(e||``).trim()||`black`;let t=L._namedColorToRBA(e)||L._hex3ColorToRGBA(e)||L._hex4ColorToRGBA(e)||L._hex6ColorToRGBA(e)||L._hex8ColorToRGBA(e)||L._rgbColorToRGBA(e)||L._hslColorToRGBA(e);if(t&&[t.r,t.g,t.b,t.a].every(L._isNumber))return t},_namedColorToRBA(e){let t=lt[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:t.length>3?t[3]:1}:null},_rgbColorToRGBA(e){let t=/^rgba?\(([^)]*)\)$/i.exec(e);if(!t)return;let n=gt(t[1]);if(!(n.length<3||n.length>4))return{r:yt(n[0],255),g:yt(n[1],255),b:yt(n[2],255),a:n.length>3?yt(n[3],1):1}},_hex8ColorToRGBA(e){if(e.length===9&&bt.test(e))return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if(e.length===7&&bt.test(e))return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if(e.length===5&&bt.test(e))return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if(e.length===4&&bt.test(e))return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){let t=/^hsla?\(([^)]*)\)$/i.exec(e);if(!t)return;let n=gt(t[1]);if(n.length<3||n.length>4)return;let r=xt.exec(n[0]);if(!r)return;let i=r[2],a=Number(r[1])*(i?St[i.toLowerCase()]:1);if(!isFinite(a))return;let o=(a%360+360)%360/360,s=yt(n[1],100)/100,c=yt(n[2],100)/100,l=n.length>3?yt(n[3],1):1,u=c<.5?c*(1+s):c+s-c*s,d=2*c-u,f=[0,0,0];for(let e=0;e<3;e++){let t=o+1/3*-(e-1);t<0&&t++,t>1&&t--;let n;n=6*t<1?d+(u-d)*6*t:2*t<1?u:3*t<2?d+(u-d)*(2/3-t)*6:d,f[e]=n*255}return{r:Math.round(f[0]),g:Math.round(f[1]),b:Math.round(f[2]),a:l}},_getPointsRect(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a=0;a<e.length;a+=2){let o=e[a],s=e[a+1];isNaN(o)||(t=Math.min(t,o),r=Math.max(r,o)),isNaN(s)||(n=Math.min(n,s),i=Math.max(i,s))}return isFinite(t+n)?{x:t,y:n,width:r-t,height:i-n}:{x:0,y:0,width:0,height:0}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.width<e.x||t.y>e.y+e.height||t.y+t.height<e.y)},cloneObject(e){let t={};for(let n in e)t[n]=L._cloneValue(e[n]);return t},_cloneValue(e){return L._isArray(e)?e.some(e=>typeof e==`object`)?e.map(L._cloneValue):e.slice():L._isPlainObject(e)?L.cloneObject(e):e instanceof ht?e.slice():e},cloneArray(e){return e.slice(0)},degToRad(e){return e*nt},radToDeg(e){return e*rt},_getRotation(e){return I.angleDeg?L.radToDeg(e):e},_capitalize(e){let t=mt.get(e);if(t!==void 0)return t;let n=e.charAt(0).toUpperCase()+e.slice(1);return mt.set(e,n),n},throw(e){throw Error(ct+e)},error(e){console.error(ct+e)},warn(e){I.showWarnings&&console.warn(st+e)},_batchEvents(e,t){if(!e)return t();let n=!1,r=!0;try{e(()=>{n||!r?L.warn(`eventBatchFunc must call its argument exactly once, synchronously.`):(n=!0,t())})}finally{r=!1,n||L.warn(`eventBatchFunc must call its argument synchronously.`)}},each(e,t){for(let n in e)t(n,e[n])},_inRange(e,t,n){return t<=e&&e<n},_getProjectionToSegment(e,t,n,r,i,a){let o,s,c,l=(e-n)*(e-n)+(t-r)*(t-r);if(l==0)o=e,s=t,c=(i-n)*(i-n)+(a-r)*(a-r);else{let u=((i-e)*(n-e)+(a-t)*(r-t))/l;u<0?(o=e,s=t,c=(e-i)*(e-i)+(t-a)*(t-a)):u>1?(o=n,s=r,c=(n-i)*(n-i)+(r-a)*(r-a)):(o=e+u*(n-e),s=t+u*(r-t),c=(o-i)*(o-i)+(s-a)*(s-a))}return[o,s,c]},_getProjectionToLine(e,t,n){let r=L.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(a,o){if(!n&&o===t.length-1)return;let s=t[(o+1)%t.length],c=L._getProjectionToSegment(a.x,a.y,s.x,s.y,e.x,e.y),l=c[0],u=c[1],d=c[2];d<i&&(r.x=l,r.y=u,i=d)}),r},_prepareArrayForTween(e,t,n){let r=[],i=[];if(e.length>t.length){let n=t;t=e,e=n}for(let t=0;t<e.length;t+=2)r.push({x:e[t],y:e[t+1]});for(let e=0;e<t.length;e+=2)i.push({x:t[e],y:t[e+1]});let a=[];return i.forEach(function(e){let t=L._getProjectionToLine(e,r,n);a.push(t.x),a.push(t.y)}),a},_prepareToStringify(e,t=new Set){let n=L._isArray(e)?[]:{};t.add(e);for(let r of Object.keys(e)){let i=e[r];L._isElement(i)||t.has(i)||(n[r]=L._isPlainObject(i)||L._isArray(i)?L._prepareToStringify(i,t):i)}return t.delete(e),n},_assign(e,t){for(let n in t)e[n]=t[n];return e},_getEventType(e){return e.indexOf(`pointer`)>=0?`pointer`:e.indexOf(`touch`)>=0?`touch`:`mouse`},_getFirstPointerId(e){return e.touches?e.changedTouches[0].identifier:e.pointerId??999},releaseCanvas(...e){I.releaseCanvasOnDestroy&&e.forEach(e=>{e.width=0,e.height=0})},_cornerRadii(e,t,n){let r=Math.min(t,n)/2;if(typeof e==`number`){let t=Ct(e,r);return[t,t,t,t]}return[Ct(e[0],r),Ct(e[1],r),Ct(e[2],r),Ct(e[3],r)]},drawRoundedRectPath(e,t,n,r){let i=t<0?t:0,a=n<0?n:0;t=Math.abs(t),n=Math.abs(n);let[o,s,c,l]=L._cornerRadii(r,t,n);e.moveTo(i+o,a),e.lineTo(i+t-s,a),e.arc(i+t-s,a+s,s,Math.PI*3/2,0,!1),e.lineTo(i+t,a+n-c),e.arc(i+t-c,a+n-c,c,0,Math.PI/2,!1),e.lineTo(i+l,a+n),e.arc(i+l,a+n-l,l,Math.PI/2,Math.PI,!1),e.lineTo(i,a+o),e.arc(i+o,a+o,o,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(e,t,n,r,i){r=Math.abs(r);for(let a=0;a<n;a++){let o=t[(a-1+n)%n],s=t[a],c=t[(a+1)%n],l={x:s.x-o.x,y:s.y-o.y},u={x:c.x-s.x,y:c.y-s.y},d=Math.hypot(l.x,l.y),f=Math.hypot(u.x,u.y),p;p=typeof i==`number`?i:a<i.length?i[a]:0,p=r*Math.cos(Math.PI/n)*Math.min(1,p/r*2);let m={x:l.x/d,y:l.y/d},h={x:u.x/f,y:u.y/f},g={x:s.x-m.x*p,y:s.y-m.y*p},_={x:s.x+h.x*p,y:s.y+h.y*p};a===0?e.moveTo(g.x,g.y):e.lineTo(g.x,g.y),e.arcTo(s.x,s.y,_.x,_.y,p)}}};function wt(e){let t=[],n=e.length,r=L;for(let i=0;i<n;i++){let n=e[i];r._isNumber(n)?n=Math.round(n*1e3)/1e3:r._isString(n)||(n+=``),t.push(n)}return t}var Tt=`,`,Et=`(`,Dt=`)`,Ot=`;`,kt=`()`,At=`=`,jt=`arc.arcTo.beginPath.bezierCurveTo.clearRect.clip.closePath.createLinearGradient.createPattern.createRadialGradient.drawImage.ellipse.fill.fillText.getImageData.createImageData.lineTo.moveTo.putImageData.quadraticCurveTo.rect.roundRect.restore.rotate.save.scale.setLineDash.setTransform.stroke.strokeText.transform.translate`.split(`.`),Mt=[`fillStyle`,`strokeStyle`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`,`letterSpacing`,`lineCap`,`lineDashOffset`,`lineJoin`,`lineWidth`,`miterLimit`,`direction`,`font`,`textAlign`,`textBaseline`,`globalAlpha`,`globalCompositeOperation`,`imageSmoothingEnabled`,`imageSmoothingQuality`,`filter`],Nt=100,Pt=null;function Ft(){if(Pt!==null)return Pt;try{let e=L.createCanvasElement(),t=e.getContext(`2d`);Pt=!!t&&`filter`in t,L.releaseCanvas(e)}catch{Pt=!1}return Pt}var It=class{constructor(e){this.canvas=e,I.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,t){let n=this.traceArr,r=n.length,i=``,a,o,s,c;for(a=0;a<r;a++)o=n[a],s=o.method,s?(c=o.args,i+=s,e?i+=kt:(t&&(c=c.map(e=>typeof e==`number`?Math.floor(e):e)),i+=Et+c.join(Tt)+Dt)):(i+=o.property,e||(i+=At+o.val)),i+=Ot;return i}clearTrace(){this.traceArr=[]}_trace(e){let t=this.traceArr,n;t.push(e),n=t.length,n>=Nt&&t.shift()}reset(){let e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){let t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_drawDeviceBuffer(e){let{x:t,y:n,width:r,height:i}=e._isolationRect;this.setTransform(1,0,0,1,0,0),this.imageSmoothingEnabled=!1,this.drawImage(e._canvas,0,0,r,i,t,n,r,i)}_applyLineCap(e){let t=e.attrs.lineCap;t&&this.setAttr(`lineCap`,t)}_getOpacity(e){if(!this._opacityRoot)return e.getAbsoluteOpacity();let t=e.opacity(),n=e.parent;for(;n&&n!==this._opacityRoot;)t*=n.opacity(),n=n.parent;return t}_applyOpacity(e){let t=this._getOpacity(e);t!==1&&this.setAttr(`globalAlpha`,t)}_applyLineJoin(e){let t=e.attrs.lineJoin;t&&this.setAttr(`lineJoin`,t)}_applyMiterLimit(e){let t=e.attrs.miterLimit;t!=null&&this.setAttr(`miterLimit`,t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,i,a){this._context.arc(e,t,n,r,i,a)}arcTo(e,t,n,r,i){this._context.arcTo(e,t,n,r,i)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,i,a){this._context.bezierCurveTo(e,t,n,r,i,a)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,t){let n=arguments;if(n.length===2)return this._context.createImageData(e,t);if(n.length===1)return this._context.createImageData(e)}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,i,a){return this._context.createRadialGradient(e,t,n,r,i,a)}drawImage(e,t,n,r,i,a,o,s,c){let l=arguments,u=this._context;l.length===3?u.drawImage(e,t,n):l.length===5?u.drawImage(e,t,n,r,i):l.length===9&&u.drawImage(e,t,n,r,i,a,o,s,c)}ellipse(e,t,n,r,i,a,o,s){this._context.ellipse(e,t,n,r,i,a,o,s)}isPointInPath(e,t,n,r){return n?this._context.isPointInPath(n,e,t,r):this._context.isPointInPath(e,t,r)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}roundRect(e,t,n,r,i){this._context.roundRect(e,t,n,r,i)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash(e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,i,a){this._context.setTransform(e,t,n,r,i,a)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,i,a){this._context.transform(e,t,n,r,i,a)}translate(e,t){this._context.translate(e,t)}_enableTrace(){let e=this,t=jt.length,n=this.setAttr,r,i,a=function(t){let n=e[t],r;e[t]=function(){return i=wt(Array.prototype.slice.call(arguments,0)),r=n.apply(e,arguments),e._trace({method:t,args:i}),r}};for(r=0;r<t;r++)a(jt[r]);e.setAttr=function(){n.apply(e,arguments);let t=arguments[0],r=arguments[1];(t===`shadowOffsetX`||t===`shadowOffsetY`||t===`shadowBlur`)&&(r/=this.canvas.getPixelRatio()),e._trace({property:t,val:r})}}_applyGlobalCompositeOperation(e){let t=e.attrs.globalCompositeOperation;t&&t!==`source-over`&&this.setAttr(`globalCompositeOperation`,t)}};Mt.forEach(function(e){Object.defineProperty(It.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});var Lt=class extends It{constructor(e,{willReadFrequently:t=!1}={}){super(e),this._context=e._canvas.getContext(`2d`,{willReadFrequently:t})}_getFillPattern(e){let t=this._context;return`patternQuality`in t&&(t.patternQuality=t.imageSmoothingEnabled?`good`:`nearest`),e._getFillPattern()}_getFillStyle(e){let t=e.fill(),n=e.fillPriority();if(t&&n===`color`)return t;let r=e.fillPatternImage();if(r&&n===`pattern`)return this._getFillPattern(e);let i=e.fillLinearGradientColorStops();if(i&&n===`linear-gradient`)return e._getLinearGradient();let a=e.fillRadialGradientColorStops();if(a&&n===`radial-gradient`)return e._getRadialGradient();if(t)return t;if(r)return this._getFillPattern(e);if(i)return e._getLinearGradient();if(a)return e._getRadialGradient()}_fill(e){let t=this._getFillStyle(e);t!==void 0&&(this.setAttr(`fillStyle`,t),e._fillFunc(this))}_strokeLinearGradient(e){let t=e.getStrokeLinearGradientStartPoint(),n=e.getStrokeLinearGradientEndPoint();if(!e.getStrokeScaleEnabled()){let{a:e,b:r,c:i,d:a,e:o,f:s}=this._context.getTransform(),c=new Ze([e,r,i,a,o,s]),l=this.canvas.getPixelRatio(),u=n.x-t.x,d=n.y-t.y,f=a*u-r*d,p=e*d-i*u,m=f*f+p*p,h=m?(u*u+d*d)*(e*a-r*i)/m:0;t=c.point(t),n={x:t.x+f*h,y:t.y+p*h},t={x:t.x/l,y:t.y/l},n={x:n.x/l,y:n.y/l}}let r=e.getStrokeLinearGradientColorStops(),i=this.createLinearGradient(t.x,t.y,n.x,n.y);if(r){for(let e=0;e<r.length;e+=2)i.addColorStop(r[e],r[e+1]);this.setAttr(`strokeStyle`,i)}}_applyStrokeStyle(e){e.strokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr(`strokeStyle`,e.stroke())}_stroke(e){let t=e.dash(),n=e.getStrokeScaleEnabled();n||this.save(),this._applyLineCap(e),t&&e.dashEnabled()&&(this.setLineDash(t),this.setAttr(`lineDashOffset`,e.dashOffset())),this.setAttr(`lineWidth`,e.strokeWidth());let r=this.shadowColor,i=e.getShadowForStrokeEnabled();if(i||this.setAttr(`shadowColor`,`rgba(0,0,0,0)`),this._applyStrokeStyle(e),!n){let e=this.getCanvas().getPixelRatio();this.setTransform(e,0,0,e,0,0)}try{e._strokeFunc(this)}finally{i||this.setAttr(`shadowColor`,r),n||this.restore()}}_applyShadow(e){let t=e.getShadowRGBA()??`black`,n=e.getShadowBlur(),r=e.getShadowOffset(),i=e.getAbsoluteScale(),a=this.canvas.getPixelRatio(),o=i.x*a,s=i.y*a;this.setAttr(`shadowColor`,t),this.setAttr(`shadowBlur`,n*Math.min(Math.abs(o),Math.abs(s))),this.setAttr(`shadowOffsetX`,r.x*o),this.setAttr(`shadowOffsetY`,r.y*s)}},Rt=class extends It{constructor(e){super(e),this._context=e._canvas.getContext(`2d`,{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr(`fillStyle`,e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){let t=e.getStrokeScaleEnabled();if(!t){this.save();let e=this.getCanvas().getPixelRatio();this.setTransform(e,0,0,e,0,0)}this._applyLineCap(e);let n=e.hitStrokeWidth(),r=n===`auto`?e.strokeWidth():n;this.setAttr(`lineWidth`,r),this.setAttr(`strokeStyle`,e.colorKey),e._strokeFuncHit(this),t||this.restore()}},zt=class{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this._logicalWidth=0,this._logicalHeight=0,this.isCache=!1;let t=(e||{}).pixelRatio||I.pixelRatio||I._global.devicePixelRatio||1;this.pixelRatio=t,this._canvas=L.createCanvasElement(),this._canvas.style.padding=`0`,this._canvas.style.margin=`0`,this._canvas.style.border=`0`,this._canvas.style.background=`transparent`,this._canvas.style.position=`absolute`,this._canvas.style.top=`0`,this._canvas.style.left=`0`}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){this.pixelRatio=e,this.setSize(this._logicalWidth,this._logicalHeight)}setWidth(e){this.setSize(e,this._logicalHeight)}setHeight(e){this.setSize(this._logicalWidth,e)}getWidth(){return this.width}getHeight(){return this.height}_bitmapSize(e){return Math.floor((e||0)*this.pixelRatio)}setSize(e,t){(!isFinite(e??0)||!isFinite(t??0))&&(L.error(`Canvas size must be finite numbers, got ${e}x${t}. The canvas is left empty.`),e=t=0),e||=0,t||=0;let n=this.pixelRatio,r=this.getContext()._context,i=r.imageSmoothingEnabled;this._logicalWidth=e,this._logicalHeight=t,this.width=this._canvas.width=this._bitmapSize(e),this.height=this._canvas.height=this._bitmapSize(t),this._canvas.style.width=e+`px`,this._canvas.style.height=t+`px`,r.scale(n,n),r.imageSmoothingEnabled=i}setSizeIfChanged(e,t){(this.width!==this._bitmapSize(e)||this.height!==this._bitmapSize(t))&&this.setSize(e,t)}toDataURL(e,t){try{return this._canvas.toDataURL(e,t)}catch{try{return this._canvas.toDataURL()}catch(e){throw L.error(`Unable to get data URL. `+e.message+` For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html.`),e}}}},Bt=class e extends zt{_prepareIsolationCanvas(t){let{a:n,b:r,c:i,d:a,e:o,f:s}=this.getContext()._context.getTransform(),c=this._isolationRect||this,l=0,u=0,d=c.width,f=c.height;if(t){let e=new Ze([n,r,i,a,o,s])._getTransformedRect(t);l=Math.max(0,Math.floor(e.x)-1),u=Math.max(0,Math.floor(e.y)-1),d=Math.min(d,Math.ceil(e.x+e.width)+1)-l,f=Math.min(f,Math.ceil(e.y+e.height)+1)-u}d>0&&f>0||(l=u=0,d=f=1);let p=this._isolationCanvas||=new e({width:0,height:0,pixelRatio:this.pixelRatio});if(p.width<d||p.height<f){let e=this.pixelRatio,t=(t,n,r)=>Math.min(r,Math.ceil((n<t?Math.max(t,n*1.5):n)/e));p.setSize(t(d,p.width,this._logicalWidth),t(f,p.height,this._logicalHeight))}p._isolationRect={x:l,y:u,width:d,height:f};let m=p._isolationPeak;m.width=Math.max(m.width,d),m.height=Math.max(m.height,f);let h=p.getContext();h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,d,f),h.setTransform(n,r,i,a,o-l,s-u);let g=this.getContext();return h.imageSmoothingEnabled=g.imageSmoothingEnabled,h.imageSmoothingQuality=g.imageSmoothingQuality,h.direction=g.direction,p}_trimIsolationCanvas(){let e=this._isolationCanvas;if(!e)return;let t=e._isolationPeak;e._isolationLowFrames=e.width*e.height>4*t.width*t.height?e._isolationLowFrames+1:0,e._isolationLowFrames>=10?this._releaseIsolationCanvas():(t.width=t.height=0,e._trimIsolationCanvas())}_releaseIsolationCanvas(){let e=this._isolationCanvas;e&&(e._releaseIsolationCanvas(),L.releaseCanvas(e._canvas),this._isolationCanvas=void 0)}setSize(e,t){this._releaseIsolationCanvas(),super.setSize(e,t)}constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this._isolationPeak={width:0,height:0},this._isolationLowFrames=0,this.context=new Lt(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}},Vt=class extends zt{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new Rt(this),this.context.imageSmoothingEnabled=!1,this.setSize(e.width,e.height)}},R={get isDragging(){let e=!1;return R._dragElements.forEach(t=>{t.dragStatus===`dragging`&&(e=!0)}),e},get node(){let e;for(let t of R._dragElements.values()){if(t.dragStatus===`dragging`)return t.node;e=t.node}return e},_dragElements:new Map,_listenToWindow(e){let t=t=>R._endDragBefore(t,e),n=t=>R._batchEvents(()=>R._drag(t,e),e),r=e=>R._batchEvents(()=>R._endDragAfter(e));e.addEventListener(`mouseup`,t,!0),e.addEventListener(`touchend`,t,!0),e.addEventListener(`touchcancel`,t,!0),e.addEventListener(`mousemove`,n),e.addEventListener(`touchmove`,n),e.addEventListener(`mouseup`,r,!1),e.addEventListener(`touchend`,r,!1),e.addEventListener(`touchcancel`,r,!1)},_batchEvents(e,t){if(!R._dragElements.size)return;let n=new Set;for(let{node:e}of R._dragElements.values()){let r=e.getStage();if(!r||t&&r._getOwnerWindow()!==t)continue;let i=r.eventBatchFunc();i&&n.add(i)}let r=e;for(let e of n){let t=r;r=()=>L._batchEvents(e,t)}r()},_drag(e,t){let n=[],r=new Set;R._dragElements.forEach((i,a)=>{let{node:o}=i,s=o.getStage();if(t&&s._getOwnerWindow()!==t||(r.has(s)||(s.setPointersPositions(e),r.add(s)),i.pointerEventType&&i.pointerEventType!==s._pointerEventType))return;i.pointerId===void 0&&(i.pointerId=L._getFirstPointerId(e),i.pointerEventType=s._pointerEventType,i.dragStatus===`dragging`&&s._cancelClick(i.pointerId,i.pointerEventType));let c=s._changedPointerPositions.find(e=>e.id===i.pointerId);if(c){if(i.dragStatus!==`dragging`){let t=o.dragDistance();if(Math.max(Math.abs(c.x-i.startPointerPos.x),Math.abs(c.y-i.startPointerPos.y))<t||(o.startDrag({evt:e}),!o.isDragging()))return}o._setDragPosition(e,i),n.push(o)}}),n.forEach(t=>{t.getStage()&&t.fire(`dragmove`,{type:`dragmove`,target:t,evt:e},!0)})},_endDragBefore(e,t,n){let r=[],i=new Set;R._dragElements.forEach((a,o)=>{let{node:s}=a;if(n&&a!==n&&a.pointerId!==n.pointerId)return;let c=s.getStage();if(e&&!i.has(c)&&(!t||c._getOwnerWindow()===t)&&(c.setPointersPositions(e),i.add(c)),n||(!e||!a.pointerEventType||a.pointerEventType===L._getEventType(e.type))&&(a.pointerId===void 0||c._changedPointerPositions.some(e=>e.id===a.pointerId))){if(a.dragStatus===`ready`)R._dragElements.delete(o);else{c._cancelClick(a.pointerId,a.pointerEventType),a.dragStatus=`stopped`;let e=s.getLayer()||c;e&&r.indexOf(e)===-1&&r.push(e)}}}),r.forEach(e=>{e.draw()})},_endDragAfter(e,t){R._dragElements.forEach((n,r)=>{n.dragStatus!==`stopped`||t&&n!==t&&n.pointerId!==t.pointerId||(n.node.fire(`dragend`,{type:`dragend`,target:n.node,evt:e},!0),n.dragStatus!==`dragging`&&R._dragElements.delete(r))})}},Ht=new Map,Ut=I._global.PointerEvent!==void 0;function Wt(e,t){let n=Ht.get(e);return n&&(!t||n.stage===t)?n.shape:void 0}function Gt(e,t,n){e._fire(t,{evt:new PointerEvent(t,{pointerId:n}),pointerId:n})}function z(e,t){return Ht.get(e)?.shape===t}function Kt(e,t){var n;Jt(e);let r=t.getStage();if(r&&(Ht.set(e,{shape:t,stage:r}),Ut)){try{(n=r.content)==null||n.setPointerCapture(e)}catch{}Gt(t,`gotpointercapture`,e)}}function qt(e){Ht.forEach(({shape:t,stage:n},r)=>{(t===e||n===e)&&Jt(r)})}function Jt(e,t){var n;let r=Ht.get(e);if(!r||t&&r.shape!==t)return;let{shape:i,stage:a}=r;if(Ht.delete(e),Ut){try{(n=a.content)==null||n.releasePointerCapture(e)}catch{}Gt(i,`lostpointercapture`,e)}}function Yt(e){return L._isString(e)?`"`+e+`"`:Object.prototype.toString.call(e)===`[object Number]`||L._isBoolean(e)?e:Object.prototype.toString.call(e)}function Xt(e){return e>255?255:e<0?0:Math.round(e)}function B(){if(I.isUnminified)return function(e,t){return L._isNumber(e)||L.warn(Yt(e)+` is a not valid value for "`+t+`" attribute. The value should be a number.`),e}}function Zt(e){if(I.isUnminified)return function(t,n){let r=L._isNumber(t),i=L._isArray(t)&&t.length==e;return!r&&!i&&L.warn(Yt(t)+` is a not valid value for "`+n+`" attribute. The value should be a number or Array<number>(`+e+`)`),t}}function Qt(){if(I.isUnminified)return function(e,t){return L._isNumber(e)||e===`auto`||L.warn(Yt(e)+` is a not valid value for "`+t+`" attribute. The value should be a number or "auto".`),e}}function $t(){if(I.isUnminified)return function(e,t){return L._isString(e)||L.warn(Yt(e)+` is a not valid value for "`+t+`" attribute. The value should be a string.`),e}}function en(){if(I.isUnminified)return function(e,t){let n=L._isString(e),r=Object.prototype.toString.call(e)===`[object CanvasGradient]`||e&&e.addColorStop;return n||r||L.warn(Yt(e)+` is a not valid value for "`+t+`" attribute. The value should be a string or a native gradient.`),e}}function tn(){if(I.isUnminified)return function(e,t){return e instanceof ht||(L._isArray(e)?e.forEach(function(e){L._isNumber(e)||L.warn(`"`+t+`" attribute has non numeric element `+e+`. Make sure that all elements are numbers.`)}):L.warn(Yt(e)+` is a not valid value for "`+t+`" attribute. The value should be a array of numbers.`)),e}}function nn(){if(I.isUnminified)return function(e,t){return e!==!0&&e!==!1&&L.warn(Yt(e)+` is a not valid value for "`+t+`" attribute. The value should be a boolean.`),e}}function rn(e){if(I.isUnminified)return function(t,n){return t==null||L.isObject(t)||L.warn(Yt(t)+` is a not valid value for "`+n+`" attribute. The value should be an object with properties `+e),t}}var an=`get`,on=`set`,V={addGetterSetter(e,t,n,r,i){V.addGetter(e,t,n),V.addSetter(e,t,r,i),V.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){let r=an+L._capitalize(t),i=Array.isArray(n),a=function(){let e=this.attrs[t];return e===void 0?i?n.slice():n:e};a._def=n,e.prototype[r]=e.prototype[r]||a},addSetter(e,t,n,r){let i=on+L._capitalize(t);e.prototype[i]||V.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){let i=on+L._capitalize(t);e.prototype[i]=function(e){return n&&e!=null&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){let a=n.length,o=L._capitalize,s=an+o(t),c=on+o(t),l=n.map(e=>t+o(e)),u=l.map(e=>an+o(e));e.prototype[s]=function(){let e={};for(let t=0;t<a;t++){let r=this[u[t]];e[n[t]]=r?r.call(this):this.attrs[l[t]]}return e};let d=rn(n);e.prototype[c]=function(e){let a=this[s]();r&&(e=r.call(this,e,t)),d&&d.call(this,e,t);for(let n in e)e.hasOwnProperty(n)&&this._setAttr(t+o(n),e[n]);return e||n.forEach(e=>{this._setAttr(t+o(e),void 0)}),this._fireChangeEvent(t,a,e),i&&i.call(this),this},V.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){let n=L._capitalize(t),r=on+n,i=an+n,a=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()};e.prototype[t]=a},backCompat(e,t){L.each(t,function(t,n){let r=e.prototype[n],i=an+L._capitalize(t),a=on+L._capitalize(t);function o(){return L.error(`"`+t+`" method is deprecated and will be removed soon. Use ""`+n+`" instead.`),r.apply(this,arguments)}e.prototype[t]=o,e.prototype[i]=o,e.prototype[a]=o})},afterSetFilter(){this._filterUpToDate=!1}};function sn(e){let t=[],n=/(\w+)\(([^)]*)\)/g,r;for(;(r=n.exec(e))!==null;){let[,e,n]=r;if(![`blur`,`brightness`,`contrast`,`grayscale`,`sepia`,`invert`].includes(e)){L.warn(`CSS filter "${e}" is not supported in fallback mode. Consider using function filters for better compatibility.`);continue}let i=n.trim()===``?e===`blur`?0:1:parseFloat(n)/(n.includes(`%`)?100:1);t.push({name:e,value:i})}return function(e,n=1){for(let{name:r,value:i}of t){if([`grayscale`,`sepia`,`invert`].includes(r)){let t=Math.min(1,Math.max(0,i)),n=e.data;for(let e=0;e<n.length;e+=4){let i=n[e],a=n[e+1],o=n[e+2],s,c,l;r===`grayscale`?s=c=l=.2126*i+.7152*a+.0722*o:r===`sepia`?(s=.393*i+.769*a+.189*o,c=.349*i+.686*a+.168*o,l=.272*i+.534*a+.131*o):(s=255-i,c=255-a,l=255-o),n[e]=i+(s-i)*t,n[e+1]=a+(c-a)*t,n[e+2]=o+(l-o)*t}continue}let t=I.Filters?.[L._capitalize(r)];if(!t)continue;let a=Object.create(this);a.attrs={...this.attrs},r===`blur`&&(a.attrs.blurRadius=i*.5),r===`brightness`&&(a.attrs.brightness=i),r===`contrast`&&(a.attrs.contrast=100*(Math.sqrt(i)-1)),t.call(a,e,n)}}}var cn=`absoluteOpacity`,ln=`absoluteTransform`,un=`Change`,dn=`children`,fn=`konva`,pn=`listening`,mn=[`mouseenter`,`mouseleave`,`pointerenter`,`pointerleave`,`touchenter`,`touchleave`],hn=`set`,gn=`Shape`,_n=` `,vn=`stage`,yn=`transform`,bn=`Stage`,xn=`visible`,Sn=[`xChange.konva`,`yChange.konva`,`scaleXChange.konva`,`scaleYChange.konva`,`skewXChange.konva`,`skewYChange.konva`,`rotationChange.konva`,`offsetXChange.konva`,`offsetYChange.konva`,`transformsEnabledChange.konva`].join(_n),Cn=1,H=class e{constructor(e){this._id=Cn++,this.eventListeners={},this.attrs={},this.index=0,this.parent=null,this._cache={},this._canvasCache=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===yn||e===ln)&&this._cache[e]?this._cache[e].dirty=!0:e?this._cache[e]=void 0:(this._cache={},this._attrsVersion!==void 0&&this._attrsVersion++)}_releaseCanvasCache(){let e=this._canvasCache;e&&(L.releaseCanvas(e.scene._canvas,e.filter._canvas,...e.hit?[e.hit._canvas]:[]),this._canvasCache=null)}_getCache(e,t){let n=this._cache[e];return(n===void 0||(e===yn||e===ln)&&n.dirty===!0)&&(n=t.call(this),this._cache[e]=n),n}_getCanvasCache(){return this._canvasCache}_clearSelfAndDescendantCache(e){this._clearCache(e),(e===void 0||e===ln)&&this.fire(`absoluteTransformChange`)}static _runAfterUpdateBatch(t){e._updateBatchDepth>0?e._pendingUpdates.add(t):t()}static _flushUpdateBatch(){if(e._updateBatchDepth>0)return;let t=e._pendingUpdates;t.size&&(e._pendingUpdates=new Set,t.forEach(e=>e()))}static _updateBatch(t){e._updateBatchDepth++;try{return t()}finally{e._updateBatchDepth--,e._flushUpdateBatch()}}static _beginUpdateBatch(){e._updateBatchDepth++;let t=!1;return()=>{t||(t=!0,e._updateBatchDepth--,e._flushUpdateBatch())}}clearCache(){return this._releaseCanvasCache(),this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){let t=e||{},n={};if(t.x===void 0||t.y===void 0||t.width===void 0||t.height===void 0){let e=this._isUnderCache;this._isUnderCache=!0,n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}),this._isUnderCache=e}let r=t.x===void 0?Math.floor(n.x):t.x,i=t.y===void 0?Math.floor(n.y):t.y,a=Math.ceil(t.width||n.x+n.width-r),o=Math.ceil(t.height||n.y+n.height-i),s=t.pixelRatio,c=t.offset||0,l=t.drawBorder||!1,u=t.hitCanvasPixelRatio||1;if(a<=0||o<=0||!isFinite(r+i+a+o))return L.error(`Can not cache the node. Its size is 0 or its bounds are not finite numbers (${r}, ${i}, ${a}x${o}). Caching is skipped.`),this;a+=c*2,o+=c*2,r-=c,i-=c;let d=new Bt({pixelRatio:s,width:a,height:o}),f=new Bt({pixelRatio:s,width:0,height:0,willReadFrequently:!0}),p=d.getContext();d.isCache=!0,this._releaseCanvasCache(),this._filterUpToDate=!1,t.imageSmoothingEnabled===!1&&(d.getContext()._context.imageSmoothingEnabled=!1,f.getContext()._context.imageSmoothingEnabled=!1),p.save(),p.translate(-r,-i),this._isUnderCache=!0,this._clearSelfAndDescendantCache(cn);try{this.drawScene(d,this)}catch(e){throw L.releaseCanvas(d._canvas),e}finally{this._isUnderCache=!1,this._clearSelfAndDescendantCache(cn),p.restore(),d._releaseIsolationCanvas()}return l&&(p.save(),p.beginPath(),p.rect(0,0,a,o),p.closePath(),p.setAttr(`strokeStyle`,`red`),p.setAttr(`lineWidth`,5),p.stroke(),p.restore()),this._canvasCache={scene:d,filter:f,hit:null,hitConfig:{pixelRatio:u,width:a,height:o},x:r,y:i},this._clearSelfAndDescendantCache(),this._requestDraw(),this}_getCachedHitCanvas(e){if(e===this)return null;let t=this._getCanvasCache();if(!t)return null;if(t.hit)return t.hit;let n=new Vt(t.hitConfig);n.isCache=!0;let r=n.getContext();return r.save(),r.translate(-t.x,-t.y),this.drawHit(n,this),r.restore(),t.hit=n,n}isCached(){return!!this._canvasCache}getClientRect(e){throw Error(`abstract "getClientRect" method call`)}_getCachedSceneRect(e){let t=e._forDrawing&&!this._isUnderCache&&this._getCanvasCache();if(!t)return;let n={x:t.x,y:t.y,width:t.scene.width/t.scene.pixelRatio,height:t.scene.height/t.scene.pixelRatio};return e.skipTransform?n:this._transformedRect(n,e.relativeTo)}_transformedRect(e,t){return this.getAbsoluteTransform(t)._getTransformedRect(e)}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);let t=this._getCanvasCache();e.translate(t.x,t.y);let n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}_drawCachedHitCanvas(e,t){let n=this._getCanvasCache();e.save(),e.translate(n.x,n.y),e.drawImage(t._canvas,0,0,t.width/t.pixelRatio,t.height/t.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),t=this._getCanvasCache(),n=t.scene,r=t.filter,i=r.getContext(),a,o,s,c;if(!e||e.length===0)return n;if(this._filterUpToDate)return r;let l=!0;for(let t=0;t<e.length;t++)if(typeof e[t]!=`string`||!Ft()){l=!1;break}let u=n.pixelRatio;if(r.setSizeIfChanged(n._logicalWidth,n._logicalHeight),l){let t=e.join(` `).replace(/url\((?:[^()"']|"[^"]*"|'[^']*')*\)|"[^"]*"|'[^']*'|([-+]?(?:\d*\.)?\d+(?:e[-+]?\d+)?)(px|em|rem|ex|ch|cap|ic|lh|rlh|vw|vh|vmin|vmax|cm|mm|q|in|pt|pc)\b/gi,(e,t,n)=>t===void 0?e:`${Number(t)*u}${n}`);return i.clear(),i.save(),i.setAttr(`filter`,t),i.drawImage(n._canvas,0,0,n.getWidth()/u,n.getHeight()/u),i.restore(),this._filterUpToDate=!0,r}try{for(a=e.length,i.clear(),i.drawImage(n._canvas,0,0,n.getWidth()/u,n.getHeight()/u),o=i.getImageData(0,0,r.getWidth(),r.getHeight()),s=0;s<a;s++)c=e[s],typeof c==`string`&&(c=sn(c)),c.call(this,o,u);i.putImageData(o,0,0)}catch(e){L.error(`Unable to apply filter. `+e.message+` This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.`)}return this._filterUpToDate=!0,r}on(...e){this._prepareListeners();let t=e[0],n=e[1];if(e[2],e.length===3)return this._delegate.apply(this,e);let r=t.split(_n);for(let e=0;e<r.length;e++){let t=r[e].split(`.`),i=t[0],a=t[1]||``;this.eventListeners[i]||(this.eventListeners[i]=[]),this.eventListeners[i].push({name:a,handler:n})}return this}_prepareListeners(){this===this.constructor.prototype&&(this.hasOwnProperty(`eventListeners`)||(this.eventListeners={}),e.protoListenerMap=new WeakMap)}off(e,t){this._prepareListeners();let n=(e||``).split(_n),r=n.length,i,a,o,s,c,l;if(!e)for(a in this.eventListeners)this._off(a);for(i=0;i<r;i++)if(o=n[i],s=o.split(`.`),c=s[0],l=s[1],c)this.eventListeners[c]&&this._off(c,l,t);else for(a in this.eventListeners)this._off(a,l,t);return this}dispatchEvent(e){let t={target:this,type:e.type,evt:e};return this.fire(e.type,t),this}addEventListener(e,t){return this.on(e,function(e){t.call(this,e.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,t,n){let r=this;return this.on(e,function(e){let i=e.target.findAncestors(t,!0,r);for(let t=0;t<i.length;t++)e=L.cloneObject(e),e.currentTarget=i[t],n.call(i[t],e)}),this}remove(){return this.isDragging()&&this.stopDrag(),R._dragElements.delete(this._id),R._dragElements.forEach((e,t)=>{this.isAncestorOf(e.node)&&R._dragElements.delete(t)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ln),this._clearSelfAndDescendantCache(cn),this._clearSelfAndDescendantCache(vn),this._clearSelfAndDescendantCache(xn),this._clearSelfAndDescendantCache(pn)}_remove(){let e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null),this._clearCaches()}destroy(){return this._fire(`destroy`,{target:this}),qt(this),this.remove(),this.clearCache(),this}getAttr(e){let t=`get`+L._capitalize(e);return L._isFunction(this[t])?this[t]():this.attrs[e]}getAncestors(){let e=this.getParent(),t=[];for(;e;)t.push(e),e=e.getParent();return t}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let t,n;if(!e)return this;for(t in e)t!==dn&&(n=hn+L._capitalize(t),L._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))}),this}isListening(){return this._getCache(pn,this._isListening)}_isListening(e){if(!this.listening())return!1;let t=this.getParent();return t&&t!==e&&this!==e?t._isListening(e):!0}isVisible(){return this._getCache(xn,this._isVisible)}_isVisible(e){if(!this.visible())return!1;let t=this.getParent();return t&&t!==e&&this!==e?t._isVisible(e):!0}shouldDrawHit(e){return e?this._isVisible(e)&&this._isListening(e):this.isListening()&&this.isVisible()}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),t=this,n=0,r,i,a,o;function s(c){for(r=[],i=c.length,a=0;a<i;a++)o=c[a],n++,o.nodeType!==gn&&(r=r.concat(o.children)),o._id===t._id&&(a=i);r.length>0&&r[0].getDepth()<=e&&s(r)}let c=this.getStage();return t.nodeType!==bn&&c&&s(c.children),n}getDepth(){let e=0,t=this.parent;for(;t;)e++,t=t.parent;return e}_batchTransformChanges(t){this._batchingTransformChange?t():e._updateBatch(()=>{this._batchingTransformChange=!0;try{t()}finally{this._batchingTransformChange=!1,this._needClearTransformCache&&(this._needClearTransformCache=!1,this._clearCache(yn),this._clearSelfAndDescendantCache(ln))}})}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){let e=this.getStage();if(!e)return null;let t=e.getPointerPosition();if(!t)return null;let n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(e){let t=this.getAbsoluteTransform(e).getMatrix(),n=new Ze,r=this.offset();return n.m=t.slice(),n.translate(r.x,r.y),n.getTranslation()}setAbsolutePosition(e){let{x:t,y:n,...r}=this._clearTransform();this.attrs.x=t,this.attrs.y=n,this._clearCache(yn);let i=this._getAbsoluteTransform().copy(),a=i.isInvertible();i.invert(),i.translate(e.x,e.y);let{x:o,y:s}=i.getTranslation();return this._setTransform(r),a?this.setPosition({x:this.attrs.x+o,y:this.attrs.y+s}):L.warn(`Cannot set the absolute position: the absolute transform is not invertible (an ancestor has a zero scale).`),this._clearCache(yn),this._clearSelfAndDescendantCache(ln),this}_setTransform(e){let t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){let e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let t=e.x,n=e.y,r=this.x(),i=this.y();return t!==void 0&&(r+=t),n!==void 0&&(i+=n),this.setPosition({x:r,y:i}),this}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return L.warn(`Node has no parent. moveToTop function is ignored.`),!1;let e=this.index;return e<this.parent.children.length-1&&(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0)}moveUp(){if(!this.parent)return L.warn(`Node has no parent. moveUp function is ignored.`),!1;let e=this.index;return e<this.parent.children.length-1&&(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0)}moveDown(){if(!this.parent)return L.warn(`Node has no parent. moveDown function is ignored.`),!1;let e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}moveToBottom(){if(!this.parent)return L.warn(`Node has no parent. moveToBottom function is ignored.`),!1;let e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}setZIndex(e){if(!this.parent)return L.warn(`Node has no parent. zIndex parameter is ignored.`),this;(e<0||e>=this.parent.children.length)&&L.warn(`Unexpected value `+e+` for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to `+(this.parent.children.length-1)+`.`);let t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(cn,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),t,n,r,i={attrs:{},className:this.getClassName()};for(t in e)n=e[t],n instanceof ht&&(n=Array.from(n)),r=L.isObject(n)&&!L._isPlainObject(n)&&!L._isArray(n),!r&&(this[`get`+L._capitalize(t)]?._def!==n||t===`brightness`||t===`threshold`)&&(i.attrs[t]=t===`filters`&&L._isArray(n)?n.filter(e=>typeof e==`string`):L.isObject(n)?L._prepareToStringify(n):n);return i}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){let r=[];t&&this._isMatch(e)&&r.push(this);let i=this.parent;for(;i;){if(i===n)return r;i._isMatch(e)&&r.push(i),i=i.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(!e)return!1;if(typeof e==`function`)return e(this);let t=e.replace(/ /g,``).split(`,`),n=t.length,r,i;for(r=0;r<n;r++)if(i=t[r],L.isValidSelector(i)||(L.warn(`Selector "`+i+`" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".`),L.warn(`If you have a custom shape with such className, please change it to start with upper letter like "Triangle".`),L.warn(`Konva is awesome, right?`)),i.charAt(0)===`#`){if(this.id()===i.slice(1))return!0}else if(i.charAt(0)===`.`){if(this.hasName(i.slice(1)))return!0}else if(this.className===i||this.nodeType===i)return!0;return!1}getLayer(){let e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(vn,this._getStage)}_getStage(){let e=this.getParent();return e?e.getStage():null}fire(e,t,n){return t||={},t.target=t.target||this,n?this._fireAndBubble(e,t):this._fire(e,t),this}getAbsoluteTransform(e){return e||this._hasCachedAncestor()?this._getAbsoluteTransform(e):this._getCache(ln,this._getCachedAbsoluteTransform)}_hasCachedAncestor(){let e=this.parent;for(;e;){if(e.isCached())return!0;e=e.parent}return!1}_getAbsoluteTransform(e){let t=new Ze;return this===e?t:(this.parent&&this.parent!==e&&this.parent.getAbsoluteTransform(e).copyInto(t),this._multiplyOwnTransform(t))}_getCachedAbsoluteTransform(){let e=this._cache[ln]||new Ze;return this.parent?this.parent.getAbsoluteTransform().copyInto(e):e.reset(),this._multiplyOwnTransform(e),e.dirty=!1,e}_multiplyOwnTransform(e){let t=this.transformsEnabled();if(t===`all`)e.multiply(this.getTransform());else if(t===`position`){let t=this.attrs.x||0,n=this.attrs.y||0,r=this.attrs.offsetX||0,i=this.attrs.offsetY||0;e.translate(t-r,n-i)}return e}getAbsoluteScale(e){let t=this;for(;t;)t._isUnderCache&&(e=t),t=t.getParent();let n=this.getAbsoluteTransform(e).decompose();return{x:n.scaleX,y:n.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(yn,this._getTransform)}_getTransform(){let e=this._cache[yn]||new Ze;e.reset();let t=this.x(),n=this.y(),r=I.getAngle(this.rotation()),i=this.attrs.scaleX??1,a=this.attrs.scaleY??1,o=this.attrs.skewX||0,s=this.attrs.skewY||0,c=this.attrs.offsetX||0,l=this.attrs.offsetY||0;return(t!==0||n!==0)&&e.translate(t,n),r!==0&&e.rotate(r),(o!==0||s!==0)&&e.skew(o,s),(i!==1||a!==1)&&e.scale(i,a),(c!==0||l!==0)&&e.translate(-1*c,-1*l),e.dirty=!1,e}clone(e){let t=L.cloneObject(this.attrs),n,r,i,a,o;for(n in e)t[n]=e[n];let s=new this.constructor(t);for(n in this.eventListeners)for(r=this.eventListeners[n],i=r.length,a=0;a<i;a++)o=r[a],o.name.indexOf(fn)<0&&(s.eventListeners[n]||(s.eventListeners[n]=[]),s.eventListeners[n].push(o));return s}_toKonvaCanvas(e){e||={};let t=e.x===void 0||e.y===void 0||!e.width||!e.height?this.getClientRect():{x:0,y:0,width:0,height:0};isFinite(t.x+t.y+t.width+t.height)||L.error(`Cannot find the bounds of the node to export, its client rect is ${t.x}, ${t.y}, ${t.width}x${t.height}. Check its position, size and points.`);let n=this.getStage(),r=e.x===void 0?Math.floor(t.x):e.x,i=e.y===void 0?Math.floor(t.y):e.y,a=e.pixelRatio||1,o=new Bt({width:e.width||Math.max(0,Math.ceil(t.x+t.width-r))||(n?n.width():0),height:e.height||Math.max(0,Math.ceil(t.y+t.height-i))||(n?n.height():0),pixelRatio:a}),s=o.getContext();return e.imageSmoothingEnabled===!1&&(s._context.imageSmoothingEnabled=!1),s.save(),(r||i)&&s.translate(-1*r,-1*i),this.drawScene(o),s.restore(),o._releaseIsolationCanvas(),o}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e||={};let t=e.mimeType||null,n=e.quality??null,r=this._toKonvaCanvas(e).toDataURL(t,n);return e.callback&&e.callback(r),r}toImage(e){return new Promise((t,n)=>{try{let{callback:r,...i}=e||{};L._urlToImage(this.toDataURL(i),function(e){t(e),r?.(e)},n)}catch(e){n(e)}})}toBlob(e){return new Promise((t,n)=>{try{this.toCanvas(e).toBlob(r=>{var i;r?(t(r),(i=e?.callback)==null||i.call(e,r)):n(Error(`Konva: toBlob() failed, the canvas was not encoded`))},e?.mimeType,e?.quality)}catch(e){n(e)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance===void 0?this.parent?this.parent.getDragDistance():I.dragDistance:this.attrs.dragDistance}_off(e,t,n){let r=this.eventListeners[e],i,a,o;for(i=0;i<r.length;i++)if(a=r[i].name,o=r[i].handler,(a!==`konva`||t===`konva`)&&(!t||a===t)&&(!n||n===o)){if(r.splice(i,1),r.length===0){delete this.eventListeners[e];break}i--}}_fireChangeEvent(e,t,n){this._fire(e+un,{oldVal:t,newVal:n})}addName(e){if(!this.hasName(e)){let t=this.name(),n=t?t+` `+e:e;this.name(n)}return this}hasName(e){if(!e)return!1;let t=this.name();return t?(t||``).split(/\s/g).indexOf(e)!==-1:!1}removeName(e){let t=(this.name()||``).split(/\s/g),n=t.indexOf(e);return n!==-1&&(t.splice(n,1),this.name(t.join(` `))),this}setAttr(e,t){let n=this[hn+L._capitalize(e)];return L._isFunction(n)?n.call(this,t):this._setAttr(e,t),this}_addSubtreeObserver(t){(this._subtreeObservers??=new Set).add(t),e._subtreeObserverCount++}_removeSubtreeObserver(t){this._subtreeObservers?.delete(t)&&e._subtreeObserverCount--}_notifySubtreeChange(){if(e._subtreeObserverCount)for(let e=this;e;e=e.parent){let t=e._subtreeObservers;if(t)for(let n of t)n._onSubtreeChange(e)}}_requestDraw(){var e;(e=this.parent)==null||e._notifySubtreeChange(),I.autoDrawEnabled&&(this.getLayer()||this.getStage())?.batchDraw()}_setAttr(e,t){let n=this.attrs[e];(n!==t||L.isObject(t))&&(t==null?delete this.attrs[e]:this.attrs[e]=t,this._attrsVersion!==void 0&&this._attrsVersion++,this._shouldFireChangeEvents&&this._fireChangeEvent(e,n,t),this._requestDraw())}_fireAndBubble(e,t,n){t&&this.nodeType===gn&&(t.target=this);let r=mn.indexOf(e)!==-1;if(!(r&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType===`Stage`&&!n))){this._fire(e,t);let i=r&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(t&&!t.cancelBubble||!t)&&this.parent&&this.parent.isListening()&&!i&&(n&&n.parent?this._fireAndBubble.call(this.parent,e,t,n):this._fireAndBubble.call(this.parent,e,t))}}_getProtoListeners(t){let n=Object.getPrototypeOf(this),r=e.protoListenerMap.get(n);r||(r={},e.protoListenerMap.set(n,r));let i=r[t];if(i===void 0){i=[];let e=new Set,n=Object.getPrototypeOf(this);for(;n;){let r=n.eventListeners?.[t]??[];for(let t=0;t<r.length;t++){let n=r[t];e.has(n)||(e.add(n),i.push(n))}n=Object.getPrototypeOf(n)}r[t]=i}return i}_fire(e,t){t||={},t.currentTarget=this,t.type=e;let n=this._getProtoListeners(e);if(n)for(let e=0;e<n.length;e++)n[e].handler.call(this,t);let r=this.eventListeners[e];if(r){let n=r.slice(),i=n.length;for(let e=0;e<n.length;e++)n[e].handler.call(this,t);let a=this.eventListeners[e];if(a)for(let e=i;e<a.length;e++)a[e].handler.call(this,t)}}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){let t=e?e.pointerId:void 0,n=this.getStage(),r=this.getAbsolutePosition();if(!n)return;let i=n._getPointerById(t)||n._changedPointerPositions[0]||r,a=e?.evt?.type?L._getEventType(e.evt.type):n._pointerEventType,o=a!==`pointer`;R._dragElements.set(this._id,{node:this,startPointerPos:i,offset:{x:i.x-r.x,y:i.y-r.y},dragStatus:`ready`,pointerId:o?t??(`id`in i?i.id:void 0):void 0,pointerEventType:o?a:void 0,startEvent:e})}startDrag(e,t=!0){var n;R._dragElements.has(this._id)||this._createDragElement(e);let r=R._dragElements.get(this._id);r&&(r.dragStatus=`dragging`,(n=this.getStage())==null||n._cancelClick(r.pointerId,r.pointerEventType),this.fire(`dragstart`,{type:`dragstart`,target:this,evt:r.startEvent&&r.startEvent.evt||e&&e.evt},t))}_setDragPosition(e,t){let n=this.getStage()._getPointerById(t.pointerId);if(!n)return;let r={x:n.x-t.offset.x,y:n.y-t.offset.y},i=this.dragBoundFunc();if(i!==void 0){let t=i.call(this,r,e);if(!t)L.warn(`dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.`);else if(!L._isNumber(t.x)||!L._isNumber(t.y)){L.warn(`dragBoundFunc returned a position with a non-finite x or y (${t.x}, ${t.y}). The node was not moved.`);return}else r=t}let a=t.lastPos;(!a||a.x!==r.x||a.y!==r.y)&&(this.setAbsolutePosition(r),this._requestDraw()),t.lastPos=r}stopDrag(e){let t=R._dragElements.get(this._id);t&&(t.dragStatus=`stopped`,R._endDragBefore(e,void 0,t),R._endDragAfter(e,t))}setDraggable(e){this._setAttr(`draggable`,e),this._dragChange()}isDragging(){let e=R._dragElements.get(this._id);return e?e.dragStatus===`dragging`:!1}_listenDrag(){this._dragCleanup(),this.on(`mousedown.konva touchstart.konva`,function(e){if(!(e.evt.button===void 0||I.dragButtons.indexOf(e.evt.button)>=0)||R._dragElements.has(this._id))return;let t=!1;R._dragElements.forEach(e=>{this.isAncestorOf(e.node)&&(t=!0)}),t||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;let e=R._dragElements.get(this._id),t=e&&e.dragStatus===`dragging`,n=e&&e.dragStatus===`ready`;t?this.stopDrag():n&&R._dragElements.delete(this._id)}}_dragCleanup(){this.off(`mousedown.konva`),this.off(`touchstart.konva`)}isClientRectOnScreen(e={x:0,y:0}){let t=this.getStage();if(!t)return!1;let n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return L.haveIntersection(n,this.getClientRect())}static create(e,t){return L._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(t,n){let r=e.prototype.getClassName.call(t),i=t.children,a,o,s;if(n&&(t.attrs.container=n),!I[r]){let e=i?`Group`:`Shape`;L.warn(`Can not find a node with class name "`+r+`". Fallback to "${e}".`),r=e}let c=I[r];if(a=new c(t.attrs),i)for(o=i.length,s=0;s<o;s++)a.add(e._createNode(i[s]));return a}};H._subtreeObserverCount=0,H._updateBatchDepth=0,H._pendingUpdates=new Set,H.protoListenerMap=new WeakMap,H.prototype.nodeType=`Node`,H.prototype._attrsAffectingSize=[],H.prototype.on(Sn,function(){this._batchingTransformChange?this._needClearTransformCache=!0:(this._clearCache(yn),this._clearSelfAndDescendantCache(ln))}),H.prototype.on(`visibleChange.konva`,function(){this._clearSelfAndDescendantCache(xn)}),H.prototype.on(`listeningChange.konva`,function(){this._clearSelfAndDescendantCache(pn);for(let e=this.getParent();e;e=e.getParent()){let t=e._getCanvasCache();t?.hit&&(L.releaseCanvas(t.hit._canvas),t.hit=null)}}),H.prototype.on(`opacityChange.konva`,function(){this._clearSelfAndDescendantCache(cn)});var wn=V.addGetterSetter;wn(H,`zIndex`),wn(H,`absolutePosition`),wn(H,`position`),wn(H,`x`,0,B()),wn(H,`y`,0,B()),wn(H,`globalCompositeOperation`,`source-over`,$t()),wn(H,`opacity`,1,B()),wn(H,`name`,``,$t()),wn(H,`id`,``,$t()),wn(H,`rotation`,0,B()),V.addComponentsGetterSetter(H,`scale`,[`x`,`y`]),wn(H,`scaleX`,1,B()),wn(H,`scaleY`,1,B()),V.addComponentsGetterSetter(H,`skew`,[`x`,`y`]),wn(H,`skewX`,0,B()),wn(H,`skewY`,0,B()),V.addComponentsGetterSetter(H,`offset`,[`x`,`y`]),wn(H,`offsetX`,0,B()),wn(H,`offsetY`,0,B()),wn(H,`dragDistance`,void 0,B()),wn(H,`width`,0,B()),wn(H,`height`,0,B()),wn(H,`listening`,!0,nn()),wn(H,`preventDefault`,!0,nn()),wn(H,`filters`,void 0,function(e){return this._filterUpToDate=!1,e}),wn(H,`visible`,!0,nn()),wn(H,`transformsEnabled`,`all`,$t()),wn(H,`size`),wn(H,`dragBoundFunc`),wn(H,`draggable`,!1,nn()),V.backCompat(H,{rotateDeg:`rotate`,setRotationDeg:`setRotation`,getRotationDeg:`getRotation`});var Tn=class extends H{constructor(){super(...arguments),this.children=[]}getChildren(e){let t=this.children||[];return e?t.filter(e):t.slice()}hasChildren(){return this.children.length>0}removeChildren(){return this._clearChildren(`remove`)}destroyChildren(){return this._clearChildren(`destroy`)}_clearChildren(e){return H._updateBatch(()=>(this.children.forEach(t=>{t.parent=null,t.index=0,t[e]()}),this.children=[],this._notifySubtreeChange(),this._requestDraw(),this))}add(...e){if(e.length===0)return this;if(e.length>1){for(let t=0;t<e.length;t++)this.add(e[t]);return this}let t=e[0];return t.getParent()?(t.moveTo(this),this):(this._validateAdd(t),t.index=this.children.length,t.parent=this,t._clearCaches(),this.children.push(t),this._fire(`add`,{child:t}),this._notifySubtreeChange(),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){let t=this._generalFind(e,!0);return t.length>0?t[0]:void 0}_generalFind(e,t){let n=[];return this._descendants(r=>{let i=r._isMatch(e);return i&&n.push(r),!!(i&&t)}),n}_descendants(e){let t=!1;for(let n of this.children)if(t=e(n),t||n.hasChildren()&&(t=n._descendants(e),t))return!0;return!1}toObject(){let e=H.prototype.toObject.call(this);return e.children=[],this.children.forEach(t=>{e.children.push(t.toObject())}),e}isAncestorOf(e){let t=e.getParent();for(;t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){let t=H.prototype.clone.call(this,e);return this.children.forEach(function(e){t.add(e.clone())}),t}getAllIntersections(e){let t=[];return this.find(`Shape`).forEach(n=>{n.isVisible()&&n.intersects(e)&&t.push(n)}),t}_clearSelfAndDescendantCache(e){var t;let n=e===void 0||e===`absoluteTransform`;n&&H._updateBatchDepth++;try{if(super._clearSelfAndDescendantCache(e),e===`absoluteTransform`&&this.isCached())return;(t=this.children)==null||t.forEach(function(t){t._clearSelfAndDescendantCache(e)})}finally{n&&--H._updateBatchDepth===0&&H._flushUpdateBatch()}}_setChildrenIndices(){var e;(e=this.children)==null||e.forEach(function(e,t){e.index=t}),this._notifySubtreeChange(),this._requestDraw()}drawScene(e,t){let n=this.getLayer(),r=e||n&&n.getCanvas(),i=r&&r.getContext(),a=this._getCanvasCache(),o=a&&a.scene,s=t===this;if(!(t?this._isVisible(t):this.isVisible())&&!s)return this;if(o){i.save();let e=this.getAbsoluteTransform(t).getMatrix();i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedSceneCanvas(i),i.restore()}else this._drawChildren(`drawScene`,r,t);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;let n=this.getLayer(),r=e||n&&n.hitCanvas,i=r&&r.getContext(),a=this._getCachedHitCanvas(t);if(a){i.save();let e=this.getAbsoluteTransform(t).getMatrix();i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedHitCanvas(i,a),i.restore()}else this._drawChildren(`drawHit`,r,t);return this}_drawChildren(e,t,n){let r=t&&t.getContext(),i=this.clipWidth(),a=this.clipHeight(),o=this.clipFunc(),s=typeof i==`number`&&typeof a==`number`||o,c=n===this;if(s){r.save();let e=this.getAbsoluteTransform(n),t=e.getMatrix();r.transform(t[0],t[1],t[2],t[3],t[4],t[5]),r.beginPath();let s;if(o)s=o.call(this,r,this);else{let e=this.clipX(),t=this.clipY();r.rect(e||0,t||0,i,a)}r.clip.apply(r,s),t=e.copy().invert().getMatrix(),r.transform(t[0],t[1],t[2],t[3],t[4],t[5])}let l=!c&&this.globalCompositeOperation()!==`source-over`&&e===`drawScene`;l&&(r.save(),r._applyGlobalCompositeOperation(this));try{this._drawChildNodes(e,t,n)}finally{l&&r.restore(),s&&r.restore()}}_drawChildNodes(e,t,n){var r;(r=this.children)==null||r.forEach(function(r){r[e](t,n)})}getClientRect(e={}){var t;let n=this._getCachedSceneRect(e);if(n)return n;let r=e.skipTransform,i=e.relativeTo,[a,o,s,c]=this.getAbsoluteTransform().getMatrix(),l=!r&&(e._forDrawing||a*c-o*s===0),u,d,f,p,m={x:1/0,y:1/0,width:0,height:0},h=this;return(t=this.children)==null||t.forEach(function(t){if(!t.visible())return;let n=t.getClientRect({relativeTo:l?i:h,_forDrawing:e._forDrawing,skipShadow:e.skipShadow,skipStroke:e.skipStroke});n.width===0&&n.height===0||!isFinite(n.x+n.y+n.width+n.height)||(u===void 0?(u=n.x,d=n.y,f=n.x+n.width,p=n.y+n.height):(u=Math.min(u,n.x),d=Math.min(d,n.y),f=Math.max(f,n.x+n.width),p=Math.max(p,n.y+n.height)))}),m=u===void 0?{x:0,y:0,width:0,height:0}:{x:u,y:d,width:f-u,height:p-d},!r&&!l?this._transformedRect(m,i):m}};V.addComponentsGetterSetter(Tn,`clip`,[`x`,`y`,`width`,`height`]),V.addGetterSetter(Tn,`clipX`,void 0,B()),V.addGetterSetter(Tn,`clipY`,void 0,B()),V.addGetterSetter(Tn,`clipWidth`,void 0,B()),V.addGetterSetter(Tn,`clipHeight`,void 0,B()),V.addGetterSetter(Tn,`clipFunc`);var En=`Stage`,Dn=`string`,On=`px`,kn=`mouseout`,An=`mouseleave`,jn=`mouseover`,Mn=`mouseenter`,Nn=`mousemove`,Pn=`mousedown`,Fn=`mouseup`,In=`pointermove`,Ln=`pointerdown`,Rn=`pointerup`,zn=`pointercancel`,Bn=`lostpointercapture`,Vn=`pointerout`,Hn=`pointerleave`,Un=`pointerover`,Wn=`pointerenter`,Gn=`contextmenu`,Kn=`touchstart`,qn=`touchend`,Jn=`touchmove`,Yn=`touchcancel`,Xn=`wheel`,Zn=5,Qn=[[Mn,`_pointerenter`],[Pn,`_pointerdown`],[Nn,`_pointermove`],[Fn,`_pointerup`],[An,`_pointerleave`],[Kn,`_pointerdown`],[Jn,`_pointermove`],[qn,`_pointerup`],[Yn,`_pointercancel`],[jn,`_pointerover`],[Xn,`_wheel`],[Gn,`_contextmenu`],[Ln,`_pointerdown`],[In,`_pointermove`],[Rn,`_pointerup`],[zn,`_pointercancel`],[Hn,`_pointerleave`],[Bn,`_lostpointercapture`]],$n={mouse:{[Vn]:kn,[Hn]:An,[Un]:jn,[Wn]:Mn,[In]:Nn,[Ln]:Pn,[Rn]:Fn,[zn]:`mousecancel`,pointerclick:`click`,pointerdblclick:`dblclick`},touch:{[Vn]:`touchout`,[Hn]:`touchleave`,[Un]:`touchover`,[Wn]:`touchenter`,[In]:Jn,[Ln]:Kn,[Rn]:qn,[zn]:Yn,pointerclick:`tap`,pointerdblclick:`dbltap`},pointer:{[Vn]:Vn,[Hn]:Hn,[Un]:Un,[Wn]:Wn,[In]:In,[Ln]:Ln,[Rn]:Rn,[zn]:zn,pointerclick:`pointerclick`,pointerdblclick:`pointerdblclick`}},er=e=>{let t=L._getEventType(e);if(t===`pointer`)return I.pointerEventsEnabled&&$n.pointer;if(t===`touch`)return $n.touch;if(t===`mouse`)return $n.mouse};function tr(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&L.warn(`Stage does not support clipping. Please use clip for Layers or Groups.`),e}var nr=`Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);`,rr=[],ir=new WeakSet,ar=e=>{e&&!ir.has(e)&&(ir.add(e),R._listenToWindow(e),e.document.addEventListener(`visibilitychange`,()=>{rr.forEach(e=>{e.batchDraw()})}))},or=class extends Tn{constructor(e){super(tr(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._pointerStates=new Map,this._lastClicks={},this._buildDOM(),this._bindContentEvents(),rr.push(this),this.on(`widthChange.konva heightChange.konva`,this._resizeDOM),this.on(`visibleChange.konva`,this._checkVisibility),this.on(`clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva`,()=>{tr(this.attrs)}),this._checkVisibility()}_validateAdd(e){let t=e.getType()===`Layer`,n=e.getType()===`FastLayer`;t||n||L.throw(`You may only add layers to the stage.`)}_checkVisibility(){if(!this.content)return;let e=this.visible()?``:`none`;this.content.style.display=e}_getOwnerWindow(){return(this.content||this.container())?.ownerDocument?.defaultView||(I.isBrowser?window:null)}setContainer(e){if(typeof e===Dn){let t;if(e.charAt(0)===`.`){let t=e.slice(1);e=document.getElementsByClassName(t)[0]}else t=e.charAt(0)===`#`?e.slice(1):e,e=document.getElementById(t);if(!e)throw`Can not find container in document with id `+t}return this._setAttr(`container`,e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content),ar(this._getOwnerWindow())),this}shouldDrawHit(){return!0}clear(){let e=this.children,t=e.length;for(let n=0;n<t;n++)e[n].clear();return this}clone(e){return e||={},e.container=typeof document<`u`&&document.createElement(`div`),Tn.prototype.clone.call(this,e)}destroy(){var e;super.destroy(),this._pointerStates.clear(),this._lastClicks={};let t=this.content;(e=t?.parentNode)==null||e.removeChild(t);let n=rr.indexOf(this);return n>-1&&rr.splice(n,1),L.releaseCanvas(this.bufferHitCanvas._canvas),this}getPointerPosition(){let e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(L.warn(nr),null)}_getPointerById(e){return this._pointerPositions.find(t=>t.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e={...e},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();let t=new Bt({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach(function(t){if(!t.isVisible())return;let r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio()),L.releaseCanvas(r._canvas)}),t}getIntersection(e){if(!e)return null;let t=this.children,n=t.length-1;for(let r=n;r>=0;r--){let n=t[r].getIntersection(e);if(n)return n}return null}_resizeDOM(){let e=this.width(),t=this.height();this.content&&(this.content.style.width=e+On,this.content.style.height=t+On),this.children.forEach(n=>{n._setSize({width:e,height:t}),n.draw()})}add(e,...t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}super.add(e);let n=this.children.length;return n>Zn&&L.warn(`The stage has `+n+` layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group.`),e._setSize({width:this.width(),height:this.height()}),e.draw(),I.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return z(e,this)}setPointerCapture(e){Kt(e,this)}releaseCapture(e){Jt(e,this)}getLayers(){return this.getChildren()}_bindContentEvents(){I.isBrowser&&Qn.forEach(([e,t])=>{this.content.addEventListener(e,e=>{this._batchEvents(()=>this[t](e))},{passive:!1})})}_batchEvents(e){L._batchEvents(this.eventBatchFunc(),e)}_pointerenter(e){this.setPointersPositions(e);let t=er(e.type);t&&this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);let t=er(e.type);t&&this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_pointerEventsEnabled(){if(I.hitOnDragEnabled)return!0;for(let{node:e,dragStatus:t}of R._dragElements.values())if(t===`dragging`&&e.getStage()===this)return!1;return!this.getLayers().some(e=>I.Transformer?._isLayerTransforming(e))}_cancelClick(e,t){let n=t?[t]:[`mouse`,`touch`,`pointer`];for(let t of n){let n=this._pointerStates.get(`${t}:${e}`);n&&(n.clickStartShape=void 0,n.relatedPointer&&(n.relatedPointer.clickStartShape=void 0))}}_pointerleave(e){let t=er(e.type),n=L._getEventType(e.type);if(!t)return;this.setPointersPositions(e);let r=this._changedPointerPositions[0]?.id,i=`${n}:${r}`,a=this._pointerStates.get(i),o=(a?.targetShape)?.getStage()===this?a.targetShape:void 0,s=this._pointerEventsEnabled()||e.pointerType===`touch`&&!a?.downPosition;s&&(a?.clickStartShape===void 0?this._pointerStates.delete(i):a.targetShape=void 0),o&&s?(o._fireAndBubble(t.pointerout,{evt:e,pointerId:r}),o._fireAndBubble(t.pointerleave,{evt:e,pointerId:r}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this})):s&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[],this._changedPointerPositions=[],this._pointerEventType=void 0}_pointerdown(e){let t=er(e.type),n=L._getEventType(e.type);if(!t)return;this.setPointersPositions(e);let r=!1;this._changedPointerPositions.forEach(i=>{let a=this.getIntersection(i),o=`${n}:${i.id}`,s={targetShape:this._pointerStates.get(o)?.targetShape,clickStartShape:a&&a.isListening()?a:null,lastClick:this._lastClicks[n],downPosition:i,pointerType:e.pointerType};if(this._pointerStates.delete(o),n!==`pointer`){for(let[e,t]of[...this._pointerStates].reverse())if(!(!e.startsWith(`pointer:`)||!t.downPosition||n===`touch`&&t.relatedPointer)&&(n===`mouse`?t.pointerType!==`touch`:t.pointerType===`touch`&&t.downPosition.x===i.x&&t.downPosition.y===i.y)){s.relatedPointer=t,t.relatedPointer=s,t.clickStartShape===void 0&&(s.clickStartShape=void 0);break}}this._pointerStates.set(o,s);for(let e of R._dragElements.values())e.dragStatus===`dragging`&&(e.pointerId===void 0||e.pointerEventType===n&&e.pointerId===i.id||e.pointerEventType===`mouse`&&n===`pointer`&&s.pointerType!==`touch`)&&e.node.getStage()===this&&(e.pointerId===void 0&&n!==`pointer`&&(e.pointerId=i.id,e.pointerEventType=n),this._cancelClick(i.id,n));if(!a||!a.isListening())return;I.capturePointerEventsEnabled&&a.setPointerCapture(i.id),a._fireAndBubble(t.pointerdown,{evt:e,pointerId:i.id}),r=!0;let c=e.type.indexOf(`touch`)>=0;a.preventDefault()&&e.cancelable&&c&&e.preventDefault()}),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointermove(e){let t=er(e.type),n=L._getEventType(e.type);if(!t)return;let r=e.type.indexOf(`touch`)>=0||e.pointerType===`touch`;if(e.cancelable&&r){for(let{node:t,dragStatus:n}of R._dragElements.values())if(n===`dragging`&&t.getStage()===this&&t.preventDefault()){e.preventDefault();break}}if(this.setPointersPositions(e),!this._pointerEventsEnabled())return;let i={},a=!1;this._changedPointerPositions.forEach(r=>{let o=`${n}:${r.id}`,s=this._pointerStates.get(o);s||(s={},this._pointerStates.set(o,s));let c=Wt(r.id)||this.getIntersection(r),l=s.targetShape===c||s.targetShape?.getStage()===this?s.targetShape:void 0,u=r.id,d={evt:e,pointerId:u},f=l!==c;s.targetShape=c&&c.isListening()?c:void 0,f&&l&&(l._fireAndBubble(t.pointerout,{...d},c),l._fireAndBubble(t.pointerleave,{...d},c)),c&&c.isListening()?(a=!0,f&&(c._fireAndBubble(t.pointerover,{...d},l),c._fireAndBubble(t.pointerenter,{...d},l)),i[c._id]||(i[c._id]=!0,c._fireAndBubble(t.pointermove,{...d}))):l&&this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:u})}),a||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){let t=er(e.type),n=L._getEventType(e.type);if(!t)return;this.setPointersPositions(e);let r={},i=!1;this._changedPointerPositions.forEach(a=>{let o=`${n}:${a.id}`,s=this._pointerStates.get(o),c=s?.clickStartShape!==void 0,l=s?.clickStartShape;s?.targetShape&&n!==`touch`?this._pointerStates.set(o,{targetShape:s.targetShape}):this._pointerStates.delete(o);let u=Wt(a.id)||this.getIntersection(a),d=u&&r[u._id];u&&(u.releaseCapture(a.id),r[u._id]=!0);let f=a.id,p={evt:e,pointerId:f},m=u&&u.isListening()?u:null,h=this._lastClicks[n],g=c&&(!m||l===m),_=g&&h&&s?.lastClick===h&&h.shape===m&&Date.now()-h.time<I.dblClickWindow;g&&(this._lastClicks[n]=_?void 0:{shape:m,time:Date.now()}),u&&u.isListening()?(i=!0,d||u._fireAndBubble(t.pointerup,{...p}),c&&l===u&&(u._fireAndBubble(t.pointerclick,{...p}),_&&u._fireAndBubble(t.pointerdblclick,{...p}))):(i||=(this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),!0),c&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:f}),_&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:f})),n===`touch`&&(s?.targetShape)?.getStage()===this&&(s.targetShape._fireAndBubble(t.pointerout,{...p}),s.targetShape._fireAndBubble(t.pointerleave,{...p}))}),i||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),e.cancelable&&n!==`touch`&&n!==`pointer`&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);let t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(Gn,{evt:e}):this._fire(Gn,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);let t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(Xn,{evt:e}):this._fire(Xn,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);let t=er(e.type);this._changedPointerPositions.forEach(n=>{let r=L._getEventType(e.type),i=`${r}:${n.id}`;this._cancelClick(n.id,r);let a=this._pointerStates.get(i)?.targetShape;a&&r!==`touch`?this._pointerStates.set(i,{targetShape:a}):this._pointerStates.delete(i);let o=Wt(n.id)||this.getIntersection(n),s={evt:e,pointerId:n.id};o?(t&&o._fireAndBubble(t.pointercancel,{...s}),o._fireAndBubble(Rn,{...s})):t&&this._fire(t.pointercancel,{...s,target:this,currentTarget:this}),Jt(n.id),t&&r===`touch`&&a?.getStage()===this&&(a._fireAndBubble(t.pointerout,{...s}),a._fireAndBubble(t.pointerleave,{...s}))})}_lostpointercapture(e){Wt(e.pointerId,this)&&Jt(e.pointerId)}setPointersPositions(e){let t=this._getContentPosition(),n=null,r=null;e||=window.event,e.touches===void 0?(this._pointerEventType=e.pointerId===void 0?`mouse`:`pointer`,n=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:L._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:L._getFirstPointerId(e)}]):(this._pointerEventType=`touch`,this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}))}_setPointerPosition(e){L.warn(`Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.`),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};let e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferHitCanvas=new Vt({pixelRatio:1,width:0,height:0}),!I.isBrowser)return;let e=this.container();if(!e)throw`Stage has no container. A container is required.`;e.innerHTML=``,this.content=e.ownerDocument.createElement(`div`),this.content.style.position=`relative`,this.content.style.userSelect=`none`,this.content.className=`konvajs-content`,this.content.setAttribute(`role`,`presentation`),e.appendChild(this.content),ar(this._getOwnerWindow()),this._resizeDOM()}cache(){return L.warn(`Cache function is not allowed for stage. You may use cache only for layers, groups and shapes.`),this}clearCache(){return this}batchDraw(){var e;return(e=this.children)==null||e.forEach(function(e){e.batchDraw()}),this}};or.prototype.nodeType=En,Je(or),V.addGetterSetter(or,`container`),V.addGetterSetter(or,`eventBatchFunc`);var sr=`hasShadow`,cr=`hasFill`,lr=`hasStroke`,ur=`shadowRGBA`,dr=`patternImage`,fr=`linearGradient`,pr=`radialGradient`,mr;function hr(){return mr||(mr=L.createCanvasElement().getContext(`2d`),mr)}var gr={};function _r(e){let t=this.attrs.fillRule;t?e.fill(t):e.fill()}function vr(e){e.stroke()}function yr(){this._clearCache(sr)}function br(){this._clearCache(cr)}function xr(){this._clearCache(lr)}function Sr(){this._clearCache(ur)}function Cr(){this._clearCache(dr)}function wr(){this._clearCache(fr)}function Tr(){this._clearCache(pr)}var U=class e extends H{constructor(e){super(e);let t,n=0;for(;t=L.getHitColor(),!t||t in gr;)if(n++,n>=1e4){L.warn(`Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it.`),t=L.getRandomColor();break}this.colorKey=t,gr[t]=this}getContext(){return L.warn(`shape.getContext() method is deprecated. Please do not use it.`),this.getLayer().getContext()}getCanvas(){return L.warn(`shape.getCanvas() method is deprecated. Please do not use it.`),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(sr,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(dr,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){let e=hr().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||`repeat`);if(e&&e.setTransform){let t=new Ze;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate(I.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());let n=t.getMatrix(),r=typeof DOMMatrix>`u`?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(fr,this.__getLinearGradient)}__getLinearGradient(){let e=this.fillLinearGradientColorStops();if(e){let t=hr(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),i=t.createLinearGradient(n.x,n.y,r.x,r.y);for(let t=0;t<e.length;t+=2)i.addColorStop(e[t],e[t+1]);return i}}_getRadialGradient(){return this._getCache(pr,this.__getRadialGradient)}__getRadialGradient(){let e=this.fillRadialGradientColorStops();if(e){let t=hr(),n=this.fillRadialGradientStartPoint(),r=this.fillRadialGradientEndPoint(),i=t.createRadialGradient(n.x,n.y,this.fillRadialGradientStartRadius(),r.x,r.y,this.fillRadialGradientEndRadius());for(let t=0;t<e.length;t+=2)i.addColorStop(e[t],e[t+1]);return i}}getShadowRGBA(){return this._getCache(ur,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;let e=L.colorToRGBA(this.shadowColor());if(e)return`rgba(`+e.r+`,`+e.g+`,`+e.b+`,`+e.a*(this.shadowOpacity()||1)+`)`}hasFill(){return this._getCache(cr,this._hasFill)}_hasFill(){return this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops())}hasStroke(){return this._getCache(lr,this._hasStroke)}_hasStroke(){return this.strokeEnabled()&&!!(this.strokeWidth()&&(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){let e=this.hitStrokeWidth();return e===`auto`?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){let t=this.getStage();if(!t)return!1;let n=t.bufferHitCanvas;return n.setSizeIfChanged(t.width(),t.height()),n.getContext().clear(),this.drawHit(n),n.context.getImageData(Math.floor(e.x),Math.floor(e.y),1,1).data[3]>0}destroy(){return H.prototype.destroy.call(this),delete gr[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e,t=this.getAbsoluteOpacity()){if(!(this.attrs.perfectDrawEnabled??!0))return!1;let n=e||this.hasFill(),r=this.hasStroke(),i=!this._isUnderCache&&t!==1;if(n&&r&&i)return!0;let a=this.hasShadow(),o=this.shadowForStrokeEnabled();return!!(n&&r&&a&&o)}setStrokeHitEnabled(e){L.warn(`strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead.`),e?this.hitStrokeWidth(`auto`):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){let e=this.attrs.selfRectFunc;if(e)return{...e.call(this,this)};let t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}_getSelfRectForDrawing(){return this.getSelfRect()}getClientRect(e={}){let t=this._getCachedSceneRect(e);if(t)return t;let n=e.skipTransform,r=e.relativeTo,i=e._forDrawing,a=i?this._getSelfRectForDrawing():this.getSelfRect();i&&!this.strokeScaleEnabled()?a=this._transformedRect(a,r):(a.width<0||a.height<0)&&(a=new Ze()._getTransformedRect(a));let o=!e.skipStroke&&this.hasStroke()?i?this._getStrokePadding()*2:this.strokeWidth():0,s=o,c=o,l;if(!i&&o&&!this.strokeScaleEnabled()){let e=this;for(;e&&!e.isCached()&&!e._isUnderCache;)e=e.parent;let[t,i,a,o]=this.getAbsoluteTransform(e).getMatrix(),u=Math.abs(t*o-i*a);if(u)s*=Math.hypot(a,o)/u,c*=Math.hypot(t,i)/u;else if(!n&&(s=c=0,l=e?e.getAbsoluteTransform().copy():new Ze,r)){let e=r.getAbsoluteTransform(),[t,n,i,a]=e.getMatrix();l=t*a-n*i?e.copy().invert().multiply(l):new Ze}}let u={x:a.x-s/2,y:a.y-c/2,width:a.width+s,height:a.height+c};if(i&&this.strokeScaleEnabled()&&(u=this._transformedRect(u,r)),!e.skipShadow&&this.hasShadow()){let e=i?this.getAbsoluteScale():{x:1,y:1},t=this.shadowOffsetX()*e.x,n=this.shadowOffsetY()*e.y,r=this.shadowBlur()*(i?2*Math.min(Math.abs(e.x),Math.abs(e.y)):1);u.x+=Math.min(0,t)-r,u.y+=Math.min(0,n)-r,u.width+=Math.abs(t)+r*2,u.height+=Math.abs(n)+r*2}if(i)return u;if(!n){let e=this._transformedRect(u,r);if(l){let[t,n,r,i]=l.getMatrix(),a=o*Math.hypot(t,r)/2,s=o*Math.hypot(n,i)/2;e.x-=a,e.y-=s,e.width+=a*2,e.height+=s*2}return e}return u}_getStrokePadding(e=this.miterLimit()||10){return this.attrs.sceneFunc&&(e=this.miterLimit()||10),Math.abs(this.strokeWidth())/2*Math.max(this.lineCap()===`square`?Math.SQRT2:1,(this.lineJoin()||`miter`)===`miter`?e:1)}drawScene(t,n){let r=this.getLayer(),i=t||r.getCanvas(),a=i.getContext(),o=this._getCanvasCache(),s=this.getSceneFunc(),c=this.hasShadow(),l=n===this;if(!(n?this._isVisible(n):this.isVisible())&&!l)return this;if(o){a.save();let e=this.getAbsoluteTransform(n).getMatrix();return a.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!s)return this;a.save();try{if(i.width&&i.height&&this._useBufferCanvas(void 0,a._getOpacity(this))){let t=!!a._opacityRoot||!!this.attrs.selfRectFunc&&this.getSelfRect===e.prototype.getSelfRect||!this.attrs.sceneFunc&&!this.attrs.charRenderFunc&&qe.has(this.constructor),r=i._prepareIsolationCanvas(t?this.getClientRect({_forDrawing:!0,relativeTo:n,skipShadow:!0}):void 0),o=r.getContext();o.save(),o._applyLineJoin(this),o._applyMiterLimit(this);let u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),s.call(this,o,this),o.restore(),c&&a._applyShadow(this),l||(a._applyOpacity(this),a._applyGlobalCompositeOperation(this)),a._drawDeviceBuffer(r)}else{if(a._applyLineJoin(this),a._applyMiterLimit(this),!l){let e=this.getAbsoluteTransform(n).getMatrix();a.transform(e[0],e[1],e[2],e[3],e[4],e[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}c&&a._applyShadow(this),s.call(this,a,this)}}catch(e){throw i._releaseIsolationCanvas(),e}finally{a.restore()}return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;let n=this.getLayer(),r=e||n.hitCanvas,i=r&&r.getContext(),a=this.hitFunc()||this.sceneFunc(),o=this._getCachedHitCanvas(t);if(this.colorKey||L.warn(`Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()`),o){i.save();let e=this.getAbsoluteTransform(t).getMatrix();return i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedHitCanvas(i,o),i.restore(),this}if(!a)return this;if(i.save(),i._applyLineJoin(this),i._applyMiterLimit(this),this!==t){let e=this.getAbsoluteTransform(t).getMatrix();i.transform(e[0],e[1],e[2],e[3],e[4],e[5])}try{a.call(this,i,this)}finally{i.restore()}return this}drawHitFromCache(e=0){let t=this._getCachedSceneCanvas(),n=this._getCachedHitCanvas(),r=n.getContext(),i=n.getWidth(),a=n.getHeight();r.clear(),r.drawImage(t._canvas,0,0,i/n.pixelRatio,a/n.pixelRatio);try{let t=r.getImageData(0,0,i,a),n=t.data,o=n.length,s=L._hexToRgb(this.colorKey);for(let t=0;t<o;t+=4)n[t+3]>e?(n[t]=s.r,n[t+1]=s.g,n[t+2]=s.b,n[t+3]=255):n[t+3]=0;r.putImageData(t,0,0)}catch(e){L.error(`Unable to draw hit graph from cached scene canvas. `+e.message)}return this}hasPointerCapture(e){return z(e,this)}setPointerCapture(e){Kt(e,this)}releaseCapture(e){Jt(e,this)}};U.prototype._fillFunc=_r,U.prototype._strokeFunc=vr,U.prototype._fillFuncHit=_r,U.prototype._strokeFuncHit=vr,U.prototype._centroid=!1,U.prototype.nodeType=`Shape`,Je(U),U.prototype.on(`shadowColorChange.konva shadowBlurChange.konva shadowOffsetXChange.konva shadowOffsetYChange.konva shadowOpacityChange.konva shadowEnabledChange.konva`,yr),U.prototype.on(`shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva`,Sr),U.prototype.on(`fillEnabledChange.konva fillChange.konva fillPatternImageChange.konva fillLinearGradientColorStopsChange.konva fillRadialGradientColorStopsChange.konva`,br),U.prototype.on(`strokeEnabledChange.konva strokeWidthChange.konva strokeChange.konva strokeLinearGradientColorStopsChange.konva`,xr),U.prototype.on(`fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva`,Cr),U.prototype.on(`fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva`,wr),U.prototype.on(`fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva`,Tr),V.addGetterSetter(U,`stroke`,void 0,en()),V.addGetterSetter(U,`strokeWidth`,2,B()),V.addGetterSetter(U,`fillAfterStrokeEnabled`,!1),V.addGetterSetter(U,`hitStrokeWidth`,`auto`,Qt()),V.addGetterSetter(U,`strokeHitEnabled`,!0,nn()),V.addGetterSetter(U,`perfectDrawEnabled`,!0,nn()),V.addGetterSetter(U,`shadowForStrokeEnabled`,!0,nn()),V.addGetterSetter(U,`lineJoin`),V.addGetterSetter(U,`lineCap`),V.addGetterSetter(U,`miterLimit`),V.addGetterSetter(U,`sceneFunc`),V.addGetterSetter(U,`hitFunc`),V.addGetterSetter(U,`selfRectFunc`),V.addGetterSetter(U,`dash`),V.addGetterSetter(U,`dashOffset`,0,B()),V.addGetterSetter(U,`shadowColor`,void 0,$t()),V.addGetterSetter(U,`shadowBlur`,0,B()),V.addGetterSetter(U,`shadowOpacity`,1,B()),V.addComponentsGetterSetter(U,`shadowOffset`,[`x`,`y`]),V.addGetterSetter(U,`shadowOffsetX`,0,B()),V.addGetterSetter(U,`shadowOffsetY`,0,B()),V.addGetterSetter(U,`fillPatternImage`),V.addGetterSetter(U,`fill`,void 0,en()),V.addGetterSetter(U,`fillPatternX`,0,B()),V.addGetterSetter(U,`fillPatternY`,0,B()),V.addGetterSetter(U,`fillLinearGradientColorStops`),V.addGetterSetter(U,`strokeLinearGradientColorStops`),V.addGetterSetter(U,`fillRadialGradientStartRadius`,0),V.addGetterSetter(U,`fillRadialGradientEndRadius`,0),V.addGetterSetter(U,`fillRadialGradientColorStops`),V.addGetterSetter(U,`fillPatternRepeat`,`repeat`),V.addGetterSetter(U,`fillEnabled`,!0),V.addGetterSetter(U,`strokeEnabled`,!0),V.addGetterSetter(U,`shadowEnabled`,!0),V.addGetterSetter(U,`dashEnabled`,!0),V.addGetterSetter(U,`strokeScaleEnabled`,!0),V.addGetterSetter(U,`fillPriority`,`color`),V.addComponentsGetterSetter(U,`fillPatternOffset`,[`x`,`y`]),V.addGetterSetter(U,`fillPatternOffsetX`,0,B()),V.addGetterSetter(U,`fillPatternOffsetY`,0,B()),V.addComponentsGetterSetter(U,`fillPatternScale`,[`x`,`y`]),V.addGetterSetter(U,`fillPatternScaleX`,1,B()),V.addGetterSetter(U,`fillPatternScaleY`,1,B()),V.addComponentsGetterSetter(U,`fillLinearGradientStartPoint`,[`x`,`y`]),V.addComponentsGetterSetter(U,`strokeLinearGradientStartPoint`,[`x`,`y`]),V.addGetterSetter(U,`fillLinearGradientStartPointX`,0),V.addGetterSetter(U,`strokeLinearGradientStartPointX`,0),V.addGetterSetter(U,`fillLinearGradientStartPointY`,0),V.addGetterSetter(U,`strokeLinearGradientStartPointY`,0),V.addComponentsGetterSetter(U,`fillLinearGradientEndPoint`,[`x`,`y`]),V.addComponentsGetterSetter(U,`strokeLinearGradientEndPoint`,[`x`,`y`]),V.addGetterSetter(U,`fillLinearGradientEndPointX`,0),V.addGetterSetter(U,`strokeLinearGradientEndPointX`,0),V.addGetterSetter(U,`fillLinearGradientEndPointY`,0),V.addGetterSetter(U,`strokeLinearGradientEndPointY`,0),V.addComponentsGetterSetter(U,`fillRadialGradientStartPoint`,[`x`,`y`]),V.addGetterSetter(U,`fillRadialGradientStartPointX`,0),V.addGetterSetter(U,`fillRadialGradientStartPointY`,0),V.addComponentsGetterSetter(U,`fillRadialGradientEndPoint`,[`x`,`y`]),V.addGetterSetter(U,`fillRadialGradientEndPointX`,0),V.addGetterSetter(U,`fillRadialGradientEndPointY`,0),V.addGetterSetter(U,`fillPatternRotation`,0),V.addGetterSetter(U,`fillRule`,void 0,$t()),V.backCompat(U,{dashArray:`dash`,getDashArray:`getDash`,setDashArray:`setDash`,drawFunc:`sceneFunc`,getDrawFunc:`getSceneFunc`,setDrawFunc:`setSceneFunc`,drawHitFunc:`hitFunc`,getDrawHitFunc:`getHitFunc`,setDrawHitFunc:`setHitFunc`});var Er=`beforeDraw`,Dr=`draw`,Or=10,kr=256;function Ar(e,t){return e[t+3]>=128?gr[L.getHitColorKey(e[t],e[t+1],e[t+2])]:void 0}var jr=class extends Tn{constructor(e){super(e),this.canvas=new Bt,this.hitCanvas=new Vt({pixelRatio:1}),this._waitingForDraw=!1,this.on(`visibleChange.konva`,this._checkVisibility),this._checkVisibility(),this.on(`imageSmoothingEnabledChange.konva`,this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);let t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e<t.children.length-1?t.content.insertBefore(this.getNativeCanvasElement(),t.children[e+1].getCanvas()._canvas):t.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){H.prototype.moveToTop.call(this);let e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!H.prototype.moveUp.call(this))return!1;let e=this.getStage();return!e||!e.content?!1:(e.content.removeChild(this.getNativeCanvasElement()),this.index<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[this.index+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(H.prototype.moveDown.call(this)){let e=this.getStage();if(e){let t=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),t[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(H.prototype.moveToBottom.call(this)){let e=this.getStage();if(e){let t=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),t[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var e,t;super.remove();let n=this.getNativeCanvasElement(),r=this.getHitCanvas()._canvas;return(e=n.parentNode)==null||e.removeChild(n),(t=r.parentNode)==null||t.removeChild(r),this}getStage(){return this.parent}_setSize({width:e,height:t}){return this.canvas.setSize(e,t),this._syncHitCanvasSize(),this._setSmoothEnabled(),this}_syncHitCanvasSize(){let e=this.isListening();this.hitCanvas.setSizeIfChanged((e?this.getWidth():0)||0,(e?this.getHeight():0)||0)}_validateAdd(e){let t=e.getType();t!==`Group`&&t!==`Shape`&&L.throw(`You may only add groups and shapes to a layer.`)}_toKonvaCanvas(e){return e={...e},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x===void 0?this.x():e.x,e.y=e.y===void 0?this.y():e.y,H.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display=`block`:this.canvas._canvas.style.display=`none`}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){L.warn(`Can not change width of layer. Use "stage.width(value)" function instead.`)}getHeight(){if(this.parent)return this.parent.height()}setHeight(){L.warn(`Can not change height of layer. Use "stage.height(value)" function instead.`)}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,L.requestAnimFrame(()=>{this._waitingForDraw=!1,this.draw()},this.getStage()?._getOwnerWindow())),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let t=this._getIntersection(e);if(t.shape)return t.shape;if(!t.antialiased)return null;let n=this.hitCanvas.pixelRatio,r=Math.floor(e.x*n),i=Math.floor(e.y*n),a=e=>this.hitCanvas.context.getImageData(r-e,i-e,e*2+1,e*2+1).data,o=Or,s=o*2+1,c=a(o),l=c[(o*s+o)*4+3];for(let e=1;e<=kr;e++){e>o&&(o=Math.min(kr,o*2),s=o*2+1,c=a(o));let t=0;for(let n=-e;n<=e;n++){let r=Math.abs(n)===e?1:e*2;for(let i=-e;i<=e;i+=r){let e=((n+o)*s+i+o)*4,r=Ar(c,e);if(r)return r;t=Math.max(t,c[e+3])}}if(t<=l&&t!==255)return null;l=t}return null}_getIntersection(e){if(!this.hitCanvas.width||!this.hitCanvas.height)return{};let t=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.floor(e.x*t),Math.floor(e.y*t),1,1).data,r=Ar(n,0);return r?{shape:r}:n[3]>0?{antialiased:!0}:{}}drawScene(e,t){let n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire(Er,{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),Tn.prototype.drawScene.call(this,r,t),r._trimIsolationCanvas(),this._fire(Dr,{node:this}),this}shouldDrawHit(e){if(!super.shouldDrawHit(e))return!1;if(e||I.hitOnDragEnabled)return!0;let t=!1;return R._dragElements.forEach(e=>{e.dragStatus===`dragging`&&(e.node===this.getStage()||e.node.getLayer()===this)&&(t=!0)}),!t&&!I.Transformer?._isLayerTransforming(this)}drawHit(e,t){let n=this.getLayer(),r=e||n&&n.hitCanvas;return!e&&n&&(n._syncHitCanvasSize(),n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear()),Tn.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){L.warn(`hitGraphEnabled method is deprecated. Please use layer.listening() instead.`),this.listening(e)}getHitGraphEnabled(e){return L.warn(`hitGraphEnabled method is deprecated. Please use layer.listening() instead.`),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;let e=this.parent;this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return this.getCanvas()._releaseIsolationCanvas(),L.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};jr.prototype.nodeType=`Layer`,Je(jr),V.addGetterSetter(jr,`imageSmoothingEnabled`,!0),V.addGetterSetter(jr,`clearBeforeDraw`,!0),V.addOverloadedGetterSetter(jr,`hitGraphEnabled`);var Mr=class extends jr{constructor(e){super(e),this.listening(!1),L.warn(`Konva.FastLayer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.`)}};Mr.prototype.nodeType=`FastLayer`,Je(Mr);var Nr=class extends Tn{_validateAdd(e){let t=e.getType();t!==`Group`&&t!==`Shape`&&L.throw(`You may only add groups and shapes to groups.`)}_drawChildNodes(e,t,n){if(e!==`drawScene`||!this.isolated()||n===this)return super._drawChildNodes(e,t,n);if(!t.width||!t.height)return;let r=t.getContext(),i=t._prepareIsolationCanvas(this.getClientRect({_forDrawing:!0,relativeTo:n})),a=i.getContext();a._opacityRoot=this,r.save();try{super._drawChildNodes(e,i,n),r._applyOpacity(this),r._drawDeviceBuffer(i)}catch(e){throw t._releaseIsolationCanvas(),e}finally{r.restore(),a._opacityRoot=void 0}}};V.addGetterSetter(Nr,`isolated`,!1,nn()),Nr.prototype.nodeType=`Group`,Je(Nr);var Pr=Ke.performance?.now?()=>Ke.performance.now():Date.now,Fr=class e{constructor(t,n){this.id=e.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Pr(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(e){return this.layers=e?[].concat(e):[],this}getLayers(){return this.layers}addLayer(e){let t=this.layers,n=t.length;for(let r=0;r<n;r++)if(t[r]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){return e.animations.has(this)}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=Pr(),e._addAnimation(this),this}stop(){return e._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.add(e),this._handleAnimation()}static _removeAnimation(e){this.animations.delete(e)}static _runFrames(){let e=new Set;H._updateBatch(()=>{Array.from(this.animations).forEach(t=>{this.animations.has(t)&&(t._updateFrameObject(Pr()),!(t.func&&t.func.call(t,t.frame)===!1)&&t.layers.forEach(t=>t&&e.add(t)))})}),e.forEach(e=>e.batchDraw())}static _animationLoop(){let t=e;t.animations.size?(t._runFrames(),L.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,L.requestAnimFrame(this._animationLoop))}};Fr.animations=new Set,Fr.animIdCounter=0,Fr.animRunning=!1;var Ir={node:1,duration:1,easing:1,onFinish:1,onUpdate:1,onReset:1,yoyo:1},Lr=1,Rr=2,zr=3,Br=[`fill`,`stroke`,`shadowColor`],Vr=0;function Hr(e){return L.colorToRGBA(e)||L.throw(`can not tween the color "`+e+`", because it is not a valid color.`)}function Ur(e,t){return{r:t.r-e.r,g:t.g-e.g,b:t.b-e.b,a:t.a-e.a}}function Wr(e,t,n){return`rgba(`+Math.round(e.r+t.r*n)+`,`+Math.round(e.g+t.g*n)+`,`+Math.round(e.b+t.b*n)+`,`+(e.a+t.a*n)+`)`}var Gr=class{constructor(e,t,n,r,i,a,o){this.prop=e,this.propFunc=t,this.begin=r,this._pos=r,this.duration=a,this._change=0,this.prevPos=0,this.yoyo=o,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=n,this._change=i-this.begin,this.pause()}fire(e){let t=this[e];t&&t()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=Rr,this._startTime=this.getTimer()-this._time,this.fire(`onPlay`),this.onEnterFrame()}reverse(){this.state=zr,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.fire(`onReverse`),this.onEnterFrame()}seek(e){this.pause(),this._time=e,this.update(),this.fire(`onSeek`)}reset(){this.pause(),this._time=0,this.update(),this.fire(`onReset`)}finish(){this.pause(),this._time=this.duration,this.update(),this.fire(`onFinish`)}update(){this.setPosition(this.getPosition(this._time)),this.fire(`onUpdate`)}onEnterFrame(){let e=this.getTimer()-this._startTime;this.state===Rr?this.setTime(e):this.state===zr&&this.setTime(this.duration-e)}pause(){this.state=Lr,this.fire(`onPause`)}getTimer(){return Date.now()}},Kr=class e{constructor(t){let n=this,r=t.node,i=r._id,a=t.easing||qr.Linear,o=!!t.yoyo,s,c;s=t.duration===void 0?.3:t.duration===0?.001:t.duration,this.node=r,this._id=Vr++;let l=r.getLayer()||(r instanceof I.Stage?r.getLayers():null);for(c in l||L.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Fr(function(){n.tween.onEnterFrame()},l),this.tween=new Gr(c,function(e){n._tweenFunc(e)},a,0,1,s*1e3,o),this._addListeners(),e.attrs[i]||(e.attrs[i]={}),e.attrs[i][this._id]||(e.attrs[i][this._id]={}),e.tweens[i]||(e.tweens[i]={}),t)Ir[c]===void 0&&this._addAttr(c,t[c]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){if(L._isPlainObject(n)){for(let e in n)this._addAttr(t+L._capitalize(e),n[e]);return}let r=this.node,i=r._id,a,o,s,c,l=e.tweens[i][t];l!==void 0&&delete e.attrs[i][l][t];let u=r.getAttr(t);if(L._isArray(n)||L._isArray(u)){if(a=[],c=u,s=n,u=L._isArray(u)?u.slice():Array(n.length).fill(u||0),L._isArray(n)||(n=Array(u.length).fill(n)),o=Math.max(n.length,u.length),t===`points`&&n.length!==u.length&&(n.length>u.length?u=L._prepareArrayForTween(u,n,r.closed()):n=L._prepareArrayForTween(n,u,r.closed())),t.endsWith(`ColorStops`))for(let e=0;e<o;e++)if(e%2==0)a.push((n[e]||0)-(u[e]||0));else{let t=Hr(u[e]);u[e]=t,a.push(Ur(t,Hr(n[e])))}else for(let e=0;e<o;e++)a.push((n[e]||0)-(u[e]||0))}else Br.indexOf(t)===-1?a=n-u:(u=Hr(u),a=Ur(u,Hr(n)));e.attrs[i][this._id][t]={start:u,diff:a,end:n,trueEnd:s,trueStart:c},e.tweens[i][t]=this._id}_tweenFunc(t){let n=this.node,r=e.attrs[n._id]?.[this._id],i,a,o,s,c,l,u,d;for(i in r){if(a=r[i],o=a.start,s=a.diff,d=a.end,L._isArray(o)){if(c=[],u=Math.max(o.length,d.length),i.endsWith(`ColorStops`))for(l=0;l<u;l++)l%2==0?c.push((o[l]||0)+s[l]*t):c.push(Wr(o[l],s[l],t));else for(l=0;l<u;l++)c.push((o[l]||0)+s[l]*t)}else c=Br.indexOf(i)===-1?o+s*t:Wr(o,s,t);n.setAttr(i,c)}}_addListeners(){let t=`destroy.konva-tween${this._id}`,n=()=>this.destroy(),r=()=>{this.node.off(t).on(t,n),this.anim.start()};this.tween.onPlay=r,this.tween.onReverse=r,this.tween.onPause=()=>{this.node.off(t),this.anim.stop()};let i=(t,n)=>{let r=e.attrs[this.node._id]?.[this._id];if(r){for(let e in r)r[e][t]!==void 0&&this.node.setAttr(e,r[e][t]);n?.call(this)}};this.tween.onFinish=()=>i(`trueEnd`,this.onFinish),this.tween.onReset=()=>i(`trueStart`,this.onReset),this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){let t=this.node._id,n=this._id,r=e.attrs[t]?.[n],i=e.tweens[t];if(this.pause(),this.anim&&this.anim.stop(),r){if(i){for(let e in r)delete i[e];Object.keys(i).length===0&&delete e.tweens[t]}delete e.attrs[t][n],Object.keys(e.attrs[t]).length===0&&delete e.attrs[t]}}};Kr.attrs={},Kr.tweens={},H.prototype.to=function(e){let t=e.onFinish,n=new Kr({...e,node:this,onFinish(){n.destroy(),t&&t()}});return n.play(),n};var qr={BackEaseIn(e,t,n,r){return n*(e/=r)*e*(2.70158*e-1.70158)+t},BackEaseOut(e,t,n,r){return n*((e=e/r-1)*e*(2.70158*e+1.70158)+1)+t},BackEaseInOut(e,t,n,r){let i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,a){let o=0;return e===0?t:(e/=r)===1?t+n:(a||=r*.3,!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),-(i*2**(10*--e)*Math.sin((e*r-o)*(2*Math.PI)/a))+t)},ElasticEaseOut(e,t,n,r,i,a){let o=0;return e===0?t:(e/=r)===1?t+n:(a||=r*.3,!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),i*2**(-10*e)*Math.sin((e*r-o)*(2*Math.PI)/a)+n+t)},ElasticEaseInOut(e,t,n,r,i,a){let o=0;return e===0?t:(e/=r/2)==2?t+n:(a||=.3*1.5*r,!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),e<1?-.5*(i*2**(10*--e)*Math.sin((e*r-o)*(2*Math.PI)/a))+t:i*2**(-10*--e)*Math.sin((e*r-o)*(2*Math.PI)/a)*.5+n+t)},BounceEaseOut(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t},BounceEaseIn(e,t,n,r){return n-qr.BounceEaseOut(r-e,0,n,r)+t},BounceEaseInOut(e,t,n,r){return e<r/2?qr.BounceEaseIn(e*2,0,n,r)*.5+t:qr.BounceEaseOut(e*2-r,0,n,r)*.5+n*.5+t},EaseIn(e,t,n,r){return n*(e/=r)*e+t},EaseOut(e,t,n,r){return-n*(e/=r)*(e-2)+t},EaseInOut(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},StrongEaseIn(e,t,n,r){return n*(e/=r)*e*e*e*e+t},StrongEaseOut(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t},StrongEaseInOut(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t},Linear(e,t,n,r){return n*e/r+t}},Jr=L._assign(I,{beginUpdateBatch:H._beginUpdateBatch,Util:L,Transform:Ze,Node:H,Container:Tn,Stage:or,stages:rr,Layer:jr,FastLayer:Mr,Group:Nr,DD:R,Shape:U,shapes:gr,Animation:Fr,Tween:Kr,Easings:qr,Context:It,Canvas:zt}),Yr=class extends U{_sceneFunc(e){let t=I.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,Math.abs(this.outerRadius()),0,t,n),e.arc(0,0,Math.abs(this.innerRadius()),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return Math.abs(this.outerRadius())*2}getHeight(){return Math.abs(this.outerRadius())*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){let e=Math.abs(this.innerRadius()),t=Math.abs(this.outerRadius()),n=Math.min(e,t),r=Math.max(e,t),i=this.clockwise(),a=I.getAngle(this.angle());if(a%(Math.PI*2)==0)return a===0?{x:n,y:0,width:r-n,height:0}:{x:-r,y:-r,width:r*2,height:r*2};let o=Math.PI*2,s=i?-a:a,c=s>=o?o:(s%o+o)%o,l=Math.cos(Math.min(c,Math.PI)),u=Math.sin(Math.min(Math.max(Math.PI,c),3*Math.PI/2)),d=Math.sin(Math.min(c,Math.PI/2)),f=l*(l>0?n:r),p=1*r,m=u*(u>0?n:r),h=d*(d>0?r:n);return{x:f,y:i?-1*h:m,width:p-f,height:h-m}}};Yr.prototype._centroid=!0,Yr.prototype.className=`Arc`,Yr.prototype._attrsAffectingSize=[`innerRadius`,`outerRadius`,`angle`,`clockwise`],Je(Yr,!0),V.addGetterSetter(Yr,`innerRadius`,0,B()),V.addGetterSetter(Yr,`outerRadius`,0,B()),V.addGetterSetter(Yr,`angle`,0,B()),V.addGetterSetter(Yr,`clockwise`,!1,nn());var Xr=[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],Zr=[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],Qr=(e,t,n)=>{let r=n/2,i=0;for(let n=0;n<Xr.length;n++){let a=r*Xr[n]+r;i+=Zr[n]*ei(e,t,a)}return r*i},$r=(e,t,n=1)=>Qr([e[0],e[0]+2/3*(e[1]-e[0]),e[2]+2/3*(e[1]-e[2]),e[2]],[t[0],t[0]+2/3*(t[1]-t[0]),t[2]+2/3*(t[1]-t[2]),t[2]],n);function ei(e,t,n){let r=1-n,i=r*r,a=2*r*n,o=n*n,s=i*(3*(e[1]-e[0]))+a*(3*(e[2]-e[1]))+o*(3*(e[3]-e[2])),c=i*(3*(t[1]-t[0]))+a*(3*(t[2]-t[1]))+o*(3*(t[3]-t[2]));return Math.sqrt(s*s+c*c)}var ti=(e,t,n)=>{let r=1,i=e/t,a=(e-n(i))/t,o=0;for(;r>.001;){let s=n(i+a),c=Math.abs(e-s)/t;if(c<r)r=c,i+=a;else{let o=n(i-a),s=Math.abs(e-o)/t;s<r?(r=s,i-=a):a/=2}if(o++,o>500)break}return i},ni=(e,t,n,r)=>{let i=1-r;return i*i*e+2*i*r*t+r*r*n},ri=(e,t,n,r,i,a)=>{let o=[];for(let s of[[e,n,i],[t,r,a]]){let c=(s[0]-s[1])/(s[0]-2*s[1]+s[2]);c>0&&c<1&&o.push(ni(e,n,i,c),ni(t,r,a,c))}return o},ii=(e,t,n,r,i)=>{let a=1-i;return a*a*a*e+3*a*a*i*t+3*a*i*i*n+i*i*i*r},ai=(e,t,n,r,i,a,o,s)=>{let c=[];for(let l of[[e,n,i,o],[t,r,a,s]]){let u=-3*l[0]+9*l[1]-9*l[2]+3*l[3],d=6*l[0]-12*l[1]+6*l[2],f=-3*l[0]+3*l[1],p=d*d-4*u*f;if(p<0)continue;let m=-(d+(d<0?-1:1)*Math.sqrt(p))/2;for(let l of[m/u,f/m])l>0&&l<1&&c.push(ii(e,n,i,o,l),ii(t,r,a,s,l))}return c};function oi(e,t,n,r,i,a,o){let s=Math.sqrt((n-e)**2+(r-t)**2),c=Math.sqrt((i-n)**2+(a-r)**2),l=s+c;if(l===0)return[n,r,n,r];let u=o*s/l,d=o*c/l;return[n-u*(i-e),r-u*(a-t),n+d*(i-e),r+d*(a-t)]}function si(e,t){let n=e.length,r=[];for(let i=2;i<n-2;i+=2){let n=oi(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t);isNaN(n[0])||(r.push(n[0]),r.push(n[1]),r.push(e[i]),r.push(e[i+1]),r.push(n[2]),r.push(n[3]))}return r}function ci(e){let t=[];for(let n=0;n+7<e.length;n+=6)t.push(e[n+6],e[n+7],...ai(e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5],e[n+6],e[n+7]));return t}var li=class extends U{constructor(e){super(e),this.on(`pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva`,function(){this._clearCache(`tensionPoints`)})}_hasTension(){return this.tension()!==0&&this.points().length>4}_eachTensionSegment(e,t){let n=this.points(),r=n.length,i=this.closed(),a=this.getTensionPoints(),o=a.length,s=n[0],c=n[1],l=i?0:4;for(i||(e(s,c,a[0],a[1],a[2],a[3]),s=a[2],c=a[3]);l<o-2;){let e=a[l++],n=a[l++],r=a[l++],i=a[l++],o=a[l++],u=a[l++];t(s,c,e,n,r,i,o,u),s=o,c=u}i||e(s,c,a[o-2],a[o-1],n[r-2],n[r-1])}_getStrokePadding(e=this.points().length===4&&!this.closed()?1:void 0){return super._getStrokePadding(e)}_sceneFunc(e){let t=this.points(),n=t.length,r=this.closed(),i=this.bezier();if(!n)return;let a=0;if(e.beginPath(),e.moveTo(t[0],t[1]),this._hasTension())this._eachTensionSegment((t,n,r,i,a,o)=>e.quadraticCurveTo(r,i,a,o),(t,n,r,i,a,o,s,c)=>e.bezierCurveTo(r,i,a,o,s,c));else if(i)for(a=2;a<n;)e.bezierCurveTo(t[a++],t[a++],t[a++],t[a++],t[a++],t[a++]);else for(a=2;a<n;a+=2)e.lineTo(t[a],t[a+1]);r?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache(`tensionPoints`,this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():si(this.points(),this.tension())}_getTensionPointsClosed(){let e=this.points(),t=e.length,n=this.tension(),r=oi(e[t-2],e[t-1],e[0],e[1],e[2],e[3],n),i=oi(e[t-4],e[t-3],e[t-2],e[t-1],e[0],e[1],n),a=si(e,n);return[r[2],r[3]].concat(a,[i[0],i[1],e[t-2],e[t-1],i[2],i[3],r[0],r[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};if(this._hasTension()){let t=[e[0],e[1]];this._eachTensionSegment((e,n,r,i,a,o)=>t.push(a,o,...ri(e,n,r,i,a,o)),(e,n,r,i,a,o,s,c)=>t.push(s,c,...ai(e,n,r,i,a,o,s,c))),e=t}else this.bezier()&&(e=[e[0],e[1],...ci(e)]);return L._getPointsRect(e)}};li.prototype.className=`Line`,li.prototype._attrsAffectingSize=[`points`,`bezier`,`tension`,`closed`],Je(li,!0),V.addGetterSetter(li,`closed`,!1),V.addGetterSetter(li,`bezier`,!1),V.addGetterSetter(li,`tension`,0,B()),V.addGetterSetter(li,`points`,[],tn());var ui={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,z:0},di=Math.PI*2,fi=class e extends U{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on(`dataChange.konva`,function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=e.parsePathData(this.data()),this.pathLength=e.getPathLength(this.dataArray)}_sceneFunc(e){let t=this.dataArray;e.beginPath();let n=!1;for(let r=0;r<t.length;r++){let i=t[r].command,a=t[r].points;switch(i){case`L`:e.lineTo(a[0],a[1]);break;case`M`:e.moveTo(a[0],a[1]);break;case`C`:e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case`Q`:e.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case`A`:e.ellipse(a[0],a[1],a[2],a[3],a[6],a[4],a[4]+a[5],!a[7]);break;case`z`:n=!0,e.closePath()}}!n&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let t=[];return this.dataArray.forEach(function(n){if(n.command===`A`){let[r,i,a,o,s,c,l]=n.points,u=Math.cos(l),d=Math.sin(l),f=e.getPointOnEllipticalArc(r,i,a,o,s+c,l);t.push(n.start.x,n.start.y,f.x,f.y);let p=Math.atan2(-o*d,a*u),m=Math.atan2(o*u,a*d);[p,p+Math.PI,m,m+Math.PI].forEach(n=>{if(((n-s)*Math.sign(c)%di+di)%di<Math.abs(c)){let s=e.getPointOnEllipticalArc(r,i,a,o,n,l);t.push(s.x,s.y)}})}else n.command===`C`?t.push(n.start.x,n.start.y,n.points[4],n.points[5],...ai(n.start.x,n.start.y,n.points[0],n.points[1],n.points[2],n.points[3],n.points[4],n.points[5])):n.command===`Q`?t.push(n.start.x,n.start.y,n.points[2],n.points[3],...ri(n.start.x,n.start.y,n.points[0],n.points[1],n.points[2],n.points[3])):t.push(...n.points)}),L._getPointsRect(t)}getLength(){return this.pathLength}getPointAtLength(t){return e.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}static getPathLength(e){let t=0;for(let n=0;n<e.length;++n)t+=e[n].pathLength;return t}static getPointAtLengthOfDataArray(t,n,r){let i,a=r?.index??0,o=r?.offset??0,s=n.length;if(!s)return null;for(;a>0&&t<=o;)o-=n[--a].pathLength;for(t-=o;a<s&&t>n[a].pathLength;){let e=n[a].pathLength;t-=e,o+=e,++a}if(r&&a<s&&(r.index=a,r.offset=o),a===s&&(a--,t=n[a].pathLength),t<.01)return n[a].command===`M`?(i=n[a].points.slice(0,2),{x:i[0],y:i[1]}):{x:n[a].start.x,y:n[a].start.y};let c=n[a],l=c.points;switch(c.command){case`L`:case`z`:return e.getPointOnLine(t,c.start.x,c.start.y,l[0],l[1]);case`C`:return e.getPointOnCubicBezier(ti(t,c.pathLength,e=>Qr([c.start.x,l[0],l[2],l[4]],[c.start.y,l[1],l[3],l[5]],e)),c.start.x,c.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case`Q`:return e.getPointOnQuadraticBezier(ti(t,c.pathLength,e=>$r([c.start.x,l[0],l[2]],[c.start.y,l[1],l[3]],e)),c.start.x,c.start.y,l[0],l[1],l[2],l[3]);case`A`:return e.getPointOnEllipticalArc(l[0],l[1],l[2],l[3],l[2]===l[3]?l[4]+l[5]*t/c.pathLength:e._walkArc(l,t).theta,l[6])}return null}static getPointOnLine(e,t,n,r,i,a,o){a??=t,o??=n;let s=this.getLineLength(t,n,r,i);if(s<1e-10)return{x:t,y:n};if(r===t)return{x:a,y:o+(i>n?e:-e)};let c=(i-n)/(r-t),l=Math.sqrt(e*e/(1+c*c))*(r<t?-1:1),u=c*l;if(Math.abs(o-n-c*(a-t))<1e-10)return{x:a+l,y:o+u};let d=((a-t)*(r-t)+(o-n)*(i-n))/(s*s),f=t+d*(r-t),p=n+d*(i-n),m=this.getLineLength(a,o,f,p),h=Math.sqrt(e*e-m*m),g=Math.sqrt(h*h/(1+c*c))*(r<t?-1:1),_=c*g;return{x:f+g,y:p+_}}static getPointOnCubicBezier(e,t,n,r,i,a,o,s,c){function l(e){return e*e*e}function u(e){return 3*e*e*(1-e)}function d(e){return 3*e*(1-e)*(1-e)}function f(e){return(1-e)*(1-e)*(1-e)}return{x:s*l(e)+a*u(e)+r*d(e)+t*f(e),y:c*l(e)+o*u(e)+i*d(e)+n*f(e)}}static getPointOnQuadraticBezier(e,t,n,r,i,a,o){function s(e){return e*e}function c(e){return 2*e*(1-e)}function l(e){return(1-e)*(1-e)}return{x:a*s(e)+r*c(e)+t*l(e),y:o*s(e)+i*c(e)+n*l(e)}}static getPointOnEllipticalArc(e,t,n,r,i,a){let o=Math.cos(a),s=Math.sin(a),c={x:n*Math.cos(i),y:r*Math.sin(i)};return{x:e+(c.x*o-c.y*s),y:t+(c.x*s+c.y*o)}}static parsePathData(e){if(!e)return[];let t=e,n=[`m`,`M`,`l`,`L`,`v`,`V`,`h`,`H`,`z`,`Z`,`c`,`C`,`q`,`Q`,`t`,`T`,`s`,`S`,`a`,`A`];t=t.replace(RegExp(` `,`g`),`,`);for(let e=0;e<n.length;e++)t=t.replace(new RegExp(n[e],`g`),`|`+n[e]);let r=t.split(`|`),i=[],a=[],o=0,s=0,c=0,l=0,u=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,d;for(let e=1;e<r.length;e++){let t=r[e],n=t.charAt(0);for(t=t.slice(1),a.length=0;d=u.exec(t);)a.push(d[0]);let f=[],p=n===`A`||n===`a`?0:-1;for(let e=0,t=a.length;e<t;e++){let t=a[e];for(;(p===3||p===4)&&t.length>1&&(t[0]===`0`||t[0]===`1`);)f.push(+t[0]),p++,t=t.slice(1);let n=parseFloat(t);f.push(isNaN(n)?0:n),p>=0&&(p=(p+1)%7)}let m=0;for(;m<f.length&&!(f.length-m<ui[n.toLowerCase()]||n===`z`||n===`Z`);){let e=``,t=[],r=o,a=s,u,d,p,h,g,_,v,y,b,x;switch(n){case`l`:o+=f[m++],s+=f[m++],e=`L`,t.push(o,s);break;case`L`:o=f[m++],s=f[m++],t.push(o,s);break;case`m`:o+=f[m++],s+=f[m++],e=`M`,c=o,l=s,t.push(o,s),n=`l`;break;case`M`:o=f[m++],s=f[m++],e=`M`,c=o,l=s,t.push(o,s),n=`L`;break;case`h`:o+=f[m++],e=`L`,t.push(o,s);break;case`H`:o=f[m++],e=`L`,t.push(o,s);break;case`v`:s+=f[m++],e=`L`,t.push(o,s);break;case`V`:s=f[m++],e=`L`,t.push(o,s);break;case`C`:t.push(f[m++],f[m++],f[m++],f[m++]),o=f[m++],s=f[m++],t.push(o,s);break;case`c`:t.push(o+f[m++],s+f[m++],o+f[m++],s+f[m++]),o+=f[m++],s+=f[m++],e=`C`,t.push(o,s);break;case`S`:d=o,p=s,u=i[i.length-1],u?.command===`C`&&(d=o+(o-u.points[2]),p=s+(s-u.points[3])),t.push(d,p,f[m++],f[m++]),o=f[m++],s=f[m++],e=`C`,t.push(o,s);break;case`s`:d=o,p=s,u=i[i.length-1],u?.command===`C`&&(d=o+(o-u.points[2]),p=s+(s-u.points[3])),t.push(d,p,o+f[m++],s+f[m++]),o+=f[m++],s+=f[m++],e=`C`,t.push(o,s);break;case`Q`:t.push(f[m++],f[m++]),o=f[m++],s=f[m++],t.push(o,s);break;case`q`:t.push(o+f[m++],s+f[m++]),o+=f[m++],s+=f[m++],e=`Q`,t.push(o,s);break;case`T`:d=o,p=s,u=i[i.length-1],u?.command===`Q`&&(d=o+(o-u.points[0]),p=s+(s-u.points[1])),o=f[m++],s=f[m++],e=`Q`,t.push(d,p,o,s);break;case`t`:d=o,p=s,u=i[i.length-1],u?.command===`Q`&&(d=o+(o-u.points[0]),p=s+(s-u.points[1])),o+=f[m++],s+=f[m++],e=`Q`,t.push(d,p,o,s);break;case`A`:case`a`:if(h=Math.abs(f[m++]),g=Math.abs(f[m++]),_=f[m++],v=f[m++],y=f[m++],b=o,x=s,n===`a`?(o+=f[m++],s+=f[m++]):(o=f[m++],s=f[m++]),e=`A`,o===b&&s===x)continue;!h||!g?(e=`L`,t.push(o,s)):t=this.convertEndpointToCenterParameterization(b,x,o,s,v,y,h,g,_)}i.push({command:e||n,points:t,start:{x:r,y:a},pathLength:this.calcLength(r,a,e||n,t)})}(n===`z`||n===`Z`)&&(i.push({command:`z`,points:[c,l],start:{x:o,y:s},pathLength:this.getLineLength(o,s,c,l)}),o=c,s=l)}return i}static _walkArc(t,n){let[r,i,a,o,s,c]=t,l=Math.max(1,Math.ceil(Math.abs(c)/(Math.PI/180))),u=e.getPointOnEllipticalArc(r,i,a,o,s,0),d=s,f=0;for(let t=1;t<=l;t++){let p=s+c*t/l,m=e.getPointOnEllipticalArc(r,i,a,o,p,0),h=e.getLineLength(u.x,u.y,m.x,m.y);if(f+h>=n)return{theta:d+(p-d)*((n-f)/h),length:n};f+=h,u=m,d=p}return{theta:d,length:f}}static calcLength(t,n,r,i){let a=e;switch(r){case`L`:return a.getLineLength(t,n,i[0],i[1]);case`C`:return Qr([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case`Q`:return $r([t,i[0],i[2]],[n,i[1],i[3]],1);case`A`:return a._walkArc(i,1/0).length}return 0}static convertEndpointToCenterParameterization(e,t,n,r,i,a,o,s,c){let l=Math.PI/180*c,u=Math.cos(l)*(e-n)/2+Math.sin(l)*(t-r)/2,d=-1*Math.sin(l)*(e-n)/2+Math.cos(l)*(t-r)/2,f=u*u/(o*o)+d*d/(s*s);f>1&&(o*=Math.sqrt(f),s*=Math.sqrt(f));let p=Math.sqrt((o*o*(s*s)-o*o*(d*d)-s*s*(u*u))/(o*o*(d*d)+s*s*(u*u)));i===a&&(p*=-1),isNaN(p)&&(p=0);let m=p*o*d/s,h=p*-s*u/o,g=(e+n)/2+Math.cos(l)*m-Math.sin(l)*h,_=(t+r)/2+Math.sin(l)*m+Math.cos(l)*h,v=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},y=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(v(e)*v(t))},b=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(y(e,t))},x=b([1,0],[(u-m)/o,(d-h)/s]),S=[(u-m)/o,(d-h)/s],C=[(-1*u-m)/o,(-1*d-h)/s],w=b(S,C);return y(S,C)<=-1&&(w=Math.PI),y(S,C)>=1&&(w=0),a===0&&w>0&&(w-=2*Math.PI),a===1&&w<0&&(w+=2*Math.PI),[g,_,o,s,x,w,l,a]}};fi.prototype.className=`Path`,fi.prototype._attrsAffectingSize=[`data`],Je(fi,!0),V.addGetterSetter(fi,`data`);var pi=class extends li{_getStrokePadding(){return super._getStrokePadding(this.pointerAtBeginning()||this.pointerAtEnding()?this.miterLimit()||10:void 0)}_sceneFunc(e){super._sceneFunc(e);let t=this.points(),n=t.length;if(n<4)return;let r=this.pointerLength(),i=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(t[n-2],t[n-1]),e.rotate(this._getPointerAngle(!1)),e.moveTo(0,0),e.lineTo(-r,i/2),e.lineTo(-r,-i/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(t[0],t[1]),e.rotate(this._getPointerAngle(!0)),e.moveTo(0,0),e.lineTo(-r,i/2),e.lineTo(-r,-i/2),e.closePath(),e.restore(),this.__fillStroke(e))}_getPointerAngle(e){let t=this.points(),n=t.length,r=this.tension()!==0&&n>4,i=r?this.getTensionPoints():t,a=e?t[0]:t[n-2],o=e?t[1]:t[n-1],s=0,c=0;if(r&&e)s=a-(i[0]+i[2])/2,c=o-(i[1]+i[3])/2;else if(r){let e=i[i.length-4],t=i[i.length-3],n=i[i.length-2],r=i[i.length-1],l=fi.calcLength(e,t,`Q`,[n,r,a,o]),u=fi.getPointOnQuadraticBezier(l?Math.max(0,1-this.pointerLength()/l):0,e,t,n,r,a,o);s=a-u.x,c=o-u.y}for(let t=e?0:i.length-2;!s&&!c&&t>=0&&t<i.length;t+=e?2:-2)s=a-i[t],c=o-i[t+1];let l=Math.PI*2;return(Math.atan2(c,s)+l)%l}__fillStroke(e){let t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){let e=super.getSelfRect(),t=this.points();if(t.length<4)return e;let n=e.x,r=e.y,i=n+e.width,a=r+e.height;for(let e of[!1,!0]){if(!(e?this.pointerAtBeginning():this.pointerAtEnding()))continue;let o=e?0:t.length-2,s=this._getPointerAngle(e),c=Math.cos(s),l=Math.sin(s),u=t[o]-this.pointerLength()*c,d=t[o+1]-this.pointerLength()*l,f=Math.abs(this.pointerWidth()*l/2),p=Math.abs(this.pointerWidth()*c/2);n=Math.min(n,u-f),r=Math.min(r,d-p),i=Math.max(i,u+f),a=Math.max(a,d+p)}return{x:n,y:r,width:i-n,height:a-r}}};pi.prototype.className=`Arrow`,pi.prototype._attrsAffectingSize=[...li.prototype._attrsAffectingSize,`pointerLength`,`pointerWidth`,`pointerAtBeginning`,`pointerAtEnding`],Je(pi,!0),V.addGetterSetter(pi,`pointerLength`,10,B()),V.addGetterSetter(pi,`pointerWidth`,10,B()),V.addGetterSetter(pi,`pointerAtBeginning`,!1),V.addGetterSetter(pi,`pointerAtEnding`,!0);var mi=class extends U{_getStrokePadding(){return super._getStrokePadding(1)}_sceneFunc(e){e.beginPath(),e.arc(0,0,Math.abs(this.attrs.radius||0),0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return Math.abs(this.radius())*2}getHeight(){return Math.abs(this.radius())*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};mi.prototype._centroid=!0,mi.prototype.className=`Circle`,mi.prototype._attrsAffectingSize=[`radius`],Je(mi,!0),V.addGetterSetter(mi,`radius`,0,B());var hi=class extends U{_getStrokePadding(){return super._getStrokePadding(1)}_sceneFunc(e){let t=Math.abs(this.radiusX()),n=Math.abs(this.radiusY());e.beginPath(),e.ellipse(0,0,t,n,0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return Math.abs(this.radiusX())*2}getHeight(){return Math.abs(this.radiusY())*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}};hi.prototype.className=`Ellipse`,hi.prototype._centroid=!0,hi.prototype._attrsAffectingSize=[`radiusX`,`radiusY`],Je(hi,!0),V.addComponentsGetterSetter(hi,`radius`,[`x`,`y`]),V.addGetterSetter(hi,`radiusX`,0,B()),V.addGetterSetter(hi,`radiusY`,0,B());var gi=class e extends U{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on(`imageChange.konva`,e=>{this._removeImageLoad(e.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){var e;let t=this.image();t?.complete&&t.src||t?.readyState>=2||(e=t?.addEventListener)==null||e.call(t,`videoWidth`in t?`loadeddata`:`load`,this._loadListener)}_removeImageLoad(e){var t;(t=e?.removeEventListener)==null||t.call(e,`videoWidth`in e?`loadeddata`:`load`,this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(e,t=this.getAbsoluteOpacity()){if(this.attrs.perfectDrawEnabled===!1)return!1;let n=!!this.cornerRadius(),r=this.hasShadow();return n&&r?!0:super._useBufferCanvas(!0,t)}_getStrokePadding(){return super._getStrokePadding(this.strokeScaleEnabled()?1:void 0)}_sceneFunc(e){let t=this.getWidth(),n=this.getHeight(),r=this.cornerRadius(),i=this.attrs.image;if((this.hasFill()||this.hasStroke()||r)&&(e.beginPath(),r?L.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)),i){r&&e.clip();let a=this.attrs.cropWidth,o=this.attrs.cropHeight;a&&o?e.drawImage(i,this.cropX(),this.cropY(),a,o,0,0,t,n):e.drawImage(i,0,0,t,n)}}_hitFunc(e){let t=this.width(),n=this.height(),r=this.cornerRadius();e.beginPath(),r?L.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){let e=this.image();return this.attrs.width??e?.videoWidth??e?.width??0}getHeight(){let e=this.image();return this.attrs.height??e?.videoHeight??e?.height??0}static fromURL(t,n,r=null){let i=L.createImageElement();i.onload=()=>{i.onload=i.onerror=null,n(new e({image:i}))},i.onerror=r,i.crossOrigin=`Anonymous`,i.src=t}};gi.prototype.className=`Image`,gi.prototype._attrsAffectingSize=[`image`],Je(gi,!0),V.addGetterSetter(gi,`cornerRadius`,0,Zt(4)),V.addGetterSetter(gi,`image`),V.addComponentsGetterSetter(gi,`crop`,[`x`,`y`,`width`,`height`]),V.addGetterSetter(gi,`cropX`,0,B()),V.addGetterSetter(gi,`cropY`,0,B()),V.addGetterSetter(gi,`cropWidth`,0,B()),V.addGetterSetter(gi,`cropHeight`,0,B());var _i=typeof Intl<`u`&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:`grapheme`}):null;function vi(e){return e/15}function yi(e){return _i?Array.from(_i.segment(e),e=>e.segment):e.match(/\p{RI}\p{RI}|\P{M}(?:\p{M}|\p{Emoji_Modifier}|\uFE0F|\u200D\P{M})*|\p{M}+/gu)||[]}var bi=`auto`,xi=`center`,Si=`inherit`,Ci=`justify`,wi=`Change.konva`,Ti=`2d`,Ei=`-`,Di=`left`,Oi=`text`,ki=`Text`,Ai=`top`,ji=`bottom`,Mi=`middle`,Ni=`normal`,Pi=`px `,Fi=` `,Ii=`right`,Li=`rtl`,Ri=`word`,zi=`char`,Bi=`none`,Vi=`…`,Hi=[`direction`,`fontFamily`,`fontSize`,`fontStyle`,`fontVariant`,`padding`,`align`,`verticalAlign`,`lineHeight`,`text`,`width`,`height`,`wrap`,`ellipsis`,`letterSpacing`],Ui=null;function Wi(){if(Ui!==null)return Ui;Ui=!1;let e;try{e=L.createCanvasElement(),e.width=10,e.height=10;let t=e.getContext(Ti);if(t){t.globalAlpha=0,t.shadowColor=`black`,t.shadowBlur=5,t.shadowOffsetX=5,t.shadowOffsetY=5,t.fillStyle=`black`,t.font=`10px Arial`,t.fillText(`X`,0,10);let e=t.getImageData(0,0,10,10).data;for(let t=3;t<e.length;t+=4)if(e[t]>0){Ui=!0;break}}}catch{}finally{e&&L.releaseCanvas(e)}return Ui}function Gi(e){return e.split(`,`).map(e=>{e=e.trim();let t=e.indexOf(` `)>=0,n=e.indexOf(`"`)>=0||e.indexOf(`'`)>=0;return t&&!n&&(e=`"${e}"`),e}).join(`, `)}var Ki;function qi(){return Ki||(Ki=L.createCanvasElement().getContext(Ti),Ki)}function Ji(e){this._partialFillStyle&&e.setAttr(`fillStyle`,this._partialFillStyle),e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Yi(e){e.setAttr(`miterLimit`,2),this._partialStrokeStyle&&e.setAttr(`strokeStyle`,this._partialStrokeStyle),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Xi(e){return e||={},e.fill||e.fillLinearGradientColorStops||e.fillRadialGradientColorStops||e.fillPatternImage?e:{...e,fill:`black`}}var W=class extends U{constructor(e){super(Xi(e)),this._partialTextX=0,this._partialTextY=0,this._baselineShift=0,this._setTextData()}_sceneFunc(e){let t=this.textArr,n=t.length;if(!this.text())return;let r=this.padding(),i=this.fontSize(),a=this.lineHeight()*i,o=this.direction(),s=this.align(),c=this.getWidth(),l=this.letterSpacing(),u=this.charRenderFunc(),d=this.textDecoration(),f=d.indexOf(`underline`)!==-1,p=d.indexOf(`line-through`)!==-1,m,h=a/2,g=Mi;if(!I.legacyTextRendering){let e=this.measureSize(`M`);g=`alphabetic`,h=((e.fontBoundingBoxAscent??e.actualBoundingBoxAscent)-(e.fontBoundingBoxDescent??e.actualBoundingBoxDescent))/2+a/2}if(o===Si?o=e.direction:e.setAttr(`direction`,o),e.setAttr(`font`,this._getContextFont()),e.setAttr(`textBaseline`,g),e.setAttr(`textAlign`,Di),e.translate(r,this._getTextTop()),u){let t=e._getFillStyle(this);t!==void 0&&(e.fillStyle=t),this.hasStroke()&&e._applyStrokeStyle(this)}let _=u?e.fillStyle:void 0,v=u?e.strokeStyle:void 0,y=0;for(m=0;m<n;m++){let d=0,g=t[m],b=g.text,x=g.width,S=g.lastInParagraph;if(e.save(),s===Ii?d+=c-x-r*2:s===xi&&(d+=(c-x-r*2)/2),f){e.save(),e.beginPath();let t=this._getUnderlineOffset(),n=d,a=h+0+t;e.moveTo(n,a);let o=s===Ci&&!S?c-r*2:x;e.lineTo(n+Math.round(o),a),e.lineWidth=vi(i),e.strokeStyle=e._getFillStyle(this),e.stroke(),e.restore()}let C=d;if(o!==Li&&(l!==0||s===Ci||u)){let t=b.split(` `).length-1,n=yi(b);for(let i=0;i<n.length;i++){let a=n[i];a===` `&&!S&&s===Ci&&(d+=(c-r*2-x)/t),this._partialTextX=d,this._partialTextY=h+0,this._partialText=a;let o=e.measureText(a).width;if(u){e.save(),u({char:a,index:y,x:d,y:h+0,lineIndex:m,column:i,isLastInLine:i===n.length-1,width:o,context:e});let t=e.fillStyle;t!==_&&(this._partialFillStyle=t);let r=e.strokeStyle;r!==v&&(this._partialStrokeStyle=r)}e.fillStrokeShape(this),u&&(this._partialFillStyle=void 0,this._partialStrokeStyle=void 0,e.restore()),d+=o+l,y++}}else l!==0&&e.setAttr(`letterSpacing`,`${l}px`),this._partialTextX=d,this._partialTextY=h+0,this._partialText=b,e.fillStrokeShape(this);if(p){e.save(),e.beginPath();let t=I.legacyTextRendering?0:-Math.round(i/4),n=C;e.moveTo(n,h+0+t);let a=s===Ci&&!S?c-r*2:x;e.lineTo(n+Math.round(a),h+0+t),e.lineWidth=vi(i),e.strokeStyle=e._getFillStyle(this),e.stroke(),e.restore()}e.restore(),n>1&&(h+=a)}}_getTextTop(){let e=this.padding(),t=this.getHeight()-this.textArr.length*this.lineHeight()*this.fontSize()-e*2,n=this.verticalAlign();return n===Mi?e+t/2:n===ji?e+t:e}_getUnderlineOffset(){return this.underlineOffset()??Math.round(this.fontSize()/(I.legacyTextRendering?2:4))}getSelfRect(){let e=super.getSelfRect(),t=this.textArr.length;if(!t||this.textDecoration().indexOf(`underline`)===-1)return e;let n=this.fontSize(),r=this.lineHeight()*n,i=this._getTextTop()+t*r-r/2;return I.legacyTextRendering||(i+=this._baselineShift),i+=this._getUnderlineOffset()+vi(n)/2,e.height=Math.max(e.y+e.height,i)-e.y,e}_getSelfRectForDrawing(){let e=this.getSelfRect(),t=this.fontSize(),n=this.padding(),r=this.lineHeight()*t,i=this.getWidth()-n*2,a=this.align(),o=this.textArr.length*r,s=this._getTextTop(),c=e.x,l=e.x+e.width;for(let{text:e,width:t}of this.textArr){let r=n+(a===Ii?i-t:a===xi?(i-t)/2:0),o=Math.min(0,this.letterSpacing())*e.length;c=Math.min(c,r+o),l=Math.max(l,r+t-o)}let u=this.textDecoration().includes(`underline`),d=Math.min(e.y,s+(u?Math.min(0,this._getUnderlineOffset()):0));return{x:c-t,y:d-t,width:l-c+t*2,height:Math.max(e.y+e.height,s+o)-d+t*2}}_hitFunc(e){let t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){let t=L._isString(e)?e:e==null?``:e+``;return this._setAttr(Oi,t),this}getWidth(){return this.attrs.width===bi||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===bi||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return L.warn(`text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.`),this.textHeight}measureSize(e){let t=qi(),n=this.fontSize(),r;t.save(),t.font=this._getContextFont(),r=t.measureText(e),t.restore();let i=n/100;return{actualBoundingBoxAscent:r.actualBoundingBoxAscent??71.58203125*i,actualBoundingBoxDescent:r.actualBoundingBoxDescent??0,actualBoundingBoxLeft:r.actualBoundingBoxLeft??-7.421875*i,actualBoundingBoxRight:r.actualBoundingBoxRight??75.732421875*i,alphabeticBaseline:r.alphabeticBaseline??0,emHeightAscent:r.emHeightAscent??100*i,emHeightDescent:r.emHeightDescent??-20*i,fontBoundingBoxAscent:r.fontBoundingBoxAscent??91*i,fontBoundingBoxDescent:r.fontBoundingBoxDescent??21*i,hangingBaseline:r.hangingBaseline??72.80000305175781*i,ideographicBaseline:r.ideographicBaseline??-21*i,width:r.width,height:n}}_getContextFont(){return this.fontStyle()+Fi+this.fontVariant()+Fi+(this.fontSize()+Pi)+Gi(this.fontFamily())}_addTextLine(e){this.align()===Ci&&(e=e.trim());let t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e,t){let n=this.letterSpacing(),r=n?n*(t??yi(e).length):0;return qi().measureText(e).width+r}_setTextData(){let e=this.text().split(`
`),t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.width,i=this.attrs.height,a=r!==bi&&r!==void 0,o=i!==bi&&i!==void 0,s=this.padding(),c=r-s*2,l=i-s*2,u=0,d=this.wrap(),f=d!==zi&&d!==Bi,p=this.ellipsis(),m=this.measureSize(`M`);this._baselineShift=(m.fontBoundingBoxAscent-m.fontBoundingBoxDescent)/2,this.textArr=[];let h=qi();h.font=this._getContextFont(),h.fontKerning=this.direction()!==Li&&(this.letterSpacing()!==0||this.align()===Ci||this.charRenderFunc())?`none`:`auto`;let g=p?this._getTextWidth(Vi):0;for(let t=0,r=e.length;t<r;++t){let i=e[t],s=this._getTextWidth(i);if(a&&s>c){let e=yi(i),a=e.length,d=0,m=t=>e.slice(d,t).join(``),h=e=>e===Fi||e===Ei,_=Math.max(1,Math.ceil(a*c/s));for(;d<a;){let i=p&&o&&u+n>l?g:0,s=e=>!(this._getTextWidth(m(e),e-d)+i>c),v=d,y=Math.min(a,d+_);for(;s(y)&&(v=y,y!==a);)y=Math.min(a,y+(y-d));for(;y-v>1;){let e=v+y>>>1;s(e)?v=e:y=e}if(v===d)break;if(v===a){this._addTextLine(m(a)),u+=n,o&&u+n>l&&t<r-1&&this._tryToAddEllipsisToLastLine();break}if(f&&!h(e[v])){let t=v-1;for(;t>=d&&!h(e[t]);)t--;t>=d&&(v=t+1)}if(this._addTextLine(m(v).trimRight()),u+=n,this._shouldHandleEllipsis(u)){this._tryToAddEllipsisToLastLine();break}for(d=v;d<a&&!e[d].trim();)d++}}else this._addTextLine(i),u+=n,o&&u+n>l&&t<r-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),o&&u+n>l)break}this.textHeight=t,this.textWidth=this.textArr.reduce((e,t)=>Math.max(e,t.width),0)}_shouldHandleEllipsis(e){let t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,i=r!==bi&&r!==void 0,a=r-this.padding()*2;return this.wrap()===Bi||i&&e+n>a}_tryToAddEllipsisToLastLine(){let e=this.attrs.width,t=e!==bi&&e!==void 0,n=e-this.padding()*2,r=this.ellipsis(),i=this.textArr[this.textArr.length-1];if(!i||!r)return;let a=i.text+Vi;if(t){let e=yi(i.text);for(;e.length&&this._getTextWidth(a)>n;)e.pop(),a=e.join(``)+Vi;this._getTextWidth(a)>n&&(a=``)}i.text=a,i.width=this._getTextWidth(a)}getStrokeScaleEnabled(){return!0}_getStrokePadding(){return super._getStrokePadding(2)}_useBufferCanvas(e,t=this.getAbsoluteOpacity()){if(this.attrs.perfectDrawEnabled===!1)return!1;let n=this.textDecoration().indexOf(`underline`)!==-1||this.textDecoration().indexOf(`line-through`)!==-1,r=this.hasShadow();return n&&r||r&&t!==1&&Wi()?!0:super._useBufferCanvas(e,t)}};W.prototype._fillFunc=Ji,W.prototype._strokeFunc=Yi,W.prototype.className=ki,W.prototype._attrsAffectingSize=Hi.filter(e=>e!==`width`&&e!==`height`).concat([`textDecoration`,`underlineOffset`]),Je(W,!0),W.prototype.on(Hi.map(e=>e+wi).join(` `),function(){this._setTextData()}),V.overWriteSetter(W,`width`,Qt()),V.overWriteSetter(W,`height`,Qt()),V.addGetterSetter(W,`direction`,Si),V.addGetterSetter(W,`fontFamily`,`Arial`),V.addGetterSetter(W,`fontSize`,12,B()),V.addGetterSetter(W,`fontStyle`,Ni),V.addGetterSetter(W,`fontVariant`,Ni),V.addGetterSetter(W,`padding`,0,B()),V.addGetterSetter(W,`align`,Di),V.addGetterSetter(W,`verticalAlign`,Ai),V.addGetterSetter(W,`lineHeight`,1,B()),V.addGetterSetter(W,`wrap`,Ri),V.addGetterSetter(W,`ellipsis`,!1,nn()),V.addGetterSetter(W,`letterSpacing`,0,B()),V.addGetterSetter(W,`text`,``,$t()),V.addGetterSetter(W,`textDecoration`,``),V.addGetterSetter(W,`underlineOffset`,void 0,B()),V.addGetterSetter(W,`charRenderFunc`,void 0);var Zi=[...W.prototype._attrsAffectingSize,`width`,`height`,`pointerDirection`,`pointerWidth`,`pointerHeight`].map(e=>e+`Change.konva`).join(` `),Qi=`none`,$i=`up`,G=`right`,ea=`down`,ta=`left`,na=class extends Nr{constructor(e){super(e),this._sync=this._sync.bind(this),this.on(`add.konva`,function(e){e.child.off(Zi,this._sync).on(Zi,this._sync),this._sync()})}getText(){return this.find(`Text`)[0]}getTag(){return this.find(`Tag`)[0]}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),t=this.getTag(),n,r,i,a,o,s,c;if(e&&t){switch(n=e.width(),r=e.height(),i=t.pointerDirection(),a=t.pointerWidth(),c=t.pointerHeight(),o=0,s=0,i){case $i:o=n/2,s=-1*c;break;case G:o=n+a,s=r/2;break;case ea:o=n/2,s=r+c;break;case ta:o=-1*a,s=r/2}t.setAttrs({x:-1*o,y:-1*s,width:n,height:r}),e.setAttrs({x:-1*o,y:-1*s})}}};na.prototype.className=`Label`,Je(na);var ra=class extends U{_sceneFunc(e){let t=this.width(),n=this.height(),r=this.pointerDirection(),i=this.pointerWidth(),a=this.pointerHeight(),o=this.cornerRadius(),[s,c,l,u]=L._cornerRadii(o,t,n);e.beginPath(),e.moveTo(s,0),r===$i&&(e.lineTo((t-i)/2,0),e.lineTo(t/2,-1*a),e.lineTo((t+i)/2,0)),e.lineTo(t-c,0),e.arc(t-c,c,c,Math.PI*3/2,0,!1),r===G&&(e.lineTo(t,(n-a)/2),e.lineTo(t+i,n/2),e.lineTo(t,(n+a)/2)),e.lineTo(t,n-l),e.arc(t-l,n-l,l,0,Math.PI/2,!1),r===ea&&(e.lineTo((t+i)/2,n),e.lineTo(t/2,n+a),e.lineTo((t-i)/2,n)),e.lineTo(u,n),e.arc(u,n-u,u,Math.PI/2,Math.PI,!1),r===ta&&(e.lineTo(0,(n+a)/2),e.lineTo(-1*i,n/2),e.lineTo(0,(n-a)/2)),e.lineTo(0,s),e.arc(s,s,s,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=this.pointerWidth(),t=this.pointerHeight(),n=this.pointerDirection(),r=this.width(),i=this.height();return n===$i||n===ea?{x:Math.min(0,(r-e)/2),y:n===$i?-t:0,width:Math.max(r,e),height:i+t}:n===ta||n===G?{x:n===ta?-e:0,y:Math.min(0,(i-t)/2),width:r+e,height:Math.max(i,t)}:{x:0,y:0,width:r,height:i}}};ra.prototype.className=`Tag`,Je(ra,!0),V.addGetterSetter(ra,`pointerDirection`,Qi),V.addGetterSetter(ra,`pointerWidth`,0,B()),V.addGetterSetter(ra,`pointerHeight`,0,B()),V.addGetterSetter(ra,`cornerRadius`,0,Zt(4));var ia=class extends U{_getStrokePadding(){return super._getStrokePadding(this.strokeScaleEnabled()?1:void 0)}_sceneFunc(e){let t=this.cornerRadius(),n=this.width(),r=this.height();e.beginPath(),t?L.drawRoundedRectPath(e,n,r,t):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}};ia.prototype.className=`Rect`,Je(ia,!0),V.addGetterSetter(ia,`cornerRadius`,0,Zt(4));var aa=class extends U{_sceneFunc(e){let t=this._getPoints(),n=this.radius(),r=this.sides(),i=this.cornerRadius();if(t.length){if(e.beginPath(),i)L.drawRoundedPolygonPath(e,t,r,n,i);else{e.moveTo(t[0].x,t[0].y);for(let n=1;n<t.length;n++)e.lineTo(t[n].x,t[n].y)}e.closePath(),e.fillStrokeShape(this)}}_getPoints(){let e=this.attrs.sides,t=this.attrs.radius||0,n=[];for(let r=0;r<e;r++)n.push({x:t*Math.sin(r*2*Math.PI/e),y:-1*t*Math.cos(r*2*Math.PI/e)});return n}getSelfRect(){let e=this._getPoints();if(!e.length)return{x:0,y:0,width:0,height:0};let t=e[0].x,n=e[0].x,r=e[0].y,i=e[0].y;return e.forEach(e=>{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.y)}),{x:t,y:r,width:n-t,height:i-r}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};aa.prototype.className=`RegularPolygon`,aa.prototype._centroid=!0,aa.prototype._attrsAffectingSize=[`radius`,`sides`],Je(aa,!0),V.addGetterSetter(aa,`radius`,0,B()),V.addGetterSetter(aa,`sides`,0,B()),V.addGetterSetter(aa,`cornerRadius`,0,Zt(4));var oa=Math.PI*2,sa=class extends U{_getStrokePadding(){return super._getStrokePadding(1)}_sceneFunc(e){let t=Math.abs(this.innerRadius()),n=Math.abs(this.outerRadius());e.beginPath(),e.arc(0,0,t,0,oa,!1),e.moveTo(n,0),e.arc(0,0,n,oa,0,!0),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=Math.max(Math.abs(this.innerRadius()),Math.abs(this.outerRadius()));return{x:-e,y:-e,width:e*2,height:e*2}}getWidth(){return Math.abs(this.outerRadius())*2}getHeight(){return Math.abs(this.outerRadius())*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};sa.prototype.className=`Ring`,sa.prototype._centroid=!0,sa.prototype._attrsAffectingSize=[`innerRadius`,`outerRadius`],Je(sa,!0),V.addGetterSetter(sa,`innerRadius`,0,B()),V.addGetterSetter(sa,`outerRadius`,0,B());var ca=class extends U{constructor(e){super(e),this._updated=!0,this.anim=new Fr(()=>{let e=this._updated;return this._updated=!1,e}),this.on(`animationChange.konva`,function(){this.frameIndex(0)}),this.on(`frameIndexChange.konva`,function(){this._updated=!0}),this.on(`frameRateChange.konva`,function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_getFrame(){let e=this.animation(),t=this.animations()?.[e],n=this.frameIndex(),r=n*4;if(!t||!Number.isInteger(n)||r<0||r+4>t.length)return;let i=this.frameOffsets()?.[e]||[];return{x:t[r],y:t[r+1],width:t[r+2],height:t[r+3],offsetX:i[n*2]||0,offsetY:i[n*2+1]||0}}_getStrokePadding(){return super._getStrokePadding(this.strokeScaleEnabled()?1:void 0)}_sceneFunc(e){let t=this._getFrame();if(!t)return;let{x:n,y:r,width:i,height:a,offsetX:o,offsetY:s}=t,c=this.image();(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(o,s,i,a),e.closePath(),e.fillStrokeShape(this)),c&&e.drawImage(c,n,r,i,a,o,s,i,a)}_hitFunc(e){let{x:t,y:n,width:r,height:i}=this.getSelfRect();e.beginPath(),e.rect(t,n,r,i),e.closePath(),e.fillShape(this)}getSelfRect(){let e=this._getFrame();return e?{x:e.offsetX,y:e.offsetY,width:e.width,height:e.height}:{x:0,y:0,width:0,height:0}}_useBufferCanvas(e,t=this.getAbsoluteOpacity()){return super._useBufferCanvas(!0,t)}_setInterval(){let e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;let e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}destroy(){return this.stop(),super.destroy()}isRunning(){return this.anim.isRunning()}_updateIndex(){let e=this.frameIndex(),t=this.animations()?.[this.animation()],n=t?t.length/4:0;this.frameIndex(e<n-1?e+1:0)}};ca.prototype.className=`Sprite`,Je(ca,!0),V.addGetterSetter(ca,`animation`),V.addGetterSetter(ca,`animations`),V.addGetterSetter(ca,`frameOffsets`),V.addGetterSetter(ca,`image`),V.addGetterSetter(ca,`frameIndex`,0,B()),V.addGetterSetter(ca,`frameRate`,17,B()),V.backCompat(ca,{index:`frameIndex`,getIndex:`getFrameIndex`,setIndex:`setFrameIndex`});var la=class extends U{_sceneFunc(e){let t=this.innerRadius(),n=this.outerRadius(),r=this.numPoints();e.beginPath(),e.moveTo(0,0-n);for(let i=1;i<r*2;i++){let a=i%2==0?n:t,o=a*Math.sin(i*Math.PI/r),s=-1*a*Math.cos(i*Math.PI/r);e.lineTo(o,s)}e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=Math.max(Math.abs(this.innerRadius()),Math.abs(this.outerRadius()));return{x:-e,y:-e,width:e*2,height:e*2}}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};la.prototype.className=`Star`,la.prototype._centroid=!0,la.prototype._attrsAffectingSize=[`innerRadius`,`outerRadius`],Je(la,!0),V.addGetterSetter(la,`numPoints`,5,B()),V.addGetterSetter(la,`innerRadius`,0,B()),V.addGetterSetter(la,`outerRadius`,0,B());var ua=``,da=`normal`;function fa(e){e.fillText(this.partialText,0,0)}function pa(e){e.strokeText(this.partialText,0,0)}var K=class extends U{constructor(e){super(e),this.dataArray=[],this._readDataAttribute(),this._setTextData()}_getTextPathLength(){return fi.getPathLength(this.dataArray)}_getPointAtLength(e,t){return!this.attrs.data||e>this.pathLength?null:fi.getPointAtLengthOfDataArray(e,this.dataArray,t)}_readDataAttribute(){this.dataArray=fi.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr(`font`,this._getContextFont()),e.setAttr(`textBaseline`,this.textBaseline()),e.setAttr(`textAlign`,`left`),e.save();let t=this.textDecoration(),n=this.fill(),r=this.fontSize(),i=this.glyphInfo,a=t.indexOf(`underline`)!==-1,o=t.indexOf(`line-through`)!==-1;a&&e.beginPath();for(let t=0;t<i.length;t++){e.save();let n=i[t].p0;e.translate(n.x,n.y),e.rotate(i[t].rotation),this.partialText=i[t].text,e.fillStrokeShape(this),a&&(t===0&&e.moveTo(0,r/2+1),e.lineTo(i[t].width,r/2+1)),e.restore()}if(a&&(e.strokeStyle=n,e.lineWidth=vi(r),e.stroke()),o){e.beginPath();for(let t=0;t<i.length;t++){e.save();let n=i[t].p0;e.translate(n.x,n.y),e.rotate(i[t].rotation),t===0&&e.moveTo(0,0),e.lineTo(i[t].width,0),e.restore()}e.strokeStyle=n,e.lineWidth=vi(r),e.stroke()}e.restore()}_hitFunc(e){e.beginPath();let t=this.glyphInfo;if(t.length>=1){let n=t[0].p0;e.moveTo(n.x,n.y)}for(let n=0;n<t.length;n++){let r=t[n].p1;e.lineTo(r.x,r.y)}e.setAttr(`lineWidth`,this.fontSize()),e.setAttr(`strokeStyle`,this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return L.warn(`text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.`),this.textHeight}setText(e){return W.prototype.setText.call(this,e)}_getContextFont(){return W.prototype._getContextFont.call(this)}_getTextSize(e){let t=qi();t.save(),t.font=this._getContextFont(),t.fontKerning=`auto`;let n=t.measureText(e);return t.restore(),{width:n.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){let e=yi(this.text());this.direction()===`rtl`&&e.reverse();let t=this.kerningFunc(),n=[],r=0;for(let i=0;i<e.length;i++){let a=0;if(t&&i>0)try{a=t(e[i-1],e[i])*this.fontSize()}catch{}n.push({char:e[i],width:this._getTextSize(e[i]).width,kern:a}),r+=n[i].width+a}let{width:i,height:a}=this._getTextSize(this.attrs.text);if(this.textWidth=r,this.textHeight=a,this.glyphInfo=[],!this.attrs.data)return null;let o=this.letterSpacing(),s=this.align(),c=s===`justify`?this.text().split(` `).length-1:0,l=Math.max(0,r-i),u=Math.max(this.textWidth+(e.length-1)*o,0),d=0;s===`center`&&(d=Math.max(0,this.pathLength/2-u/2)),s===`right`&&(d=Math.max(0,this.pathLength-u));let f=d,p=this.dataArray.some((e,t)=>t>0&&e.command===`M`)?void 0:{index:0,offset:0};for(let t=0;t<n.length;t++){f+=n[t].kern;let r=this._getPointAtLength(f,p);if(!r)return;let i=n[t].char,a=n[t].width+(t<n.length-1?o:0);i===` `&&s===`justify`&&(a+=(this.pathLength-u)/c);let d=f+a,m=this._getPointAtLength(d>this.pathLength&&d-this.pathLength<=l?this.pathLength:d,p);if(!m)return;let h=fi.getLineLength(r.x,r.y,m.x,m.y),g=Math.atan2(m.y-r.y,m.x-r.x);this.glyphInfo.push({text:e[t],rotation:g,p0:r,p1:m,width:h}),f+=a}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};let e=[];this.glyphInfo.forEach(function(t){e.push(t.p0.x),e.push(t.p0.y),e.push(t.p1.x),e.push(t.p1.y)});let t=L._getPointsRect(e),n=this.fontSize();return{x:t.x-n/2,y:t.y-n/2,width:t.width+n,height:t.height+n}}getStrokeScaleEnabled(){return!0}_getSelfRectForDrawing(){let e=this.getSelfRect(),t=this.fontSize();return{x:e.x-t,y:e.y-t,width:e.width+t*2,height:e.height+t*2}}};K.prototype._fillFunc=fa,K.prototype._strokeFunc=pa,K.prototype._fillFuncHit=fa,K.prototype._strokeFuncHit=pa,K.prototype.className=`TextPath`,K.prototype._attrsAffectingSize=[`text`,`fontSize`,`data`,`align`,`letterSpacing`,`kerningFunc`,`fontFamily`,`fontStyle`,`fontVariant`,`direction`],Je(K,!0),K.prototype.on(`dataChange.konva`,function(){this._readDataAttribute(),this._setTextData()}),K.prototype.on(K.prototype._attrsAffectingSize.filter(e=>e!==`data`).map(e=>e+`Change.konva`).join(` `),function(){this._setTextData()}),V.addGetterSetter(K,`data`),V.addGetterSetter(K,`fontFamily`,`Arial`),V.addGetterSetter(K,`fontSize`,12,B()),V.addGetterSetter(K,`fontStyle`,da),V.addGetterSetter(K,`align`,`left`),V.addGetterSetter(K,`letterSpacing`,0,B()),V.addGetterSetter(K,`textBaseline`,`middle`),V.addGetterSetter(K,`fontVariant`,da),V.addGetterSetter(K,`text`,ua),V.addGetterSetter(K,`textDecoration`,``),V.addGetterSetter(K,`kerningFunc`,void 0),V.addGetterSetter(K,`direction`,`inherit`);var ma=`tr-konva`,ha=[`resizeEnabledChange`,`rotateAnchorOffsetChange`,`rotateAnchorAngleChange`,`rotateEnabledChange`,`rotateModeChange`,`enabledAnchorsChange`,`anchorSizeChange`,`borderEnabledChange`,`shouldOverdrawWholeAreaChange`,`borderStrokeChange`,`borderStrokeWidthChange`,`borderDashChange`,`anchorStrokeChange`,`anchorStrokeWidthChange`,`anchorFillChange`,`anchorCornerRadiusChange`,`ignoreStrokeChange`,`anchorStyleFuncChange`,`paddingChange`].map(e=>e+`.${ma}`).join(` `),ga=`nodesRect`,_a=[`widthChange`,`heightChange`,`scaleXChange`,`scaleYChange`,`skewXChange`,`skewYChange`,`rotationChange`,`offsetXChange`,`offsetYChange`,`transformsEnabledChange`,`strokeWidthChange`,`strokeChange`,`selfRectFuncChange`,`strokeLinearGradientColorStopsChange`,`strokeScaleEnabledChange`,`strokeEnabledChange`,`draggableChange`],va={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},ya=`ontouchstart`in I._global,ba=[`rotater-top-left`,`rotater-top-right`,`rotater-bottom-left`,`rotater-bottom-right`];function xa(e){return e.startsWith(`rotater`)}var Sa=Math.PI/12;function Ca(e,t){let n=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><g transform="rotate(${e} 12 12)" stroke-linejoin="round"><path d="M5 8 A11 11 0 0 1 16 19" fill="none" stroke="white" stroke-width="4"/><path d="M2 8 L6 4.5 L6 11.5 Z M16 22 L12.5 18 L19.5 18 Z" fill="black" stroke="white"/><path d="M5 8 A11 11 0 0 1 16 19" fill="none" stroke="black" stroke-width="1.5"/></g></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(n)}") 12 12, ${t}`}function wa(e,t,n){if(e===`rotater`)return n;if(xa(e)){let r=e.slice(8);return Ca(Math.round(L.radToDeg(t)+va[r]-45),n)}t+=L.degToRad(va[e]||0);let r=(L.radToDeg(t)%360+360)%360;return L._inRange(r,337.5,360)||L._inRange(r,0,22.5)?`ns-resize`:L._inRange(r,22.5,67.5)?`nesw-resize`:L._inRange(r,67.5,112.5)?`ew-resize`:L._inRange(r,112.5,157.5)?`nwse-resize`:L._inRange(r,157.5,202.5)?`ns-resize`:L._inRange(r,202.5,247.5)?`nesw-resize`:L._inRange(r,247.5,292.5)?`ew-resize`:L._inRange(r,292.5,337.5)?`nwse-resize`:(L.error(`Transformer has unknown angle for cursor detection: `+r),`pointer`)}var Ta=[`top-left`,`top-center`,`top-right`,`middle-right`,`middle-left`,`bottom-left`,`bottom-center`,`bottom-right`];function Ea(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function Da(e,t,n){let r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:r,y:i}}function Oa(e,t){return Da(e,t,Ea(e))}function ka(e,t,n){let r=t,i=n;for(let n=0;n<e.length;n++){let a=I.getAngle(e[n]),o=Math.abs(a-t)%(Math.PI*2),s=Math.min(o,Math.PI*2-o);s<i&&(i=s,r=a)}return r}function Aa(e,t,n){let r=L.degToRad(e.rotateAnchorAngle()),i=Math.sin(r),a=-Math.cos(r),o=t/2,s=n/2,c=1/0;a<0?c=Math.min(c,-s/a):a>0&&(c=Math.min(c,(n-s)/a)),i<0?c=Math.min(c,-o/i):i>0&&(c=Math.min(c,(t-o)/i));let l=o+i*c,u=s+a*c,d=e.rotateAnchorOffset()+e.padding();return{edgeX:l,edgeY:u,endX:l+i*d,endY:u+a*d}}var ja=new Set,q=class extends Nr{static _isLayerTransforming(e){for(let t of ja)if(t.getLayer()===e||t._nodes.some(t=>t.getLayer()===e))return!0;return!1}constructor(e){super(e),this._movingAnchorName=null,this._anchors={},this._transforming=!1,this._fitting=!1,this._transformWindow=null,this._elementsCreated=!1,this._updatePending=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this._syncUpdate=this._syncUpdate.bind(this),this.on(ha,e=>{e.type===`ignoreStrokeChange`&&this._resetTransformCache(),this.update()}),this.on(`rotationChange.${ma}`,()=>this._clearCache(ga)),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return L.warn(`tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead.`),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return ma+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();let t=new Set(e);for(let e of t)e.isAncestorOf(this)&&(L.error(`Konva.Transformer cannot be an a child of the node you are trying to attach`),t.delete(e));let n=Array.from(t).filter(e=>{for(let n=e.getParent();n;n=n.getParent())if(t.has(n))return!1;return!0});return this._nodes=e=n,this._resetRotation(),this._nodes.forEach(e=>{let t=()=>{var t;this._fitting?(t=this._nodeRectCache)==null||t.delete(e):(this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(e),this.isDragging()||this._scheduleUpdate())};if(e._attrsAffectingSize.length){let n=e._attrsAffectingSize.map(e=>e+`Change.`+this._getEventNamespace()).join(` `);e.on(n,t)}e.on(_a.map(e=>e+`.${this._getEventNamespace()}`).join(` `),t),e.on(`absoluteTransformChange.${this._getEventNamespace()}`,t),e instanceof Tn&&e._addSubtreeObserver(this),e.on(`destroy.${this._getEventNamespace()}`,()=>{this._removeNode(e)}),this._proxyDrag(e)}),this._resetTransformCache(),this._elementsCreated&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,n=>{t=e.getAbsolutePosition(),!this.isDragging()&&e!==this._back&&this.startDrag(n,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!t)return;let r=e.getAbsolutePosition(),i=r.x-t.x,a=r.y-t.y;this.nodes().forEach(t=>{if(t===e||t.isDragging())return;let r=t.getAbsolutePosition();t.setAbsolutePosition({x:r.x+i,y:r.y+a}),t.startDrag(n)}),t=null})}_detachNode(e){e.off(`.`+this._getEventNamespace()),e._removeSubtreeObserver(this)}_resetRotation(){let e=this._nodes.length===1&&this.useSingleNodeRotation();this.rotation(e?this._nodes[0].getAbsoluteRotation():0)}_removeNode(e){this._detachNode(e),this._nodes=this._nodes.filter(t=>t!==e),this._resetRotation(),this._resetTransformCache(e),this._scheduleUpdate()}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){var e,t;(e=this._nodes)==null||e.forEach(e=>this._detachNode(e)),this._nodes=[],this._updatePending=!1,this._resetTransformCache(),(t=this.getLayer())==null||t.batchDraw()}_resetTransformCache(e){var t,n;e?(t=this._nodeRectCache)==null||t.delete(e):(n=this._nodeRectCache)==null||n.clear(),this._clearCache(ga),this._clearCache(`transform`),this._clearSelfAndDescendantCache(`absoluteTransform`)}_onSubtreeChange(e){var t;this._fitting||((!this._updatePending||this._cache[ga])&&this._resetTransformCache(e),H._updateBatchDepth>0?this._scheduleUpdate():this._updatePending||(this._updatePending=!0,L.requestAnimFrame(this._syncUpdate,this.getStage()?._getOwnerWindow()),(t=this.getLayer())==null||t.batchDraw()))}_syncUpdate(){this._updatePending&&!this._fitting&&!this.isDragging()&&this._update()}drawScene(e,t){return this._syncUpdate(),super.drawScene(e,t)}drawHit(e,t){return this._syncUpdate(),super.drawHit(e,t)}_getNodeRect(){return this._getCache(ga,this.__getNodeRect)}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};let e=I.getAngle(this.rotation()),t=this.ignoreStroke(),n=new Ze;n.rotate(-e);let r=this._nodeRectCache||=new Map,i=1/0,a=1/0,o=-1/0,s=-1/0;for(let c of this.nodes()){let l=c instanceof U&&c.getSelfRect===U.prototype.getSelfRect&&!c.attrs.selfRectFunc&&!c._hasCachedAncestor(),u=l?c.width():0,d=l?c.height():0;l&&(c._attrsVersion??=0);let f=l?r.get(c):void 0;if(!f||f.rotation!==e||f.ignoreStroke!==t||f.version!==c._attrsVersion||f.width!==u||f.height!==d){let i=c.getAbsoluteTransform(),[a,o,s,p]=i.getMatrix(),m=a*p-o*s===0,h=c.getClientRect({skipTransform:!m,skipShadow:!0,skipStroke:t}),g=[{x:h.x,y:h.y},{x:h.x+h.width,y:h.y},{x:h.x+h.width,y:h.y+h.height},{x:h.x,y:h.y+h.height}];m&&(i=new Ze),f={rotation:e,ignoreStroke:t,width:u,height:d,version:c._attrsVersion||0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(let e of g){let t=n.point(i.point(e));f.minX=Math.min(f.minX,t.x),f.minY=Math.min(f.minY,t.y),f.maxX=Math.max(f.maxX,t.x),f.maxY=Math.max(f.maxY,t.y)}l&&r.set(c,f)}i=Math.min(i,f.minX),a=Math.min(a,f.minY),o=Math.max(o,f.maxX),s=Math.max(s,f.maxY)}n.invert();let c=n.point({x:i,y:a});return{x:c.x,y:c.y,width:o-i,height:s-a,rotation:I.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),ba.forEach(e=>{this._createAnchor(e,`_rotate-zone`).setAttrs({fill:`transparent`,strokeEnabled:!1,visible:!1})}),Ta.forEach(e=>{this._createAnchor(e)}),this._createAnchor(`rotater`),this._elementsCreated=!0}_createAnchor(e,t=`_anchor`){let n=new ia({stroke:`rgb(0, 161, 255)`,fill:`white`,strokeWidth:1,name:e+` `+t,dragDistance:0,draggable:!0,hitStrokeWidth:ya?10:`auto`});this._anchors[e]=n;let r=this;return n.on(`mousedown touchstart`,function(e){r._handleMouseDown(e)}),n.on(`dragstart`,e=>{n.stopDrag(),e.cancelBubble=!0}),n.on(`dragend`,e=>{e.cancelBubble=!0}),n.on(`mouseenter`,()=>{this.isTransforming()||(this._setAnchorCursor(e),this._cursorChange=!0)}),n.on(`mouseout`,()=>{this._cursorChange=!1,!this.isTransforming()&&n.getStage().content&&(n.getStage().content.style.cursor=``)}),this.add(n),n}_setAnchorCursor(e,t=I.getAngle(this.rotation())){let n=this.getStage()?.content;n&&(n.style.cursor=wa(e,t,this.rotateAnchorCursor()))}_createBack(){let e=new U({name:`back`,width:0,height:0,sceneFunc(e,t){let n=t.getParent();if(!n.borderEnabled())return;let r=n.padding(),i=t.width(),a=t.height();if(e.beginPath(),e.rect(-r,-r,i+r*2,a+r*2),n.rotateEnabled()&&n.rotateLineVisible()&&n.rotateMode()!==`corners`){let t=Aa(n,i,a);e.moveTo(t.edgeX,t.edgeY),e.lineTo(t.endX,t.endY)}e.fillStrokeShape(t)},hitFunc:(e,t)=>{if(!this.shouldOverdrawWholeArea())return;let n=this.padding();e.beginPath(),e.rect(-n,-n,t.width()+n*2,t.height()+n*2),e.fillStrokeShape(t)}});this._back=e,this.add(e),this._proxyDrag(e),e.on(`dragstart`,e=>{e.cancelBubble=!0}),e.on(`dragmove`,e=>{e.cancelBubble=!0}),e.on(`dragend`,e=>{e.cancelBubble=!0}),this.on(`dragmove`,e=>{this.update()})}_handleMouseDown(e){if(e.evt.button!==void 0&&!I.dragButtons.includes(e.evt.button)||this._transforming)return;this._movingAnchorName=e.target.name().split(` `)[0];let t=this._getNodeRect(),n=t.width,r=t.height,i=Math.sqrt(n**2+r**2);this.sin=Math.abs(r/i),this.cos=Math.abs(n/i);let a=this.getStage()?._getOwnerWindow();this._transformWindow=a||null,a&&(a.addEventListener(`mousemove`,this._handleMouseMove),a.addEventListener(`touchmove`,this._handleMouseMove),a.addEventListener(`mouseup`,this._handleMouseUp,!0),a.addEventListener(`touchend`,this._handleMouseUp,!0),a.addEventListener(`touchcancel`,this._handleMouseUp,!0)),this._transforming=!0,this._pointerId=e.pointerId??L._getFirstPointerId(e.evt);let o=e.target.getAbsolutePosition(),s=e.target.getStage()._getPointerById(this._pointerId);if(this._anchorDragOffset={x:s.x-o.x,y:s.y-o.y},xa(this._movingAnchorName)){let e=Ea(t);this._rotateStart={pointerAngle:Math.atan2(s.y-e.y,s.x-e.x),rotation:t.rotation}}ja.add(this),this._fire(`transformstart`,{evt:e.evt,target:this.getNode()}),this._nodes.forEach(t=>{t._fire(`transformstart`,{evt:e.evt,target:t})})}_handleMouseMove(e){var t;(t=this.getStage())==null||t._batchEvents(()=>this._moveTransform(e))}_moveTransform(e){this._syncUpdate();let t,n,r,i=this._anchors[this._movingAnchorName],a=i.getStage();a.setPointersPositions(e);let o=a._getPointerById(this._pointerId);if(!o)return;let s={x:o.x-this._anchorDragOffset.x,y:o.y-this._anchorDragOffset.y},c=i.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(c,s,e)),i.setAbsolutePosition(s);let l=i.getAbsolutePosition();if(c.x===l.x&&c.y===l.y)return;if(xa(this._movingAnchorName)){let t=this._getNodeRect(),n=Ea(t),r=this._rotateStart,i={x:l.x+this._anchorDragOffset.x,y:l.y+this._anchorDragOffset.y},a=Math.atan2(i.y-n.y,i.x-n.x),o=r.rotation+a-r.pointerAngle,s;if(e.shiftKey&&this.shiftBehavior()!==`none`)s=Math.round(o/Sa)*Sa;else{let e=I.getAngle(this.rotationSnapTolerance());s=ka(this.rotationSnaps(),o,e)}this._movingAnchorName!==`rotater`&&this._setAnchorCursor(this._movingAnchorName,s);let c=Oa(t,s-t.rotation);this._fitNodesInto(c,e);return}let u=this.shiftBehavior(),d;d=u===`inverted`?this.keepRatio()&&!e.shiftKey:u===`none`?this.keepRatio():this.keepRatio()||e.shiftKey;let f=this.centeredScaling()||e.altKey,p=!1;if(this._movingAnchorName===`top-left`){if(d){p=!0;let e=f?{x:this.width()/2,y:this.height()/2}:{x:this._anchors[`bottom-right`].x(),y:this._anchors[`bottom-right`].y()};r=Math.sqrt((e.x-i.x())**2+(e.y-i.y())**2);let a=this._anchors[`top-left`].x()>e.x?-1:1,o=this._anchors[`top-left`].y()>e.y?-1:1;t=r*this.cos*a,n=r*this.sin*o,this._anchors[`top-left`].x(e.x-t),this._anchors[`top-left`].y(e.y-n)}}else if(this._movingAnchorName===`top-center`)this._anchors[`top-left`].y(i.y());else if(this._movingAnchorName===`top-right`){if(d){p=!0;let e=f?{x:this.width()/2,y:this.height()/2}:{x:this._anchors[`bottom-left`].x(),y:this._anchors[`bottom-left`].y()};r=Math.sqrt((i.x()-e.x)**2+(e.y-i.y())**2);let a=this._anchors[`top-right`].x()<e.x?-1:1,o=this._anchors[`top-right`].y()>e.y?-1:1;t=r*this.cos*a,n=r*this.sin*o,this._anchors[`top-right`].x(e.x+t),this._anchors[`top-right`].y(e.y-n)}var m=i.position();this._anchors[`top-left`].y(m.y),this._anchors[`bottom-right`].x(m.x)}else if(this._movingAnchorName===`middle-left`)this._anchors[`top-left`].x(i.x());else if(this._movingAnchorName===`middle-right`)this._anchors[`bottom-right`].x(i.x());else if(this._movingAnchorName===`bottom-left`){if(d){p=!0;let e=f?{x:this.width()/2,y:this.height()/2}:{x:this._anchors[`top-right`].x(),y:this._anchors[`top-right`].y()};r=Math.sqrt((e.x-i.x())**2+(i.y()-e.y)**2);let a=e.x<i.x()?-1:1,o=i.y()<e.y?-1:1;t=r*this.cos*a,n=r*this.sin*o,i.x(e.x-t),i.y(e.y+n)}m=i.position(),this._anchors[`top-left`].x(m.x),this._anchors[`bottom-right`].y(m.y)}else if(this._movingAnchorName===`bottom-center`)this._anchors[`bottom-right`].y(i.y());else if(this._movingAnchorName===`bottom-right`){if(d){p=!0;let e=f?{x:this.width()/2,y:this.height()/2}:{x:this._anchors[`top-left`].x(),y:this._anchors[`top-left`].y()};r=Math.sqrt((i.x()-e.x)**2+(i.y()-e.y)**2);let a=this._anchors[`bottom-right`].x()<e.x?-1:1,o=this._anchors[`bottom-right`].y()<e.y?-1:1;t=r*this.cos*a,n=r*this.sin*o,this._anchors[`bottom-right`].x(e.x+t),this._anchors[`bottom-right`].y(e.y+n)}}else console.error(Error(`Wrong position argument of selection resizer: `+this._movingAnchorName));if(f=this.centeredScaling()||e.altKey,f){let e=this._anchors[`top-left`],t=this._anchors[`bottom-right`],n=e.x(),r=e.y(),i=this.getWidth()-t.x(),a=this.getHeight()-t.y();t.move({x:-n,y:-r}),e.move({x:i,y:a})}let h=this._anchors[`top-left`].getAbsolutePosition();t=h.x,n=h.y;let g=this._anchors[`bottom-right`].x()-this._anchors[`top-left`].x(),_=this._anchors[`bottom-right`].y()-this._anchors[`top-left`].y();this._fitNodesInto({x:t,y:n,width:g,height:_,rotation:I.getAngle(this.rotation())},e,p)}_handleMouseUp(e){let t=this.getStage();t&&(t.setPointersPositions(e),!t._changedPointerPositions.some(e=>e.id===this._pointerId))||(t?t._batchEvents(()=>this._removeEvents(e)):this._removeEvents(e))}getAbsoluteTransform(e){let t=this.getTransform();return e?e.getAbsoluteTransform().copy().invert().multiply(t):t}_removeEvents(e){var t;if(this._transforming){this._transforming=!1;let n=this.getStage()?.content;n&&!this._cursorChange&&(n.style.cursor=``);let r=this._transformWindow;this._transformWindow=null,r&&(r.removeEventListener(`mousemove`,this._handleMouseMove),r.removeEventListener(`touchmove`,this._handleMouseMove),r.removeEventListener(`mouseup`,this._handleMouseUp,!0),r.removeEventListener(`touchend`,this._handleMouseUp,!0),r.removeEventListener(`touchcancel`,this._handleMouseUp,!0));let i=this.getNode();ja.delete(this),this._fire(`transformend`,{evt:e,target:i}),(t=this.getLayer())==null||t.batchDraw(),i&&this._nodes.forEach(t=>{var n;t._fire(`transformend`,{evt:e,target:t}),(n=t.getLayer())==null||n.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,t,n=!1){this._fitting=!0;try{return this._doFitNodesInto(e,t,n)}finally{this._fitting=!1}}_doFitNodesInto(e,t,n=!1){let r=this._getNodeRect();if(!r.width||!r.height||L._inRange(e.width,-this.padding()*2-1,1)||L._inRange(e.height,-this.padding()*2-1,1)){this.update();return}let i=new Ze;i.rotate(I.getAngle(this.rotation()));let a=n?0:this.padding()*2,o=null,s=null;if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf(`left`)>=0){let t=i.point({x:-a,y:0});e.x+=t.x,e.y+=t.y,e.width+=a,o={axis:`width`,from:`left`,to:`right`,offset:t}}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf(`right`)>=0){let t=i.point({x:a,y:0});e.width+=a,o={axis:`width`,from:`right`,to:`left`,offset:t}}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf(`top`)>=0){let t=i.point({x:0,y:-a});e.x+=t.x,e.y+=t.y,e.height+=a,s={axis:`height`,from:`top`,to:`bottom`,offset:t}}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf(`bottom`)>=0){let t=i.point({x:0,y:a});e.height+=a,s={axis:`height`,from:`bottom`,to:`top`,offset:t}}if(this.boundBoxFunc()){let t=this.boundBoxFunc()(r,e);t?e=t:L.warn(`boundBoxFunc returned falsy. You should return new bound rect from it!`)}for(let t of[o,s])t&&e[t.axis]<0&&this._movingAnchorName&&(this._movingAnchorName=this._movingAnchorName.replace(t.from,t.to),this._anchorDragOffset.x-=t.offset.x,this._anchorDragOffset.y-=t.offset.y);let c=1e7,l=new Ze;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/c,r.height/c);let u=new Ze,d=e.width/c,f=e.height/c;this.flipEnabled()===!1?(u.translate(e.x,e.y),u.rotate(e.rotation),u.translate(e.width<0?e.width:0,e.height<0?e.height:0),u.scale(Math.abs(d),Math.abs(f))):(u.translate(e.x,e.y),u.rotate(e.rotation),u.scale(d,f));let p=u.multiply(l.invert()),m=new Set;this._nodes.forEach(e=>{if(!e.getStage())return;let t=e.getParent().getAbsoluteTransform(),n=e.getTransform().copy();n.translate(e.offsetX(),e.offsetY());let r=new Ze;r.multiply(t.copy().invert()).multiply(p).multiply(t).multiply(n);let i=r.decompose();e.setAttrs(i);let a=e.getLayer();a&&m.add(a)}),this.rotation(L._getRotation(e.rotation)),this._nodes.forEach(e=>{this._fire(`transform`,{evt:t,target:e}),e._fire(`transform`,{evt:t,target:e})}),this._resetTransformCache(),this.update(),m.add(this.getLayer()),m.forEach(e=>e&&e.batchDraw())}_scheduleUpdate(){this._updatePending=!0,H._runAfterUpdateBatch(this._syncUpdate)}forceUpdate(){this._resetTransformCache(),this.update()}update(){this._lastNodeRect=void 0,this._update()}_update(){var e;this._updatePending=!1;let t=this._getNodeRect();this._updateElements(t);let n=this.nodes().some(e=>e.draggable());this._back.draggable()!==n&&this._back.draggable(n);let r=this.anchorStyleFunc();r&&Object.values(this._anchors).forEach(e=>e.hasName(`_anchor`)&&r(e)),(e=this.getLayer())==null||e.batchDraw()}_updateElements(e){let t=this._lastNodeRect;if(t&&!this.anchorStyleFunc()&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height&&e.rotation===t.rotation)return;this._lastNodeRect={...e};let n=e.width,r=e.height,i=this.enabledAnchors(),a=this.resizeEnabled(),o=this.padding(),s=this.anchorSize();Object.values(this._anchors).filter(e=>e.hasName(`_anchor`)).forEach(e=>{e.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._anchors[`top-left`].setAttrs({x:0,y:0,offsetX:s/2+o,offsetY:s/2+o,visible:a&&i.indexOf(`top-left`)>=0}),this._anchors[`top-center`].setAttrs({x:n/2,y:0,offsetY:s/2+o,visible:a&&i.indexOf(`top-center`)>=0}),this._anchors[`top-right`].setAttrs({x:n,y:0,offsetX:s/2-o,offsetY:s/2+o,visible:a&&i.indexOf(`top-right`)>=0}),this._anchors[`middle-left`].setAttrs({x:0,y:r/2,offsetX:s/2+o,visible:a&&i.indexOf(`middle-left`)>=0}),this._anchors[`middle-right`].setAttrs({x:n,y:r/2,offsetX:s/2-o,visible:a&&i.indexOf(`middle-right`)>=0}),this._anchors[`bottom-left`].setAttrs({x:0,y:r,offsetX:s/2+o,offsetY:s/2-o,visible:a&&i.indexOf(`bottom-left`)>=0}),this._anchors[`bottom-center`].setAttrs({x:n/2,y:r,offsetY:s/2-o,visible:a&&i.indexOf(`bottom-center`)>=0}),this._anchors[`bottom-right`].setAttrs({x:n,y:r,offsetX:s/2-o,offsetY:s/2-o,visible:a&&i.indexOf(`bottom-right`)>=0});let c=this.rotateMode(),l=Aa(this,n,r);this._anchors.rotater.setAttrs({x:l.endX,y:l.endY,visible:this.rotateEnabled()&&c!==`corners`});let u=s*2,d=this.rotateEnabled()&&c!==`handle`,f=-o-u;ba.forEach(e=>{this._anchors[e].setAttrs({x:e.includes(`left`)?f:n+o,y:e.includes(`top`)?f:r+o,width:u,height:u,visible:d})}),this._back.setAttrs({width:n,height:r,visible:this.borderEnabled()||this.shouldOverdrawWholeArea(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0})}isTransforming(){return this._transforming}stopTransform(){this._transforming&&this._removeEvents()}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=``),Nr.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...e){return this._elementsCreated?(L.error(`You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead.`),this):super.add(...e)}toObject(){return H.prototype.toObject.call(this)}clone(e){return H.prototype.clone.call(this,e)}getClientRect(e){return this._syncUpdate(),this.nodes().length>0?super.getClientRect(e):{x:0,y:0,width:0,height:0}}};q.isTransforming=()=>ja.size>0;function Ma(e){return e instanceof Array||L.warn(`enabledAnchors value should be an array`),e instanceof Array&&e.forEach(function(e){Ta.indexOf(e)===-1&&L.warn(`Unknown anchor name: `+e+`. Available names are: `+Ta.join(`, `))}),e||[]}q.prototype.className=`Transformer`,Je(q),V.addGetterSetter(q,`enabledAnchors`,Ta,Ma),V.addGetterSetter(q,`flipEnabled`,!0,nn()),V.addGetterSetter(q,`resizeEnabled`,!0),V.addGetterSetter(q,`anchorSize`,10,B()),V.addGetterSetter(q,`rotateEnabled`,!0),V.addGetterSetter(q,`rotateLineVisible`,!0),V.addGetterSetter(q,`rotationSnaps`,[]),V.addGetterSetter(q,`rotateAnchorOffset`,50,B()),V.addGetterSetter(q,`rotateAnchorAngle`,0,B()),V.addGetterSetter(q,`rotateAnchorCursor`,`crosshair`),V.addGetterSetter(q,`rotateMode`,`handle`),V.addGetterSetter(q,`rotationSnapTolerance`,5,B()),V.addGetterSetter(q,`borderEnabled`,!0),V.addGetterSetter(q,`anchorStroke`,`rgb(0, 161, 255)`),V.addGetterSetter(q,`anchorStrokeWidth`,1,B()),V.addGetterSetter(q,`anchorFill`,`white`),V.addGetterSetter(q,`anchorCornerRadius`,0,B()),V.addGetterSetter(q,`borderStroke`,`rgb(0, 161, 255)`),V.addGetterSetter(q,`borderStrokeWidth`,1,B()),V.addGetterSetter(q,`borderDash`),V.addGetterSetter(q,`keepRatio`,!0),V.addGetterSetter(q,`shiftBehavior`,`default`),V.addGetterSetter(q,`centeredScaling`,!1),V.addGetterSetter(q,`ignoreStroke`,!1),V.addGetterSetter(q,`padding`,0,B()),V.addGetterSetter(q,`nodes`),V.addGetterSetter(q,`node`),V.addGetterSetter(q,`boundBoxFunc`),V.addGetterSetter(q,`anchorDragBoundFunc`),V.addGetterSetter(q,`anchorStyleFunc`),V.addGetterSetter(q,`shouldOverdrawWholeArea`,!1),V.addGetterSetter(q,`useSingleNodeRotation`,!0),V.backCompat(q,{lineEnabled:`borderEnabled`,rotateHandlerOffset:`rotateAnchorOffset`,enabledHandlers:`enabledAnchors`});var Na=class extends U{_sceneFunc(e){e.beginPath(),e.arc(0,0,Math.abs(this.radius()),0,I.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return Math.abs(this.radius())*2}getHeight(){return Math.abs(this.radius())*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};Na.prototype.className=`Wedge`,Na.prototype._centroid=!0,Na.prototype._attrsAffectingSize=[`radius`],Je(Na,!0),V.addGetterSetter(Na,`radius`,0,B()),V.addGetterSetter(Na,`angle`,0,B()),V.addGetterSetter(Na,`clockwise`,!1),V.backCompat(Na,{angleDeg:`angle`,getAngleDeg:`getAngle`,setAngleDeg:`setAngle`});function Pa(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var Fa=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Ia=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function La(e,t){return t===255?e:e*t/255}var Ra=180;function za(e,t){let n=e.data,r=e.width,i=e.height,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=t+t+1,ee=r-1,E=i-1,D=t+1,te=D*(D+1)/2,ne=new Pa,O=t<=Ra?Fa[t]/2**Ia[t]:1/(D*D),re=null,k=ne,A=null,ie=null;for(let e=1;e<T;e++)k=k.next=new Pa,e===D&&(re=k);k.next=ne,s=o=0;for(let e=0;e<i;e++){g=_=v=y=c=l=u=d=0,C=n[o+3],b=La(n[o],C),x=La(n[o+1],C),S=La(n[o+2],C),f=D*b,p=D*x,m=D*S,h=D*C,c+=te*b,l+=te*x,u+=te*S,d+=te*C,k=ne;for(let e=0;e<D;e++)k.r=b,k.g=x,k.b=S,k.a=C,k=k.next;for(let e=1;e<D;e++)a=o+((ee<e?ee:e)<<2),C=n[a+3],c+=(k.r=b=La(n[a],C))*(w=D-e),l+=(k.g=x=La(n[a+1],C))*w,u+=(k.b=S=La(n[a+2],C))*w,d+=(k.a=C)*w,g+=b,_+=x,v+=S,y+=C,k=k.next;A=ne,ie=re;for(let e=0;e<r;e++)n[o]=Math.floor(c*O),n[o+1]=Math.floor(l*O),n[o+2]=Math.floor(u*O),n[o+3]=Math.floor(d*O),c-=f,l-=p,u-=m,d-=h,f-=A.r,p-=A.g,m-=A.b,h-=A.a,a=s+((a=e+t+1)<ee?a:ee)<<2,C=n[a+3],g+=A.r=La(n[a],C),_+=A.g=La(n[a+1],C),v+=A.b=La(n[a+2],C),y+=A.a=C,c+=g,l+=_,u+=v,d+=y,A=A.next,f+=b=ie.r,p+=x=ie.g,m+=S=ie.b,h+=C=ie.a,g-=b,_-=x,v-=S,y-=C,ie=ie.next,o+=4;s+=r}for(let e=0;e<r;e++){_=v=y=g=l=u=d=c=0,o=e<<2,f=D*(b=n[o]),p=D*(x=n[o+1]),m=D*(S=n[o+2]),h=D*(C=n[o+3]),c+=te*b,l+=te*x,u+=te*S,d+=te*C,k=ne;for(let e=0;e<D;e++)k.r=b,k.g=x,k.b=S,k.a=C,k=k.next;let s=Math.min(1,E)*r;for(let i=1;i<=t;i++)o=s+e<<2,c+=(k.r=b=n[o])*(w=D-i),l+=(k.g=x=n[o+1])*w,u+=(k.b=S=n[o+2])*w,d+=(k.a=C=n[o+3])*w,g+=b,_+=x,v+=S,y+=C,k=k.next,i<E&&(s+=r);o=e,A=ne,ie=re;for(let t=0;t<i;t++)a=o<<2,n[a+3]=C=Math.floor(d*O),C>0?(C=255/C,n[a]=Math.floor(c*O)*C,n[a+1]=Math.floor(l*O)*C,n[a+2]=Math.floor(u*O)*C):n[a]=n[a+1]=n[a+2]=0,c-=f,l-=p,u-=m,d-=h,f-=A.r,p-=A.g,m-=A.b,h-=A.a,a=e+((a=t+D)<E?a:E)*r<<2,c+=g+=A.r=n[a],l+=_+=A.g=n[a+1],u+=v+=A.b=n[a+2],d+=y+=A.a=n[a+3],A=A.next,f+=b=ie.r,p+=x=ie.g,m+=S=ie.b,h+=C=ie.a,g-=b,_-=x,v-=S,y-=C,ie=ie.next,o+=r}}var Ba=function(e,t=1){let n=Math.round(Math.min(this.blurRadius(),Ra)*t);n>0&&za(e,n)};V.addGetterSetter(H,`blurRadius`,0,B(),V.afterSetFilter);var Va=function(e){let t=this.brightness()*255,n=e.data,r=n.length;for(let e=0;e<r;e+=4)n[e]+=t,n[e+1]+=t,n[e+2]+=t};V.addGetterSetter(H,`brightness`,0,B(),V.afterSetFilter);var Ha=function(e){let t=this.attrs.brightness===void 0?1:this.brightness(),n=e.data,r=n.length;for(let e=0;e<r;e+=4)n[e]=Math.min(255,n[e]*t),n[e+1]=Math.min(255,n[e+1]*t),n[e+2]=Math.min(255,n[e+2]*t)},Ua=function(e){let t=((this.contrast()+100)/100)**2,n=e.data,r=n.length,i=150,a=150,o=150;for(let e=0;e<r;e+=4)i=n[e],a=n[e+1],o=n[e+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,n[e]=i,n[e+1]=a,n[e+2]=o};V.addGetterSetter(H,`contrast`,0,B(),V.afterSetFilter);var Wa=function(e){let t=e.data,n=e.width,r=e.height,i=Math.min(1,Math.max(0,this.embossStrength?.call(this)??.5)),a=Math.min(1,Math.max(0,this.embossWhiteLevel?.call(this)??.5)),o={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[this.embossDirection?.call(this)??`top-left`]??315,s=!!(this.embossBlend?.call(this)??!1),c=i*10,l=a*255,u=o*Math.PI/180,d=Math.cos(u),f=Math.sin(u),p=128/1020*c,m=new Float32Array(n*r);for(let e=0,n=0;n<t.length;n+=4,e++)m[e]=.2126*t[n]+.7152*t[n+1]+.0722*t[n+2];let h=[-1,0,1,-2,0,2,-1,0,1],g=[-1,-2,-1,0,0,0,1,2,1],_=e=>e<0?0:e>255?255:e;for(let e=0;e<r;e++)for(let i=0;i<n;i++){let a=0,o=0,c=0;for(let t=-1;t<=1;t++){let s=Math.max(0,Math.min(r-1,e+t))*n;for(let e=-1;e<=1;e++,c++){let t=m[s+Math.max(0,Math.min(n-1,i+e))];a+=t*h[c],o+=t*g[c]}}let u=e*n+i,v=_(l+(d*a+f*o)*p),y=u*4;if(s){let e=v-l;t[y]=_(t[y]+e),t[y+1]=_(t[y+1]+e),t[y+2]=_(t[y+2]+e)}else t[y]=t[y+1]=t[y+2]=v}return e};V.addGetterSetter(H,`embossStrength`,.5,B(),V.afterSetFilter),V.addGetterSetter(H,`embossWhiteLevel`,.5,B(),V.afterSetFilter),V.addGetterSetter(H,`embossDirection`,`top-left`,void 0,V.afterSetFilter),V.addGetterSetter(H,`embossBlend`,!1,void 0,V.afterSetFilter);function Ga(e,t,n,r,i){let a=n-t,o=i-r;if(a===0)return r+o/2;if(o===0)return r;let s=(e-t)/a;return s=o*s+r,s}var Ka=function(e){let t=e.data,n=t.length,r=t[0],i=r,a,o=t[1],s=o,c,l=t[2],u=l,d,f=this.enhance();if(f===0)return;for(let e=0;e<n;e+=4)a=t[e+0],a<r?r=a:a>i&&(i=a),c=t[e+1],c<o?o=c:c>s&&(s=c),d=t[e+2],d<l?l=d:d>u&&(u=d);i===r&&(i=255,r=0),s===o&&(s=255,o=0),u===l&&(u=255,l=0);let p,m,h,g,_,v;if(f>0)p=i+f*(255-i),m=r-f*(r-0),h=s+f*(255-s),g=o-f*(o-0),_=u+f*(255-u),v=l-f*(l-0);else{let e=(i+r)*.5;p=i+f*(i-e),m=r+f*(r-e);let t=(s+o)*.5;h=s+f*(s-t),g=o+f*(o-t);let n=(u+l)*.5;_=u+f*(u-n),v=l+f*(l-n)}for(let e=0;e<n;e+=4)t[e+0]=Ga(t[e+0],r,i,m,p),t[e+1]=Ga(t[e+1],o,s,g,h),t[e+2]=Ga(t[e+2],l,u,v,_)};V.addGetterSetter(H,`enhance`,0,B(),V.afterSetFilter);var qa=function(e){let t=e.data,n=t.length;for(let e=0;e<n;e+=4){let n=.34*t[e]+.5*t[e+1]+.16*t[e+2];t[e]=n,t[e+1]=n,t[e+2]=n}};V.addGetterSetter(H,`hue`,0,B(),V.afterSetFilter),V.addGetterSetter(H,`saturation`,0,B(),V.afterSetFilter),V.addGetterSetter(H,`luminance`,0,B(),V.afterSetFilter);var Ja=function(e){let t=e.data,n=t.length,r=2**this.saturation(),i=(this.hue()%360+360)%360,a=this.luminance()*127,o=1*r*Math.cos(i*Math.PI/180),s=1*r*Math.sin(i*Math.PI/180),c=.299+.701*o+.168*s,l=.587-.587*o+.33*s,u=.114-.114*o-.497*s,d=.299-.299*o-.328*s,f=.587+.413*o+.035*s,p=.114-.114*o+.292*s,m=.299-.3*o+1.25*s,h=.587-.588*o-1.05*s,g=.114+.886*o-.203*s,_,v,y,b;for(let e=0;e<n;e+=4)_=t[e+0],v=t[e+1],y=t[e+2],b=t[e+3],t[e+0]=c*_+l*v+u*y+a,t[e+1]=d*_+f*v+p*y+a,t[e+2]=m*_+h*v+g*y+a,t[e+3]=b},Ya=function(e){let t=e.data,n=t.length,r=2**this.value(),i=2**this.saturation(),a=(this.hue()%360+360)%360,o=r*i*Math.cos(a*Math.PI/180),s=r*i*Math.sin(a*Math.PI/180),c=.299*r+.701*o+.168*s,l=.587*r-.587*o+.33*s,u=.114*r-.114*o-.497*s,d=.299*r-.299*o-.328*s,f=.587*r+.413*o+.035*s,p=.114*r-.114*o+.292*s,m=.299*r-.3*o+1.25*s,h=.587*r-.588*o-1.05*s,g=.114*r+.886*o-.203*s;for(let e=0;e<n;e+=4){let n=t[e+0],r=t[e+1],i=t[e+2],a=t[e+3];t[e+0]=c*n+l*r+u*i,t[e+1]=d*n+f*r+p*i,t[e+2]=m*n+h*r+g*i,t[e+3]=a}};V.addGetterSetter(H,`hue`,0,B(),V.afterSetFilter),V.addGetterSetter(H,`saturation`,0,B(),V.afterSetFilter),V.addGetterSetter(H,`value`,0,B(),V.afterSetFilter);var Xa=function(e){let t=e.data,n=t.length;for(let e=0;e<n;e+=4)t[e]=255-t[e],t[e+1]=255-t[e+1],t[e+2]=255-t[e+2]},Za=function(e,t,n){let r=e.data,i=t.data,a=e.width,o=e.height,s=n.polarCenterX||a/2,c=n.polarCenterY||o/2,l=Math.sqrt(s*s+c*c),u=a-s,d=o-c,f=Math.sqrt(u*u+d*d);l=f>l?f:l;let p=o,m=a,h=360/m*Math.PI/180;for(let e=0;e<m;e+=1){let t=Math.sin(e*h),n=Math.cos(e*h);for(let o=0;o<p;o+=1){u=Math.floor(s+l*o/p*n),d=Math.floor(c+l*o/p*t);let f=(d*a+u)*4,m=r[f+0],h=r[f+1],g=r[f+2],_=r[f+3];f=(e+o*a)*4,i[f+0]=m,i[f+1]=h,i[f+2]=g,i[f+3]=_}}},Qa=function(e,t,n){let r=e.data,i=t.data,a=e.width,o=e.height,s=n.polarCenterX||a/2,c=n.polarCenterY||o/2,l=Math.sqrt(s*s+c*c),u=a-s,d=o-c,f=Math.sqrt(u*u+d*d);l=f>l?f:l;let p=o,m=a,h=n.polarRotation||0,g,_;for(u=0;u<a;u+=1)for(d=0;d<o;d+=1){let e=u-s,t=d-c,n=Math.sqrt(e*e+t*t)*p/l,o=(Math.atan2(t,e)*180/Math.PI+360+h)%360;o=o*m/360,g=Math.floor(o),_=Math.floor(n);let f=(_*a+g)*4,v=r[f+0],y=r[f+1],b=r[f+2],x=r[f+3];f=(d*a+u)*4,i[f+0]=v,i[f+1]=y,i[f+2]=b,i[f+3]=x}},$a=function(e){let t=e.width,n=e.height,r,i,a,o,s,c,l,u,d,f,p=Math.round(this.kaleidoscopePower()),m=Math.round(this.kaleidoscopeAngle()),h=Math.floor(t*((m%360+360)%360)/360);if(p<1)return;let g={width:t,height:n,data:new Uint8ClampedArray(t*n*4)};Za(e,g,{polarCenterX:t/2,polarCenterY:n/2});let _=t/2**p;for(;_<=8;)_*=2,--p;_=Math.ceil(_);let v=_,y=0,b=v,x=1;for(h+_>t&&(y=v,b=0,x=-1),i=0;i<n;i+=1)for(r=y;r!==b;r+=x)a=Math.round(r+h)%t,d=(t*i+a)*4,s=g.data[d+0],c=g.data[d+1],l=g.data[d+2],u=g.data[d+3],f=(t*i+r)*4,g.data[f+0]=s,g.data[f+1]=c,g.data[f+2]=l,g.data[f+3]=u;for(i=0;i<n;i+=1)for(v=Math.floor(_),o=0;o<p;o+=1){for(r=0;r<v+1;r+=1)d=(t*i+r)*4,s=g.data[d+0],c=g.data[d+1],l=g.data[d+2],u=g.data[d+3],f=(t*i+v*2-r-1)*4,g.data[f+0]=s,g.data[f+1]=c,g.data[f+2]=l,g.data[f+3]=u;v*=2}Qa(g,e,{polarRotation:0})};V.addGetterSetter(H,`kaleidoscopePower`,2,B(),V.afterSetFilter),V.addGetterSetter(H,`kaleidoscopeAngle`,0,B(),V.afterSetFilter);function eo(e,t,n){let r=(n*e.width+t)*4,i=[];return i.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),i}function to(e,t){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2)}function no(e){let t=[0,0,0];for(let n=0;n<e.length;n++)t[0]+=e[n][0],t[1]+=e[n][1],t[2]+=e[n][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function ro(e,t){let n=eo(e,0,0),r=eo(e,e.width-1,0),i=eo(e,0,e.height-1),a=eo(e,e.width-1,e.height-1);if(to(n,r)<t&&to(r,a)<t&&to(a,i)<t&&to(i,n)<t){let o=no([r,n,a,i]),s=[];for(let n=0;n<e.width*e.height;n++){let r=to(o,[e.data[n*4],e.data[n*4+1],e.data[n*4+2]]);s[n]=r<t?0:255}return s}}function io(e,t){for(let n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function ao(e,t,n){let r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s<n;s++)for(let c=0;c<t;c++){let l=s*t+c,u=0;for(let o=0;o<i;o++)for(let l=0;l<i;l++){let d=s+o-a,f=c+l-a;if(d>=0&&d<n&&f>=0&&f<t){let n=d*t+f,a=r[o*i+l];u+=e[n]*a}}o[l]=u===2040?255:0}return o}function oo(e,t,n){let r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s<n;s++)for(let c=0;c<t;c++){let l=s*t+c,u=0;for(let o=0;o<i;o++)for(let l=0;l<i;l++){let d=s+o-a,f=c+l-a;if(d>=0&&d<n&&f>=0&&f<t){let n=d*t+f,a=r[o*i+l];u+=e[n]*a}}o[l]=u>=1020?255:0}return o}function so(e,t,n){let r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s<n;s++)for(let c=0;c<t;c++){let l=s*t+c,u=0;for(let o=0;o<i;o++)for(let l=0;l<i;l++){let d=s+o-a,f=c+l-a;if(d>=0&&d<n&&f>=0&&f<t){let n=d*t+f,a=r[o*i+l];u+=e[n]*a}}o[l]=u}return o}V.addGetterSetter(H,`threshold`,.5,B(),V.afterSetFilter),V.addGetterSetter(H,`noise`,.2,B(),V.afterSetFilter),V.addGetterSetter(H,`pixelSize`,8,B(),V.afterSetFilter),V.addGetterSetter(H,`levels`,.5,B(),V.afterSetFilter),V.addGetterSetter(H,`red`,0,Xt,V.afterSetFilter),V.addGetterSetter(H,`green`,0,Xt,V.afterSetFilter),V.addGetterSetter(H,`blue`,0,Xt,V.afterSetFilter),V.addGetterSetter(H,`alpha`,1,e=>Math.min(1,Math.max(0,e)),V.afterSetFilter),V.addGetterSetter(H,`threshold`,.5,B(),V.afterSetFilter),Jr.Util._assign(Jr,{Arc:Yr,Arrow:pi,Circle:mi,Ellipse:hi,Image:gi,Label:na,Tag:ra,Line:li,Path:fi,Rect:ia,RegularPolygon:aa,Ring:sa,Sprite:ca,Star:la,Text:W,TextPath:K,Transformer:q,Wedge:Na,Filters:{Blur:Ba,Brightness:Ha,Brighten:Va,Contrast:Ua,Emboss:Wa,Enhance:Ka,Grayscale:qa,HSL:Ja,HSV:Ya,Invert:Xa,Kaleidoscope:$a,Mask:function(e){let t=ro(e,this.attrs.threshold??10);return t&&(t=ao(t,e.width,e.height),t=oo(t,e.width,e.height),t=so(t,e.width,e.height),io(e,t)),e},Noise:function(e){let t=this.noise()*255,n=e.data,r=n.length,i=t/2;for(let e=0;e<r;e+=4)n[e+0]+=i-2*i*Math.random(),n[e+1]+=i-2*i*Math.random(),n[e+2]+=i-2*i*Math.random()},Pixelate:function(e,t=1){let n=Math.ceil(this.pixelSize()*t),r=e.width,i=e.height,a=Math.ceil(r/n),o=Math.ceil(i/n),s=e.data;if(n<=0)L.error(`pixelSize value can not be <= 0`);else for(let e=0;e<a;e+=1)for(let t=0;t<o;t+=1){let a=0,o=0,c=0,l=0,u=e*n,d=Math.min(u+n,r),f=t*n,p=Math.min(f+n,i);for(let e=u;e<d;e+=1)for(let t=f;t<p;t+=1){let n=(r*t+e)*4,i=s[n+3];a+=s[n+0]*i,o+=s[n+1]*i,c+=s[n+2]*i,l+=i}l&&(a/=l,o/=l,c/=l),l/=(d-u)*(p-f);for(let e=u;e<d;e+=1)for(let t=f;t<p;t+=1){let n=(r*t+e)*4;s[n+0]=a,s[n+1]=o,s[n+2]=c,s[n+3]=l}}},Posterize:function(e){let t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t;for(let e=0;e<r;e+=1)n[e]=Math.floor(n[e]/i)*i},RGB:function(e){let t=e.data,n=t.length,r=this.red(),i=this.green(),a=this.blue();for(let e=0;e<n;e+=4){let n=(.34*t[e]+.5*t[e+1]+.16*t[e+2])/255;t[e]=n*r,t[e+1]=n*i,t[e+2]=n*a,t[e+3]=t[e+3]}},RGBA:function(e){let t=e.data,n=t.length,r=this.red(),i=this.green(),a=this.blue(),o=this.alpha();for(let e=0;e<n;e+=4){let n=1-o;t[e]=r*o+t[e]*n,t[e+1]=i*o+t[e+1]*n,t[e+2]=a*o+t[e+2]*n}},Sepia:function(e){let t=e.data,n=t.length;for(let e=0;e<n;e+=4){let n=t[e+0],r=t[e+1],i=t[e+2];t[e+0]=Math.min(255,n*.393+r*.769+i*.189),t[e+1]=Math.min(255,n*.349+r*.686+i*.168),t[e+2]=Math.min(255,n*.272+r*.534+i*.131)}},Solarize:function(e){let t=e.data;for(let e=0;e<t.length;e+=4){let n=t[e],r=t[e+1],i=t[e+2];.2126*n+.7152*r+.0722*i>=128&&(t[e]=255-n,t[e+1]=255-r,t[e+2]=255-i)}return e},Threshold:function(e){let t=this.threshold()*255,n=e.data,r=n.length;for(let e=0;e<r;e+=1)n[e]=n[e]<t?0:255}}});var co=h(),lo=Jr,uo=o(((e,t)=>{t.exports=function(e){function t(e,t,n,r){return new Qa(e,t,n,r)}function n(){}function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function i(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function a(e){if(i(e)!==e)throw Error(r(188))}function o(e){var t=e.alternate;if(!t){if(t=i(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,o=t;;){var s=n.return;if(s===null)break;var c=s.alternate;if(c===null){if(o=s.return,o!==null){n=o;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===n)return a(s),e;if(c===o)return a(s),t;c=c.sibling}throw Error(r(188))}if(n.return!==o.return)n=s,o=c;else{for(var l=!1,u=s.child;u;){if(u===n){l=!0,n=s,o=c;break}if(u===o){l=!0,o=s,n=c;break}u=u.sibling}if(!l){for(u=c.child;u;){if(u===n){l=!0,n=c,o=s;break}if(u===o){l=!0,o=c,n=s;break}u=u.sibling}if(!l)throw Error(r(189))}}if(n.alternate!==o)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function s(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=s(e),t!==null)return t;e=e.sibling}return null}function c(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(e.tag!==4&&(t=c(e),t!==null))return t;e=e.sibling}return null}function l(e){return typeof e!=`object`||!e?null:(e=Fo&&e[Fo]||e[`@@iterator`],typeof e==`function`?e:null)}function u(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===Lo?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case xo:return`Fragment`;case Co:return`Profiler`;case So:return`StrictMode`;case Do:return`Suspense`;case Oo:return`SuspenseList`;case jo:return`Activity`;case Po:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case bo:return`Portal`;case To:return e.displayName||`Context`;case wo:return(e._context.displayName||`Context`)+`.Consumer`;case Eo:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ko:return t=e.displayName||null,t===null?u(e.type)||`Memo`:t;case Ao:t=e._payload,e=e._init;try{return u(e(t))}catch{}}return null}function f(e){return{current:e}}function m(e){0>Sl||(e.current=xl[Sl],xl[Sl]=null,Sl--)}function h(e,t){Sl++,xl[Sl]=e.current,e.current=t}function g(e){return e>>>=0,e===0?32:31-(Tl(e)/El|0)|0}function _(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function v(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=_(n))):i=_(o):i=_(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=_(n))):i=_(o)):i=_(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function y(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function b(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-wl(n),i=1<<r;t|=e[r],n&=~i}return t}function x(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function S(){var e=kl;return kl<<=1,!(kl&62914560)&&(kl=4194304),e}function C(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function w(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function T(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-wl(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ee(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ee(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-wl(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function E(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wl(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function D(e,t){var n=t&-t;return n=n&42?1:te(n),(n&(e.suspendedLanes|t))===0?n:0}function te(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ne(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function O(e){if(typeof zl==`function`&&Bl(e),Hl&&typeof Hl.setStrictMode==`function`)try{Hl.setStrictMode(Vl,e)}catch{}}function re(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=gf.identifierPrefix;var n=Ul++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function k(e){if(e==null||typeof e==`string`)return e;var t=null,n=wf;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function A(e,t){return e=k(e),t=k(t),t==null?e===`auto`?null:e:t===`auto`?null:t}function ie(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function ae(e){if(ql===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ql=t&&t[1]||``,Jl=-1<e.stack.indexOf(`
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
`+ql+e+Jl}function j(e,t){if(!e||Yl)return``;Yl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
`),l=s.split(`
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Yl=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ae(n):``}function oe(e,t){switch(e.tag){case 26:case 27:case 5:return ae(e.type);case 16:return ae(`Lazy`);case 13:return e.child!==t&&t!==null?ae(`Suspense Fallback`):ae(`Suspense`);case 19:return ae(`SuspenseList`);case 0:case 15:return j(e.type,!1);case 11:return j(e.type.render,!1);case 1:return j(e.type,!0);case 31:return ae(`Activity`);case 30:return ae(`ViewTransition`);default:return``}}function se(e){try{var t=``,n=null;do t+=oe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
Error generating stack: `+e.message+`
`+e.stack}}function M(e,t){if(typeof e==`object`&&e){var n=Xl.get(e);return n===void 0?(t={value:e,source:t,stack:se(t)},Xl.set(e,t),t):n}return{value:e,source:t,stack:se(t)}}function ce(e,t){Zl[Ql++]=eu,Zl[Ql++]=$l,$l=e,eu=t}function le(e,t,n){tu[nu++]=iu,tu[nu++]=au,tu[nu++]=ru,ru=e;var r=iu;e=au;var i=32-wl(r)-1;r&=~(1<<i),n+=1;var a=32-wl(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,iu=1<<32-wl(t)+i|n<<i|r,au=a+e}else iu=1<<a|n<<i|r,au=e}function ue(e){e.return!==null&&(ce(e,1),le(e,1,0))}function de(e){for(;e===$l;)$l=Zl[--Ql],Zl[Ql]=null,eu=Zl[--Ql],Zl[Ql]=null;for(;e===ru;)ru=tu[--nu],tu[nu]=null,au=tu[--nu],tu[nu]=null,iu=tu[--nu],tu[nu]=null}function fe(e,t){tu[nu++]=iu,tu[nu++]=au,tu[nu++]=ru,iu=t.id,au=t.overflow,ru=e}function pe(e,t){h(cu,t),h(su,e),h(ou,null),e=Uo(t),m(ou),h(ou,e)}function me(){m(ou),m(su),m(cu)}function he(e){var t=e.memoizedState;t!==null&&(t=t.memoizedState,ts?xs._currentValue=t:xs._currentValue2=t,h(lu,e)),t=ou.current;var n=Wo(t,e.type);t!==n&&(h(su,e),h(ou,n))}function ge(e){su.current===e&&(m(ou),m(su)),lu.current===e&&(m(lu),ts?xs._currentValue=bs:xs._currentValue2=bs)}function _e(e){throw Se(M(Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),hu}function N(e,t){if(!is)throw Error(r(175));Ic(e.stateNode,e.type,e.memoizedProps,t,e)||_e(e,!0)}function ve(e){for(uu=e.return;uu;)switch(uu.tag){case 5:case 31:case 13:mu=!1;return;case 27:case 3:mu=!0;return;default:uu=uu.return}}function ye(e){if(!is||e!==uu)return!1;if(!fu)return ve(e),fu=!0,!1;var t=e.tag;if(hl?t!==3&&t!==27&&(t!==5||Qc(e.type)&&!Xo(e.type,e.memoizedProps))&&du&&_e(e):t!==3&&(t!==5||Qc(e.type)&&!Xo(e.type,e.memoizedProps))&&du&&_e(e),ve(e),t===13){if(!is)throw Error(r(316));if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));du=Vc(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));du=Bc(e)}else du=hl&&t===27?Ec(e.type,du):uu?Tc(e.stateNode):null;return!0}function be(){is&&(du=uu=null,fu=!1)}function xe(){var e=pu;return e!==null&&(cf===null?cf=e:cf.push.apply(cf,e),pu=null),e}function Se(e){pu===null?pu=[e]:pu.push(e)}function Ce(e,t,n){ts?(h(gu,t._currentValue),t._currentValue=n):(h(gu,t._currentValue2),t._currentValue2=n)}function P(e){var t=gu.current;ts?e._currentValue=t:e._currentValue2=t,m(gu)}function we(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Te(e,t,n,i){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),we(o.return,n,e),i||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(r(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),we(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),we(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ee(e,t,n,i){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(r(387));if(s=s.memoizedProps,s!==null){var c=a.type;Wl(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===lu.current){if(s=a.alternate,s===null)throw Error(r(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[xs]:e.push(xs))}a=a.return}return e!==null&&Te(t,e,n,i),t.flags|=262144,e!==null}function De(e){for(e=e.firstContext;e!==null;){var t=e.context;if(!Wl(ts?t._currentValue:t._currentValue2,e.memoizedValue))return!0;e=e.next}return!1}function Oe(e){_u=e,vu=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ke(e){return je(_u,e)}function Ae(e,t){return _u===null&&Oe(e),je(e,t)}function je(e,t){var n=ts?t._currentValue:t._currentValue2;if(t={context:t,memoizedValue:n,next:null},vu===null){if(e===null)throw Error(r(308));vu=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else vu=vu.next=t;return n}function Me(){return{controller:new yu,data:new Map,refCount:0}}function F(e){e.refCount--,e.refCount===0&&bu(xu,function(){e.controller.abort()})}function Ne(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}function Pe(e){var t=e.transitionTypes;return e.transitionTypes=null,t}function Fe(){}function Ie(e){e!==Tu&&e.next===null&&(Tu===null?wu=Tu=e:Tu=Tu.next=e),Du=!0,Eu||(Eu=!0,Ue())}function Le(e,t){if(!Ou&&Du){Ou=!0;do for(var n=!1,r=wu;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-wl(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,He(r,a))}else a=qd,a=v(r,r===Gd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==es),!(a&3)||y(r,a)||(n=!0,He(r,a))}r=r.next}while(n);Ou=!1}}function Re(){ze()}function ze(){Du=Eu=!1;var e=0;ku!==0&&us()&&(e=ku);for(var t=Pl(),n=null,r=wu;r!==null;){var i=r.next,a=Be(r,t);a===0?(r.next=null,n===null?wu=i:n.next=i,i===null&&(Tu=n)):(n=r,(e!==0||a&3)&&(Du=!0)),r=i}hf!==0&&hf!==5||Le(e,!1),ku!==0&&(ku=0)}function Be(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-wl(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=x(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Gd,n=qd,n=v(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==es),r=e.callbackNode,n===0||e===t&&(Jd===2||Jd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&jl(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||y(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&jl(r),ne(n)){case 2:case 8:n=Il;break;case 32:n=Ll;break;case 268435456:n=Rl;break;default:n=Ll}return r=Ve.bind(null,e),n=Al(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&jl(r),e.callbackPriority=2,e.callbackNode=null,2}function Ve(e,t){if(hf!==0&&hf!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ha()&&e.callbackNode!==n)return null;var r=qd;return r=v(e,e===Gd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==es),r===0?null:(ma(e,r,t),Be(e,Pl()),e.callbackNode!=null&&e.callbackNode===n?Ve.bind(null,e):null)}function He(e,t){if(Ha())return null;ma(e,t,!0)}function Ue(){Cs?ws(function(){Wd&6?Al(Fl,Re):ze()}):Al(Fl,Re)}function We(){if(ku===0){var e=Mu;e===0&&(e=Dl,Dl<<=1,!(Dl&261888)&&(Dl=256)),ku=e}return ku}function Ge(e,t){if(Au===null){var n=Au=[];ju=0,Mu=We(),Nu={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ju++,t.then(Ke,Ke),t}function Ke(){if(--ju===0&&(Cu=null,Au!==null)){Nu!==null&&(Nu.status=`fulfilled`);var e=Au;Au=null,Mu=0,Nu=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function I(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}function qe(){var e=Fu.current;return e===null?Gd.pooledCache:e}function Je(e,t){t===null?h(Fu,Fu.current):h(Fu,t.pool)}function Ye(){var e=qe();return e===null?null:{parent:ts?Su._currentValue:Su._currentValue2,pool:e}}function Xe(e,t){if(Wl(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)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 i=n[r];if(!Kl.call(t,i)||!Wl(e[i],t[i]))return!1}return!0}function Ze(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Qe(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Fe,Fe),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,tt(e),e===void 0&&!(`reason`in t)?Error(r(600)):e;default:if(typeof t.status==`string`)t.then(Fe,Fe);else{if(e=Gd,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,tt(e),e}throw Bu=t,Iu}}function $e(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Bu=e,Iu):e}}function et(){if(Bu===null)throw Error(r(459));var e=Bu;return Bu=null,e}function tt(e){if(e===Iu||e===Ru)throw Error(r(483))}function nt(e){var t=Hu;return Hu+=1,Vu===null&&(Vu=[]),Qe(Vu,e,t)}function rt(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function it(e,t){throw t.$$typeof===vo?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function at(e){function n(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function i(t,r){if(!e)return null;for(;r!==null;)n(t,r),r=r.sibling;return null}function a(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function o(e,t){return e=eo(e,t),e.index=0,e.sibling=null,e}function s(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function c(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function u(e,t,n,r){return t===null||t.tag!==6?(t=io(n,e.mode,r),t.return=e,t):(t=o(t,n),t.return=e,t)}function d(e,t,n,r){var i=n.type;return i===xo?(e=p(e,t,n.props.children,r,n.key),rt(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===Ao&&$e(i)===t.type)?(t=o(t,n.props),rt(t,n),t.return=e,t):(t=no(n.type,n.key,n.props,null,e.mode,r),rt(t,n),t.return=e,t)}function f(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=oo(n,e.mode,r),t.return=e,t):(t=o(t,n.children||[]),t.return=e,t)}function p(e,t,n,r,i){return t===null||t.tag!==7?(t=ro(n,e.mode,r,i),t.return=e,t):(t=o(t,n),t.return=e,t)}function m(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=io(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case yo:return n=no(t.type,t.key,t.props,null,e.mode,n),rt(n,t),n.return=e,n;case bo:return t=oo(t,e.mode,n),t.return=e,t;case Ao:return t=$e(t),m(e,t,n)}if(Ro(t)||l(t))return t=ro(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return m(e,nt(t),n);if(t.$$typeof===To)return m(e,Ae(e,t),n);it(e,t)}return null}function h(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?u(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case yo:return n.key===i?d(e,t,n,r):null;case bo:return n.key===i?f(e,t,n,r):null;case Ao:return n=$e(n),h(e,t,n,r)}if(Ro(n)||l(n))return i===null?p(e,t,n,r,null):null;if(typeof n.then==`function`)return h(e,t,nt(n),r);if(n.$$typeof===To)return h(e,t,Ae(e,n),r);it(e,n)}return null}function g(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,u(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case yo:return e=e.get(r.key===null?n:r.key)||null,d(t,e,r,i);case bo:return e=e.get(r.key===null?n:r.key)||null,f(t,e,r,i);case Ao:return r=$e(r),g(e,t,n,r,i)}if(Ro(r)||l(r))return e=e.get(n)||null,p(t,e,r,i,null);if(typeof r.then==`function`)return g(e,t,n,nt(r),i);if(r.$$typeof===To)return g(e,t,n,Ae(t,r),i);it(t,r)}return null}function _(t,r,o,c){for(var l=null,u=null,d=r,f=r=0,p=null;d!==null&&f<o.length;f++){d.index>f?(p=d,d=null):p=d.sibling;var _=h(t,d,o[f],c);if(_===null){d===null&&(d=p);break}e&&d&&_.alternate===null&&n(t,d),r=s(_,r,f),u===null?l=_:u.sibling=_,u=_,d=p}if(f===o.length)return i(t,d),fu&&ce(t,f),l;if(d===null){for(;f<o.length;f++)d=m(t,o[f],c),d!==null&&(r=s(d,r,f),u===null?l=d:u.sibling=d,u=d);return fu&&ce(t,f),l}for(d=a(d);f<o.length;f++)p=g(d,t,f,o[f],c),p!==null&&(e&&(_=p.alternate,_!==null&&d.delete(_.key===null?f:_.key)),r=s(p,r,f),u===null?l=p:u.sibling=p,u=p);return e&&d.forEach(function(e){return n(t,e)}),fu&&ce(t,f),l}function v(t,o,c,l){if(c==null)throw Error(r(151));for(var u=null,d=null,f=o,p=o=0,_=null,v=c.next();f!==null&&!v.done;p++,v=c.next()){f.index>p?(_=f,f=null):_=f.sibling;var y=h(t,f,v.value,l);if(y===null){f===null&&(f=_);break}e&&f&&y.alternate===null&&n(t,f),o=s(y,o,p),d===null?u=y:d.sibling=y,d=y,f=_}if(v.done)return i(t,f),fu&&ce(t,p),u;if(f===null){for(;!v.done;p++,v=c.next())v=m(t,v.value,l),v!==null&&(o=s(v,o,p),d===null?u=v:d.sibling=v,d=v);return fu&&ce(t,p),u}for(f=a(f);!v.done;p++,v=c.next())v=g(f,t,p,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&f.delete(_.key===null?p:_.key)),o=s(v,o,p),d===null?u=v:d.sibling=v,d=v);return e&&f.forEach(function(e){return n(t,e)}),fu&&ce(t,p),u}function y(e,t,a,s){if(typeof a==`object`&&a&&a.type===xo&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case yo:a:{for(var u=a.key;t!==null;){if(t.key===u){if(u=a.type,u===xo){if(t.tag===7){i(e,t.sibling),s=o(t,a.props.children),rt(s,a),s.return=e,e=s;break a}}else if(t.elementType===u||typeof u==`object`&&u&&u.$$typeof===Ao&&$e(u)===t.type){i(e,t.sibling),s=o(t,a.props),rt(s,a),s.return=e,e=s;break a}i(e,t);break}n(e,t),t=t.sibling}a.type===xo?(s=ro(a.props.children,e.mode,s,a.key),rt(s,a),s.return=e,e=s):(s=no(a.type,a.key,a.props,null,e.mode,s),rt(s,a),s.return=e,e=s)}return c(e);case bo:a:{for(u=a.key;t!==null;){if(t.key===u){if(t.tag===4&&t.stateNode.containerInfo===a.containerInfo&&t.stateNode.implementation===a.implementation){i(e,t.sibling),s=o(t,a.children||[]),s.return=e,e=s;break a}i(e,t);break}n(e,t),t=t.sibling}s=oo(a,e.mode,s),s.return=e,e=s}return c(e);case Ao:return a=$e(a),y(e,t,a,s)}if(Ro(a))return _(e,t,a,s);if(l(a)){if(u=l(a),typeof u!=`function`)throw Error(r(150));return a=u.call(a),v(e,t,a,s)}if(typeof a.then==`function`)return y(e,t,nt(a),s);if(a.$$typeof===To)return y(e,t,Ae(e,a),s);it(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,t!==null&&t.tag===6?(i(e,t.sibling),s=o(t,a),s.return=e,e=s):(i(e,t),s=io(a,e.mode,s),s.return=e,e=s),c(e)):i(e,t)}return function(e,n,r,i){try{Hu=0;var a=y(e,n,r,i);return Vu=null,a}catch(n){if(n===Iu||n===Ru)throw n;var o=t(29,n,null,e.mode);return o.lanes=i,o.return=e,o}}}function ot(){for(var e=Ku,t=qu=Ku=0;t<e;){var n=Gu[t];Gu[t++]=null;var r=Gu[t];Gu[t++]=null;var i=Gu[t];Gu[t++]=null;var a=Gu[t];if(Gu[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ut(n,i,a)}}function st(e,t,n,r){Gu[Ku++]=e,Gu[Ku++]=t,Gu[Ku++]=n,Gu[Ku++]=r,qu|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ct(e,t,n,r){return st(e,t,n,r),dt(e)}function lt(e,t){return st(e,null,null,t),dt(e)}function ut(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-wl(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function dt(e){if(50<Tf)throw Tf=0,Ef=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}function ft(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pt(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function mt(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ht(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Wd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=dt(e),ut(e,null,n),t}return st(e,r,t,n),dt(e)}function gt(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,E(e,n)}}function _t(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function vt(){if(Yu){var e=Nu;if(e!==null)throw e}}function yt(e,t,n,r){Yu=!1;var i=e.updateQueue;Ju=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(qd&f)===f:(r&f)===f){f!==0&&f===Mu&&(Yu=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=_o({},d,f);break a;case 2:Ju=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),tf|=o,e.lanes=o,e.memoizedState=d}}function bt(e,t){if(typeof e!=`function`)throw Error(r(191,e));e.call(t)}function xt(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bt(n[e],t)}function St(e,t){e=$d,h(Zu,e),h(Xu,t),$d=e|t.baseLanes}function Ct(){h(Zu,$d),h(Xu,Xu.current)}function L(){$d=Zu.current,m(Xu),m(Zu)}function wt(e){var t=e.alternate;h(Qu,Qu.current&1),h(Z,e),Q===null&&(t===null||Xu.current!==null||t.memoizedState!==null)&&(Q=e)}function Tt(e){h(Qu,Qu.current),h(Z,e),Q===null&&(Q=e)}function Et(e){e.tag===22?(h(Qu,Qu.current),h(Z,e),Q===null&&(Q=e)):Dt()}function Dt(){h(Qu,Qu.current),h(Z,Z.current)}function Ot(e){m(Z),Q===e&&(Q=null),m(Qu)}function kt(e,t){h(Z,Z.current),h(Qu,t)}function At(e){m(Qu),m(Z),Q===e&&(Q=null)}function jt(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||yc(n)||bc(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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}function Mt(){throw Error(r(321))}function Nt(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wl(e[n],t[n]))return!1;return!0}function Pt(e,t,n,r,i,a){return $u=a,$=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,X.H=e===null||e.memoizedState===null?ud:dd,id=!1,a=n(r,i),id=!1,rd&&(a=It(t,n,r,i)),Ft(e),a}function Ft(e){X.H=ld;var t=ed!==null&&ed.next!==null;if($u=0,td=ed=$=null,nd=!1,od=0,sd=null,t)throw Error(r(300));e===null||hd||(e=e.dependencies,e!==null&&De(e)&&(hd=!0))}function It(e,t,n,i){$=e;var a=0;do{if(rd&&(sd=null),od=0,rd=!1,25<=a)throw Error(r(301));if(a+=1,td=ed=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}X.H=fd,o=t(n,i)}while(rd);return o}function Lt(){var e=X.H,t=e.useState()[0];return t=typeof t.then==`function`?Ut(t):t,e=e.useState()[0],(ed===null?null:ed.memoizedState)!==e&&($.flags|=1024),t}function Rt(){var e=ad!==0;return ad=0,e}function zt(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Bt(e){if(nd){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}nd=!1}$u=0,td=ed=$=null,rd=!1,od=ad=0,sd=null}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return td===null?$.memoizedState=td=e:td=td.next=e,td}function R(){if(ed===null){var e=$.alternate;e=e===null?null:e.memoizedState}else e=ed.next;var t=td===null?$.memoizedState:td.next;if(t!==null)td=t,ed=e;else{if(e===null)throw $.alternate===null?Error(r(467)):Error(r(310));ed=e,e={memoizedState:ed.memoizedState,baseState:ed.baseState,baseQueue:ed.baseQueue,queue:ed.queue,next:null},td===null?$.memoizedState=td=e:td=td.next=e}return td}function Ht(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ut(e){var t=od;return od+=1,sd===null&&(sd=[]),e=Qe(sd,e,t),t=$,(td===null?t.memoizedState:td.next)===null&&(t=t.alternate,X.H=t===null||t.memoizedState===null?ud:dd),e}function Wt(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ut(e);if(e.$$typeof===Y)return;if(e.$$typeof===To)return ke(e)}throw Error(r(438,String(e)))}function Gt(e){var t=null,n=$.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=$.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Ht(),$.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=No;return t.index++,n}function z(e,t){return typeof t==`function`?t(e):t}function Kt(e){return qt(R(),ed,e)}function qt(e,t,n){var i=e.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=n;var a=e.baseQueue,o=i.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,i.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?($u&f)===f:(qd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Mu&&(d=!0);else if(($u&p)===p){u=u.next,p===Mu&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,$.lanes|=p,tf|=p;f=u.action,id&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,$.lanes|=f,tf|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Wl(o,e.memoizedState)&&(hd=!0,d&&(n=Nu,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,i.lastRenderedState=o}return a===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Jt(e){var t=R(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Wl(o,t.memoizedState)||(hd=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Yt(e,t,n){var i=$,a=R(),o=fu;if(o){if(n===void 0)throw Error(r(407));n=n()}else n=t();var s=!Wl((ed||a).memoizedState,n);if(s&&(a.memoizedState=n,hd=!0),a=a.queue,yn(Zt.bind(null,i,a,e),[e]),e=a.getSnapshot!==t||s||td!==null&&!!(td.memoizedState.tag&1),mn(e?9:8,{destroy:void 0},B.bind(null,i,a,n,t),null),e){if(i.flags|=2048,Gd===null)throw Error(r(349));o||$u&127||Xt(i,t,n)}return n}function Xt(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$.updateQueue,t===null?(t=Ht(),$.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function B(e,t,n,r){t.value=n,t.getSnapshot=r,Qt(t)&&$t(e)}function Zt(e,t,n){return n(function(){Qt(t)&&$t(e)})}function Qt(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wl(e,n)}catch{return!0}}function $t(e){var t=lt(e,2);t!==null&&K(t,e,2)}function en(e){var t=Vt();if(typeof e==`function`){var n=e;if(e=n(),id){O(!0);try{n()}finally{O(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:z,lastRenderedState:e},t}function tn(e,t,n,r){return e.baseState=n,qt(e,ed,typeof r==`function`?r:z)}function nn(e,t,n,i,a){if(Bn(e))throw Error(r(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};X.T===null?o.isTransition=!1:n(!0),i(o),n=t.pending,n===null?(o.next=t.pending=o,rn(t,o)):(o.next=n.next,t.pending=n.next=o)}}function rn(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=X.T,o={};o.types=a===null?null:a.types,X.T=o;try{var s=n(i,r),c=X.S;c!==null&&c(o,s),an(e,t,s)}catch(n){V(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),X.T=a}}else try{a=n(i,r),an(e,t,a)}catch(n){V(e,t,n)}}function an(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){on(e,t,n)},function(n){return V(e,t,n)}):on(e,t,n)}function on(e,t,n){t.status=`fulfilled`,t.value=n,sn(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,rn(e,n)))}function V(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,sn(t),t=t.next;while(t!==r)}e.action=null}function sn(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function cn(e,t){return t}function ln(e,t){if(fu){var n=Gd.formState;if(n!==null){a:{var r=$;if(fu){if(du){var i=Cc(du,mu);if(i){du=Tc(i),r=wc(i);break a}}_e(r)}r=!1}r&&(t=n[0])}}n=Vt(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cn,lastRenderedState:t},n.queue=r,n=Ln.bind(null,$,r),r.dispatch=n,r=en(!1);var a=zn.bind(null,$,!1,r.queue);return r=Vt(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=nn.bind(null,$,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function un(e){return dn(R(),ed,e)}function dn(e,t,n){if(t=qt(e,t,cn)[0],e=Kt(z)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ut(t)}catch(e){throw e===Iu?Ru:e}else r=t;t=R();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&($.flags|=2048,mn(9,{destroy:void 0},fn.bind(null,i,n),null)),[r,a,e]}function fn(e,t){e.action=t}function pn(e){var t=R(),n=ed;if(n!==null)return dn(t,n,e);R(),t=t.memoizedState,n=R();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function mn(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=$.updateQueue,t===null&&(t=Ht(),$.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function hn(){return R().memoizedState}function gn(e,t,n,r){var i=Vt();$.flags|=e,i.memoizedState=mn(1|t,{destroy:void 0},n,r===void 0?null:r)}function _n(e,t,n,r){var i=R();r=r===void 0?null:r;var a=i.memoizedState.inst;ed!==null&&r!==null&&Nt(r,ed.memoizedState.deps)?i.memoizedState=mn(t,a,n,r):($.flags|=e,i.memoizedState=mn(1|t,a,n,r))}function vn(e,t){gn(8390656,8,e,t)}function yn(e,t){_n(2048,8,e,t)}function bn(e){$.flags|=4;var t=$.updateQueue;if(t===null)t=Ht(),$.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function xn(e){var t=R().memoizedState;return bn({ref:t,nextImpl:e}),function(){if(Wd&2)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Sn(e,t){return _n(4,2,e,t)}function Cn(e,t){return _n(4,4,e,t)}function H(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function wn(e,t,n){n=n==null?null:n.concat([e]),_n(4,4,H.bind(null,t,e),n)}function Tn(){}function En(e,t){var n=R();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Nt(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Dn(e,t){var n=R();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Nt(t,r[1]))return r[0];if(r=e(),id){O(!0);try{e()}finally{O(!1)}}return n.memoizedState=[r,t],r}function On(e,t,n){return n===void 0||$u&1073741824&&!(qd&261930)?e.memoizedState=t:(e.memoizedState=n,e=fa(),$.lanes|=e,tf|=e,n)}function kn(e,t,n,r){return Wl(n,t)?n:Xu.current===null?!($u&106)||$u&1073741824&&!(qd&261930)?(hd=!0,e.memoizedState=n):(e=fa(),$.lanes|=e,tf|=e,t):(e=On(e,n,r),Wl(e,t)||(hd=!0),e)}function An(e,t,n,r,i){var a=cs();ss(a!==0&&8>a?a:8);var o=X.T,s={};s.types=o===null?null:o.types,X.T=s,zn(e,!1,t,n);try{var c=i(),l=X.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Rn(e,t,I(c,r),da(e)):Rn(e,t,r,da(e))}catch(n){Rn(e,t,{then:function(){},status:`rejected`,reason:n},da())}finally{ss(a),o!==null&&s.types!==null&&(o.types=s.types),X.T=o}}function jn(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:bs,baseState:bs,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:z,lastRenderedState:bs},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:z,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Mn(){return ke(xs)}function Nn(){return R().memoizedState}function Pn(){return R().memoizedState}function Fn(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=da();e=mt(n);var r=ht(t,e,n);r!==null&&(K(r,t,n),gt(r,t,n)),t={cache:Me()},e.payload=t;return}t=t.return}}function In(e,t,n){var r=da();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bn(e)?Vn(t,n):(n=ct(e,t,n,r),n!==null&&(K(n,e,r),Hn(n,t,r)))}function Ln(e,t,n){Rn(e,t,n,da())}function Rn(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bn(e))Vn(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Wl(s,o))return st(e,t,i,0),Gd===null&&ot(),!1}catch{}if(n=ct(e,t,i,r),n!==null)return K(n,e,r),Hn(n,t,r),!0}return!1}function zn(e,t,n,i){if(i={lane:2,revertLane:We(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Bn(e)){if(t)throw Error(r(479))}else t=ct(e,n,i,2),t!==null&&K(t,e,2)}function Bn(e){var t=e.alternate;return e===$||t!==null&&t===$}function Vn(e,t){rd=nd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Hn(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,E(e,n)}}function Un(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:_o({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}function Wn(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Xe(n,r)||!Xe(i,a):!0}function Gn(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&&pd.enqueueReplaceState(t,t.state,null)}function Kn(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=_o({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function qn(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Jn(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Yn(e,t,n){return n=mt(n),n.tag=3,n.payload={element:null},n.callback=function(){qn(e,t)},n}function Xn(e){return e=mt(e),e.tag=3,e}function Zn(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Jn(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Jn(t,n,r),typeof i!=`function`&&(mf===null?mf=new Set([this]):mf.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qn(e,t,n,i,a){if(n.flags|=32768,typeof i==`object`&&i&&typeof i.then==`function`){if(t=n.alternate,t!==null&&Ee(t,n,a,!0),n=Z.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Q===null?Ta():n.alternate===null&&ef===0&&(ef=3),n.flags&=-257,n.flags|=65536,n.lanes=a,i===zu?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),Ka(e,i,a)),!1;case 22:return n.flags|=65536,i===zu?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),Ka(e,i,a)),!1}throw Error(r(435,n.tag))}return Ka(e,i,a),Ta(),!1}if(fu)return t=Z.current,t===null?(i!==hu&&(t=Error(r(423),{cause:i}),Se(M(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,i=M(i,n),a=Yn(e.stateNode,i,a),_t(e,a),ef!==4&&(ef=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,i!==hu&&(e=Error(r(422),{cause:i}),Se(M(e,n)))),!1;var o=Error(r(520),{cause:i});if(o=M(o,n),sf===null?sf=[o]:sf.push(o),ef!==4&&(ef=2),t===null)return!0;i=M(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Yn(n.stateNode,i,e),_t(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(mf===null||!mf.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xn(a),Zn(a,e,n,i),_t(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}function $n(e,t,n,r){t.child=e===null?Wu(t,null,n,r):Uu(t,e.child,n,r)}function er(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Oe(t),r=Pt(e,t,n,o,a,i),s=Rt(),e!==null&&!hd?(zt(e,t,i),Er(e,t,i)):(fu&&s&&ue(t),t.flags|=1,$n(e,t,r,i),t.child)}function tr(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!$a(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,nr(e,t,a,r,i)):(e=no(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Dr(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Xe:n,n(o,r)&&e.ref===t.ref)return Er(e,t,i)}return t.flags|=1,e=eo(a,r),e.ref=t.ref,e.return=t,t.child=e}function nr(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Xe(a,r)&&e.ref===t.ref){if(hd=!1,t.pendingProps=r=a,Dr(e,i))e.flags&131072&&(hd=!0);else return t.lanes=e.lanes,Er(e,t,i)}}return ur(e,t,n,r,i)}function rr(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ar(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Je(t,a===null?null:a.cachePool),a===null?Ct():St(t,a),Et(t);else return r=t.lanes=536870912,ar(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Je(t,null),Ct(),Dt()):(Je(t,a.cachePool),St(t,a),Dt(),t.memoizedState=null);return $n(e,t,i,n),t.child}function ir(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ar(e,t,n,r,i){var a=qe();return a=a===null?null:{parent:ts?Su._currentValue:Su._currentValue2,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Je(t,null),Ct(),Et(t),e!==null&&Ee(e,t,r,!0),t.childLanes=i,null}function or(e,t){return t=vr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sr(e,t,n){return Uu(t,e.child,null,n),e=or(t,t.pendingProps),e.flags|=2,Ot(t),t.memoizedState=null,e}function cr(e,t,n){var i=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(fu){if(i.mode===`hidden`)return e=or(t,i),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},ir(null,e);if(Tt(t),(e=du)?(e=Pc(e,mu),e!==null&&(t.memoizedState={dehydrated:e,treeContext:ru===null?null:{id:iu,overflow:au},retryLane:536870912,hydrationErrors:null},n=ao(e),n.return=t,t.child=n,uu=t,du=null)):e=null,e===null)throw _e(t);return t.lanes=536870912,null}return or(t,i)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Tt(t),a){if(t.flags&256)t.flags&=-257,t=sr(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558))}else if(hd||Ee(e,t,n,!1),a=(n&e.childLanes)!==0,hd||a){if(Xu.current===null){if(i=Gd,i!==null&&(s=D(i,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,lt(e,s),K(i,e,s),md;Ta()}t=sr(e,t,n)}else e=o.treeContext,is&&(du=kc(s),uu=t,fu=!0,pu=null,mu=!1,e!==null&&fe(t,e)),t=or(t,i),t.flags|=134221824;return t}return e=eo(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lr(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(r(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ur(e,t,n,r,i){return Oe(t),n=Pt(e,t,n,r,void 0,i),r=Rt(),e!==null&&!hd?(zt(e,t,i),Er(e,t,i)):(fu&&r&&ue(t),t.flags|=1,$n(e,t,n,i),t.child)}function dr(e,t,n,r,i,a){return Oe(t),t.updateQueue=null,n=It(t,r,n,i),Ft(e),r=Rt(),e!==null&&!hd?(zt(e,t,a),Er(e,t,a)):(fu&&r&&ue(t),t.flags|=1,$n(e,t,n,a),t.child)}function fr(e,t,n,r,i){if(Oe(t),t.stateNode===null){var a=Cl,o=n.contextType;typeof o==`object`&&o&&(a=ke(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=pd,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ft(t),o=n.contextType,a.context=typeof o==`object`&&o?ke(o):Cl,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Un(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&pd.enqueueReplaceState(a,a.state,null),yt(t,r,a,i),vt(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Kn(n,s);a.props=c;var l=a.context,u=n.contextType;o=Cl,typeof u==`object`&&u&&(o=ke(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Gn(t,a,r,o),Ju=!1;var f=t.memoizedState;a.state=f,yt(t,r,a,i),vt(),l=t.memoizedState,s||f!==l||Ju?(typeof d==`function`&&(Un(t,n,d,r),l=t.memoizedState),(c=Ju||Wn(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,pt(e,t),o=t.memoizedProps,u=Kn(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Cl,typeof l==`object`&&l&&(c=ke(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Gn(t,a,r,c),Ju=!1,f=t.memoizedState,a.state=f,yt(t,r,a,i),vt();var p=t.memoizedState;o!==d||f!==p||Ju||e!==null&&e.dependencies!==null&&De(e.dependencies)?(typeof s==`function`&&(Un(t,n,s,r),p=t.memoizedState),(u=Ju||Wn(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&De(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,lr(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Uu(t,e.child,null,i),t.child=Uu(t,null,n,i)):$n(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Er(e,t,i),e}function pr(e,t,n,r){return be(),t.flags|=256,$n(e,t,n,r),t.child}function mr(e){return{baseLanes:e,cachePool:Ye()}}function hr(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=af),e}function gr(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Qu.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(fu){if(i?wt(t):Dt(),(e=du)?(e=Fc(e,mu),e!==null&&(t.memoizedState={dehydrated:e,treeContext:ru===null?null:{id:iu,overflow:au},retryLane:536870912,hydrationErrors:null},n=ao(e),n.return=t,t.child=n,uu=t,du=null)):e=null,e===null)throw _e(t);return t.lanes=bc(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Dt(),i=t.mode,a=vr({mode:`hidden`,children:a},i),r=ro(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=mr(n),r.childLanes=hr(e,o,n),t.memoizedState=gd,ir(null,r)):(wt(t),_r(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return br(e,t,a,o,r,c,s,n)}return i?(Dt(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=eo(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=ro(i,a,n,null),i.flags|=2):i=eo(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,ir(null,r),r=t.child,i=e.child.memoizedState,i===null?i=mr(n):(a=i.cachePool,a===null?a=Ye():(s=ts?Su._currentValue:Su._currentValue2,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=hr(e,o,n),t.memoizedState=gd,ir(e.child,r)):(wt(t),n=e.child,e=n.sibling,n=eo(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function _r(e,t){return t=vr({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function vr(e,n){return e=t(22,e,null,n),e.lanes=0,e}function yr(e,t,n){return Uu(t,e.child,null,n),e=_r(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function br(e,t,n,i,a,o,s,c){if(n)return t.flags&256?(wt(t),t.flags&=-257,yr(e,t,c)):t.memoizedState===null?(Dt(),o=a.fallback,s=t.mode,a=vr({mode:`visible`,children:a.children},s),o=ro(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,Uu(t,e.child,null,c),a=t.child,a.memoizedState=mr(c),a.childLanes=hr(e,i,c),t.memoizedState=gd,ir(null,a)):(Dt(),t.child=e.child,t.flags|=128,null);if(wt(t),bc(o))return i=xc(o).digest,i!==``&&(a=Error(r(419)),a.stack=``,a.digest=i,Se({value:a,source:null,stack:null})),yr(e,t,c);if(hd||Ee(e,t,c,!1),i=(c&e.childLanes)!==0,hd||i){if(Xu.current!==null)return yr(e,t,c);if(i=Gd,i!==null&&(a=D(i,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,lt(e,a),K(i,e,a),md;return yc(o)||Ta(),yr(e,t,c)}return yc(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,is&&(du=Ac(o),uu=t,fu=!0,pu=null,mu=!1,e!==null&&fe(t,e)),t=_r(t,a.children),t.flags|=134221824,t)}function xr(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),we(e.return,t,n)}function Sr(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&jt(n)===null&&(t=e),e=e.sibling}return t}function Cr(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function wr(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function Tr(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Qu.current;if(t.flags&128)return kt(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,kt(t,o),i===`backwards`&&e!==null?(wr(e),$n(e,t,r,n),wr(e)):$n(e,t,r,n),r=fu?eu:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xr(e,n,t);else if(e.tag===19)xr(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=Sr(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,wr(t)),Cr(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&jt(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cr(t,!0,n,null,a,r);break;case`together`:Cr(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Sr(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cr(t,!1,i,n,a,r)}return t.child}function U(e,t,n){var r=t.pendingProps;return Ce(t,t.type,r.value),$n(e,t,r.children,n),t.child}function Er(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),tf|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ee(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=eo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=eo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dr(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&De(e)))}function Or(e,t,n){switch(t.tag){case 3:pe(t,t.stateNode.containerInfo),Ce(t,Su,e.memoizedState.cache),be();break;case 27:case 5:he(t);break;case 4:pe(t,t.stateNode.containerInfo);break;case 10:Ce(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Tt(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return wt(t),t.flags|=128,null;r=Ee(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?gr(e,t,n):(wt(t),e=Er(e,t,n),e===null?null:e.sibling)}wt(t);break;case 19:if(t.flags&128)return Tr(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ee(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Tr(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),kt(t,Qu.current),r)break;return null;case 22:return t.lanes=0,rr(e,t,n,t.pendingProps);case 24:Ce(t,Su,e.memoizedState.cache)}return Er(e,t,n)}function kr(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)hd=!0;else{if(!Dr(e,n)&&!(t.flags&128))return hd=!1,Or(e,t,n);hd=!!(e.flags&131072)}}else hd=!1,fu&&t.flags&1048576&&le(t,eu,t.index);switch(t.lanes=0,t.tag){case 16:a:{var i=t.pendingProps;if(e=$e(t.elementType),t.type=e,typeof e==`function`)$a(e)?(i=Kn(e,i),t.tag=1,t=fr(null,t,e,i,n)):(t.tag=0,t=ur(null,t,e,i,n));else{if(e!=null){var a=e.$$typeof;if(a===Eo){t.tag=11,t=er(null,t,e,i,n);break a}if(a===ko){t.tag=14,t=tr(null,t,e,i,n);break a}if(a===To){t.tag=10,t.type=e,t=U(null,t,n);break a}}throw t=u(e)||e,Error(r(306,t,``))}}return t;case 0:return ur(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,a=Kn(i,t.pendingProps),fr(e,t,i,a,n);case 3:a:{if(pe(t,t.stateNode.containerInfo),e===null)throw Error(r(387));var o=t.pendingProps;a=t.memoizedState,i=a.element,pt(e,t),yt(t,o,null,n);var s=t.memoizedState;if(o=s.cache,Ce(t,Su,o),o!==a.cache&&Te(t,[Su],n,!0),vt(),o=s.element,is&&a.isDehydrated){if(a={element:o,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=pr(e,t,o,n);break a}if(o!==i){i=M(Error(r(424)),t),Se(i),t=pr(e,t,o,n);break a}for(is&&(du=Oc(t.stateNode.containerInfo),uu=t,fu=!0,pu=null,mu=!0),n=Wu(t,null,o,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(be(),o===i){t=Er(e,t,n);break a}$n(e,t,o,n)}t=t.child}return t;case 26:if(tl)return lr(e,t),e===null?(n=il(t.type,null,t.pendingProps,null))?t.memoizedState=n:fu||(t.stateNode=ul(t.type,t.pendingProps,cu.current,t)):t.memoizedState=il(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:if(hl)return he(t),e===null&&hl&&fu&&(i=t.stateNode=gl(t.type,t.pendingProps,cu.current,ou.current,!1),uu=t,mu=!0,du=jc(t.type,i,du)),$n(e,t,t.pendingProps.children,n),lr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&fu&&($c(t.type,t.pendingProps,ou.current),(a=i=du)&&(i=Mc(i,t.type,t.pendingProps,mu),i===null?a=!1:(t.stateNode=i,uu=t,du=Dc(i),mu=!1,a=!0)),a||_e(t)),he(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,i=o.children,Xo(a,o)?i=null:s!==null&&Xo(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Pt(e,t,Lt,null,null,n),ts?xs._currentValue=a:xs._currentValue2=a),lr(e,t),$n(e,t,i,n),t.child;case 6:return e===null&&fu&&(el(t.pendingProps,ou.current),(e=n=du)&&(n=Nc(n,t.pendingProps,mu),n===null?e=!1:(t.stateNode=n,uu=t,du=null,e=!0)),e||_e(t)),null;case 13:return gr(e,t,n);case 4:return pe(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Uu(t,null,i,n):$n(e,t,i,n),t.child;case 11:return er(e,t,t.type,t.pendingProps,n);case 7:return i=t.pendingProps,lr(e,t),$n(e,t,i,n),t.child;case 8:return $n(e,t,t.pendingProps.children,n),t.child;case 12:return $n(e,t,t.pendingProps.children,n),t.child;case 10:return U(e,t,n);case 9:return a=t.type._context,i=t.pendingProps.children,Oe(t),a=ke(a),i=i(a),t.flags|=1,$n(e,t,i,n),t.child;case 14:return tr(e,t,t.type,t.pendingProps,n);case 15:return nr(e,t,t.type,t.pendingProps,n);case 19:return Tr(e,t,n);case 31:return cr(e,t,n);case 22:return rr(e,t,n,t.pendingProps);case 24:return Oe(t),i=ke(Su),e===null?(a=qe(),a===null&&(a=Gd,o=Me(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:i,cache:a},ft(t),Ce(t,Su,a)):((e.lanes&n)!==0&&(pt(e,t),yt(t,null,null,n),vt()),a=e.memoizedState,o=t.memoizedState,a.parent===i?(i=o.cache,Ce(t,Su,i),i!==a.cache&&Te(t,[Su],n,!0)):(a={parent:i,cache:i},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ce(t,Su,i))),$n(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),i=t.pendingProps,i.name!=null&&i.name!==`auto`?t.flags|=e===null?18882560:18874368:fu&&ue(t),e!==null&&e.memoizedProps.name!==i.name?t.flags|=4194816:lr(e,t),$n(e,t,i.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function Ar(e){e.flags|=4}function jr(e){rs&&(e.flags|=8)}function Mr(e,t){if(e!==null&&e.child===t.child)return!1;if(t.flags&16)return!0;for(e=t.child;e!==null;){if(e.flags&8218||e.subtreeFlags&8218)return!0;e=e.sibling}return!1}function Nr(e,t,n,r){if(ns)for(n=t.child;n!==null;){if(n.tag===5||n.tag===6)Jo(e,n.stateNode);else if(!(n.tag===4||hl&&n.tag===27)&&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}else if(rs)for(var i=t.child;i!==null;){if(i.tag===5){var a=i.stateNode;n&&r&&(a=_c(a,i.type,i.memoizedProps)),Jo(e,a)}else if(i.tag===6)a=i.stateNode,n&&r&&(a=vc(a,i.memoizedProps)),Jo(e,a);else if(i.tag!==4){if(i.tag===22&&i.memoizedState!==null)a=i.child,a!==null&&(a.return=i),Nr(e,i,!0,!0);else if(i.child!==null){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}}function Pr(e,t,n,r){var i=!1;if(rs)for(var a=t.child;a!==null;){if(a.tag===5){var o=a.stateNode;n&&r&&(o=_c(o,a.type,a.memoizedProps)),mc(e,o)}else if(a.tag===6)o=a.stateNode,n&&r&&(o=vc(o,a.memoizedProps)),mc(e,o);else if(a.tag!==4){if(a.tag===22&&a.memoizedState!==null)i=a.child,i!==null&&(i.return=a),Pr(e,a,!0,!0),i=!0;else if(a.child!==null){a.child.return=a,a=a.child;continue}}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return i;a=a.return}a.sibling.return=a.return,a=a.sibling}return i}function Fr(e,t){if(rs&&Mr(e,t)){e=t.stateNode;var n=e.containerInfo,r=pc();Pr(r,t,!1,!1),e.pendingChildren=r,Ar(t),hc(n,r)}}function Ir(e,t,n,r){if(ns)e.memoizedProps!==r&&Ar(t);else if(rs){var i=e.stateNode,a=e.memoizedProps;if((e=Mr(e,t))||a!==r){var o=ou.current;a=fc(i,n,a,r,!e,null),a===i?t.stateNode=i:(jr(t),Yo(a,n,r,o)&&Ar(t),t.stateNode=a,e&&Nr(a,t,!1,!1))}else t.stateNode=i}}function Lr(e,t,n,r,i){if(e.mode&32&&(n===null?fs(t,r):ps(t,n,r))){if(e.flags|=16777216,(i&335544128)===i||ms(t,r)){if(hs(e.stateNode,t,r))e.flags|=8192;else if(Sa())e.flags|=8192;else throw Bu=zu,Lu}}else e.flags&=-16777217}function Rr(e,t){if(fl(t)){if(e.flags|=16777216,!pl(t)){if(Sa())e.flags|=8192;else throw Bu=zu,Lu}}else e.flags&=-16777217}function zr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:S(),e.lanes|=t,of|=t)}function Br(e,t){if(!fu)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function Vr(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Hr(e,t,n){var i=t.pendingProps;switch(de(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vr(t),null;case 1:return Vr(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),P(Su),me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ye(t)?Ar(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xe())),Fr(e,t),Vr(t),null;case 26:if(tl){var a=t.type,o=t.memoizedState;return e===null?(Ar(t),o===null?(Vr(t),Lr(t,a,null,i,n)):(Vr(t),Rr(t,o))):o?o===e.memoizedState?(Vr(t),t.flags&=-16777217):(Ar(t),Vr(t),Rr(t,o)):(o=e.memoizedProps,ns?o!==i&&Ar(t):Ir(e,t,a,i),Vr(t),Lr(t,a,o,i,n)),null}case 27:if(hl){if(ge(t),n=cu.current,a=t.type,e!==null&&t.stateNode!=null)ns?e.memoizedProps!==i&&Ar(t):Ir(e,t,a,i);else{if(!i){if(t.stateNode===null)throw Error(r(166));return Vr(t),t.subtreeFlags&=-33554433,null}e=ou.current,ye(t)?N(t,e):(e=gl(a,i,n,e,!0),t.stateNode=e,Ar(t))}return Vr(t),t.subtreeFlags&=-33554433,null}case 5:if(ge(t),a=t.type,e!==null&&t.stateNode!=null)Ir(e,t,a,i);else{if(!i){if(t.stateNode===null)throw Error(r(166));return Vr(t),t.subtreeFlags&=-33554433,null}if(o=ou.current,ye(t))N(t,o),Kc(t.stateNode,a,i,o)&&(t.flags|=64);else{var s=qo(a,i,cu.current,o,t);jr(t),Nr(s,t,!1,!1),t.stateNode=s,Yo(s,a,i,o)&&Ar(t)}}return Vr(t),t.subtreeFlags&=-33554433,Lr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)n=e.memoizedProps,ns?n!==i&&Ar(t):rs&&(n===i?t.stateNode=e.stateNode:(e=cu.current,n=ou.current,jr(t),t.stateNode=Zo(i,e,n,t)));else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(e=cu.current,n=ou.current,ye(t)){if(!is)throw Error(r(176));if(e=t.stateNode,n=t.memoizedProps,i=null,a=uu,a!==null)switch(a.tag){case 27:case 5:i=a.memoizedProps}Lc(e,n,t,i)||_e(t,!0)}else jr(t),t.stateNode=Zo(i,e,n,t)}return Vr(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=ye(t),n!==null){if(e===null){if(!i)throw Error(r(318));if(!is)throw Error(r(556));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(557));Rc(e,t)}else be(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vr(t),e=!1}else n=xe(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ot(t),t):(Ot(t),null);if(t.flags&128)throw Error(r(558))}return Vr(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ye(t),i!==null&&i.dehydrated!==null){if(e===null){if(!a)throw Error(r(318));if(!is)throw Error(r(344));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(r(317));zc(a,t)}else be(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vr(t),a=!1}else a=xe(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ot(t),t):(Ot(t),null)}return Ot(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,a=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(a=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==a&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),zr(t,t.updateQueue),Vr(t),null);case 4:return me(),Fr(e,t),e===null&&os(t.stateNode.containerInfo),t.flags|=67108864,Vr(t),null;case 10:return P(t.type),Vr(t),null;case 19:if(At(t),i=t.memoizedState,i===null)return Vr(t),null;if(a=!!(t.flags&128),o=i.rendering,o===null){if(a)Br(i,!1);else{if(ef!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=jt(e),o!==null){for(t.flags|=128,Br(i,!1),e=o.updateQueue,t.updateQueue=e,zr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)to(n,e),n=n.sibling;return kt(t,Qu.current&1|2),fu&&ce(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Pl()>ff&&(t.flags|=128,a=!0,Br(i,!1),t.lanes=4194304)}}else{if(!a){if(e=jt(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,zr(t,e),Br(i,!0),i.tail===null&&i.tailMode!==`collapsed`&&i.tailMode!==`visible`&&!o.alternate&&!fu)return Vr(t),null}else 2*Pl()-i.renderingStartTime>ff&&n!==536870912&&(t.flags|=128,a=!0,Br(i,!1),t.lanes=4194304)}i.isBackwards?(o.sibling=t.child,t.child=o):(e=i.last,e===null?t.child=o:e.sibling=o,i.last=o)}if(i.tail!==null){e=i.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Pl(),e.sibling=null,o=Qu.current,o=a?o&1|2:o&1,i.tailMode===`visible`||i.tailMode===`collapsed`||!n||fu?kt(t,o):(n=o,h(Z,t),h(Qu,n),Q===null&&(Q=t)),fu&&ce(t,i.treeForkCount),e}return Vr(t),null;case 22:case 23:return Ot(t),L(),i=t.memoizedState!==null,e===null?i&&(t.flags|=8192):e.memoizedState!==null!==i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Vr(t),t.subtreeFlags&6&&(t.flags|=8192)):Vr(t),n=t.updateQueue,n!==null&&zr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&m(Fu),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),P(Su),Vr(t),null;case 25:return null;case 30:return t.flags|=33554432,Vr(t),null}throw Error(r(156,t.tag))}function Ur(e,t){switch(de(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return P(Su),me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ge(t),null;case 31:if(t.memoizedState!==null){if(Ot(t),t.alternate===null)throw Error(r(340));be()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ot(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));be()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return At(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return me(),null;case 10:return P(t.type),null;case 22:case 23:return Ot(t),L(),e!==null&&m(Fu),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return P(Su),null;case 25:return null;default:return null}}function Wr(e,t){switch(de(t),t.tag){case 3:P(Su),me();break;case 26:case 27:case 5:ge(t);break;case 4:me();break;case 31:t.memoizedState!==null&&Ot(t);break;case 13:Ot(t);break;case 19:At(t);break;case 10:P(t.type);break;case 22:case 23:Ot(t),L(),e!==null&&m(Fu);break;case 24:P(Su)}}function Gr(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ga(t,t.return,e)}}function Kr(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ga(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ga(t,t.return,e)}}function qr(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xt(t,n)}catch(t){Ga(e,e.return,t)}}}function Jr(e,t,n){n.props=Kn(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ga(e,t,n)}}function Yr(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=Ho(e.stateNode);break;case 30:var i=e.stateNode,a=re(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=oc(a)),r=i.ref;break;case 7:e.stateNode===null&&(e.stateNode=cc(e)),r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ga(e,t,n)}}function Xr(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ga(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ga(e,t,n)}else n.current=null}}function Zr(){var e=_d;return _d=!1,e}function Qr(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)uc(e.stateNode,t[n])}function $r(e){for(var t=e.return;t!==null&&(ni(t)&&uc(e.stateNode,t.stateNode),!ti(t));)t=t.return}function ei(e){for(var t=e.return;t!==null&&(ni(t)&&dc(e.stateNode,t.stateNode),!ti(t));)t=t.return}function ti(e){return e.tag===5||e.tag===3||(hl?e.tag===27:!1)}function ni(e){return e&&e.tag===7&&e.stateNode!==null}function ri(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{Is(r,t,n,e)}catch(t){Ga(e,e.return,t)}}function ii(e,t,n){try{Ls(e.stateNode,e.type,n,t,e)}catch(t){Ga(e,e.return,t)}}function ai(e){return e.tag===5||e.tag===3||(tl?e.tag===26:!1)||(hl?e.tag===27&&bl(e.type):!1)||e.tag===4}function oi(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||ai(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(hl&&e.tag===27&&bl(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function si(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?zs(n,i,t):Ps(n,i),Qr(e,r),_d=!0;else if(i!==4&&(hl&&i===27&&(Qr(e,r),r=null,bl(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(si(e,t,n,r),e=e.sibling;e!==null;)si(e,t,n,r),e=e.sibling}function ci(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?Rs(n,i,t):Ns(n,i),Qr(e,r),_d=!0;else if(i!==4&&(hl&&i===27&&(Qr(e,r),r=null,bl(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(ci(e,t,n,r),e=e.sibling;e!==null;)ci(e,t,n,r),e=e.sibling}function li(e,t){if(e.tag===5||hl&&e.tag===27)Qr(e,t);else if(e.tag!==4&&(e=e.child,e!==null))for(li(e,t),e=e.sibling;e!==null;)li(e,t),e=e.sibling}function ui(e,t,n){e=e.containerInfo;try{gc(e,n)}catch(e){Ga(t,t.return,e)}}function di(e){var t=e.stateNode,n=e.memoizedProps;try{_l(e.type,n,t,e)}catch(t){Ga(e,e.return,t)}}function fi(e){(e.tag===30||e.subtreeFlags&33554432)&&(vd=!0)}function pi(){var e=bd;return bd=null,e}function mi(e,t,n,r,i){return xd=0,hi(e.child,t,n,r,i)}function hi(e,t,n,r,i){if(!ns)return!1;for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Qs(o);r.push(s),ec(s)&&(a=!0)}else a||ec(Qs(o))&&(a=!0);vd=!0,qs(o,xd===0?t:t+`_`+xd,n),xd++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||hi(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function gi(e,t){if(ns)for(;e!==null;)e.tag===5?Js(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||gi(e.child,t)),e=e.sibling}function _i(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(_i(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(r(544));var n=t.name;t=A(t.default,t.share),t!==`none`&&(mi(e,n,t,null,!1)||gi(e.child,!1))}e=e.sibling}}function vi(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=re(r,n),a=A(r.default,n.paired?r.share:r.enter);a===`none`?_i(e):mi(e,i,a,null,!1)?(_i(e),n.paired||t||pa(e,r.onEnter)):gi(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)vi(e,t),e=e.sibling;else _i(e)}function yi(e){if(yd!==null&&yd.size!==0){var t=yd;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=A(n.default,n.share);if(a!==`none`&&(mi(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,pa(e,n.onShare)):gi(e.child,!1)),t.delete(r),t.size===0)break}}}yi(e)}e=e.sibling}}}function bi(e){if(e.tag===30){var t=e.memoizedProps,n=re(t,e.stateNode),r=yd===null?void 0:yd.get(n),i=A(t.default,r===void 0?t.exit:t.share);i!==`none`&&(mi(e,n,i,null,!1)?r===void 0?pa(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,yd.delete(n),pa(e,t.onShare)):gi(e.child,!1)),yd!==null&&yi(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)bi(e),e=e.sibling;else yd!==null&&yi(e)}function xi(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=re(t,e.stateNode);t=A(t.default,t.update),e.flags&=-5,t!==`none`&&mi(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&xi(e);e=e.sibling}}function Si(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,gi(e.child,!1))}Si(e)}e=e.sibling}}function Ci(e){if(e.tag===30)e.stateNode.paired=null,gi(e.child,!1),Si(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ci(e),e=e.sibling;else Si(e)}function wi(e){for(e=e.child;e!==null;)e.tag===30?gi(e.child,!1):e.subtreeFlags&33554432&&wi(e),e=e.sibling}function Ti(e,t,n,r,i,a,o){if(!ns)return!1;for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&xd<a.length){var l=a[xd],u=Qs(c);(ec(l)||ec(u))&&(s=!0),!(e.flags&4)&&tc(l,u)&&(e.flags|=4),nc(l,u)&&(e.flags|=32)}else e.flags|=32;e.flags&4&&qs(c,xd===0?n:n+`_`+xd,i),s&&e.flags&4||(bd===null&&(bd=[]),bd.push(c,xd===0?r:r+`_`+xd,t.memoizedProps)),xd++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Ti(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Ei(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=re(n,r),a=A(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map($s)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;xd=0,i=Ti(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||pa(e,n.onUpdate))}else e.subtreeFlags&33554432&&Ei(e,t);e=e.sibling}}function Di(e,t,n){for(Go(e.containerInfo),e=(n&335544064)===n,Dd=t,t=e?9270:1024;Dd!==null;){if(n=Dd,e){var r=n.deletions;if(r!==null)for(var i=0;i<r.length;i++)e&&bi(r[i])}if(n.alternate===null&&n.flags&2)e&&fi(n),Oi(e);else{if(n.tag===22){if(r=n.alternate,n.memoizedState!==null){r!==null&&r.memoizedState===null&&e&&bi(r),Oi(e);continue}if(r!==null&&r.memoizedState!==null){e&&fi(n),Oi(e);continue}}r=n.child,(n.subtreeFlags&t)!==0&&r!==null?(r.return=n,Dd=r):(e&&xi(n),Oi(e))}}yd=null}function Oi(e){for(;Dd!==null;){var t=Dd,n=e,i=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&i!==null){n=void 0,a=i.memoizedProps,i=i.memoizedState;var o=t.stateNode;try{var s=Kn(t.type,a);n=o.getSnapshotBeforeUpdate(s,i),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Ga(t,t.return,e)}}break;case 3:a&1024&&ns&&sc(t.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&i!==null&&(n=re(i.memoizedProps,i.stateNode),a=t.memoizedProps,a=A(a.default,a.update),a!==`none`&&mi(i,n,a,i.memoizedState=[],!0));break;default:if(a&1024)throw Error(r(163))}if(i=t.sibling,i!==null){i.return=t.return,Dd=i;break}Dd=t.return}}function ki(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ki(e,n),r&4&&Gr(5,n);break;case 1:if(Ki(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ga(n,n.return,e)}else{var i=Kn(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ga(n,n.return,e)}}}r&64&&qr(n),r&512&&Yr(n,n.return);break;case 3:if(Ki(e,n),r&64&&(r=n.updateQueue,r!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=Ho(n.child.stateNode);break;case 1:e=n.child.stateNode}try{xt(r,e)}catch(e){Ga(n,n.return,e)}}break;case 27:hl&&t===null&&r&4&&di(n);case 26:case 5:if(Ki(e,n),t===null){if(r&4)ri(n);else if(r&64){e=n.type,t=n.memoizedProps,i=n.stateNode;try{Hc(i,e,t,n)}catch(e){Ga(n,n.return,e)}}}r&512&&Yr(n,n.return);break;case 12:Ki(e,n);break;case 31:Ki(e,n),r&4&&Ii(e,n);break;case 13:Ki(e,n),r&4&&Li(e,n),r&64&&(r=n.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(n=Ya.bind(null,n),Sc(r,n))));break;case 22:if(r=n.memoizedState!==null||Sd,!r){var a=t!==null&&t.memoizedState!==null||Cd;t=Sd,i=Cd,Sd=r,(Cd=a)&&!i?(r=hl?2:0,n.subtreeFlags&8772&&(r|=1),Ji(e,n,r)):Ki(e,n),Sd=t,Cd=i}break;case 30:Ki(e,n),r&512&&Yr(n,n.return);break;case 7:r&512&&Yr(n,n.return);default:Ki(e,n)}}function Ai(e,t){if(ns)for(e=e.child;e!==null;)ji(e,t),e=e.sibling}function ji(e,t){if(ns)switch(e.tag){case 5:case 26:try{var n=e.stateNode;t?Us(n):Gs(e.stateNode,e.memoizedProps)}catch(t){Ga(e,e.return,t)}Mi(e,t);break;case 6:try{var r=e.stateNode;t?Ws(r):Ks(r,e.memoizedProps),_d=!0}catch(t){Ga(e,e.return,t)}break;case 18:try{var i=e.stateNode;t?Xc(i):Zc(e.stateNode)}catch(t){Ga(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Ai(e,t);break;default:Ai(e,t)}}function Mi(e,t){if(ns&&e.subtreeFlags&67108864)for(e=e.child;e!==null;){var n=e,r=t;if(ns)switch(n.tag){case 4:ji(n,r);break;case 22:n.memoizedState===null&&Mi(n,r);break;default:Mi(n,r)}e=e.sibling}}function Ni(e){var t=e.alternate;t!==null&&(e.alternate=null,Ni(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ds(t)),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 Pi(e,t,n){for(n=n.child;n!==null;)Fi(e,t,n),n=n.sibling}function Fi(e,t,n){if(Hl&&typeof Hl.onCommitFiberUnmount==`function`)try{Hl.onCommitFiberUnmount(Vl,n)}catch{}switch(n.tag){case 26:if(tl){Cd||Xr(n,t),Pi(e,t,n),n.memoizedState?ol(n.memoizedState):n.stateNode&&(Cd||ll(n.stateNode));break}case 27:if(hl){Cd||Xr(n,t),ei(n);var r=Md,i=Nd;bl(n.type)&&(Md=n.stateNode,Nd=!1),Pi(e,t,n),vl(n.stateNode,n.type,n.memoizedProps),Md=r,Nd=i;break}case 5:Cd||Xr(n,t),ei(n);case 6:if(n.tag===6&&ei(n),ns){if(r=Md,i=Nd,Md=null,Pi(e,t,n),Md=r,Nd=i,Md!==null){if(Nd)try{Vs(Md,n.stateNode),_d=!0}catch(e){Ga(n,t,e)}else try{Bs(Md,n.stateNode),_d=!0}catch(e){Ga(n,t,e)}}}else Pi(e,t,n);break;case 18:ns&&Md!==null&&(Nd?Yc(Md,n.stateNode):Jc(Md,n.stateNode));break;case 4:ns?(r=Md,i=Nd,Md=n.stateNode.containerInfo,Nd=!0,Pi(e,t,n),Md=r,Nd=i):(rs&&ui(n.stateNode,n,pc()),Pi(e,t,n));break;case 0:case 11:case 14:case 15:Kr(2,n,t),Cd||Kr(4,n,t),Pi(e,t,n);break;case 1:Cd||(Xr(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Jr(n,t,r)),Pi(e,t,n);break;case 21:Pi(e,t,n);break;case 22:Cd=(r=Cd)||n.memoizedState!==null,Pi(e,t,n),Cd=r;break;case 30:Xr(n,t),Pi(e,t,n);break;case 7:Cd||Xr(n,t),Pi(e,t,n);break;default:Pi(e,t,n)}}function Ii(e,t){if(is&&t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wc(e)}catch(e){Ga(t,t.return,e)}}}function Li(e,t){if(is&&t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gc(e)}catch(e){Ga(t,t.return,e)}}function Ri(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ed),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ed),t;default:throw Error(r(435,e.tag))}}function zi(e,t){var n=Ri(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Xa.bind(null,e,t);t.then(r,r)}})}function Bi(e,t,n){var i=t.deletions;if(i!==null)for(var a=0;a<i.length;a++){var o=i[a],s=e,c=t;if(ns){var l=c;a:for(;l!==null;){switch(l.tag){case 27:if(hl){if(bl(l.type)){Md=l.stateNode,Nd=!1;break a}break}case 5:Md=l.stateNode,Nd=!1;break a;case 3:case 4:Md=l.stateNode.containerInfo,Nd=!0;break a}l=l.return}if(Md===null)throw Error(r(160));Fi(s,c,o),Md=null,Nd=!1}else Fi(s,c,o);s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Vi(t,e,n),t=t.sibling}function Vi(e,t,n){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(i=e.updateQueue,i=i===null?null:i.events,i!==null))for(var o=0;o<i.length;o++){var s=i[o];s.ref.impl=s.nextImpl}Bi(t,e,n),Hi(e),a&4&&(Kr(3,e,e.return),Gr(3,e),Kr(5,e,e.return));break;case 1:Bi(t,e,n),Hi(e),a&512&&(Cd||i===null||Xr(i,i.return)),a&64&&Sd&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?t:a.concat(t))));break;case 26:if(tl){o=Pd,Bi(t,e,n),Hi(e),a&512&&(Cd||i===null||Xr(i,i.return)),a&4&&(n=i===null?null:i.memoizedState,a=e.memoizedState,i===null?a===null?e.stateNode===null?e.stateNode=Sd?ul(e.type,e.memoizedProps,t.containerInfo,e):sl(o,e.type,e.memoizedProps,e):Sd||cl(o,e.type,e.stateNode):e.stateNode=al(o,a,e.memoizedProps):n===a?a===null&&e.stateNode!==null&&ii(e,e.memoizedProps,i.memoizedProps):(n===null?(t=i.stateNode,t===null||Cd||ll(t)):ol(n),a===null?Sd||cl(o,e.type,e.stateNode):al(o,a,e.memoizedProps)));break}case 27:if(hl){Bi(t,e,n),Hi(e),a&512&&(Cd||i===null||Xr(i,i.return)),i!==null&&a&4&&ii(e,e.memoizedProps,i.memoizedProps);break}case 5:if(o=wd,wd=!1,Bi(t,e,n),wd=o,Hi(e),a&512&&(Cd||i===null||Xr(i,i.return)),ns){if(e.flags&32){t=e.stateNode;try{Hs(t),_d=!0}catch(t){Ga(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,ii(e,t,i===null?t:i.memoizedProps)),a&1024&&(Td=!0)}else rs&&e.alternate!==null&&(e.alternate.stateNode=e.stateNode);break;case 6:if(Bi(t,e,n),Hi(e),a&4&&ns){if(e.stateNode===null)throw Error(r(162));t=e.memoizedProps,a=i===null?t:i.memoizedProps,n=e.stateNode;try{Fs(n,a,t),_d=!0}catch(t){Ga(e,e.return,t)}}break;case 3:if(_d=!1,tl?(dl(),o=Pd,Pd=rl(t.containerInfo),Bi(t,e,n),Pd=o):Bi(t,e,n),Hi(e),a&4){if(ns&&is&&i!==null&&i.memoizedState.isDehydrated)try{Uc(t.containerInfo)}catch(t){Ga(e,e.return,t)}if(rs){a=t.containerInfo,t=t.pendingChildren;try{gc(a,t),_d=!0}catch(t){Ga(e,e.return,t)}}}Td&&(Td=!1,Ui(e)),_d=!1;break;case 4:i=wd,wd=Sd,o=Zr(),tl?(s=Pd,Pd=rl(e.stateNode.containerInfo),Bi(t,e,n),Hi(e),Pd=s):(Bi(t,e,n),Hi(e)),_d&&kd&&(Ad=!0),_d=o,wd=i,a&4&&rs&&ui(e.stateNode,e,e.stateNode.pendingChildren);break;case 12:Bi(t,e,n),Hi(e);break;case 31:Bi(t,e,n),Hi(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,zi(e,t)));break;case 13:Bi(t,e,n),Hi(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(uf=Pl()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,zi(e,t)));break;case 22:o=e.memoizedState!==null,s=i!==null&&i.memoizedState!==null;var c=Sd,l=Cd,u=wd;Sd=c||o,wd=u||o,Cd=l||s,Bi(t,e,n),Cd=l,wd=u,Sd=c,Hi(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||i===null||s||Sd||Cd||(t=hl?2:0,n=s||Cd,i=Sd,s=Cd,Sd=o||Sd,Cd=n,qi(e,t),Sd=i,Cd=s),ns&&(o||!wd)&&Ai(e,o)),a&4&&(t=e.updateQueue,t!==null&&(a=t.retryQueue,a!==null&&(t.retryQueue=null,zi(e,a))));break;case 19:Bi(t,e,n),Hi(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,zi(e,t)));break;case 30:a&512&&(Cd||i===null||Xr(i,i.return)),a=Zr(),o=kd,s=(n&335544064)===n,c=e.memoizedProps,kd=s&&A(c.default,c.update)!==`none`,Bi(t,e,n),Hi(e),s&&i!==null&&_d&&(e.flags|=4),kd=o,_d=a;break;case 21:break;case 7:a&512&&(Cd||i===null||Xr(i,i.return)),i&&i.stateNode!==null&&lc(e,i.stateNode);default:Bi(t,e,n),Hi(e)}}function Hi(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(ai(i)){n=i;break}i=i.return}i=null;for(var a=e.return;a!==null;){if(ni(a)){var o=a.stateNode;i===null?i=[o]:i.push(o)}if(ti(a))break;a=a.return}var s=i;if(ns){if(n==null)throw Error(r(160));switch(n.tag){case 27:if(hl){var c=n.stateNode;ci(e,oi(e),c,s);break}case 5:var l=n.stateNode;n.flags&32&&(Hs(l),n.flags&=-33),ci(e,oi(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;si(e,oi(e),u,s);break;default:throw Error(r(161))}}else li(e,s)}catch(t){Ga(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ui(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ui(t),t.tag===5&&t.flags&1024&&Ss(t.stateNode),e=e.sibling}}function Wi(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Gi(t,e),t=t.sibling;else Ei(t,!1)}function Gi(e,t){var n=e.alternate;if(n===null)vi(e,!1);else switch(e.tag){case 3:if(jd=Od=!1,pi(),Wi(t,e),!Od&&!Ad){if(e=bd,e!==null)for(var r=0;r<e.length;r+=3)Ys(e[r],e[r+1],e[r+2]);Xs(t.containerInfo),jd=!0}bd=null;break;case 5:Wi(t,e);break;case 4:r=Od,Od=!1,Wi(t,e),Od&&(Ad=!0),Od=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Wi(t,e):vi(e,!1));break;case 30:r=Od;var i=pi();Od=!1,Wi(t,e),Od&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=re(a,o),o=re(n.memoizedProps,o);var s=A(a.default,a.update);s===`none`?n=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,xd=0,n=Ti(e,n,t,o,s,a,!0),xd!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&n?(pa(e,e.memoizedProps.onUpdate),bd=i):i!==null&&(i.push.apply(i,bd),bd=i),Od=e.flags&32?!0:r;break;default:Wi(t,e)}}function Ki(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ki(e,t.alternate,t),t=t.sibling}function qi(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Kr(4,n,n.return),qi(n,r);break;case 1:Xr(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Jr(n,n.return,i),qi(n,r);break;case 27:hl&&r&2&&vl(n.stateNode,n.type,n.memoizedProps);case 5:Xr(n,n.return),n.tag!==5&&n.tag!==27||ei(n),qi(n,r);break;case 6:ei(n);break;case 26:Xr(n,n.return),tl&&(i=n.stateNode,n.memoizedState!==null||i===null||Cd||ll(i)),qi(n,r);break;case 22:n.memoizedState===null&&qi(n,r);break;case 30:Xr(n,n.return),qi(n,r);break;case 7:Xr(n,n.return);default:qi(n,r)}e=e.sibling}}function Ji(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Ji(i,a,n),Gr(4,a);break;case 1:if(Ji(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ga(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)bt(l[i],c)}catch(e){Ga(r,r.return,e)}}s&&o&64&&qr(a),Yr(a,a.return);break;case 27:hl&&n&2&&di(a);case 5:a.tag!==5&&a.tag!==27||$r(a),Ji(i,a,n),s&&r===null&&o&4&&ri(a),Yr(a,a.return);break;case 6:$r(a);break;case 26:tl&&(c=a.stateNode,a.memoizedState!==null||c===null||Sd||cl(rl(c.ownerDocument),a.type,c)),Ji(i,a,n),s&&r===null&&o&4&&ri(a),Yr(a,a.return);break;case 12:Ji(i,a,n);break;case 31:Ji(i,a,n),s&&o&4&&Ii(i,a);break;case 13:Ji(i,a,n),s&&o&4&&Li(i,a);break;case 22:a.memoizedState===null&&Ji(i,a,n),Yr(a,a.return);break;case 30:Ji(i,a,n),Yr(a,a.return);break;case 7:Yr(a,a.return);default:Ji(i,a,n)}t=t.sibling}}function Yi(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&F(n))}function Xi(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&F(e))}function W(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Zi(e,t,n,r),t=t.sibling;else i&&wi(t)}function Zi(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Ci(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:W(e,t,n,r),a&2048&&Gr(9,t);break;case 1:W(e,t,n,r);break;case 3:W(e,t,n,r),i&&ns&&jd&&Zs(e.containerInfo),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&F(e)));break;case 12:if(a&2048){W(e,t,n,r),e=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ga(t,t.return,e)}}else W(e,t,n,r);break;case 31:W(e,t,n,r);break;case 13:W(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Ci(t),o._visibility&2?W(e,t,n,r):(o._visibility|=2,Qi(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Ci(s),o._visibility&2?W(e,t,n,r):$i(e,t)),a&2048&&Yi(s,t);break;case 24:W(e,t,n,r),a&2048&&Xi(t.alternate,t);break;case 30:i&&(i=t.alternate,i!==null&&(gi(i.child,!0),gi(t.child,!0))),W(e,t,n,r);break;default:W(e,t,n,r)}}function Qi(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Qi(a,o,s,c,i),Gr(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Qi(a,o,s,c,i)):u._visibility&2?Qi(a,o,s,c,i):$i(a,o),i&&l&2048&&Yi(o.alternate,o);break;case 24:Qi(a,o,s,c,i),i&&l&2048&&Xi(o.alternate,o);break;default:Qi(a,o,s,c,i)}t=t.sibling}}function $i(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:$i(n,r),i&2048&&Yi(r.alternate,r);break;case 24:$i(n,r),i&2048&&Xi(r.alternate,r);break;default:$i(n,r)}t=t.sibling}}function G(e,t,n){if(e.subtreeFlags&Fd)for(e=e.child;e!==null;)ea(e,t,n),e=e.sibling}function ea(e,t,n){switch(e.tag){case 26:if(G(e,t,n),e.flags&Fd){if(e.memoizedState!==null)ml(n,Pd,e.memoizedState,e.memoizedProps);else{var r=e.stateNode,i=e.type;e=e.memoizedProps,((t&335544128)===t||ms(i,e))&&_s(n,r,i,e)}}break;case 5:G(e,t,n),e.flags&Fd&&(r=e.stateNode,i=e.type,e=e.memoizedProps,((t&335544128)===t||ms(i,e))&&_s(n,r,i,e));break;case 3:case 4:tl?(r=Pd,Pd=rl(e.stateNode.containerInfo),G(e,t,n),Pd=r):G(e,t,n);break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Fd,Fd=16777216,G(e,t,n),Fd=r):G(e,t,n));break;case 30:(e.flags&Fd)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`&&(i=e.stateNode,i.paired=null,yd===null&&(yd=new Map),yd.set(r,i))),G(e,t,n);break;default:G(e,t,n)}}function ta(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function na(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Dd=r,aa(r,e)}ta(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ra(e),e=e.sibling}function ra(e){switch(e.tag){case 0:case 11:case 15:na(e),e.flags&2048&&Kr(9,e,e.return);break;case 3:na(e);break;case 12:na(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ia(e)):na(e);break;default:na(e)}}function ia(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Dd=r,aa(r,e)}ta(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Kr(8,t,t.return),ia(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ia(t));break;default:ia(t)}e=e.sibling}}function aa(e,t){for(;Dd!==null;){var n=Dd;switch(n.tag){case 0:case 11:case 15:Kr(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:F(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Dd=r;else a:for(n=e;Dd!==null;){r=Dd;var i=r.sibling,a=r.return;if(Ni(r),r===n){Dd=null;break a}if(i!==null){i.return=a,Dd=i;break a}Dd=a}}}function oa(e){var t=as(e);if(t!=null){if(typeof t.memoizedProps[`data-testname`]!=`string`)throw Error(r(364));return t}if(e=Es(e),e===null)throw Error(r(362));return e.stateNode.current}function sa(e,t){var n=e.tag;switch(t.$$typeof){case Ld:if(e.type===t.value)return!0;break;case Rd:a:{for(t=t.value,e=[e,0],n=0;n<e.length;){var i=e[n++],a=i.tag,o=e[n++],s=t[o];if(a!==5&&a!==26&&a!==27||!ks(i)){for(;s!=null&&sa(i,s);)o++,s=t[o];if(o===t.length){t=!0;break a}for(i=i.child;i!==null;)e.push(i,o),i=i.sibling}}t=!1}return t;case zd:if((n===5||n===26||n===27)&&As(e.stateNode,t.value))return!0;break;case Vd:if((n===5||n===6||n===26||n===27)&&(e=Os(e),e!==null&&0<=e.indexOf(t.value)))return!0;break;case Bd:if((n===5||n===26||n===27)&&(e=e.memoizedProps[`data-testname`],typeof e==`string`&&e.toLowerCase()===t.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function ca(e){switch(e.$$typeof){case Ld:return`<`+(u(e.value)||`Unknown`)+`>`;case Rd:return`:has(`+(ca(e)||``)+`)`;case zd:return`[role="`+e.value+`"]`;case Vd:return`"`+e.value+`"`;case Bd:return`[data-testname="`+e.value+`"]`;default:throw Error(r(365))}}function la(e,t){var n=[];e=[e,0];for(var r=0;r<e.length;){var i=e[r++],a=i.tag,o=e[r++],s=t[o];if(a!==5&&a!==26&&a!==27||!ks(i)){for(;s!=null&&sa(i,s);)o++,s=t[o];if(o===t.length)n.push(i);else for(i=i.child;i!==null;)e.push(i,o),i=i.sibling}}return n}function ua(e,t){if(!Ts)throw Error(r(363));e=oa(e),e=la(e,t),t=[],e=Array.from(e);for(var n=0;n<e.length;){var i=e[n++],a=i.tag;if(a===5||a===26||a===27)ks(i)||t.push(i.stateNode);else for(i=i.child;i!==null;)e.push(i),i=i.sibling}return t}function da(){return Wd&2&&qd!==0?qd&-qd:X.T===null?ls():We()}function fa(){if(af===0){if(!(qd&536870912)||fu){var e=Ol;Ol<<=1,!(Ol&3932160)&&(Ol=262144),af=e}else af=536870912}return e=Z.current,e!==null&&(e.flags|=32),af}function pa(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=oc(re(e.memoizedProps,n))),Cf===null&&(Cf=[]),Cf.push(t.bind(null,r))}}function K(e,t,n){(e===Gd&&(Jd===2||Jd===9)||e.cancelPendingCommit!==null)&&(ba(e,0),_a(e,qd,af,!1)),w(e,n),(!(Wd&2)||e!==Gd)&&(e===Gd&&(!(Wd&2)&&(nf|=n),ef===4&&_a(e,qd,af,!1)),Ie(e))}function ma(e,t,n){if(Wd&6)throw Error(r(327));var i=!n&&!(t&127)&&(t&e.expiredLanes)===0||y(e,t),a=i?Oa(e,t):Ea(e,t,!0),o=i;do{if(a===0){Zd&&!i&&_a(e,t,0,!1);break}if(n=e.current.alternate,o&&!ga(n))a=Ea(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=sf;var l=is&&c.current.memoizedState.isDehydrated;if(l&&(ba(c,s).flags|=256),s=Ea(c,s,!1),s!==2&&s!==6){if(Qd&&!l){c.errorRecoveryDisabledLanes|=o,nf|=o,a=4;break a}o=cf,cf=a,o!==null&&(cf===null?cf=o:cf.push.apply(cf,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){ba(e,0),_a(e,t,0,!0);break}a:{switch(i=e,o=a,o){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:_a(i,t,af,!Xd);break a;case 2:cf=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(a=uf+300-Pl(),10<a)){if(_a(i,t,af,!Xd),v(i,0,!0)!==0)break a;vf=t,i.timeoutHandle=Qo(ha.bind(null,i,n,cf,pf,lf,t,af,nf,of,Xd,o,`Throttled`,-0,0),a);break a}ha(i,n,cf,pf,lf,t,af,nf,of,Xd,o,null,-0,0)}break}}while(1);Ie(e)}function ha(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=es;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d=gs(),yd=null,ea(t,a,d),h&&vs(d,e.containerInfo),m=(a&62914560)===a?uf-Pl():(a&4194048)===a?df-Pl():0,m=ys(d,m),m!==null)?(vf=a,e.cancelPendingCommit=m(Pa.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),_a(e,a,o,!l)):Pa(e,t,a,n,r,i,o,s,c,l,u,d)}function ga(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Wl(a(),i))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 _a(e,t,n,r){t=b(e,t),t&=~rf,t&=~nf,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-wl(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ee(e,n,t)}function va(){return Wd&6?!0:(Le(0,!1),!1)}function ya(){if(Kd!==null){if(Jd===0)var e=Kd.return;else e=Kd,vu=_u=null,Bt(e),Vu=null,Hu=0,e=Kd;for(;e!==null;)Wr(e.alternate,e),e=e.return;Kd=null}}function ba(e,t){var n=e.timeoutHandle;return n!==es&&(e.timeoutHandle=es,$o(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),vf=0,ya(),Gd=e,Kd=n=eo(e.current,null),qd=t,Jd=0,Yd=null,Xd=!1,Zd=y(e,t),Qd=!1,of=af=rf=nf=tf=ef=0,cf=sf=null,lf=!1,$d=b(e,t),ot(),n}function xa(e,t){$=null,X.H=ld,t===Iu||t===Ru?(t=et(),Jd=3):t===Lu?(t=et(),Jd=4):Jd=t===md?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Yd=t,Kd===null&&(ef=1,qn(e,M(t,e.current)))}function Sa(){var e=Z.current;return e===null?!0:(qd&4194048)===qd?Q===null:(qd&62914560)===qd||qd&536870912?e===Q:!1}function Ca(){var e=X.H;return X.H=ld,e===null?ld:e}function wa(){var e=X.A;return X.A=Id,e}function Ta(){ef=4,Xd||(qd&4194048)!==qd&&Z.current!==null||(Zd=!0),!(tf&134217727)&&!(nf&134217727)||Gd===null||_a(Gd,qd,af,!1)}function Ea(e,t,n){var r=Wd;Wd|=2;var i=Ca(),a=wa();(Gd!==e||qd!==t)&&(pf=null,ba(e,t)),t=!1;var o=ef;a:do try{if(Jd!==0&&Kd!==null){var s=Kd,c=Yd;switch(Jd){case 8:ya(),o=6;break a;case 3:case 2:case 9:case 6:Z.current===null&&(t=!0);var l=Jd;if(Jd=0,Yd=null,q(e,s,c,l),n&&Zd){o=0;break a}break;default:l=Jd,Jd=0,Yd=null,q(e,s,c,l)}}Da(),o=ef;break}catch(t){xa(e,t)}while(1);return t&&e.shellSuspendCounter++,vu=_u=null,Wd=r,X.H=i,X.A=a,Kd===null&&(Gd=null,qd=0,ot()),o}function Da(){for(;Kd!==null;)Aa(Kd)}function Oa(e,t){var n=Wd;Wd|=2;var i=Ca(),a=wa();Gd!==e||qd!==t?(pf=null,ff=Pl()+500,ba(e,t)):Zd=y(e,t);a:do try{if(Jd!==0&&Kd!==null){t=Kd;var o=Yd;b:switch(Jd){case 1:Jd=0,Yd=null,q(e,t,o,1);break;case 2:case 9:if(Ze(o)){Jd=0,Yd=null,ja(t);break}t=function(){Jd!==2&&Jd!==9||Gd!==e||(Jd=7),Ie(e)},o.then(t,t);break a;case 3:Jd=7;break a;case 4:Jd=5;break a;case 7:Ze(o)?(Jd=0,Yd=null,ja(t)):(Jd=0,Yd=null,q(e,t,o,7));break;case 5:var s=null;switch(Kd.tag){case 26:s=Kd.memoizedState;case 5:case 27:var c=Kd,l=c.type,u=c.pendingProps;if(s?pl(s):hs(c.stateNode,l,u)){Jd=0,Yd=null;var d=c.sibling;if(d!==null)Kd=d;else{var f=c.return;f===null?Kd=null:(Kd=f,Ma(f))}break b}}Jd=0,Yd=null,q(e,t,o,5);break;case 6:Jd=0,Yd=null,q(e,t,o,6);break;case 8:ya(),ef=6;break a;default:throw Error(r(462))}}ka();break}catch(t){xa(e,t)}while(1);return vu=_u=null,X.H=i,X.A=a,Wd=n,Kd===null?(Gd=null,qd=0,ot(),ef):0}function ka(){for(;Kd!==null&&!Ml();)Aa(Kd)}function Aa(e){var t=kr(e.alternate,e,$d);e.memoizedProps=e.pendingProps,t===null?Ma(e):Kd=t}function ja(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=dr(n,t,t.pendingProps,t.type,void 0,qd);break;case 11:t=dr(n,t,t.pendingProps,t.type.render,t.ref,qd);break;case 5:Bt(t);var r=t;is&&r===uu&&(fu?(ve(r),r.tag===5&&r.stateNode!=null&&(du=r.stateNode)):(ve(r),fu=!0));default:Wr(n,t),t=Kd=to(t,$d),t=kr(n,t,$d)}e.memoizedProps=e.pendingProps,t===null?Ma(e):Kd=t}function q(e,t,n,r){vu=_u=null,Bt(t),Vu=null,Hu=0;var i=t.return;try{if(Qn(e,i,t,n,qd)){ef=1,qn(e,M(n,e.current)),Kd=null;return}}catch(t){if(i!==null)throw Kd=i,t;ef=1,qn(e,M(n,e.current)),Kd=null;return}t.flags&32768?(fu||r===1?e=!0:Zd||qd&536870912?e=!1:(Xd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Z.current,r!==null&&r.tag===13&&(r.flags|=16384))),Na(t,e)):Ma(t)}function Ma(e){var t=e;do{if(t.flags&32768){Na(t,Xd);return}e=t.return;var n=Hr(t.alternate,t,$d);if(n!==null){Kd=n;return}if(t=t.sibling,t!==null){Kd=t;return}Kd=t=e}while(t!==null);ef===0&&(ef=5)}function Na(e,t){do{var n=Ur(e.alternate,e);if(n!==null){n.flags&=32767,Kd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Kd=e;return}Kd=e=n}while(e!==null);ef=6,Kd=null}function Pa(e,t,n,i,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do Ha();while(hf!==0);if(Wd&6)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));e===Gd&&(Kd=Gd=null,qd=0),_f=t,gf=e,vf=n,bf=a,xf=i,Fa(e,t,n,s,c,l,f)}}function Fa(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(yf=s,s|=qu,T(e,n,s,r,i,a),Cf=null,(n&335544064)===n?(wf=Pe(e),r=10262):(wf=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Za(Ll,function(){return Ua(),null})):(e.callbackNode=null,e.callbackPriority=0),vd=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=X.T,X.T=null,i=cs(),ss(2),a=Wd,Wd|=4;try{Di(e,t,n)}finally{Wd=a,ss(i),X.T=r}}hf=1,vd?Sf=rc(o,e.containerInfo,wf,Ra,za,La,Ba,Ua,Ia,null,null):(Ra(),za(),Ba())}function Ia(e){if(hf!==0){var t=gf.onRecoverableError;t(e,{componentStack:null})}}function La(){hf===3&&(hf=0,Gi(_f,gf),hf=4)}function Ra(){if(hf===1){hf=0;var e=gf,t=_f,n=vf,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=X.T,X.T=null;var i=cs();ss(2);var a=Wd;Wd|=4;try{kd=Ad=!1,Vi(t,e,n),Ko(e.containerInfo)}finally{Wd=a,ss(i),X.T=r}}e.current=t,hf=2}}function za(){if(hf===2){hf=0;var e=gf,t=_f,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=X.T,X.T=null;var r=cs();ss(2);var i=Wd;Wd|=4;try{ki(e,t.alternate,t)}finally{Wd=i,ss(r),X.T=n}}hf=3}}function Ba(){if(hf===4||hf===3){hf=0;var e=Sf;Sf=null,Nl();var t=gf,n=_f,r=vf,i=xf,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?hf=5:(hf=0,_f=gf=null,Va(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(mf=null),ne(r),n=n.stateNode,Hl&&typeof Hl.onCommitFiberRoot==`function`)try{Hl.onCommitFiberRoot(Vl,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=X.T,a=cs(),ss(2),X.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{X.T=n,ss(a)}}if(i=Cf,o=wf,wf=null,i!==null&&(Cf=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&ac(e,n);vf&3&&Ha(),Ie(t),a=t.pendingLanes,r&261930&&a&42?t===Ef?Tf++:(Tf=0,Ef=t):(Tf=0,Ef=null),is&&qc(),Le(0,!1)}}function Va(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,F(t)))}function Ha(){return Sf!==null&&(ic(Sf),Sf=null),Ra(),za(),Ba(),Ua()}function Ua(){if(hf!==5)return!1;var e=gf,t=yf;yf=0;var n=ne(vf),i=32>n?32:n;n=X.T;var a=cs();try{ss(i),X.T=null,i=bf,bf=null;var o=gf,s=vf;if(hf=0,_f=gf=null,vf=0,Wd&6)throw Error(r(331));var c=Wd;if(Wd|=4,ra(o.current),Zi(o,o.current,s,i),Wd=c,Le(0,!1),Hl&&typeof Hl.onPostCommitFiberRoot==`function`)try{Hl.onPostCommitFiberRoot(Vl,o)}catch{}return!0}finally{ss(a),X.T=n,Va(e,t)}}function Wa(e,t,n){t=M(n,t),t=Yn(e.stateNode,t,2),e=ht(e,t,2),e!==null&&(w(e,2),Ie(e))}function Ga(e,t,n){if(e.tag===3)Wa(e,e,n);else for(;t!==null;){if(t.tag===3){Wa(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(mf===null||!mf.has(r))){e=M(n,e),n=Xn(2),r=ht(t,n,2),r!==null&&(Zn(n,r,t,e),w(r,2),Ie(r));break}}t=t.return}}function Ka(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ud;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Qd=!0,i.add(n),e=qa.bind(null,e,t,n),t.then(e,e))}function qa(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gd===e&&(qd&n)===n&&(ef===4||ef===3&&(qd&62914560)===qd&&300>Pl()-uf?Wd&2?rf|=n:ba(e,0):rf|=n,of===qd&&(of=0)),Ie(e)}function Ja(e,t){t===0&&(t=S()),e=lt(e,t),e!==null&&(w(e,t),Ie(e))}function Ya(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ja(e,n)}function Xa(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(r(314))}i!==null&&i.delete(t),Ja(e,n)}function Za(e,t){return Al(e,t)}function Qa(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.refCleanup=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 $a(e){return e=e.prototype,!(!e||!e.isReactComponent)}function eo(e,n){var r=e.alternate;return r===null?(r=t(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&1206910976,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function to(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function no(e,n,i,a,o,s){var c=0;if(a=e,typeof a==`function`)$a(a)&&(c=1);else if(typeof a==`string`)c=tl&&hl?nl(e,i,ou.current)?26:yl(e)?27:5:tl?nl(e,i,ou.current)?26:5:hl&&yl(e)?27:5;else a:switch(a){case jo:return e=t(31,i,n,o),e.elementType=jo,e.lanes=s,e;case xo:return ro(i.children,o,s,n);case So:c=8,o|=24;break;case Co:return e=t(12,i,n,o|2),e.elementType=Co,e.lanes=s,e;case Do:return e=t(13,i,n,o),e.elementType=Do,e.lanes=s,e;case Oo:return e=t(19,i,n,o),e.elementType=Oo,e.lanes=s,e;case Mo:case Po:return e=o|32,e=t(30,i,n,e),e.elementType=Po,e.lanes=s,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof a==`object`&&a)switch(a.$$typeof){case To:c=10;break a;case wo:c=9;break a;case Eo:c=11;break a;case ko:c=14;break a;case Ao:c=16,a=null;break a}c=29,i=Error(r(130,e===null?`null`:typeof e,``)),a=null}return n=t(c,i,n,o),n.elementType=e,n.type=a,n.lanes=s,n}function ro(e,n,r,i){return e=t(7,e,i,n),e.lanes=r,e}function io(e,n,r){return e=t(6,e,null,n),e.lanes=r,e}function ao(e){var n=t(18,null,null,0);return n.stateNode=e,n}function oo(e,n,r){return n=t(4,e.children===null?[]:e.children,e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function so(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=es,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=C(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=C(0),this.hiddenUpdates=C(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function co(e,n,r,i,a,o,s,c,l,u,d,f){return e=new so(e,n,r,s,l,u,d,f,c),n=1,!0===o&&(n|=24),o=t(3,null,null,n),e.current=o,o.stateNode=e,n=Me(),n.refCount++,e.pooledCache=n,n.refCount++,o.memoizedState={element:i,isDehydrated:r,cache:n},ft(o),e}function lo(e){return e?(e=Cl,e):Cl}function uo(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=o(t),e=e===null?null:s(e),e===null?null:Ho(e.stateNode)}function fo(e,t,n,r,i,a){i=lo(i),r.context===null?r.context=i:r.pendingContext=i,r=mt(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=ht(e,r,t),n!==null&&(K(n,e,t),gt(n,e,t))}function po(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mo(e,t){po(e,t),(e=e.alternate)&&po(e,t)}var J={},ho=p(),go=d(),_o=Object.assign,vo=Symbol.for(`react.element`),yo=Symbol.for(`react.transitional.element`),bo=Symbol.for(`react.portal`),xo=Symbol.for(`react.fragment`),So=Symbol.for(`react.strict_mode`),Co=Symbol.for(`react.profiler`),wo=Symbol.for(`react.consumer`),To=Symbol.for(`react.context`),Eo=Symbol.for(`react.forward_ref`),Do=Symbol.for(`react.suspense`),Oo=Symbol.for(`react.suspense_list`),ko=Symbol.for(`react.memo`),Ao=Symbol.for(`react.lazy`),jo=Symbol.for(`react.activity`),Mo=Symbol.for(`react.legacy_hidden`),No=Symbol.for(`react.memo_cache_sentinel`),Po=Symbol.for(`react.view_transition`),Y=Symbol.for(`react.recoverable`),Fo=Symbol.iterator,Io=Symbol.for(`react.optimistic_key`),Lo=Symbol.for(`react.client.reference`),Ro=Array.isArray,X=ho.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,zo=e.rendererVersion,Bo=e.rendererPackageName,Vo=e.extraDevToolsConfig,Ho=e.getPublicInstance,Uo=e.getRootHostContext,Wo=e.getChildHostContext,Go=e.prepareForCommit,Ko=e.resetAfterCommit,qo=e.createInstance;e.cloneMutableInstance;var Jo=e.appendInitialChild,Yo=e.finalizeInitialChildren,Xo=e.shouldSetTextContent,Zo=e.createTextInstance;e.cloneMutableTextInstance;var Qo=e.scheduleTimeout,$o=e.cancelTimeout,es=e.noTimeout,ts=e.isPrimaryRenderer;e.warnsIfNotActing;var ns=e.supportsMutation,rs=e.supportsPersistence,is=e.supportsHydration,as=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var os=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var ss=e.setCurrentUpdatePriority,cs=e.getCurrentUpdatePriority,ls=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var us=e.shouldAttemptEagerTransition,ds=e.detachDeletedInstance;e.requestPostPaintCallback;var fs=e.maySuspendCommit,ps=e.maySuspendCommitOnUpdate,ms=e.maySuspendCommitInSyncRender,hs=e.preloadInstance,gs=e.startSuspendingCommit,_s=e.suspendInstance,vs=e.suspendOnActiveViewTransition,ys=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var bs=e.NotPendingTransition,xs=e.HostTransitionContext,Ss=e.resetFormInstance;e.bindToConsole;var Cs=e.supportsMicrotasks,ws=e.scheduleMicrotask,Ts=e.supportsTestSelectors,Es=e.findFiberRoot,Ds=e.getBoundingRect,Os=e.getTextContent,ks=e.isHiddenSubtree,As=e.matchAccessibilityRole,js=e.setFocusIfFocusable,Ms=e.setupIntersectionObserver,Ns=e.appendChild,Ps=e.appendChildToContainer,Fs=e.commitTextUpdate,Is=e.commitMount,Ls=e.commitUpdate,Rs=e.insertBefore,zs=e.insertInContainerBefore,Bs=e.removeChild,Vs=e.removeChildFromContainer,Hs=e.resetTextContent,Us=e.hideInstance,Ws=e.hideTextInstance,Gs=e.unhideInstance,Ks=e.unhideTextInstance,qs=e.applyViewTransitionName,Js=e.restoreViewTransitionName,Ys=e.cancelViewTransitionName,Xs=e.cancelRootViewTransitionName,Zs=e.restoreRootViewTransitionName;e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone;var Qs=e.measureInstance,$s=e.measureClonedInstance,ec=e.wasInstanceInViewport,tc=e.hasInstanceChanged,nc=e.hasInstanceAffectedParent,rc=e.startViewTransition;e.startGestureTransition;var ic=e.stopViewTransition,ac=e.addViewTransitionFinishedListener;e.getCurrentGestureOffset;var oc=e.createViewTransitionInstance,sc=e.clearContainer,cc=e.createFragmentInstance,lc=e.updateFragmentInstanceFiber,uc=e.commitNewChildToFragmentInstance,dc=e.deleteChildFromFragmentInstance,fc=e.cloneInstance,pc=e.createContainerChildSet,mc=e.appendChildToContainerChildSet,hc=e.finalizeContainerChildren,gc=e.replaceContainerChildren,_c=e.cloneHiddenInstance,vc=e.cloneHiddenTextInstance,yc=e.isSuspenseInstancePending,bc=e.isSuspenseInstanceFallback,xc=e.getSuspenseInstanceFallbackErrorDetails,Sc=e.registerSuspenseInstanceRetry,Cc=e.canHydrateFormStateMarker,wc=e.isFormStateMarkerMatching,Tc=e.getNextHydratableSibling,Ec=e.getNextHydratableSiblingAfterSingleton,Dc=e.getFirstHydratableChild,Oc=e.getFirstHydratableChildWithinContainer,kc=e.getFirstHydratableChildWithinActivityInstance,Ac=e.getFirstHydratableChildWithinSuspenseInstance,jc=e.getFirstHydratableChildWithinSingleton,Mc=e.canHydrateInstance,Nc=e.canHydrateTextInstance,Pc=e.canHydrateActivityInstance,Fc=e.canHydrateSuspenseInstance,Ic=e.hydrateInstance,Lc=e.hydrateTextInstance,Rc=e.hydrateActivityInstance,zc=e.hydrateSuspenseInstance,Bc=e.getNextHydratableInstanceAfterActivityInstance,Vc=e.getNextHydratableInstanceAfterSuspenseInstance,Hc=e.commitHydratedInstance,Uc=e.commitHydratedContainer,Wc=e.commitHydratedActivityInstance,Gc=e.commitHydratedSuspenseInstance,Kc=e.finalizeHydratedChildren,qc=e.flushHydrationEvents;e.clearActivityBoundary;var Jc=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var Yc=e.clearSuspenseBoundaryFromContainer,Xc=e.hideDehydratedBoundary,Zc=e.unhideDehydratedBoundary,Qc=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var $c=e.validateHydratableInstance,el=e.validateHydratableTextInstance,tl=e.supportsResources,nl=e.isHostHoistableType,rl=e.getHoistableRoot,il=e.getResource,al=e.acquireResource,ol=e.releaseResource,sl=e.hydrateHoistable,cl=e.mountHoistable,ll=e.unmountHoistable,ul=e.createHoistableInstance,dl=e.prepareToCommitHoistables,fl=e.mayResourceSuspendCommit,pl=e.preloadResource,ml=e.suspendResource,hl=e.supportsSingletons,gl=e.resolveSingletonInstance,_l=e.acquireSingletonInstance,vl=e.releaseSingletonInstance,yl=e.isHostSingletonType,bl=e.isSingletonScope,xl=[],Sl=-1,Cl={},wl=Math.clz32?Math.clz32:g,Tl=Math.log,El=Math.LN2,Dl=256,Ol=262144,kl=4194304,Al=go.unstable_scheduleCallback,jl=go.unstable_cancelCallback,Ml=go.unstable_shouldYield,Nl=go.unstable_requestPaint,Pl=go.unstable_now,Fl=go.unstable_ImmediatePriority,Il=go.unstable_UserBlockingPriority,Ll=go.unstable_NormalPriority,Rl=go.unstable_IdlePriority,zl=go.log,Bl=go.unstable_setDisableYieldValue,Vl=null,Hl=null,Ul=0,Wl=typeof Object.is==`function`?Object.is:ie,Gl=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Kl=Object.prototype.hasOwnProperty,ql,Jl,Yl=!1,Xl=new WeakMap,Zl=[],Ql=0,$l=null,eu=0,tu=[],nu=0,ru=null,iu=1,au=``,ou=f(null),su=f(null),cu=f(null),lu=f(null),uu=null,du=null,fu=!1,pu=null,mu=!1,hu=Error(r(519)),gu=f(null),_u=null,vu=null,yu=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},bu=go.unstable_scheduleCallback,xu=go.unstable_NormalPriority,Su={$$typeof:To,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Cu=null,wu=null,Tu=null,Eu=!1,Du=!1,Ou=!1,ku=0,Au=null,ju=0,Mu=0,Nu=null,Pu=X.S;X.S=function(e,t){if(df=Pl(),typeof t==`object`&&t&&typeof t.then==`function`&&Ge(e,t),Cu!==null)for(var n=wu;n!==null;)Ne(n,Cu),n=n.next;if(n=e.types,n!==null){for(var r=wu;r!==null;)Ne(r,n),r=r.next;if(Mu!==0){r=Cu,r===null&&(r=Cu=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Pu!==null&&Pu(e,t)};var Fu=f(null),Iu=Error(r(460)),Lu=Error(r(474)),Ru=Error(r(542)),zu={then:function(){}},Bu=null,Vu=null,Hu=0,Uu=at(!0),Wu=at(!1),Gu=[],Ku=0,qu=0,Ju=!1,Yu=!1,Xu=f(null),Zu=f(0),Z=f(null),Q=null,Qu=f(0),$u=0,$=null,ed=null,td=null,nd=!1,rd=!1,id=!1,ad=0,od=0,sd=null,cd=0,ld={readContext:ke,use:Wt,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt,useHostTransitionStatus:Mt,useFormState:Mt,useActionState:Mt,useOptimistic:Mt,useMemoCache:Mt,useCacheRefresh:Mt,useEffectEvent:Mt},ud={readContext:ke,use:Wt,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:ke,useEffect:vn,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),gn(4194308,4,H.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gn(4194308,4,e,t)},useInsertionEffect:function(e,t){gn(4,2,e,t)},useMemo:function(e,t){var n=Vt();t=t===void 0?null:t;var r=e();if(id){O(!0);try{e()}finally{O(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Vt();if(n!==void 0){var i=n(t);if(id){O(!0);try{n(t)}finally{O(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=In.bind(null,$,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:function(e){e=en(e);var t=e.queue,n=Ln.bind(null,$,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Tn,useDeferredValue:function(e,t){return On(Vt(),e,t)},useTransition:function(){var e=en(!1);return e=An.bind(null,$,e.queue,!0,!1),Vt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=$,a=Vt();if(fu){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Gd===null)throw Error(r(349));qd&127||Xt(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,vn(Zt.bind(null,i,o,e),[e]),i.flags|=2048,mn(9,{destroy:void 0},B.bind(null,i,o,n,t),null),n},useId:function(){var e=Vt(),t=Gd.identifierPrefix;if(fu){var n=au,r=iu;n=(r&~(1<<32-wl(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ad++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=cd++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Mn,useFormState:ln,useActionState:ln,useOptimistic:function(e){var t=Vt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=zn.bind(null,$,!0,n),n.dispatch=t,[e,t]},useMemoCache:Gt,useCacheRefresh:function(){return Vt().memoizedState=Fn.bind(null,$)},useEffectEvent:function(e){var t=Vt(),n={impl:e};return t.memoizedState=n,function(){if(Wd&2)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},dd={readContext:ke,use:Wt,useCallback:En,useContext:ke,useEffect:yn,useImperativeHandle:wn,useInsertionEffect:Sn,useLayoutEffect:Cn,useMemo:Dn,useReducer:Kt,useRef:hn,useState:function(){return Kt(z)},useDebugValue:Tn,useDeferredValue:function(e,t){return kn(R(),ed.memoizedState,e,t)},useTransition:function(){var e=Kt(z)[0],t=R().memoizedState;return[typeof e==`boolean`?e:Ut(e),t]},useSyncExternalStore:Yt,useId:Nn,useHostTransitionStatus:Mn,useFormState:un,useActionState:un,useOptimistic:function(e,t){return tn(R(),ed,e,t)},useMemoCache:Gt,useCacheRefresh:Pn,useEffectEvent:xn},fd={readContext:ke,use:Wt,useCallback:En,useContext:ke,useEffect:yn,useImperativeHandle:wn,useInsertionEffect:Sn,useLayoutEffect:Cn,useMemo:Dn,useReducer:Jt,useRef:hn,useState:function(){return Jt(z)},useDebugValue:Tn,useDeferredValue:function(e,t){var n=R();return ed===null?On(n,e,t):kn(n,ed.memoizedState,e,t)},useTransition:function(){var e=Jt(z)[0],t=R().memoizedState;return[typeof e==`boolean`?e:Ut(e),t]},useSyncExternalStore:Yt,useId:Nn,useHostTransitionStatus:Mn,useFormState:pn,useActionState:pn,useOptimistic:function(e,t){var n=R();return ed===null?(n.baseState=e,[e,n.queue.dispatch]):tn(n,ed,e,t)},useMemoCache:Gt,useCacheRefresh:Pn,useEffectEvent:xn},pd={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=da(),i=mt(r);i.payload=t,n!=null&&(i.callback=n),t=ht(e,i,r),t!==null&&(K(t,e,r),gt(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=da(),i=mt(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ht(e,i,r),t!==null&&(K(t,e,r),gt(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=da(),r=mt(n);r.tag=2,t!=null&&(r.callback=t),t=ht(e,r,n),t!==null&&(K(t,e,n),gt(t,e,n))}},md=Error(r(461)),hd=!1,gd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},_d=!1,vd=!1,yd=null,bd=null,xd=0,Sd=!1,Cd=!1,wd=!1,Td=!1,Ed=typeof WeakSet==`function`?WeakSet:Set,Dd=null,Od=!1,kd=!1,Ad=!1,jd=!1,Md=null,Nd=!1,Pd=null,Fd=8192,Id={getCacheForType:function(e){var t=ke(Su),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ke(Su).controller.signal}},Ld=0,Rd=1,zd=2,Bd=3,Vd=4;if(typeof Symbol==`function`&&Symbol.for){var Hd=Symbol.for;Ld=Hd(`selector.component`),Rd=Hd(`selector.has_pseudo_class`),zd=Hd(`selector.role`),Bd=Hd(`selector.test_id`),Vd=Hd(`selector.text`)}var Ud=typeof WeakMap==`function`?WeakMap:Map,Wd=0,Gd=null,Kd=null,qd=0,Jd=0,Yd=null,Xd=!1,Zd=!1,Qd=!1,$d=0,ef=0,tf=0,nf=0,rf=0,af=0,of=0,sf=null,cf=null,lf=!1,uf=0,df=0,ff=1/0,pf=null,mf=null,hf=0,gf=null,_f=null,vf=0,yf=0,bf=null,xf=null,Sf=null,Cf=null,wf=null,Tf=0,Ef=null;return J.attemptContinuousHydration=function(e){if(e.tag===13||e.tag===31){var t=lt(e,67108864);t!==null&&K(t,e,67108864),mo(e,67108864)}},J.attemptHydrationAtCurrentPriority=function(e){if(e.tag===13||e.tag===31){var t=da();t=te(t);var n=lt(e,t);n!==null&&K(n,e,t),mo(e,t)}},J.attemptSynchronousHydration=function(e){switch(e.tag){case 3:if(e=e.stateNode,e.current.memoizedState.isDehydrated){var t=_(e.pendingLanes);if(t!==0){for(e.pendingLanes|=2,e.entangledLanes|=2;t;){var n=1<<31-wl(t);e.entanglements[1]|=n,t&=~n}Ie(e),!(Wd&6)&&(ff=Pl()+500,Le(0,!1))}}break;case 31:case 13:t=lt(e,2),t!==null&&K(t,e,2),va(),mo(e,2)}},J.batchedUpdates=function(e,t){return e(t)},J.createComponentSelector=function(e){return{$$typeof:Ld,value:e}},J.createContainer=function(e,t,n,r,i,a,o,s,c,l){return co(e,t,!1,null,n,r,a,null,o,s,c,l)},J.createHasPseudoClassSelector=function(e){return{$$typeof:Rd,value:e}},J.createHydrationContainer=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p){return e=co(n,r,!0,e,i,a,s,p,c,l,u,d),e.context=lo(null),n=e.current,r=da(),r=te(r),i=mt(r),i.callback=t??null,ht(n,i,r),t=r,e.current.lanes=t,w(e,t),Ie(e),e},J.createPortal=function(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:bo,key:r==null?null:r===Io?Io:``+r,children:e,containerInfo:t,implementation:n}},J.createRoleSelector=function(e){return{$$typeof:zd,value:e}},J.createTestNameSelector=function(e){return{$$typeof:Bd,value:e}},J.createTextSelector=function(e){return{$$typeof:Vd,value:e}},J.defaultOnCaughtError=function(e){console.error(e)},J.defaultOnRecoverableError=function(e){Gl(e)},J.defaultOnUncaughtError=function(e){Gl(e)},J.deferredUpdates=function(e){var t=X.T,n=cs();try{return ss(32),X.T=null,e()}finally{ss(n),X.T=t}},J.discreteUpdates=function(e,t,n,r,i){var a=X.T,o=cs();try{return ss(2),X.T=null,e(t,n,r,i)}finally{ss(o),X.T=a,Wd===0&&(ff=Pl()+500)}},J.findAllNodes=ua,J.findBoundingRects=function(e,t){if(!Ts)throw Error(r(363));t=ua(e,t),e=[];for(var n=0;n<t.length;n++)e.push(Ds(t[n]));for(t=e.length-1;0<t;t--){n=e[t];for(var i=n.x,a=i+n.width,o=n.y,s=o+n.height,c=t-1;0<=c;c--)if(t!==c){var l=e[c],u=l.x,d=u+l.width,f=l.y,p=f+l.height;if(i>=u&&o>=f&&a<=d&&s<=p){e.splice(t,1);break}if(!(i!==u||n.width!==l.width||p<o||f>s)){f>o&&(l.height+=f-o,l.y=o),p<s&&(l.height=s-f),e.splice(t,1);break}if(!(o!==f||n.height!==l.height||d<i||u>a)){u>i&&(l.width+=u-i,l.x=i),d<a&&(l.width=a-u),e.splice(t,1);break}}}return e},J.findHostInstance=uo,J.findHostInstanceWithNoPortals=function(e){return e=o(e),e=e===null?null:c(e),e===null?null:Ho(e.stateNode)},J.findHostInstanceWithWarning=function(e){return uo(e)},J.flushPassiveEffects=Ha,J.flushSyncFromReconciler=function(e){var t=Wd;Wd|=1;var n=X.T,r=cs();try{if(ss(2),X.T=null,e)return e()}finally{ss(r),X.T=n,Wd=t,!(Wd&6)&&Le(0,!1)}},J.flushSyncWork=va,J.focusWithin=function(e,t){if(!Ts)throw Error(r(363));for(e=oa(e),t=la(e,t),t=Array.from(t),e=0;e<t.length;){var n=t[e++],i=n.tag;if(!ks(n)){if((i===5||i===26||i===27)&&js(n.stateNode))return!0;for(n=n.child;n!==null;)t.push(n),n=n.sibling}}return!1},J.getFindAllNodesFailureDescription=function(e,t){if(!Ts)throw Error(r(363));var n=0,i=[];e=[oa(e),0];for(var a=0;a<e.length;){var o=e[a++],s=o.tag,c=e[a++],l=t[c];if((s!==5&&s!==26&&s!==27||!ks(o))&&(sa(o,l)&&(i.push(ca(l)),c++,c>n&&(n=c)),c<t.length))for(o=o.child;o!==null;)e.push(o,c),o=o.sibling}if(n<t.length){for(e=[];n<t.length;n++)e.push(ca(t[n]));return`findAllNodes was able to match part of the selector:
`+(i.join(` > `)+`
No matching component was found for:
`)+e.join(` > `)}return null},J.getPublicRootInstance=function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 27:case 5:return Ho(e.child.stateNode);default:return e.child.stateNode}},J.injectIntoDevTools=function(){var e={bundleType:0,version:zo,rendererPackageName:Bo,currentDispatcherRef:X,reconcilerVersion:`19.3.0`};if(Vo!==null&&(e.rendererConfig=Vo),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{Vl=t.inject(e),Hl=t}catch{}e=!!t.checkDCE}}return e},J.isAlreadyRendering=function(){return!!(Wd&6)},J.observeVisibleRects=function(e,t,n,i){if(!Ts)throw Error(r(363));e=ua(e,t);var a=Ms(e,n,i).disconnect;return{disconnect:function(){a()}}},J.shouldError=function(){return null},J.shouldSuspend=function(){return!1},J.startHostTransition=function(e,t,i,a){if(e.tag!==5)throw Error(r(476));var o=jn(e).queue;An(e,o,t,bs,i===null?n:function(){var t=jn(e);return t.next===null&&(t=e.alternate.memoizedState),Rn(e,t.next.queue,{},da()),i(a)})},J.updateContainer=function(e,t,n,r){var i=t.current,a=da();return fo(i,a,e,t,n,r),a},J.updateContainerSync=function(e,t,n,r){return fo(t.current,2,e,t,n,r),2},J},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})),fo=o(((e,t)=>{t.exports=uo()})),po=o((e=>{e.ConcurrentRoot=1,e.DefaultEventPriority=32,e.DiscreteEventPriority=2})),mo=o(((e,t)=>{t.exports=po()})),J=l(fo()),ho=mo(),go={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,eventBatchFunc:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0},_o=!1,vo=!1,yo=`.react-konva-event`,bo=!1,xo=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
Consider to add onDragMove or onDragEnd events.
For more info see: https://github.com/konvajs/react-konva/issues/256
`,So=`ReactKonva: You are using "zIndex" attribute for a Konva node.
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
For more info see: https://github.com/konvajs/react-konva/issues/194
`,Co={};function wo(e,t,n=Co){if(!_o&&`zIndex`in t&&(console.warn(So),_o=!0),!vo&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(xo),vo=!0)}var a={},o=!1;for(var s in n)if(!go[s]){var c=s.slice(0,2)===`on`,l=n[s]!==t[s];if(c&&l){var u=s.substr(2).toLowerCase();u.substr(0,7)===`content`&&(u=`content`+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u+yo)}var d=!t.hasOwnProperty(s);!c&&d&&(a[s]=void 0,o=!0)}var f=bo||t._useStrictMode;let p={};for(var s in t)if(!go[s]){var c=s.slice(0,2)===`on`,m=n[s]!==t[s];if(c&&m){var u=s.substr(2).toLowerCase();u.substr(0,7)===`content`&&(u=`content`+u.substr(7,1).toUpperCase()+u.substr(8)),t[s]&&(p[u]=t[s])}!c&&(t[s]!==n[s]||f&&t[s]!==e.getAttr(s))&&(o=!0,a[s]=t[s])}for(var u in o&&(e.setAttrs(a),To(e)),p)e.off(u+yo),e.on(u+yo,p[u])}function To(e){if(!I.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}var Eo=d(),Do=new Set,Oo=new Set,ko=typeof queueMicrotask==`function`?queueMicrotask:e=>Promise.resolve().then(e),Ao=0,jo=new WeakMap;function Mo(e){return Oo.add(e),()=>{Oo.delete(e)}}function No(){for(let e of Oo)e()}function Po(e){if(!e)return Fo;let t=jo.get(e);return t||(t=t=>Fo(()=>e(t)),jo.set(e,t)),t}function Y(e){let t=()=>{Do.delete(t)&&(No(),e())};Do.add(t),ko(t)}function Fo(e){if(Ao)return e();Ao++;try{(0,co.flushSync)(e)}finally{try{for(;Do.size;)(0,co.flushSync)(()=>{for(let e of Do)e()})}finally{Ao--}}}var Io=s({HostTransitionContext:()=>Ws,NotPendingTransition:()=>Us,afterActiveInstanceBlur:()=>xs,appendChild:()=>rs,appendChildToContainer:()=>is,appendInitialChild:()=>X,beforeActiveInstanceBlur:()=>bs,bindToConsole:()=>ys,cancelTimeout:()=>ts,clearContainer:()=>gs,commitMount:()=>us,commitNewChildToFragmentInstance:()=>Go,commitTextUpdate:()=>ls,commitUpdate:()=>ds,createFragmentInstance:()=>Uo,createInstance:()=>zo,createTextInstance:()=>Bo,createViewTransitionInstance:()=>Ns,deleteChildFromFragmentInstance:()=>Ko,detachDeletedInstance:()=>_s,finalizeInitialChildren:()=>Vo,getChildHostContext:()=>$o,getCurrentUpdatePriority:()=>Ts,getInstanceFromNode:()=>vs,getInstanceFromScope:()=>Cs,getPublicInstance:()=>Ho,getRootHostContext:()=>Qo,getSuspendedCommitReason:()=>Hs,hideInstance:()=>fs,hideTextInstance:()=>ps,idlePriority:()=>Eo.unstable_IdlePriority,insertBefore:()=>as,insertInContainerBefore:()=>os,isPrimaryRenderer:()=>!1,maySuspendCommit:()=>Ms,maySuspendCommitInSyncRender:()=>Fs,maySuspendCommitOnUpdate:()=>Ps,noTimeout:()=>-1,now:()=>Eo.unstable_now,preloadInstance:()=>Ls,prepareForCommit:()=>Jo,preparePortalMount:()=>Yo,prepareScopeUpdate:()=>Ss,removeChild:()=>ss,removeChildFromContainer:()=>cs,requestPostPaintCallback:()=>js,resetAfterCommit:()=>Xo,resetFormInstance:()=>Gs,resetTextContent:()=>Zo,resolveEventTimeStamp:()=>As,resolveEventType:()=>ks,resolveUpdatePriority:()=>Es,run:()=>Eo.unstable_runWithPriority,scheduleMicrotask:()=>Y,scheduleTimeout:()=>es,setCurrentUpdatePriority:()=>ws,shouldAttemptEagerTransition:()=>Ds,shouldSetTextContent:()=>ns,startSuspendingCommit:()=>Rs,startViewTransition:()=>Is,supportsHydration:()=>!1,supportsMicrotasks:()=>!0,supportsMutation:()=>!0,supportsPersistence:()=>!1,suspendInstance:()=>zs,suspendOnActiveViewTransition:()=>Bs,trackSchedulerEvent:()=>Os,unhideInstance:()=>ms,unhideTextInstance:()=>hs,updateFragmentInstanceFiber:()=>Wo,waitForCommitToBeReady:()=>Vs,warnsIfNotActing:()=>!1}),Lo={};lo.Node.prototype._applyProps=wo;var Ro=ho.DefaultEventPriority;function X(e,t){typeof t==`string`?console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`):(e.add(t),To(e))}function zo(e,t,n){let r=lo[e];r||=(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),lo.Group);let i={},a={};for(var o in t)o!==`ref`&&(o.slice(0,2)===`on`?a[o]=t[o]:i[o]=t[o]);let s=new r(i);return wo(s,a),s}function Bo(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Vo(e,t,n){return!1}function Ho(e){return e}function Uo(){return null}function Wo(){}function Go(){}function Ko(){}var qo;function Jo(){return qo=lo.beginUpdateBatch?.(),null}function Yo(){return null}function Xo(){let e=qo;qo=void 0,e?.()}function Zo(e){}function Qo(){return Lo}function $o(){return Lo}var es=setTimeout,ts=clearTimeout;function ns(e,t){return!1}function rs(e,t){t.parent===e?t.moveToTop():e.add(t),To(e)}var is=rs;function as(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),To(e)}var os=as;function ss(e,t){t.destroy(),t.off(yo),To(e)}var cs=ss;function ls(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function us(e,t,n){}function ds(e,t,n,r){wo(e,r,n)}function fs(e){e.hide(),To(e)}function ps(e){}function ms(e,t){(t.visible==null||t.visible)&&(e.show(),To(e))}function hs(e,t){}function gs(e){}function _s(e){e.off(yo)}function vs(){return null}function ys(e,t){return console[e].bind(console,...t)}function bs(){}function xs(){}function Ss(){}function Cs(){return null}function ws(e){Ro=e}function Ts(){return Ro}function Es(){return ho.DiscreteEventPriority}function Ds(){return!1}function Os(){}function ks(){return null}function As(){return-1.1}function js(){}function Ms(){throw Error(`ViewTransition is not supported inside a Stage. Place ViewTransition around Stage to animate its DOM container.`)}var Ns=Ms,Ps=Ms,Fs=Ms;function Is(e,t,n,r,i,a,o,s,c,l,u){return r(),i(),u?.(),o(),null}function Ls(){return!0}function Rs(){}function zs(){}function Bs(){}function Vs(){return null}function Hs(){return null}var Us=Object.freeze({pending:!1,data:null,method:null,action:null}),Ws=v.createContext(Us);function Gs(){}typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`)?v.useLayoutEffect:v.useEffect;function Ks(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){let e=Ks(r,t,n);if(e)return e;r=t?null:r.sibling}}function qs(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}var Js=qs(v.createContext(null)),Ys=class extends v.Component{render(){return v.createElement(Js.Provider,{value:this._reactInternals},this.props.children)}};function Xs(){let e=v.useContext(Js);if(e===null)throw Error(`its-fine: useFiber must be called within a <FiberProvider />!`);let t=v.useId();return v.useMemo(()=>{for(let n of[e,e?.alternate]){if(!n)continue;let e=Ks(n,!1,e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}});if(e)return e}},[e,t])}var Zs=Symbol.for(`react.context`),Qs=e=>typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Zs;function $s(){let e=Xs(),[t]=v.useState(()=>new Map);t.clear();let n=e;for(;n;){let e=n.type;Qs(e)&&e!==Js&&!t.has(e)&&t.set(e,v.use(qs(e))),n=n.return}return t}function ec(){let e=$s();return v.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>v.createElement(t,null,v.createElement(n.Provider,{...r,value:e.get(n)})),e=>v.createElement(Ys,{...e})),[e])}var[tc,nc]=`19.3.1`.split(`.`).map(Number);if(tc!==19||nc<3)throw Error(`react-konva requires React 19.3 or later within React 19. Install matching versions of react and react-dom. For React 19.2, use react-konva 19.2. For React 18, use react-konva 18.`);function rc({promise:e}){throw e}var ic=e=>{let t=v.useRef(null),n=v.useRef(null),r=v.useRef(null),i=v.useRef(null),a=v.useRef(null),o=v.useId(),s=(0,co.useFormStatus)(),c=v.useRef({}),l=c.current,u=ec(),d=!!Ks(Xs(),!0,e=>e.type===v.StrictMode),f=v.useRef(!1),p=v.useRef(!1),m=v.useRef(null);v.useInsertionEffect(()=>(p.current=!1,()=>{p.current=!0,f.current&&n.current&&h()}),[]);let h=()=>{m.current?.(),m.current=null,No(),pc.flushSyncFromReconciler(()=>{pc.updateContainer(null,r.current,null)}),n.current?.destroy(),n.current?.off(yo),n.current=null,a.current?.resolve(),a.current=null},g=e=>{if(e===`suspended`){if(!a.current){let e,t=new Promise(t=>{e=t});a.current={promise:t,resolve:e}}}else a.current?.resolve(),a.current=null;pc.updateContainer(v.createElement(v.Activity,{mode:e===`hidden`?`hidden`:`visible`,children:v.createElement(v.Suspense,{fallback:null},i.current,a.current&&v.createElement(rc,{promise:a.current.promise}))}),r.current,null),No(),pc.flushSyncWork()};return v.useLayoutEffect(()=>(m.current?.(),m.current=null,n.current||(n.current=new lo.Stage({width:e.width,height:e.height,container:t.current}),r.current=pc.createContainer(n.current,ho.ConcurrentRoot,null,d,null,o,console.error,console.error,console.error,null,null)),()=>{p.current?h():(m.current=Mo(()=>{p.current&&(m.current?.(),m.current=null,pc.updateContainer(null,r.current,null))}),g(`suspended`))}),[]),v.useEffect(()=>(f.current=!1,()=>{f.current=!0,n.current&&(p.current?h():g(`hidden`))}),[]),v.useLayoutEffect(()=>{typeof n.current.eventBatchFunc==`function`&&n.current.eventBatchFunc(Po(e.eventBatchFunc))},[e.eventBatchFunc]),v.useImperativeHandle(e.forwardedRef,()=>n.current,[]),v.useLayoutEffect(()=>{c.current=e,wo(n.current,e,l),i.current=v.createElement(Ws.Provider,{value:s},v.createElement(u,{},e.children)),g(`visible`)}),v.createElement(`div`,{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},ac=`Layer`,oc=`Group`,sc=`Rect`,cc=`Line`,lc=`Path`,uc=`RegularPolygon`,dc=`19.3.2`,fc={...Io,HostTransitionContext:Ws,rendererVersion:dc,rendererPackageName:`react-konva`,extraDevToolsConfig:null},pc=(0,J.default)(fc);pc.injectIntoDevTools();var mc=v.forwardRef((e,t)=>v.createElement(Ys,{},v.createElement(ic,{...e,forwardedRef:t}))),hc={normal:`#3b3b3b`,selected:`#1c7ed6`,valid:`#2f9e44`,invalid:`#e03131`};function gc({shape:e,width:t,height:n,pxPerM:r,outline:i,opacity:a=1}){let o=t*r,s=n*r,c=hc[i],l=i===`normal`?1.5:3;if(e===`screen`){let e=Math.min(3,s/4);return(0,F.jsxs)(oc,{opacity:a,children:[(0,F.jsx)(sc,{width:o,height:s,fill:`#2d3748`,stroke:c,strokeWidth:l,cornerRadius:2}),(0,F.jsx)(sc,{x:e,y:e,width:Math.max(0,o-e*2),height:Math.max(0,s-e*2),fill:`#63b3ed`,listening:!1})]})}if(e===`table`)return(0,F.jsx)(oc,{opacity:a,children:(0,F.jsx)(sc,{width:o,height:s,fill:`#d9b382`,stroke:c,strokeWidth:l,cornerRadius:3})});let u=Math.max(4,s*.2);return(0,F.jsxs)(oc,{opacity:a,children:[(0,F.jsx)(sc,{width:o,height:s,fill:`#8fb4d9`,stroke:c,strokeWidth:l,cornerRadius:3}),(0,F.jsx)(sc,{width:o,height:u,fill:`#4a6f96`,cornerRadius:[3,3,0,0],listening:!1})]})}var _c=10,vc=6,yc=`#2b2b2b`,bc=`#1c7ed6`,xc=`#e03131`,Sc=`#2f9e44`;function Cc(e){let t=[];for(let n of[`top`,`bottom`,`left`,`right`]){let r=O(e,n),i=e.doors.filter(e=>e.wall===n).sort((e,t)=>e.offset-t.offset),a=0;for(let e of i)e.offset>a+1e-6&&t.push({wall:n,a,b:e.offset}),a=Math.max(a,e.offset+e.width);a<r-1e-6&&t.push({wall:n,a,b:r})}return t}var wc={top:{rot:0,dir:[0,1]},bottom:{rot:270,dir:[0,-1]},left:{rot:0,dir:[1,0]},right:{rot:90,dir:[-1,0]}};function Tc(e,t){switch(t.wall){case`top`:return[t.offset,0];case`bottom`:return[t.offset,e.height];case`left`:return[0,t.offset];case`right`:return[e.width,t.offset]}}function Ec({room:e,door:t,px:n,color:r}){let[i,a]=Tc(e,t),o=wc[t.wall],s=t.width*n;return(0,F.jsxs)(oc,{listening:!1,children:[(0,F.jsx)(`Arc`,{x:i*n,y:a*n,innerRadius:0,outerRadius:s,angle:90,rotation:o.rot,fill:t.isLoading?`rgba(237,137,54,0.2)`:`rgba(66,153,225,0.14)`,stroke:r,strokeWidth:1,dash:[4,4]}),(0,F.jsx)(cc,{points:[i*n,a*n,i*n+o.dir[0]*s,a*n+o.dir[1]*s],stroke:r,strokeWidth:3,lineCap:`round`})]})}var Dc={top:180,bottom:0,left:90,right:-90};function Oc({room:e,screen:t,px:n,outline:r}){let i=re(e,t.wall,t.offset,t.width,D),a=Math.max(4,D*n*.5);return(0,F.jsxs)(oc,{listening:!1,children:[(0,F.jsx)(sc,{x:i.x*n,y:i.y*n,width:i.width*n,height:i.height*n,fill:`#2d3748`,stroke:r,strokeWidth:r===yc?1:2.5,cornerRadius:2}),(0,F.jsx)(uc,{x:(i.x+i.width/2)*n,y:(i.y+i.height/2)*n,sides:3,radius:a,rotation:Dc[t.wall],fill:`#63b3ed`})]})}var kc=[`left`,`right`];function Ac({w:e,h:t,rotation:n}){let r=Math.min(1,Math.max(.35,Math.min(e,t)*.7/24));return(0,F.jsxs)(oc,{x:e/2,y:t/2,offsetX:12,offsetY:12,scaleX:r,scaleY:r,rotation:-n,listening:!1,children:[(0,F.jsx)(lc,{data:`M8 11V8a4 4 0 0 1 8 0v3`,stroke:`#1a1a1a`,strokeWidth:2.5}),(0,F.jsx)(sc,{x:5,y:11,width:14,height:10,cornerRadius:2,fill:`#fff`,stroke:`#1a1a1a`,strokeWidth:2})]})}function jc({mode:e,roomSel:t,onSelectRoom:n,onMoveWallItem:r,onMoveObstacle:i,room:a,items:o,configs:s,preview:c,pxPerM:l,floorRef:u,selectedId:d,onSelect:f,onMove:p,onResize:m}){let h=e===`layout`,[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(null),x=(0,v.useRef)(null),[S,C]=(0,v.useState)(null),w=(0,v.useRef)(null),[T,ee]=(0,v.useState)(null),E=a.width*l,D=a.height*l,te=(e,t)=>se({...e,x:t.x()/l-e.width/2,y:t.y()/l-e.height/2},a),ne=E+12,A=D+12,ie=(e,t)=>((e===`top`||e===`bottom`?t.x:t.y)-vc)/l,ae=(e,t,i,s,c,u)=>(0,F.jsx)(sc,{x:u.x*l,y:u.y*l,width:u.width*l,height:u.height*l,fill:`transparent`,draggable:!0,dragBoundFunc:function(){return this.absolutePosition()},onMouseDown:()=>n({kind:e,id:t}),onTouchStart:()=>n({kind:e,id:t}),onDragStart:e=>{e.cancelBubble=!0;let t=e.target.getStage()?.getPointerPosition();t&&(w.current={along:ie(i,t),offset:s})},onDragMove:n=>{let r=n.target.getStage()?.getPointerPosition(),s=w.current;if(!r||!s)return;let l=Math.min(Math.max(s.offset+ie(i,r)-s.along,0),O(a,i)-c);C({kind:e,id:t,offset:l,valid:fe(a,o,{id:t,kind:e,wall:i,offset:l,width:c})})},onDragEnd:()=>{S?.valid&&r(e,t,S.offset),C(null),w.current=null},onMouseEnter:e=>{let t=e.target.getStage()?.container();t&&(t.style.cursor=i===`top`||i===`bottom`?`ew-resize`:`ns-resize`)},onMouseLeave:e=>{let t=e.target.getStage()?.container();t&&(t.style.cursor=``)}},`hit-${t}`),j=(e,n,r)=>S?.kind===e&&S.id===n?S.valid?Sc:xc:t?.kind===e&&t.id===n?bc:r;return(0,F.jsx)(`div`,{style:{width:ne,height:A,background:`#fff`,boxShadow:`0 4px 18px rgba(0,0,0,0.12)`,touchAction:`none`},ref:u,children:(0,F.jsx)(mc,{width:ne,height:A,onMouseDown:e=>{e.target===e.target.getStage()&&(h?f(null):n(null))},onTouchStart:e=>{e.target===e.target.getStage()&&(h?f(null):n(null))},children:(0,F.jsxs)(ac,{x:vc,y:vc,children:[(0,F.jsx)(sc,{width:E,height:D,fill:`#fff`,listening:!1}),Cc(a).map((e,t)=>{let n=e.a*l,r=(e.b-e.a)*l,i=e.wall===`top`?{x:n,y:-6,width:r,height:vc}:e.wall===`bottom`?{x:n,y:D,width:r,height:vc}:e.wall===`left`?{x:-6,y:n,width:vc,height:r}:{x:E,y:n,width:vc,height:r};return(0,F.jsx)(sc,{...i,fill:yc,listening:!1},t)}),[[-6,-6],[E,-6],[-6,D],[E,D]].map(([e,t])=>(0,F.jsx)(sc,{x:e,y:t,width:vc,height:vc,fill:yc,listening:!1},`${e},${t}`)),a.doors.map(e=>{let t=S?.kind===`door`&&S.id===e.id?{...e,offset:S.offset}:e;return(0,F.jsx)(Ec,{room:a,door:t,px:l,color:j(`door`,e.id,e.isLoading?`#c05621`:`#4a5568`)},e.id)}),a.screens.map(e=>{let t=S?.kind===`screen`&&S.id===e.id?{...e,offset:S.offset}:e;return(0,F.jsx)(Oc,{room:a,screen:t,px:l,outline:j(`screen`,e.id,yc)},e.id)}),a.obstacles.map(e=>{let r=T?.id===e.id?T.valid?Sc:xc:t?.kind===`obstacle`&&t.id===e.id?bc:`#4a4a4a`;return(0,F.jsx)(sc,{x:e.x*l,y:e.y*l,width:e.width*l,height:e.height*l,fill:`#9aa0a6`,stroke:r,strokeWidth:r===`#4a4a4a`?1.5:3,cornerRadius:2,listening:!h,draggable:!h,onMouseDown:()=>n({kind:`obstacle`,id:e.id}),onTouchStart:()=>n({kind:`obstacle`,id:e.id}),dragBoundFunc:t=>({x:Math.min(Math.max(t.x,vc),vc+E-e.width*l),y:Math.min(Math.max(t.y,vc),vc+D-e.height*l)}),onDragMove:t=>ee({id:e.id,valid:pe(a,o,{...e,x:t.target.x()/l,y:t.target.y()/l})}),onDragEnd:t=>{let n=t.target.x()/l,r=t.target.y()/l,s=pe(a,o,{...e,x:n,y:r});t.target.position({x:(s?n:e.x)*l,y:(s?r:e.y)*l}),s&&i(e.id,n,r),ee(null)},onMouseEnter:e=>{let t=e.target.getStage()?.container();t&&!h&&(t.style.cursor=`grab`)},onMouseLeave:e=>{let t=e.target.getStage()?.container();t&&(t.style.cursor=``)}},e.id)}),o.map(e=>{let t=s[e.type]?.shape??`chair`,n=y?.id===e.id,r=n?y.rect:e,i=n?y.valid?`valid`:`invalid`:g?.id===e.id?g.valid?`valid`:`invalid`:d===e.id?`selected`:`normal`,c=oe({...r,rotation:e.rotation}),u=r.width*l,m=r.height*l;return(0,F.jsxs)(oc,{x:(r.x+r.width/2)*l,y:(r.y+r.height/2)*l,offsetX:u/2,offsetY:m/2,rotation:e.rotation,listening:h,draggable:h&&!e.locked,onMouseDown:()=>f(e.id),onTouchStart:()=>f(e.id),dragBoundFunc:e=>{let t=c.width/2*l,n=c.height/2*l;return{x:Math.min(Math.max(e.x,vc+t),vc+E-t),y:Math.min(Math.max(e.y,vc+n),vc+D-n)}},onDragStart:e=>{e.target.moveToTop()},onDragMove:t=>{let n=te(e,t.target);_({id:e.id,valid:le(n,o,a,e.id)})},onDragEnd:t=>{let n=t.target,r=te(e,n),i=le(r,o,a,e.id),s=i?r:e;n.position({x:(s.x+e.width/2)*l,y:(s.y+e.height/2)*l}),i&&p(e.id,r.x,r.y),_(null)},onMouseEnter:t=>{let n=t.target.getStage()?.container();n&&(n.style.cursor=e.locked?`not-allowed`:`grab`)},onMouseLeave:e=>{let t=e.target.getStage()?.container();t&&(t.style.cursor=``)},children:[(0,F.jsx)(gc,{shape:t,width:r.width,height:r.height,pxPerM:l,outline:i}),e.locked&&(0,F.jsx)(Ac,{w:u,h:m,rotation:e.rotation})]},e.id)}),o.map(e=>{let t=s[e.type]?.shape===`screen`;if(!h||e.id!==d||!t||e.locked||e.rotation!==0||g?.id===e.id)return null;let n=y?.id===e.id?y.rect:e,r={left:[n.x,n.y+n.height/2],right:[n.x+n.width,n.y+n.height/2]};return kc.map(t=>(0,F.jsx)(sc,{x:r[t][0]*l,y:r[t][1]*l,offsetX:_c/2,offsetY:_c/2,width:_c,height:_c,fill:`#fff`,stroke:`#1c7ed6`,strokeWidth:2,cornerRadius:2,hitStrokeWidth:12,draggable:!0,dragBoundFunc:function(){return this.absolutePosition()},onDragStart:t=>{t.cancelBubble=!0,x.current={x:e.x,y:e.y,width:e.width,height:e.height}},onDragMove:n=>{let r=n.target.getStage()?.getPointerPosition(),i=x.current;if(!r||!i)return;let s=be(i,t,(r.x-vc)/l,a);b({id:e.id,rect:s,valid:le({...e,...s},o,a,e.id)})},onDragEnd:()=>{y?.valid&&m(e.id,y.rect),b(null),x.current=null},onMouseEnter:e=>{let t=e.target.getStage()?.container();t&&(t.style.cursor=`ew-resize`)},onMouseLeave:e=>{let t=e.target.getStage()?.container();t&&(t.style.cursor=``)}},`${e.id}-${t}`))}),!h&&a.doors.map(e=>{let t=S?.kind===`door`&&S.id===e.id?S.offset:e.offset;return ae(`door`,e.id,e.wall,t,e.width,k(a,{...e,offset:t}))}),!h&&a.screens.map(e=>{let t=S?.kind===`screen`&&S.id===e.id?S.offset:e.offset;return ae(`screen`,e.id,e.wall,t,e.width,re(a,e.wall,t,e.width,.3))}),c&&(0,F.jsx)(`Group`,{x:c.x*l,y:c.y*l,listening:!1,children:(0,F.jsx)(gc,{shape:c.shape,width:c.width,height:c.height,pxPerM:l,outline:c.valid?`valid`:`invalid`,opacity:.85})})]})})})}function Mc({mode:e,onChange:t}){let n=t=>({flex:1,height:30,border:`none`,borderRadius:6,cursor:`pointer`,font:`600 13px system-ui, sans-serif`,background:e===t?`#fff`:`transparent`,color:e===t?`#222`:`#666`,boxShadow:e===t?`0 1px 3px rgba(0,0,0,0.15)`:`none`});return(0,F.jsxs)(`div`,{style:{gridColumn:`1 / -1`,display:`flex`,gap:2,padding:3,background:`#d9d9d9`,borderRadius:9},children:[(0,F.jsx)(`button`,{style:n(`layout`),onClick:()=>t(`layout`),children:`Layout`}),(0,F.jsx)(`button`,{style:n(`room`),onClick:()=>t(`room`),children:`Room`})]})}var Nc=34,Pc=4,Fc=7,Ic=12,Lc=4,Rc=40,zc=40;function Bc({value:e,min:t,max:n=999,step:r=1,wrap:i=!1,rows:a=5,disabled:o=!1,format:s,onChange:c}){let l=e=>Math.round(e/r),u=(String(r).split(`.`)[1]??``).length,[d,f]=(0,v.useState)(l(e)),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(``),b=(0,v.useRef)(l(e)),x=(0,v.useRef)(l(e)),S=(0,v.useRef)(0),C=(0,v.useRef)(0),w=(0,v.useRef)(l(e)),T=(0,v.useRef)(null),ee=(0,v.useRef)(null),E=(0,v.useRef)([]),D=l(t),te=l(n),ne=te-D+1,O=(0,v.useRef)({imin:D,imax:te,n:ne,wrap:i,step:r,onChange:c,valueIdx:l(e)});O.current={imin:D,imax:te,n:ne,wrap:i,step:r,onChange:c,valueIdx:l(e)};let re=e=>O.current.imin+((e-O.current.imin)%O.current.n+O.current.n)%O.current.n,k=e=>O.current.wrap?re(e):e,A=e=>O.current.wrap?e:Math.min(O.current.imax,Math.max(O.current.imin,e)),ie=e=>{let t=A(e);b.current=t,f(t);let n=k(Math.round(t));return n!==x.current&&(x.current=n,O.current.onChange(Math.round(n*O.current.step*1e3)/1e3)),t},ae=()=>{cancelAnimationFrame(S.current),S.current=0,window.clearTimeout(C.current),C.current=0},j=()=>{let e=Math.round(b.current);if(!O.current.wrap)return O.current.valueIdx;let t=re(O.current.valueIdx-e+O.current.imin)-O.current.imin;return e+(t>O.current.n/2?t-O.current.n:t)},oe=()=>{S.current=requestAnimationFrame(()=>{S.current=0,!ee.current&&k(Math.round(b.current))!==O.current.valueIdx&&(x.current=O.current.valueIdx,M(j(),0))})},se=e=>{ae();let t=A(Math.round(e));w.current=t;let n=performance.now(),r=e=>{let i=Math.min(.05,(e-n)/1e3);n=e;let a=b.current+(t-b.current)*(1-Math.exp(-7*i));Math.abs(t-a)<.003?(ie(t),S.current=0,oe()):(ie(a),S.current=requestAnimationFrame(r))};S.current=requestAnimationFrame(r)};function M(e,t){ae();let n=A(Math.round(e));w.current=n;let r=b.current-n,i=Math.abs(r),a=i>0&&Math.sign(t)===-Math.sign(r)?Math.max(Ic,Math.abs(t)/i):Ic,o=t+a*r,s=performance.now(),c=e=>{let t=(e-s)/1e3,i=Math.exp(-a*t),l=n+(r+o*t)*i,u=(o-a*(r+o*t))*i;Math.abs(l-n)<.003&&Math.abs(u)<.05||t>1.5?(ie(n),S.current=0,oe()):(ie(l),S.current=requestAnimationFrame(c))};S.current=requestAnimationFrame(c)}(0,v.useEffect)(()=>{if(ee.current||S.current)return;let e=j();b.current=e,x.current=k(Math.round(e)),f(e)},[e]),(0,v.useEffect)(()=>ae,[]);let ce=(0,v.useRef)(``),le=(0,v.useRef)(0),ue=()=>{window.clearTimeout(le.current);let e=ce.current;ce.current=``,y(``);let t=parseFloat(e);if(Number.isNaN(t))return;let n=O.current,r=Math.round(t/n.step);if(n.wrap){let e=re(r)-re(Math.round(b.current));r=Math.round(b.current)+(Math.abs(e)>n.n/2?e-Math.sign(e)*n.n:e)}else r=Math.min(n.imax,Math.max(n.imin,r));se(r)},de=e=>{ce.current=e,y(e),window.clearTimeout(le.current),e&&(le.current=window.setTimeout(ue,1500))};(0,v.useEffect)(()=>{if(!h||o)return;let e=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;let t=ce.current,n=()=>{e.preventDefault(),e.stopImmediatePropagation()};/^[0-9]$/.test(e.key)||e.key===`.`&&u>0&&!t.includes(`.`)?(n(),t.length<6&&(ae(),de(t+e.key))):e.key===`Backspace`||e.key===`Delete`?(n(),de(t.slice(0,-1))):e.key===`Enter`&&t?(n(),ue()):e.key===`Escape`&&t&&(n(),de(``))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[h,o,u]),(0,v.useEffect)(()=>()=>window.clearTimeout(le.current),[]);let fe=e=>{if(o)return;e.currentTarget.setPointerCapture(e.pointerId);let t=S.current!==0||C.current!==0;ae(),ee.current={y0:e.clientY,pos0:b.current,moved:!1,wasMoving:t},E.current=[{t:performance.now(),pos:b.current}],m(!0)},pe=e=>{let t=ee.current;if(!t)return;let n=e.clientY-t.y0;Math.abs(n)>Pc&&(t.moved=!0);let r=ie(t.pos0-n/Nc),i=performance.now();E.current.push({t:i,pos:r}),E.current=E.current.filter(e=>i-e.t<100)},me=e=>{let t=ee.current;if(ee.current=null,m(!1),!t)return;if(!t.moved){if(t.wasMoving)M(b.current,0);else{let n=T.current.getBoundingClientRect(),r=Math.round((e.clientY-n.top-a*Nc/2)/Nc);b.current=t.pos0,se(Math.round(t.pos0)+r)}return}let n=performance.now(),r=E.current,i=0;if(r.length>1&&n-r[r.length-1].t<80){let e=r[0],t=(r[r.length-1].t-e.t)/1e3;t>.005&&(i=(r[r.length-1].pos-e.pos)/t)}i=Math.max(-40,Math.min(Rc,i)),Math.abs(i)<Lc?M(b.current+i*.1,i):se(b.current+i/Fc)},he=e=>{if(!o){if(Math.abs(e.deltaY)>=zc){let t=S.current?w.current:Math.round(b.current);se(t+Math.sign(e.deltaY))}else ae(),ie(b.current+e.deltaY/(Nc*1.5)),C.current=window.setTimeout(()=>{C.current=0,M(b.current,0)},120)}},ge=e=>{if(!o){if(e.key===`ArrowUp`)se(Math.round(b.current)+1);else if(e.key===`ArrowDown`)se(Math.round(b.current)-1);else return;e.preventDefault()}},_e=Math.floor(a/2)+1,N=Math.round(d),ve=i?N-_e:Math.max(D,N-_e),ye=i?N+_e:Math.min(te,N+_e),be=[];for(let e=ve;e<=ye;e++){let t=e-d,n=(i?re(e):e)*r;be.push((0,F.jsx)(`div`,{style:{position:`absolute`,left:0,right:0,height:Nc,display:`flex`,alignItems:`center`,justifyContent:`center`,font:`600 20px system-ui, sans-serif`,color:`#222`,opacity:Math.max(0,1-Math.abs(t)*(a<=3?.55:.38)),transform:`translateY(${((a-1)/2+t)*Nc}px) scale(${1-Math.min(1,Math.abs(t))*.12})`,pointerEvents:`none`},children:s?s(n):n.toFixed(u)},e))}return(0,F.jsxs)(`div`,{ref:T,tabIndex:o?-1:0,role:`spinbutton`,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":n,"aria-disabled":o,onPointerDown:fe,onPointerMove:pe,onPointerUp:me,onPointerCancel:me,onWheel:he,onKeyDown:ge,onMouseEnter:()=>g(!0),onMouseLeave:()=>{g(!1),ce.current&&ue()},title:o?void 0:`Scroll, drag, or hover and type a number`,style:{position:`relative`,width:`100%`,height:a*Nc,overflow:`hidden`,background:`#f4f4f4`,borderRadius:10,cursor:o?`not-allowed`:p?`grabbing`:`ns-resize`,opacity:o?.45:1,userSelect:`none`,touchAction:`none`,outline:`none`},children:[(0,F.jsx)(`div`,{style:{position:`absolute`,left:6,right:6,top:(a-1)/2*Nc,height:Nc,background:`rgba(0,0,0,0.08)`,borderRadius:8,pointerEvents:`none`}}),be,_&&(0,F.jsxs)(`div`,{style:{position:`absolute`,left:6,right:6,top:(a-1)/2*Nc,height:Nc,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#fff`,border:`1.5px solid #1c7ed6`,borderRadius:8,boxSizing:`border-box`,font:`600 20px system-ui, sans-serif`,color:`#1c7ed6`,pointerEvents:`none`},children:[_,(0,F.jsx)(`span`,{style:{width:1.5,height:20,background:`#1c7ed6`,marginLeft:2}})]})]})}var Vc={gridColumn:`1 / -1`,display:`flex`,flexDirection:`column`,gap:14},Hc={font:`600 12px system-ui, sans-serif`,color:`#555`,marginBottom:4},Uc={font:`12px system-ui, sans-serif`,color:`#888`,marginTop:4},Wc={font:`600 15px system-ui, sans-serif`,color:`#222`},Gc={alignSelf:`flex-start`,border:`none`,background:`none`,padding:0,cursor:`pointer`,font:`13px system-ui, sans-serif`,color:`#555`},Kc={height:32,padding:`0 12px`,border:`1px solid #c4c4c4`,background:`#fff`,borderRadius:8,cursor:`pointer`,font:`13px system-ui, sans-serif`,color:`#222`},qc={display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(96px, 1fr))`,gap:12},Jc=e=>e.toFixed(1);function Yc(e){(0,v.useEffect)(()=>{let t=t=>t.key===`Escape`&&e();return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}var Xc={...Kc,color:`#e03131`,borderColor:`#e8a8a8`};function Zc({room:e,minSize:t,notice:n,onResize:r,onAddDoor:i,onAddScreen:a,onAddObstacle:o,onExport:s,onImport:c}){let l=(0,v.useRef)(null),u=t.width>C.min||t.height>C.min;return(0,F.jsxs)(`div`,{style:Vc,children:[(0,F.jsx)(`div`,{style:Wc,children:`Room`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Size (m)`}),(0,F.jsxs)(`div`,{style:qc,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Uc,children:`Width`}),(0,F.jsx)(Bc,{value:e.width,min:t.width,max:C.max,step:.1,rows:3,format:Jc,onChange:e=>r({width:e})})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Uc,children:`Length`}),(0,F.jsx)(Bc,{value:e.height,min:t.height,max:C.max,step:.1,rows:3,format:Jc,onChange:e=>r({height:e})})]})]}),u&&(0,F.jsxs)(`div`,{style:Uc,children:[`The room can't shrink past what's placed in it (min `,Jc(t.width),` × `,Jc(t.height),` m).`]})]}),(0,F.jsxs)(`div`,{style:{display:`grid`,gap:8},children:[(0,F.jsx)(`button`,{style:Kc,onClick:i,children:`Add door`}),(0,F.jsx)(`button`,{style:{...Kc,opacity:e.screens.length>=2?.45:1},disabled:e.screens.length>=2,onClick:a,children:`Add screen`}),e.screens.length>=2&&(0,F.jsxs)(`div`,{style:{...Uc,marginTop:-4},children:[`Maximum of `,2,` screens.`]}),(0,F.jsx)(`button`,{style:Kc,onClick:o,children:`Add obstacle`})]}),n&&(0,F.jsx)(`div`,{style:{...Uc,color:`#e03131`,marginTop:0},children:n}),(0,F.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,F.jsx)(`button`,{style:{...Kc,flex:1},onClick:s,children:`Export room`}),(0,F.jsx)(`button`,{style:{...Kc,flex:1},onClick:()=>l.current?.click(),children:`Import room`}),(0,F.jsx)(`input`,{ref:l,type:`file`,accept:`application/json,.json`,style:{display:`none`},onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&c(t)}})]}),(0,F.jsx)(`div`,{style:Uc,children:`Furniture isn't included in room.json.`})]})}function Qc({door:e,isLast:t,notice:n,onPatch:r,onDelete:i,onClose:a}){return Yc(a),(0,F.jsxs)(`div`,{style:Vc,children:[(0,F.jsx)(`button`,{onClick:a,style:Gc,children:`← Done`}),(0,F.jsx)(`div`,{style:Wc,children:`Door`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Width (m)`}),(0,F.jsx)(Bc,{value:e.width,min:w.min,max:w.max,step:.1,rows:3,format:Jc,onChange:e=>r({width:e})})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`button`,{style:{...Kc,width:`100%`,background:e.isLoading?`#2b2b2b`:`#fff`,color:e.isLoading?`#fff`:`#222`},onClick:()=>r({isLoading:!e.isLoading}),children:[`Loading door: `,e.isLoading?`on`:`off`]}),(0,F.jsx)(`div`,{style:Uc,children:`Furniture is carried through a loading door.`})]}),(0,F.jsx)(`div`,{style:Uc,children:`The swing area and 0.6 m inside the opening stay clear of furniture.`}),n&&(0,F.jsx)(`div`,{style:{...Uc,color:`#e03131`,marginTop:0},children:n}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`button`,{style:{...Xc,width:`100%`,opacity:t?.45:1,cursor:t?`not-allowed`:`pointer`},disabled:t,onClick:i,children:`Delete door`}),t&&(0,F.jsx)(`div`,{style:Uc,children:`A room needs at least one door.`})]})]})}function $c({screen:e,notice:t,onPatch:n,onDelete:r,onClose:i}){return Yc(i),(0,F.jsxs)(`div`,{style:Vc,children:[(0,F.jsx)(`button`,{onClick:i,style:Gc,children:`← Done`}),(0,F.jsx)(`div`,{style:Wc,children:`Screen`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Width (m)`}),(0,F.jsx)(Bc,{value:e.width,min:T.min,max:T.max,step:.1,rows:3,format:Jc,onChange:e=>n({width:e})})]}),(0,F.jsx)(`div`,{style:Uc,children:`Drag it along its wall. A 0.3 m strip in front of the wall stays clear.`}),t&&(0,F.jsx)(`div`,{style:{...Uc,color:`#e03131`,marginTop:0},children:t}),(0,F.jsx)(`button`,{style:Xc,onClick:r,children:`Delete screen`})]})}function el({obstacle:e,notice:t,onPatch:n,onDelete:r,onClose:i}){return Yc(i),(0,F.jsxs)(`div`,{style:Vc,children:[(0,F.jsx)(`button`,{onClick:i,style:Gc,children:`← Done`}),(0,F.jsx)(`div`,{style:Wc,children:`Obstacle`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Size (m)`}),(0,F.jsxs)(`div`,{style:qc,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Uc,children:`Width`}),(0,F.jsx)(Bc,{value:e.width,min:ee.min,max:ee.max,step:.1,rows:3,format:Jc,onChange:e=>n({width:e})})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Uc,children:`Length`}),(0,F.jsx)(Bc,{value:e.height,min:ee.min,max:ee.max,step:.1,rows:3,format:Jc,onChange:e=>n({height:e})})]})]})]}),t&&(0,F.jsx)(`div`,{style:{...Uc,color:`#e03131`,marginTop:0},children:t}),(0,F.jsx)(`button`,{style:Xc,onClick:r,children:`Delete obstacle`})]})}function tl({pxPerM:e,roomWidthPx:t}){return(0,F.jsx)(`div`,{style:{width:t,height:40,display:`flex`,alignItems:`flex-end`,paddingBottom:4,boxSizing:`border-box`},children:(0,F.jsxs)(`div`,{style:{font:`12px system-ui, sans-serif`,color:`#555`},children:[(0,F.jsx)(`div`,{style:{width:e,height:6,borderBottom:`2px solid #555`,borderLeft:`2px solid #555`,borderRight:`2px solid #555`,boxSizing:`border-box`,marginBottom:2}}),`1 m`]})})}function nl({config:e,placed:t,onSetAvailable:n,onSetSeats:r,onClose:i}){return(0,v.useEffect)(()=>{let e=e=>e.key===`Escape`&&i();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]),(0,F.jsxs)(`div`,{style:Vc,children:[(0,F.jsx)(`button`,{onClick:i,style:Gc,children:`← Back`}),(0,F.jsx)(`div`,{style:Wc,children:e.name}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Available`}),(0,F.jsx)(Bc,{value:e.available,min:t,onChange:n}),(0,F.jsxs)(`div`,{style:Uc,children:[t,` placed`]})]}),e.shape===`screen`&&(0,F.jsx)(`div`,{style:Uc,children:`Click a placed screen, then drag an end handle (or use the Length wheel) to change its length.`}),e.seatsPerUnit!==void 0&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:e.isTable?`Seats per table`:`Seats each`}),(0,F.jsx)(Bc,{value:e.seatsPerUnit,min:1,onChange:r})]})]})}var rl=120,il=46;function al({value:e,disabled:t=!1,onChange:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(!1),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),l=(0,v.useRef)(``),u=(0,v.useRef)(0),d=(0,v.useRef)({onChange:n});d.current={onChange:n};let f=e=>{l.current=e,c(e),window.clearTimeout(u.current),e&&(u.current=window.setTimeout(p,1500))};function p(){window.clearTimeout(u.current);let e=parseInt(l.current,10);l.current=``,c(``),Number.isNaN(e)||d.current.onChange((e%360+360)%360)}(0,v.useEffect)(()=>{if(!a||t)return;let e=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;let t=l.current,n=()=>{e.preventDefault(),e.stopImmediatePropagation()};/^[0-9]$/.test(e.key)?(n(),t.length<3&&f(t+e.key)):e.key===`Backspace`||e.key===`Delete`?(n(),f(t.slice(0,-1))):e.key===`Enter`&&t?(n(),p()):e.key===`Escape`&&t&&(n(),f(``))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[a,t]),(0,v.useEffect)(()=>()=>window.clearTimeout(u.current),[]);let m=e=>(Math.round(e)%360+360)%360,h=e=>{let t=r.current.getBoundingClientRect(),n=e.clientX-(t.left+t.width/2),i=e.clientY-(t.top+t.height/2),a=Math.atan2(n,-i)*180/Math.PI;return e.shiftKey&&(a=Math.round(a/15)*15),m(a)},g=e=>{t||(e.currentTarget.setPointerCapture(e.pointerId),i.current=!0,n(h(e)))},_=e=>{i.current&&n(h(e))},y=()=>{i.current=!1},b=e*Math.PI/180,x=rl/2,S=x+il*Math.sin(b),C=x-il*Math.cos(b);return(0,F.jsxs)(`svg`,{ref:r,width:`100%`,viewBox:`0 0 ${rl} ${rl}`,style:{maxWidth:160,display:`block`,margin:`0 auto`,touchAction:`none`,userSelect:`none`,opacity:t?.45:1,cursor:t?`not-allowed`:`pointer`,outline:`none`},tabIndex:t?-1:0,role:`slider`,"aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":359,onMouseEnter:()=>o(!0),onMouseLeave:()=>{o(!1),l.current&&p()},onPointerDown:g,onPointerMove:_,onPointerUp:y,onPointerCancel:y,onWheel:r=>!t&&n(m(e+Math.sign(r.deltaY))),onKeyDown:r=>{if(!t){if(r.key===`ArrowRight`||r.key===`ArrowUp`)n(m(e+1));else if(r.key===`ArrowLeft`||r.key===`ArrowDown`)n(m(e-1));else return;r.preventDefault()}},children:[(0,F.jsx)(`circle`,{cx:x,cy:x,r:56,fill:`#f4f4f4`}),(0,F.jsx)(`circle`,{cx:x,cy:x,r:il,fill:`#fff`,stroke:`#bbb`,strokeWidth:2}),[0,90,180,270].map(e=>{let t=e*Math.PI/180;return(0,F.jsx)(`line`,{x1:x+40*Math.sin(t),y1:x-40*Math.cos(t),x2:x+il*Math.sin(t),y2:x-il*Math.cos(t),stroke:`#bbb`,strokeWidth:2},e)}),(0,F.jsx)(`line`,{x1:x,y1:x,x2:S,y2:C,stroke:`#1c7ed6`,strokeWidth:2,opacity:.5}),(0,F.jsx)(`circle`,{cx:S,cy:C,r:9,fill:`#1c7ed6`,stroke:`#fff`,strokeWidth:2}),(0,F.jsx)(`text`,{x,y:66,textAnchor:`middle`,style:{font:`600 18px system-ui, sans-serif`,fill:s?`#1c7ed6`:`#222`},children:s?`${s}|`:`${e}°`})]})}var ol=.3,sl=6,cl=e=>e.toFixed(1);function ll({item:e,config:t,onPatch:n,onDelete:r,onClose:i}){let[a,o]=(0,v.useState)(``);(0,v.useEffect)(()=>{let e=e=>e.key===`Escape`&&i();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]);let s=e=>{let t=n(e);o(t?``:`No room for that change.`)},c=t.shape===`screen`,l=je(e,t)??1,u=e.seatsOverride!==void 0,d=(e,t)=>Math.min(t,e);return(0,F.jsxs)(`div`,{style:Vc,children:[(0,F.jsx)(`button`,{onClick:i,style:Gc,children:`← Done`}),(0,F.jsxs)(`div`,{style:Wc,children:[t.name,e.locked?` 🔒`:``]}),t.rotatable&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Rotation`}),(0,F.jsx)(al,{value:e.rotation,disabled:e.locked,onChange:e=>s({rotation:e})})]}),t.isTable&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Seats at this table`}),(0,F.jsx)(Bc,{value:l,min:1,max:99,rows:3,format:e=>String(e),onChange:e=>s({seatsOverride:e})}),u&&(0,F.jsxs)(`button`,{onClick:()=>s({seatsOverride:void 0}),style:{...Uc,border:`none`,background:`none`,padding:0,cursor:`pointer`,color:`#1c7ed6`,textDecoration:`underline`},children:[`Reset to default (`,t.seatsPerUnit??1,`)`]})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Size (m)`}),(0,F.jsx)(`div`,{style:qc,children:c?(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Uc,children:`Length`}),(0,F.jsx)(Bc,{value:e.width,min:.5,max:sl,step:.1,rows:3,format:cl,onChange:e=>s({width:e})})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Uc,children:`Width`}),(0,F.jsx)(Bc,{value:e.width,min:d(e.width,ol),max:sl,step:.1,rows:3,format:cl,onChange:e=>s({width:e})})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Uc,children:`Length`}),(0,F.jsx)(Bc,{value:e.height,min:d(e.height,ol),max:sl,step:.1,rows:3,format:cl,onChange:e=>s({height:e})})]})]})})]}),a&&(0,F.jsx)(`div`,{style:{...Uc,color:`#e03131`,marginTop:0},children:a}),(0,F.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,F.jsx)(`button`,{style:{...Kc,flex:1},onClick:()=>s({locked:!e.locked}),children:e.locked?`Unlock`:`Lock`}),(0,F.jsx)(`button`,{style:{...Kc,flex:1,color:`#e03131`,borderColor:`#e8a8a8`},onClick:r,children:`Delete`})]})]})}var ul=e=>e.toFixed(1),dl={width:.5,height:.5,seats:1},fl={width:1.8,height:.8,seats:8};function pl({onSave:e,onCancel:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(dl.width),[c,l]=(0,v.useState)(dl.height),[u,d]=(0,v.useState)(dl.seats),[f,p]=(0,v.useState)(10);(0,v.useEffect)(()=>{let e=e=>e.key===`Escape`&&t();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]);let m=e=>{a(e);let t=e?fl:dl;s(t.width),l(t.height),d(t.seats)},h=n.trim().length>0,g=e=>({...Kc,flex:1,background:e?`#2b2b2b`:`#fff`,color:e?`#fff`:`#222`});return(0,F.jsxs)(`div`,{style:Vc,children:[(0,F.jsx)(`button`,{onClick:t,style:Gc,children:`← Cancel`}),(0,F.jsx)(`div`,{style:Wc,children:`New furniture`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Name`}),(0,F.jsx)(`input`,{value:n,autoFocus:!0,maxLength:24,placeholder:`e.g. Couch`,onChange:e=>r(e.target.value),style:{width:`100%`,boxSizing:`border-box`,height:32,padding:`0 10px`,border:`1px solid #c4c4c4`,borderRadius:8,font:`14px system-ui, sans-serif`}})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Type`}),(0,F.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,F.jsx)(`button`,{style:g(!i),onClick:()=>m(!1),children:`Seating`}),(0,F.jsx)(`button`,{style:g(i),onClick:()=>m(!0),children:`Table`})]})]}),(0,F.jsxs)(`div`,{style:qc,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Width (m)`}),(0,F.jsx)(Bc,{value:o,min:.3,max:6,step:.1,rows:3,format:ul,onChange:s})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Length (m)`}),(0,F.jsx)(Bc,{value:c,min:.3,max:6,step:.1,rows:3,format:ul,onChange:l})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Seats`}),(0,F.jsx)(Bc,{value:u,min:1,max:99,rows:3,onChange:d})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:Hc,children:`Available`}),(0,F.jsx)(Bc,{value:f,min:1,max:999,rows:3,onChange:p})]})]}),!h&&(0,F.jsx)(`div`,{style:Uc,children:`Enter a name to save.`}),(0,F.jsx)(`button`,{style:{...Kc,background:h?`#2b2b2b`:`#ddd`,color:h?`#fff`:`#999`,cursor:h?`pointer`:`not-allowed`},disabled:!h,onClick:()=>e({name:n.trim(),isTable:i,width:o,height:c,seats:u,available:f}),children:`Save`})]})}var ml=40;function hl(){let[e,t]=(0,v.useReducer)(Oe,De),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)({kind:`tiles`}),[o,s]=(0,v.useState)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(null),u=(0,v.useRef)(e.room);u.current=e.room;let[d,f]=(0,v.useState)(60),[p,m]=(0,v.useState)(`layout`),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(``),S=(0,v.useRef)(1),C=(0,v.useRef)(1),w=e.items.find(e=>e.id===o)??null,T=(0,v.useCallback)(e=>{s(e),e&&a({kind:`tiles`})},[]),ee=e=>{s(null),a(e)},E=(0,v.useCallback)(()=>a({kind:`tiles`}),[]),D=(0,v.useCallback)(()=>s(null),[]),te=e=>{m(e),s(null),g(null),y(``),a({kind:`tiles`})},ne=(0,v.useCallback)(()=>{g(null),y(``)},[]),re=(0,v.useCallback)(()=>{o&&(t({kind:`remove`,id:o}),s(null))},[o]);(0,v.useEffect)(()=>{let e=e=>{if(e.key!==`Delete`&&e.key!==`Backspace`)return;let t=e.target;(!t||t.tagName!==`INPUT`&&t.tagName!==`TEXTAREA`&&!t.isContentEditable)&&(h?(e.preventDefault(),P()):o&&(e.preventDefault(),re()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o,re,h,e.room]),(0,v.useEffect)(()=>{let e=l.current;if(!e)return;let t=new ResizeObserver(([e])=>{let{width:t,height:n}=e.contentRect;f(b(u.current,t-12,n-12-ml))});return t.observe(e),()=>t.disconnect()},[e.room.width,e.room.height]);let k=t=>{let n=c.current?.getBoundingClientRect();if(!n)return null;let r=(n.width-e.room.width*d)/2,i=t.clientX-n.left-r,a=t.clientY-n.top-r;if(i<0||a<0||i>e.room.width*d||a>e.room.height*d)return null;let{defaultWidth:o,defaultHeight:s}=e.configs[t.type];return se({x:i/d-o/2,y:a/d-s/2,width:o,height:s},e.room)};(0,v.useEffect)(()=>{if(!n)return;let i=n.type,a=e=>r({type:i,clientX:e.clientX,clientY:e.clientY}),o=n=>{let a=k({type:i,clientX:n.clientX,clientY:n.clientY});a&&Ae(e.items,i,e.configs[i].available)>0&&le(a,e.items,e.room)&&t({kind:`add`,id:`item-${S.current++}`,type:i,x:a.x,y:a.y}),r(null)},s=()=>r(null);return window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o),window.addEventListener(`pointercancel`,s),()=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,s)}},[n?.type,e.items,e.room,e.configs,d]);let A=(0,v.useMemo)(()=>{if(!n)return null;let t=k(n);return t?{shape:e.configs[n.type].shape,...t,valid:le(t,e.items,e.room)}:null},[n,e.items,e.room,d]),ie=(e,t,n)=>{a({kind:`tiles`}),r({type:e,clientX:t,clientY:n})},ae=(n,r)=>{if(!(`rotation`in r||`width`in r||`height`in r))return t({kind:`update`,id:n.id,patch:r}),!0;let i=ue(n,r,e.items,e.room);return i?(t({kind:`update`,id:n.id,patch:{...r,x:i.x,y:i.y}}),!0):!1},j=e.room,oe=e=>{t({kind:`setRoom`,room:e}),y(``)},M=e=>y(e),ce=e=>`${e}-${Math.random().toString(36).slice(2,8)}`,de=t=>{let n=_e(j,e.items,t);n?oe(n):M(`Can't shrink past what's placed in the room.`)},he=()=>{for(let t of[`bottom`,`right`,`left`,`top`]){let n=N(j,e.items,`door`,t,x);if(n===null)continue;let r={id:ce(`door`),wall:t,offset:n,width:x,isLoading:!1};oe({...j,doors:[...j.doors,r]}),g({kind:`door`,id:r.id});return}M(`No free space on any wall for a door.`)},ye=()=>{if(!(j.screens.length>=2)){for(let t of[`top`,`left`,`right`,`bottom`]){let n=Math.min(4,O(j,t)),r=N(j,e.items,`screen`,t,n);if(r===null)continue;let i={id:ce(`screen`),wall:t,offset:r,width:n};oe({...j,screens:[...j.screens,i]}),g({kind:`screen`,id:i.id});return}M(`No free space on any wall for a screen.`)}},be=()=>{let t=ve(j,e.items,.6,.6);if(!t)return M(`No free space for an obstacle.`);let n={id:ce(`obstacle`),...t,width:.6,height:.6};oe({...j,obstacles:[...j.obstacles,n]}),g({kind:`obstacle`,id:n.id})},xe=(t,n)=>{let r=j.doors.find(e=>e.id===t);if(!r)return;let i={...r,...n};if(i.offset=Math.max(0,Math.min(i.offset,O(j,i.wall)-i.width)),!fe(j,e.items,{id:t,kind:`door`,wall:i.wall,offset:i.offset,width:i.width}))return M(`No room for that change.`);oe({...j,doors:j.doors.map(e=>e.id===t?i:e)})},Se=(t,n)=>{let r=j.screens.find(e=>e.id===t);if(!r)return;let i={...r,...n};if(i.offset=Math.max(0,Math.min(i.offset,O(j,i.wall)-i.width)),!fe(j,e.items,{id:t,kind:`screen`,wall:i.wall,offset:i.offset,width:i.width}))return M(`No room for that change.`);oe({...j,screens:j.screens.map(e=>e.id===t?i:e)})},Ce=(t,n)=>{let r=j.obstacles.find(e=>e.id===t);if(!r)return;let i=se({...r,...n},j);if(!pe(j,e.items,i))return M(`No room for that change.`);oe({...j,obstacles:j.obstacles.map(e=>e.id===t?i:e)})},P=()=>{if(h){if(h.kind===`door`){if(j.doors.length<=1)return M(`A room needs at least one door.`);oe({...j,doors:j.doors.filter(e=>e.id!==h.id)})}else h.kind===`screen`?oe({...j,screens:j.screens.filter(e=>e.id!==h.id)}):oe({...j,obstacles:j.obstacles.filter(e=>e.id!==h.id)});g(null)}},Ee=()=>{let e=URL.createObjectURL(new Blob([we(j)],{type:`application/json`})),t=document.createElement(`a`);t.href=e,t.download=`room.json`,t.click(),URL.revokeObjectURL(e)},je=async n=>{let r=Te(await n.text());if(!r.ok)return M(`Import failed: ${r.error}`);if(e.items.length>0&&!window.confirm(`Importing replaces the current room. Continue?`))return;let i=e.items.length>0&&!me(r.room,e.items);t({kind:`setRoom`,room:r.room,clearItems:i}),s(null),g(null),y(i?`Furniture was cleared because it didn't fit the imported room.`:``)},Me=e=>{let n=`custom-${C.current++}`;t({kind:`addConfig`,config:{id:n,name:e.name,shape:e.isTable?`table`:`chair`,defaultWidth:e.width,defaultHeight:e.height,isTable:e.isTable,rotatable:!0,available:e.available,seatsPerUnit:e.seats}}),a({kind:`tiles`})},Ne=Object.fromEntries(e.typeOrder.map(t=>[t,Ae(e.items,t,e.configs[t].available)])),Pe=null;if(p===`room`){let t=h?.kind===`door`?j.doors.find(e=>e.id===h.id):void 0,n=h?.kind===`screen`?j.screens.find(e=>e.id===h.id):void 0,r=h?.kind===`obstacle`?j.obstacles.find(e=>e.id===h.id):void 0;Pe=t?(0,F.jsx)(Qc,{door:t,isLast:j.doors.length<=1,notice:_,onPatch:e=>xe(t.id,e),onDelete:P,onClose:ne},t.id):n?(0,F.jsx)($c,{screen:n,notice:_,onPatch:e=>Se(n.id,e),onDelete:P,onClose:ne},n.id):r?(0,F.jsx)(el,{obstacle:r,notice:_,onPatch:e=>Ce(r.id,e),onDelete:P,onClose:ne},r.id):(0,F.jsx)(Zc,{room:j,minSize:ge(j,e.items),notice:_,onResize:de,onAddDoor:he,onAddScreen:ye,onAddObstacle:be,onExport:Ee,onImport:je})}else if(w)Pe=(0,F.jsx)(ll,{item:w,config:e.configs[w.type],onPatch:e=>ae(w,e),onDelete:re,onClose:D},w.id);else if(i.kind===`type`){let n=i.id;Pe=(0,F.jsx)(nl,{config:e.configs[n],placed:ke(e.items,n),onSetAvailable:e=>t({kind:`setAvailable`,type:n,value:e}),onSetSeats:e=>t({kind:`setSeats`,type:n,value:e}),onClose:E})}else i.kind===`custom`&&(Pe=(0,F.jsx)(pl,{onSave:Me,onCancel:E}));return(0,F.jsxs)(`div`,{style:{display:`flex`,height:`100vh`,background:`#e9e9e9`,cursor:n?`grabbing`:void 0},children:[(0,F.jsx)(Ue,{types:e.typeOrder.map(t=>e.configs[t]),remaining:Ne,onStartDrag:ie,onOpenMenu:e=>ee({kind:`type`,id:e}),onNewCustom:()=>ee({kind:`custom`}),header:(0,F.jsx)(Mc,{mode:p,onChange:te}),panel:Pe}),(0,F.jsxs)(`main`,{ref:l,style:{flex:1,minWidth:0,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,padding:24},children:[(0,F.jsx)(jc,{mode:p,roomSel:h,onSelectRoom:e=>{g(e),y(``)},onMoveWallItem:(e,t,n)=>e===`door`?xe(t,{offset:n}):Se(t,{offset:n}),onMoveObstacle:(e,t,n)=>Ce(e,{x:t,y:n}),pxPerM:d,room:e.room,items:e.items,configs:e.configs,preview:A,floorRef:c,selectedId:o,onSelect:T,onMove:(e,n,r)=>t({kind:`move`,id:e,x:n,y:r}),onResize:(e,n)=>t({kind:`update`,id:e,patch:{...n}})}),(0,F.jsx)(tl,{pxPerM:d,roomWidthPx:e.room.width*d+12})]}),n&&!A&&(0,F.jsx)(`div`,{style:{position:`fixed`,left:n.clientX,top:n.clientY,transform:`translate(-50%, -50%)`,pointerEvents:`none`,opacity:.8},children:(0,F.jsx)(Ie,{shape:e.configs[n.type].shape})})]})}document.body.style.margin=`0`,(0,y.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(hl,{}));