Nora / frontend /dist /assets /index-Dphn6THU.js
GitHub Action
Deploy clean version of Nora
59bd45e
(function(){const L=document.createElement("link").relList;if(L&&L.supports&&L.supports("modulepreload"))return;for(const b of document.querySelectorAll('link[rel="modulepreload"]'))C(b);new MutationObserver(b=>{for(const s of b)if(s.type==="childList")for(const p of s.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&C(p)}).observe(document,{childList:!0,subtree:!0});function R(b){const s={};return b.integrity&&(s.integrity=b.integrity),b.referrerPolicy&&(s.referrerPolicy=b.referrerPolicy),b.crossOrigin==="use-credentials"?s.credentials="include":b.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function C(b){if(b.ep)return;b.ep=!0;const s=R(b);fetch(b.href,s)}})();var _d=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rr(N){return N&&N.__esModule&&Object.prototype.hasOwnProperty.call(N,"default")?N.default:N}var Er={exports:{}},kn={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ld;function wh(){if(Ld)return kn;Ld=1;var N=Symbol.for("react.transitional.element"),L=Symbol.for("react.fragment");function R(C,b,s){var p=null;if(s!==void 0&&(p=""+s),b.key!==void 0&&(p=""+b.key),"key"in b){s={};for(var v in b)v!=="key"&&(s[v]=b[v])}else s=b;return b=s.ref,{$$typeof:N,type:C,key:p,ref:b!==void 0?b:null,props:s}}return kn.Fragment=L,kn.jsx=R,kn.jsxs=R,kn}var Yd;function Mh(){return Yd||(Yd=1,Er.exports=wh()),Er.exports}var h=Mh(),Cr={exports:{}},ve={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Gd;function jh(){if(Gd)return ve;Gd=1;var N=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),p=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),r=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),g=Symbol.iterator;function u(Y){return Y===null||typeof Y!="object"?null:(Y=g&&Y[g]||Y["@@iterator"],typeof Y=="function"?Y:null)}var o={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,y={};function T(Y,F,ae){this.props=Y,this.context=F,this.refs=y,this.updater=ae||o}T.prototype.isReactComponent={},T.prototype.setState=function(Y,F){if(typeof Y!="object"&&typeof Y!="function"&&Y!=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,Y,F,"setState")},T.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function z(){}z.prototype=T.prototype;function D(Y,F,ae){this.props=Y,this.context=F,this.refs=y,this.updater=ae||o}var O=D.prototype=new z;O.constructor=D,f(O,T.prototype),O.isPureReactComponent=!0;var S=Array.isArray;function M(){}var j={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function B(Y,F,ae){var se=ae.ref;return{$$typeof:N,type:Y,key:F,ref:se!==void 0?se:null,props:ae}}function U(Y,F){return B(Y.type,F,Y.props)}function H(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===N}function E(Y){var F={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(ae){return F[ae]})}var Q=/\/+/g;function ee(Y,F){return typeof Y=="object"&&Y!==null&&Y.key!=null?E(""+Y.key):F.toString(36)}function P(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status=="string"?Y.then(M,M):(Y.status="pending",Y.then(function(F){Y.status==="pending"&&(Y.status="fulfilled",Y.value=F)},function(F){Y.status==="pending"&&(Y.status="rejected",Y.reason=F)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function V(Y,F,ae,se,ne){var te=typeof Y;(te==="undefined"||te==="boolean")&&(Y=null);var fe=!1;if(Y===null)fe=!0;else switch(te){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(Y.$$typeof){case N:case L:fe=!0;break;case r:return fe=Y._init,V(fe(Y._payload),F,ae,se,ne)}}if(fe)return ne=ne(Y),fe=se===""?"."+ee(Y,0):se,S(ne)?(ae="",fe!=null&&(ae=fe.replace(Q,"$&/")+"/"),V(ne,F,ae,"",function($e){return $e})):ne!=null&&(H(ne)&&(ne=U(ne,ae+(ne.key==null||Y&&Y.key===ne.key?"":(""+ne.key).replace(Q,"$&/")+"/")+fe)),F.push(ne)),1;fe=0;var he=se===""?".":se+":";if(S(Y))for(var we=0;we<Y.length;we++)se=Y[we],te=he+ee(se,we),fe+=V(se,F,ae,te,ne);else if(we=u(Y),typeof we=="function")for(Y=we.call(Y),we=0;!(se=Y.next()).done;)se=se.value,te=he+ee(se,we++),fe+=V(se,F,ae,te,ne);else if(te==="object"){if(typeof Y.then=="function")return V(P(Y),F,ae,se,ne);throw F=String(Y),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(Y).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return fe}function K(Y,F,ae){if(Y==null)return Y;var se=[],ne=0;return V(Y,se,"","",function(te){return F.call(ae,te,ne++)}),se}function le(Y){if(Y._status===-1){var F=Y._result;F=F(),F.then(function(ae){(Y._status===0||Y._status===-1)&&(Y._status=1,Y._result=ae)},function(ae){(Y._status===0||Y._status===-1)&&(Y._status=2,Y._result=ae)}),Y._status===-1&&(Y._status=0,Y._result=F)}if(Y._status===1)return Y._result.default;throw Y._result}var re=typeof reportError=="function"?reportError:function(Y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Y=="object"&&Y!==null&&typeof Y.message=="string"?String(Y.message):String(Y),error:Y});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",Y);return}console.error(Y)},me={map:K,forEach:function(Y,F,ae){K(Y,function(){F.apply(this,arguments)},ae)},count:function(Y){var F=0;return K(Y,function(){F++}),F},toArray:function(Y){return K(Y,function(F){return F})||[]},only:function(Y){if(!H(Y))throw Error("React.Children.only expected to receive a single React element child.");return Y}};return ve.Activity=x,ve.Children=me,ve.Component=T,ve.Fragment=R,ve.Profiler=b,ve.PureComponent=D,ve.StrictMode=C,ve.Suspense=c,ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,ve.__COMPILER_RUNTIME={__proto__:null,c:function(Y){return j.H.useMemoCache(Y)}},ve.cache=function(Y){return function(){return Y.apply(null,arguments)}},ve.cacheSignal=function(){return null},ve.cloneElement=function(Y,F,ae){if(Y==null)throw Error("The argument must be a React element, but you passed "+Y+".");var se=f({},Y.props),ne=Y.key;if(F!=null)for(te in F.key!==void 0&&(ne=""+F.key),F)!w.call(F,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&F.ref===void 0||(se[te]=F[te]);var te=arguments.length-2;if(te===1)se.children=ae;else if(1<te){for(var fe=Array(te),he=0;he<te;he++)fe[he]=arguments[he+2];se.children=fe}return B(Y.type,ne,se)},ve.createContext=function(Y){return Y={$$typeof:p,_currentValue:Y,_currentValue2:Y,_threadCount:0,Provider:null,Consumer:null},Y.Provider=Y,Y.Consumer={$$typeof:s,_context:Y},Y},ve.createElement=function(Y,F,ae){var se,ne={},te=null;if(F!=null)for(se in F.key!==void 0&&(te=""+F.key),F)w.call(F,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ne[se]=F[se]);var fe=arguments.length-2;if(fe===1)ne.children=ae;else if(1<fe){for(var he=Array(fe),we=0;we<fe;we++)he[we]=arguments[we+2];ne.children=he}if(Y&&Y.defaultProps)for(se in fe=Y.defaultProps,fe)ne[se]===void 0&&(ne[se]=fe[se]);return B(Y,te,ne)},ve.createRef=function(){return{current:null}},ve.forwardRef=function(Y){return{$$typeof:v,render:Y}},ve.isValidElement=H,ve.lazy=function(Y){return{$$typeof:r,_payload:{_status:-1,_result:Y},_init:le}},ve.memo=function(Y,F){return{$$typeof:m,type:Y,compare:F===void 0?null:F}},ve.startTransition=function(Y){var F=j.T,ae={};j.T=ae;try{var se=Y(),ne=j.S;ne!==null&&ne(ae,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(M,re)}catch(te){re(te)}finally{F!==null&&ae.types!==null&&(F.types=ae.types),j.T=F}},ve.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},ve.use=function(Y){return j.H.use(Y)},ve.useActionState=function(Y,F,ae){return j.H.useActionState(Y,F,ae)},ve.useCallback=function(Y,F){return j.H.useCallback(Y,F)},ve.useContext=function(Y){return j.H.useContext(Y)},ve.useDebugValue=function(){},ve.useDeferredValue=function(Y,F){return j.H.useDeferredValue(Y,F)},ve.useEffect=function(Y,F){return j.H.useEffect(Y,F)},ve.useEffectEvent=function(Y){return j.H.useEffectEvent(Y)},ve.useId=function(){return j.H.useId()},ve.useImperativeHandle=function(Y,F,ae){return j.H.useImperativeHandle(Y,F,ae)},ve.useInsertionEffect=function(Y,F){return j.H.useInsertionEffect(Y,F)},ve.useLayoutEffect=function(Y,F){return j.H.useLayoutEffect(Y,F)},ve.useMemo=function(Y,F){return j.H.useMemo(Y,F)},ve.useOptimistic=function(Y,F){return j.H.useOptimistic(Y,F)},ve.useReducer=function(Y,F,ae){return j.H.useReducer(Y,F,ae)},ve.useRef=function(Y){return j.H.useRef(Y)},ve.useState=function(Y){return j.H.useState(Y)},ve.useSyncExternalStore=function(Y,F,ae){return j.H.useSyncExternalStore(Y,F,ae)},ve.useTransition=function(){return j.H.useTransition()},ve.version="19.2.3",ve}var Vd;function Br(){return Vd||(Vd=1,Cr.exports=jh()),Cr.exports}var ie=Br();const Th=Rr(ie);var Dr={exports:{}},qn={},zr={exports:{}},Or={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var kd;function Eh(){return kd||(kd=1,(function(N){function L(V,K){var le=V.length;V.push(K);e:for(;0<le;){var re=le-1>>>1,me=V[re];if(0<b(me,K))V[re]=K,V[le]=me,le=re;else break e}}function R(V){return V.length===0?null:V[0]}function C(V){if(V.length===0)return null;var K=V[0],le=V.pop();if(le!==K){V[0]=le;e:for(var re=0,me=V.length,Y=me>>>1;re<Y;){var F=2*(re+1)-1,ae=V[F],se=F+1,ne=V[se];if(0>b(ae,le))se<me&&0>b(ne,ae)?(V[re]=ne,V[se]=le,re=se):(V[re]=ae,V[F]=le,re=F);else if(se<me&&0>b(ne,le))V[re]=ne,V[se]=le,re=se;else break e}}return K}function b(V,K){var le=V.sortIndex-K.sortIndex;return le!==0?le:V.id-K.id}if(N.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;N.unstable_now=function(){return s.now()}}else{var p=Date,v=p.now();N.unstable_now=function(){return p.now()-v}}var c=[],m=[],r=1,x=null,g=3,u=!1,o=!1,f=!1,y=!1,T=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function O(V){for(var K=R(m);K!==null;){if(K.callback===null)C(m);else if(K.startTime<=V)C(m),K.sortIndex=K.expirationTime,L(c,K);else break;K=R(m)}}function S(V){if(f=!1,O(V),!o)if(R(c)!==null)o=!0,M||(M=!0,E());else{var K=R(m);K!==null&&P(S,K.startTime-V)}}var M=!1,j=-1,w=5,B=-1;function U(){return y?!0:!(N.unstable_now()-B<w)}function H(){if(y=!1,M){var V=N.unstable_now();B=V;var K=!0;try{e:{o=!1,f&&(f=!1,z(j),j=-1),u=!0;var le=g;try{t:{for(O(V),x=R(c);x!==null&&!(x.expirationTime>V&&U());){var re=x.callback;if(typeof re=="function"){x.callback=null,g=x.priorityLevel;var me=re(x.expirationTime<=V);if(V=N.unstable_now(),typeof me=="function"){x.callback=me,O(V),K=!0;break t}x===R(c)&&C(c),O(V)}else C(c);x=R(c)}if(x!==null)K=!0;else{var Y=R(m);Y!==null&&P(S,Y.startTime-V),K=!1}}break e}finally{x=null,g=le,u=!1}K=void 0}}finally{K?E():M=!1}}}var E;if(typeof D=="function")E=function(){D(H)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,ee=Q.port2;Q.port1.onmessage=H,E=function(){ee.postMessage(null)}}else E=function(){T(H,0)};function P(V,K){j=T(function(){V(N.unstable_now())},K)}N.unstable_IdlePriority=5,N.unstable_ImmediatePriority=1,N.unstable_LowPriority=4,N.unstable_NormalPriority=3,N.unstable_Profiling=null,N.unstable_UserBlockingPriority=2,N.unstable_cancelCallback=function(V){V.callback=null},N.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<V?Math.floor(1e3/V):5},N.unstable_getCurrentPriorityLevel=function(){return g},N.unstable_next=function(V){switch(g){case 1:case 2:case 3:var K=3;break;default:K=g}var le=g;g=K;try{return V()}finally{g=le}},N.unstable_requestPaint=function(){y=!0},N.unstable_runWithPriority=function(V,K){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var le=g;g=V;try{return K()}finally{g=le}},N.unstable_scheduleCallback=function(V,K,le){var re=N.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?re+le:re):le=re,V){case 1:var me=-1;break;case 2:me=250;break;case 5:me=1073741823;break;case 4:me=1e4;break;default:me=5e3}return me=le+me,V={id:r++,callback:K,priorityLevel:V,startTime:le,expirationTime:me,sortIndex:-1},le>re?(V.sortIndex=le,L(m,V),R(c)===null&&V===R(m)&&(f?(z(j),j=-1):f=!0,P(S,le-re))):(V.sortIndex=me,L(c,V),o||u||(o=!0,M||(M=!0,E()))),V},N.unstable_shouldYield=U,N.unstable_wrapCallback=function(V){var K=g;return function(){var le=g;g=K;try{return V.apply(this,arguments)}finally{g=le}}}})(Or)),Or}var qd;function Ch(){return qd||(qd=1,zr.exports=Eh()),zr.exports}var Ur={exports:{}},st={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Xd;function Dh(){if(Xd)return st;Xd=1;var N=Br();function L(c){var m="https://react.dev/errors/"+c;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)m+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+c+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function R(){}var C={d:{f:R,r:function(){throw Error(L(522))},D:R,C:R,L:R,m:R,X:R,S:R,M:R},p:0,findDOMNode:null},b=Symbol.for("react.portal");function s(c,m,r){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:b,key:x==null?null:""+x,children:c,containerInfo:m,implementation:r}}var p=N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(c,m){if(c==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return st.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,st.createPortal=function(c,m){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(L(299));return s(c,m,null,r)},st.flushSync=function(c){var m=p.T,r=C.p;try{if(p.T=null,C.p=2,c)return c()}finally{p.T=m,C.p=r,C.d.f()}},st.preconnect=function(c,m){typeof c=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,C.d.C(c,m))},st.prefetchDNS=function(c){typeof c=="string"&&C.d.D(c)},st.preinit=function(c,m){if(typeof c=="string"&&m&&typeof m.as=="string"){var r=m.as,x=v(r,m.crossOrigin),g=typeof m.integrity=="string"?m.integrity:void 0,u=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;r==="style"?C.d.S(c,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:g,fetchPriority:u}):r==="script"&&C.d.X(c,{crossOrigin:x,integrity:g,fetchPriority:u,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},st.preinitModule=function(c,m){if(typeof c=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var r=v(m.as,m.crossOrigin);C.d.M(c,{crossOrigin:r,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&C.d.M(c)},st.preload=function(c,m){if(typeof c=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var r=m.as,x=v(r,m.crossOrigin);C.d.L(c,r,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},st.preloadModule=function(c,m){if(typeof c=="string")if(m){var r=v(m.as,m.crossOrigin);C.d.m(c,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:r,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else C.d.m(c)},st.requestFormReset=function(c){C.d.r(c)},st.unstable_batchedUpdates=function(c,m){return c(m)},st.useFormState=function(c,m,r){return p.H.useFormState(c,m,r)},st.useFormStatus=function(){return p.H.useHostTransitionStatus()},st.version="19.2.3",st}var Qd;function zh(){if(Qd)return Ur.exports;Qd=1;function N(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(N)}catch(L){console.error(L)}}return N(),Ur.exports=Dh(),Ur.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Zd;function Oh(){if(Zd)return qn;Zd=1;var N=Ch(),L=Br(),R=zh();function C(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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 b(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function p(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 v(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 c(e){if(s(e)!==e)throw Error(C(188))}function m(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(C(188));return t!==e?null:e}for(var a=e,l=t;;){var n=a.return;if(n===null)break;var i=n.alternate;if(i===null){if(l=n.return,l!==null){a=l;continue}break}if(n.child===i.child){for(i=n.child;i;){if(i===a)return c(n),e;if(i===l)return c(n),t;i=i.sibling}throw Error(C(188))}if(a.return!==l.return)a=n,l=i;else{for(var d=!1,A=n.child;A;){if(A===a){d=!0,a=n,l=i;break}if(A===l){d=!0,l=n,a=i;break}A=A.sibling}if(!d){for(A=i.child;A;){if(A===a){d=!0,a=i,l=n;break}if(A===l){d=!0,l=i,a=n;break}A=A.sibling}if(!d)throw Error(C(189))}}if(a.alternate!==l)throw Error(C(190))}if(a.tag!==3)throw Error(C(188));return a.stateNode.current===a?e:t}function r(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=r(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,g=Symbol.for("react.element"),u=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),D=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function E(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Symbol.for("react.client.reference");function ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case f:return"Fragment";case T:return"Profiler";case y:return"StrictMode";case S:return"Suspense";case M:return"SuspenseList";case B:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case o:return"Portal";case D:return e.displayName||"Context";case z:return(e._context.displayName||"Context")+".Consumer";case O:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case j:return t=e.displayName||null,t!==null?t:ee(e.type)||"Memo";case w:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var P=Array.isArray,V=L.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=R.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},re=[],me=-1;function Y(e){return{current:e}}function F(e){0>me||(e.current=re[me],re[me]=null,me--)}function ae(e,t){me++,re[me]=e.current,e.current=t}var se=Y(null),ne=Y(null),te=Y(null),fe=Y(null);function he(e,t){switch(ae(te,t),ae(ne,e),ae(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sd(t),e=ud(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}F(se),ae(se,e)}function we(){F(se),F(ne),F(te)}function $e(e){e.memoizedState!==null&&ae(fe,e);var t=se.current,a=ud(t,e.type);t!==a&&(ae(ne,e),ae(se,a))}function Le(e){ne.current===e&&(F(se),F(ne)),fe.current===e&&(F(fe),Ln._currentValue=le)}var Qe,nl;function Qt(e){if(Qe===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Qe=t&&t[1]||"",nl=-1<a.stack.indexOf(`
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Qe+e+nl}var Jl=!1;function il(e,t){if(!e||Jl)return"";Jl=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(J){var Z=J}Reflect.construct(e,[],I)}else{try{I.call()}catch(J){Z=J}e.call(I.prototype)}}else{try{throw Error()}catch(J){Z=J}(I=e())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(J){if(J&&Z&&typeof J.stack=="string")return[J.stack,Z.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=l.DetermineComponentFrameRoot(),d=i[0],A=i[1];if(d&&A){var _=d.split(`
`),X=A.split(`
`);for(n=l=0;l<_.length&&!_[l].includes("DetermineComponentFrameRoot");)l++;for(;n<X.length&&!X[n].includes("DetermineComponentFrameRoot");)n++;if(l===_.length||n===X.length)for(l=_.length-1,n=X.length-1;1<=l&&0<=n&&_[l]!==X[n];)n--;for(;1<=l&&0<=n;l--,n--)if(_[l]!==X[n]){if(l!==1||n!==1)do if(l--,n--,0>n||_[l]!==X[n]){var $=`
`+_[l].replace(" at new "," at ");return e.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",e.displayName)),$}while(1<=l&&0<=n);break}}}finally{Jl=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Qt(a):""}function Qn(e,t){switch(e.tag){case 26:case 27:case 5:return Qt(e.type);case 16:return Qt("Lazy");case 13:return e.child!==t&&t!==null?Qt("Suspense Fallback"):Qt("Suspense");case 19:return Qt("SuspenseList");case 0:case 15:return il(e.type,!1);case 11:return il(e.type.render,!1);case 1:return il(e.type,!0);case 31:return Qt("Activity");default:return""}}function sl(e){try{var t="",a=null;do t+=Qn(e,a),a=e,e=e.return;while(e);return t}catch(l){return`
Error generating stack: `+l.message+`
`+l.stack}}var pt=Object.prototype.hasOwnProperty,ul=N.unstable_scheduleCallback,Ba=N.unstable_cancelCallback,Zn=N.unstable_shouldYield,Kn=N.unstable_requestPaint,it=N.unstable_now,Jn=N.unstable_getCurrentPriorityLevel,Ha=N.unstable_ImmediatePriority,Fn=N.unstable_UserBlockingPriority,rl=N.unstable_NormalPriority,cl=N.unstable_LowPriority,_a=N.unstable_IdlePriority,s0=N.log,u0=N.unstable_setDisableYieldValue,Fl=null,gt=null;function oa(e){if(typeof s0=="function"&&u0(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(Fl,e)}catch{}}var xt=Math.clz32?Math.clz32:o0,r0=Math.log,c0=Math.LN2;function o0(e){return e>>>=0,e===0?32:31-(r0(e)/c0|0)|0}var $n=256,Wn=262144,In=4194304;function La(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&261888;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 Pn(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var n=0,i=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var A=l&134217727;return A!==0?(l=A&~i,l!==0?n=La(l):(d&=A,d!==0?n=La(d):a||(a=A&~e,a!==0&&(n=La(a))))):(A=l&~i,A!==0?n=La(A):d!==0?n=La(d):a||(a=l&~e,a!==0&&(n=La(a)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:n}function $l(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function f0(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 Yr(){var e=In;return In<<=1,(In&62914560)===0&&(In=4194304),e}function ps(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Wl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function d0(e,t,a,l,n,i){var d=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var A=e.entanglements,_=e.expirationTimes,X=e.hiddenUpdates;for(a=d&~a;0<a;){var $=31-xt(a),I=1<<$;A[$]=0,_[$]=-1;var Z=X[$];if(Z!==null)for(X[$]=null,$=0;$<Z.length;$++){var J=Z[$];J!==null&&(J.lane&=-536870913)}a&=~I}l!==0&&Gr(e,l,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(d&~t))}function Gr(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-xt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function Vr(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-xt(a),n=1<<l;n&t|e[l]&t&&(e[l]|=t),a&=~n}}function kr(e,t){var a=t&-t;return a=(a&42)!==0?1:gs(a),(a&(e.suspendedLanes|t))!==0?0:a}function gs(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 xs(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function qr(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:Dd(e.type))}function Xr(e,t){var a=K.p;try{return K.p=e,t()}finally{K.p=a}}var fa=Math.random().toString(36).slice(2),et="__reactFiber$"+fa,ct="__reactProps$"+fa,ol="__reactContainer$"+fa,ys="__reactEvents$"+fa,m0="__reactListeners$"+fa,h0="__reactHandles$"+fa,Qr="__reactResources$"+fa,Il="__reactMarker$"+fa;function Ss(e){delete e[et],delete e[ct],delete e[ys],delete e[m0],delete e[h0]}function fl(e){var t=e[et];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ol]||a[et]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=hd(e);e!==null;){if(a=e[et])return a;e=hd(e)}return t}e=a,a=e.parentNode}return null}function dl(e){if(e=e[et]||e[ol]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(C(33))}function ml(e){var t=e[Qr];return t||(t=e[Qr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ie(e){e[Il]=!0}var Zr=new Set,Kr={};function Ya(e,t){hl(e,t),hl(e+"Capture",t)}function hl(e,t){for(Kr[e]=t,e=0;e<t.length;e++)Zr.add(t[e])}var v0=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]*$"),Jr={},Fr={};function p0(e){return pt.call(Fr,e)?!0:pt.call(Jr,e)?!1:v0.test(e)?Fr[e]=!0:(Jr[e]=!0,!1)}function ei(e,t,a){if(p0(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function ti(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Zt(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}function Tt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $r(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function g0(e,t,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var n=l.get,i=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(d){a=""+d,i.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(d){a=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bs(e){if(!e._valueTracker){var t=$r(e)?"checked":"value";e._valueTracker=g0(e,t,""+e[t])}}function Wr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=$r(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function ai(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var x0=/[\n"\\]/g;function Et(e){return e.replace(x0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function As(e,t,a,l,n,i,d,A){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Tt(t)):e.value!==""+Tt(t)&&(e.value=""+Tt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Ns(e,d,Tt(t)):a!=null?Ns(e,d,Tt(a)):l!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.name=""+Tt(A):e.removeAttribute("name")}function Ir(e,t,a,l,n,i,d,A){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){bs(e);return}a=a!=null?""+Tt(a):"",t=t!=null?""+Tt(t):a,A||t===e.value||(e.value=t),e.defaultValue=t}l=l??n,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=A?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),bs(e)}function Ns(e,t,a){t==="number"&&ai(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function vl(e,t,a,l){if(e=e.options,t){t={};for(var n=0;n<a.length;n++)t["$"+a[n]]=!0;for(a=0;a<e.length;a++)n=t.hasOwnProperty("$"+e[a].value),e[a].selected!==n&&(e[a].selected=n),n&&l&&(e[a].defaultSelected=!0)}else{for(a=""+Tt(a),t=null,n=0;n<e.length;n++){if(e[n].value===a){e[n].selected=!0,l&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function Pr(e,t,a){if(t!=null&&(t=""+Tt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Tt(a):""}function ec(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(C(92));if(P(l)){if(1<l.length)throw Error(C(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=Tt(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),bs(e)}function pl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var y0=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 tc(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||y0.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function ac(e,t,a){if(t!=null&&typeof t!="object")throw Error(C(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var n in t)l=t[n],t.hasOwnProperty(n)&&a[n]!==l&&tc(e,n,l)}else for(var i in t)t.hasOwnProperty(i)&&tc(e,i,t[i])}function ws(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 S0=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"],["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"]]),b0=/^[\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 li(e){return b0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Kt(){}var Ms=null;function js(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gl=null,xl=null;function lc(e){var t=dl(e);if(t&&(e=t.stateNode)){var a=e[ct]||null;e:switch(e=t.stateNode,t.type){case"input":if(As(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Et(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var n=l[ct]||null;if(!n)throw Error(C(90));As(l,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Wr(l)}break e;case"textarea":Pr(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&vl(e,!!a.multiple,t,!1)}}}var Ts=!1;function nc(e,t,a){if(Ts)return e(t,a);Ts=!0;try{var l=e(t);return l}finally{if(Ts=!1,(gl!==null||xl!==null)&&(Xi(),gl&&(t=gl,e=xl,xl=gl=null,lc(t),e)))for(t=0;t<e.length;t++)lc(e[t])}}function en(e,t){var a=e.stateNode;if(a===null)return null;var l=a[ct]||null;if(l===null)return null;a=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(C(231,t,typeof a));return a}var Jt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Es=!1;if(Jt)try{var tn={};Object.defineProperty(tn,"passive",{get:function(){Es=!0}}),window.addEventListener("test",tn,tn),window.removeEventListener("test",tn,tn)}catch{Es=!1}var da=null,Cs=null,ni=null;function ic(){if(ni)return ni;var e,t=Cs,a=t.length,l,n="value"in da?da.value:da.textContent,i=n.length;for(e=0;e<a&&t[e]===n[e];e++);var d=a-e;for(l=1;l<=d&&t[a-l]===n[i-l];l++);return ni=n.slice(e,1<l?1-l:void 0)}function ii(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 si(){return!0}function sc(){return!1}function ot(e){function t(a,l,n,i,d){this._reactName=a,this._targetInst=n,this.type=l,this.nativeEvent=i,this.target=d,this.currentTarget=null;for(var A in e)e.hasOwnProperty(A)&&(a=e[A],this[A]=a?a(i):i[A]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?si:sc,this.isPropagationStopped=sc,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=si)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=si)},persist:function(){},isPersistent:si}),t}var Ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ui=ot(Ga),an=x({},Ga,{view:0,detail:0}),A0=ot(an),Ds,zs,ln,ri=x({},an,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Us,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!==ln&&(ln&&e.type==="mousemove"?(Ds=e.screenX-ln.screenX,zs=e.screenY-ln.screenY):zs=Ds=0,ln=e),Ds)},movementY:function(e){return"movementY"in e?e.movementY:zs}}),uc=ot(ri),N0=x({},ri,{dataTransfer:0}),w0=ot(N0),M0=x({},an,{relatedTarget:0}),Os=ot(M0),j0=x({},Ga,{animationName:0,elapsedTime:0,pseudoElement:0}),T0=ot(j0),E0=x({},Ga,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),C0=ot(E0),D0=x({},Ga,{data:0}),rc=ot(D0),z0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},O0={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"},U0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function R0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=U0[e])?!!t[e]:!1}function Us(){return R0}var B0=x({},an,{key:function(e){if(e.key){var t=z0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ii(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?O0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Us,charCode:function(e){return e.type==="keypress"?ii(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ii(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),H0=ot(B0),_0=x({},ri,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cc=ot(_0),L0=x({},an,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Us}),Y0=ot(L0),G0=x({},Ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),V0=ot(G0),k0=x({},ri,{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}),q0=ot(k0),X0=x({},Ga,{newState:0,oldState:0}),Q0=ot(X0),Z0=[9,13,27,32],Rs=Jt&&"CompositionEvent"in window,nn=null;Jt&&"documentMode"in document&&(nn=document.documentMode);var K0=Jt&&"TextEvent"in window&&!nn,oc=Jt&&(!Rs||nn&&8<nn&&11>=nn),fc=" ",dc=!1;function mc(e,t){switch(e){case"keyup":return Z0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yl=!1;function J0(e,t){switch(e){case"compositionend":return hc(t);case"keypress":return t.which!==32?null:(dc=!0,fc);case"textInput":return e=t.data,e===fc&&dc?null:e;default:return null}}function F0(e,t){if(yl)return e==="compositionend"||!Rs&&mc(e,t)?(e=ic(),ni=Cs=da=null,yl=!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 oc&&t.locale!=="ko"?null:t.data;default:return null}}var $0={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 vc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$0[e.type]:t==="textarea"}function pc(e,t,a,l){gl?xl?xl.push(l):xl=[l]:gl=l,t=Wi(t,"onChange"),0<t.length&&(a=new ui("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var sn=null,un=null;function W0(e){ed(e,0)}function ci(e){var t=Pl(e);if(Wr(t))return e}function gc(e,t){if(e==="change")return t}var xc=!1;if(Jt){var Bs;if(Jt){var Hs="oninput"in document;if(!Hs){var yc=document.createElement("div");yc.setAttribute("oninput","return;"),Hs=typeof yc.oninput=="function"}Bs=Hs}else Bs=!1;xc=Bs&&(!document.documentMode||9<document.documentMode)}function Sc(){sn&&(sn.detachEvent("onpropertychange",bc),un=sn=null)}function bc(e){if(e.propertyName==="value"&&ci(un)){var t=[];pc(t,un,e,js(e)),nc(W0,t)}}function I0(e,t,a){e==="focusin"?(Sc(),sn=t,un=a,sn.attachEvent("onpropertychange",bc)):e==="focusout"&&Sc()}function P0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ci(un)}function em(e,t){if(e==="click")return ci(t)}function tm(e,t){if(e==="input"||e==="change")return ci(t)}function am(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is=="function"?Object.is:am;function rn(e,t){if(yt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var n=a[l];if(!pt.call(t,n)||!yt(e[n],t[n]))return!1}return!0}function Ac(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Nc(e,t){var a=Ac(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Ac(a)}}function wc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ai(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ai(e.document)}return t}function _s(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 lm=Jt&&"documentMode"in document&&11>=document.documentMode,Sl=null,Ls=null,cn=null,Ys=!1;function jc(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ys||Sl==null||Sl!==ai(l)||(l=Sl,"selectionStart"in l&&_s(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),cn&&rn(cn,l)||(cn=l,l=Wi(Ls,"onSelect"),0<l.length&&(t=new ui("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=Sl)))}function Va(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var bl={animationend:Va("Animation","AnimationEnd"),animationiteration:Va("Animation","AnimationIteration"),animationstart:Va("Animation","AnimationStart"),transitionrun:Va("Transition","TransitionRun"),transitionstart:Va("Transition","TransitionStart"),transitioncancel:Va("Transition","TransitionCancel"),transitionend:Va("Transition","TransitionEnd")},Gs={},Tc={};Jt&&(Tc=document.createElement("div").style,"AnimationEvent"in window||(delete bl.animationend.animation,delete bl.animationiteration.animation,delete bl.animationstart.animation),"TransitionEvent"in window||delete bl.transitionend.transition);function ka(e){if(Gs[e])return Gs[e];if(!bl[e])return e;var t=bl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Tc)return Gs[e]=t[a];return e}var Ec=ka("animationend"),Cc=ka("animationiteration"),Dc=ka("animationstart"),nm=ka("transitionrun"),im=ka("transitionstart"),sm=ka("transitioncancel"),zc=ka("transitionend"),Oc=new Map,Vs="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Vs.push("scrollEnd");function _t(e,t){Oc.set(e,t),Ya(t,[e])}var oi=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!==null&&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)},Ct=[],Al=0,ks=0;function fi(){for(var e=Al,t=ks=Al=0;t<e;){var a=Ct[t];Ct[t++]=null;var l=Ct[t];Ct[t++]=null;var n=Ct[t];Ct[t++]=null;var i=Ct[t];if(Ct[t++]=null,l!==null&&n!==null){var d=l.pending;d===null?n.next=n:(n.next=d.next,d.next=n),l.pending=n}i!==0&&Uc(a,n,i)}}function di(e,t,a,l){Ct[Al++]=e,Ct[Al++]=t,Ct[Al++]=a,Ct[Al++]=l,ks|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function qs(e,t,a,l){return di(e,t,a,l),mi(e)}function qa(e,t){return di(e,null,null,t),mi(e)}function Uc(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var n=!1,i=e.return;i!==null;)i.childLanes|=a,l=i.alternate,l!==null&&(l.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(n=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,n&&t!==null&&(n=31-xt(a),e=i.hiddenUpdates,l=e[n],l===null?e[n]=[t]:l.push(t),t.lane=a|536870912),i):null}function mi(e){if(50<zn)throw zn=0,Iu=null,Error(C(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Nl={};function um(e,t,a,l){this.tag=e,this.key=a,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function St(e,t,a,l){return new um(e,t,a,l)}function Xs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ft(e,t){var a=e.alternate;return a===null?(a=St(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Rc(e,t){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function hi(e,t,a,l,n,i){var d=0;if(l=e,typeof e=="function")Xs(e)&&(d=1);else if(typeof e=="string")d=dh(e,a,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case B:return e=St(31,a,t,n),e.elementType=B,e.lanes=i,e;case f:return Xa(a.children,n,i,t);case y:d=8,n|=24;break;case T:return e=St(12,a,t,n|2),e.elementType=T,e.lanes=i,e;case S:return e=St(13,a,t,n),e.elementType=S,e.lanes=i,e;case M:return e=St(19,a,t,n),e.elementType=M,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:d=10;break e;case z:d=9;break e;case O:d=11;break e;case j:d=14;break e;case w:d=16,l=null;break e}d=29,a=Error(C(130,e===null?"null":typeof e,"")),l=null}return t=St(d,a,t,n),t.elementType=e,t.type=l,t.lanes=i,t}function Xa(e,t,a,l){return e=St(7,e,l,t),e.lanes=a,e}function Qs(e,t,a){return e=St(6,e,null,t),e.lanes=a,e}function Bc(e){var t=St(18,null,null,0);return t.stateNode=e,t}function Zs(e,t,a){return t=St(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hc=new WeakMap;function Dt(e,t){if(typeof e=="object"&&e!==null){var a=Hc.get(e);return a!==void 0?a:(t={value:e,source:t,stack:sl(t)},Hc.set(e,t),t)}return{value:e,source:t,stack:sl(t)}}var wl=[],Ml=0,vi=null,on=0,zt=[],Ot=0,ma=null,Gt=1,Vt="";function $t(e,t){wl[Ml++]=on,wl[Ml++]=vi,vi=e,on=t}function _c(e,t,a){zt[Ot++]=Gt,zt[Ot++]=Vt,zt[Ot++]=ma,ma=e;var l=Gt;e=Vt;var n=32-xt(l)-1;l&=~(1<<n),a+=1;var i=32-xt(t)+n;if(30<i){var d=n-n%5;i=(l&(1<<d)-1).toString(32),l>>=d,n-=d,Gt=1<<32-xt(t)+n|a<<n|l,Vt=i+e}else Gt=1<<i|a<<n|l,Vt=e}function Ks(e){e.return!==null&&($t(e,1),_c(e,1,0))}function Js(e){for(;e===vi;)vi=wl[--Ml],wl[Ml]=null,on=wl[--Ml],wl[Ml]=null;for(;e===ma;)ma=zt[--Ot],zt[Ot]=null,Vt=zt[--Ot],zt[Ot]=null,Gt=zt[--Ot],zt[Ot]=null}function Lc(e,t){zt[Ot++]=Gt,zt[Ot++]=Vt,zt[Ot++]=ma,Gt=t.id,Vt=t.overflow,ma=e}var tt=null,Be=null,Ne=!1,ha=null,Ut=!1,Fs=Error(C(519));function va(e){var t=Error(C(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fn(Dt(t,e)),Fs}function Yc(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[et]=e,t[ct]=l,a){case"dialog":Se("cancel",t),Se("close",t);break;case"iframe":case"object":case"embed":Se("load",t);break;case"video":case"audio":for(a=0;a<Un.length;a++)Se(Un[a],t);break;case"source":Se("error",t);break;case"img":case"image":case"link":Se("error",t),Se("load",t);break;case"details":Se("toggle",t);break;case"input":Se("invalid",t),Ir(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Se("invalid",t);break;case"textarea":Se("invalid",t),ec(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||nd(t.textContent,a)?(l.popover!=null&&(Se("beforetoggle",t),Se("toggle",t)),l.onScroll!=null&&Se("scroll",t),l.onScrollEnd!=null&&Se("scrollend",t),l.onClick!=null&&(t.onclick=Kt),t=!0):t=!1,t||va(e,!0)}function Gc(e){for(tt=e.return;tt;)switch(tt.tag){case 5:case 31:case 13:Ut=!1;return;case 27:case 3:Ut=!0;return;default:tt=tt.return}}function jl(e){if(e!==tt)return!1;if(!Ne)return Gc(e),Ne=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||mr(e.type,e.memoizedProps)),a=!a),a&&Be&&va(e),Gc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(C(317));Be=md(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(C(317));Be=md(e)}else t===27?(t=Be,Ca(e.type)?(e=xr,xr=null,Be=e):Be=t):Be=tt?Bt(e.stateNode.nextSibling):null;return!0}function Qa(){Be=tt=null,Ne=!1}function $s(){var e=ha;return e!==null&&(ht===null?ht=e:ht.push.apply(ht,e),ha=null),e}function fn(e){ha===null?ha=[e]:ha.push(e)}var Ws=Y(null),Za=null,Wt=null;function pa(e,t,a){ae(Ws,t._currentValue),t._currentValue=a}function It(e){e._currentValue=Ws.current,F(Ws)}function Is(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function Ps(e,t,a,l){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var i=n.dependencies;if(i!==null){var d=n.child;i=i.firstContext;e:for(;i!==null;){var A=i;i=n;for(var _=0;_<t.length;_++)if(A.context===t[_]){i.lanes|=a,A=i.alternate,A!==null&&(A.lanes|=a),Is(i.return,a,e),l||(d=null);break e}i=A.next}}else if(n.tag===18){if(d=n.return,d===null)throw Error(C(341));d.lanes|=a,i=d.alternate,i!==null&&(i.lanes|=a),Is(d,a,e),d=null}else d=n.child;if(d!==null)d.return=n;else for(d=n;d!==null;){if(d===e){d=null;break}if(n=d.sibling,n!==null){n.return=d.return,d=n;break}d=d.return}n=d}}function Tl(e,t,a,l){e=null;for(var n=t,i=!1;n!==null;){if(!i){if((n.flags&524288)!==0)i=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var d=n.alternate;if(d===null)throw Error(C(387));if(d=d.memoizedProps,d!==null){var A=n.type;yt(n.pendingProps.value,d.value)||(e!==null?e.push(A):e=[A])}}else if(n===fe.current){if(d=n.alternate,d===null)throw Error(C(387));d.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(Ln):e=[Ln])}n=n.return}e!==null&&Ps(t,e,a,l),t.flags|=262144}function pi(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ka(e){Za=e,Wt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function at(e){return Vc(Za,e)}function gi(e,t){return Za===null&&Ka(e),Vc(e,t)}function Vc(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Wt===null){if(e===null)throw Error(C(308));Wt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wt=Wt.next=t;return a}var rm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},cm=N.unstable_scheduleCallback,om=N.unstable_NormalPriority,Ze={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function eu(){return{controller:new rm,data:new Map,refCount:0}}function dn(e){e.refCount--,e.refCount===0&&cm(om,function(){e.controller.abort()})}var mn=null,tu=0,El=0,Cl=null;function fm(e,t){if(mn===null){var a=mn=[];tu=0,El=nr(),Cl={status:"pending",value:void 0,then:function(l){a.push(l)}}}return tu++,t.then(kc,kc),t}function kc(){if(--tu===0&&mn!==null){Cl!==null&&(Cl.status="fulfilled");var e=mn;mn=null,El=0,Cl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function dm(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(n){a.push(n)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var n=0;n<a.length;n++)(0,a[n])(t)},function(n){for(l.status="rejected",l.reason=n,n=0;n<a.length;n++)(0,a[n])(void 0)}),l}var qc=V.S;V.S=function(e,t){Ef=it(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&fm(e,t),qc!==null&&qc(e,t)};var Ja=Y(null);function au(){var e=Ja.current;return e!==null?e:Re.pooledCache}function xi(e,t){t===null?ae(Ja,Ja.current):ae(Ja,t.pool)}function Xc(){var e=au();return e===null?null:{parent:Ze._currentValue,pool:e}}var Dl=Error(C(460)),lu=Error(C(474)),yi=Error(C(542)),Si={then:function(){}};function Qc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Zc(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Kt,Kt),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Jc(e),e;default:if(typeof t.status=="string")t.then(Kt,Kt);else{if(e=Re,e!==null&&100<e.shellSuspendCounter)throw Error(C(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=l}},function(l){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Jc(e),e}throw $a=t,Dl}}function Fa(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?($a=a,Dl):a}}var $a=null;function Kc(){if($a===null)throw Error(C(459));var e=$a;return $a=null,e}function Jc(e){if(e===Dl||e===yi)throw Error(C(483))}var zl=null,hn=0;function bi(e){var t=hn;return hn+=1,zl===null&&(zl=[]),Zc(zl,e,t)}function vn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ai(e,t){throw t.$$typeof===g?Error(C(525)):(e=Object.prototype.toString.call(t),Error(C(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Fc(e){function t(k,G){if(e){var q=k.deletions;q===null?(k.deletions=[G],k.flags|=16):q.push(G)}}function a(k,G){if(!e)return null;for(;G!==null;)t(k,G),G=G.sibling;return null}function l(k){for(var G=new Map;k!==null;)k.key!==null?G.set(k.key,k):G.set(k.index,k),k=k.sibling;return G}function n(k,G){return k=Ft(k,G),k.index=0,k.sibling=null,k}function i(k,G,q){return k.index=q,e?(q=k.alternate,q!==null?(q=q.index,q<G?(k.flags|=67108866,G):q):(k.flags|=67108866,G)):(k.flags|=1048576,G)}function d(k){return e&&k.alternate===null&&(k.flags|=67108866),k}function A(k,G,q,W){return G===null||G.tag!==6?(G=Qs(q,k.mode,W),G.return=k,G):(G=n(G,q),G.return=k,G)}function _(k,G,q,W){var oe=q.type;return oe===f?$(k,G,q.props.children,W,q.key):G!==null&&(G.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===w&&Fa(oe)===G.type)?(G=n(G,q.props),vn(G,q),G.return=k,G):(G=hi(q.type,q.key,q.props,null,k.mode,W),vn(G,q),G.return=k,G)}function X(k,G,q,W){return G===null||G.tag!==4||G.stateNode.containerInfo!==q.containerInfo||G.stateNode.implementation!==q.implementation?(G=Zs(q,k.mode,W),G.return=k,G):(G=n(G,q.children||[]),G.return=k,G)}function $(k,G,q,W,oe){return G===null||G.tag!==7?(G=Xa(q,k.mode,W,oe),G.return=k,G):(G=n(G,q),G.return=k,G)}function I(k,G,q){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Qs(""+G,k.mode,q),G.return=k,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case u:return q=hi(G.type,G.key,G.props,null,k.mode,q),vn(q,G),q.return=k,q;case o:return G=Zs(G,k.mode,q),G.return=k,G;case w:return G=Fa(G),I(k,G,q)}if(P(G)||E(G))return G=Xa(G,k.mode,q,null),G.return=k,G;if(typeof G.then=="function")return I(k,bi(G),q);if(G.$$typeof===D)return I(k,gi(k,G),q);Ai(k,G)}return null}function Z(k,G,q,W){var oe=G!==null?G.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return oe!==null?null:A(k,G,""+q,W);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case u:return q.key===oe?_(k,G,q,W):null;case o:return q.key===oe?X(k,G,q,W):null;case w:return q=Fa(q),Z(k,G,q,W)}if(P(q)||E(q))return oe!==null?null:$(k,G,q,W,null);if(typeof q.then=="function")return Z(k,G,bi(q),W);if(q.$$typeof===D)return Z(k,G,gi(k,q),W);Ai(k,q)}return null}function J(k,G,q,W,oe){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return k=k.get(q)||null,A(G,k,""+W,oe);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case u:return k=k.get(W.key===null?q:W.key)||null,_(G,k,W,oe);case o:return k=k.get(W.key===null?q:W.key)||null,X(G,k,W,oe);case w:return W=Fa(W),J(k,G,q,W,oe)}if(P(W)||E(W))return k=k.get(q)||null,$(G,k,W,oe,null);if(typeof W.then=="function")return J(k,G,q,bi(W),oe);if(W.$$typeof===D)return J(k,G,q,gi(G,W),oe);Ai(G,W)}return null}function ue(k,G,q,W){for(var oe=null,Me=null,ce=G,xe=G=0,Ae=null;ce!==null&&xe<q.length;xe++){ce.index>xe?(Ae=ce,ce=null):Ae=ce.sibling;var je=Z(k,ce,q[xe],W);if(je===null){ce===null&&(ce=Ae);break}e&&ce&&je.alternate===null&&t(k,ce),G=i(je,G,xe),Me===null?oe=je:Me.sibling=je,Me=je,ce=Ae}if(xe===q.length)return a(k,ce),Ne&&$t(k,xe),oe;if(ce===null){for(;xe<q.length;xe++)ce=I(k,q[xe],W),ce!==null&&(G=i(ce,G,xe),Me===null?oe=ce:Me.sibling=ce,Me=ce);return Ne&&$t(k,xe),oe}for(ce=l(ce);xe<q.length;xe++)Ae=J(ce,k,xe,q[xe],W),Ae!==null&&(e&&Ae.alternate!==null&&ce.delete(Ae.key===null?xe:Ae.key),G=i(Ae,G,xe),Me===null?oe=Ae:Me.sibling=Ae,Me=Ae);return e&&ce.forEach(function(Ra){return t(k,Ra)}),Ne&&$t(k,xe),oe}function de(k,G,q,W){if(q==null)throw Error(C(151));for(var oe=null,Me=null,ce=G,xe=G=0,Ae=null,je=q.next();ce!==null&&!je.done;xe++,je=q.next()){ce.index>xe?(Ae=ce,ce=null):Ae=ce.sibling;var Ra=Z(k,ce,je.value,W);if(Ra===null){ce===null&&(ce=Ae);break}e&&ce&&Ra.alternate===null&&t(k,ce),G=i(Ra,G,xe),Me===null?oe=Ra:Me.sibling=Ra,Me=Ra,ce=Ae}if(je.done)return a(k,ce),Ne&&$t(k,xe),oe;if(ce===null){for(;!je.done;xe++,je=q.next())je=I(k,je.value,W),je!==null&&(G=i(je,G,xe),Me===null?oe=je:Me.sibling=je,Me=je);return Ne&&$t(k,xe),oe}for(ce=l(ce);!je.done;xe++,je=q.next())je=J(ce,k,xe,je.value,W),je!==null&&(e&&je.alternate!==null&&ce.delete(je.key===null?xe:je.key),G=i(je,G,xe),Me===null?oe=je:Me.sibling=je,Me=je);return e&&ce.forEach(function(Nh){return t(k,Nh)}),Ne&&$t(k,xe),oe}function Ue(k,G,q,W){if(typeof q=="object"&&q!==null&&q.type===f&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case u:e:{for(var oe=q.key;G!==null;){if(G.key===oe){if(oe=q.type,oe===f){if(G.tag===7){a(k,G.sibling),W=n(G,q.props.children),W.return=k,k=W;break e}}else if(G.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===w&&Fa(oe)===G.type){a(k,G.sibling),W=n(G,q.props),vn(W,q),W.return=k,k=W;break e}a(k,G);break}else t(k,G);G=G.sibling}q.type===f?(W=Xa(q.props.children,k.mode,W,q.key),W.return=k,k=W):(W=hi(q.type,q.key,q.props,null,k.mode,W),vn(W,q),W.return=k,k=W)}return d(k);case o:e:{for(oe=q.key;G!==null;){if(G.key===oe)if(G.tag===4&&G.stateNode.containerInfo===q.containerInfo&&G.stateNode.implementation===q.implementation){a(k,G.sibling),W=n(G,q.children||[]),W.return=k,k=W;break e}else{a(k,G);break}else t(k,G);G=G.sibling}W=Zs(q,k.mode,W),W.return=k,k=W}return d(k);case w:return q=Fa(q),Ue(k,G,q,W)}if(P(q))return ue(k,G,q,W);if(E(q)){if(oe=E(q),typeof oe!="function")throw Error(C(150));return q=oe.call(q),de(k,G,q,W)}if(typeof q.then=="function")return Ue(k,G,bi(q),W);if(q.$$typeof===D)return Ue(k,G,gi(k,q),W);Ai(k,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,G!==null&&G.tag===6?(a(k,G.sibling),W=n(G,q),W.return=k,k=W):(a(k,G),W=Qs(q,k.mode,W),W.return=k,k=W),d(k)):a(k,G)}return function(k,G,q,W){try{hn=0;var oe=Ue(k,G,q,W);return zl=null,oe}catch(ce){if(ce===Dl||ce===yi)throw ce;var Me=St(29,ce,null,k.mode);return Me.lanes=W,Me.return=k,Me}finally{}}}var Wa=Fc(!0),$c=Fc(!1),ga=!1;function nu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function iu(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 xa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ya(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Te&2)!==0){var n=l.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),l.pending=t,t=mi(e),Uc(e,null,a),t}return di(e,l,t,a),mi(e)}function pn(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Vr(e,a)}}function su(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var n=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var d={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?n=i=d:i=i.next=d,a=a.next}while(a!==null);i===null?n=i=t:i=i.next=t}else n=i=t;a={baseState:l.baseState,firstBaseUpdate:n,lastBaseUpdate:i,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var uu=!1;function gn(){if(uu){var e=Cl;if(e!==null)throw e}}function xn(e,t,a,l){uu=!1;var n=e.updateQueue;ga=!1;var i=n.firstBaseUpdate,d=n.lastBaseUpdate,A=n.shared.pending;if(A!==null){n.shared.pending=null;var _=A,X=_.next;_.next=null,d===null?i=X:d.next=X,d=_;var $=e.alternate;$!==null&&($=$.updateQueue,A=$.lastBaseUpdate,A!==d&&(A===null?$.firstBaseUpdate=X:A.next=X,$.lastBaseUpdate=_))}if(i!==null){var I=n.baseState;d=0,$=X=_=null,A=i;do{var Z=A.lane&-536870913,J=Z!==A.lane;if(J?(be&Z)===Z:(l&Z)===Z){Z!==0&&Z===El&&(uu=!0),$!==null&&($=$.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var ue=e,de=A;Z=t;var Ue=a;switch(de.tag){case 1:if(ue=de.payload,typeof ue=="function"){I=ue.call(Ue,I,Z);break e}I=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=de.payload,Z=typeof ue=="function"?ue.call(Ue,I,Z):ue,Z==null)break e;I=x({},I,Z);break e;case 2:ga=!0}}Z=A.callback,Z!==null&&(e.flags|=64,J&&(e.flags|=8192),J=n.callbacks,J===null?n.callbacks=[Z]:J.push(Z))}else J={lane:Z,tag:A.tag,payload:A.payload,callback:A.callback,next:null},$===null?(X=$=J,_=I):$=$.next=J,d|=Z;if(A=A.next,A===null){if(A=n.shared.pending,A===null)break;J=A,A=J.next,J.next=null,n.lastBaseUpdate=J,n.shared.pending=null}}while(!0);$===null&&(_=I),n.baseState=_,n.firstBaseUpdate=X,n.lastBaseUpdate=$,i===null&&(n.shared.lanes=0),wa|=d,e.lanes=d,e.memoizedState=I}}function Wc(e,t){if(typeof e!="function")throw Error(C(191,e));e.call(t)}function Ic(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Wc(a[e],t)}var Ol=Y(null),Ni=Y(0);function Pc(e,t){e=ua,ae(Ni,e),ae(Ol,t),ua=e|t.baseLanes}function ru(){ae(Ni,ua),ae(Ol,Ol.current)}function cu(){ua=Ni.current,F(Ol),F(Ni)}var bt=Y(null),Rt=null;function Sa(e){var t=e.alternate;ae(qe,qe.current&1),ae(bt,e),Rt===null&&(t===null||Ol.current!==null||t.memoizedState!==null)&&(Rt=e)}function ou(e){ae(qe,qe.current),ae(bt,e),Rt===null&&(Rt=e)}function eo(e){e.tag===22?(ae(qe,qe.current),ae(bt,e),Rt===null&&(Rt=e)):ba()}function ba(){ae(qe,qe.current),ae(bt,bt.current)}function At(e){F(bt),Rt===e&&(Rt=null),F(qe)}var qe=Y(0);function wi(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||pr(a)||gr(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 Pt=0,pe=null,ze=null,Ke=null,Mi=!1,Ul=!1,Ia=!1,ji=0,yn=0,Rl=null,mm=0;function Ve(){throw Error(C(321))}function fu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!yt(e[a],t[a]))return!1;return!0}function du(e,t,a,l,n,i){return Pt=i,pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?Lo:Tu,Ia=!1,i=a(l,n),Ia=!1,Ul&&(i=ao(t,a,l,n)),to(e),i}function to(e){V.H=An;var t=ze!==null&&ze.next!==null;if(Pt=0,Ke=ze=pe=null,Mi=!1,yn=0,Rl=null,t)throw Error(C(300));e===null||Je||(e=e.dependencies,e!==null&&pi(e)&&(Je=!0))}function ao(e,t,a,l){pe=e;var n=0;do{if(Ul&&(Rl=null),yn=0,Ul=!1,25<=n)throw Error(C(301));if(n+=1,Ke=ze=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}V.H=Yo,i=t(a,l)}while(Ul);return i}function hm(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?Sn(t):t,e=e.useState()[0],(ze!==null?ze.memoizedState:null)!==e&&(pe.flags|=1024),t}function mu(){var e=ji!==0;return ji=0,e}function hu(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function vu(e){if(Mi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Mi=!1}Pt=0,Ke=ze=pe=null,Ul=!1,yn=ji=0,Rl=null}function rt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?pe.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function Xe(){if(ze===null){var e=pe.alternate;e=e!==null?e.memoizedState:null}else e=ze.next;var t=Ke===null?pe.memoizedState:Ke.next;if(t!==null)Ke=t,ze=e;else{if(e===null)throw pe.alternate===null?Error(C(467)):Error(C(310));ze=e,e={memoizedState:ze.memoizedState,baseState:ze.baseState,baseQueue:ze.baseQueue,queue:ze.queue,next:null},Ke===null?pe.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function Ti(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sn(e){var t=yn;return yn+=1,Rl===null&&(Rl=[]),e=Zc(Rl,e,t),t=pe,(Ke===null?t.memoizedState:Ke.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?Lo:Tu),e}function Ei(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sn(e);if(e.$$typeof===D)return at(e)}throw Error(C(438,String(e)))}function pu(e){var t=null,a=pe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=pe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ti(),pe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=U;return t.index++,a}function ea(e,t){return typeof t=="function"?t(e):t}function Ci(e){var t=Xe();return gu(t,ze,e)}function gu(e,t,a){var l=e.queue;if(l===null)throw Error(C(311));l.lastRenderedReducer=a;var n=e.baseQueue,i=l.pending;if(i!==null){if(n!==null){var d=n.next;n.next=i.next,i.next=d}t.baseQueue=n=i,l.pending=null}if(i=e.baseState,n===null)e.memoizedState=i;else{t=n.next;var A=d=null,_=null,X=t,$=!1;do{var I=X.lane&-536870913;if(I!==X.lane?(be&I)===I:(Pt&I)===I){var Z=X.revertLane;if(Z===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),I===El&&($=!0);else if((Pt&Z)===Z){X=X.next,Z===El&&($=!0);continue}else I={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},_===null?(A=_=I,d=i):_=_.next=I,pe.lanes|=Z,wa|=Z;I=X.action,Ia&&a(i,I),i=X.hasEagerState?X.eagerState:a(i,I)}else Z={lane:I,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},_===null?(A=_=Z,d=i):_=_.next=Z,pe.lanes|=I,wa|=I;X=X.next}while(X!==null&&X!==t);if(_===null?d=i:_.next=A,!yt(i,e.memoizedState)&&(Je=!0,$&&(a=Cl,a!==null)))throw a;e.memoizedState=i,e.baseState=d,e.baseQueue=_,l.lastRenderedState=i}return n===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function xu(e){var t=Xe(),a=t.queue;if(a===null)throw Error(C(311));a.lastRenderedReducer=e;var l=a.dispatch,n=a.pending,i=t.memoizedState;if(n!==null){a.pending=null;var d=n=n.next;do i=e(i,d.action),d=d.next;while(d!==n);yt(i,t.memoizedState)||(Je=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,l]}function lo(e,t,a){var l=pe,n=Xe(),i=Ne;if(i){if(a===void 0)throw Error(C(407));a=a()}else a=t();var d=!yt((ze||n).memoizedState,a);if(d&&(n.memoizedState=a,Je=!0),n=n.queue,bu(so.bind(null,l,n,e),[e]),n.getSnapshot!==t||d||Ke!==null&&Ke.memoizedState.tag&1){if(l.flags|=2048,Bl(9,{destroy:void 0},io.bind(null,l,n,a,t),null),Re===null)throw Error(C(349));i||(Pt&127)!==0||no(l,t,a)}return a}function no(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=pe.updateQueue,t===null?(t=Ti(),pe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function io(e,t,a,l){t.value=a,t.getSnapshot=l,uo(t)&&ro(e)}function so(e,t,a){return a(function(){uo(t)&&ro(e)})}function uo(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!yt(e,a)}catch{return!0}}function ro(e){var t=qa(e,2);t!==null&&vt(t,e,2)}function yu(e){var t=rt();if(typeof e=="function"){var a=e;if(e=a(),Ia){oa(!0);try{a()}finally{oa(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:e},t}function co(e,t,a,l){return e.baseState=a,gu(e,ze,typeof l=="function"?l:ea)}function vm(e,t,a,l,n){if(Oi(e))throw Error(C(485));if(e=t.action,e!==null){var i={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){i.listeners.push(d)}};V.T!==null?a(!0):i.isTransition=!1,l(i),a=t.pending,a===null?(i.next=t.pending=i,oo(t,i)):(i.next=a.next,t.pending=a.next=i)}}function oo(e,t){var a=t.action,l=t.payload,n=e.state;if(t.isTransition){var i=V.T,d={};V.T=d;try{var A=a(n,l),_=V.S;_!==null&&_(d,A),fo(e,t,A)}catch(X){Su(e,t,X)}finally{i!==null&&d.types!==null&&(i.types=d.types),V.T=i}}else try{i=a(n,l),fo(e,t,i)}catch(X){Su(e,t,X)}}function fo(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){mo(e,t,l)},function(l){return Su(e,t,l)}):mo(e,t,a)}function mo(e,t,a){t.status="fulfilled",t.value=a,ho(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,oo(e,a)))}function Su(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,ho(t),t=t.next;while(t!==l)}e.action=null}function ho(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function vo(e,t){return t}function po(e,t){if(Ne){var a=Re.formState;if(a!==null){e:{var l=pe;if(Ne){if(Be){t:{for(var n=Be,i=Ut;n.nodeType!==8;){if(!i){n=null;break t}if(n=Bt(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){Be=Bt(n.nextSibling),l=n.data==="F!";break e}}va(l)}l=!1}l&&(t=a[0])}}return a=rt(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:t},a.queue=l,a=Bo.bind(null,pe,l),l.dispatch=a,l=yu(!1),i=ju.bind(null,pe,!1,l.queue),l=rt(),n={state:t,dispatch:null,action:e,pending:null},l.queue=n,a=vm.bind(null,pe,n,i,a),n.dispatch=a,l.memoizedState=e,[t,a,!1]}function go(e){var t=Xe();return xo(t,ze,e)}function xo(e,t,a){if(t=gu(e,t,vo)[0],e=Ci(ea)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Sn(t)}catch(d){throw d===Dl?yi:d}else l=t;t=Xe();var n=t.queue,i=n.dispatch;return a!==t.memoizedState&&(pe.flags|=2048,Bl(9,{destroy:void 0},pm.bind(null,n,a),null)),[l,i,e]}function pm(e,t){e.action=t}function yo(e){var t=Xe(),a=ze;if(a!==null)return xo(t,a,e);Xe(),t=t.memoizedState,a=Xe();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function Bl(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=pe.updateQueue,t===null&&(t=Ti(),pe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function So(){return Xe().memoizedState}function Di(e,t,a,l){var n=rt();pe.flags|=e,n.memoizedState=Bl(1|t,{destroy:void 0},a,l===void 0?null:l)}function zi(e,t,a,l){var n=Xe();l=l===void 0?null:l;var i=n.memoizedState.inst;ze!==null&&l!==null&&fu(l,ze.memoizedState.deps)?n.memoizedState=Bl(t,i,a,l):(pe.flags|=e,n.memoizedState=Bl(1|t,i,a,l))}function bo(e,t){Di(8390656,8,e,t)}function bu(e,t){zi(2048,8,e,t)}function gm(e){pe.flags|=4;var t=pe.updateQueue;if(t===null)t=Ti(),pe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Ao(e){var t=Xe().memoizedState;return gm({ref:t,nextImpl:e}),function(){if((Te&2)!==0)throw Error(C(440));return t.impl.apply(void 0,arguments)}}function No(e,t){return zi(4,2,e,t)}function wo(e,t){return zi(4,4,e,t)}function Mo(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jo(e,t,a){a=a!=null?a.concat([e]):null,zi(4,4,Mo.bind(null,t,e),a)}function Au(){}function To(e,t){var a=Xe();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&fu(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function Eo(e,t){var a=Xe();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&fu(t,l[1]))return l[0];if(l=e(),Ia){oa(!0);try{e()}finally{oa(!1)}}return a.memoizedState=[l,t],l}function Nu(e,t,a){return a===void 0||(Pt&1073741824)!==0&&(be&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Df(),pe.lanes|=e,wa|=e,a)}function Co(e,t,a,l){return yt(a,t)?a:Ol.current!==null?(e=Nu(e,a,l),yt(e,t)||(Je=!0),e):(Pt&42)===0||(Pt&1073741824)!==0&&(be&261930)===0?(Je=!0,e.memoizedState=a):(e=Df(),pe.lanes|=e,wa|=e,t)}function Do(e,t,a,l,n){var i=K.p;K.p=i!==0&&8>i?i:8;var d=V.T,A={};V.T=A,ju(e,!1,t,a);try{var _=n(),X=V.S;if(X!==null&&X(A,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var $=dm(_,l);bn(e,t,$,Mt(e))}else bn(e,t,l,Mt(e))}catch(I){bn(e,t,{then:function(){},status:"rejected",reason:I},Mt())}finally{K.p=i,d!==null&&A.types!==null&&(d.types=A.types),V.T=d}}function xm(){}function wu(e,t,a,l){if(e.tag!==5)throw Error(C(476));var n=zo(e).queue;Do(e,n,t,le,a===null?xm:function(){return Oo(e),a(l)})}function zo(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:le},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Oo(e){var t=zo(e);t.next===null&&(t=e.alternate.memoizedState),bn(e,t.next.queue,{},Mt())}function Mu(){return at(Ln)}function Uo(){return Xe().memoizedState}function Ro(){return Xe().memoizedState}function ym(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Mt();e=xa(a);var l=ya(t,e,a);l!==null&&(vt(l,t,a),pn(l,t,a)),t={cache:eu()},e.payload=t;return}t=t.return}}function Sm(e,t,a){var l=Mt();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Oi(e)?Ho(t,a):(a=qs(e,t,a,l),a!==null&&(vt(a,e,l),_o(a,t,l)))}function Bo(e,t,a){var l=Mt();bn(e,t,a,l)}function bn(e,t,a,l){var n={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Oi(e))Ho(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var d=t.lastRenderedState,A=i(d,a);if(n.hasEagerState=!0,n.eagerState=A,yt(A,d))return di(e,t,n,0),Re===null&&fi(),!1}catch{}finally{}if(a=qs(e,t,n,l),a!==null)return vt(a,e,l),_o(a,t,l),!0}return!1}function ju(e,t,a,l){if(l={lane:2,revertLane:nr(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Oi(e)){if(t)throw Error(C(479))}else t=qs(e,a,l,2),t!==null&&vt(t,e,2)}function Oi(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function Ho(e,t){Ul=Mi=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function _o(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Vr(e,a)}}var An={readContext:at,use:Ei,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useLayoutEffect:Ve,useInsertionEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useSyncExternalStore:Ve,useId:Ve,useHostTransitionStatus:Ve,useFormState:Ve,useActionState:Ve,useOptimistic:Ve,useMemoCache:Ve,useCacheRefresh:Ve};An.useEffectEvent=Ve;var Lo={readContext:at,use:Ei,useCallback:function(e,t){return rt().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:bo,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Di(4194308,4,Mo.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Di(4194308,4,e,t)},useInsertionEffect:function(e,t){Di(4,2,e,t)},useMemo:function(e,t){var a=rt();t=t===void 0?null:t;var l=e();if(Ia){oa(!0);try{e()}finally{oa(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=rt();if(a!==void 0){var n=a(t);if(Ia){oa(!0);try{a(t)}finally{oa(!1)}}}else n=t;return l.memoizedState=l.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=Sm.bind(null,pe,e),[l.memoizedState,e]},useRef:function(e){var t=rt();return e={current:e},t.memoizedState=e},useState:function(e){e=yu(e);var t=e.queue,a=Bo.bind(null,pe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Au,useDeferredValue:function(e,t){var a=rt();return Nu(a,e,t)},useTransition:function(){var e=yu(!1);return e=Do.bind(null,pe,e.queue,!0,!1),rt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=pe,n=rt();if(Ne){if(a===void 0)throw Error(C(407));a=a()}else{if(a=t(),Re===null)throw Error(C(349));(be&127)!==0||no(l,t,a)}n.memoizedState=a;var i={value:a,getSnapshot:t};return n.queue=i,bo(so.bind(null,l,i,e),[e]),l.flags|=2048,Bl(9,{destroy:void 0},io.bind(null,l,i,a,t),null),a},useId:function(){var e=rt(),t=Re.identifierPrefix;if(Ne){var a=Vt,l=Gt;a=(l&~(1<<32-xt(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=ji++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=mm++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Mu,useFormState:po,useActionState:po,useOptimistic:function(e){var t=rt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=ju.bind(null,pe,!0,a),a.dispatch=t,[e,t]},useMemoCache:pu,useCacheRefresh:function(){return rt().memoizedState=ym.bind(null,pe)},useEffectEvent:function(e){var t=rt(),a={impl:e};return t.memoizedState=a,function(){if((Te&2)!==0)throw Error(C(440));return a.impl.apply(void 0,arguments)}}},Tu={readContext:at,use:Ei,useCallback:To,useContext:at,useEffect:bu,useImperativeHandle:jo,useInsertionEffect:No,useLayoutEffect:wo,useMemo:Eo,useReducer:Ci,useRef:So,useState:function(){return Ci(ea)},useDebugValue:Au,useDeferredValue:function(e,t){var a=Xe();return Co(a,ze.memoizedState,e,t)},useTransition:function(){var e=Ci(ea)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Sn(e),t]},useSyncExternalStore:lo,useId:Uo,useHostTransitionStatus:Mu,useFormState:go,useActionState:go,useOptimistic:function(e,t){var a=Xe();return co(a,ze,e,t)},useMemoCache:pu,useCacheRefresh:Ro};Tu.useEffectEvent=Ao;var Yo={readContext:at,use:Ei,useCallback:To,useContext:at,useEffect:bu,useImperativeHandle:jo,useInsertionEffect:No,useLayoutEffect:wo,useMemo:Eo,useReducer:xu,useRef:So,useState:function(){return xu(ea)},useDebugValue:Au,useDeferredValue:function(e,t){var a=Xe();return ze===null?Nu(a,e,t):Co(a,ze.memoizedState,e,t)},useTransition:function(){var e=xu(ea)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Sn(e),t]},useSyncExternalStore:lo,useId:Uo,useHostTransitionStatus:Mu,useFormState:yo,useActionState:yo,useOptimistic:function(e,t){var a=Xe();return ze!==null?co(a,ze,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:pu,useCacheRefresh:Ro};Yo.useEffectEvent=Ao;function Eu(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:x({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Cu={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=Mt(),n=xa(l);n.payload=t,a!=null&&(n.callback=a),t=ya(e,n,l),t!==null&&(vt(t,e,l),pn(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=Mt(),n=xa(l);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=ya(e,n,l),t!==null&&(vt(t,e,l),pn(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Mt(),l=xa(a);l.tag=2,t!=null&&(l.callback=t),t=ya(e,l,a),t!==null&&(vt(t,e,a),pn(t,e,a))}};function Go(e,t,a,l,n,i,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,i,d):t.prototype&&t.prototype.isPureReactComponent?!rn(a,l)||!rn(n,i):!0}function Vo(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Cu.enqueueReplaceState(t,t.state,null)}function Pa(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=x({},a));for(var n in e)a[n]===void 0&&(a[n]=e[n])}return a}function ko(e){oi(e)}function qo(e){console.error(e)}function Xo(e){oi(e)}function Ui(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Qo(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Du(e,t,a){return a=xa(a),a.tag=3,a.payload={element:null},a.callback=function(){Ui(e,t)},a}function Zo(e){return e=xa(e),e.tag=3,e}function Ko(e,t,a,l){var n=a.type.getDerivedStateFromError;if(typeof n=="function"){var i=l.value;e.payload=function(){return n(i)},e.callback=function(){Qo(t,a,l)}}var d=a.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Qo(t,a,l),typeof n!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var A=l.stack;this.componentDidCatch(l.value,{componentStack:A!==null?A:""})})}function bm(e,t,a,l,n){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&Tl(t,a,n,!0),a=bt.current,a!==null){switch(a.tag){case 31:case 13:return Rt===null?Qi():a.alternate===null&&ke===0&&(ke=3),a.flags&=-257,a.flags|=65536,a.lanes=n,l===Si?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),tr(e,l,n)),!1;case 22:return a.flags|=65536,l===Si?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),tr(e,l,n)),!1}throw Error(C(435,a.tag))}return tr(e,l,n),Qi(),!1}if(Ne)return t=bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,l!==Fs&&(e=Error(C(422),{cause:l}),fn(Dt(e,a)))):(l!==Fs&&(t=Error(C(423),{cause:l}),fn(Dt(t,a))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,l=Dt(l,a),n=Du(e.stateNode,l,n),su(e,n),ke!==4&&(ke=2)),!1;var i=Error(C(520),{cause:l});if(i=Dt(i,a),Dn===null?Dn=[i]:Dn.push(i),ke!==4&&(ke=2),t===null)return!0;l=Dt(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=n&-n,a.lanes|=e,e=Du(a.stateNode,l,e),su(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Ma===null||!Ma.has(i))))return a.flags|=65536,n&=-n,a.lanes|=n,n=Zo(n),Ko(n,e,a,l),su(a,n),!1}a=a.return}while(a!==null);return!1}var zu=Error(C(461)),Je=!1;function lt(e,t,a,l){t.child=e===null?$c(t,null,a,l):Wa(t,e.child,a,l)}function Jo(e,t,a,l,n){a=a.render;var i=t.ref;if("ref"in l){var d={};for(var A in l)A!=="ref"&&(d[A]=l[A])}else d=l;return Ka(t),l=du(e,t,a,d,i,n),A=mu(),e!==null&&!Je?(hu(e,t,n),ta(e,t,n)):(Ne&&A&&Ks(t),t.flags|=1,lt(e,t,l,n),t.child)}function Fo(e,t,a,l,n){if(e===null){var i=a.type;return typeof i=="function"&&!Xs(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,$o(e,t,i,l,n)):(e=hi(a.type,null,l,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Yu(e,n)){var d=i.memoizedProps;if(a=a.compare,a=a!==null?a:rn,a(d,l)&&e.ref===t.ref)return ta(e,t,n)}return t.flags|=1,e=Ft(i,l),e.ref=t.ref,e.return=t,t.child=e}function $o(e,t,a,l,n){if(e!==null){var i=e.memoizedProps;if(rn(i,l)&&e.ref===t.ref)if(Je=!1,t.pendingProps=l=i,Yu(e,n))(e.flags&131072)!==0&&(Je=!0);else return t.lanes=e.lanes,ta(e,t,n)}return Ou(e,t,a,l,n)}function Wo(e,t,a,l){var n=l.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|a:a,e!==null){for(l=t.child=e.child,n=0;l!==null;)n=n|l.lanes|l.childLanes,l=l.sibling;l=n&~i}else l=0,t.child=null;return Io(e,t,i,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xi(t,i!==null?i.cachePool:null),i!==null?Pc(t,i):ru(),eo(t);else return l=t.lanes=536870912,Io(e,t,i!==null?i.baseLanes|a:a,a,l)}else i!==null?(xi(t,i.cachePool),Pc(t,i),ba(),t.memoizedState=null):(e!==null&&xi(t,null),ru(),ba());return lt(e,t,n,a),t.child}function Nn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Io(e,t,a,l,n){var i=au();return i=i===null?null:{parent:Ze._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&xi(t,null),ru(),eo(t),e!==null&&Tl(e,t,l,!0),t.childLanes=n,null}function Ri(e,t){return t=Hi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Po(e,t,a){return Wa(t,e.child,null,a),e=Ri(t,t.pendingProps),e.flags|=2,At(t),t.memoizedState=null,e}function Am(e,t,a){var l=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ne){if(l.mode==="hidden")return e=Ri(t,l),t.lanes=536870912,Nn(null,e);if(ou(t),(e=Be)?(e=dd(e,Ut),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ma!==null?{id:Gt,overflow:Vt}:null,retryLane:536870912,hydrationErrors:null},a=Bc(e),a.return=t,t.child=a,tt=t,Be=null)):e=null,e===null)throw va(t);return t.lanes=536870912,null}return Ri(t,l)}var i=e.memoizedState;if(i!==null){var d=i.dehydrated;if(ou(t),n)if(t.flags&256)t.flags&=-257,t=Po(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(C(558));else if(Je||Tl(e,t,a,!1),n=(a&e.childLanes)!==0,Je||n){if(l=Re,l!==null&&(d=kr(l,a),d!==0&&d!==i.retryLane))throw i.retryLane=d,qa(e,d),vt(l,e,d),zu;Qi(),t=Po(e,t,a)}else e=i.treeContext,Be=Bt(d.nextSibling),tt=t,Ne=!0,ha=null,Ut=!1,e!==null&&Lc(t,e),t=Ri(t,l),t.flags|=4096;return t}return e=Ft(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Bi(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(C(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Ou(e,t,a,l,n){return Ka(t),a=du(e,t,a,l,void 0,n),l=mu(),e!==null&&!Je?(hu(e,t,n),ta(e,t,n)):(Ne&&l&&Ks(t),t.flags|=1,lt(e,t,a,n),t.child)}function ef(e,t,a,l,n,i){return Ka(t),t.updateQueue=null,a=ao(t,l,a,n),to(e),l=mu(),e!==null&&!Je?(hu(e,t,i),ta(e,t,i)):(Ne&&l&&Ks(t),t.flags|=1,lt(e,t,a,i),t.child)}function tf(e,t,a,l,n){if(Ka(t),t.stateNode===null){var i=Nl,d=a.contextType;typeof d=="object"&&d!==null&&(i=at(d)),i=new a(l,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Cu,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=l,i.state=t.memoizedState,i.refs={},nu(t),d=a.contextType,i.context=typeof d=="object"&&d!==null?at(d):Nl,i.state=t.memoizedState,d=a.getDerivedStateFromProps,typeof d=="function"&&(Eu(t,a,d,l),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(d=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),d!==i.state&&Cu.enqueueReplaceState(i,i.state,null),xn(t,l,i,n),gn(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){i=t.stateNode;var A=t.memoizedProps,_=Pa(a,A);i.props=_;var X=i.context,$=a.contextType;d=Nl,typeof $=="object"&&$!==null&&(d=at($));var I=a.getDerivedStateFromProps;$=typeof I=="function"||typeof i.getSnapshotBeforeUpdate=="function",A=t.pendingProps!==A,$||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(A||X!==d)&&Vo(t,i,l,d),ga=!1;var Z=t.memoizedState;i.state=Z,xn(t,l,i,n),gn(),X=t.memoizedState,A||Z!==X||ga?(typeof I=="function"&&(Eu(t,a,I,l),X=t.memoizedState),(_=ga||Go(t,a,_,l,Z,X,d))?($||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=X),i.props=l,i.state=X,i.context=d,l=_):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{i=t.stateNode,iu(e,t),d=t.memoizedProps,$=Pa(a,d),i.props=$,I=t.pendingProps,Z=i.context,X=a.contextType,_=Nl,typeof X=="object"&&X!==null&&(_=at(X)),A=a.getDerivedStateFromProps,(X=typeof A=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(d!==I||Z!==_)&&Vo(t,i,l,_),ga=!1,Z=t.memoizedState,i.state=Z,xn(t,l,i,n),gn();var J=t.memoizedState;d!==I||Z!==J||ga||e!==null&&e.dependencies!==null&&pi(e.dependencies)?(typeof A=="function"&&(Eu(t,a,A,l),J=t.memoizedState),($=ga||Go(t,a,$,l,Z,J,_)||e!==null&&e.dependencies!==null&&pi(e.dependencies))?(X||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(l,J,_),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(l,J,_)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=J),i.props=l,i.state=J,i.context=_,l=$):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),l=!1)}return i=l,Bi(e,t),l=(t.flags&128)!==0,i||l?(i=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&l?(t.child=Wa(t,e.child,null,n),t.child=Wa(t,null,a,n)):lt(e,t,a,n),t.memoizedState=i.state,e=t.child):e=ta(e,t,n),e}function af(e,t,a,l){return Qa(),t.flags|=256,lt(e,t,a,l),t.child}var Uu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ru(e){return{baseLanes:e,cachePool:Xc()}}function Bu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=wt),e}function lf(e,t,a){var l=t.pendingProps,n=!1,i=(t.flags&128)!==0,d;if((d=i)||(d=e!==null&&e.memoizedState===null?!1:(qe.current&2)!==0),d&&(n=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ne){if(n?Sa(t):ba(),(e=Be)?(e=dd(e,Ut),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ma!==null?{id:Gt,overflow:Vt}:null,retryLane:536870912,hydrationErrors:null},a=Bc(e),a.return=t,t.child=a,tt=t,Be=null)):e=null,e===null)throw va(t);return gr(e)?t.lanes=32:t.lanes=536870912,null}var A=l.children;return l=l.fallback,n?(ba(),n=t.mode,A=Hi({mode:"hidden",children:A},n),l=Xa(l,n,a,null),A.return=t,l.return=t,A.sibling=l,t.child=A,l=t.child,l.memoizedState=Ru(a),l.childLanes=Bu(e,d,a),t.memoizedState=Uu,Nn(null,l)):(Sa(t),Hu(t,A))}var _=e.memoizedState;if(_!==null&&(A=_.dehydrated,A!==null)){if(i)t.flags&256?(Sa(t),t.flags&=-257,t=_u(e,t,a)):t.memoizedState!==null?(ba(),t.child=e.child,t.flags|=128,t=null):(ba(),A=l.fallback,n=t.mode,l=Hi({mode:"visible",children:l.children},n),A=Xa(A,n,a,null),A.flags|=2,l.return=t,A.return=t,l.sibling=A,t.child=l,Wa(t,e.child,null,a),l=t.child,l.memoizedState=Ru(a),l.childLanes=Bu(e,d,a),t.memoizedState=Uu,t=Nn(null,l));else if(Sa(t),gr(A)){if(d=A.nextSibling&&A.nextSibling.dataset,d)var X=d.dgst;d=X,l=Error(C(419)),l.stack="",l.digest=d,fn({value:l,source:null,stack:null}),t=_u(e,t,a)}else if(Je||Tl(e,t,a,!1),d=(a&e.childLanes)!==0,Je||d){if(d=Re,d!==null&&(l=kr(d,a),l!==0&&l!==_.retryLane))throw _.retryLane=l,qa(e,l),vt(d,e,l),zu;pr(A)||Qi(),t=_u(e,t,a)}else pr(A)?(t.flags|=192,t.child=e.child,t=null):(e=_.treeContext,Be=Bt(A.nextSibling),tt=t,Ne=!0,ha=null,Ut=!1,e!==null&&Lc(t,e),t=Hu(t,l.children),t.flags|=4096);return t}return n?(ba(),A=l.fallback,n=t.mode,_=e.child,X=_.sibling,l=Ft(_,{mode:"hidden",children:l.children}),l.subtreeFlags=_.subtreeFlags&65011712,X!==null?A=Ft(X,A):(A=Xa(A,n,a,null),A.flags|=2),A.return=t,l.return=t,l.sibling=A,t.child=l,Nn(null,l),l=t.child,A=e.child.memoizedState,A===null?A=Ru(a):(n=A.cachePool,n!==null?(_=Ze._currentValue,n=n.parent!==_?{parent:_,pool:_}:n):n=Xc(),A={baseLanes:A.baseLanes|a,cachePool:n}),l.memoizedState=A,l.childLanes=Bu(e,d,a),t.memoizedState=Uu,Nn(e.child,l)):(Sa(t),a=e.child,e=a.sibling,a=Ft(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=a,t.memoizedState=null,a)}function Hu(e,t){return t=Hi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Hi(e,t){return e=St(22,e,null,t),e.lanes=0,e}function _u(e,t,a){return Wa(t,e.child,null,a),e=Hu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nf(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Is(e.return,t,a)}function Lu(e,t,a,l,n,i){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:n,treeForkCount:i}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=a,d.tailMode=n,d.treeForkCount=i)}function sf(e,t,a){var l=t.pendingProps,n=l.revealOrder,i=l.tail;l=l.children;var d=qe.current,A=(d&2)!==0;if(A?(d=d&1|2,t.flags|=128):d&=1,ae(qe,d),lt(e,t,l,a),l=Ne?on:0,!A&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nf(e,a,t);else if(e.tag===19)nf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(n){case"forwards":for(a=t.child,n=null;a!==null;)e=a.alternate,e!==null&&wi(e)===null&&(n=a),a=a.sibling;a=n,a===null?(n=t.child,t.child=null):(n=a.sibling,a.sibling=null),Lu(t,!1,n,a,i,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&wi(e)===null){t.child=n;break}e=n.sibling,n.sibling=a,a=n,n=e}Lu(t,!0,a,null,i,l);break;case"together":Lu(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ta(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),wa|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Tl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(C(153));if(t.child!==null){for(e=t.child,a=Ft(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ft(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Yu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&pi(e)))}function Nm(e,t,a){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),pa(t,Ze,e.memoizedState.cache),Qa();break;case 27:case 5:$e(t);break;case 4:he(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,ou(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Sa(t),t.flags|=128,null):(a&t.child.childLanes)!==0?lf(e,t,a):(Sa(t),e=ta(e,t,a),e!==null?e.sibling:null);Sa(t);break;case 19:var n=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(Tl(e,t,a,!1),l=(a&t.childLanes)!==0),n){if(l)return sf(e,t,a);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),ae(qe,qe.current),l)break;return null;case 22:return t.lanes=0,Wo(e,t,a,t.pendingProps);case 24:pa(t,Ze,e.memoizedState.cache)}return ta(e,t,a)}function uf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Je=!0;else{if(!Yu(e,a)&&(t.flags&128)===0)return Je=!1,Nm(e,t,a);Je=(e.flags&131072)!==0}else Je=!1,Ne&&(t.flags&1048576)!==0&&_c(t,on,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Fa(t.elementType),t.type=e,typeof e=="function")Xs(e)?(l=Pa(e,l),t.tag=1,t=tf(null,t,e,l,a)):(t.tag=0,t=Ou(null,t,e,l,a));else{if(e!=null){var n=e.$$typeof;if(n===O){t.tag=11,t=Jo(null,t,e,l,a);break e}else if(n===j){t.tag=14,t=Fo(null,t,e,l,a);break e}}throw t=ee(e)||e,Error(C(306,t,""))}}return t;case 0:return Ou(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,n=Pa(l,t.pendingProps),tf(e,t,l,n,a);case 3:e:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(C(387));l=t.pendingProps;var i=t.memoizedState;n=i.element,iu(e,t),xn(t,l,null,a);var d=t.memoizedState;if(l=d.cache,pa(t,Ze,l),l!==i.cache&&Ps(t,[Ze],a,!0),gn(),l=d.element,i.isDehydrated)if(i={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=af(e,t,l,a);break e}else if(l!==n){n=Dt(Error(C(424)),t),fn(n),t=af(e,t,l,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Be=Bt(e.firstChild),tt=t,Ne=!0,ha=null,Ut=!0,a=$c(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Qa(),l===n){t=ta(e,t,a);break e}lt(e,t,l,a)}t=t.child}return t;case 26:return Bi(e,t),e===null?(a=xd(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ne||(a=t.type,e=t.pendingProps,l=Ii(te.current).createElement(a),l[et]=t,l[ct]=e,nt(l,a,e),Ie(l),t.stateNode=l):t.memoizedState=xd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return $e(t),e===null&&Ne&&(l=t.stateNode=vd(t.type,t.pendingProps,te.current),tt=t,Ut=!0,n=Be,Ca(t.type)?(xr=n,Be=Bt(l.firstChild)):Be=n),lt(e,t,t.pendingProps.children,a),Bi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ne&&((n=l=Be)&&(l=Pm(l,t.type,t.pendingProps,Ut),l!==null?(t.stateNode=l,tt=t,Be=Bt(l.firstChild),Ut=!1,n=!0):n=!1),n||va(t)),$e(t),n=t.type,i=t.pendingProps,d=e!==null?e.memoizedProps:null,l=i.children,mr(n,i)?l=null:d!==null&&mr(n,d)&&(t.flags|=32),t.memoizedState!==null&&(n=du(e,t,hm,null,null,a),Ln._currentValue=n),Bi(e,t),lt(e,t,l,a),t.child;case 6:return e===null&&Ne&&((e=a=Be)&&(a=eh(a,t.pendingProps,Ut),a!==null?(t.stateNode=a,tt=t,Be=null,e=!0):e=!1),e||va(t)),null;case 13:return lf(e,t,a);case 4:return he(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Wa(t,null,l,a):lt(e,t,l,a),t.child;case 11:return Jo(e,t,t.type,t.pendingProps,a);case 7:return lt(e,t,t.pendingProps,a),t.child;case 8:return lt(e,t,t.pendingProps.children,a),t.child;case 12:return lt(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,pa(t,t.type,l.value),lt(e,t,l.children,a),t.child;case 9:return n=t.type._context,l=t.pendingProps.children,Ka(t),n=at(n),l=l(n),t.flags|=1,lt(e,t,l,a),t.child;case 14:return Fo(e,t,t.type,t.pendingProps,a);case 15:return $o(e,t,t.type,t.pendingProps,a);case 19:return sf(e,t,a);case 31:return Am(e,t,a);case 22:return Wo(e,t,a,t.pendingProps);case 24:return Ka(t),l=at(Ze),e===null?(n=au(),n===null&&(n=Re,i=eu(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=a),n=i),t.memoizedState={parent:l,cache:n},nu(t),pa(t,Ze,n)):((e.lanes&a)!==0&&(iu(e,t),xn(t,null,null,a),gn()),n=e.memoizedState,i=t.memoizedState,n.parent!==l?(n={parent:l,cache:l},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),pa(t,Ze,l)):(l=i.cache,pa(t,Ze,l),l!==n.cache&&Ps(t,[Ze],a,!0))),lt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(C(156,t.tag))}function aa(e){e.flags|=4}function Gu(e,t,a,l,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(Rf())e.flags|=8192;else throw $a=Si,lu}else e.flags&=-16777217}function rf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Nd(t))if(Rf())e.flags|=8192;else throw $a=Si,lu}function _i(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Yr():536870912,e.lanes|=t,Yl|=t)}function wn(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var n=e.child;n!==null;)a|=n.lanes|n.childLanes,l|=n.subtreeFlags&65011712,l|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)a|=n.lanes|n.childLanes,l|=n.subtreeFlags,l|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function wm(e,t,a){var l=t.pendingProps;switch(Js(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return He(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),It(Ze),we(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(jl(t)?aa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,$s())),He(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(aa(t),i!==null?(He(t),rf(t,i)):(He(t),Gu(t,n,null,l,a))):i?i!==e.memoizedState?(aa(t),He(t),rf(t,i)):(He(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&aa(t),He(t),Gu(t,n,e,l,a)),null;case 27:if(Le(t),a=te.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&aa(t);else{if(!l){if(t.stateNode===null)throw Error(C(166));return He(t),null}e=se.current,jl(t)?Yc(t):(e=vd(n,l,a),t.stateNode=e,aa(t))}return He(t),null;case 5:if(Le(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&aa(t);else{if(!l){if(t.stateNode===null)throw Error(C(166));return He(t),null}if(i=se.current,jl(t))Yc(t);else{var d=Ii(te.current);switch(i){case 1:i=d.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:i=d.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":i=d.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":i=d.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":i=d.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?d.createElement(n,{is:l.is}):d.createElement(n)}}i[et]=t,i[ct]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=i;e:switch(nt(i,n,l),n){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&aa(t)}}return He(t),Gu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&aa(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(C(166));if(e=te.current,jl(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,n=tt,n!==null)switch(n.tag){case 27:case 5:l=n.memoizedProps}e[et]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||nd(e.nodeValue,a)),e||va(t,!0)}else e=Ii(e).createTextNode(l),e[et]=t,t.stateNode=e}return He(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=jl(t),a!==null){if(e===null){if(!l)throw Error(C(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(C(557));e[et]=t}else Qa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),e=!1}else a=$s(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(At(t),t):(At(t),null);if((t.flags&128)!==0)throw Error(C(558))}return He(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=jl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!n)throw Error(C(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(C(317));n[et]=t}else Qa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),n=!1}else n=$s(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(At(t),t):(At(t),null)}return At(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,n=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(n=l.alternate.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==n&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),_i(t,t.updateQueue),He(t),null);case 4:return we(),e===null&&rr(t.stateNode.containerInfo),He(t),null;case 10:return It(t.type),He(t),null;case 19:if(F(qe),l=t.memoizedState,l===null)return He(t),null;if(n=(t.flags&128)!==0,i=l.rendering,i===null)if(n)wn(l,!1);else{if(ke!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=wi(e),i!==null){for(t.flags|=128,wn(l,!1),e=i.updateQueue,t.updateQueue=e,_i(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Rc(a,e),a=a.sibling;return ae(qe,qe.current&1|2),Ne&&$t(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&it()>ki&&(t.flags|=128,n=!0,wn(l,!1),t.lanes=4194304)}else{if(!n)if(e=wi(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,_i(t,e),wn(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!Ne)return He(t),null}else 2*it()-l.renderingStartTime>ki&&a!==536870912&&(t.flags|=128,n=!0,wn(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(e=l.last,e!==null?e.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=it(),e.sibling=null,a=qe.current,ae(qe,n?a&1|2:a&1),Ne&&$t(t,l.treeForkCount),e):(He(t),null);case 22:case 23:return At(t),cu(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),a=t.updateQueue,a!==null&&_i(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&F(Ja),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),It(Ze),He(t),null;case 25:return null;case 30:return null}throw Error(C(156,t.tag))}function Mm(e,t){switch(Js(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return It(Ze),we(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Le(t),null;case 31:if(t.memoizedState!==null){if(At(t),t.alternate===null)throw Error(C(340));Qa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(At(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(C(340));Qa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(qe),null;case 4:return we(),null;case 10:return It(t.type),null;case 22:case 23:return At(t),cu(),e!==null&&F(Ja),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return It(Ze),null;case 25:return null;default:return null}}function cf(e,t){switch(Js(t),t.tag){case 3:It(Ze),we();break;case 26:case 27:case 5:Le(t);break;case 4:we();break;case 31:t.memoizedState!==null&&At(t);break;case 13:At(t);break;case 19:F(qe);break;case 10:It(t.type);break;case 22:case 23:At(t),cu(),e!==null&&F(Ja);break;case 24:It(Ze)}}function Mn(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var n=l.next;a=n;do{if((a.tag&e)===e){l=void 0;var i=a.create,d=a.inst;l=i(),d.destroy=l}a=a.next}while(a!==n)}}catch(A){Ce(t,t.return,A)}}function Aa(e,t,a){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var i=n.next;l=i;do{if((l.tag&e)===e){var d=l.inst,A=d.destroy;if(A!==void 0){d.destroy=void 0,n=t;var _=a,X=A;try{X()}catch($){Ce(n,_,$)}}}l=l.next}while(l!==i)}}catch($){Ce(t,t.return,$)}}function of(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Ic(t,a)}catch(l){Ce(e,e.return,l)}}}function ff(e,t,a){a.props=Pa(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Ce(e,t,l)}}function jn(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(n){Ce(e,t,n)}}function kt(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(n){Ce(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(n){Ce(e,t,n)}else a.current=null}function df(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(n){Ce(e,e.return,n)}}function Vu(e,t,a){try{var l=e.stateNode;Km(l,e.type,a,t),l[ct]=t}catch(n){Ce(e,e.return,n)}}function mf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ca(e.type)||e.tag===4}function ku(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ca(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qu(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Kt));else if(l!==4&&(l===27&&Ca(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(qu(e,t,a),e=e.sibling;e!==null;)qu(e,t,a),e=e.sibling}function Li(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&Ca(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Li(e,t,a),e=e.sibling;e!==null;)Li(e,t,a),e=e.sibling}function hf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);nt(t,l,a),t[et]=e,t[ct]=a}catch(i){Ce(e,e.return,i)}}var la=!1,Fe=!1,Xu=!1,vf=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function jm(e,t){if(e=e.containerInfo,fr=is,e=Mc(e),_s(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var n=l.anchorOffset,i=l.focusNode;l=l.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var d=0,A=-1,_=-1,X=0,$=0,I=e,Z=null;t:for(;;){for(var J;I!==a||n!==0&&I.nodeType!==3||(A=d+n),I!==i||l!==0&&I.nodeType!==3||(_=d+l),I.nodeType===3&&(d+=I.nodeValue.length),(J=I.firstChild)!==null;)Z=I,I=J;for(;;){if(I===e)break t;if(Z===a&&++X===n&&(A=d),Z===i&&++$===l&&(_=d),(J=I.nextSibling)!==null)break;I=Z,Z=I.parentNode}I=J}a=A===-1||_===-1?null:{start:A,end:_}}else a=null}a=a||{start:0,end:0}}else a=null;for(dr={focusedElem:e,selectionRange:a},is=!1,Pe=t;Pe!==null;)if(t=Pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Pe=e;else for(;Pe!==null;){switch(t=Pe,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)n=e[a],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,a=t,n=i.memoizedProps,i=i.memoizedState,l=a.stateNode;try{var ue=Pa(a.type,n);e=l.getSnapshotBeforeUpdate(ue,i),l.__reactInternalSnapshotBeforeUpdate=e}catch(de){Ce(a,a.return,de)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)vr(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":vr(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(C(163))}if(e=t.sibling,e!==null){e.return=t.return,Pe=e;break}Pe=t.return}}function pf(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:ia(e,a),l&4&&Mn(5,a);break;case 1:if(ia(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(d){Ce(a,a.return,d)}else{var n=Pa(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Ce(a,a.return,d)}}l&64&&of(a),l&512&&jn(a,a.return);break;case 3:if(ia(e,a),l&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Ic(e,t)}catch(d){Ce(a,a.return,d)}}break;case 27:t===null&&l&4&&hf(a);case 26:case 5:ia(e,a),t===null&&l&4&&df(a),l&512&&jn(a,a.return);break;case 12:ia(e,a);break;case 31:ia(e,a),l&4&&yf(e,a);break;case 13:ia(e,a),l&4&&Sf(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Bm.bind(null,a),th(e,a))));break;case 22:if(l=a.memoizedState!==null||la,!l){t=t!==null&&t.memoizedState!==null||Fe,n=la;var i=Fe;la=l,(Fe=t)&&!i?sa(e,a,(a.subtreeFlags&8772)!==0):ia(e,a),la=n,Fe=i}break;case 30:break;default:ia(e,a)}}function gf(e){var t=e.alternate;t!==null&&(e.alternate=null,gf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ss(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 Ye=null,ft=!1;function na(e,t,a){for(a=a.child;a!==null;)xf(e,t,a),a=a.sibling}function xf(e,t,a){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(Fl,a)}catch{}switch(a.tag){case 26:Fe||kt(a,t),na(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Fe||kt(a,t);var l=Ye,n=ft;Ca(a.type)&&(Ye=a.stateNode,ft=!1),na(e,t,a),Bn(a.stateNode),Ye=l,ft=n;break;case 5:Fe||kt(a,t);case 6:if(l=Ye,n=ft,Ye=null,na(e,t,a),Ye=l,ft=n,Ye!==null)if(ft)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(a.stateNode)}catch(i){Ce(a,t,i)}else try{Ye.removeChild(a.stateNode)}catch(i){Ce(a,t,i)}break;case 18:Ye!==null&&(ft?(e=Ye,od(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Kl(e)):od(Ye,a.stateNode));break;case 4:l=Ye,n=ft,Ye=a.stateNode.containerInfo,ft=!0,na(e,t,a),Ye=l,ft=n;break;case 0:case 11:case 14:case 15:Aa(2,a,t),Fe||Aa(4,a,t),na(e,t,a);break;case 1:Fe||(kt(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&ff(a,t,l)),na(e,t,a);break;case 21:na(e,t,a);break;case 22:Fe=(l=Fe)||a.memoizedState!==null,na(e,t,a),Fe=l;break;default:na(e,t,a)}}function yf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Kl(e)}catch(a){Ce(t,t.return,a)}}}function Sf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Kl(e)}catch(a){Ce(t,t.return,a)}}function Tm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vf),t;default:throw Error(C(435,e.tag))}}function Yi(e,t){var a=Tm(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var n=Hm.bind(null,e,l);l.then(n,n)}})}function dt(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var n=a[l],i=e,d=t,A=d;e:for(;A!==null;){switch(A.tag){case 27:if(Ca(A.type)){Ye=A.stateNode,ft=!1;break e}break;case 5:Ye=A.stateNode,ft=!1;break e;case 3:case 4:Ye=A.stateNode.containerInfo,ft=!0;break e}A=A.return}if(Ye===null)throw Error(C(160));xf(i,d,n),Ye=null,ft=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)bf(t,e),t=t.sibling}var Lt=null;function bf(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dt(t,e),mt(e),l&4&&(Aa(3,e,e.return),Mn(3,e),Aa(5,e,e.return));break;case 1:dt(t,e),mt(e),l&512&&(Fe||a===null||kt(a,a.return)),l&64&&la&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var n=Lt;if(dt(t,e),mt(e),l&512&&(Fe||a===null||kt(a,a.return)),l&4){var i=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,n=n.ownerDocument||n;t:switch(l){case"title":i=n.getElementsByTagName("title")[0],(!i||i[Il]||i[et]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(l),n.head.insertBefore(i,n.querySelector("head > title"))),nt(i,l,a),i[et]=e,Ie(i),l=i;break e;case"link":var d=bd("link","href",n).get(l+(a.href||""));if(d){for(var A=0;A<d.length;A++)if(i=d[A],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){d.splice(A,1);break t}}i=n.createElement(l),nt(i,l,a),n.head.appendChild(i);break;case"meta":if(d=bd("meta","content",n).get(l+(a.content||""))){for(A=0;A<d.length;A++)if(i=d[A],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){d.splice(A,1);break t}}i=n.createElement(l),nt(i,l,a),n.head.appendChild(i);break;default:throw Error(C(468,l))}i[et]=e,Ie(i),l=i}e.stateNode=l}else Ad(n,e.type,e.stateNode);else e.stateNode=Sd(n,l,e.memoizedProps);else i!==l?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,l===null?Ad(n,e.type,e.stateNode):Sd(n,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Vu(e,e.memoizedProps,a.memoizedProps)}break;case 27:dt(t,e),mt(e),l&512&&(Fe||a===null||kt(a,a.return)),a!==null&&l&4&&Vu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(dt(t,e),mt(e),l&512&&(Fe||a===null||kt(a,a.return)),e.flags&32){n=e.stateNode;try{pl(n,"")}catch(ue){Ce(e,e.return,ue)}}l&4&&e.stateNode!=null&&(n=e.memoizedProps,Vu(e,n,a!==null?a.memoizedProps:n)),l&1024&&(Xu=!0);break;case 6:if(dt(t,e),mt(e),l&4){if(e.stateNode===null)throw Error(C(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(ue){Ce(e,e.return,ue)}}break;case 3:if(ts=null,n=Lt,Lt=Pi(t.containerInfo),dt(t,e),Lt=n,mt(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{Kl(t.containerInfo)}catch(ue){Ce(e,e.return,ue)}Xu&&(Xu=!1,Af(e));break;case 4:l=Lt,Lt=Pi(e.stateNode.containerInfo),dt(t,e),mt(e),Lt=l;break;case 12:dt(t,e),mt(e);break;case 31:dt(t,e),mt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Yi(e,l)));break;case 13:dt(t,e),mt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Vi=it()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Yi(e,l)));break;case 22:n=e.memoizedState!==null;var _=a!==null&&a.memoizedState!==null,X=la,$=Fe;if(la=X||n,Fe=$||_,dt(t,e),Fe=$,la=X,mt(e),l&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(a===null||_||la||Fe||el(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){_=a=t;try{if(i=_.stateNode,n)d=i.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{A=_.stateNode;var I=_.memoizedProps.style,Z=I!=null&&I.hasOwnProperty("display")?I.display:null;A.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(ue){Ce(_,_.return,ue)}}}else if(t.tag===6){if(a===null){_=t;try{_.stateNode.nodeValue=n?"":_.memoizedProps}catch(ue){Ce(_,_.return,ue)}}}else if(t.tag===18){if(a===null){_=t;try{var J=_.stateNode;n?fd(J,!0):fd(_.stateNode,!1)}catch(ue){Ce(_,_.return,ue)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,Yi(e,a))));break;case 19:dt(t,e),mt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Yi(e,l)));break;case 30:break;case 21:break;default:dt(t,e),mt(e)}}function mt(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if(mf(l)){a=l;break}l=l.return}if(a==null)throw Error(C(160));switch(a.tag){case 27:var n=a.stateNode,i=ku(e);Li(e,i,n);break;case 5:var d=a.stateNode;a.flags&32&&(pl(d,""),a.flags&=-33);var A=ku(e);Li(e,A,d);break;case 3:case 4:var _=a.stateNode.containerInfo,X=ku(e);qu(e,X,_);break;default:throw Error(C(161))}}catch($){Ce(e,e.return,$)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Af(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Af(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ia(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pf(e,t.alternate,t),t=t.sibling}function el(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Aa(4,t,t.return),el(t);break;case 1:kt(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&ff(t,t.return,a),el(t);break;case 27:Bn(t.stateNode);case 26:case 5:kt(t,t.return),el(t);break;case 22:t.memoizedState===null&&el(t);break;case 30:el(t);break;default:el(t)}e=e.sibling}}function sa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,n=e,i=t,d=i.flags;switch(i.tag){case 0:case 11:case 15:sa(n,i,a),Mn(4,i);break;case 1:if(sa(n,i,a),l=i,n=l.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(X){Ce(l,l.return,X)}if(l=i,n=l.updateQueue,n!==null){var A=l.stateNode;try{var _=n.shared.hiddenCallbacks;if(_!==null)for(n.shared.hiddenCallbacks=null,n=0;n<_.length;n++)Wc(_[n],A)}catch(X){Ce(l,l.return,X)}}a&&d&64&&of(i),jn(i,i.return);break;case 27:hf(i);case 26:case 5:sa(n,i,a),a&&l===null&&d&4&&df(i),jn(i,i.return);break;case 12:sa(n,i,a);break;case 31:sa(n,i,a),a&&d&4&&yf(n,i);break;case 13:sa(n,i,a),a&&d&4&&Sf(n,i);break;case 22:i.memoizedState===null&&sa(n,i,a),jn(i,i.return);break;case 30:break;default:sa(n,i,a)}t=t.sibling}}function Qu(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&dn(a))}function Zu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dn(e))}function Yt(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Nf(e,t,a,l),t=t.sibling}function Nf(e,t,a,l){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Yt(e,t,a,l),n&2048&&Mn(9,t);break;case 1:Yt(e,t,a,l);break;case 3:Yt(e,t,a,l),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dn(e)));break;case 12:if(n&2048){Yt(e,t,a,l),e=t.stateNode;try{var i=t.memoizedProps,d=i.id,A=i.onPostCommit;typeof A=="function"&&A(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(_){Ce(t,t.return,_)}}else Yt(e,t,a,l);break;case 31:Yt(e,t,a,l);break;case 13:Yt(e,t,a,l);break;case 23:break;case 22:i=t.stateNode,d=t.alternate,t.memoizedState!==null?i._visibility&2?Yt(e,t,a,l):Tn(e,t):i._visibility&2?Yt(e,t,a,l):(i._visibility|=2,Hl(e,t,a,l,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Qu(d,t);break;case 24:Yt(e,t,a,l),n&2048&&Zu(t.alternate,t);break;default:Yt(e,t,a,l)}}function Hl(e,t,a,l,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,d=t,A=a,_=l,X=d.flags;switch(d.tag){case 0:case 11:case 15:Hl(i,d,A,_,n),Mn(8,d);break;case 23:break;case 22:var $=d.stateNode;d.memoizedState!==null?$._visibility&2?Hl(i,d,A,_,n):Tn(i,d):($._visibility|=2,Hl(i,d,A,_,n)),n&&X&2048&&Qu(d.alternate,d);break;case 24:Hl(i,d,A,_,n),n&&X&2048&&Zu(d.alternate,d);break;default:Hl(i,d,A,_,n)}t=t.sibling}}function Tn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,n=l.flags;switch(l.tag){case 22:Tn(a,l),n&2048&&Qu(l.alternate,l);break;case 24:Tn(a,l),n&2048&&Zu(l.alternate,l);break;default:Tn(a,l)}t=t.sibling}}var En=8192;function _l(e,t,a){if(e.subtreeFlags&En)for(e=e.child;e!==null;)wf(e,t,a),e=e.sibling}function wf(e,t,a){switch(e.tag){case 26:_l(e,t,a),e.flags&En&&e.memoizedState!==null&&mh(a,Lt,e.memoizedState,e.memoizedProps);break;case 5:_l(e,t,a);break;case 3:case 4:var l=Lt;Lt=Pi(e.stateNode.containerInfo),_l(e,t,a),Lt=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=En,En=16777216,_l(e,t,a),En=l):_l(e,t,a));break;default:_l(e,t,a)}}function Mf(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 Cn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Pe=l,Tf(l,e)}Mf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jf(e),e=e.sibling}function jf(e){switch(e.tag){case 0:case 11:case 15:Cn(e),e.flags&2048&&Aa(9,e,e.return);break;case 3:Cn(e);break;case 12:Cn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gi(e)):Cn(e);break;default:Cn(e)}}function Gi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Pe=l,Tf(l,e)}Mf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Aa(8,t,t.return),Gi(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Gi(t));break;default:Gi(t)}e=e.sibling}}function Tf(e,t){for(;Pe!==null;){var a=Pe;switch(a.tag){case 0:case 11:case 15:Aa(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:dn(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Pe=l;else e:for(a=e;Pe!==null;){l=Pe;var n=l.sibling,i=l.return;if(gf(l),l===a){Pe=null;break e}if(n!==null){n.return=i,Pe=n;break e}Pe=i}}}var Em={getCacheForType:function(e){var t=at(Ze),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return at(Ze).controller.signal}},Cm=typeof WeakMap=="function"?WeakMap:Map,Te=0,Re=null,ye=null,be=0,Ee=0,Nt=null,Na=!1,Ll=!1,Ku=!1,ua=0,ke=0,wa=0,tl=0,Ju=0,wt=0,Yl=0,Dn=null,ht=null,Fu=!1,Vi=0,Ef=0,ki=1/0,qi=null,Ma=null,We=0,ja=null,Gl=null,ra=0,$u=0,Wu=null,Cf=null,zn=0,Iu=null;function Mt(){return(Te&2)!==0&&be!==0?be&-be:V.T!==null?nr():qr()}function Df(){if(wt===0)if((be&536870912)===0||Ne){var e=Wn;Wn<<=1,(Wn&3932160)===0&&(Wn=262144),wt=e}else wt=536870912;return e=bt.current,e!==null&&(e.flags|=32),wt}function vt(e,t,a){(e===Re&&(Ee===2||Ee===9)||e.cancelPendingCommit!==null)&&(Vl(e,0),Ta(e,be,wt,!1)),Wl(e,a),((Te&2)===0||e!==Re)&&(e===Re&&((Te&2)===0&&(tl|=a),ke===4&&Ta(e,be,wt,!1)),qt(e))}function zf(e,t,a){if((Te&6)!==0)throw Error(C(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||$l(e,t),n=l?Om(e,t):er(e,t,!0),i=l;do{if(n===0){Ll&&!l&&Ta(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!Dm(a)){n=er(e,t,!1),i=!1;continue}if(n===2){if(i=t,e.errorRecoveryDisabledLanes&i)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var A=e;n=Dn;var _=A.current.memoizedState.isDehydrated;if(_&&(Vl(A,d).flags|=256),d=er(A,d,!1),d!==2){if(Ku&&!_){A.errorRecoveryDisabledLanes|=i,tl|=i,n=4;break e}i=ht,ht=n,i!==null&&(ht===null?ht=i:ht.push.apply(ht,i))}n=d}if(i=!1,n!==2)continue}}if(n===1){Vl(e,0),Ta(e,t,0,!0);break}e:{switch(l=e,i=n,i){case 0:case 1:throw Error(C(345));case 4:if((t&4194048)!==t)break;case 6:Ta(l,t,wt,!Na);break e;case 2:ht=null;break;case 3:case 5:break;default:throw Error(C(329))}if((t&62914560)===t&&(n=Vi+300-it(),10<n)){if(Ta(l,t,wt,!Na),Pn(l,0,!0)!==0)break e;ra=t,l.timeoutHandle=rd(Of.bind(null,l,a,ht,qi,Fu,t,wt,tl,Yl,Na,i,"Throttled",-0,0),n);break e}Of(l,a,ht,qi,Fu,t,wt,tl,Yl,Na,i,null,-0,0)}}break}while(!0);qt(e)}function Of(e,t,a,l,n,i,d,A,_,X,$,I,Z,J){if(e.timeoutHandle=-1,I=t.subtreeFlags,I&8192||(I&16785408)===16785408){I={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Kt},wf(t,i,I);var ue=(i&62914560)===i?Vi-it():(i&4194048)===i?Ef-it():0;if(ue=hh(I,ue),ue!==null){ra=i,e.cancelPendingCommit=ue(Gf.bind(null,e,t,i,a,l,n,d,A,_,$,I,null,Z,J)),Ta(e,i,d,!X);return}}Gf(e,t,i,a,l,n,d,A,_)}function Dm(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var n=a[l],i=n.getSnapshot;n=n.value;try{if(!yt(i(),n))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Ta(e,t,a,l){t&=~Ju,t&=~tl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var n=t;0<n;){var i=31-xt(n),d=1<<i;l[i]=-1,n&=~d}a!==0&&Gr(e,a,t)}function Xi(){return(Te&6)===0?(On(0),!1):!0}function Pu(){if(ye!==null){if(Ee===0)var e=ye.return;else e=ye,Wt=Za=null,vu(e),zl=null,hn=0,e=ye;for(;e!==null;)cf(e.alternate,e),e=e.return;ye=null}}function Vl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,$m(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ra=0,Pu(),Re=e,ye=a=Ft(e.current,null),be=t,Ee=0,Nt=null,Na=!1,Ll=$l(e,t),Ku=!1,Yl=wt=Ju=tl=wa=ke=0,ht=Dn=null,Fu=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var n=31-xt(l),i=1<<n;t|=e[n],l&=~i}return ua=t,fi(),a}function Uf(e,t){pe=null,V.H=An,t===Dl||t===yi?(t=Kc(),Ee=3):t===lu?(t=Kc(),Ee=4):Ee=t===zu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Nt=t,ye===null&&(ke=1,Ui(e,Dt(t,e.current)))}function Rf(){var e=bt.current;return e===null?!0:(be&4194048)===be?Rt===null:(be&62914560)===be||(be&536870912)!==0?e===Rt:!1}function Bf(){var e=V.H;return V.H=An,e===null?An:e}function Hf(){var e=V.A;return V.A=Em,e}function Qi(){ke=4,Na||(be&4194048)!==be&&bt.current!==null||(Ll=!0),(wa&134217727)===0&&(tl&134217727)===0||Re===null||Ta(Re,be,wt,!1)}function er(e,t,a){var l=Te;Te|=2;var n=Bf(),i=Hf();(Re!==e||be!==t)&&(qi=null,Vl(e,t)),t=!1;var d=ke;e:do try{if(Ee!==0&&ye!==null){var A=ye,_=Nt;switch(Ee){case 8:Pu(),d=6;break e;case 3:case 2:case 9:case 6:bt.current===null&&(t=!0);var X=Ee;if(Ee=0,Nt=null,kl(e,A,_,X),a&&Ll){d=0;break e}break;default:X=Ee,Ee=0,Nt=null,kl(e,A,_,X)}}zm(),d=ke;break}catch($){Uf(e,$)}while(!0);return t&&e.shellSuspendCounter++,Wt=Za=null,Te=l,V.H=n,V.A=i,ye===null&&(Re=null,be=0,fi()),d}function zm(){for(;ye!==null;)_f(ye)}function Om(e,t){var a=Te;Te|=2;var l=Bf(),n=Hf();Re!==e||be!==t?(qi=null,ki=it()+500,Vl(e,t)):Ll=$l(e,t);e:do try{if(Ee!==0&&ye!==null){t=ye;var i=Nt;t:switch(Ee){case 1:Ee=0,Nt=null,kl(e,t,i,1);break;case 2:case 9:if(Qc(i)){Ee=0,Nt=null,Lf(t);break}t=function(){Ee!==2&&Ee!==9||Re!==e||(Ee=7),qt(e)},i.then(t,t);break e;case 3:Ee=7;break e;case 4:Ee=5;break e;case 7:Qc(i)?(Ee=0,Nt=null,Lf(t)):(Ee=0,Nt=null,kl(e,t,i,7));break;case 5:var d=null;switch(ye.tag){case 26:d=ye.memoizedState;case 5:case 27:var A=ye;if(d?Nd(d):A.stateNode.complete){Ee=0,Nt=null;var _=A.sibling;if(_!==null)ye=_;else{var X=A.return;X!==null?(ye=X,Zi(X)):ye=null}break t}}Ee=0,Nt=null,kl(e,t,i,5);break;case 6:Ee=0,Nt=null,kl(e,t,i,6);break;case 8:Pu(),ke=6;break e;default:throw Error(C(462))}}Um();break}catch($){Uf(e,$)}while(!0);return Wt=Za=null,V.H=l,V.A=n,Te=a,ye!==null?0:(Re=null,be=0,fi(),ke)}function Um(){for(;ye!==null&&!Zn();)_f(ye)}function _f(e){var t=uf(e.alternate,e,ua);e.memoizedProps=e.pendingProps,t===null?Zi(e):ye=t}function Lf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=ef(a,t,t.pendingProps,t.type,void 0,be);break;case 11:t=ef(a,t,t.pendingProps,t.type.render,t.ref,be);break;case 5:vu(t);default:cf(a,t),t=ye=Rc(t,ua),t=uf(a,t,ua)}e.memoizedProps=e.pendingProps,t===null?Zi(e):ye=t}function kl(e,t,a,l){Wt=Za=null,vu(t),zl=null,hn=0;var n=t.return;try{if(bm(e,n,t,a,be)){ke=1,Ui(e,Dt(a,e.current)),ye=null;return}}catch(i){if(n!==null)throw ye=n,i;ke=1,Ui(e,Dt(a,e.current)),ye=null;return}t.flags&32768?(Ne||l===1?e=!0:Ll||(be&536870912)!==0?e=!1:(Na=e=!0,(l===2||l===9||l===3||l===6)&&(l=bt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Yf(t,e)):Zi(t)}function Zi(e){var t=e;do{if((t.flags&32768)!==0){Yf(t,Na);return}e=t.return;var a=wm(t.alternate,t,ua);if(a!==null){ye=a;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);ke===0&&(ke=5)}function Yf(e,t){do{var a=Mm(e.alternate,e);if(a!==null){a.flags&=32767,ye=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){ye=e;return}ye=e=a}while(e!==null);ke=6,ye=null}function Gf(e,t,a,l,n,i,d,A,_){e.cancelPendingCommit=null;do Ki();while(We!==0);if((Te&6)!==0)throw Error(C(327));if(t!==null){if(t===e.current)throw Error(C(177));if(i=t.lanes|t.childLanes,i|=ks,d0(e,a,i,d,A,_),e===Re&&(ye=Re=null,be=0),Gl=t,ja=e,ra=a,$u=i,Wu=n,Cf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,_m(rl,function(){return Qf(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=V.T,V.T=null,n=K.p,K.p=2,d=Te,Te|=4;try{jm(e,t,a)}finally{Te=d,K.p=n,V.T=l}}We=1,Vf(),kf(),qf()}}function Vf(){if(We===1){We=0;var e=ja,t=Gl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=V.T,V.T=null;var l=K.p;K.p=2;var n=Te;Te|=4;try{bf(t,e);var i=dr,d=Mc(e.containerInfo),A=i.focusedElem,_=i.selectionRange;if(d!==A&&A&&A.ownerDocument&&wc(A.ownerDocument.documentElement,A)){if(_!==null&&_s(A)){var X=_.start,$=_.end;if($===void 0&&($=X),"selectionStart"in A)A.selectionStart=X,A.selectionEnd=Math.min($,A.value.length);else{var I=A.ownerDocument||document,Z=I&&I.defaultView||window;if(Z.getSelection){var J=Z.getSelection(),ue=A.textContent.length,de=Math.min(_.start,ue),Ue=_.end===void 0?de:Math.min(_.end,ue);!J.extend&&de>Ue&&(d=Ue,Ue=de,de=d);var k=Nc(A,de),G=Nc(A,Ue);if(k&&G&&(J.rangeCount!==1||J.anchorNode!==k.node||J.anchorOffset!==k.offset||J.focusNode!==G.node||J.focusOffset!==G.offset)){var q=I.createRange();q.setStart(k.node,k.offset),J.removeAllRanges(),de>Ue?(J.addRange(q),J.extend(G.node,G.offset)):(q.setEnd(G.node,G.offset),J.addRange(q))}}}}for(I=[],J=A;J=J.parentNode;)J.nodeType===1&&I.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<I.length;A++){var W=I[A];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}is=!!fr,dr=fr=null}finally{Te=n,K.p=l,V.T=a}}e.current=t,We=2}}function kf(){if(We===2){We=0;var e=ja,t=Gl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=V.T,V.T=null;var l=K.p;K.p=2;var n=Te;Te|=4;try{pf(e,t.alternate,t)}finally{Te=n,K.p=l,V.T=a}}We=3}}function qf(){if(We===4||We===3){We=0,Kn();var e=ja,t=Gl,a=ra,l=Cf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?We=5:(We=0,Gl=ja=null,Xf(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(Ma=null),xs(a),t=t.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(Fl,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=V.T,n=K.p,K.p=2,V.T=null;try{for(var i=e.onRecoverableError,d=0;d<l.length;d++){var A=l[d];i(A.value,{componentStack:A.stack})}}finally{V.T=t,K.p=n}}(ra&3)!==0&&Ki(),qt(e),n=e.pendingLanes,(a&261930)!==0&&(n&42)!==0?e===Iu?zn++:(zn=0,Iu=e):zn=0,On(0)}}function Xf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,dn(t)))}function Ki(){return Vf(),kf(),qf(),Qf()}function Qf(){if(We!==5)return!1;var e=ja,t=$u;$u=0;var a=xs(ra),l=V.T,n=K.p;try{K.p=32>a?32:a,V.T=null,a=Wu,Wu=null;var i=ja,d=ra;if(We=0,Gl=ja=null,ra=0,(Te&6)!==0)throw Error(C(331));var A=Te;if(Te|=4,jf(i.current),Nf(i,i.current,d,a),Te=A,On(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(Fl,i)}catch{}return!0}finally{K.p=n,V.T=l,Xf(e,t)}}function Zf(e,t,a){t=Dt(a,t),t=Du(e.stateNode,t,2),e=ya(e,t,2),e!==null&&(Wl(e,2),qt(e))}function Ce(e,t,a){if(e.tag===3)Zf(e,e,a);else for(;t!==null;){if(t.tag===3){Zf(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ma===null||!Ma.has(l))){e=Dt(a,e),a=Zo(2),l=ya(t,a,2),l!==null&&(Ko(a,l,t,e),Wl(l,2),qt(l));break}}t=t.return}}function tr(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new Cm;var n=new Set;l.set(t,n)}else n=l.get(t),n===void 0&&(n=new Set,l.set(t,n));n.has(a)||(Ku=!0,n.add(a),e=Rm.bind(null,e,t,a),t.then(e,e))}function Rm(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Re===e&&(be&a)===a&&(ke===4||ke===3&&(be&62914560)===be&&300>it()-Vi?(Te&2)===0&&Vl(e,0):Ju|=a,Yl===be&&(Yl=0)),qt(e)}function Kf(e,t){t===0&&(t=Yr()),e=qa(e,t),e!==null&&(Wl(e,t),qt(e))}function Bm(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Kf(e,a)}function Hm(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,n=e.memoizedState;n!==null&&(a=n.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(C(314))}l!==null&&l.delete(t),Kf(e,a)}function _m(e,t){return ul(e,t)}var Ji=null,ql=null,ar=!1,Fi=!1,lr=!1,Ea=0;function qt(e){e!==ql&&e.next===null&&(ql===null?Ji=ql=e:ql=ql.next=e),Fi=!0,ar||(ar=!0,Ym())}function On(e,t){if(!lr&&Fi){lr=!0;do for(var a=!1,l=Ji;l!==null;){if(e!==0){var n=l.pendingLanes;if(n===0)var i=0;else{var d=l.suspendedLanes,A=l.pingedLanes;i=(1<<31-xt(42|e)+1)-1,i&=n&~(d&~A),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Wf(l,i))}else i=be,i=Pn(l,l===Re?i:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(i&3)===0||$l(l,i)||(a=!0,Wf(l,i));l=l.next}while(a);lr=!1}}function Lm(){Jf()}function Jf(){Fi=ar=!1;var e=0;Ea!==0&&Fm()&&(e=Ea);for(var t=it(),a=null,l=Ji;l!==null;){var n=l.next,i=Ff(l,t);i===0?(l.next=null,a===null?Ji=n:a.next=n,n===null&&(ql=a)):(a=l,(e!==0||(i&3)!==0)&&(Fi=!0)),l=n}We!==0&&We!==5||On(e),Ea!==0&&(Ea=0)}function Ff(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var d=31-xt(i),A=1<<d,_=n[d];_===-1?((A&a)===0||(A&l)!==0)&&(n[d]=f0(A,t)):_<=t&&(e.expiredLanes|=A),i&=~A}if(t=Re,a=be,a=Pn(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(Ee===2||Ee===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Ba(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||$l(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&Ba(l),xs(a)){case 2:case 8:a=Fn;break;case 32:a=rl;break;case 268435456:a=_a;break;default:a=rl}return l=$f.bind(null,e),a=ul(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&Ba(l),e.callbackPriority=2,e.callbackNode=null,2}function $f(e,t){if(We!==0&&We!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ki()&&e.callbackNode!==a)return null;var l=be;return l=Pn(e,e===Re?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(zf(e,l,t),Ff(e,it()),e.callbackNode!=null&&e.callbackNode===a?$f.bind(null,e):null)}function Wf(e,t){if(Ki())return null;zf(e,t,!0)}function Ym(){Wm(function(){(Te&6)!==0?ul(Ha,Lm):Jf()})}function nr(){if(Ea===0){var e=El;e===0&&(e=$n,$n<<=1,($n&261888)===0&&($n=256)),Ea=e}return Ea}function If(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:li(""+e)}function Pf(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Gm(e,t,a,l,n){if(t==="submit"&&a&&a.stateNode===n){var i=If((n[ct]||null).action),d=l.submitter;d&&(t=(t=d[ct]||null)?If(t.formAction):d.getAttribute("formAction"),t!==null&&(i=t,d=null));var A=new ui("action","action",null,l,n);e.push({event:A,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ea!==0){var _=d?Pf(n,d):new FormData(n);wu(a,{pending:!0,data:_,method:n.method,action:i},null,_)}}else typeof i=="function"&&(A.preventDefault(),_=d?Pf(n,d):new FormData(n),wu(a,{pending:!0,data:_,method:n.method,action:i},i,_))},currentTarget:n}]})}}for(var ir=0;ir<Vs.length;ir++){var sr=Vs[ir],Vm=sr.toLowerCase(),km=sr[0].toUpperCase()+sr.slice(1);_t(Vm,"on"+km)}_t(Ec,"onAnimationEnd"),_t(Cc,"onAnimationIteration"),_t(Dc,"onAnimationStart"),_t("dblclick","onDoubleClick"),_t("focusin","onFocus"),_t("focusout","onBlur"),_t(nm,"onTransitionRun"),_t(im,"onTransitionStart"),_t(sm,"onTransitionCancel"),_t(zc,"onTransitionEnd"),hl("onMouseEnter",["mouseout","mouseover"]),hl("onMouseLeave",["mouseout","mouseover"]),hl("onPointerEnter",["pointerout","pointerover"]),hl("onPointerLeave",["pointerout","pointerover"]),Ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ya("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Un="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(" "),qm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Un));function ed(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],n=l.event;l=l.listeners;e:{var i=void 0;if(t)for(var d=l.length-1;0<=d;d--){var A=l[d],_=A.instance,X=A.currentTarget;if(A=A.listener,_!==i&&n.isPropagationStopped())break e;i=A,n.currentTarget=X;try{i(n)}catch($){oi($)}n.currentTarget=null,i=_}else for(d=0;d<l.length;d++){if(A=l[d],_=A.instance,X=A.currentTarget,A=A.listener,_!==i&&n.isPropagationStopped())break e;i=A,n.currentTarget=X;try{i(n)}catch($){oi($)}n.currentTarget=null,i=_}}}}function Se(e,t){var a=t[ys];a===void 0&&(a=t[ys]=new Set);var l=e+"__bubble";a.has(l)||(td(t,e,2,!1),a.add(l))}function ur(e,t,a){var l=0;t&&(l|=4),td(a,e,l,t)}var $i="_reactListening"+Math.random().toString(36).slice(2);function rr(e){if(!e[$i]){e[$i]=!0,Zr.forEach(function(a){a!=="selectionchange"&&(qm.has(a)||ur(a,!1,e),ur(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$i]||(t[$i]=!0,ur("selectionchange",!1,t))}}function td(e,t,a,l){switch(Dd(t)){case 2:var n=gh;break;case 8:n=xh;break;default:n=Nr}a=n.bind(null,t,a,e),n=void 0,!Es||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),l?n!==void 0?e.addEventListener(t,a,{capture:!0,passive:n}):e.addEventListener(t,a,!0):n!==void 0?e.addEventListener(t,a,{passive:n}):e.addEventListener(t,a,!1)}function cr(e,t,a,l,n){var i=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var A=l.stateNode.containerInfo;if(A===n)break;if(d===4)for(d=l.return;d!==null;){var _=d.tag;if((_===3||_===4)&&d.stateNode.containerInfo===n)return;d=d.return}for(;A!==null;){if(d=fl(A),d===null)return;if(_=d.tag,_===5||_===6||_===26||_===27){l=i=d;continue e}A=A.parentNode}}l=l.return}nc(function(){var X=i,$=js(a),I=[];e:{var Z=Oc.get(e);if(Z!==void 0){var J=ui,ue=e;switch(e){case"keypress":if(ii(a)===0)break e;case"keydown":case"keyup":J=H0;break;case"focusin":ue="focus",J=Os;break;case"focusout":ue="blur",J=Os;break;case"beforeblur":case"afterblur":J=Os;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=uc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=w0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=Y0;break;case Ec:case Cc:case Dc:J=T0;break;case zc:J=V0;break;case"scroll":case"scrollend":J=A0;break;case"wheel":J=q0;break;case"copy":case"cut":case"paste":J=C0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=cc;break;case"toggle":case"beforetoggle":J=Q0}var de=(t&4)!==0,Ue=!de&&(e==="scroll"||e==="scrollend"),k=de?Z!==null?Z+"Capture":null:Z;de=[];for(var G=X,q;G!==null;){var W=G;if(q=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||q===null||k===null||(W=en(G,k),W!=null&&de.push(Rn(G,W,q))),Ue)break;G=G.return}0<de.length&&(Z=new J(Z,ue,null,a,$),I.push({event:Z,listeners:de}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",Z&&a!==Ms&&(ue=a.relatedTarget||a.fromElement)&&(fl(ue)||ue[ol]))break e;if((J||Z)&&(Z=$.window===$?$:(Z=$.ownerDocument)?Z.defaultView||Z.parentWindow:window,J?(ue=a.relatedTarget||a.toElement,J=X,ue=ue?fl(ue):null,ue!==null&&(Ue=s(ue),de=ue.tag,ue!==Ue||de!==5&&de!==27&&de!==6)&&(ue=null)):(J=null,ue=X),J!==ue)){if(de=uc,W="onMouseLeave",k="onMouseEnter",G="mouse",(e==="pointerout"||e==="pointerover")&&(de=cc,W="onPointerLeave",k="onPointerEnter",G="pointer"),Ue=J==null?Z:Pl(J),q=ue==null?Z:Pl(ue),Z=new de(W,G+"leave",J,a,$),Z.target=Ue,Z.relatedTarget=q,W=null,fl($)===X&&(de=new de(k,G+"enter",ue,a,$),de.target=q,de.relatedTarget=Ue,W=de),Ue=W,J&&ue)t:{for(de=Xm,k=J,G=ue,q=0,W=k;W;W=de(W))q++;W=0;for(var oe=G;oe;oe=de(oe))W++;for(;0<q-W;)k=de(k),q--;for(;0<W-q;)G=de(G),W--;for(;q--;){if(k===G||G!==null&&k===G.alternate){de=k;break t}k=de(k),G=de(G)}de=null}else de=null;J!==null&&ad(I,Z,J,de,!1),ue!==null&&Ue!==null&&ad(I,Ue,ue,de,!0)}}e:{if(Z=X?Pl(X):window,J=Z.nodeName&&Z.nodeName.toLowerCase(),J==="select"||J==="input"&&Z.type==="file")var Me=gc;else if(vc(Z))if(xc)Me=tm;else{Me=P0;var ce=I0}else J=Z.nodeName,!J||J.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?X&&ws(X.elementType)&&(Me=gc):Me=em;if(Me&&(Me=Me(e,X))){pc(I,Me,a,$);break e}ce&&ce(e,Z,X),e==="focusout"&&X&&Z.type==="number"&&X.memoizedProps.value!=null&&Ns(Z,"number",Z.value)}switch(ce=X?Pl(X):window,e){case"focusin":(vc(ce)||ce.contentEditable==="true")&&(Sl=ce,Ls=X,cn=null);break;case"focusout":cn=Ls=Sl=null;break;case"mousedown":Ys=!0;break;case"contextmenu":case"mouseup":case"dragend":Ys=!1,jc(I,a,$);break;case"selectionchange":if(lm)break;case"keydown":case"keyup":jc(I,a,$)}var xe;if(Rs)e:{switch(e){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else yl?mc(e,a)&&(Ae="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ae="onCompositionStart");Ae&&(oc&&a.locale!=="ko"&&(yl||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&yl&&(xe=ic()):(da=$,Cs="value"in da?da.value:da.textContent,yl=!0)),ce=Wi(X,Ae),0<ce.length&&(Ae=new rc(Ae,e,null,a,$),I.push({event:Ae,listeners:ce}),xe?Ae.data=xe:(xe=hc(a),xe!==null&&(Ae.data=xe)))),(xe=K0?J0(e,a):F0(e,a))&&(Ae=Wi(X,"onBeforeInput"),0<Ae.length&&(ce=new rc("onBeforeInput","beforeinput",null,a,$),I.push({event:ce,listeners:Ae}),ce.data=xe)),Gm(I,e,X,a,$)}ed(I,t)})}function Rn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Wi(e,t){for(var a=t+"Capture",l=[];e!==null;){var n=e,i=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||i===null||(n=en(e,a),n!=null&&l.unshift(Rn(e,n,i)),n=en(e,t),n!=null&&l.push(Rn(e,n,i))),e.tag===3)return l;e=e.return}return[]}function Xm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ad(e,t,a,l,n){for(var i=t._reactName,d=[];a!==null&&a!==l;){var A=a,_=A.alternate,X=A.stateNode;if(A=A.tag,_!==null&&_===l)break;A!==5&&A!==26&&A!==27||X===null||(_=X,n?(X=en(a,i),X!=null&&d.unshift(Rn(a,X,_))):n||(X=en(a,i),X!=null&&d.push(Rn(a,X,_)))),a=a.return}d.length!==0&&e.push({event:t,listeners:d})}var Qm=/\r\n?/g,Zm=/\u0000|\uFFFD/g;function ld(e){return(typeof e=="string"?e:""+e).replace(Qm,`
`).replace(Zm,"")}function nd(e,t){return t=ld(t),ld(e)===t}function Oe(e,t,a,l,n,i){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||pl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&pl(e,""+l);break;case"className":ti(e,"class",l);break;case"tabIndex":ti(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ti(e,a,l);break;case"style":ac(e,l,i);break;case"data":if(t!=="object"){ti(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=li(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"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}else typeof i=="function"&&(a==="formAction"?(t!=="input"&&Oe(e,t,"name",n.name,n,null),Oe(e,t,"formEncType",n.formEncType,n,null),Oe(e,t,"formMethod",n.formMethod,n,null),Oe(e,t,"formTarget",n.formTarget,n,null)):(Oe(e,t,"encType",n.encType,n,null),Oe(e,t,"method",n.method,n,null),Oe(e,t,"target",n.target,n,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=li(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=Kt);break;case"onScroll":l!=null&&Se("scroll",e);break;case"onScrollEnd":l!=null&&Se("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(C(61));if(a=l.__html,a!=null){if(n.children!=null)throw Error(C(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=li(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":Se("beforetoggle",e),Se("toggle",e),ei(e,"popover",l);break;case"xlinkActuate":Zt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Zt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Zt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Zt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Zt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Zt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ei(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=S0.get(a)||a,ei(e,a,l))}}function or(e,t,a,l,n,i){switch(a){case"style":ac(e,l,i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(C(61));if(a=l.__html,a!=null){if(n.children!=null)throw Error(C(60));e.innerHTML=a}}break;case"children":typeof l=="string"?pl(e,l):(typeof l=="number"||typeof l=="bigint")&&pl(e,""+l);break;case"onScroll":l!=null&&Se("scroll",e);break;case"onScrollEnd":l!=null&&Se("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Kt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Kr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(n=a.endsWith("Capture"),t=a.slice(2,n?a.length-7:void 0),i=e[ct]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,n),typeof l=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,n);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):ei(e,a,l)}}}function nt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Se("error",e),Se("load",e);var l=!1,n=!1,i;for(i in a)if(a.hasOwnProperty(i)){var d=a[i];if(d!=null)switch(i){case"src":l=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(C(137,t));default:Oe(e,t,i,d,a,null)}}n&&Oe(e,t,"srcSet",a.srcSet,a,null),l&&Oe(e,t,"src",a.src,a,null);return;case"input":Se("invalid",e);var A=i=d=n=null,_=null,X=null;for(l in a)if(a.hasOwnProperty(l)){var $=a[l];if($!=null)switch(l){case"name":n=$;break;case"type":d=$;break;case"checked":_=$;break;case"defaultChecked":X=$;break;case"value":i=$;break;case"defaultValue":A=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(C(137,t));break;default:Oe(e,t,l,$,a,null)}}Ir(e,i,A,_,X,d,n,!1);return;case"select":Se("invalid",e),l=d=i=null;for(n in a)if(a.hasOwnProperty(n)&&(A=a[n],A!=null))switch(n){case"value":i=A;break;case"defaultValue":d=A;break;case"multiple":l=A;default:Oe(e,t,n,A,a,null)}t=i,a=d,e.multiple=!!l,t!=null?vl(e,!!l,t,!1):a!=null&&vl(e,!!l,a,!0);return;case"textarea":Se("invalid",e),i=n=l=null;for(d in a)if(a.hasOwnProperty(d)&&(A=a[d],A!=null))switch(d){case"value":l=A;break;case"defaultValue":n=A;break;case"children":i=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(C(91));break;default:Oe(e,t,d,A,a,null)}ec(e,l,n,i);return;case"option":for(_ in a)if(a.hasOwnProperty(_)&&(l=a[_],l!=null))switch(_){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Oe(e,t,_,l,a,null)}return;case"dialog":Se("beforetoggle",e),Se("toggle",e),Se("cancel",e),Se("close",e);break;case"iframe":case"object":Se("load",e);break;case"video":case"audio":for(l=0;l<Un.length;l++)Se(Un[l],e);break;case"image":Se("error",e),Se("load",e);break;case"details":Se("toggle",e);break;case"embed":case"source":case"link":Se("error",e),Se("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(X in a)if(a.hasOwnProperty(X)&&(l=a[X],l!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(C(137,t));default:Oe(e,t,X,l,a,null)}return;default:if(ws(t)){for($ in a)a.hasOwnProperty($)&&(l=a[$],l!==void 0&&or(e,t,$,l,a,void 0));return}}for(A in a)a.hasOwnProperty(A)&&(l=a[A],l!=null&&Oe(e,t,A,l,a,null))}function Km(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,i=null,d=null,A=null,_=null,X=null,$=null;for(J in a){var I=a[J];if(a.hasOwnProperty(J)&&I!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":_=I;default:l.hasOwnProperty(J)||Oe(e,t,J,null,l,I)}}for(var Z in l){var J=l[Z];if(I=a[Z],l.hasOwnProperty(Z)&&(J!=null||I!=null))switch(Z){case"type":i=J;break;case"name":n=J;break;case"checked":X=J;break;case"defaultChecked":$=J;break;case"value":d=J;break;case"defaultValue":A=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(C(137,t));break;default:J!==I&&Oe(e,t,Z,J,l,I)}}As(e,d,A,_,X,$,i,n);return;case"select":J=d=A=Z=null;for(i in a)if(_=a[i],a.hasOwnProperty(i)&&_!=null)switch(i){case"value":break;case"multiple":J=_;default:l.hasOwnProperty(i)||Oe(e,t,i,null,l,_)}for(n in l)if(i=l[n],_=a[n],l.hasOwnProperty(n)&&(i!=null||_!=null))switch(n){case"value":Z=i;break;case"defaultValue":A=i;break;case"multiple":d=i;default:i!==_&&Oe(e,t,n,i,l,_)}t=A,a=d,l=J,Z!=null?vl(e,!!a,Z,!1):!!l!=!!a&&(t!=null?vl(e,!!a,t,!0):vl(e,!!a,a?[]:"",!1));return;case"textarea":J=Z=null;for(A in a)if(n=a[A],a.hasOwnProperty(A)&&n!=null&&!l.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:Oe(e,t,A,null,l,n)}for(d in l)if(n=l[d],i=a[d],l.hasOwnProperty(d)&&(n!=null||i!=null))switch(d){case"value":Z=n;break;case"defaultValue":J=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(C(91));break;default:n!==i&&Oe(e,t,d,n,l,i)}Pr(e,Z,J);return;case"option":for(var ue in a)if(Z=a[ue],a.hasOwnProperty(ue)&&Z!=null&&!l.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:Oe(e,t,ue,null,l,Z)}for(_ in l)if(Z=l[_],J=a[_],l.hasOwnProperty(_)&&Z!==J&&(Z!=null||J!=null))switch(_){case"selected":e.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:Oe(e,t,_,Z,l,J)}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 de in a)Z=a[de],a.hasOwnProperty(de)&&Z!=null&&!l.hasOwnProperty(de)&&Oe(e,t,de,null,l,Z);for(X in l)if(Z=l[X],J=a[X],l.hasOwnProperty(X)&&Z!==J&&(Z!=null||J!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(C(137,t));break;default:Oe(e,t,X,Z,l,J)}return;default:if(ws(t)){for(var Ue in a)Z=a[Ue],a.hasOwnProperty(Ue)&&Z!==void 0&&!l.hasOwnProperty(Ue)&&or(e,t,Ue,void 0,l,Z);for($ in l)Z=l[$],J=a[$],!l.hasOwnProperty($)||Z===J||Z===void 0&&J===void 0||or(e,t,$,Z,l,J);return}}for(var k in a)Z=a[k],a.hasOwnProperty(k)&&Z!=null&&!l.hasOwnProperty(k)&&Oe(e,t,k,null,l,Z);for(I in l)Z=l[I],J=a[I],!l.hasOwnProperty(I)||Z===J||Z==null&&J==null||Oe(e,t,I,Z,l,J)}function id(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Jm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var n=a[l],i=n.transferSize,d=n.initiatorType,A=n.duration;if(i&&A&&id(d)){for(d=0,A=n.responseEnd,l+=1;l<a.length;l++){var _=a[l],X=_.startTime;if(X>A)break;var $=_.transferSize,I=_.initiatorType;$&&id(I)&&(_=_.responseEnd,d+=$*(_<A?1:(A-X)/(_-X)))}if(--l,t+=8*(i+d)/(n.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 fr=null,dr=null;function Ii(e){return e.nodeType===9?e:e.ownerDocument}function sd(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 ud(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 mr(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 hr=null;function Fm(){var e=window.event;return e&&e.type==="popstate"?e===hr?!1:(hr=e,!0):(hr=null,!1)}var rd=typeof setTimeout=="function"?setTimeout:void 0,$m=typeof clearTimeout=="function"?clearTimeout:void 0,cd=typeof Promise=="function"?Promise:void 0,Wm=typeof queueMicrotask=="function"?queueMicrotask:typeof cd<"u"?function(e){return cd.resolve(null).then(e).catch(Im)}:rd;function Im(e){setTimeout(function(){throw e})}function Ca(e){return e==="head"}function od(e,t){var a=t,l=0;do{var n=a.nextSibling;if(e.removeChild(a),n&&n.nodeType===8)if(a=n.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(n),Kl(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")Bn(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Bn(a);for(var i=a.firstChild;i;){var d=i.nextSibling,A=i.nodeName;i[Il]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=d}}else a==="body"&&Bn(e.ownerDocument.body);a=n}while(a);Kl(t)}function fd(e,t){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function vr(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":vr(a),Ss(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Pm(e,t,a,l){for(;e.nodeType===1;){var n=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Il])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Bt(e.nextSibling),e===null)break}return null}function eh(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Bt(e.nextSibling),e===null))return null;return e}function dd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Bt(e.nextSibling),e===null))return null;return e}function pr(e){return e.data==="$?"||e.data==="$~"}function gr(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function th(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Bt(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 xr=null;function md(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Bt(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function hd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function vd(e,t,a){switch(t=Ii(a),e){case"html":if(e=t.documentElement,!e)throw Error(C(452));return e;case"head":if(e=t.head,!e)throw Error(C(453));return e;case"body":if(e=t.body,!e)throw Error(C(454));return e;default:throw Error(C(451))}}function Bn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ss(e)}var Ht=new Map,pd=new Set;function Pi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ca=K.d;K.d={f:ah,r:lh,D:nh,C:ih,L:sh,m:uh,X:ch,S:rh,M:oh};function ah(){var e=ca.f(),t=Xi();return e||t}function lh(e){var t=dl(e);t!==null&&t.tag===5&&t.type==="form"?Oo(t):ca.r(e)}var Xl=typeof document>"u"?null:document;function gd(e,t,a){var l=Xl;if(l&&typeof t=="string"&&t){var n=Et(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),pd.has(n)||(pd.add(n),e={rel:e,crossOrigin:a,href:t},l.querySelector(n)===null&&(t=l.createElement("link"),nt(t,"link",e),Ie(t),l.head.appendChild(t)))}}function nh(e){ca.D(e),gd("dns-prefetch",e,null)}function ih(e,t){ca.C(e,t),gd("preconnect",e,t)}function sh(e,t,a){ca.L(e,t,a);var l=Xl;if(l&&e&&t){var n='link[rel="preload"][as="'+Et(t)+'"]';t==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+Et(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+Et(a.imageSizes)+'"]')):n+='[href="'+Et(e)+'"]';var i=n;switch(t){case"style":i=Ql(e);break;case"script":i=Zl(e)}Ht.has(i)||(e=x({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Ht.set(i,e),l.querySelector(n)!==null||t==="style"&&l.querySelector(Hn(i))||t==="script"&&l.querySelector(_n(i))||(t=l.createElement("link"),nt(t,"link",e),Ie(t),l.head.appendChild(t)))}}function uh(e,t){ca.m(e,t);var a=Xl;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+Et(l)+'"][href="'+Et(e)+'"]',i=n;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Zl(e)}if(!Ht.has(i)&&(e=x({rel:"modulepreload",href:e},t),Ht.set(i,e),a.querySelector(n)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(_n(i)))return}l=a.createElement("link"),nt(l,"link",e),Ie(l),a.head.appendChild(l)}}}function rh(e,t,a){ca.S(e,t,a);var l=Xl;if(l&&e){var n=ml(l).hoistableStyles,i=Ql(e);t=t||"default";var d=n.get(i);if(!d){var A={loading:0,preload:null};if(d=l.querySelector(Hn(i)))A.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Ht.get(i))&&yr(e,a);var _=d=l.createElement("link");Ie(_),nt(_,"link",e),_._p=new Promise(function(X,$){_.onload=X,_.onerror=$}),_.addEventListener("load",function(){A.loading|=1}),_.addEventListener("error",function(){A.loading|=2}),A.loading|=4,es(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:A},n.set(i,d)}}}function ch(e,t){ca.X(e,t);var a=Xl;if(a&&e){var l=ml(a).hoistableScripts,n=Zl(e),i=l.get(n);i||(i=a.querySelector(_n(n)),i||(e=x({src:e,async:!0},t),(t=Ht.get(n))&&Sr(e,t),i=a.createElement("script"),Ie(i),nt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(n,i))}}function oh(e,t){ca.M(e,t);var a=Xl;if(a&&e){var l=ml(a).hoistableScripts,n=Zl(e),i=l.get(n);i||(i=a.querySelector(_n(n)),i||(e=x({src:e,async:!0,type:"module"},t),(t=Ht.get(n))&&Sr(e,t),i=a.createElement("script"),Ie(i),nt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(n,i))}}function xd(e,t,a,l){var n=(n=te.current)?Pi(n):null;if(!n)throw Error(C(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Ql(a.href),a=ml(n).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ql(a.href);var i=ml(n).hoistableStyles,d=i.get(e);if(d||(n=n.ownerDocument||n,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,d),(i=n.querySelector(Hn(e)))&&!i._p&&(d.instance=i,d.state.loading=5),Ht.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ht.set(e,a),i||fh(n,e,a,d.state))),t&&l===null)throw Error(C(528,""));return d}if(t&&l!==null)throw Error(C(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Zl(a),a=ml(n).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(C(444,e))}}function Ql(e){return'href="'+Et(e)+'"'}function Hn(e){return'link[rel="stylesheet"]['+e+"]"}function yd(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function fh(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),nt(t,"link",a),Ie(t),e.head.appendChild(t))}function Zl(e){return'[src="'+Et(e)+'"]'}function _n(e){return"script[async]"+e}function Sd(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Et(a.href)+'"]');if(l)return t.instance=l,Ie(l),l;var n=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Ie(l),nt(l,"style",n),es(l,a.precedence,e),t.instance=l;case"stylesheet":n=Ql(a.href);var i=e.querySelector(Hn(n));if(i)return t.state.loading|=4,t.instance=i,Ie(i),i;l=yd(a),(n=Ht.get(n))&&yr(l,n),i=(e.ownerDocument||e).createElement("link"),Ie(i);var d=i;return d._p=new Promise(function(A,_){d.onload=A,d.onerror=_}),nt(i,"link",l),t.state.loading|=4,es(i,a.precedence,e),t.instance=i;case"script":return i=Zl(a.src),(n=e.querySelector(_n(i)))?(t.instance=n,Ie(n),n):(l=a,(n=Ht.get(i))&&(l=x({},a),Sr(l,n)),e=e.ownerDocument||e,n=e.createElement("script"),Ie(n),nt(n,"link",l),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(C(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,es(l,a.precedence,e));return t.instance}function es(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=l.length?l[l.length-1]:null,i=n,d=0;d<l.length;d++){var A=l[d];if(A.dataset.precedence===t)i=A;else if(i!==n)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function yr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Sr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ts=null;function bd(e,t,a){if(ts===null){var l=new Map,n=ts=new Map;n.set(a,l)}else n=ts,l=n.get(a),l||(l=new Map,n.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),n=0;n<a.length;n++){var i=a[n];if(!(i[Il]||i[et]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var d=i.getAttribute(t)||"";d=e+d;var A=l.get(d);A?A.push(i):l.set(d,[i])}}return l}function Ad(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function dh(e,t,a){if(a===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 Nd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function mh(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var n=Ql(l.href),i=t.querySelector(Hn(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=as.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,Ie(i);return}i=t.ownerDocument||t,l=yd(l),(n=Ht.get(n))&&yr(l,n),i=i.createElement("link"),Ie(i);var d=i;d._p=new Promise(function(A,_){d.onload=A,d.onerror=_}),nt(i,"link",l),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=as.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var br=0;function hh(e,t){return e.stylesheets&&e.count===0&&ns(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&ns(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&br===0&&(br=62500*Jm());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ns(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>br?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(n)}}:null}function as(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ns(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ls=null;function ns(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ls=new Map,t.forEach(vh,e),ls=null,as.call(e))}function vh(e,t){if(!(t.state.loading&4)){var a=ls.get(e);if(a)var l=a.get(null);else{a=new Map,ls.set(e,a);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<n.length;i++){var d=n[i];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(a.set(d.dataset.precedence,d),l=d)}l&&a.set(null,l)}n=t.instance,d=n.getAttribute("data-precedence"),i=a.get(d)||l,i===l&&a.set(null,n),a.set(d,n),this.count++,l=as.bind(this),n.addEventListener("load",l),n.addEventListener("error",l),i?i.parentNode.insertBefore(n,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var Ln={$$typeof:D,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function ph(e,t,a,l,n,i,d,A,_){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=ps(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ps(0),this.hiddenUpdates=ps(null),this.identifierPrefix=l,this.onUncaughtError=n,this.onCaughtError=i,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function wd(e,t,a,l,n,i,d,A,_,X,$,I){return e=new ph(e,t,a,d,_,X,$,I,A),t=1,i===!0&&(t|=24),i=St(3,null,null,t),e.current=i,i.stateNode=e,t=eu(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:l,isDehydrated:a,cache:t},nu(i),e}function Md(e){return e?(e=Nl,e):Nl}function jd(e,t,a,l,n,i){n=Md(n),l.context===null?l.context=n:l.pendingContext=n,l=xa(t),l.payload={element:a},i=i===void 0?null:i,i!==null&&(l.callback=i),a=ya(e,l,t),a!==null&&(vt(a,e,t),pn(a,e,t))}function Td(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ar(e,t){Td(e,t),(e=e.alternate)&&Td(e,t)}function Ed(e){if(e.tag===13||e.tag===31){var t=qa(e,67108864);t!==null&&vt(t,e,67108864),Ar(e,67108864)}}function Cd(e){if(e.tag===13||e.tag===31){var t=Mt();t=gs(t);var a=qa(e,t);a!==null&&vt(a,e,t),Ar(e,t)}}var is=!0;function gh(e,t,a,l){var n=V.T;V.T=null;var i=K.p;try{K.p=2,Nr(e,t,a,l)}finally{K.p=i,V.T=n}}function xh(e,t,a,l){var n=V.T;V.T=null;var i=K.p;try{K.p=8,Nr(e,t,a,l)}finally{K.p=i,V.T=n}}function Nr(e,t,a,l){if(is){var n=wr(l);if(n===null)cr(e,t,l,ss,a),zd(e,l);else if(Sh(n,e,t,a,l))l.stopPropagation();else if(zd(e,l),t&4&&-1<yh.indexOf(e)){for(;n!==null;){var i=dl(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var d=La(i.pendingLanes);if(d!==0){var A=i;for(A.pendingLanes|=2,A.entangledLanes|=2;d;){var _=1<<31-xt(d);A.entanglements[1]|=_,d&=~_}qt(i),(Te&6)===0&&(ki=it()+500,On(0))}}break;case 31:case 13:A=qa(i,2),A!==null&&vt(A,i,2),Xi(),Ar(i,2)}if(i=wr(l),i===null&&cr(e,t,l,ss,a),i===n)break;n=i}n!==null&&l.stopPropagation()}else cr(e,t,l,null,a)}}function wr(e){return e=js(e),Mr(e)}var ss=null;function Mr(e){if(ss=null,e=fl(e),e!==null){var t=s(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=p(t),e!==null)return e;e=null}else if(a===31){if(e=v(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ss=e,null}function Dd(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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Jn()){case Ha:return 2;case Fn:return 8;case rl:case cl:return 32;case _a:return 268435456;default:return 32}default:return 32}}var jr=!1,Da=null,za=null,Oa=null,Yn=new Map,Gn=new Map,Ua=[],yh="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 zd(e,t){switch(e){case"focusin":case"focusout":Da=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":Oa=null;break;case"pointerover":case"pointerout":Yn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gn.delete(t.pointerId)}}function Vn(e,t,a,l,n,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:i,targetContainers:[n]},t!==null&&(t=dl(t),t!==null&&Ed(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function Sh(e,t,a,l,n){switch(t){case"focusin":return Da=Vn(Da,e,t,a,l,n),!0;case"dragenter":return za=Vn(za,e,t,a,l,n),!0;case"mouseover":return Oa=Vn(Oa,e,t,a,l,n),!0;case"pointerover":var i=n.pointerId;return Yn.set(i,Vn(Yn.get(i)||null,e,t,a,l,n)),!0;case"gotpointercapture":return i=n.pointerId,Gn.set(i,Vn(Gn.get(i)||null,e,t,a,l,n)),!0}return!1}function Od(e){var t=fl(e.target);if(t!==null){var a=s(t);if(a!==null){if(t=a.tag,t===13){if(t=p(a),t!==null){e.blockedOn=t,Xr(e.priority,function(){Cd(a)});return}}else if(t===31){if(t=v(a),t!==null){e.blockedOn=t,Xr(e.priority,function(){Cd(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function us(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=wr(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);Ms=l,a.target.dispatchEvent(l),Ms=null}else return t=dl(a),t!==null&&Ed(t),e.blockedOn=a,!1;t.shift()}return!0}function Ud(e,t,a){us(e)&&a.delete(t)}function bh(){jr=!1,Da!==null&&us(Da)&&(Da=null),za!==null&&us(za)&&(za=null),Oa!==null&&us(Oa)&&(Oa=null),Yn.forEach(Ud),Gn.forEach(Ud)}function rs(e,t){e.blockedOn===t&&(e.blockedOn=null,jr||(jr=!0,N.unstable_scheduleCallback(N.unstable_NormalPriority,bh)))}var cs=null;function Rd(e){cs!==e&&(cs=e,N.unstable_scheduleCallback(N.unstable_NormalPriority,function(){cs===e&&(cs=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],n=e[t+2];if(typeof l!="function"){if(Mr(l||a)===null)continue;break}var i=dl(a);i!==null&&(e.splice(t,3),t-=3,wu(i,{pending:!0,data:n,method:a.method,action:l},l,n))}}))}function Kl(e){function t(_){return rs(_,e)}Da!==null&&rs(Da,e),za!==null&&rs(za,e),Oa!==null&&rs(Oa,e),Yn.forEach(t),Gn.forEach(t);for(var a=0;a<Ua.length;a++){var l=Ua[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ua.length&&(a=Ua[0],a.blockedOn===null);)Od(a),a.blockedOn===null&&Ua.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var n=a[l],i=a[l+1],d=n[ct]||null;if(typeof i=="function")d||Rd(a);else if(d){var A=null;if(i&&i.hasAttribute("formAction")){if(n=i,d=i[ct]||null)A=d.formAction;else if(Mr(n)!==null)continue}else A=d.action;typeof A=="function"?a[l+1]=A:(a.splice(l,3),l-=3),Rd(a)}}}function Bd(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(d){return n=d})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function Tr(e){this._internalRoot=e}os.prototype.render=Tr.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(C(409));var a=t.current,l=Mt();jd(a,l,e,t,null,null)},os.prototype.unmount=Tr.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jd(e.current,2,null,e,null,null),Xi(),t[ol]=null}};function os(e){this._internalRoot=e}os.prototype.unstable_scheduleHydration=function(e){if(e){var t=qr();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ua.length&&t!==0&&t<Ua[a].priority;a++);Ua.splice(a,0,e),a===0&&Od(e)}};var Hd=L.version;if(Hd!=="19.2.3")throw Error(C(527,Hd,"19.2.3"));K.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(C(188)):(e=Object.keys(e).join(","),Error(C(268,e)));return e=m(t),e=e!==null?r(e):null,e=e===null?null:e.stateNode,e};var Ah={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fs.isDisabled&&fs.supportsFiber)try{Fl=fs.inject(Ah),gt=fs}catch{}}return qn.createRoot=function(e,t){if(!b(e))throw Error(C(299));var a=!1,l="",n=ko,i=qo,d=Xo;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=wd(e,1,!1,null,null,a,l,null,n,i,d,Bd),e[ol]=t.current,rr(e),new Tr(t)},qn.hydrateRoot=function(e,t,a){if(!b(e))throw Error(C(299));var l=!1,n="",i=ko,d=qo,A=Xo,_=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(d=a.onCaughtError),a.onRecoverableError!==void 0&&(A=a.onRecoverableError),a.formState!==void 0&&(_=a.formState)),t=wd(e,1,!0,t,a??null,l,n,_,i,d,A,Bd),t.context=Md(null),a=t.current,l=Mt(),l=gs(l),n=xa(l),n.callback=null,ya(a,n,l),a=l,t.current.lanes=a,Wl(t,a),qt(t),e[ol]=t.current,rr(e),new os(t)},qn.version="19.2.3",qn}var Kd;function Uh(){if(Kd)return Dr.exports;Kd=1;function N(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(N)}catch(L){console.error(L)}}return N(),Dr.exports=Oh(),Dr.exports}var Rh=Uh();const Bh=Rr(Rh);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hh=N=>N.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_h=N=>N.replace(/^([A-Z])|[\s-_]+(\w)/g,(L,R,C)=>C?C.toUpperCase():R.toLowerCase()),Jd=N=>{const L=_h(N);return L.charAt(0).toUpperCase()+L.slice(1)},Id=(...N)=>N.filter((L,R,C)=>!!L&&L.trim()!==""&&C.indexOf(L)===R).join(" ").trim(),Lh=N=>{for(const L in N)if(L.startsWith("aria-")||L==="role"||L==="title")return!0};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Yh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Gh=ie.forwardRef(({color:N="currentColor",size:L=24,strokeWidth:R=2,absoluteStrokeWidth:C,className:b="",children:s,iconNode:p,...v},c)=>ie.createElement("svg",{ref:c,...Yh,width:L,height:L,stroke:N,strokeWidth:C?Number(R)*24/Number(L):R,className:Id("lucide",b),...!s&&!Lh(v)&&{"aria-hidden":"true"},...v},[...p.map(([m,r])=>ie.createElement(m,r)),...Array.isArray(s)?s:[s]]));/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const De=(N,L)=>{const R=ie.forwardRef(({className:C,...b},s)=>ie.createElement(Gh,{ref:s,iconNode:L,className:Id(`lucide-${Hh(Jd(N))}`,`lucide-${N}`,C),...b}));return R.displayName=Jd(N),R};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vh=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],kh=De("arrow-left",Vh);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qh=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Xh=De("book-open",qh);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qh=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],Zh=De("briefcase",Qh);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Kh=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Jh=De("calendar",Kh);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Fh=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ds=De("check",Fh);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $h=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Fd=De("chevron-left",$h);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wh=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ih=De("chevron-right",Wh);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ph=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Pd=De("circle-check",Ph);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ev=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],tv=De("circle",ev);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const av=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],lv=De("coffee",av);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nv=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}],["path",{d:"M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"auskq0"}]],iv=De("heart-pulse",nv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sv=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],uv=De("heart",sv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rv=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],cv=De("history",rv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ov=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],fv=De("house",ov);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dv=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],al=De("loader-circle",dv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mv=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],hv=De("map-pin",mv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vv=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],hs=De("message-circle",vv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pv=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],Hr=De("mic",pv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gv=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],xv=De("notebook-pen",gv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yv=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],e0=De("pen-line",yv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Sv=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],t0=De("plus",Sv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bv=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],_r=De("send",bv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Av=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],a0=De("smile",Av);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Nv=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ll=De("sparkles",Nv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const wv=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],l0=De("square",wv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Mv=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],$d=De("tag",Mv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jv=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Tv=De("user",jv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ev=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Cv=De("users",Ev);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Dv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Xn=De("x",Dv),zv=({imageUrl:N,onGreeting:L,onOpenChat:R,latestRecord:C})=>{const[b,s]=ie.useState(!1),[p,v]=ie.useState(""),[c,m]=ie.useState(!1),r=()=>{if(C){const o=[`刚才你说"${C.substring(0,20)}...",想聊聊吗?`,`关于"${C.substring(0,20)}...",我有些想法想和你分享~`,`听到你说"${C.substring(0,20)}...",我很想了解更多呢`,`"${C.substring(0,20)}..."这让我想起了一些事情,要聊聊吗?`];return o[Math.floor(Math.random()*o.length)]}else{const o=["嗨!今天过得怎么样呀?","你好呀!有什么想和我分享的吗?","Hi~ 我一直在这里陪着你哦","嘿!要不要聊聊天?","你来啦!今天感觉如何?"];return o[Math.floor(Math.random()*o.length)]}},x=()=>{const o=r();v(o),s(!0),L&&L(o)},g=o=>{o.stopPropagation(),s(!1)},u=o=>{o.stopPropagation(),R&&R()};return h.jsxs("div",{className:"relative w-72 h-72 flex items-center justify-center select-none",children:[h.jsx("div",{className:"absolute inset-0 bg-purple-200/30 blur-[60px] rounded-full animate-pulse pointer-events-none"}),N?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"absolute w-64 h-64 opacity-60 animate-morph animate-float duration-[10s]",children:h.jsx("div",{className:"w-full h-full rounded-full bg-gradient-to-br from-pink-300 via-purple-300 to-indigo-200 blur-2xl animate-gradient-slow"})}),h.jsxs("div",{className:`
relative z-10 w-56 h-56 rounded-full overflow-hidden
border-4 border-white/50 shadow-2xl
animate-float cursor-pointer
transition-all duration-500 ease-out
${c?"scale-110 border-purple-300/70 shadow-purple-300/50":"scale-100"}
${b?"scale-105":""}
`,onClick:x,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),children:[h.jsx("img",{src:N,alt:"AI Character",className:"w-full h-full object-cover"}),c&&h.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-purple-400/20 to-transparent animate-pulse"})]}),h.jsx("div",{className:"absolute w-32 h-32 bg-white/20 blur-[40px] rounded-full animate-breathe pointer-events-none"}),c&&!b&&h.jsx("div",{className:"absolute -bottom-8 left-1/2 -translate-x-1/2 z-20 animate-[fadeIn_0.3s_ease-out]",children:h.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 bg-white/90 backdrop-blur-sm rounded-full shadow-lg border border-purple-200/50",children:[h.jsx(hs,{size:14,className:"text-purple-500"}),h.jsx("span",{className:"text-xs text-slate-600 font-medium",children:"点击和我聊天"})]})})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"absolute w-64 h-64 opacity-80 animate-morph animate-float duration-[10s]",children:h.jsx("div",{className:"w-full h-full rounded-[inherit] bg-gradient-to-br from-pink-300 via-purple-300 to-indigo-200 blur-xl animate-gradient-slow opacity-80"})}),h.jsx("div",{className:"absolute w-60 h-60 opacity-60 animate-morph animate-float duration-[12s] delay-1000 rotate-45",children:h.jsx("div",{className:"w-full h-full rounded-[inherit] bg-gradient-to-tl from-indigo-200 via-pink-200 to-white blur-lg animate-gradient-slow"})}),h.jsx("div",{className:"absolute w-32 h-32 bg-white/40 blur-[40px] rounded-full animate-breathe pointer-events-none"}),h.jsx("div",{className:`
absolute inset-0 rounded-full cursor-pointer z-10
transition-transform duration-700 ease-out
${c?"scale-110":"scale-100"}
active:scale-95
`,onClick:x,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1)})]}),b&&h.jsx("div",{className:"absolute -top-32 left-1/2 -translate-x-1/2 z-30 w-64 animate-[bounceIn_0.5s_ease-out]",children:h.jsxs("div",{className:"relative bg-white/95 backdrop-blur-xl rounded-3xl p-4 shadow-2xl border-2 border-purple-200/50",children:[h.jsx("button",{onClick:g,className:"absolute -top-2 -right-2 p-1.5 bg-purple-100 hover:bg-purple-200 rounded-full shadow-lg transition-colors",children:h.jsx(Xn,{size:14,className:"text-purple-600"})}),h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx("button",{onClick:u,className:"flex-shrink-0 w-10 h-10 rounded-full bg-gradient-to-br from-purple-400 to-pink-400 flex items-center justify-center shadow-md hover:scale-110 hover:shadow-lg transition-all duration-300 cursor-pointer group",title:"点击打开对话",children:h.jsx(hs,{size:20,className:"text-white group-hover:scale-110 transition-transform"})}),h.jsx("div",{className:"flex-1",children:h.jsx("p",{className:"text-sm text-slate-700 leading-relaxed",children:p})})]}),h.jsx("div",{className:"absolute -bottom-3 left-1/2 -translate-x-1/2 w-6 h-6 bg-white/95 backdrop-blur-xl rotate-45 border-r-2 border-b-2 border-purple-200/50"})]})})]})};var Xt=(N=>(N.HOME="HOME",N.RECORD="RECORD",N.COMMUNITY="COMMUNITY",N.MINE="MINE",N))(Xt||{}),jt=(N=>(N.MOOD="MOOD",N.INSPIRATION="INSPIRATION",N.TODO="TODO",N))(jt||{}),ge=(N=>(N.MOOD="MOOD",N.INSPIRATION="INSPIRATION",N.VOICE="VOICE",N.MANUAL="MANUAL",N))(ge||{}),_e=(N=>(N.HAPPY="HAPPY",N.CALM="CALM",N.TIRED="TIRED",N.ANXIOUS="ANXIOUS",N.HOPEFUL="HOPEFUL",N))(_e||{});const Ov=({onActionClick:N})=>{const L=[{id:jt.MOOD,label:"心情",icon:a0,color:"text-pink-400"},{id:jt.INSPIRATION,label:"灵感",icon:ll,color:"text-purple-400"},{id:jt.TODO,label:"待办",icon:Pd,color:"text-blue-400"}];return h.jsx("div",{className:"flex justify-center items-center gap-10 w-full px-6 pt-16 pb-2 z-20",children:L.map(R=>h.jsxs("button",{onClick:()=>N(R.id),className:"group flex flex-col items-center justify-center gap-2.5 p-3 rounded-2xl transition-all duration-500 hover:bg-white/40 active:scale-95",children:[h.jsx("div",{className:`p-4 rounded-full bg-white/50 shadow-sm backdrop-blur-sm group-hover:shadow-md transition-all duration-500 ring-1 ring-white/50 ${R.color}`,children:h.jsx(R.icon,{size:40,strokeWidth:1.5,className:"opacity-80 group-hover:opacity-100 transition-opacity"})}),h.jsx("span",{className:"text-sm font-medium text-slate-500 tracking-wide group-hover:text-slate-700 transition-colors",children:R.label})]},R.id))})},Uv=({currentTab:N,onTabChange:L})=>{const R=[{id:Xt.HOME,label:"首页",icon:fv},{id:Xt.RECORD,label:"记录",icon:xv},{id:Xt.COMMUNITY,label:"社区",icon:Cv},{id:Xt.MINE,label:"我的",icon:Tv}];return h.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-[150] px-6 pb-6 pt-2",children:h.jsx("nav",{className:"relative bg-white/70 backdrop-blur-xl shadow-lg shadow-purple-100/50 rounded-3xl flex justify-between items-center px-6 py-4 max-w-md mx-auto ring-1 ring-white/50",children:R.map(C=>{const b=N===C.id;return h.jsxs("button",{onClick:()=>L(C.id),className:"relative flex flex-col items-center justify-center gap-1 w-12 h-12 transition-all duration-300",children:[h.jsx("div",{className:`
absolute inset-0 rounded-full transition-all duration-500
${b?"bg-gradient-to-br from-pink-100 to-purple-100 opacity-100 scale-100":"opacity-0 scale-75"}
`}),h.jsx(C.icon,{size:22,strokeWidth:b?2:1.5,className:`relative z-10 transition-colors duration-300 ${b?"text-purple-600":"text-slate-400"}`}),h.jsx("span",{className:`relative z-10 text-[10px] font-medium transition-colors duration-300 ${b?"text-purple-700":"text-slate-400"}`,children:C.label})]},C.id)})})})},Rv=({onClick:N})=>h.jsx("div",{className:"fixed bottom-28 right-6 z-40",children:h.jsxs("button",{onClick:N,className:`
group relative flex items-center justify-center w-12 h-12
bg-white/60 backdrop-blur-md rounded-full shadow-sm
ring-1 ring-white/60 text-purple-400
hover:bg-white/80 hover:text-purple-500 hover:shadow-md hover:scale-105
active:scale-95 transition-all duration-500
`,"aria-label":"Customize AI",children:[h.jsx(ll,{size:20,strokeWidth:1.5}),h.jsx("span",{className:"absolute right-full mr-3 text-xs text-slate-400 whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none",children:"AI形象定制"})]})}),Bv=()=>{const N=window.location.hostname,L=window.location.protocol;return N.includes("hf.space")||N.includes("huggingface.co")||N.includes("modelscope.cn")||N.includes("gradio.live")?`${L}//${N}`:N!=="localhost"&&N!=="127.0.0.1"?`${L}//${N}:8000`:"http://localhost:8000"},n0=Bv();console.log("🔗 API Base URL:",n0);class Hv{constructor(L=n0){this.baseUrl=L}async processInput(L,R){try{console.log("📤 Processing input:",L?"audio":"text");const C=new FormData;if(L)C.append("audio",L);else if(R)C.append("text",R);else throw new Error("Either audio or text must be provided");const b=await fetch(`${this.baseUrl}/api/process`,{method:"POST",body:C,mode:"cors",credentials:"omit",signal:AbortSignal.timeout(6e4)});if(console.log("📡 Process response status:",b.status),!b.ok){const p=await b.json();throw console.error("❌ Process error:",p),new Error(p.error||"Failed to process input")}const s=await b.json();return console.log("✅ Process result:",s),s}catch(C){throw console.error("❌ Process input error:",C),C}}async getRecords(){const L=await fetch(`${this.baseUrl}/api/records`);if(!L.ok)throw new Error("Failed to fetch records");return L.json()}async getMoods(){const L=await fetch(`${this.baseUrl}/api/moods`);if(!L.ok)throw new Error("Failed to fetch moods");return L.json()}async getInspirations(){const L=await fetch(`${this.baseUrl}/api/inspirations`);if(!L.ok)throw new Error("Failed to fetch inspirations");return L.json()}async getTodos(){const L=await fetch(`${this.baseUrl}/api/todos`);if(!L.ok)throw new Error("Failed to fetch todos");return L.json()}async updateTodoStatus(L,R){const C=new FormData;C.append("status",R);const b=await fetch(`${this.baseUrl}/api/todos/${L}`,{method:"PATCH",body:C});if(!b.ok)throw new Error("Failed to update todo");return b.json()}async getUserConfig(){const L=await fetch(`${this.baseUrl}/api/user/config`);if(!L.ok)throw new Error("Failed to fetch user config");return L.json()}async chatWithAI(L){try{console.log("🤖 Sending chat request to:",`${this.baseUrl}/api/chat`),console.log("📝 Message:",L);const R=new FormData;R.append("text",L);const C=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",body:R,mode:"cors",credentials:"omit",signal:AbortSignal.timeout(6e4)});if(console.log("📡 Response status:",C.status),!C.ok){const s=await C.text();throw console.error("❌ Chat API error:",C.status,s),new Error(`Chat API failed: ${C.status}`)}const b=await C.json();return console.log("✅ Chat response received:",b),b.response||"抱歉,我现在有点累了,稍后再聊好吗?"}catch(R){if(console.error("❌ Chat error:",R),R instanceof Error){if(R.name==="AbortError"||R.message.includes("timeout"))return"抱歉,网络有点慢,请稍后再试~";if(R.message.includes("Failed to fetch")||R.message.includes("NetworkError"))return"抱歉,无法连接到服务器,请检查网络连接~"}return"抱歉,出现了一些问题,请稍后再试~"}}async healthCheck(){const L=await fetch(`${this.baseUrl}/health`);if(!L.ok)throw new Error("Health check failed");return L.json()}async generateCharacter(L){const R=new FormData;R.append("color",L.color),R.append("personality",L.personality),R.append("appearance",L.appearance),R.append("role",L.role);const C=new AbortController,b=setTimeout(()=>C.abort(),12e4);try{const s=await fetch(`${this.baseUrl}/api/character/generate`,{method:"POST",body:R,signal:C.signal,keepalive:!0});if(clearTimeout(b),!s.ok){const p=await s.json();throw new Error(p.detail||p.error||"Failed to generate character")}return s.json()}catch(s){throw clearTimeout(b),s.name==="AbortError"?new Error("请求超时,图像生成时间较长,请稍后重试"):s}}async updateCharacterPreferences(L){const R=new FormData;L.color&&R.append("color",L.color),L.personality&&R.append("personality",L.personality),L.appearance&&R.append("appearance",L.appearance),L.role&&R.append("role",L.role);const C=await fetch(`${this.baseUrl}/api/character/preferences`,{method:"POST",body:R});if(!C.ok)throw new Error("Failed to update preferences");return C.json()}async getCharacterHistory(){const L=await fetch(`${this.baseUrl}/api/character/history`);if(!L.ok)throw new Error("Failed to fetch character history");return L.json()}async selectCharacter(L){const R=new FormData;R.append("filename",L);const C=await fetch(`${this.baseUrl}/api/character/select`,{method:"POST",body:R});if(!C.ok){const b=await C.json();throw new Error(b.detail||"Failed to select character")}return C.json()}}const ut=new Hv,_v=[{value:"温暖粉",label:"温暖粉",color:"bg-pink-200"},{value:"天空蓝",label:"天空蓝",color:"bg-blue-200"},{value:"薄荷绿",label:"薄荷绿",color:"bg-green-200"},{value:"奶油黄",label:"奶油黄",color:"bg-yellow-200"},{value:"薰衣草紫",label:"薰衣草紫",color:"bg-purple-200"},{value:"珊瑚橙",label:"珊瑚橙",color:"bg-orange-200"},{value:"纯白",label:"纯白",color:"bg-white border border-gray-300"},{value:"浅灰",label:"浅灰",color:"bg-gray-200"}],Lv=[{value:"活泼",label:"活泼",emoji:"😄"},{value:"温柔",label:"温柔",emoji:"😊"},{value:"聪明",label:"聪明",emoji:"🤓"},{value:"慵懒",label:"慵懒",emoji:"😴"},{value:"勇敢",label:"勇敢",emoji:"💪"},{value:"害羞",label:"害羞",emoji:"😳"}],Yv=[{value:"戴眼镜",label:"戴眼镜",emoji:"👓"},{value:"戴帽子",label:"戴帽子",emoji:"🎩"},{value:"戴围巾",label:"戴围巾",emoji:"🧣"},{value:"戴蝴蝶结",label:"戴蝴蝶结",emoji:"🎀"},{value:"无配饰",label:"无配饰",emoji:"✨"}],Gv=[{value:"陪伴式朋友",label:"陪伴式朋友",emoji:"🤝"},{value:"温柔照顾型长辈",label:"温柔照顾型长辈",emoji:"🤗"},{value:"引导型老师",label:"引导型老师",emoji:"👨‍🏫"}],Vv=({isOpen:N,onClose:L,onGenerate:R,onSelectHistory:C,currentPreferences:b,currentImageUrl:s})=>{const[p,v]=ie.useState("history"),[c,m]=ie.useState({color:"温暖粉",personality:"温柔",appearance:"无配饰",role:"陪伴式朋友"}),[r,x]=ie.useState(!1),[g,u]=ie.useState(1),[o,f]=ie.useState(null),[y,T]=ie.useState([]),[z,D]=ie.useState(!1),[O,S]=ie.useState(null);ie.useEffect(()=>{b&&m(b)},[b]),ie.useEffect(()=>{N&&p==="history"&&M()},[N,p]);const M=async()=>{D(!0);try{const E=await ut.getCharacterHistory();T(E.images)}catch(E){console.error("Failed to load history:",E)}finally{D(!1)}},j=async E=>{S(E.filename);try{const Q=await ut.selectCharacter(E.filename);C(Q.image_url),setTimeout(()=>{L(),v("history"),u(1),f(null),S(null)},500)}catch(Q){console.error("Failed to select character:",Q),f(Q.message||"选择失败,请重试"),S(null)}};if(!N)return null;const w=async()=>{x(!0),f(null);try{await R(c),setTimeout(()=>{L(),v("history"),u(1),f(null)},1e3)}catch(E){console.error("Failed to generate character:",E);let Q="生成失败,请重试";E.message&&(E.message.includes("MiniMax API 未配置")?Q="MiniMax API 未配置,请在 .env 文件中配置 MINIMAX_API_KEY":E.message.includes("invalid api key")?Q="API 密钥无效,请检查 MINIMAX_API_KEY 配置":E.message.includes("配额不足")?Q="API 配额不足,请充值或等待配额恢复":E.message.includes("timeout")||E.message.includes("超时")?Q="请求超时,图像生成时间较长(约60-90秒),请耐心等待或稍后重试":E.message.includes("Failed to fetch")||E.message.includes("fetch")?Q=`网络连接失败,请检查:
1. 后端服务是否运行
2. 网络连接是否正常
3. 防火墙是否允许访问`:Q=E.message),f(Q)}finally{x(!1)}},B=()=>h.jsx("div",{className:"space-y-4",children:z?h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsx(al,{size:32,className:"animate-spin text-purple-400"})}):y.length===0?h.jsxs("div",{className:"text-center py-12",children:[h.jsx("p",{className:"text-slate-400 mb-4",children:"还没有历史形象"}),h.jsx("button",{onClick:()=>v("create"),className:`\r
px-6 py-3 rounded-2xl\r
bg-gradient-to-br from-purple-400 to-pink-400\r
hover:from-purple-500 hover:to-pink-500\r
text-white font-medium\r
transition-all duration-200\r
hover:scale-105 active:scale-95\r
`,children:"创建第一个形象"})]}):h.jsx("div",{className:"grid grid-cols-2 gap-4 max-h-[400px] overflow-y-auto pr-2",children:y.map(E=>h.jsxs("button",{onClick:()=>j(E),disabled:O===E.filename,className:`
relative p-3 rounded-2xl bg-white/80
hover:bg-white hover:scale-105
transition-all duration-200
${O===E.filename?"opacity-50":""}
`,children:[h.jsx("img",{src:E.url,alt:`${E.color} ${E.personality}`,className:"w-full aspect-square rounded-xl object-cover mb-2"}),h.jsxs("div",{className:"text-xs text-slate-600 space-y-0.5",children:[h.jsxs("p",{children:["🎨 ",E.color]}),h.jsxs("p",{children:["😊 ",E.personality]})]}),O===E.filename&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-white/80 rounded-2xl",children:h.jsx(al,{size:24,className:"animate-spin text-purple-400"})})]},E.filename))})}),U=()=>h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx("h4",{className:"text-sm font-medium text-slate-700 mb-3",children:"选择颜色"}),h.jsx("div",{className:"grid grid-cols-4 gap-3",children:_v.map(E=>h.jsxs("button",{onClick:()=>m({...c,color:E.value}),className:`
relative p-3 rounded-xl transition-all duration-200
${c.color===E.value?"ring-2 ring-purple-400 scale-105":"hover:scale-105"}
`,children:[h.jsx("div",{className:`w-full h-12 rounded-lg ${E.color}`}),h.jsx("p",{className:"text-xs text-slate-600 mt-2",children:E.label}),c.color===E.value&&h.jsx("div",{className:"absolute top-1 right-1 w-5 h-5 bg-purple-400 rounded-full flex items-center justify-center",children:h.jsx(ds,{size:12,className:"text-white"})})]},E.value))})]}),h.jsxs("div",{children:[h.jsx("h4",{className:"text-sm font-medium text-slate-700 mb-3",children:"选择性格"}),h.jsx("div",{className:"grid grid-cols-3 gap-3",children:Lv.map(E=>h.jsxs("button",{onClick:()=>m({...c,personality:E.value}),className:`
relative p-3 rounded-xl bg-white/80 transition-all duration-200
${c.personality===E.value?"ring-2 ring-purple-400 scale-105":"hover:scale-105"}
`,children:[h.jsx("div",{className:"text-2xl mb-1",children:E.emoji}),h.jsx("p",{className:"text-xs text-slate-600",children:E.label}),c.personality===E.value&&h.jsx("div",{className:"absolute top-1 right-1 w-5 h-5 bg-purple-400 rounded-full flex items-center justify-center",children:h.jsx(ds,{size:12,className:"text-white"})})]},E.value))})]})]}),H=()=>h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx("h4",{className:"text-sm font-medium text-slate-700 mb-3",children:"选择外观"}),h.jsx("div",{className:"grid grid-cols-3 gap-3",children:Yv.map(E=>h.jsxs("button",{onClick:()=>m({...c,appearance:E.value}),className:`
relative p-3 rounded-xl bg-white/80 transition-all duration-200
${c.appearance===E.value?"ring-2 ring-purple-400 scale-105":"hover:scale-105"}
`,children:[h.jsx("div",{className:"text-2xl mb-1",children:E.emoji}),h.jsx("p",{className:"text-xs text-slate-600",children:E.label}),c.appearance===E.value&&h.jsx("div",{className:"absolute top-1 right-1 w-5 h-5 bg-purple-400 rounded-full flex items-center justify-center",children:h.jsx(ds,{size:12,className:"text-white"})})]},E.value))})]}),h.jsxs("div",{children:[h.jsx("h4",{className:"text-sm font-medium text-slate-700 mb-3",children:"选择角色"}),h.jsx("div",{className:"grid grid-cols-1 gap-3",children:Gv.map(E=>h.jsxs("button",{onClick:()=>m({...c,role:E.value}),className:`
relative p-4 rounded-xl bg-white/80 transition-all duration-200
flex items-center gap-3
${c.role===E.value?"ring-2 ring-purple-400 scale-105":"hover:scale-105"}
`,children:[h.jsx("div",{className:"text-2xl",children:E.emoji}),h.jsx("p",{className:"text-sm text-slate-700",children:E.label}),c.role===E.value&&h.jsx("div",{className:"absolute top-3 right-3 w-5 h-5 bg-purple-400 rounded-full flex items-center justify-center",children:h.jsx(ds,{size:12,className:"text-white"})})]},E.value))})]})]});return h.jsxs("div",{className:`\r
fixed inset-0 z-[100]\r
flex items-center justify-center\r
bg-black/30 backdrop-blur-sm\r
animate-[fadeIn_0.3s_ease-out]\r
p-4\r
`,children:[h.jsxs("div",{className:`\r
relative w-full max-w-lg\r
bg-gradient-to-br from-white/95 to-purple-50/95\r
backdrop-blur-xl\r
rounded-3xl shadow-2xl\r
border border-white/50\r
p-6\r
animate-[slideUp_0.3s_ease-out]\r
max-h-[90vh]\r
overflow-y-auto\r
`,children:[h.jsxs("div",{className:"flex items-center justify-between mb-6",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(ll,{className:"text-purple-400",size:20}),h.jsx("h3",{className:"text-lg font-medium text-slate-700",children:"AI 形象定制"})]}),h.jsx("button",{onClick:L,disabled:r,className:`\r
p-2 rounded-full\r
text-slate-400 hover:text-slate-600\r
hover:bg-white/50\r
transition-all duration-200\r
disabled:opacity-50\r
`,children:h.jsx(Xn,{size:20})})]}),h.jsxs("div",{className:"flex gap-2 mb-6",children:[h.jsxs("button",{onClick:()=>v("history"),className:`
flex-1 flex items-center justify-center gap-2
px-4 py-2 rounded-xl
transition-all duration-200
${p==="history"?"bg-purple-400 text-white":"bg-white/80 text-slate-600 hover:bg-white"}
`,children:[h.jsx(cv,{size:16}),h.jsx("span",{className:"text-sm",children:"历史形象"})]}),h.jsxs("button",{onClick:()=>{v("create"),u(1)},className:`
flex-1 flex items-center justify-center gap-2
px-4 py-2 rounded-xl
transition-all duration-200
${p==="create"?"bg-purple-400 text-white":"bg-white/80 text-slate-600 hover:bg-white"}
`,children:[h.jsx(t0,{size:16}),h.jsx("span",{className:"text-sm",children:"生成新形象"})]})]}),p==="create"&&s&&h.jsx("div",{className:"mb-6 p-4 bg-gradient-to-br from-purple-50 to-pink-50 rounded-2xl border border-purple-100",children:h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("img",{src:s,alt:"Current character",className:"w-24 h-24 rounded-full object-cover border-4 border-white shadow-lg"}),h.jsxs("div",{className:"flex-1",children:[h.jsx("p",{className:"text-sm font-medium text-slate-700 mb-1",children:"当前形象"}),h.jsxs("div",{className:"text-xs text-slate-500 space-y-0.5",children:[h.jsxs("p",{children:["🎨 ",c.color]}),h.jsxs("p",{children:["😊 ",c.personality]}),h.jsxs("p",{children:["✨ ",c.appearance]}),h.jsxs("p",{children:["🎭 ",c.role]})]})]})]})}),p==="history"?B():h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-center justify-center gap-2 mb-6",children:[h.jsx("div",{className:`
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
${g===1?"bg-purple-400 text-white":"bg-white/80 text-slate-400"}
`,children:"1"}),h.jsx("div",{className:"w-12 h-0.5 bg-slate-200"}),h.jsx("div",{className:`
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
${g===2?"bg-purple-400 text-white":"bg-white/80 text-slate-400"}
`,children:"2"})]}),g===1?U():H(),h.jsxs("div",{className:"flex gap-3 mt-6",children:[g===2&&h.jsx("button",{onClick:()=>u(1),disabled:r,className:`\r
flex-1 px-4 py-3 rounded-2xl\r
bg-white/80 text-slate-600\r
hover:bg-white\r
transition-all duration-200\r
disabled:opacity-50\r
`,children:"上一步"}),g===1?h.jsx("button",{onClick:()=>u(2),className:`\r
flex-1 px-4 py-3 rounded-2xl\r
bg-gradient-to-br from-purple-400 to-pink-400\r
hover:from-purple-500 hover:to-pink-500\r
text-white font-medium\r
transition-all duration-200\r
hover:scale-105 active:scale-95\r
`,children:"下一步"}):h.jsx("button",{onClick:w,disabled:r,className:`\r
flex-1 flex items-center justify-center gap-2\r
px-4 py-3 rounded-2xl\r
bg-gradient-to-br from-purple-400 to-pink-400\r
hover:from-purple-500 hover:to-pink-500\r
text-white font-medium\r
transition-all duration-200\r
disabled:opacity-50\r
hover:scale-105 active:scale-95\r
`,children:r?h.jsxs(h.Fragment,{children:[h.jsx(al,{size:18,className:"animate-spin"}),h.jsx("span",{children:"生成中..."})]}):h.jsxs(h.Fragment,{children:[h.jsx(ll,{size:18}),h.jsx("span",{children:s?"重新生成":"生成形象"})]})})]})]}),o&&h.jsx("div",{className:"mt-4 p-3 bg-red-50 border border-red-200 rounded-xl",children:h.jsx("p",{className:"text-sm text-red-600 text-center",children:o})}),h.jsx("p",{className:"text-xs text-slate-400 text-center mt-4",children:p==="history"?"点击历史形象即可切换,或创建新形象":r?"正在生成你的专属 AI 形象,请稍候(约 30-60 秒)...":s?'修改选项后点击"重新生成"更新形象':"选择你喜欢的风格,生成专属的 AI 陪伴形象"})]}),h.jsx("style",{children:`
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
`})]})},vs=({isOpen:N,onClose:L,characterImageUrl:R,onSendMessage:C})=>{const[b,s]=ie.useState([{id:"1",role:"assistant",content:"你好呀~ 我在这里陪着你,有什么想聊的吗?",timestamp:Date.now()}]),[p,v]=ie.useState(""),[c,m]=ie.useState(!1),r=ie.useRef(null),x=ie.useRef(null);ie.useEffect(()=>{var o;(o=r.current)==null||o.scrollIntoView({behavior:"smooth"})},[b]),ie.useEffect(()=>{var o;N&&((o=x.current)==null||o.focus())},[N]);const g=async()=>{if(!p.trim()||c)return;const o={id:Date.now().toString(),role:"user",content:p,timestamp:Date.now()};s(f=>[...f,o]),v(""),m(!0);try{const f=await C(p),y={id:(Date.now()+1).toString(),role:"assistant",content:f,timestamp:Date.now()};s(T=>[...T,y])}catch{const y={id:(Date.now()+1).toString(),role:"assistant",content:"抱歉,我现在有点累了,稍后再聊好吗?",timestamp:Date.now()};s(T=>[...T,y])}finally{m(!1)}},u=o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),g())};return N?h.jsxs("div",{className:`\r
fixed inset-0 z-[100] \r
flex items-center justify-center\r
bg-black/20 backdrop-blur-sm\r
animate-[fadeIn_0.3s_ease-out]\r
`,children:[h.jsxs("div",{className:`\r
relative w-full max-w-md h-[600px] mx-4\r
bg-gradient-to-br from-white/95 to-purple-50/95\r
backdrop-blur-xl\r
rounded-3xl shadow-2xl\r
border border-white/50\r
flex flex-col\r
animate-[slideUp_0.3s_ease-out]\r
`,children:[h.jsxs("div",{className:`\r
flex items-center justify-between\r
px-6 py-4\r
border-b border-white/50\r
`,children:[h.jsxs("div",{className:"flex items-center gap-3",children:[R?h.jsx("img",{src:R,alt:"AI Companion",className:"w-10 h-10 rounded-full object-cover border-2 border-white shadow-md"}):h.jsx("div",{className:`\r
w-10 h-10 rounded-full \r
bg-gradient-to-br from-purple-200 to-pink-200\r
border-2 border-white shadow-md\r
flex items-center justify-center\r
`,children:h.jsx("span",{className:"text-lg",children:"🐱"})}),h.jsxs("div",{children:[h.jsx("h3",{className:"text-base font-medium text-slate-700",children:"小喵陪伴"}),h.jsx("p",{className:"text-xs text-slate-400",children:"在线 · 随时陪你聊天"})]})]}),h.jsx("button",{onClick:L,className:`\r
p-2 rounded-full\r
text-slate-400 hover:text-slate-600\r
hover:bg-white/50\r
transition-all duration-200\r
`,children:h.jsx(Xn,{size:20})})]}),h.jsxs("div",{className:`\r
flex-1 overflow-y-auto\r
px-6 py-4\r
space-y-4\r
`,children:[b.map(o=>h.jsxs("div",{className:`
flex gap-3
${o.role==="user"?"flex-row-reverse":"flex-row"}
`,children:[o.role==="assistant"&&h.jsx("div",{className:`\r
w-8 h-8 rounded-full flex-shrink-0\r
bg-gradient-to-br from-purple-200 to-pink-200\r
flex items-center justify-center\r
text-sm\r
`,children:"🐱"}),h.jsx("div",{className:`
max-w-[75%] px-4 py-2.5 rounded-2xl
${o.role==="user"?"bg-gradient-to-br from-purple-400 to-pink-400 text-white rounded-tr-sm":"bg-white/80 text-slate-700 rounded-tl-sm"}
shadow-sm
`,children:h.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:o.content})}),o.role==="user"&&h.jsx("div",{className:`\r
w-8 h-8 rounded-full flex-shrink-0\r
bg-gradient-to-br from-blue-200 to-cyan-200\r
flex items-center justify-center\r
text-sm\r
`,children:"👤"})]},o.id)),c&&h.jsxs("div",{className:"flex gap-3",children:[h.jsx("div",{className:`\r
w-8 h-8 rounded-full\r
bg-gradient-to-br from-purple-200 to-pink-200\r
flex items-center justify-center\r
text-sm\r
`,children:"🐱"}),h.jsxs("div",{className:`\r
px-4 py-2.5 rounded-2xl rounded-tl-sm\r
bg-white/80\r
flex items-center gap-2\r
`,children:[h.jsx(al,{size:16,className:"animate-spin text-purple-400"}),h.jsx("span",{className:"text-sm text-slate-400",children:"思考中..."})]})]}),h.jsx("div",{ref:r})]}),h.jsxs("div",{className:`\r
px-6 py-4\r
border-t border-white/50\r
`,children:[h.jsxs("div",{className:`\r
flex items-center gap-2\r
bg-white/80 rounded-2xl\r
px-4 py-2\r
border border-white/50\r
shadow-sm\r
`,children:[h.jsx("input",{ref:x,type:"text",value:p,onChange:o=>v(o.target.value),onKeyPress:u,placeholder:"说点什么吧...",disabled:c,className:`\r
flex-1 bg-transparent\r
text-sm text-slate-700\r
placeholder:text-slate-400\r
outline-none\r
disabled:opacity-50\r
`}),h.jsx("button",{onClick:g,disabled:!p.trim()||c,className:`\r
p-2 rounded-full\r
bg-gradient-to-br from-purple-400 to-pink-400\r
text-white\r
hover:from-purple-500 hover:to-pink-500\r
disabled:opacity-50 disabled:cursor-not-allowed\r
transition-all duration-200\r
hover:scale-105\r
`,children:h.jsx(_r,{size:16})})]}),h.jsx("p",{className:"text-xs text-slate-400 text-center mt-2",children:"按 Enter 发送,Shift + Enter 换行"})]})]}),h.jsx("style",{children:`
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
`})]}):null},kv=({item:N,index:L})=>{const R=new Date(N.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),C=s=>{switch(s){case ge.MOOD:return h.jsx(a0,{size:12});case ge.INSPIRATION:return h.jsx(ll,{size:12});case ge.VOICE:return h.jsx(Hr,{size:12});case ge.MANUAL:return h.jsx(e0,{size:12})}},b=s=>{switch(s){case ge.MOOD:return"Mood";case ge.INSPIRATION:return"Idea";case ge.VOICE:return"Voice";case ge.MANUAL:return"Note"}};return h.jsxs("div",{className:"group relative w-full bg-white/30 backdrop-blur-xl border border-white/40 shadow-[0_4px_20px_-10px_rgba(0,0,0,0.02)] hover:bg-white/40 transition-all duration-500 rounded-[24px] p-5 mb-4 animate-morph",style:{animation:"fadeSlideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards",animationDelay:`${L*100}ms`,opacity:0},children:[h.jsx("div",{className:"absolute inset-0 rounded-[24px] ring-1 ring-inset ring-white/30 pointer-events-none"}),h.jsx("div",{className:"relative z-10",children:h.jsx("p",{className:"text-[15px] leading-relaxed font-normal text-slate-800/80 line-clamp-3 font-sans",children:N.content})}),h.jsxs("div",{className:"relative z-10 flex items-center justify-between mt-4",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-slate-400/40 text-[11px] font-medium tracking-wide group-hover:text-slate-500/60 transition-colors duration-300",children:[C(N.sourceType),h.jsx("span",{children:b(N.sourceType)})]}),h.jsx("span",{className:"text-[11px] font-light text-slate-400/30 tracking-wider",children:R})]}),h.jsx("style",{children:`
@keyframes fadeSlideUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
`})]})},qv=({items:N})=>{const L=ie.useMemo(()=>{const R={};return N.forEach(C=>{const b=new Date(C.createdAt),s=new Date,p=new Date(s);p.setDate(p.getDate()-1);let v=b.toLocaleDateString("en-US",{month:"short",day:"numeric"});b.toDateString()===s.toDateString()?v="Today":b.toDateString()===p.toDateString()&&(v="Yesterday"),R[v]||(R[v]=[]),R[v].push(C)}),R},[N]);return h.jsx("div",{className:"w-full h-full flex flex-col pt-16 pb-32 overflow-y-auto no-scrollbar scroll-smooth",children:h.jsxs("div",{className:"w-full max-w-md mx-auto px-6",children:[h.jsx("div",{className:"mb-10 text-center opacity-0 animate-[fadeSlideUp_1s_ease-out_forwards]",children:h.jsx("h2",{className:"text-xl font-light text-slate-600/60 tracking-tight font-serif italic",children:"Your words, gently kept."})}),h.jsx("div",{className:"flex flex-col gap-8",children:Object.entries(L).map(([R,C],b)=>h.jsxs("div",{className:"flex flex-col",children:[h.jsx("div",{className:"sticky top-0 z-20 py-2 mb-3 text-xs font-semibold tracking-widest text-slate-300/80 uppercase backdrop-blur-[2px]",style:{animationDelay:`${b*100}ms`},children:R}),h.jsx("div",{className:"flex flex-col gap-1",children:C.sort((s,p)=>p.createdAt-s.createdAt).map((s,p)=>h.jsx(kv,{item:s,index:p},s.id))})]},R))}),h.jsx("div",{className:"h-20"})]})})},Xv=({post:N,index:L})=>{const[R,C]=ie.useState(N.isLiked),[b,s]=ie.useState(N.likeCount),p=()=>{const c=!R;C(c),s(m=>c?m+1:m-1)},v=c=>{const m=Date.now()-c,r=Math.floor(m/6e4);if(r<60)return`${r}m ago`;const x=Math.floor(r/60);return x<24?`${x}h ago`:new Date(c).toLocaleDateString([],{month:"short",day:"numeric"})};return h.jsxs("div",{className:"group relative w-full bg-white/40 backdrop-blur-xl border border-white/50 shadow-[0_8px_32px_-10px_rgba(0,0,0,0.02)] rounded-[24px] p-6 mb-6 transition-all duration-700 hover:bg-white/50",style:{animation:"fadeSlideUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards",animationDelay:`${L*150}ms`,opacity:0},children:[h.jsxs("div",{className:"flex items-center gap-2 mb-3 opacity-60",children:[h.jsx("div",{className:`w-5 h-5 rounded-full ${N.user.avatarColor} opacity-50`}),h.jsx("span",{className:"text-xs font-medium text-slate-500 tracking-wide",children:N.user.name})]}),h.jsx("div",{className:"relative z-10 mb-4",children:h.jsx("p",{className:"text-[15px] leading-7 font-normal text-slate-700/80 font-sans whitespace-pre-wrap",children:N.content})}),h.jsxs("div",{className:"flex items-center justify-between mt-2",children:[h.jsxs("div",{className:"flex items-center gap-6",children:[h.jsxs("button",{onClick:p,className:"flex items-center gap-1.5 group/btn transition-transform active:scale-95 focus:outline-none",children:[h.jsx(uv,{size:18,strokeWidth:1.5,className:`transition-all duration-500 ${R?"fill-pink-300 stroke-pink-300 scale-110":"stroke-slate-300 fill-transparent group-hover/btn:stroke-pink-300/50"}`}),h.jsx("span",{className:`text-xs font-medium transition-colors duration-500 ${R?"text-pink-300":"text-slate-300"}`,children:b>0?b:""})]}),h.jsxs("button",{className:"flex items-center gap-1.5 group/btn transition-transform active:scale-95 focus:outline-none",children:[h.jsx(hs,{size:18,strokeWidth:1.5,className:"stroke-slate-300 transition-colors duration-300 group-hover/btn:stroke-purple-300/50"}),h.jsx("span",{className:"text-xs font-medium text-slate-300",children:N.commentCount>0?N.commentCount:""})]})]}),h.jsx("span",{className:"text-[11px] font-light text-slate-400/30 tracking-widest uppercase",children:v(N.createdAt)})]}),h.jsx("style",{children:`
@keyframes fadeSlideUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
`})]})},Qv=({posts:N,onAddPost:L})=>{const[R,C]=ie.useState(!1),[b,s]=ie.useState(""),p=()=>{b.trim()&&(L(b),s(""),C(!1))};return h.jsxs("div",{className:"w-full h-full relative",children:[h.jsxs("div",{className:"w-full h-full flex flex-col pt-16 px-6 pb-32 overflow-y-auto no-scrollbar scroll-smooth",children:[h.jsx("div",{className:"mb-8 text-center opacity-0 animate-[fadeSlideUp_1s_ease-out_forwards]",children:h.jsx("h2",{className:"text-xl font-light text-slate-600/60 tracking-tight font-serif italic",children:"你并不孤单"})}),h.jsx("div",{className:"flex flex-col w-full max-w-md mx-auto",children:N.map((v,c)=>h.jsx(Xv,{post:v,index:c},v.id))}),h.jsx("div",{className:"h-24"})]}),!R&&h.jsx("div",{className:"fixed bottom-28 right-6 z-40 animate-[fadeSlideUp_0.5s_ease-out]",children:h.jsx("button",{onClick:()=>C(!0),className:`
group relative flex items-center justify-center w-14 h-14
bg-white/60 backdrop-blur-md rounded-full shadow-lg shadow-purple-100/50
ring-1 ring-white/60 text-purple-400
hover:bg-white/80 hover:text-purple-500 hover:scale-105
active:scale-95 transition-all duration-500
`,children:h.jsx(e0,{size:24,strokeWidth:1.5})})}),R&&h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-6 bg-white/10 backdrop-blur-sm transition-all duration-500 animate-[fadeIn_0.3s_ease-out]",children:h.jsxs("div",{className:"relative w-full max-w-md bg-white/70 backdrop-blur-xl border border-white/60 shadow-2xl rounded-[32px] p-6 animate-[scaleIn_0.4s_cubic-bezier(0.16,1,0.3,1)]",children:[h.jsx("button",{onClick:()=>C(!1),className:"absolute top-4 right-4 p-2 text-slate-400 hover:text-slate-600 transition-colors",children:h.jsx(Xn,{size:20})}),h.jsx("h3",{className:"text-lg font-medium text-slate-600 mb-6 pl-1",children:"分享一个想法..."}),h.jsx("textarea",{className:"w-full h-32 bg-transparent text-slate-700 text-lg font-light placeholder:text-slate-400/50 resize-none focus:outline-none",placeholder:"此刻你在想什么?轻轻说出来吧。",value:b,onChange:v=>s(v.target.value),autoFocus:!0}),h.jsx("div",{className:"flex justify-end mt-4",children:h.jsx("button",{onClick:p,disabled:!b.trim(),className:`
px-6 py-2.5 rounded-full font-medium text-sm transition-all duration-300
${b.trim()?"bg-gradient-to-r from-purple-300 to-pink-300 text-white shadow-md hover:shadow-lg transform hover:-translate-y-0.5":"bg-slate-200/50 text-slate-400 cursor-not-allowed"}
`,children:"发布"})})]})}),h.jsx("style",{children:`
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
`})]})},Zv=({profile:N})=>h.jsxs("div",{className:"flex flex-col items-center justify-center p-6 mb-8 opacity-0 animate-[fadeSlideUp_1s_cubic-bezier(0.2,0.8,0.2,1)_forwards]",children:[h.jsxs("div",{className:"w-32 h-32 rounded-full mb-6 relative overflow-hidden ring-4 ring-white/30 shadow-[0_10px_40px_-10px_rgba(167,139,250,0.3)]",children:[N.avatarUrl?h.jsx("img",{src:N.avatarUrl,alt:N.name,className:"w-full h-full object-cover"}):h.jsx("div",{className:"w-full h-full bg-gradient-to-br from-purple-100 via-pink-100 to-white flex items-center justify-center",children:h.jsx("span",{className:"text-4xl text-purple-300/50 font-light",children:N.name.charAt(0)})}),h.jsx("div",{className:"absolute inset-0 bg-gradient-to-tr from-white/10 to-transparent pointer-events-none"})]}),h.jsx("h2",{className:"text-2xl font-medium text-slate-800/80 mb-1.5 tracking-wide font-sans",children:N.name}),h.jsxs("p",{className:"text-[13px] font-light text-slate-400/60 mb-8 tracking-wider uppercase",children:["Born on ",N.birthday]}),h.jsx("div",{className:"px-5 py-2.5 rounded-2xl bg-white/40 backdrop-blur-md border border-white/40 shadow-sm",children:h.jsxs("p",{className:"text-[15px] font-normal text-slate-600/90 italic flex items-center gap-2",children:[h.jsx("span",{children:N.moodStatus}),h.jsx("span",{className:"text-lg opacity-80",children:"🍃"})]})}),h.jsx("style",{children:`
@keyframes fadeSlideUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
`})]}),Kv=({status:N})=>h.jsxs("div",{className:"w-full bg-white/40 backdrop-blur-xl border border-white/50 shadow-[0_8px_32px_-10px_rgba(0,0,0,0.01)] rounded-[24px] p-6 mb-6 flex flex-col items-start gap-5 opacity-0 animate-[fadeSlideUp_1s_cubic-bezier(0.2,0.8,0.2,1)_forwards]",style:{animationDelay:"150ms"},children:[h.jsx("span",{className:"text-[10px] font-semibold tracking-[0.2em] text-slate-400/40 uppercase ml-1",children:"My Device"}),h.jsxs("div",{className:"w-full flex items-center justify-between pl-1",children:[h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${N.isConnected?"bg-purple-300":"bg-slate-300"}`}),h.jsx("span",{className:`text-[15px] font-medium tracking-wide ${N.isConnected?"text-slate-600":"text-slate-400"}`,children:N.isConnected?"Connected":"Not connected"})]}),h.jsx("span",{className:"text-xs font-light text-slate-400/60 pl-3.5",children:N.deviceName})]}),h.jsxs("div",{className:"flex flex-col items-end gap-2.5",children:[h.jsxs("span",{className:"text-[11px] font-medium text-slate-400/60 tracking-wider",children:["Battery · ",N.batteryLevel,"%"]}),h.jsx("div",{className:"relative w-16 h-2 bg-white/50 rounded-full overflow-hidden shadow-inner ring-1 ring-white/40",children:h.jsx("div",{className:"absolute top-0 left-0 h-full rounded-full bg-gradient-to-r from-purple-200 to-pink-200 transition-all duration-1000 ease-out",style:{width:`${N.batteryLevel}%`}})})]})]})]}),Jv=({profile:N,deviceStatus:L})=>h.jsx("div",{className:"w-full h-full flex flex-col pt-12 pb-32 overflow-y-auto no-scrollbar scroll-smooth",children:h.jsxs("div",{className:"w-full max-w-md mx-auto px-6",children:[h.jsx("div",{className:"h-4"}),h.jsx(Zv,{profile:N}),h.jsx("div",{className:"h-6"}),h.jsx(Kv,{status:L}),h.jsx("div",{className:"h-24"})]})});var ms={exports:{}};/*!
* matter-js 0.20.0 by @liabru
* http://brm.io/matter-js/
* License MIT
*
* The MIT License (MIT)
*
* Copyright (c) Liam Brummitt and contributors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/var Fv=ms.exports,Wd;function $v(){return Wd||(Wd=1,(function(N,L){(function(C,b){N.exports=b()})(Fv,function(){return(function(R){var C={};function b(s){if(C[s])return C[s].exports;var p=C[s]={i:s,l:!1,exports:{}};return R[s].call(p.exports,p,p.exports,b),p.l=!0,p.exports}return b.m=R,b.c=C,b.d=function(s,p,v){b.o(s,p)||Object.defineProperty(s,p,{enumerable:!0,get:v})},b.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},b.t=function(s,p){if(p&1&&(s=b(s)),p&8||p&4&&typeof s=="object"&&s&&s.__esModule)return s;var v=Object.create(null);if(b.r(v),Object.defineProperty(v,"default",{enumerable:!0,value:s}),p&2&&typeof s!="string")for(var c in s)b.d(v,c,(function(m){return s[m]}).bind(null,c));return v},b.n=function(s){var p=s&&s.__esModule?function(){return s.default}:function(){return s};return b.d(p,"a",p),p},b.o=function(s,p){return Object.prototype.hasOwnProperty.call(s,p)},b.p="",b(b.s=20)})([(function(R,C){var b={};R.exports=b,(function(){b._baseDelta=1e3/60,b._nextId=0,b._seed=0,b._nowStartTime=+new Date,b._warnedOnce={},b._decomp=null,b.extend=function(p,v){var c,m;typeof v=="boolean"?(c=2,m=v):(c=1,m=!0);for(var r=c;r<arguments.length;r++){var x=arguments[r];if(x)for(var g in x)m&&x[g]&&x[g].constructor===Object&&(!p[g]||p[g].constructor===Object)?(p[g]=p[g]||{},b.extend(p[g],m,x[g])):p[g]=x[g]}return p},b.clone=function(p,v){return b.extend({},v,p)},b.keys=function(p){if(Object.keys)return Object.keys(p);var v=[];for(var c in p)v.push(c);return v},b.values=function(p){var v=[];if(Object.keys){for(var c=Object.keys(p),m=0;m<c.length;m++)v.push(p[c[m]]);return v}for(var r in p)v.push(p[r]);return v},b.get=function(p,v,c,m){v=v.split(".").slice(c,m);for(var r=0;r<v.length;r+=1)p=p[v[r]];return p},b.set=function(p,v,c,m,r){var x=v.split(".").slice(m,r);return b.get(p,v,0,-1)[x[x.length-1]]=c,c},b.shuffle=function(p){for(var v=p.length-1;v>0;v--){var c=Math.floor(b.random()*(v+1)),m=p[v];p[v]=p[c],p[c]=m}return p},b.choose=function(p){return p[Math.floor(b.random()*p.length)]},b.isElement=function(p){return typeof HTMLElement<"u"?p instanceof HTMLElement:!!(p&&p.nodeType&&p.nodeName)},b.isArray=function(p){return Object.prototype.toString.call(p)==="[object Array]"},b.isFunction=function(p){return typeof p=="function"},b.isPlainObject=function(p){return typeof p=="object"&&p.constructor===Object},b.isString=function(p){return toString.call(p)==="[object String]"},b.clamp=function(p,v,c){return p<v?v:p>c?c:p},b.sign=function(p){return p<0?-1:1},b.now=function(){if(typeof window<"u"&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-b._nowStartTime},b.random=function(p,v){return p=typeof p<"u"?p:0,v=typeof v<"u"?v:1,p+s()*(v-p)};var s=function(){return b._seed=(b._seed*9301+49297)%233280,b._seed/233280};b.colorToNumber=function(p){return p=p.replace("#",""),p.length==3&&(p=p.charAt(0)+p.charAt(0)+p.charAt(1)+p.charAt(1)+p.charAt(2)+p.charAt(2)),parseInt(p,16)},b.logLevel=1,b.log=function(){console&&b.logLevel>0&&b.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},b.info=function(){console&&b.logLevel>0&&b.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},b.warn=function(){console&&b.logLevel>0&&b.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},b.warnOnce=function(){var p=Array.prototype.slice.call(arguments).join(" ");b._warnedOnce[p]||(b.warn(p),b._warnedOnce[p]=!0)},b.deprecated=function(p,v,c){p[v]=b.chain(function(){b.warnOnce("🔅 deprecated 🔅",c)},p[v])},b.nextId=function(){return b._nextId++},b.indexOf=function(p,v){if(p.indexOf)return p.indexOf(v);for(var c=0;c<p.length;c++)if(p[c]===v)return c;return-1},b.map=function(p,v){if(p.map)return p.map(v);for(var c=[],m=0;m<p.length;m+=1)c.push(v(p[m]));return c},b.topologicalSort=function(p){var v=[],c=[],m=[];for(var r in p)!c[r]&&!m[r]&&b._topologicalSort(r,c,m,p,v);return v},b._topologicalSort=function(p,v,c,m,r){var x=m[p]||[];c[p]=!0;for(var g=0;g<x.length;g+=1){var u=x[g];c[u]||v[u]||b._topologicalSort(u,v,c,m,r)}c[p]=!1,v[p]=!0,r.push(p)},b.chain=function(){for(var p=[],v=0;v<arguments.length;v+=1){var c=arguments[v];c._chained?p.push.apply(p,c._chained):p.push(c)}var m=function(){for(var r,x=new Array(arguments.length),g=0,u=arguments.length;g<u;g++)x[g]=arguments[g];for(g=0;g<p.length;g+=1){var o=p[g].apply(r,x);typeof o<"u"&&(r=o)}return r};return m._chained=p,m},b.chainPathBefore=function(p,v,c){return b.set(p,v,b.chain(c,b.get(p,v)))},b.chainPathAfter=function(p,v,c){return b.set(p,v,b.chain(b.get(p,v),c))},b.setDecomp=function(p){b._decomp=p},b.getDecomp=function(){var p=b._decomp;try{!p&&typeof window<"u"&&(p=window.decomp),!p&&typeof _d<"u"&&(p=_d.decomp)}catch{p=null}return p}})()}),(function(R,C){var b={};R.exports=b,(function(){b.create=function(s){var p={min:{x:0,y:0},max:{x:0,y:0}};return s&&b.update(p,s),p},b.update=function(s,p,v){s.min.x=1/0,s.max.x=-1/0,s.min.y=1/0,s.max.y=-1/0;for(var c=0;c<p.length;c++){var m=p[c];m.x>s.max.x&&(s.max.x=m.x),m.x<s.min.x&&(s.min.x=m.x),m.y>s.max.y&&(s.max.y=m.y),m.y<s.min.y&&(s.min.y=m.y)}v&&(v.x>0?s.max.x+=v.x:s.min.x+=v.x,v.y>0?s.max.y+=v.y:s.min.y+=v.y)},b.contains=function(s,p){return p.x>=s.min.x&&p.x<=s.max.x&&p.y>=s.min.y&&p.y<=s.max.y},b.overlaps=function(s,p){return s.min.x<=p.max.x&&s.max.x>=p.min.x&&s.max.y>=p.min.y&&s.min.y<=p.max.y},b.translate=function(s,p){s.min.x+=p.x,s.max.x+=p.x,s.min.y+=p.y,s.max.y+=p.y},b.shift=function(s,p){var v=s.max.x-s.min.x,c=s.max.y-s.min.y;s.min.x=p.x,s.max.x=p.x+v,s.min.y=p.y,s.max.y=p.y+c}})()}),(function(R,C){var b={};R.exports=b,(function(){b.create=function(s,p){return{x:s||0,y:p||0}},b.clone=function(s){return{x:s.x,y:s.y}},b.magnitude=function(s){return Math.sqrt(s.x*s.x+s.y*s.y)},b.magnitudeSquared=function(s){return s.x*s.x+s.y*s.y},b.rotate=function(s,p,v){var c=Math.cos(p),m=Math.sin(p);v||(v={});var r=s.x*c-s.y*m;return v.y=s.x*m+s.y*c,v.x=r,v},b.rotateAbout=function(s,p,v,c){var m=Math.cos(p),r=Math.sin(p);c||(c={});var x=v.x+((s.x-v.x)*m-(s.y-v.y)*r);return c.y=v.y+((s.x-v.x)*r+(s.y-v.y)*m),c.x=x,c},b.normalise=function(s){var p=b.magnitude(s);return p===0?{x:0,y:0}:{x:s.x/p,y:s.y/p}},b.dot=function(s,p){return s.x*p.x+s.y*p.y},b.cross=function(s,p){return s.x*p.y-s.y*p.x},b.cross3=function(s,p,v){return(p.x-s.x)*(v.y-s.y)-(p.y-s.y)*(v.x-s.x)},b.add=function(s,p,v){return v||(v={}),v.x=s.x+p.x,v.y=s.y+p.y,v},b.sub=function(s,p,v){return v||(v={}),v.x=s.x-p.x,v.y=s.y-p.y,v},b.mult=function(s,p){return{x:s.x*p,y:s.y*p}},b.div=function(s,p){return{x:s.x/p,y:s.y/p}},b.perp=function(s,p){return p=p===!0?-1:1,{x:p*-s.y,y:p*s.x}},b.neg=function(s){return{x:-s.x,y:-s.y}},b.angle=function(s,p){return Math.atan2(p.y-s.y,p.x-s.x)},b._temp=[b.create(),b.create(),b.create(),b.create(),b.create(),b.create()]})()}),(function(R,C,b){var s={};R.exports=s;var p=b(2),v=b(0);(function(){s.create=function(c,m){for(var r=[],x=0;x<c.length;x++){var g=c[x],u={x:g.x,y:g.y,index:x,body:m,isInternal:!1};r.push(u)}return r},s.fromPath=function(c,m){var r=/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/ig,x=[];return c.replace(r,function(g,u,o){x.push({x:parseFloat(u),y:parseFloat(o)})}),s.create(x,m)},s.centre=function(c){for(var m=s.area(c,!0),r={x:0,y:0},x,g,u,o=0;o<c.length;o++)u=(o+1)%c.length,x=p.cross(c[o],c[u]),g=p.mult(p.add(c[o],c[u]),x),r=p.add(r,g);return p.div(r,6*m)},s.mean=function(c){for(var m={x:0,y:0},r=0;r<c.length;r++)m.x+=c[r].x,m.y+=c[r].y;return p.div(m,c.length)},s.area=function(c,m){for(var r=0,x=c.length-1,g=0;g<c.length;g++)r+=(c[x].x-c[g].x)*(c[x].y+c[g].y),x=g;return m?r/2:Math.abs(r)/2},s.inertia=function(c,m){for(var r=0,x=0,g=c,u,o,f=0;f<g.length;f++)o=(f+1)%g.length,u=Math.abs(p.cross(g[o],g[f])),r+=u*(p.dot(g[o],g[o])+p.dot(g[o],g[f])+p.dot(g[f],g[f])),x+=u;return m/6*(r/x)},s.translate=function(c,m,r){r=typeof r<"u"?r:1;var x=c.length,g=m.x*r,u=m.y*r,o;for(o=0;o<x;o++)c[o].x+=g,c[o].y+=u;return c},s.rotate=function(c,m,r){if(m!==0){var x=Math.cos(m),g=Math.sin(m),u=r.x,o=r.y,f=c.length,y,T,z,D;for(D=0;D<f;D++)y=c[D],T=y.x-u,z=y.y-o,y.x=u+(T*x-z*g),y.y=o+(T*g+z*x);return c}},s.contains=function(c,m){for(var r=m.x,x=m.y,g=c.length,u=c[g-1],o,f=0;f<g;f++){if(o=c[f],(r-u.x)*(o.y-u.y)+(x-u.y)*(u.x-o.x)>0)return!1;u=o}return!0},s.scale=function(c,m,r,x){if(m===1&&r===1)return c;x=x||s.centre(c);for(var g,u,o=0;o<c.length;o++)g=c[o],u=p.sub(g,x),c[o].x=x.x+u.x*m,c[o].y=x.y+u.y*r;return c},s.chamfer=function(c,m,r,x,g){typeof m=="number"?m=[m]:m=m||[8],r=typeof r<"u"?r:-1,x=x||2,g=g||14;for(var u=[],o=0;o<c.length;o++){var f=c[o-1>=0?o-1:c.length-1],y=c[o],T=c[(o+1)%c.length],z=m[o<m.length?o:m.length-1];if(z===0){u.push(y);continue}var D=p.normalise({x:y.y-f.y,y:f.x-y.x}),O=p.normalise({x:T.y-y.y,y:y.x-T.x}),S=Math.sqrt(2*Math.pow(z,2)),M=p.mult(v.clone(D),z),j=p.normalise(p.mult(p.add(D,O),.5)),w=p.sub(y,p.mult(j,S)),B=r;r===-1&&(B=Math.pow(z,.32)*1.75),B=v.clamp(B,x,g),B%2===1&&(B+=1);for(var U=Math.acos(p.dot(D,O)),H=U/B,E=0;E<B;E++)u.push(p.add(p.rotate(M,H*E),w))}return u},s.clockwiseSort=function(c){var m=s.mean(c);return c.sort(function(r,x){return p.angle(m,r)-p.angle(m,x)}),c},s.isConvex=function(c){var m=0,r=c.length,x,g,u,o;if(r<3)return null;for(x=0;x<r;x++)if(g=(x+1)%r,u=(x+2)%r,o=(c[g].x-c[x].x)*(c[u].y-c[g].y),o-=(c[g].y-c[x].y)*(c[u].x-c[g].x),o<0?m|=1:o>0&&(m|=2),m===3)return!1;return m!==0?!0:null},s.hull=function(c){var m=[],r=[],x,g;for(c=c.slice(0),c.sort(function(u,o){var f=u.x-o.x;return f!==0?f:u.y-o.y}),g=0;g<c.length;g+=1){for(x=c[g];r.length>=2&&p.cross3(r[r.length-2],r[r.length-1],x)<=0;)r.pop();r.push(x)}for(g=c.length-1;g>=0;g-=1){for(x=c[g];m.length>=2&&p.cross3(m[m.length-2],m[m.length-1],x)<=0;)m.pop();m.push(x)}return m.pop(),r.pop(),m.concat(r)}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(3),v=b(2),c=b(7),m=b(0),r=b(1),x=b(11);(function(){s._timeCorrection=!0,s._inertiaScale=4,s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,s._baseDelta=1e3/60,s.create=function(u){var o={id:m.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:p.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,strokeStyle:null,fillStyle:null,lineWidth:null,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0}},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,deltaTime:16.666666666666668,_original:null},f=m.extend(o,u);return g(f,u),f},s.nextGroup=function(u){return u?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var g=function(u,o){o=o||{},s.set(u,{bounds:u.bounds||r.create(u.vertices),positionPrev:u.positionPrev||v.clone(u.position),anglePrev:u.anglePrev||u.angle,vertices:u.vertices,parts:u.parts||[u],isStatic:u.isStatic,isSleeping:u.isSleeping,parent:u.parent||u}),p.rotate(u.vertices,u.angle,u.position),x.rotate(u.axes,u.angle),r.update(u.bounds,u.vertices,u.velocity),s.set(u,{axes:o.axes||u.axes,area:o.area||u.area,mass:o.mass||u.mass,inertia:o.inertia||u.inertia});var f=u.isStatic?"#14151f":m.choose(["#f19648","#f5d259","#f55a3c","#063e7b","#ececd1"]),y=u.isStatic?"#555":"#ccc",T=u.isStatic&&u.render.fillStyle===null?1:0;u.render.fillStyle=u.render.fillStyle||f,u.render.strokeStyle=u.render.strokeStyle||y,u.render.lineWidth=u.render.lineWidth||T,u.render.sprite.xOffset+=-(u.bounds.min.x-u.position.x)/(u.bounds.max.x-u.bounds.min.x),u.render.sprite.yOffset+=-(u.bounds.min.y-u.position.y)/(u.bounds.max.y-u.bounds.min.y)};s.set=function(u,o,f){var y;typeof o=="string"&&(y=o,o={},o[y]=f);for(y in o)if(Object.prototype.hasOwnProperty.call(o,y))switch(f=o[y],y){case"isStatic":s.setStatic(u,f);break;case"isSleeping":c.set(u,f);break;case"mass":s.setMass(u,f);break;case"density":s.setDensity(u,f);break;case"inertia":s.setInertia(u,f);break;case"vertices":s.setVertices(u,f);break;case"position":s.setPosition(u,f);break;case"angle":s.setAngle(u,f);break;case"velocity":s.setVelocity(u,f);break;case"angularVelocity":s.setAngularVelocity(u,f);break;case"speed":s.setSpeed(u,f);break;case"angularSpeed":s.setAngularSpeed(u,f);break;case"parts":s.setParts(u,f);break;case"centre":s.setCentre(u,f);break;default:u[y]=f}},s.setStatic=function(u,o){for(var f=0;f<u.parts.length;f++){var y=u.parts[f];o?(y.isStatic||(y._original={restitution:y.restitution,friction:y.friction,mass:y.mass,inertia:y.inertia,density:y.density,inverseMass:y.inverseMass,inverseInertia:y.inverseInertia}),y.restitution=0,y.friction=1,y.mass=y.inertia=y.density=1/0,y.inverseMass=y.inverseInertia=0,y.positionPrev.x=y.position.x,y.positionPrev.y=y.position.y,y.anglePrev=y.angle,y.angularVelocity=0,y.speed=0,y.angularSpeed=0,y.motion=0):y._original&&(y.restitution=y._original.restitution,y.friction=y._original.friction,y.mass=y._original.mass,y.inertia=y._original.inertia,y.density=y._original.density,y.inverseMass=y._original.inverseMass,y.inverseInertia=y._original.inverseInertia,y._original=null),y.isStatic=o}},s.setMass=function(u,o){var f=u.inertia/(u.mass/6);u.inertia=f*(o/6),u.inverseInertia=1/u.inertia,u.mass=o,u.inverseMass=1/u.mass,u.density=u.mass/u.area},s.setDensity=function(u,o){s.setMass(u,o*u.area),u.density=o},s.setInertia=function(u,o){u.inertia=o,u.inverseInertia=1/u.inertia},s.setVertices=function(u,o){o[0].body===u?u.vertices=o:u.vertices=p.create(o,u),u.axes=x.fromVertices(u.vertices),u.area=p.area(u.vertices),s.setMass(u,u.density*u.area);var f=p.centre(u.vertices);p.translate(u.vertices,f,-1),s.setInertia(u,s._inertiaScale*p.inertia(u.vertices,u.mass)),p.translate(u.vertices,u.position),r.update(u.bounds,u.vertices,u.velocity)},s.setParts=function(u,o,f){var y;for(o=o.slice(0),u.parts.length=0,u.parts.push(u),u.parent=u,y=0;y<o.length;y++){var T=o[y];T!==u&&(T.parent=u,u.parts.push(T))}if(u.parts.length!==1){if(f=typeof f<"u"?f:!0,f){var z=[];for(y=0;y<o.length;y++)z=z.concat(o[y].vertices);p.clockwiseSort(z);var D=p.hull(z),O=p.centre(D);s.setVertices(u,D),p.translate(u.vertices,O)}var S=s._totalProperties(u);u.area=S.area,u.parent=u,u.position.x=S.centre.x,u.position.y=S.centre.y,u.positionPrev.x=S.centre.x,u.positionPrev.y=S.centre.y,s.setMass(u,S.mass),s.setInertia(u,S.inertia),s.setPosition(u,S.centre)}},s.setCentre=function(u,o,f){f?(u.positionPrev.x+=o.x,u.positionPrev.y+=o.y,u.position.x+=o.x,u.position.y+=o.y):(u.positionPrev.x=o.x-(u.position.x-u.positionPrev.x),u.positionPrev.y=o.y-(u.position.y-u.positionPrev.y),u.position.x=o.x,u.position.y=o.y)},s.setPosition=function(u,o,f){var y=v.sub(o,u.position);f?(u.positionPrev.x=u.position.x,u.positionPrev.y=u.position.y,u.velocity.x=y.x,u.velocity.y=y.y,u.speed=v.magnitude(y)):(u.positionPrev.x+=y.x,u.positionPrev.y+=y.y);for(var T=0;T<u.parts.length;T++){var z=u.parts[T];z.position.x+=y.x,z.position.y+=y.y,p.translate(z.vertices,y),r.update(z.bounds,z.vertices,u.velocity)}},s.setAngle=function(u,o,f){var y=o-u.angle;f?(u.anglePrev=u.angle,u.angularVelocity=y,u.angularSpeed=Math.abs(y)):u.anglePrev+=y;for(var T=0;T<u.parts.length;T++){var z=u.parts[T];z.angle+=y,p.rotate(z.vertices,y,u.position),x.rotate(z.axes,y),r.update(z.bounds,z.vertices,u.velocity),T>0&&v.rotateAbout(z.position,y,u.position,z.position)}},s.setVelocity=function(u,o){var f=u.deltaTime/s._baseDelta;u.positionPrev.x=u.position.x-o.x*f,u.positionPrev.y=u.position.y-o.y*f,u.velocity.x=(u.position.x-u.positionPrev.x)/f,u.velocity.y=(u.position.y-u.positionPrev.y)/f,u.speed=v.magnitude(u.velocity)},s.getVelocity=function(u){var o=s._baseDelta/u.deltaTime;return{x:(u.position.x-u.positionPrev.x)*o,y:(u.position.y-u.positionPrev.y)*o}},s.getSpeed=function(u){return v.magnitude(s.getVelocity(u))},s.setSpeed=function(u,o){s.setVelocity(u,v.mult(v.normalise(s.getVelocity(u)),o))},s.setAngularVelocity=function(u,o){var f=u.deltaTime/s._baseDelta;u.anglePrev=u.angle-o*f,u.angularVelocity=(u.angle-u.anglePrev)/f,u.angularSpeed=Math.abs(u.angularVelocity)},s.getAngularVelocity=function(u){return(u.angle-u.anglePrev)*s._baseDelta/u.deltaTime},s.getAngularSpeed=function(u){return Math.abs(s.getAngularVelocity(u))},s.setAngularSpeed=function(u,o){s.setAngularVelocity(u,m.sign(s.getAngularVelocity(u))*o)},s.translate=function(u,o,f){s.setPosition(u,v.add(u.position,o),f)},s.rotate=function(u,o,f,y){if(!f)s.setAngle(u,u.angle+o,y);else{var T=Math.cos(o),z=Math.sin(o),D=u.position.x-f.x,O=u.position.y-f.y;s.setPosition(u,{x:f.x+(D*T-O*z),y:f.y+(D*z+O*T)},y),s.setAngle(u,u.angle+o,y)}},s.scale=function(u,o,f,y){var T=0,z=0;y=y||u.position;for(var D=0;D<u.parts.length;D++){var O=u.parts[D];p.scale(O.vertices,o,f,y),O.axes=x.fromVertices(O.vertices),O.area=p.area(O.vertices),s.setMass(O,u.density*O.area),p.translate(O.vertices,{x:-O.position.x,y:-O.position.y}),s.setInertia(O,s._inertiaScale*p.inertia(O.vertices,O.mass)),p.translate(O.vertices,{x:O.position.x,y:O.position.y}),D>0&&(T+=O.area,z+=O.inertia),O.position.x=y.x+(O.position.x-y.x)*o,O.position.y=y.y+(O.position.y-y.y)*f,r.update(O.bounds,O.vertices,u.velocity)}u.parts.length>1&&(u.area=T,u.isStatic||(s.setMass(u,u.density*T),s.setInertia(u,z))),u.circleRadius&&(o===f?u.circleRadius*=o:u.circleRadius=null)},s.update=function(u,o){o=(typeof o<"u"?o:1e3/60)*u.timeScale;var f=o*o,y=s._timeCorrection?o/(u.deltaTime||o):1,T=1-u.frictionAir*(o/m._baseDelta),z=(u.position.x-u.positionPrev.x)*y,D=(u.position.y-u.positionPrev.y)*y;u.velocity.x=z*T+u.force.x/u.mass*f,u.velocity.y=D*T+u.force.y/u.mass*f,u.positionPrev.x=u.position.x,u.positionPrev.y=u.position.y,u.position.x+=u.velocity.x,u.position.y+=u.velocity.y,u.deltaTime=o,u.angularVelocity=(u.angle-u.anglePrev)*T*y+u.torque/u.inertia*f,u.anglePrev=u.angle,u.angle+=u.angularVelocity;for(var O=0;O<u.parts.length;O++){var S=u.parts[O];p.translate(S.vertices,u.velocity),O>0&&(S.position.x+=u.velocity.x,S.position.y+=u.velocity.y),u.angularVelocity!==0&&(p.rotate(S.vertices,u.angularVelocity,u.position),x.rotate(S.axes,u.angularVelocity),O>0&&v.rotateAbout(S.position,u.angularVelocity,u.position,S.position)),r.update(S.bounds,S.vertices,u.velocity)}},s.updateVelocities=function(u){var o=s._baseDelta/u.deltaTime,f=u.velocity;f.x=(u.position.x-u.positionPrev.x)*o,f.y=(u.position.y-u.positionPrev.y)*o,u.speed=Math.sqrt(f.x*f.x+f.y*f.y),u.angularVelocity=(u.angle-u.anglePrev)*o,u.angularSpeed=Math.abs(u.angularVelocity)},s.applyForce=function(u,o,f){var y={x:o.x-u.position.x,y:o.y-u.position.y};u.force.x+=f.x,u.force.y+=f.y,u.torque+=y.x*f.y-y.y*f.x},s._totalProperties=function(u){for(var o={mass:0,area:0,inertia:0,centre:{x:0,y:0}},f=u.parts.length===1?0:1;f<u.parts.length;f++){var y=u.parts[f],T=y.mass!==1/0?y.mass:1;o.mass+=T,o.area+=y.area,o.inertia+=y.inertia,o.centre=v.add(o.centre,v.mult(y.position,T))}return o.centre=v.div(o.centre,o.mass),o}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(0);(function(){s.on=function(v,c,m){for(var r=c.split(" "),x,g=0;g<r.length;g++)x=r[g],v.events=v.events||{},v.events[x]=v.events[x]||[],v.events[x].push(m);return m},s.off=function(v,c,m){if(!c){v.events={};return}typeof c=="function"&&(m=c,c=p.keys(v.events).join(" "));for(var r=c.split(" "),x=0;x<r.length;x++){var g=v.events[r[x]],u=[];if(m&&g)for(var o=0;o<g.length;o++)g[o]!==m&&u.push(g[o]);v.events[r[x]]=u}},s.trigger=function(v,c,m){var r,x,g,u,o=v.events;if(o&&p.keys(o).length>0){m||(m={}),r=c.split(" ");for(var f=0;f<r.length;f++)if(x=r[f],g=o[x],g){u=p.clone(m,!1),u.name=x,u.source=v;for(var y=0;y<g.length;y++)g[y].apply(v,[u])}}}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(5),v=b(0),c=b(1),m=b(4);(function(){s.create=function(r){return v.extend({id:v.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},r)},s.setModified=function(r,x,g,u){if(r.isModified=x,x&&r.cache&&(r.cache.allBodies=null,r.cache.allConstraints=null,r.cache.allComposites=null),g&&r.parent&&s.setModified(r.parent,x,g,u),u)for(var o=0;o<r.composites.length;o++){var f=r.composites[o];s.setModified(f,x,g,u)}},s.add=function(r,x){var g=[].concat(x);p.trigger(r,"beforeAdd",{object:x});for(var u=0;u<g.length;u++){var o=g[u];switch(o.type){case"body":if(o.parent!==o){v.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}s.addBody(r,o);break;case"constraint":s.addConstraint(r,o);break;case"composite":s.addComposite(r,o);break;case"mouseConstraint":s.addConstraint(r,o.constraint);break}}return p.trigger(r,"afterAdd",{object:x}),r},s.remove=function(r,x,g){var u=[].concat(x);p.trigger(r,"beforeRemove",{object:x});for(var o=0;o<u.length;o++){var f=u[o];switch(f.type){case"body":s.removeBody(r,f,g);break;case"constraint":s.removeConstraint(r,f,g);break;case"composite":s.removeComposite(r,f,g);break;case"mouseConstraint":s.removeConstraint(r,f.constraint);break}}return p.trigger(r,"afterRemove",{object:x}),r},s.addComposite=function(r,x){return r.composites.push(x),x.parent=r,s.setModified(r,!0,!0,!1),r},s.removeComposite=function(r,x,g){var u=v.indexOf(r.composites,x);if(u!==-1){var o=s.allBodies(x);s.removeCompositeAt(r,u);for(var f=0;f<o.length;f++)o[f].sleepCounter=0}if(g)for(var f=0;f<r.composites.length;f++)s.removeComposite(r.composites[f],x,!0);return r},s.removeCompositeAt=function(r,x){return r.composites.splice(x,1),s.setModified(r,!0,!0,!1),r},s.addBody=function(r,x){return r.bodies.push(x),s.setModified(r,!0,!0,!1),r},s.removeBody=function(r,x,g){var u=v.indexOf(r.bodies,x);if(u!==-1&&(s.removeBodyAt(r,u),x.sleepCounter=0),g)for(var o=0;o<r.composites.length;o++)s.removeBody(r.composites[o],x,!0);return r},s.removeBodyAt=function(r,x){return r.bodies.splice(x,1),s.setModified(r,!0,!0,!1),r},s.addConstraint=function(r,x){return r.constraints.push(x),s.setModified(r,!0,!0,!1),r},s.removeConstraint=function(r,x,g){var u=v.indexOf(r.constraints,x);if(u!==-1&&s.removeConstraintAt(r,u),g)for(var o=0;o<r.composites.length;o++)s.removeConstraint(r.composites[o],x,!0);return r},s.removeConstraintAt=function(r,x){return r.constraints.splice(x,1),s.setModified(r,!0,!0,!1),r},s.clear=function(r,x,g){if(g)for(var u=0;u<r.composites.length;u++)s.clear(r.composites[u],x,!0);return x?r.bodies=r.bodies.filter(function(o){return o.isStatic}):r.bodies.length=0,r.constraints.length=0,r.composites.length=0,s.setModified(r,!0,!0,!1),r},s.allBodies=function(r){if(r.cache&&r.cache.allBodies)return r.cache.allBodies;for(var x=[].concat(r.bodies),g=0;g<r.composites.length;g++)x=x.concat(s.allBodies(r.composites[g]));return r.cache&&(r.cache.allBodies=x),x},s.allConstraints=function(r){if(r.cache&&r.cache.allConstraints)return r.cache.allConstraints;for(var x=[].concat(r.constraints),g=0;g<r.composites.length;g++)x=x.concat(s.allConstraints(r.composites[g]));return r.cache&&(r.cache.allConstraints=x),x},s.allComposites=function(r){if(r.cache&&r.cache.allComposites)return r.cache.allComposites;for(var x=[].concat(r.composites),g=0;g<r.composites.length;g++)x=x.concat(s.allComposites(r.composites[g]));return r.cache&&(r.cache.allComposites=x),x},s.get=function(r,x,g){var u,o;switch(g){case"body":u=s.allBodies(r);break;case"constraint":u=s.allConstraints(r);break;case"composite":u=s.allComposites(r).concat(r);break}return u?(o=u.filter(function(f){return f.id.toString()===x.toString()}),o.length===0?null:o[0]):null},s.move=function(r,x,g){return s.remove(r,x),s.add(g,x),r},s.rebase=function(r){for(var x=s.allBodies(r).concat(s.allConstraints(r)).concat(s.allComposites(r)),g=0;g<x.length;g++)x[g].id=v.nextId();return r},s.translate=function(r,x,g){for(var u=g?s.allBodies(r):r.bodies,o=0;o<u.length;o++)m.translate(u[o],x);return r},s.rotate=function(r,x,g,u){for(var o=Math.cos(x),f=Math.sin(x),y=u?s.allBodies(r):r.bodies,T=0;T<y.length;T++){var z=y[T],D=z.position.x-g.x,O=z.position.y-g.y;m.setPosition(z,{x:g.x+(D*o-O*f),y:g.y+(D*f+O*o)}),m.rotate(z,x)}return r},s.scale=function(r,x,g,u,o){for(var f=o?s.allBodies(r):r.bodies,y=0;y<f.length;y++){var T=f[y],z=T.position.x-u.x,D=T.position.y-u.y;m.setPosition(T,{x:u.x+z*x,y:u.y+D*g}),m.scale(T,x,g)}return r},s.bounds=function(r){for(var x=s.allBodies(r),g=[],u=0;u<x.length;u+=1){var o=x[u];g.push(o.bounds.min,o.bounds.max)}return c.create(g)}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(4),v=b(5),c=b(0);(function(){s._motionWakeThreshold=.18,s._motionSleepThreshold=.08,s._minBias=.9,s.update=function(m,r){for(var x=r/c._baseDelta,g=s._motionSleepThreshold,u=0;u<m.length;u++){var o=m[u],f=p.getSpeed(o),y=p.getAngularSpeed(o),T=f*f+y*y;if(o.force.x!==0||o.force.y!==0){s.set(o,!1);continue}var z=Math.min(o.motion,T),D=Math.max(o.motion,T);o.motion=s._minBias*z+(1-s._minBias)*D,o.sleepThreshold>0&&o.motion<g?(o.sleepCounter+=1,o.sleepCounter>=o.sleepThreshold/x&&s.set(o,!0)):o.sleepCounter>0&&(o.sleepCounter-=1)}},s.afterCollisions=function(m){for(var r=s._motionSleepThreshold,x=0;x<m.length;x++){var g=m[x];if(g.isActive){var u=g.collision,o=u.bodyA.parent,f=u.bodyB.parent;if(!(o.isSleeping&&f.isSleeping||o.isStatic||f.isStatic)&&(o.isSleeping||f.isSleeping)){var y=o.isSleeping&&!o.isStatic?o:f,T=y===o?f:o;!y.isStatic&&T.motion>r&&s.set(y,!1)}}}},s.set=function(m,r){var x=m.isSleeping;r?(m.isSleeping=!0,m.sleepCounter=m.sleepThreshold,m.positionImpulse.x=0,m.positionImpulse.y=0,m.positionPrev.x=m.position.x,m.positionPrev.y=m.position.y,m.anglePrev=m.angle,m.speed=0,m.angularSpeed=0,m.motion=0,x||v.trigger(m,"sleepStart")):(m.isSleeping=!1,m.sleepCounter=0,x&&v.trigger(m,"sleepEnd"))}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(3),v=b(9);(function(){var c=[],m={overlap:0,axis:null},r={overlap:0,axis:null};s.create=function(x,g){return{pair:null,collided:!1,bodyA:x,bodyB:g,parentA:x.parent,parentB:g.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[null,null],supportCount:0}},s.collides=function(x,g,u){if(s._overlapAxes(m,x.vertices,g.vertices,x.axes),m.overlap<=0||(s._overlapAxes(r,g.vertices,x.vertices,g.axes),r.overlap<=0))return null;var o=u&&u.table[v.id(x,g)],f;o?f=o.collision:(f=s.create(x,g),f.collided=!0,f.bodyA=x.id<g.id?x:g,f.bodyB=x.id<g.id?g:x,f.parentA=f.bodyA.parent,f.parentB=f.bodyB.parent),x=f.bodyA,g=f.bodyB;var y;m.overlap<r.overlap?y=m:y=r;var T=f.normal,z=f.tangent,D=f.penetration,O=f.supports,S=y.overlap,M=y.axis,j=M.x,w=M.y,B=g.position.x-x.position.x,U=g.position.y-x.position.y;j*B+w*U>=0&&(j=-j,w=-w),T.x=j,T.y=w,z.x=-w,z.y=j,D.x=j*S,D.y=w*S,f.depth=S;var H=s._findSupports(x,g,T,1),E=0;if(p.contains(x.vertices,H[0])&&(O[E++]=H[0]),p.contains(x.vertices,H[1])&&(O[E++]=H[1]),E<2){var Q=s._findSupports(g,x,T,-1);p.contains(g.vertices,Q[0])&&(O[E++]=Q[0]),E<2&&p.contains(g.vertices,Q[1])&&(O[E++]=Q[1])}return E===0&&(O[E++]=H[0]),f.supportCount=E,f},s._overlapAxes=function(x,g,u,o){var f=g.length,y=u.length,T=g[0].x,z=g[0].y,D=u[0].x,O=u[0].y,S=o.length,M=Number.MAX_VALUE,j=0,w,B,U,H,E,Q;for(E=0;E<S;E++){var ee=o[E],P=ee.x,V=ee.y,K=T*P+z*V,le=D*P+O*V,re=K,me=le;for(Q=1;Q<f;Q+=1)H=g[Q].x*P+g[Q].y*V,H>re?re=H:H<K&&(K=H);for(Q=1;Q<y;Q+=1)H=u[Q].x*P+u[Q].y*V,H>me?me=H:H<le&&(le=H);if(B=re-le,U=me-K,w=B<U?B:U,w<M&&(M=w,j=E,w<=0))break}x.axis=o[j],x.overlap=M},s._findSupports=function(x,g,u,o){var f=g.vertices,y=f.length,T=x.position.x,z=x.position.y,D=u.x*o,O=u.y*o,S=f[0],M=S,j=D*(T-M.x)+O*(z-M.y),w,B,U;for(U=1;U<y;U+=1)M=f[U],B=D*(T-M.x)+O*(z-M.y),B<j&&(j=B,S=M);return w=f[(y+S.index-1)%y],j=D*(T-w.x)+O*(z-w.y),M=f[(S.index+1)%y],D*(T-M.x)+O*(z-M.y)<j?(c[0]=S,c[1]=M,c):(c[0]=S,c[1]=w,c)}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(16);(function(){s.create=function(v,c){var m=v.bodyA,r=v.bodyB,x={id:s.id(m,r),bodyA:m,bodyB:r,collision:v,contacts:[p.create(),p.create()],contactCount:0,separation:0,isActive:!0,isSensor:m.isSensor||r.isSensor,timeCreated:c,timeUpdated:c,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return s.update(x,v,c),x},s.update=function(v,c,m){var r=c.supports,x=c.supportCount,g=v.contacts,u=c.parentA,o=c.parentB;v.isActive=!0,v.timeUpdated=m,v.collision=c,v.separation=c.depth,v.inverseMass=u.inverseMass+o.inverseMass,v.friction=u.friction<o.friction?u.friction:o.friction,v.frictionStatic=u.frictionStatic>o.frictionStatic?u.frictionStatic:o.frictionStatic,v.restitution=u.restitution>o.restitution?u.restitution:o.restitution,v.slop=u.slop>o.slop?u.slop:o.slop,v.contactCount=x,c.pair=v;var f=r[0],y=g[0],T=r[1],z=g[1];(z.vertex===f||y.vertex===T)&&(g[1]=y,g[0]=y=z,z=g[1]),y.vertex=f,z.vertex=T},s.setActive=function(v,c,m){c?(v.isActive=!0,v.timeUpdated=m):(v.isActive=!1,v.contactCount=0)},s.id=function(v,c){return v.id<c.id?v.id.toString(36)+":"+c.id.toString(36):c.id.toString(36)+":"+v.id.toString(36)}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(3),v=b(2),c=b(7),m=b(1),r=b(11),x=b(0);(function(){s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(g){var u=g;u.bodyA&&!u.pointA&&(u.pointA={x:0,y:0}),u.bodyB&&!u.pointB&&(u.pointB={x:0,y:0});var o=u.bodyA?v.add(u.bodyA.position,u.pointA):u.pointA,f=u.bodyB?v.add(u.bodyB.position,u.pointB):u.pointB,y=v.magnitude(v.sub(o,f));u.length=typeof u.length<"u"?u.length:y,u.id=u.id||x.nextId(),u.label=u.label||"Constraint",u.type="constraint",u.stiffness=u.stiffness||(u.length>0?1:.7),u.damping=u.damping||0,u.angularStiffness=u.angularStiffness||0,u.angleA=u.bodyA?u.bodyA.angle:u.angleA,u.angleB=u.bodyB?u.bodyB.angle:u.angleB,u.plugin={};var T={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return u.length===0&&u.stiffness>.1?(T.type="pin",T.anchors=!1):u.stiffness<.9&&(T.type="spring"),u.render=x.extend(T,u.render),u},s.preSolveAll=function(g){for(var u=0;u<g.length;u+=1){var o=g[u],f=o.constraintImpulse;o.isStatic||f.x===0&&f.y===0&&f.angle===0||(o.position.x+=f.x,o.position.y+=f.y,o.angle+=f.angle)}},s.solveAll=function(g,u){for(var o=x.clamp(u/x._baseDelta,0,1),f=0;f<g.length;f+=1){var y=g[f],T=!y.bodyA||y.bodyA&&y.bodyA.isStatic,z=!y.bodyB||y.bodyB&&y.bodyB.isStatic;(T||z)&&s.solve(g[f],o)}for(f=0;f<g.length;f+=1)y=g[f],T=!y.bodyA||y.bodyA&&y.bodyA.isStatic,z=!y.bodyB||y.bodyB&&y.bodyB.isStatic,!T&&!z&&s.solve(g[f],o)},s.solve=function(g,u){var o=g.bodyA,f=g.bodyB,y=g.pointA,T=g.pointB;if(!(!o&&!f)){o&&!o.isStatic&&(v.rotate(y,o.angle-g.angleA,y),g.angleA=o.angle),f&&!f.isStatic&&(v.rotate(T,f.angle-g.angleB,T),g.angleB=f.angle);var z=y,D=T;if(o&&(z=v.add(o.position,y)),f&&(D=v.add(f.position,T)),!(!z||!D)){var O=v.sub(z,D),S=v.magnitude(O);S<s._minLength&&(S=s._minLength);var M=(S-g.length)/S,j=g.stiffness>=1||g.length===0,w=j?g.stiffness*u:g.stiffness*u*u,B=g.damping*u,U=v.mult(O,M*w),H=(o?o.inverseMass:0)+(f?f.inverseMass:0),E=(o?o.inverseInertia:0)+(f?f.inverseInertia:0),Q=H+E,ee,P,V,K,le;if(B>0){var re=v.create();V=v.div(O,S),le=v.sub(f&&v.sub(f.position,f.positionPrev)||re,o&&v.sub(o.position,o.positionPrev)||re),K=v.dot(V,le)}o&&!o.isStatic&&(P=o.inverseMass/H,o.constraintImpulse.x-=U.x*P,o.constraintImpulse.y-=U.y*P,o.position.x-=U.x*P,o.position.y-=U.y*P,B>0&&(o.positionPrev.x-=B*V.x*K*P,o.positionPrev.y-=B*V.y*K*P),ee=v.cross(y,U)/Q*s._torqueDampen*o.inverseInertia*(1-g.angularStiffness),o.constraintImpulse.angle-=ee,o.angle-=ee),f&&!f.isStatic&&(P=f.inverseMass/H,f.constraintImpulse.x+=U.x*P,f.constraintImpulse.y+=U.y*P,f.position.x+=U.x*P,f.position.y+=U.y*P,B>0&&(f.positionPrev.x+=B*V.x*K*P,f.positionPrev.y+=B*V.y*K*P),ee=v.cross(T,U)/Q*s._torqueDampen*f.inverseInertia*(1-g.angularStiffness),f.constraintImpulse.angle+=ee,f.angle+=ee)}}},s.postSolveAll=function(g){for(var u=0;u<g.length;u++){var o=g[u],f=o.constraintImpulse;if(!(o.isStatic||f.x===0&&f.y===0&&f.angle===0)){c.set(o,!1);for(var y=0;y<o.parts.length;y++){var T=o.parts[y];p.translate(T.vertices,f),y>0&&(T.position.x+=f.x,T.position.y+=f.y),f.angle!==0&&(p.rotate(T.vertices,f.angle,o.position),r.rotate(T.axes,f.angle),y>0&&v.rotateAbout(T.position,f.angle,o.position,T.position)),m.update(T.bounds,T.vertices,o.velocity)}f.angle*=s._warming,f.x*=s._warming,f.y*=s._warming}}},s.pointAWorld=function(g){return{x:(g.bodyA?g.bodyA.position.x:0)+(g.pointA?g.pointA.x:0),y:(g.bodyA?g.bodyA.position.y:0)+(g.pointA?g.pointA.y:0)}},s.pointBWorld=function(g){return{x:(g.bodyB?g.bodyB.position.x:0)+(g.pointB?g.pointB.x:0),y:(g.bodyB?g.bodyB.position.y:0)+(g.pointB?g.pointB.y:0)}},s.currentLength=function(g){var u=(g.bodyA?g.bodyA.position.x:0)+(g.pointA?g.pointA.x:0),o=(g.bodyA?g.bodyA.position.y:0)+(g.pointA?g.pointA.y:0),f=(g.bodyB?g.bodyB.position.x:0)+(g.pointB?g.pointB.x:0),y=(g.bodyB?g.bodyB.position.y:0)+(g.pointB?g.pointB.y:0),T=u-f,z=o-y;return Math.sqrt(T*T+z*z)}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(2),v=b(0);(function(){s.fromVertices=function(c){for(var m={},r=0;r<c.length;r++){var x=(r+1)%c.length,g=p.normalise({x:c[x].y-c[r].y,y:c[r].x-c[x].x}),u=g.y===0?1/0:g.x/g.y;u=u.toFixed(3).toString(),m[u]=g}return v.values(m)},s.rotate=function(c,m){if(m!==0)for(var r=Math.cos(m),x=Math.sin(m),g=0;g<c.length;g++){var u=c[g],o;o=u.x*r-u.y*x,u.y=u.x*x+u.y*r,u.x=o}}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(3),v=b(0),c=b(4),m=b(1),r=b(2);(function(){s.rectangle=function(x,g,u,o,f){f=f||{};var y={label:"Rectangle Body",position:{x,y:g},vertices:p.fromPath("L 0 0 L "+u+" 0 L "+u+" "+o+" L 0 "+o)};if(f.chamfer){var T=f.chamfer;y.vertices=p.chamfer(y.vertices,T.radius,T.quality,T.qualityMin,T.qualityMax),delete f.chamfer}return c.create(v.extend({},y,f))},s.trapezoid=function(x,g,u,o,f,y){y=y||{},f>=1&&v.warn("Bodies.trapezoid: slope parameter must be < 1."),f*=.5;var T=(1-f*2)*u,z=u*f,D=z+T,O=D+z,S;f<.5?S="L 0 0 L "+z+" "+-o+" L "+D+" "+-o+" L "+O+" 0":S="L 0 0 L "+D+" "+-o+" L "+O+" 0";var M={label:"Trapezoid Body",position:{x,y:g},vertices:p.fromPath(S)};if(y.chamfer){var j=y.chamfer;M.vertices=p.chamfer(M.vertices,j.radius,j.quality,j.qualityMin,j.qualityMax),delete y.chamfer}return c.create(v.extend({},M,y))},s.circle=function(x,g,u,o,f){o=o||{};var y={label:"Circle Body",circleRadius:u};f=f||25;var T=Math.ceil(Math.max(10,Math.min(f,u)));return T%2===1&&(T+=1),s.polygon(x,g,T,u,v.extend({},y,o))},s.polygon=function(x,g,u,o,f){if(f=f||{},u<3)return s.circle(x,g,o,f);for(var y=2*Math.PI/u,T="",z=y*.5,D=0;D<u;D+=1){var O=z+D*y,S=Math.cos(O)*o,M=Math.sin(O)*o;T+="L "+S.toFixed(3)+" "+M.toFixed(3)+" "}var j={label:"Polygon Body",position:{x,y:g},vertices:p.fromPath(T)};if(f.chamfer){var w=f.chamfer;j.vertices=p.chamfer(j.vertices,w.radius,w.quality,w.qualityMin,w.qualityMax),delete f.chamfer}return c.create(v.extend({},j,f))},s.fromVertices=function(x,g,u,o,f,y,T,z){var D=v.getDecomp(),O,S,M,j,w,B,U,H,E,Q,ee;for(O=!!(D&&D.quickDecomp),o=o||{},M=[],f=typeof f<"u"?f:!1,y=typeof y<"u"?y:.01,T=typeof T<"u"?T:10,z=typeof z<"u"?z:.01,v.isArray(u[0])||(u=[u]),Q=0;Q<u.length;Q+=1)if(B=u[Q],j=p.isConvex(B),w=!j,w&&!O&&v.warnOnce("Bodies.fromVertices: Install the 'poly-decomp' library and use Common.setDecomp or provide 'decomp' as a global to decompose concave vertices."),j||!O)j?B=p.clockwiseSort(B):B=p.hull(B),M.push({position:{x,y:g},vertices:B});else{var P=B.map(function(te){return[te.x,te.y]});D.makeCCW(P),y!==!1&&D.removeCollinearPoints(P,y),z!==!1&&D.removeDuplicatePoints&&D.removeDuplicatePoints(P,z);var V=D.quickDecomp(P);for(U=0;U<V.length;U++){var K=V[U],le=K.map(function(te){return{x:te[0],y:te[1]}});T>0&&p.area(le)<T||M.push({position:p.centre(le),vertices:le})}}for(U=0;U<M.length;U++)M[U]=c.create(v.extend(M[U],o));if(f){var re=5;for(U=0;U<M.length;U++){var me=M[U];for(H=U+1;H<M.length;H++){var Y=M[H];if(m.overlaps(me.bounds,Y.bounds)){var F=me.vertices,ae=Y.vertices;for(E=0;E<me.vertices.length;E++)for(ee=0;ee<Y.vertices.length;ee++){var se=r.magnitudeSquared(r.sub(F[(E+1)%F.length],ae[ee])),ne=r.magnitudeSquared(r.sub(F[E],ae[(ee+1)%ae.length]));se<re&&ne<re&&(F[E].isInternal=!0,ae[ee].isInternal=!0)}}}}}return M.length>1?(S=c.create(v.extend({parts:M.slice(0)},o)),c.setPosition(S,{x,y:g}),S):M[0]}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(0),v=b(8);(function(){s.create=function(c){var m={bodies:[],collisions:[],pairs:null};return p.extend(m,c)},s.setBodies=function(c,m){c.bodies=m.slice(0)},s.clear=function(c){c.bodies=[],c.collisions=[]},s.collisions=function(c){var m=c.pairs,r=c.bodies,x=r.length,g=s.canCollide,u=v.collides,o=c.collisions,f=0,y,T;for(r.sort(s._compareBoundsX),y=0;y<x;y++){var z=r[y],D=z.bounds,O=z.bounds.max.x,S=z.bounds.max.y,M=z.bounds.min.y,j=z.isStatic||z.isSleeping,w=z.parts.length,B=w===1;for(T=y+1;T<x;T++){var U=r[T],H=U.bounds;if(H.min.x>O)break;if(!(S<H.min.y||M>H.max.y)&&!(j&&(U.isStatic||U.isSleeping))&&g(z.collisionFilter,U.collisionFilter)){var E=U.parts.length;if(B&&E===1){var Q=u(z,U,m);Q&&(o[f++]=Q)}else for(var ee=w>1?1:0,P=E>1?1:0,V=ee;V<w;V++)for(var K=z.parts[V],D=K.bounds,le=P;le<E;le++){var re=U.parts[le],H=re.bounds;if(!(D.min.x>H.max.x||D.max.x<H.min.x||D.max.y<H.min.y||D.min.y>H.max.y)){var Q=u(K,re,m);Q&&(o[f++]=Q)}}}}}return o.length!==f&&(o.length=f),o},s.canCollide=function(c,m){return c.group===m.group&&c.group!==0?c.group>0:(c.mask&m.category)!==0&&(m.mask&c.category)!==0},s._compareBoundsX=function(c,m){return c.bounds.min.x-m.bounds.min.x}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(0);(function(){s.create=function(v){var c={};return v||p.log("Mouse.create: element was undefined, defaulting to document.body","warn"),c.element=v||document.body,c.absolute={x:0,y:0},c.position={x:0,y:0},c.mousedownPosition={x:0,y:0},c.mouseupPosition={x:0,y:0},c.offset={x:0,y:0},c.scale={x:1,y:1},c.wheelDelta=0,c.button=-1,c.pixelRatio=parseInt(c.element.getAttribute("data-pixel-ratio"),10)||1,c.sourceEvents={mousemove:null,mousedown:null,mouseup:null,mousewheel:null},c.mousemove=function(m){var r=s._getRelativeMousePosition(m,c.element,c.pixelRatio),x=m.changedTouches;x&&(c.button=0,m.preventDefault()),c.absolute.x=r.x,c.absolute.y=r.y,c.position.x=c.absolute.x*c.scale.x+c.offset.x,c.position.y=c.absolute.y*c.scale.y+c.offset.y,c.sourceEvents.mousemove=m},c.mousedown=function(m){var r=s._getRelativeMousePosition(m,c.element,c.pixelRatio),x=m.changedTouches;x?(c.button=0,m.preventDefault()):c.button=m.button,c.absolute.x=r.x,c.absolute.y=r.y,c.position.x=c.absolute.x*c.scale.x+c.offset.x,c.position.y=c.absolute.y*c.scale.y+c.offset.y,c.mousedownPosition.x=c.position.x,c.mousedownPosition.y=c.position.y,c.sourceEvents.mousedown=m},c.mouseup=function(m){var r=s._getRelativeMousePosition(m,c.element,c.pixelRatio),x=m.changedTouches;x&&m.preventDefault(),c.button=-1,c.absolute.x=r.x,c.absolute.y=r.y,c.position.x=c.absolute.x*c.scale.x+c.offset.x,c.position.y=c.absolute.y*c.scale.y+c.offset.y,c.mouseupPosition.x=c.position.x,c.mouseupPosition.y=c.position.y,c.sourceEvents.mouseup=m},c.mousewheel=function(m){c.wheelDelta=Math.max(-1,Math.min(1,m.wheelDelta||-m.detail)),m.preventDefault(),c.sourceEvents.mousewheel=m},s.setElement(c,c.element),c},s.setElement=function(v,c){v.element=c,c.addEventListener("mousemove",v.mousemove,{passive:!0}),c.addEventListener("mousedown",v.mousedown,{passive:!0}),c.addEventListener("mouseup",v.mouseup,{passive:!0}),c.addEventListener("wheel",v.mousewheel,{passive:!1}),c.addEventListener("touchmove",v.mousemove,{passive:!1}),c.addEventListener("touchstart",v.mousedown,{passive:!1}),c.addEventListener("touchend",v.mouseup,{passive:!1})},s.clearSourceEvents=function(v){v.sourceEvents.mousemove=null,v.sourceEvents.mousedown=null,v.sourceEvents.mouseup=null,v.sourceEvents.mousewheel=null,v.wheelDelta=0},s.setOffset=function(v,c){v.offset.x=c.x,v.offset.y=c.y,v.position.x=v.absolute.x*v.scale.x+v.offset.x,v.position.y=v.absolute.y*v.scale.y+v.offset.y},s.setScale=function(v,c){v.scale.x=c.x,v.scale.y=c.y,v.position.x=v.absolute.x*v.scale.x+v.offset.x,v.position.y=v.absolute.y*v.scale.y+v.offset.y},s._getRelativeMousePosition=function(v,c,m){var r=c.getBoundingClientRect(),x=document.documentElement||document.body.parentNode||document.body,g=window.pageXOffset!==void 0?window.pageXOffset:x.scrollLeft,u=window.pageYOffset!==void 0?window.pageYOffset:x.scrollTop,o=v.changedTouches,f,y;return o?(f=o[0].pageX-r.left-g,y=o[0].pageY-r.top-u):(f=v.pageX-r.left-g,y=v.pageY-r.top-u),{x:f/(c.clientWidth/(c.width||c.clientWidth)*m),y:y/(c.clientHeight/(c.height||c.clientHeight)*m)}}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(0);(function(){s._registry={},s.register=function(v){if(s.isPlugin(v)||p.warn("Plugin.register:",s.toString(v),"does not implement all required fields."),v.name in s._registry){var c=s._registry[v.name],m=s.versionParse(v.version).number,r=s.versionParse(c.version).number;m>r?(p.warn("Plugin.register:",s.toString(c),"was upgraded to",s.toString(v)),s._registry[v.name]=v):m<r?p.warn("Plugin.register:",s.toString(c),"can not be downgraded to",s.toString(v)):v!==c&&p.warn("Plugin.register:",s.toString(v),"is already registered to different plugin object")}else s._registry[v.name]=v;return v},s.resolve=function(v){return s._registry[s.dependencyParse(v).name]},s.toString=function(v){return typeof v=="string"?v:(v.name||"anonymous")+"@"+(v.version||v.range||"0.0.0")},s.isPlugin=function(v){return v&&v.name&&v.version&&v.install},s.isUsed=function(v,c){return v.used.indexOf(c)>-1},s.isFor=function(v,c){var m=v.for&&s.dependencyParse(v.for);return!v.for||c.name===m.name&&s.versionSatisfies(c.version,m.range)},s.use=function(v,c){if(v.uses=(v.uses||[]).concat(c||[]),v.uses.length===0){p.warn("Plugin.use:",s.toString(v),"does not specify any dependencies to install.");return}for(var m=s.dependencies(v),r=p.topologicalSort(m),x=[],g=0;g<r.length;g+=1)if(r[g]!==v.name){var u=s.resolve(r[g]);if(!u){x.push("❌ "+r[g]);continue}s.isUsed(v,u.name)||(s.isFor(u,v)||(p.warn("Plugin.use:",s.toString(u),"is for",u.for,"but installed on",s.toString(v)+"."),u._warned=!0),u.install?u.install(v):(p.warn("Plugin.use:",s.toString(u),"does not specify an install function."),u._warned=!0),u._warned?(x.push("🔶 "+s.toString(u)),delete u._warned):x.push("✅ "+s.toString(u)),v.used.push(u.name))}x.length>0&&p.info(x.join(" "))},s.dependencies=function(v,c){var m=s.dependencyParse(v),r=m.name;if(c=c||{},!(r in c)){v=s.resolve(v)||v,c[r]=p.map(v.uses||[],function(g){s.isPlugin(g)&&s.register(g);var u=s.dependencyParse(g),o=s.resolve(g);return o&&!s.versionSatisfies(o.version,u.range)?(p.warn("Plugin.dependencies:",s.toString(o),"does not satisfy",s.toString(u),"used by",s.toString(m)+"."),o._warned=!0,v._warned=!0):o||(p.warn("Plugin.dependencies:",s.toString(g),"used by",s.toString(m),"could not be resolved."),v._warned=!0),u.name});for(var x=0;x<c[r].length;x+=1)s.dependencies(c[r][x],c);return c}},s.dependencyParse=function(v){if(p.isString(v)){var c=/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/;return c.test(v)||p.warn("Plugin.dependencyParse:",v,"is not a valid dependency string."),{name:v.split("@")[0],range:v.split("@")[1]||"*"}}return{name:v.name,range:v.range||v.version}},s.versionParse=function(v){var c=/^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;c.test(v)||p.warn("Plugin.versionParse:",v,"is not a valid version or range.");var m=c.exec(v),r=Number(m[4]),x=Number(m[5]),g=Number(m[6]);return{isRange:!!(m[1]||m[2]),version:m[3],range:v,operator:m[1]||m[2]||"",major:r,minor:x,patch:g,parts:[r,x,g],prerelease:m[7],number:r*1e8+x*1e4+g}},s.versionSatisfies=function(v,c){c=c||"*";var m=s.versionParse(c),r=s.versionParse(v);if(m.isRange){if(m.operator==="*"||v==="*")return!0;if(m.operator===">")return r.number>m.number;if(m.operator===">=")return r.number>=m.number;if(m.operator==="~")return r.major===m.major&&r.minor===m.minor&&r.patch>=m.patch;if(m.operator==="^")return m.major>0?r.major===m.major&&r.number>=m.number:m.minor>0?r.minor===m.minor&&r.patch>=m.patch:r.patch===m.patch}return v===c||v==="*"}})()}),(function(R,C){var b={};R.exports=b,(function(){b.create=function(s){return{vertex:s,normalImpulse:0,tangentImpulse:0}}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(7),v=b(18),c=b(13),m=b(19),r=b(5),x=b(6),g=b(10),u=b(0),o=b(4);(function(){s._deltaMax=1e3/60,s.create=function(f){f=f||{};var y={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0,lastUpdatesPerFrame:0}},T=u.extend(y,f);return T.world=f.world||x.create({label:"World"}),T.pairs=f.pairs||m.create(),T.detector=f.detector||c.create(),T.detector.pairs=T.pairs,T.grid={buckets:[]},T.world.gravity=T.gravity,T.broadphase=T.grid,T.metrics={},T},s.update=function(f,y){var T=u.now(),z=f.world,D=f.detector,O=f.pairs,S=f.timing,M=S.timestamp,j;y>s._deltaMax&&u.warnOnce("Matter.Engine.update: delta argument is recommended to be less than or equal to",s._deltaMax.toFixed(3),"ms."),y=typeof y<"u"?y:u._baseDelta,y*=S.timeScale,S.timestamp+=y,S.lastDelta=y;var w={timestamp:S.timestamp,delta:y};r.trigger(f,"beforeUpdate",w);var B=x.allBodies(z),U=x.allConstraints(z);for(z.isModified&&(c.setBodies(D,B),x.setModified(z,!1,!1,!0)),f.enableSleeping&&p.update(B,y),s._bodiesApplyGravity(B,f.gravity),y>0&&s._bodiesUpdate(B,y),r.trigger(f,"beforeSolve",w),g.preSolveAll(B),j=0;j<f.constraintIterations;j++)g.solveAll(U,y);g.postSolveAll(B);var H=c.collisions(D);m.update(O,H,M),f.enableSleeping&&p.afterCollisions(O.list),O.collisionStart.length>0&&r.trigger(f,"collisionStart",{pairs:O.collisionStart,timestamp:S.timestamp,delta:y});var E=u.clamp(20/f.positionIterations,0,1);for(v.preSolvePosition(O.list),j=0;j<f.positionIterations;j++)v.solvePosition(O.list,y,E);for(v.postSolvePosition(B),g.preSolveAll(B),j=0;j<f.constraintIterations;j++)g.solveAll(U,y);for(g.postSolveAll(B),v.preSolveVelocity(O.list),j=0;j<f.velocityIterations;j++)v.solveVelocity(O.list,y);return s._bodiesUpdateVelocities(B),O.collisionActive.length>0&&r.trigger(f,"collisionActive",{pairs:O.collisionActive,timestamp:S.timestamp,delta:y}),O.collisionEnd.length>0&&r.trigger(f,"collisionEnd",{pairs:O.collisionEnd,timestamp:S.timestamp,delta:y}),s._bodiesClearForces(B),r.trigger(f,"afterUpdate",w),f.timing.lastElapsed=u.now()-T,f},s.merge=function(f,y){if(u.extend(f,y),y.world){f.world=y.world,s.clear(f);for(var T=x.allBodies(f.world),z=0;z<T.length;z++){var D=T[z];p.set(D,!1),D.id=u.nextId()}}},s.clear=function(f){m.clear(f.pairs),c.clear(f.detector)},s._bodiesClearForces=function(f){for(var y=f.length,T=0;T<y;T++){var z=f[T];z.force.x=0,z.force.y=0,z.torque=0}},s._bodiesApplyGravity=function(f,y){var T=typeof y.scale<"u"?y.scale:.001,z=f.length;if(!(y.x===0&&y.y===0||T===0))for(var D=0;D<z;D++){var O=f[D];O.isStatic||O.isSleeping||(O.force.y+=O.mass*y.y*T,O.force.x+=O.mass*y.x*T)}},s._bodiesUpdate=function(f,y){for(var T=f.length,z=0;z<T;z++){var D=f[z];D.isStatic||D.isSleeping||o.update(D,y)}},s._bodiesUpdateVelocities=function(f){for(var y=f.length,T=0;T<y;T++)o.updateVelocities(f[T])}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(3),v=b(0),c=b(1);(function(){s._restingThresh=2,s._restingThreshTangent=Math.sqrt(6),s._positionDampen=.9,s._positionWarming=.8,s._frictionNormalMultiplier=5,s._frictionMaxStatic=Number.MAX_VALUE,s.preSolvePosition=function(m){var r,x,g,u=m.length;for(r=0;r<u;r++)x=m[r],x.isActive&&(g=x.contactCount,x.collision.parentA.totalContacts+=g,x.collision.parentB.totalContacts+=g)},s.solvePosition=function(m,r,x){var g,u,o,f,y,T,z,D,O=s._positionDampen*(x||1),S=v.clamp(r/v._baseDelta,0,1),M=m.length;for(g=0;g<M;g++)u=m[g],!(!u.isActive||u.isSensor)&&(o=u.collision,f=o.parentA,y=o.parentB,T=o.normal,u.separation=o.depth+T.x*(y.positionImpulse.x-f.positionImpulse.x)+T.y*(y.positionImpulse.y-f.positionImpulse.y));for(g=0;g<M;g++)u=m[g],!(!u.isActive||u.isSensor)&&(o=u.collision,f=o.parentA,y=o.parentB,T=o.normal,D=u.separation-u.slop*S,(f.isStatic||y.isStatic)&&(D*=2),f.isStatic||f.isSleeping||(z=O/f.totalContacts,f.positionImpulse.x+=T.x*D*z,f.positionImpulse.y+=T.y*D*z),y.isStatic||y.isSleeping||(z=O/y.totalContacts,y.positionImpulse.x-=T.x*D*z,y.positionImpulse.y-=T.y*D*z))},s.postSolvePosition=function(m){for(var r=s._positionWarming,x=m.length,g=p.translate,u=c.update,o=0;o<x;o++){var f=m[o],y=f.positionImpulse,T=y.x,z=y.y,D=f.velocity;if(f.totalContacts=0,T!==0||z!==0){for(var O=0;O<f.parts.length;O++){var S=f.parts[O];g(S.vertices,y),u(S.bounds,S.vertices,D),S.position.x+=T,S.position.y+=z}f.positionPrev.x+=T,f.positionPrev.y+=z,T*D.x+z*D.y<0?(y.x=0,y.y=0):(y.x*=r,y.y*=r)}}},s.preSolveVelocity=function(m){var r=m.length,x,g;for(x=0;x<r;x++){var u=m[x];if(!(!u.isActive||u.isSensor)){var o=u.contacts,f=u.contactCount,y=u.collision,T=y.parentA,z=y.parentB,D=y.normal,O=y.tangent;for(g=0;g<f;g++){var S=o[g],M=S.vertex,j=S.normalImpulse,w=S.tangentImpulse;if(j!==0||w!==0){var B=D.x*j+O.x*w,U=D.y*j+O.y*w;T.isStatic||T.isSleeping||(T.positionPrev.x+=B*T.inverseMass,T.positionPrev.y+=U*T.inverseMass,T.anglePrev+=T.inverseInertia*((M.x-T.position.x)*U-(M.y-T.position.y)*B)),z.isStatic||z.isSleeping||(z.positionPrev.x-=B*z.inverseMass,z.positionPrev.y-=U*z.inverseMass,z.anglePrev-=z.inverseInertia*((M.x-z.position.x)*U-(M.y-z.position.y)*B))}}}}},s.solveVelocity=function(m,r){var x=r/v._baseDelta,g=x*x,u=g*x,o=-s._restingThresh*x,f=s._restingThreshTangent,y=s._frictionNormalMultiplier*x,T=s._frictionMaxStatic,z=m.length,D,O,S,M;for(S=0;S<z;S++){var j=m[S];if(!(!j.isActive||j.isSensor)){var w=j.collision,B=w.parentA,U=w.parentB,H=w.normal.x,E=w.normal.y,Q=w.tangent.x,ee=w.tangent.y,P=j.inverseMass,V=j.friction*j.frictionStatic*y,K=j.contacts,le=j.contactCount,re=1/le,me=B.position.x-B.positionPrev.x,Y=B.position.y-B.positionPrev.y,F=B.angle-B.anglePrev,ae=U.position.x-U.positionPrev.x,se=U.position.y-U.positionPrev.y,ne=U.angle-U.anglePrev;for(M=0;M<le;M++){var te=K[M],fe=te.vertex,he=fe.x-B.position.x,we=fe.y-B.position.y,$e=fe.x-U.position.x,Le=fe.y-U.position.y,Qe=me-we*F,nl=Y+he*F,Qt=ae-Le*ne,Jl=se+$e*ne,il=Qe-Qt,Qn=nl-Jl,sl=H*il+E*Qn,pt=Q*il+ee*Qn,ul=j.separation+sl,Ba=Math.min(ul,1);Ba=ul<0?0:Ba;var Zn=Ba*V;pt<-Zn||pt>Zn?(O=pt>0?pt:-pt,D=j.friction*(pt>0?1:-1)*u,D<-O?D=-O:D>O&&(D=O)):(D=pt,O=T);var Kn=he*E-we*H,it=$e*E-Le*H,Jn=re/(P+B.inverseInertia*Kn*Kn+U.inverseInertia*it*it),Ha=(1+j.restitution)*sl*Jn;if(D*=Jn,sl<o)te.normalImpulse=0;else{var Fn=te.normalImpulse;te.normalImpulse+=Ha,te.normalImpulse>0&&(te.normalImpulse=0),Ha=te.normalImpulse-Fn}if(pt<-f||pt>f)te.tangentImpulse=0;else{var rl=te.tangentImpulse;te.tangentImpulse+=D,te.tangentImpulse<-O&&(te.tangentImpulse=-O),te.tangentImpulse>O&&(te.tangentImpulse=O),D=te.tangentImpulse-rl}var cl=H*Ha+Q*D,_a=E*Ha+ee*D;B.isStatic||B.isSleeping||(B.positionPrev.x+=cl*B.inverseMass,B.positionPrev.y+=_a*B.inverseMass,B.anglePrev+=(he*_a-we*cl)*B.inverseInertia),U.isStatic||U.isSleeping||(U.positionPrev.x-=cl*U.inverseMass,U.positionPrev.y-=_a*U.inverseMass,U.anglePrev-=($e*_a-Le*cl)*U.inverseInertia)}}}}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(9),v=b(0);(function(){s.create=function(c){return v.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},c)},s.update=function(c,m,r){var x=p.update,g=p.create,u=p.setActive,o=c.table,f=c.list,y=f.length,T=y,z=c.collisionStart,D=c.collisionEnd,O=c.collisionActive,S=m.length,M=0,j=0,w=0,B,U,H;for(H=0;H<S;H++)B=m[H],U=B.pair,U?(U.isActive&&(O[w++]=U),x(U,B,r)):(U=g(B,r),o[U.id]=U,z[M++]=U,f[T++]=U);for(T=0,y=f.length,H=0;H<y;H++)U=f[H],U.timeUpdated>=r?f[T++]=U:(u(U,!1,r),U.collision.bodyA.sleepCounter>0&&U.collision.bodyB.sleepCounter>0?f[T++]=U:(D[j++]=U,delete o[U.id]));f.length!==T&&(f.length=T),z.length!==M&&(z.length=M),D.length!==j&&(D.length=j),O.length!==w&&(O.length=w)},s.clear=function(c){return c.table={},c.list.length=0,c.collisionStart.length=0,c.collisionActive.length=0,c.collisionEnd.length=0,c}})()}),(function(R,C,b){var s=R.exports=b(21);s.Axes=b(11),s.Bodies=b(12),s.Body=b(4),s.Bounds=b(1),s.Collision=b(8),s.Common=b(0),s.Composite=b(6),s.Composites=b(22),s.Constraint=b(10),s.Contact=b(16),s.Detector=b(13),s.Engine=b(17),s.Events=b(5),s.Grid=b(23),s.Mouse=b(14),s.MouseConstraint=b(24),s.Pair=b(9),s.Pairs=b(19),s.Plugin=b(15),s.Query=b(25),s.Render=b(26),s.Resolver=b(18),s.Runner=b(27),s.SAT=b(28),s.Sleeping=b(7),s.Svg=b(29),s.Vector=b(2),s.Vertices=b(3),s.World=b(30),s.Engine.run=s.Runner.run,s.Common.deprecated(s.Engine,"run","Engine.run ➤ use Matter.Runner.run(engine) instead")}),(function(R,C,b){var s={};R.exports=s;var p=b(15),v=b(0);(function(){s.name="matter-js",s.version="0.20.0",s.uses=[],s.used=[],s.use=function(){p.use(s,Array.prototype.slice.call(arguments))},s.before=function(c,m){return c=c.replace(/^Matter./,""),v.chainPathBefore(s,c,m)},s.after=function(c,m){return c=c.replace(/^Matter./,""),v.chainPathAfter(s,c,m)}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(6),v=b(10),c=b(0),m=b(4),r=b(12),x=c.deprecated;(function(){s.stack=function(g,u,o,f,y,T,z){for(var D=p.create({label:"Stack"}),O=g,S=u,M,j=0,w=0;w<f;w++){for(var B=0,U=0;U<o;U++){var H=z(O,S,U,w,M,j);if(H){var E=H.bounds.max.y-H.bounds.min.y,Q=H.bounds.max.x-H.bounds.min.x;E>B&&(B=E),m.translate(H,{x:Q*.5,y:E*.5}),O=H.bounds.max.x+y,p.addBody(D,H),M=H,j+=1}else O+=y}S+=B+T,O=g}return D},s.chain=function(g,u,o,f,y,T){for(var z=g.bodies,D=1;D<z.length;D++){var O=z[D-1],S=z[D],M=O.bounds.max.y-O.bounds.min.y,j=O.bounds.max.x-O.bounds.min.x,w=S.bounds.max.y-S.bounds.min.y,B=S.bounds.max.x-S.bounds.min.x,U={bodyA:O,pointA:{x:j*u,y:M*o},bodyB:S,pointB:{x:B*f,y:w*y}},H=c.extend(U,T);p.addConstraint(g,v.create(H))}return g.label+=" Chain",g},s.mesh=function(g,u,o,f,y){var T=g.bodies,z,D,O,S,M;for(z=0;z<o;z++){for(D=1;D<u;D++)O=T[D-1+z*u],S=T[D+z*u],p.addConstraint(g,v.create(c.extend({bodyA:O,bodyB:S},y)));if(z>0)for(D=0;D<u;D++)O=T[D+(z-1)*u],S=T[D+z*u],p.addConstraint(g,v.create(c.extend({bodyA:O,bodyB:S},y))),f&&D>0&&(M=T[D-1+(z-1)*u],p.addConstraint(g,v.create(c.extend({bodyA:M,bodyB:S},y)))),f&&D<u-1&&(M=T[D+1+(z-1)*u],p.addConstraint(g,v.create(c.extend({bodyA:M,bodyB:S},y))))}return g.label+=" Mesh",g},s.pyramid=function(g,u,o,f,y,T,z){return s.stack(g,u,o,f,y,T,function(D,O,S,M,j,w){var B=Math.min(f,Math.ceil(o/2)),U=j?j.bounds.max.x-j.bounds.min.x:0;if(!(M>B)){M=B-M;var H=M,E=o-1-M;if(!(S<H||S>E)){w===1&&m.translate(j,{x:(S+(o%2===1?1:-1))*U,y:0});var Q=j?S*U:0;return z(g+Q+S*y,O,S,M,j,w)}}})},s.newtonsCradle=function(g,u,o,f,y){for(var T=p.create({label:"Newtons Cradle"}),z=0;z<o;z++){var D=1.9,O=r.circle(g+z*(f*D),u+y,f,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),S=v.create({pointA:{x:g+z*(f*D),y:u},bodyB:O});p.addBody(T,O),p.addConstraint(T,S)}return T},x(s,"newtonsCradle","Composites.newtonsCradle ➤ moved to newtonsCradle example"),s.car=function(g,u,o,f,y){var T=m.nextGroup(!0),z=20,D=-o*.5+z,O=o*.5-z,S=0,M=p.create({label:"Car"}),j=r.rectangle(g,u,o,f,{collisionFilter:{group:T},chamfer:{radius:f*.5},density:2e-4}),w=r.circle(g+D,u+S,y,{collisionFilter:{group:T},friction:.8}),B=r.circle(g+O,u+S,y,{collisionFilter:{group:T},friction:.8}),U=v.create({bodyB:j,pointB:{x:D,y:S},bodyA:w,stiffness:1,length:0}),H=v.create({bodyB:j,pointB:{x:O,y:S},bodyA:B,stiffness:1,length:0});return p.addBody(M,j),p.addBody(M,w),p.addBody(M,B),p.addConstraint(M,U),p.addConstraint(M,H),M},x(s,"car","Composites.car ➤ moved to car example"),s.softBody=function(g,u,o,f,y,T,z,D,O,S){O=c.extend({inertia:1/0},O),S=c.extend({stiffness:.2,render:{type:"line",anchors:!1}},S);var M=s.stack(g,u,o,f,y,T,function(j,w){return r.circle(j,w,D,O)});return s.mesh(M,o,f,z,S),M.label="Soft Body",M},x(s,"softBody","Composites.softBody ➤ moved to softBody and cloth examples")})()}),(function(R,C,b){var s={};R.exports=s;var p=b(9),v=b(0),c=v.deprecated;(function(){s.create=function(m){var r={buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return v.extend(r,m)},s.update=function(m,r,x,g){var u,o,f,y=x.world,T=m.buckets,z,D,O=!1;for(u=0;u<r.length;u++){var S=r[u];if(!(S.isSleeping&&!g)&&!(y.bounds&&(S.bounds.max.x<y.bounds.min.x||S.bounds.min.x>y.bounds.max.x||S.bounds.max.y<y.bounds.min.y||S.bounds.min.y>y.bounds.max.y))){var M=s._getRegion(m,S);if(!S.region||M.id!==S.region.id||g){(!S.region||g)&&(S.region=M);var j=s._regionUnion(M,S.region);for(o=j.startCol;o<=j.endCol;o++)for(f=j.startRow;f<=j.endRow;f++){D=s._getBucketId(o,f),z=T[D];var w=o>=M.startCol&&o<=M.endCol&&f>=M.startRow&&f<=M.endRow,B=o>=S.region.startCol&&o<=S.region.endCol&&f>=S.region.startRow&&f<=S.region.endRow;!w&&B&&B&&z&&s._bucketRemoveBody(m,z,S),(S.region===M||w&&!B||g)&&(z||(z=s._createBucket(T,D)),s._bucketAddBody(m,z,S))}S.region=M,O=!0}}}O&&(m.pairsList=s._createActivePairsList(m))},c(s,"update","Grid.update ➤ replaced by Matter.Detector"),s.clear=function(m){m.buckets={},m.pairs={},m.pairsList=[]},c(s,"clear","Grid.clear ➤ replaced by Matter.Detector"),s._regionUnion=function(m,r){var x=Math.min(m.startCol,r.startCol),g=Math.max(m.endCol,r.endCol),u=Math.min(m.startRow,r.startRow),o=Math.max(m.endRow,r.endRow);return s._createRegion(x,g,u,o)},s._getRegion=function(m,r){var x=r.bounds,g=Math.floor(x.min.x/m.bucketWidth),u=Math.floor(x.max.x/m.bucketWidth),o=Math.floor(x.min.y/m.bucketHeight),f=Math.floor(x.max.y/m.bucketHeight);return s._createRegion(g,u,o,f)},s._createRegion=function(m,r,x,g){return{id:m+","+r+","+x+","+g,startCol:m,endCol:r,startRow:x,endRow:g}},s._getBucketId=function(m,r){return"C"+m+"R"+r},s._createBucket=function(m,r){var x=m[r]=[];return x},s._bucketAddBody=function(m,r,x){var g=m.pairs,u=p.id,o=r.length,f;for(f=0;f<o;f++){var y=r[f];if(!(x.id===y.id||x.isStatic&&y.isStatic)){var T=u(x,y),z=g[T];z?z[2]+=1:g[T]=[x,y,1]}}r.push(x)},s._bucketRemoveBody=function(m,r,x){var g=m.pairs,u=p.id,o;r.splice(v.indexOf(r,x),1);var f=r.length;for(o=0;o<f;o++){var y=g[u(x,r[o])];y&&(y[2]-=1)}},s._createActivePairsList=function(m){var r,x=m.pairs,g=v.keys(x),u=g.length,o=[],f;for(f=0;f<u;f++)r=x[g[f]],r[2]>0?o.push(r):delete x[g[f]];return o}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(3),v=b(7),c=b(14),m=b(5),r=b(13),x=b(10),g=b(6),u=b(0),o=b(1);(function(){s.create=function(f,y){var T=(f?f.mouse:null)||(y?y.mouse:null);T||(f&&f.render&&f.render.canvas?T=c.create(f.render.canvas):y&&y.element?T=c.create(y.element):(T=c.create(),u.warn("MouseConstraint.create: options.mouse was undefined, options.element was undefined, may not function as expected")));var z=x.create({label:"Mouse Constraint",pointA:T.position,pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,render:{strokeStyle:"#90EE90",lineWidth:3}}),D={type:"mouseConstraint",mouse:T,element:null,body:null,constraint:z,collisionFilter:{category:1,mask:4294967295,group:0}},O=u.extend(D,y);return m.on(f,"beforeUpdate",function(){var S=g.allBodies(f.world);s.update(O,S),s._triggerEvents(O)}),O},s.update=function(f,y){var T=f.mouse,z=f.constraint,D=f.body;if(T.button===0){if(z.bodyB)v.set(z.bodyB,!1),z.pointA=T.position;else for(var O=0;O<y.length;O++)if(D=y[O],o.contains(D.bounds,T.position)&&r.canCollide(D.collisionFilter,f.collisionFilter))for(var S=D.parts.length>1?1:0;S<D.parts.length;S++){var M=D.parts[S];if(p.contains(M.vertices,T.position)){z.pointA=T.position,z.bodyB=f.body=D,z.pointB={x:T.position.x-D.position.x,y:T.position.y-D.position.y},z.angleB=D.angle,v.set(D,!1),m.trigger(f,"startdrag",{mouse:T,body:D});break}}}else z.bodyB=f.body=null,z.pointB=null,D&&m.trigger(f,"enddrag",{mouse:T,body:D})},s._triggerEvents=function(f){var y=f.mouse,T=y.sourceEvents;T.mousemove&&m.trigger(f,"mousemove",{mouse:y}),T.mousedown&&m.trigger(f,"mousedown",{mouse:y}),T.mouseup&&m.trigger(f,"mouseup",{mouse:y}),c.clearSourceEvents(y)}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(2),v=b(8),c=b(1),m=b(12),r=b(3);(function(){s.collides=function(x,g){for(var u=[],o=g.length,f=x.bounds,y=v.collides,T=c.overlaps,z=0;z<o;z++){var D=g[z],O=D.parts.length,S=O===1?0:1;if(T(D.bounds,f))for(var M=S;M<O;M++){var j=D.parts[M];if(T(j.bounds,f)){var w=y(j,x);if(w){u.push(w);break}}}}return u},s.ray=function(x,g,u,o){o=o||1e-100;for(var f=p.angle(g,u),y=p.magnitude(p.sub(g,u)),T=(u.x+g.x)*.5,z=(u.y+g.y)*.5,D=m.rectangle(T,z,y,o,{angle:f}),O=s.collides(D,x),S=0;S<O.length;S+=1){var M=O[S];M.body=M.bodyB=M.bodyA}return O},s.region=function(x,g,u){for(var o=[],f=0;f<x.length;f++){var y=x[f],T=c.overlaps(y.bounds,g);(T&&!u||!T&&u)&&o.push(y)}return o},s.point=function(x,g){for(var u=[],o=0;o<x.length;o++){var f=x[o];if(c.contains(f.bounds,g))for(var y=f.parts.length===1?0:1;y<f.parts.length;y++){var T=f.parts[y];if(c.contains(T.bounds,g)&&r.contains(T.vertices,g)){u.push(f);break}}}return u}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(4),v=b(0),c=b(6),m=b(1),r=b(5),x=b(2),g=b(14);(function(){var u,o;typeof window<"u"&&(u=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(S){window.setTimeout(function(){S(v.now())},1e3/60)},o=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),s._goodFps=30,s._goodDelta=1e3/60,s.create=function(S){var M={engine:null,element:null,canvas:null,mouse:null,frameRequestId:null,timing:{historySize:60,delta:0,deltaHistory:[],lastTime:0,lastTimestamp:0,lastElapsed:0,timestampElapsed:0,timestampElapsedHistory:[],engineDeltaHistory:[],engineElapsedHistory:[],engineUpdatesHistory:[],elapsedHistory:[]},options:{width:800,height:600,pixelRatio:1,background:"#14151f",wireframeBackground:"#14151f",wireframeStrokeStyle:"#bbb",hasBounds:!!S.bounds,enabled:!0,wireframes:!0,showSleeping:!0,showDebug:!1,showStats:!1,showPerformance:!1,showBounds:!1,showVelocity:!1,showCollisions:!1,showSeparations:!1,showAxes:!1,showPositions:!1,showAngleIndicator:!1,showIds:!1,showVertexNumbers:!1,showConvexHulls:!1,showInternalEdges:!1,showMousePosition:!1}},j=v.extend(M,S);return j.canvas&&(j.canvas.width=j.options.width||j.canvas.width,j.canvas.height=j.options.height||j.canvas.height),j.mouse=S.mouse,j.engine=S.engine,j.canvas=j.canvas||T(j.options.width,j.options.height),j.context=j.canvas.getContext("2d"),j.textures={},j.bounds=j.bounds||{min:{x:0,y:0},max:{x:j.canvas.width,y:j.canvas.height}},j.controller=s,j.options.showBroadphase=!1,j.options.pixelRatio!==1&&s.setPixelRatio(j,j.options.pixelRatio),v.isElement(j.element)&&j.element.appendChild(j.canvas),j},s.run=function(S){(function M(j){S.frameRequestId=u(M),f(S,j),s.world(S,j),S.context.setTransform(S.options.pixelRatio,0,0,S.options.pixelRatio,0,0),(S.options.showStats||S.options.showDebug)&&s.stats(S,S.context,j),(S.options.showPerformance||S.options.showDebug)&&s.performance(S,S.context,j),S.context.setTransform(1,0,0,1,0,0)})()},s.stop=function(S){o(S.frameRequestId)},s.setPixelRatio=function(S,M){var j=S.options,w=S.canvas;M==="auto"&&(M=z(w)),j.pixelRatio=M,w.setAttribute("data-pixel-ratio",M),w.width=j.width*M,w.height=j.height*M,w.style.width=j.width+"px",w.style.height=j.height+"px"},s.setSize=function(S,M,j){S.options.width=M,S.options.height=j,S.bounds.max.x=S.bounds.min.x+M,S.bounds.max.y=S.bounds.min.y+j,S.options.pixelRatio!==1?s.setPixelRatio(S,S.options.pixelRatio):(S.canvas.width=M,S.canvas.height=j)},s.lookAt=function(S,M,j,w){w=typeof w<"u"?w:!0,M=v.isArray(M)?M:[M],j=j||{x:0,y:0};for(var B={min:{x:1/0,y:1/0},max:{x:-1/0,y:-1/0}},U=0;U<M.length;U+=1){var H=M[U],E=H.bounds?H.bounds.min:H.min||H.position||H,Q=H.bounds?H.bounds.max:H.max||H.position||H;E&&Q&&(E.x<B.min.x&&(B.min.x=E.x),Q.x>B.max.x&&(B.max.x=Q.x),E.y<B.min.y&&(B.min.y=E.y),Q.y>B.max.y&&(B.max.y=Q.y))}var ee=B.max.x-B.min.x+2*j.x,P=B.max.y-B.min.y+2*j.y,V=S.canvas.height,K=S.canvas.width,le=K/V,re=ee/P,me=1,Y=1;re>le?Y=re/le:me=le/re,S.options.hasBounds=!0,S.bounds.min.x=B.min.x,S.bounds.max.x=B.min.x+ee*me,S.bounds.min.y=B.min.y,S.bounds.max.y=B.min.y+P*Y,w&&(S.bounds.min.x+=ee*.5-ee*me*.5,S.bounds.max.x+=ee*.5-ee*me*.5,S.bounds.min.y+=P*.5-P*Y*.5,S.bounds.max.y+=P*.5-P*Y*.5),S.bounds.min.x-=j.x,S.bounds.max.x-=j.x,S.bounds.min.y-=j.y,S.bounds.max.y-=j.y,S.mouse&&(g.setScale(S.mouse,{x:(S.bounds.max.x-S.bounds.min.x)/S.canvas.width,y:(S.bounds.max.y-S.bounds.min.y)/S.canvas.height}),g.setOffset(S.mouse,S.bounds.min))},s.startViewTransform=function(S){var M=S.bounds.max.x-S.bounds.min.x,j=S.bounds.max.y-S.bounds.min.y,w=M/S.options.width,B=j/S.options.height;S.context.setTransform(S.options.pixelRatio/w,0,0,S.options.pixelRatio/B,0,0),S.context.translate(-S.bounds.min.x,-S.bounds.min.y)},s.endViewTransform=function(S){S.context.setTransform(S.options.pixelRatio,0,0,S.options.pixelRatio,0,0)},s.world=function(S,M){var j=v.now(),w=S.engine,B=w.world,U=S.canvas,H=S.context,E=S.options,Q=S.timing,ee=c.allBodies(B),P=c.allConstraints(B),V=E.wireframes?E.wireframeBackground:E.background,K=[],le=[],re,me={timestamp:w.timing.timestamp};if(r.trigger(S,"beforeRender",me),S.currentBackground!==V&&O(S,V),H.globalCompositeOperation="source-in",H.fillStyle="transparent",H.fillRect(0,0,U.width,U.height),H.globalCompositeOperation="source-over",E.hasBounds){for(re=0;re<ee.length;re++){var Y=ee[re];m.overlaps(Y.bounds,S.bounds)&&K.push(Y)}for(re=0;re<P.length;re++){var F=P[re],ae=F.bodyA,se=F.bodyB,ne=F.pointA,te=F.pointB;ae&&(ne=x.add(ae.position,F.pointA)),se&&(te=x.add(se.position,F.pointB)),!(!ne||!te)&&(m.contains(S.bounds,ne)||m.contains(S.bounds,te))&&le.push(F)}s.startViewTransform(S),S.mouse&&(g.setScale(S.mouse,{x:(S.bounds.max.x-S.bounds.min.x)/S.options.width,y:(S.bounds.max.y-S.bounds.min.y)/S.options.height}),g.setOffset(S.mouse,S.bounds.min))}else le=P,K=ee,S.options.pixelRatio!==1&&S.context.setTransform(S.options.pixelRatio,0,0,S.options.pixelRatio,0,0);!E.wireframes||w.enableSleeping&&E.showSleeping?s.bodies(S,K,H):(E.showConvexHulls&&s.bodyConvexHulls(S,K,H),s.bodyWireframes(S,K,H)),E.showBounds&&s.bodyBounds(S,K,H),(E.showAxes||E.showAngleIndicator)&&s.bodyAxes(S,K,H),E.showPositions&&s.bodyPositions(S,K,H),E.showVelocity&&s.bodyVelocity(S,K,H),E.showIds&&s.bodyIds(S,K,H),E.showSeparations&&s.separations(S,w.pairs.list,H),E.showCollisions&&s.collisions(S,w.pairs.list,H),E.showVertexNumbers&&s.vertexNumbers(S,K,H),E.showMousePosition&&s.mousePosition(S,S.mouse,H),s.constraints(le,H),E.hasBounds&&s.endViewTransform(S),r.trigger(S,"afterRender",me),Q.lastElapsed=v.now()-j},s.stats=function(S,M,j){for(var w=S.engine,B=w.world,U=c.allBodies(B),H=0,E=55,Q=44,ee=0,P=0,V=0;V<U.length;V+=1)H+=U[V].parts.length;var K={Part:H,Body:U.length,Cons:c.allConstraints(B).length,Comp:c.allComposites(B).length,Pair:w.pairs.list.length};M.fillStyle="#0e0f19",M.fillRect(ee,P,E*5.5,Q),M.font="12px Arial",M.textBaseline="top",M.textAlign="right";for(var le in K){var re=K[le];M.fillStyle="#aaa",M.fillText(le,ee+E,P+8),M.fillStyle="#eee",M.fillText(re,ee+E,P+26),ee+=E}},s.performance=function(S,M){var j=S.engine,w=S.timing,B=w.deltaHistory,U=w.elapsedHistory,H=w.timestampElapsedHistory,E=w.engineDeltaHistory,Q=w.engineUpdatesHistory,ee=w.engineElapsedHistory,P=j.timing.lastUpdatesPerFrame,V=j.timing.lastDelta,K=y(B),le=y(U),re=y(E),me=y(Q),Y=y(ee),F=y(H),ae=F/K||0,se=Math.round(K/V),ne=1e3/K||0,te=4,fe=12,he=60,we=34,$e=10,Le=69;M.fillStyle="#0e0f19",M.fillRect(0,50,fe*5+he*6+22,we),s.status(M,$e,Le,he,te,B.length,Math.round(ne)+" fps",ne/s._goodFps,function(Qe){return B[Qe]/K-1}),s.status(M,$e+fe+he,Le,he,te,E.length,V.toFixed(2)+" dt",s._goodDelta/V,function(Qe){return E[Qe]/re-1}),s.status(M,$e+(fe+he)*2,Le,he,te,Q.length,P+" upf",Math.pow(v.clamp(me/se||1,0,1),4),function(Qe){return Q[Qe]/me-1}),s.status(M,$e+(fe+he)*3,Le,he,te,ee.length,Y.toFixed(2)+" ut",1-P*Y/s._goodFps,function(Qe){return ee[Qe]/Y-1}),s.status(M,$e+(fe+he)*4,Le,he,te,U.length,le.toFixed(2)+" rt",1-le/s._goodFps,function(Qe){return U[Qe]/le-1}),s.status(M,$e+(fe+he)*5,Le,he,te,H.length,ae.toFixed(2)+" x",ae*ae*ae,function(Qe){return(H[Qe]/B[Qe]/ae||0)-1})},s.status=function(S,M,j,w,B,U,H,E,Q){S.strokeStyle="#888",S.fillStyle="#444",S.lineWidth=1,S.fillRect(M,j+7,w,1),S.beginPath(),S.moveTo(M,j+7-B*v.clamp(.4*Q(0),-2,2));for(var ee=0;ee<w;ee+=1)S.lineTo(M+ee,j+7-(ee<U?B*v.clamp(.4*Q(ee),-2,2):0));S.stroke(),S.fillStyle="hsl("+v.clamp(25+95*E,0,120)+",100%,60%)",S.fillRect(M,j-7,4,4),S.font="12px Arial",S.textBaseline="middle",S.textAlign="right",S.fillStyle="#eee",S.fillText(H,M+w,j-5)},s.constraints=function(S,M){for(var j=M,w=0;w<S.length;w++){var B=S[w];if(!(!B.render.visible||!B.pointA||!B.pointB)){var U=B.bodyA,H=B.bodyB,E,Q;if(U?E=x.add(U.position,B.pointA):E=B.pointA,B.render.type==="pin")j.beginPath(),j.arc(E.x,E.y,3,0,2*Math.PI),j.closePath();else{if(H?Q=x.add(H.position,B.pointB):Q=B.pointB,j.beginPath(),j.moveTo(E.x,E.y),B.render.type==="spring")for(var ee=x.sub(Q,E),P=x.perp(x.normalise(ee)),V=Math.ceil(v.clamp(B.length/5,12,20)),K,le=1;le<V;le+=1)K=le%2===0?1:-1,j.lineTo(E.x+ee.x*(le/V)+P.x*K*4,E.y+ee.y*(le/V)+P.y*K*4);j.lineTo(Q.x,Q.y)}B.render.lineWidth&&(j.lineWidth=B.render.lineWidth,j.strokeStyle=B.render.strokeStyle,j.stroke()),B.render.anchors&&(j.fillStyle=B.render.strokeStyle,j.beginPath(),j.arc(E.x,E.y,3,0,2*Math.PI),j.arc(Q.x,Q.y,3,0,2*Math.PI),j.closePath(),j.fill())}}},s.bodies=function(S,M,j){var w=j;S.engine;var B=S.options,U=B.showInternalEdges||!B.wireframes,H,E,Q,ee;for(Q=0;Q<M.length;Q++)if(H=M[Q],!!H.render.visible){for(ee=H.parts.length>1?1:0;ee<H.parts.length;ee++)if(E=H.parts[ee],!!E.render.visible){if(B.showSleeping&&H.isSleeping?w.globalAlpha=.5*E.render.opacity:E.render.opacity!==1&&(w.globalAlpha=E.render.opacity),E.render.sprite&&E.render.sprite.texture&&!B.wireframes){var P=E.render.sprite,V=D(S,P.texture);w.translate(E.position.x,E.position.y),w.rotate(E.angle),w.drawImage(V,V.width*-P.xOffset*P.xScale,V.height*-P.yOffset*P.yScale,V.width*P.xScale,V.height*P.yScale),w.rotate(-E.angle),w.translate(-E.position.x,-E.position.y)}else{if(E.circleRadius)w.beginPath(),w.arc(E.position.x,E.position.y,E.circleRadius,0,2*Math.PI);else{w.beginPath(),w.moveTo(E.vertices[0].x,E.vertices[0].y);for(var K=1;K<E.vertices.length;K++)!E.vertices[K-1].isInternal||U?w.lineTo(E.vertices[K].x,E.vertices[K].y):w.moveTo(E.vertices[K].x,E.vertices[K].y),E.vertices[K].isInternal&&!U&&w.moveTo(E.vertices[(K+1)%E.vertices.length].x,E.vertices[(K+1)%E.vertices.length].y);w.lineTo(E.vertices[0].x,E.vertices[0].y),w.closePath()}B.wireframes?(w.lineWidth=1,w.strokeStyle=S.options.wireframeStrokeStyle,w.stroke()):(w.fillStyle=E.render.fillStyle,E.render.lineWidth&&(w.lineWidth=E.render.lineWidth,w.strokeStyle=E.render.strokeStyle,w.stroke()),w.fill())}w.globalAlpha=1}}},s.bodyWireframes=function(S,M,j){var w=j,B=S.options.showInternalEdges,U,H,E,Q,ee;for(w.beginPath(),E=0;E<M.length;E++)if(U=M[E],!!U.render.visible)for(ee=U.parts.length>1?1:0;ee<U.parts.length;ee++){for(H=U.parts[ee],w.moveTo(H.vertices[0].x,H.vertices[0].y),Q=1;Q<H.vertices.length;Q++)!H.vertices[Q-1].isInternal||B?w.lineTo(H.vertices[Q].x,H.vertices[Q].y):w.moveTo(H.vertices[Q].x,H.vertices[Q].y),H.vertices[Q].isInternal&&!B&&w.moveTo(H.vertices[(Q+1)%H.vertices.length].x,H.vertices[(Q+1)%H.vertices.length].y);w.lineTo(H.vertices[0].x,H.vertices[0].y)}w.lineWidth=1,w.strokeStyle=S.options.wireframeStrokeStyle,w.stroke()},s.bodyConvexHulls=function(S,M,j){var w=j,B,U,H;for(w.beginPath(),U=0;U<M.length;U++)if(B=M[U],!(!B.render.visible||B.parts.length===1)){for(w.moveTo(B.vertices[0].x,B.vertices[0].y),H=1;H<B.vertices.length;H++)w.lineTo(B.vertices[H].x,B.vertices[H].y);w.lineTo(B.vertices[0].x,B.vertices[0].y)}w.lineWidth=1,w.strokeStyle="rgba(255,255,255,0.2)",w.stroke()},s.vertexNumbers=function(S,M,j){var w=j,B,U,H;for(B=0;B<M.length;B++){var E=M[B].parts;for(H=E.length>1?1:0;H<E.length;H++){var Q=E[H];for(U=0;U<Q.vertices.length;U++)w.fillStyle="rgba(255,255,255,0.2)",w.fillText(B+"_"+U,Q.position.x+(Q.vertices[U].x-Q.position.x)*.8,Q.position.y+(Q.vertices[U].y-Q.position.y)*.8)}}},s.mousePosition=function(S,M,j){var w=j;w.fillStyle="rgba(255,255,255,0.8)",w.fillText(M.position.x+" "+M.position.y,M.position.x+5,M.position.y-5)},s.bodyBounds=function(S,M,j){var w=j;S.engine;var B=S.options;w.beginPath();for(var U=0;U<M.length;U++){var H=M[U];if(H.render.visible)for(var E=M[U].parts,Q=E.length>1?1:0;Q<E.length;Q++){var ee=E[Q];w.rect(ee.bounds.min.x,ee.bounds.min.y,ee.bounds.max.x-ee.bounds.min.x,ee.bounds.max.y-ee.bounds.min.y)}}B.wireframes?w.strokeStyle="rgba(255,255,255,0.08)":w.strokeStyle="rgba(0,0,0,0.1)",w.lineWidth=1,w.stroke()},s.bodyAxes=function(S,M,j){var w=j;S.engine;var B=S.options,U,H,E,Q;for(w.beginPath(),H=0;H<M.length;H++){var ee=M[H],P=ee.parts;if(ee.render.visible)if(B.showAxes)for(E=P.length>1?1:0;E<P.length;E++)for(U=P[E],Q=0;Q<U.axes.length;Q++){var V=U.axes[Q];w.moveTo(U.position.x,U.position.y),w.lineTo(U.position.x+V.x*20,U.position.y+V.y*20)}else for(E=P.length>1?1:0;E<P.length;E++)for(U=P[E],Q=0;Q<U.axes.length;Q++)w.moveTo(U.position.x,U.position.y),w.lineTo((U.vertices[0].x+U.vertices[U.vertices.length-1].x)/2,(U.vertices[0].y+U.vertices[U.vertices.length-1].y)/2)}B.wireframes?(w.strokeStyle="indianred",w.lineWidth=1):(w.strokeStyle="rgba(255, 255, 255, 0.4)",w.globalCompositeOperation="overlay",w.lineWidth=2),w.stroke(),w.globalCompositeOperation="source-over"},s.bodyPositions=function(S,M,j){var w=j;S.engine;var B=S.options,U,H,E,Q;for(w.beginPath(),E=0;E<M.length;E++)if(U=M[E],!!U.render.visible)for(Q=0;Q<U.parts.length;Q++)H=U.parts[Q],w.arc(H.position.x,H.position.y,3,0,2*Math.PI,!1),w.closePath();for(B.wireframes?w.fillStyle="indianred":w.fillStyle="rgba(0,0,0,0.5)",w.fill(),w.beginPath(),E=0;E<M.length;E++)U=M[E],U.render.visible&&(w.arc(U.positionPrev.x,U.positionPrev.y,2,0,2*Math.PI,!1),w.closePath());w.fillStyle="rgba(255,165,0,0.8)",w.fill()},s.bodyVelocity=function(S,M,j){var w=j;w.beginPath();for(var B=0;B<M.length;B++){var U=M[B];if(U.render.visible){var H=p.getVelocity(U);w.moveTo(U.position.x,U.position.y),w.lineTo(U.position.x+H.x,U.position.y+H.y)}}w.lineWidth=3,w.strokeStyle="cornflowerblue",w.stroke()},s.bodyIds=function(S,M,j){var w=j,B,U;for(B=0;B<M.length;B++)if(M[B].render.visible){var H=M[B].parts;for(U=H.length>1?1:0;U<H.length;U++){var E=H[U];w.font="12px Arial",w.fillStyle="rgba(255,255,255,0.5)",w.fillText(E.id,E.position.x+10,E.position.y-10)}}},s.collisions=function(S,M,j){var w=j,B=S.options,U,H,E,Q;for(w.beginPath(),E=0;E<M.length;E++)if(U=M[E],!!U.isActive)for(H=U.collision,Q=0;Q<U.contactCount;Q++){var ee=U.contacts[Q],P=ee.vertex;w.rect(P.x-1.5,P.y-1.5,3.5,3.5)}for(B.wireframes?w.fillStyle="rgba(255,255,255,0.7)":w.fillStyle="orange",w.fill(),w.beginPath(),E=0;E<M.length;E++)if(U=M[E],!!U.isActive&&(H=U.collision,U.contactCount>0)){var V=U.contacts[0].vertex.x,K=U.contacts[0].vertex.y;U.contactCount===2&&(V=(U.contacts[0].vertex.x+U.contacts[1].vertex.x)/2,K=(U.contacts[0].vertex.y+U.contacts[1].vertex.y)/2),H.bodyB===H.supports[0].body||H.bodyA.isStatic===!0?w.moveTo(V-H.normal.x*8,K-H.normal.y*8):w.moveTo(V+H.normal.x*8,K+H.normal.y*8),w.lineTo(V,K)}B.wireframes?w.strokeStyle="rgba(255,165,0,0.7)":w.strokeStyle="orange",w.lineWidth=1,w.stroke()},s.separations=function(S,M,j){var w=j,B=S.options,U,H,E,Q,ee;for(w.beginPath(),ee=0;ee<M.length;ee++)if(U=M[ee],!!U.isActive){H=U.collision,E=H.bodyA,Q=H.bodyB;var P=1;!Q.isStatic&&!E.isStatic&&(P=.5),Q.isStatic&&(P=0),w.moveTo(Q.position.x,Q.position.y),w.lineTo(Q.position.x-H.penetration.x*P,Q.position.y-H.penetration.y*P),P=1,!Q.isStatic&&!E.isStatic&&(P=.5),E.isStatic&&(P=0),w.moveTo(E.position.x,E.position.y),w.lineTo(E.position.x+H.penetration.x*P,E.position.y+H.penetration.y*P)}B.wireframes?w.strokeStyle="rgba(255,165,0,0.5)":w.strokeStyle="orange",w.stroke()},s.inspector=function(S,M){S.engine;var j=S.selected,w=S.render,B=w.options,U;if(B.hasBounds){var H=w.bounds.max.x-w.bounds.min.x,E=w.bounds.max.y-w.bounds.min.y,Q=H/w.options.width,ee=E/w.options.height;M.scale(1/Q,1/ee),M.translate(-w.bounds.min.x,-w.bounds.min.y)}for(var P=0;P<j.length;P++){var V=j[P].data;switch(M.translate(.5,.5),M.lineWidth=1,M.strokeStyle="rgba(255,165,0,0.9)",M.setLineDash([1,2]),V.type){case"body":U=V.bounds,M.beginPath(),M.rect(Math.floor(U.min.x-3),Math.floor(U.min.y-3),Math.floor(U.max.x-U.min.x+6),Math.floor(U.max.y-U.min.y+6)),M.closePath(),M.stroke();break;case"constraint":var K=V.pointA;V.bodyA&&(K=V.pointB),M.beginPath(),M.arc(K.x,K.y,10,0,2*Math.PI),M.closePath(),M.stroke();break}M.setLineDash([]),M.translate(-.5,-.5)}S.selectStart!==null&&(M.translate(.5,.5),M.lineWidth=1,M.strokeStyle="rgba(255,165,0,0.6)",M.fillStyle="rgba(255,165,0,0.1)",U=S.selectBounds,M.beginPath(),M.rect(Math.floor(U.min.x),Math.floor(U.min.y),Math.floor(U.max.x-U.min.x),Math.floor(U.max.y-U.min.y)),M.closePath(),M.stroke(),M.fill(),M.translate(-.5,-.5)),B.hasBounds&&M.setTransform(1,0,0,1,0,0)};var f=function(S,M){var j=S.engine,w=S.timing,B=w.historySize,U=j.timing.timestamp;w.delta=M-w.lastTime||s._goodDelta,w.lastTime=M,w.timestampElapsed=U-w.lastTimestamp||0,w.lastTimestamp=U,w.deltaHistory.unshift(w.delta),w.deltaHistory.length=Math.min(w.deltaHistory.length,B),w.engineDeltaHistory.unshift(j.timing.lastDelta),w.engineDeltaHistory.length=Math.min(w.engineDeltaHistory.length,B),w.timestampElapsedHistory.unshift(w.timestampElapsed),w.timestampElapsedHistory.length=Math.min(w.timestampElapsedHistory.length,B),w.engineUpdatesHistory.unshift(j.timing.lastUpdatesPerFrame),w.engineUpdatesHistory.length=Math.min(w.engineUpdatesHistory.length,B),w.engineElapsedHistory.unshift(j.timing.lastElapsed),w.engineElapsedHistory.length=Math.min(w.engineElapsedHistory.length,B),w.elapsedHistory.unshift(w.lastElapsed),w.elapsedHistory.length=Math.min(w.elapsedHistory.length,B)},y=function(S){for(var M=0,j=0;j<S.length;j+=1)M+=S[j];return M/S.length||0},T=function(S,M){var j=document.createElement("canvas");return j.width=S,j.height=M,j.oncontextmenu=function(){return!1},j.onselectstart=function(){return!1},j},z=function(S){var M=S.getContext("2d"),j=window.devicePixelRatio||1,w=M.webkitBackingStorePixelRatio||M.mozBackingStorePixelRatio||M.msBackingStorePixelRatio||M.oBackingStorePixelRatio||M.backingStorePixelRatio||1;return j/w},D=function(S,M){var j=S.textures[M];return j||(j=S.textures[M]=new Image,j.src=M,j)},O=function(S,M){var j=M;/(jpg|gif|png)$/.test(M)&&(j="url("+M+")"),S.canvas.style.background=j,S.canvas.style.backgroundSize="contain",S.currentBackground=M}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(5),v=b(17),c=b(0);(function(){s._maxFrameDelta=1e3/15,s._frameDeltaFallback=1e3/60,s._timeBufferMargin=1.5,s._elapsedNextEstimate=1,s._smoothingLowerBound=.1,s._smoothingUpperBound=.9,s.create=function(r){var x={delta:16.666666666666668,frameDelta:null,frameDeltaSmoothing:!0,frameDeltaSnapping:!0,frameDeltaHistory:[],frameDeltaHistorySize:100,frameRequestId:null,timeBuffer:0,timeLastTick:null,maxUpdates:null,maxFrameTime:33.333333333333336,lastUpdatesDeferred:0,enabled:!0},g=c.extend(x,r);return g.fps=0,g},s.run=function(r,x){return r.timeBuffer=s._frameDeltaFallback,(function g(u){r.frameRequestId=s._onNextFrame(r,g),u&&r.enabled&&s.tick(r,x,u)})(),r},s.tick=function(r,x,g){var u=c.now(),o=r.delta,f=0,y=g-r.timeLastTick;if((!y||!r.timeLastTick||y>Math.max(s._maxFrameDelta,r.maxFrameTime))&&(y=r.frameDelta||s._frameDeltaFallback),r.frameDeltaSmoothing){r.frameDeltaHistory.push(y),r.frameDeltaHistory=r.frameDeltaHistory.slice(-r.frameDeltaHistorySize);var T=r.frameDeltaHistory.slice(0).sort(),z=r.frameDeltaHistory.slice(T.length*s._smoothingLowerBound,T.length*s._smoothingUpperBound),D=m(z);y=D||y}r.frameDeltaSnapping&&(y=1e3/Math.round(1e3/y)),r.frameDelta=y,r.timeLastTick=g,r.timeBuffer+=r.frameDelta,r.timeBuffer=c.clamp(r.timeBuffer,0,r.frameDelta+o*s._timeBufferMargin),r.lastUpdatesDeferred=0;var O=r.maxUpdates||Math.ceil(r.maxFrameTime/o),S={timestamp:x.timing.timestamp};p.trigger(r,"beforeTick",S),p.trigger(r,"tick",S);for(var M=c.now();o>0&&r.timeBuffer>=o*s._timeBufferMargin;){p.trigger(r,"beforeUpdate",S),v.update(x,o),p.trigger(r,"afterUpdate",S),r.timeBuffer-=o,f+=1;var j=c.now()-u,w=c.now()-M,B=j+s._elapsedNextEstimate*w/f;if(f>=O||B>r.maxFrameTime){r.lastUpdatesDeferred=Math.round(Math.max(0,r.timeBuffer/o-s._timeBufferMargin));break}}x.timing.lastUpdatesPerFrame=f,p.trigger(r,"afterTick",S),r.frameDeltaHistory.length>=100&&(r.lastUpdatesDeferred&&Math.round(r.frameDelta/o)>O?c.warnOnce("Matter.Runner: runner reached runner.maxUpdates, see docs."):r.lastUpdatesDeferred&&c.warnOnce("Matter.Runner: runner reached runner.maxFrameTime, see docs."),typeof r.isFixed<"u"&&c.warnOnce("Matter.Runner: runner.isFixed is now redundant, see docs."),(r.deltaMin||r.deltaMax)&&c.warnOnce("Matter.Runner: runner.deltaMin and runner.deltaMax were removed, see docs."),r.fps!==0&&c.warnOnce("Matter.Runner: runner.fps was replaced by runner.delta, see docs."))},s.stop=function(r){s._cancelNextFrame(r)},s._onNextFrame=function(r,x){if(typeof window<"u"&&window.requestAnimationFrame)r.frameRequestId=window.requestAnimationFrame(x);else throw new Error("Matter.Runner: missing required global window.requestAnimationFrame.");return r.frameRequestId},s._cancelNextFrame=function(r){if(typeof window<"u"&&window.cancelAnimationFrame)window.cancelAnimationFrame(r.frameRequestId);else throw new Error("Matter.Runner: missing required global window.cancelAnimationFrame.")};var m=function(r){for(var x=0,g=r.length,u=0;u<g;u+=1)x+=r[u];return x/g||0}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(8),v=b(0),c=v.deprecated;(function(){s.collides=function(m,r){return p.collides(m,r)},c(s,"collides","SAT.collides ➤ replaced by Collision.collides")})()}),(function(R,C,b){var s={};R.exports=s,b(1);var p=b(0);(function(){s.pathToVertices=function(v,c){typeof window<"u"&&!("SVGPathSeg"in window)&&p.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var m,r,x,g,u,o,f,y,T,z,D=[],O,S,M=0,j=0,w=0;c=c||15;var B=function(H,E,Q){var ee=Q%2===1&&Q>1;if(!T||H!=T.x||E!=T.y){T&&ee?(O=T.x,S=T.y):(O=0,S=0);var P={x:O+H,y:S+E};(ee||!T)&&(T=P),D.push(P),j=O+H,w=S+E}},U=function(H){var E=H.pathSegTypeAsLetter.toUpperCase();if(E!=="Z"){switch(E){case"M":case"L":case"T":case"C":case"S":case"Q":j=H.x,w=H.y;break;case"H":j=H.x;break;case"V":w=H.y;break}B(j,w,H.pathSegType)}};for(s._svgPathToAbsolute(v),x=v.getTotalLength(),o=[],m=0;m<v.pathSegList.numberOfItems;m+=1)o.push(v.pathSegList.getItem(m));for(f=o.concat();M<x;){if(z=v.getPathSegAtLength(M),u=o[z],u!=y){for(;f.length&&f[0]!=u;)U(f.shift());y=u}switch(u.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":g=v.getPointAtLength(M),B(g.x,g.y,0);break}M+=c}for(m=0,r=f.length;m<r;++m)U(f[m]);return D},s._svgPathToAbsolute=function(v){for(var c,m,r,x,g,u,o=v.pathSegList,f=0,y=0,T=o.numberOfItems,z=0;z<T;++z){var D=o.getItem(z),O=D.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(O))"x"in D&&(f=D.x),"y"in D&&(y=D.y);else switch("x1"in D&&(r=f+D.x1),"x2"in D&&(g=f+D.x2),"y1"in D&&(x=y+D.y1),"y2"in D&&(u=y+D.y2),"x"in D&&(f+=D.x),"y"in D&&(y+=D.y),O){case"m":o.replaceItem(v.createSVGPathSegMovetoAbs(f,y),z);break;case"l":o.replaceItem(v.createSVGPathSegLinetoAbs(f,y),z);break;case"h":o.replaceItem(v.createSVGPathSegLinetoHorizontalAbs(f),z);break;case"v":o.replaceItem(v.createSVGPathSegLinetoVerticalAbs(y),z);break;case"c":o.replaceItem(v.createSVGPathSegCurvetoCubicAbs(f,y,r,x,g,u),z);break;case"s":o.replaceItem(v.createSVGPathSegCurvetoCubicSmoothAbs(f,y,g,u),z);break;case"q":o.replaceItem(v.createSVGPathSegCurvetoQuadraticAbs(f,y,r,x),z);break;case"t":o.replaceItem(v.createSVGPathSegCurvetoQuadraticSmoothAbs(f,y),z);break;case"a":o.replaceItem(v.createSVGPathSegArcAbs(f,y,D.r1,D.r2,D.angle,D.largeArcFlag,D.sweepFlag),z);break;case"z":case"Z":f=c,y=m;break}(O=="M"||O=="m")&&(c=f,m=y)}}})()}),(function(R,C,b){var s={};R.exports=s;var p=b(6);b(0),(function(){s.create=p.create,s.add=p.add,s.remove=p.remove,s.clear=p.clear,s.addComposite=p.addComposite,s.addBody=p.addBody,s.addConstraint=p.addConstraint})()})])})})(ms)),ms.exports}var Wv=$v();const Ge=Rr(Wv),Iv={喜悦:"#FED7AA",开心:"#FECACA",兴奋:"#FEF08A",快乐:"#FDE68A",愉悦:"#FCA5A5",欣喜:"#FDBA74",惊喜:"#FCD34D",满足:"#FBB6CE",成就:"#F9A8D4",希望:"#FDE047",平静:"#BFDBFE",放松:"#D9F99D",宁静:"#A5F3FC",清新:"#99F6E4",温柔:"#E9D5FF",温暖:"#FBCFE8",充实:"#C7D2FE",积极:"#BAE6FD",憧憬:"#DDD6FE",焦虑:"#DDD6FE",紧张:"#E9D5FF",悲伤:"#CBD5E1",疲惫:"#E0E7FF",困倦:"#F3E8FF",沮丧:"#D1D5DB",孤独:"#E5E7EB",烦躁:"#FEE2E2",感动:"#F9A8D4",思念:"#C4B5FD",感慨:"#D8B4FE"},Pv=({moods:N,onMoodClick:L})=>{const R=ie.useRef(null),C=ie.useRef(null),b=ie.useRef(null);return ie.useEffect(()=>{if(!R.current||N.length===0)return;const s=R.current.clientWidth,p=R.current.clientHeight;if(s===0||p===0){console.warn("⚠️ 容器尺寸为0,等待下次渲染");return}console.log("🎨 初始化气泡池:",{width:s,height:p,count:N.length});const v=Ge.Engine.create({gravity:{x:0,y:.05,scale:.001}});C.current=v;const c=Ge.Render.create({element:R.current,engine:v,options:{width:s,height:p,wireframes:!1,background:"transparent"}}),m=[Ge.Bodies.rectangle(s/2,-25,s,50,{isStatic:!0,render:{visible:!1}}),Ge.Bodies.rectangle(s/2,p+25,s,50,{isStatic:!0,render:{visible:!1}}),Ge.Bodies.rectangle(-25,p/2,50,p,{isStatic:!0,render:{visible:!1}}),Ge.Bodies.rectangle(s+25,p/2,50,p,{isStatic:!0,render:{visible:!1}})];Ge.World.add(v.world,m);const r=N.map((f,y)=>{const T=25+f.intensity/10*35,z=y/N.length*Math.PI*2,D=Math.min(s,p)*.2,O=s/2+Math.cos(z)*D,S=p/2+Math.sin(z)*D,M=Iv[f.type]||"#E2E8F0",j=Ge.Bodies.circle(O,S,T,{restitution:.6,friction:.01,frictionAir:.02,render:{fillStyle:M,strokeStyle:"#94A3B8",lineWidth:2},label:f.id});return Ge.Body.setVelocity(j,{x:(Math.random()-.5)*2,y:(Math.random()-.5)*2}),{body:j,mood:f}});Ge.World.add(v.world,r.map(f=>f.body));const x=Ge.Mouse.create(c.canvas),g=Ge.MouseConstraint.create(v,{mouse:x,constraint:{stiffness:.2,render:{visible:!1}}});Ge.World.add(v.world,g),Ge.Events.on(g,"mousedown",f=>{if(f.mouse.button===0){const y=Ge.Query.point(r.map(T=>T.body),f.mouse.position)[0];if(y){b.current=y;const T=r.find(z=>z.body===y);T&&L(T.mood)}}});const u=f=>{f.preventDefault(),b.current&&(b.current=null,console.log("✨ 取消选择气泡"),L(null))};c.canvas&&c.canvas.addEventListener("contextmenu",u),Ge.Events.on(c,"afterRender",()=>{const f=c.context;r.forEach(({body:y,mood:T})=>{const z=b.current===y;z&&(f.save(),f.strokeStyle="rgba(147, 51, 234, 0.6)",f.lineWidth=4,f.beginPath(),f.arc(y.position.x,y.position.y,(y.circleRadius||30)+8,0,Math.PI*2),f.stroke(),f.restore()),f.save(),f.fillStyle=z?"#7c3aed":"#334155",f.font=`${Math.max(12,(y.circleRadius||30)*.35)}px sans-serif`,f.textAlign="center",f.textBaseline="middle",f.fillText(T.type,y.position.x,y.position.y),f.restore()})});const o=Ge.Runner.create();return Ge.Runner.run(o,v),Ge.Render.run(c),console.log("✅ 气泡池启动成功,共",r.length,"个气泡"),()=>{c.canvas&&c.canvas.removeEventListener("contextmenu",u),Ge.Render.stop(c),Ge.Runner.stop(o),Ge.World.clear(v.world,!1),Ge.Engine.clear(v),c.canvas.remove(),c.textures={}}},[N,L]),h.jsx("div",{ref:R,style:{width:"100%",height:"100%"}})},Lr=({title:N,subtitle:L,onBack:R,onChat:C,showCharacter:b=!0,characterImageUrl:s})=>h.jsxs("div",{className:"w-full px-6 pt-8 pb-4 flex items-center justify-between relative z-10",children:[h.jsx("button",{onClick:R,className:`\r
p-2.5 rounded-full \r
bg-white/40 backdrop-blur-sm\r
border border-white/50\r
text-slate-600 hover:text-slate-800\r
hover:bg-white/60 hover:scale-105\r
transition-all duration-300\r
shadow-sm hover:shadow-md\r
`,children:h.jsx(kh,{size:20,strokeWidth:2})}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center mx-4",children:[b&&h.jsxs("div",{className:"mb-2 relative",children:[s?h.jsx("img",{src:s,alt:"AI Companion",className:"w-12 h-12 rounded-full object-cover border-2 border-white/50 shadow-md"}):h.jsx("div",{className:`\r
w-12 h-12 rounded-full \r
bg-gradient-to-br from-purple-200 to-pink-200\r
border-2 border-white/50 shadow-md\r
flex items-center justify-center\r
`,children:h.jsx("span",{className:"text-lg",children:"🐱"})}),h.jsx("div",{className:`\r
absolute -bottom-0.5 -right-0.5 \r
w-3 h-3 rounded-full \r
bg-green-400 border-2 border-white\r
animate-pulse\r
`})]}),N&&h.jsx("h2",{className:"text-lg font-medium text-slate-700 tracking-wide",children:N}),L&&h.jsx("p",{className:"text-xs text-slate-400 mt-0.5 tracking-wider",children:L})]}),h.jsxs("button",{onClick:C,className:`\r
relative p-2.5 rounded-full \r
bg-gradient-to-br from-purple-400 to-pink-400\r
text-white\r
hover:from-purple-500 hover:to-pink-500\r
hover:scale-105\r
transition-all duration-300\r
shadow-md hover:shadow-lg\r
animate-pulse-slow\r
`,children:[h.jsx(hs,{size:20,strokeWidth:2}),h.jsx("div",{className:`\r
absolute -top-1 -right-1 \r
w-2 h-2 rounded-full \r
bg-red-400 border border-white\r
`})]}),h.jsx("style",{children:`
@keyframes pulse-slow {
0%, 100% { opacity: 1; }
50% { opacity: 0.8; }
}
.animate-pulse-slow {
animation: pulse-slow 3s ease-in-out infinite;
}
`})]}),ep=({items:N,onClose:L,characterImageUrl:R,onSendMessage:C})=>{var z,D;const[b,s]=ie.useState(!1),[p,v]=ie.useState(null),[c,m]=ie.useState([]),[r,x]=ie.useState(0),[g,u]=ie.useState(null);ie.useRef(null),ie.useEffect(()=>{(async()=>{try{console.log("🫧 开始加载心情数据...");const S=await ut.getMoods();console.log("📊 后端返回的心情数据:",S);const M=Date.now()-720*60*60*1e3,j=S.moods.filter(w=>new Date(w.timestamp).getTime()>=M).map(w=>({id:w.record_id,type:w.type,intensity:w.intensity,timestamp:w.timestamp,keywords:w.keywords||[],originalText:w.original_text||""}));console.log("✨ 最终显示的心情数据:",j),m(j)}catch(S){console.error("❌ 加载心情数据失败:",S);const M=N.map(j=>({id:j.id,type:j.type,intensity:j.intensity*10,timestamp:new Date(j.date).toISOString(),keywords:[],originalText:""}));m(M)}})()},[N]);const o=ie.useMemo(()=>{const O=new Map;return c.forEach(M=>{const w=new Date(M.timestamp).toISOString().split("T")[0];O.has(w)||O.set(w,[]),O.get(w).push(M)}),Array.from(O.entries()).map(([M,j])=>{const w=new Date(M),B=new Date,U=new Date(B);U.setDate(U.getDate()-1);let H="";return M===B.toISOString().split("T")[0]?H="今天":M===U.toISOString().split("T")[0]?H="昨天":H=w.toLocaleDateString("zh-CN",{month:"long",day:"numeric",weekday:"short"}),{date:M,displayDate:H,moods:j.sort((E,Q)=>new Date(Q.timestamp).getTime()-new Date(E.timestamp).getTime()),moodCount:j.length}}).sort((M,j)=>j.date.localeCompare(M.date))},[c]),f=ie.useCallback(O=>{v(O===null?null:O)},[]),y=O=>{g===O.date?u(null):u(O.date)},T=O=>new Date(O).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return h.jsxs("div",{className:"absolute inset-0 z-50 flex flex-col items-center animate-[fadeIn_0.5s_ease-out]",children:[h.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-50/90 via-pink-50/90 to-white/90 backdrop-blur-xl"}),h.jsxs("div",{className:"relative z-10 w-full h-full flex flex-col items-center",children:[h.jsx(Lr,{title:"心情日历",subtitle:"Your emotions, day by day",onBack:L,onChat:()=>s(!0),characterImageUrl:R}),h.jsxs("div",{className:"flex-1 w-full max-w-md mx-auto flex flex-col items-center justify-center relative",children:[o.length===0&&h.jsx("div",{className:"flex items-center justify-center",children:h.jsx("p",{className:"text-slate-400 text-sm",children:"暂无心情记录"})}),o.length>0&&h.jsxs("div",{className:"relative w-full h-[500px] flex items-center justify-center",children:[h.jsx("div",{className:"relative w-[280px] h-full",children:o.map((O,S)=>{const M=S-r,j=S===r,w=M===-1,B=M===1,U=Math.abs(M)<=1;return h.jsx("div",{className:`
absolute inset-0 transition-all duration-500 ease-out
${U?"":"opacity-0 pointer-events-none"}
${j?"z-30 scale-100 opacity-100":""}
${w?"z-20 -translate-x-[80%] scale-85 opacity-30":""}
${B?"z-20 translate-x-[80%] scale-85 opacity-30":""}
${!j&&!w&&!B?"scale-75 opacity-0":""}
`,style:{transform:`
translateX(${M*80}%)
scale(${j?1:.85})
rotateY(${M*15}deg)
`},children:h.jsx("button",{onClick:()=>{j?y(O):x(S)},className:`
w-full h-full
bg-gradient-to-br from-white/80 to-purple-50/60
backdrop-blur-xl rounded-3xl p-6
border-2 border-white/50
shadow-2xl
transition-all duration-300
${j?"hover:scale-105 cursor-pointer":"cursor-pointer"}
`,style:{boxShadow:j?"0 25px 50px -12px rgba(0, 0, 0, 0.25)":"0 10px 25px -5px rgba(0, 0, 0, 0.1)"},children:h.jsxs("div",{className:"flex flex-col h-full justify-between",children:[h.jsxs("div",{className:"text-center",children:[h.jsx("h2",{className:"text-2xl font-bold text-slate-700 mb-2",children:O.displayDate}),h.jsx("div",{className:"inline-block px-3 py-1 bg-purple-100/80 rounded-full",children:h.jsxs("span",{className:"text-xs text-purple-700 font-medium",children:[O.moodCount," 条"]})})]}),h.jsx("div",{className:"flex-1 flex items-center justify-center py-4",children:h.jsxs("div",{className:"grid grid-cols-3 gap-2 w-full",children:[O.moods.slice(0,9).map(H=>h.jsx("div",{className:"aspect-square rounded-xl flex items-center justify-center text-xs font-medium shadow-md border-2 border-white/50",style:{backgroundColor:tp(H.type),color:"#334155"},children:H.type},H.id)),O.moodCount>9&&h.jsxs("div",{className:"aspect-square rounded-xl flex items-center justify-center text-xs font-medium bg-slate-100 text-slate-600 shadow-md border-2 border-white/50",children:["+",O.moodCount-9]})]})}),j&&h.jsx("div",{className:"text-center animate-pulse",children:h.jsx("p",{className:"text-xs text-slate-500",children:"点击查看气泡池"})})]})})},O.date)})}),h.jsx("button",{onClick:()=>x(Math.max(0,r-1)),disabled:r===0,className:"absolute left-4 top-1/2 -translate-y-1/2 z-40 p-2.5 rounded-full bg-white/80 backdrop-blur-sm hover:bg-white disabled:opacity-30 disabled:cursor-not-allowed transition-all shadow-lg",children:h.jsx(Fd,{size:20,className:"text-slate-700"})}),h.jsx("button",{onClick:()=>x(Math.min(o.length-1,r+1)),disabled:r===o.length-1,className:"absolute right-4 top-1/2 -translate-y-1/2 z-40 p-2.5 rounded-full bg-white/80 backdrop-blur-sm hover:bg-white disabled:opacity-30 disabled:cursor-not-allowed transition-all shadow-lg",children:h.jsx(Ih,{size:20,className:"text-slate-700"})})]}),o.length>0&&h.jsx("div",{className:"flex gap-2 mt-8",children:o.map((O,S)=>h.jsx("button",{onClick:()=>x(S),className:`
h-2 rounded-full transition-all duration-300
${S===r?"w-8 bg-purple-400":"w-2 bg-slate-300 hover:bg-slate-400"}
`},S))}),h.jsx("div",{className:"mt-8 opacity-0 animate-[fadeSlideUp_1s_ease-out_forwards] delay-500",children:h.jsx("p",{className:"text-xs text-slate-400 bg-white/60 backdrop-blur-sm px-4 py-2 rounded-full whitespace-nowrap",children:"左右滑动或点击箭头切换日期"})})]})]}),g&&h.jsxs("div",{className:"fixed inset-0 z-[100] flex flex-col items-center bg-gradient-to-br from-purple-50/95 via-pink-50/95 to-white/95 backdrop-blur-xl animate-[fadeIn_0.3s_ease-out]",children:[h.jsxs("div",{className:"w-full max-w-md mx-auto px-6 py-4 flex items-center justify-between",children:[h.jsx("button",{onClick:()=>u(null),className:"p-2 rounded-full bg-white/60 hover:bg-white/80 transition-all",children:h.jsx(Fd,{size:20,className:"text-slate-600"})}),h.jsx("h2",{className:"text-lg font-medium text-slate-700",children:(z=o.find(O=>O.date===g))==null?void 0:z.displayDate}),h.jsx("div",{className:"w-9"})," "]}),h.jsx("div",{className:"flex-1 w-full max-w-md mx-auto relative",style:{minHeight:"500px"},children:h.jsx(Pv,{moods:((D=o.find(O=>O.date===g))==null?void 0:D.moods)||[],onMoodClick:f})}),h.jsx("div",{className:"mb-32",children:h.jsx("p",{className:"text-xs text-slate-400 bg-white/60 backdrop-blur-sm px-4 py-2 rounded-full whitespace-nowrap",children:"左键查看详情 · 右键取消 · 拖动互动"})})]}),p&&h.jsx("div",{className:`
fixed inset-0 z-[200]
flex items-center justify-center
bg-black/30 backdrop-blur-sm
animate-[fadeIn_0.3s_ease-out]
p-4
`,onClick:()=>v(null),children:h.jsxs("div",{className:`
relative w-full max-w-sm
bg-gradient-to-br from-white/95 to-purple-50/95
rounded-3xl shadow-2xl
border border-white/50
p-6
animate-[slideUp_0.3s_ease-out]
`,onClick:O=>O.stopPropagation(),children:[h.jsx("button",{onClick:()=>v(null),className:`
absolute top-4 right-4
p-2 rounded-full
bg-white/50 hover:bg-white/70
text-slate-600 hover:text-slate-800
transition-all duration-200
`,children:"✕"}),h.jsxs("div",{className:"flex flex-col space-y-4",children:[h.jsxs("div",{className:"text-center",children:[h.jsx("h3",{className:"text-3xl font-medium text-slate-700 mb-2",children:p.type}),h.jsx("p",{className:"text-sm text-slate-500",children:T(p.timestamp)})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex justify-between text-sm text-slate-600",children:[h.jsx("span",{children:"情绪强度"}),h.jsxs("span",{className:"font-medium",children:[p.intensity,"/10"]})]}),h.jsx("div",{className:"w-full h-3 bg-slate-200/50 rounded-full overflow-hidden",children:h.jsx("div",{className:"h-full bg-gradient-to-r from-purple-400 to-pink-400 rounded-full transition-all duration-500",style:{width:`${p.intensity/10*100}%`}})})]}),p.originalText&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-sm text-slate-600 font-medium",children:"记录原文"}),h.jsx("div",{className:"bg-slate-50/80 rounded-2xl p-4 border border-slate-200/50",children:h.jsx("p",{className:"text-sm text-slate-700 leading-relaxed whitespace-pre-wrap",children:p.originalText})})]}),p.keywords&&p.keywords.length>0&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-sm text-slate-600 font-medium",children:"关键词"}),h.jsx("div",{className:"flex flex-wrap gap-2",children:p.keywords.map((O,S)=>h.jsx("span",{className:"px-3 py-1 bg-purple-100/80 text-purple-700 text-xs rounded-full",children:O},S))})]}),h.jsx("div",{className:"pt-4 border-t border-slate-200",children:h.jsx("p",{className:"text-xs text-slate-500 italic text-center",children:'"每一种情绪都值得被记录和珍惜"'})})]})]})}),h.jsx(vs,{isOpen:b,onClose:()=>s(!1),characterImageUrl:R,onSendMessage:C}),h.jsx("style",{children:`
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeSlideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
.no-scrollbar::-webkit-scrollbar {
display: none;
}
.no-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
}
`})]})};function tp(N){return{喜悦:"#FED7AA",开心:"#FECACA",兴奋:"#FEF08A",快乐:"#FDE68A",愉悦:"#FCA5A5",欣喜:"#FDBA74",惊喜:"#FCD34D",满足:"#FBB6CE",成就:"#F9A8D4",希望:"#FDE047",平静:"#BFDBFE",放松:"#D9F99D",宁静:"#A5F3FC",清新:"#99F6E4",温柔:"#E9D5FF",温暖:"#FBCFE8",充实:"#C7D2FE",积极:"#BAE6FD",憧憬:"#DDD6FE",焦虑:"#DDD6FE",紧张:"#E9D5FF",悲伤:"#CBD5E1",疲惫:"#E0E7FF",困倦:"#F3E8FF",沮丧:"#D1D5DB",孤独:"#E5E7EB",烦躁:"#FEE2E2",感动:"#F9A8D4",思念:"#C4B5FD",感慨:"#D8B4FE"}[N]||"#E2E8F0"}const ap=({item:N,index:L})=>{var C;const R=b=>{const s=new Date(b),p=new Date;if(s.toDateString()===p.toDateString())return s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});{const c=s.toLocaleDateString([],{month:"short",day:"numeric"}),m=s.getHours();let r="Day";return m<12?r="Morning":m<18?r="Afternoon":r="Evening",`${c} · ${r}`}};return h.jsxs("div",{className:"group relative w-full bg-white/40 backdrop-blur-xl border border-white/50 shadow-[0_4px_24px_-8px_rgba(0,0,0,0.02)] rounded-[24px] p-6 mb-5 transition-all duration-700 hover:bg-white/50 active:scale-[0.99]",style:{animation:"fadeSlideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards",animationDelay:`${L*100}ms`,opacity:0},children:[h.jsx("div",{className:"absolute inset-0 rounded-[24px] ring-1 ring-inset ring-white/40 pointer-events-none"}),h.jsx("div",{className:"relative z-10 mb-4",children:h.jsx("p",{className:"text-[16px] leading-relaxed font-normal text-slate-800/80 font-sans whitespace-pre-wrap",children:N.content})}),h.jsxs("div",{className:"relative z-10 flex items-end justify-between mt-2",children:[h.jsx("div",{className:"flex flex-wrap gap-2 max-w-[70%]",children:(C=N.tags)==null?void 0:C.map((b,s)=>h.jsxs("span",{className:"px-2.5 py-1 rounded-full bg-white/30 border border-white/40 text-[11px] font-medium text-slate-500/70 tracking-wide backdrop-blur-sm",children:["#",b]},s))}),h.jsx("span",{className:"text-[12px] font-light text-slate-400/40 tracking-wider ml-2 whitespace-nowrap",children:R(N.createdAt)})]}),h.jsx("style",{children:`
@keyframes fadeSlideUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
`})]})},lp=({isOpen:N,onClose:L,onSubmit:R})=>{const[C,b]=ie.useState(""),[s,p]=ie.useState(!1),[v,c]=ie.useState(!1),m=ie.useRef(null),r=ie.useRef([]);if(!N)return null;const x=async()=>{if(!(!C.trim()||v)){c(!0);try{await R(C,!1),b(""),L()}catch(y){console.error("Failed to submit inspiration:",y)}finally{c(!1)}}},g=async()=>{try{const y=await navigator.mediaDevices.getUserMedia({audio:!0}),T=new MediaRecorder(y);m.current=T,r.current=[],T.ondataavailable=z=>{z.data.size>0&&r.current.push(z.data)},T.onstop=async()=>{const z=new Blob(r.current,{type:"audio/webm"});await o(z),y.getTracks().forEach(D=>D.stop())},T.start(),p(!0)}catch(y){console.error("Failed to start recording:",y),alert("无法访问麦克风,请检查权限设置")}},u=()=>{m.current&&s&&(m.current.stop(),p(!1))},o=async y=>{c(!0);try{const T=new File([y],"recording.webm",{type:"audio/webm"});await R("语音录制的灵感",!0),L()}catch(T){console.error("Failed to process audio:",T),alert("语音处理失败,请重试")}finally{c(!1)}},f=y=>{y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),x())};return h.jsxs("div",{className:`\r
fixed inset-0 z-[100] \r
flex items-center justify-center\r
bg-black/20 backdrop-blur-sm\r
animate-[fadeIn_0.3s_ease-out]\r
p-4\r
`,children:[h.jsxs("div",{className:`\r
relative w-full max-w-md\r
bg-gradient-to-br from-white/95 to-purple-50/95\r
backdrop-blur-xl\r
rounded-3xl shadow-2xl\r
border border-white/50\r
p-6\r
animate-[slideUp_0.3s_ease-out]\r
`,children:[h.jsxs("div",{className:"flex items-center justify-between mb-6",children:[h.jsx("h3",{className:"text-lg font-medium text-slate-700",children:"✨ 记录灵感"}),h.jsx("button",{onClick:L,className:`\r
p-2 rounded-full\r
text-slate-400 hover:text-slate-600\r
hover:bg-white/50\r
transition-all duration-200\r
`,children:h.jsx(Xn,{size:20})})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("textarea",{value:C,onChange:y=>b(y.target.value),onKeyPress:f,placeholder:"写下你的灵感...",disabled:v||s,rows:4,className:`\r
w-full px-4 py-3 rounded-2xl\r
bg-white/80 border border-white/50\r
text-slate-700 placeholder:text-slate-400\r
focus:outline-none focus:ring-2 focus:ring-purple-300\r
disabled:opacity-50 disabled:cursor-not-allowed\r
resize-none\r
`}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("button",{onClick:s?u:g,disabled:v,className:`
flex-1 flex items-center justify-center gap-2
px-4 py-3 rounded-2xl
${s?"bg-red-500 hover:bg-red-600 animate-pulse":"bg-gradient-to-br from-purple-400 to-pink-400 hover:from-purple-500 hover:to-pink-500"}
text-white font-medium
transition-all duration-200
disabled:opacity-50 disabled:cursor-not-allowed
hover:scale-105 active:scale-95
`,children:s?h.jsxs(h.Fragment,{children:[h.jsx(l0,{size:18}),h.jsx("span",{children:"停止录音"})]}):h.jsxs(h.Fragment,{children:[h.jsx(Hr,{size:18}),h.jsx("span",{children:"语音输入"})]})}),h.jsx("button",{onClick:x,disabled:!C.trim()||v||s,className:`\r
flex items-center justify-center\r
w-12 h-12 rounded-full\r
bg-gradient-to-br from-purple-400 to-pink-400\r
hover:from-purple-500 hover:to-pink-500\r
text-white\r
transition-all duration-200\r
disabled:opacity-50 disabled:cursor-not-allowed\r
hover:scale-105 active:scale-95\r
`,children:v?h.jsx(al,{size:20,className:"animate-spin"}):h.jsx(_r,{size:20})})]}),h.jsx("p",{className:"text-xs text-slate-400 text-center",children:s?"正在录音中...":"按 Enter 提交,Shift + Enter 换行"})]})]}),h.jsx("style",{children:`
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
`})]})},np=({items:N,onClose:L,onAdd:R,characterImageUrl:C,onSendMessage:b})=>{const[s,p]=ie.useState(!1),[v,c]=ie.useState(!1),[m,r]=ie.useState([]),[x,g]=ie.useState(!1),u=async(z,D)=>{R&&await R(z,D)},o=ie.useMemo(()=>{const z=new Map;return N.forEach(D=>{D.tags.forEach(O=>{z.set(O,(z.get(O)||0)+1)})}),Array.from(z.entries()).map(([D,O])=>({tag:D,count:O})).sort((D,O)=>O.count-D.count)},[N]),f=ie.useMemo(()=>m.length===0?N:N.filter(z=>m.some(D=>z.tags.includes(D))),[N,m]),y=z=>{r(D=>D.includes(z)?D.filter(O=>O!==z):[...D,z])},T=()=>{r([])};return h.jsxs("div",{className:"absolute inset-0 z-50 flex flex-col animate-[fadeIn_0.5s_ease-out]",children:[h.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-50/95 via-pink-50/95 to-white/95 backdrop-blur-xl"}),h.jsx(Lr,{title:"灵感记录",subtitle:"A thought worth keeping",onBack:L,onChat:()=>p(!0),characterImageUrl:C}),h.jsx("div",{className:"relative z-10 px-6 mb-4",children:h.jsxs("div",{className:"w-full max-w-md mx-auto",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsxs("button",{onClick:()=>g(!x),className:"flex items-center gap-2 text-sm text-slate-600 hover:text-slate-800 transition-colors",children:[h.jsx($d,{size:16}),h.jsx("span",{className:"font-medium",children:"按标签筛选"}),m.length>0&&h.jsxs("span",{className:"text-xs text-slate-400",children:["(",m.length," 个已选)"]}),h.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${x?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),m.length>0&&h.jsx("button",{onClick:T,className:"text-xs text-purple-600 hover:text-purple-700 font-medium transition-colors",children:"清除筛选"})]}),h.jsx("div",{className:`
overflow-hidden transition-all duration-300 ease-in-out
${x?"max-h-[500px] opacity-100":"max-h-0 opacity-0"}
`,children:h.jsx("div",{className:"flex flex-wrap gap-2 pb-3",children:o.map(({tag:z,count:D})=>{const O=m.includes(z);return h.jsx("button",{onClick:()=>y(z),className:`
group relative px-3 py-1.5 rounded-lg text-xs font-medium
border transition-all duration-200
${O?"bg-purple-100 text-purple-700 border-purple-200 shadow-sm scale-105":"bg-white/60 text-slate-600 border-slate-200 hover:bg-white/80"}
`,children:h.jsxs("span",{className:"flex items-center gap-1.5",children:[z,h.jsx("span",{className:`
text-[10px] px-1.5 py-0.5 rounded-full
${O?"bg-purple-200/60 text-purple-700":"bg-slate-100"}
`,children:D})]})},z)})})}),h.jsxs("div",{className:"text-xs text-slate-500",children:["显示 ",f.length," / ",N.length," 条灵感"]})]})}),h.jsx("div",{className:"relative z-10 flex-1 overflow-y-auto no-scrollbar scroll-smooth px-6 pt-2 pb-32",children:h.jsx("div",{className:"w-full max-w-md mx-auto flex flex-col gap-2",children:f.length>0?f.map((z,D)=>h.jsx(ap,{item:z,index:D},z.id)):h.jsx("div",{className:"flex flex-col items-center justify-center h-[50vh] text-center opacity-40",children:m.length>0?h.jsxs(h.Fragment,{children:[h.jsx($d,{size:32,className:"text-purple-300 mb-4",strokeWidth:1}),h.jsx("p",{className:"text-slate-400 font-light tracking-wide",children:"没有匹配的灵感"}),h.jsx("button",{onClick:T,className:"mt-4 text-sm text-purple-600 hover:text-purple-700 font-medium",children:"清除筛选条件"})]}):h.jsxs(h.Fragment,{children:[h.jsx(ll,{size:32,className:"text-purple-300 mb-4 animate-pulse",strokeWidth:1}),h.jsx("p",{className:"text-slate-400 font-light tracking-wide",children:"等待灵感的火花..."})]})})})}),h.jsx("div",{className:"absolute bottom-24 right-6 z-30 opacity-0 animate-[fadeSlideUp_0.8s_ease-out_forwards] delay-300",children:h.jsx("button",{onClick:()=>c(!0),className:`
group relative flex items-center justify-center w-14 h-14
bg-white/60 backdrop-blur-xl rounded-full shadow-lg shadow-purple-100/50
ring-1 ring-white/60 text-purple-400
hover:bg-white/80 hover:text-purple-500 hover:scale-105
active:scale-95 transition-all duration-500
`,children:h.jsx(ll,{size:22,strokeWidth:1.5,className:"group-hover:rotate-12 transition-transform duration-500"})})}),h.jsx(lp,{isOpen:v,onClose:()=>c(!1),onSubmit:u}),h.jsx(vs,{isOpen:s,onClose:()=>p(!1),characterImageUrl:C,onSendMessage:b}),h.jsx("style",{children:`
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeSlideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
`})]})},ip=({item:N,index:L,onToggle:R,location:C,time:b})=>{const[s,p]=ie.useState(N.isDone),v=r=>{r.stopPropagation(),p(!s),R(N.id)},c=r=>{const x={size:12,className:"opacity-60"};switch(r){case"study":return h.jsx(Xh,{...x});case"work":return h.jsx(Zh,{...x});case"life":return h.jsx(lv,{...x});case"health":return h.jsx(iv,{...x});default:return null}},m=r=>{if(!r)return"";const x=new Date(r),g=new Date,u=x.toDateString()===g.toDateString(),o=x.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return u?`Today · ${o}`:`${x.toLocaleDateString([],{month:"short",day:"numeric"})} · ${o}`};return h.jsxs("div",{className:`
group relative w-full rounded-[22px] p-5 mb-4
border transition-all duration-700 ease-out cursor-pointer
${s?"bg-white/20 border-white/20 shadow-none opacity-60 grayscale-[0.3]":"bg-white/40 border-white/50 shadow-[0_4px_24px_-8px_rgba(0,0,0,0.02)] hover:bg-white/50"}
`,style:{animation:"fadeSlideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards",animationDelay:`${L*100}ms`,opacity:0,backdropFilter:"blur(12px)"},children:[h.jsx("div",{className:"absolute inset-0 rounded-[22px] ring-1 ring-inset ring-white/30 pointer-events-none"}),h.jsxs("div",{className:"relative z-10 flex items-start gap-4",children:[h.jsx("button",{onClick:v,className:"mt-0.5 flex-shrink-0 text-slate-400 hover:text-purple-400 transition-colors duration-300",children:s?h.jsx(Pd,{size:20,className:"text-purple-300 fill-purple-50",strokeWidth:1.5}):h.jsx(tv,{size:20,className:"opacity-50",strokeWidth:1.5})}),h.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[h.jsx("p",{className:`
text-[16px] leading-relaxed font-normal font-sans transition-all duration-500
${s?"text-slate-400 line-through decoration-slate-300/50":"text-slate-700/90"}
`,children:N.title}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[(N.scheduledAt||b)&&h.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-500",children:[h.jsx(Jh,{size:14,className:"opacity-60"}),h.jsx("span",{children:b||m(N.scheduledAt)})]}),C&&h.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-500",children:[h.jsx(hv,{size:14,className:"opacity-60"}),h.jsx("span",{children:C})]})]}),N.category&&h.jsx("div",{className:"flex items-center gap-2",children:h.jsxs("div",{className:"px-2 py-1 rounded-full bg-white/30 border border-white/20 flex items-center gap-1.5 text-slate-500",children:[c(N.category),h.jsx("span",{className:"text-xs capitalize",children:N.category})]})})]})]})]}),h.jsx("style",{children:`
@keyframes fadeSlideUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
`})]})},sp=({items:N,onClose:L,onAdd:R,onToggleItem:C,characterImageUrl:b,onSendMessage:s})=>{const[p,v]=ie.useState(!1),c=[...N].sort((m,r)=>m.isDone===r.isDone?(m.scheduledAt||0)-(r.scheduledAt||0):m.isDone?1:-1);return h.jsxs("div",{className:"absolute inset-0 z-50 flex flex-col animate-[fadeIn_0.5s_ease-out]",children:[h.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-50/95 via-pink-50/95 to-white/95 backdrop-blur-xl"}),h.jsx(Lr,{title:"待办事项",subtitle:"One thing at a time",onBack:L,onChat:()=>v(!0),characterImageUrl:b}),h.jsx("div",{className:"relative z-10 flex-1 overflow-y-auto no-scrollbar scroll-smooth px-6 pt-2 pb-32",children:h.jsx("div",{className:"w-full max-w-md mx-auto flex flex-col gap-2",children:c.map((m,r)=>h.jsx(ip,{item:m,index:r,onToggle:C,location:m.location,time:m.time},m.id))})}),h.jsx("div",{className:"absolute bottom-24 right-6 z-30 opacity-0 animate-[fadeSlideUp_0.8s_ease-out_forwards] delay-300",children:h.jsx("button",{onClick:R,className:`
group relative flex items-center justify-center w-14 h-14
bg-white/60 backdrop-blur-xl rounded-full shadow-lg shadow-purple-100/50
ring-1 ring-white/60 text-purple-400
hover:bg-white/80 hover:text-purple-500 hover:scale-105
active:scale-95 transition-all duration-500
`,children:h.jsx(t0,{size:24,strokeWidth:1.5,className:"group-hover:rotate-90 transition-transform duration-500"})})}),h.jsx(vs,{isOpen:p,onClose:()=>v(!1),characterImageUrl:b,onSendMessage:s}),h.jsx("style",{children:`
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeSlideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
`})]})};function up({onRecordComplete:N}){const[L,R]=ie.useState(!1),[C,b]=ie.useState(""),[s,p]=ie.useState(!1),[v,c]=ie.useState(null),[m,r]=ie.useState(!1),x=ie.useRef(null),g=ie.useRef([]),u=async()=>{try{const D=await navigator.mediaDevices.getUserMedia({audio:!0});let O={mimeType:"audio/webm"};MediaRecorder.isTypeSupported("audio/wav")?O={mimeType:"audio/wav"}:MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?O={mimeType:"audio/webm;codecs=opus"}:MediaRecorder.isTypeSupported("audio/webm")&&(O={mimeType:"audio/webm"});const S=new MediaRecorder(D,O);x.current=S,g.current=[],S.ondataavailable=M=>{M.data.size>0&&g.current.push(M.data)},S.onstop=async()=>{const M=S.mimeType,j=new Blob(g.current,{type:M});await f(j,M),D.getTracks().forEach(w=>w.stop())},S.start(),R(!0),c(null),r(!1)}catch(D){console.error("Failed to start recording:",D),c("无法访问麦克风,请检查权限设置")}},o=()=>{x.current&&L&&(x.current.stop(),R(!1))},f=async(D,O)=>{p(!0),c(null);try{let S="webm",M="recording.webm";if(O.includes("wav")?(S="wav",M="recording.wav"):O.includes("mp4")||O.includes("m4a")?(S="m4a",M="recording.m4a"):(O.includes("mpeg")||O.includes("mp3"))&&(S="mp3",M="recording.mp3"),S==="webm")try{const j=await y(D),w=new File([j],"recording.wav",{type:"audio/wav"});await ut.processInput(w)}catch(j){console.error("Conversion failed, trying direct upload:",j);const w=new File([D],"recording.mp3",{type:"audio/mpeg"});await ut.processInput(w)}else{const j=new File([D],M,{type:O});await ut.processInput(j)}r(!0),setTimeout(()=>r(!1),3e3),N&&N()}catch(S){console.error("Failed to process audio:",S),c(S.message||"处理失败,请重试")}finally{p(!1)}},y=async D=>{const O=new(window.AudioContext||window.webkitAudioContext),S=await D.arrayBuffer(),M=await O.decodeAudioData(S),j=T(M);return new Blob([j],{type:"audio/wav"})},T=D=>{const O=D.length*D.numberOfChannels*2+44,S=new ArrayBuffer(O),M=new DataView(S),j=[];let w=0,B=0;const U=E=>{M.setUint16(B,E,!0),B+=2},H=E=>{M.setUint32(B,E,!0),B+=4};H(1179011410),H(O-8),H(1163280727),H(544501094),H(16),U(1),U(D.numberOfChannels),H(D.sampleRate),H(D.sampleRate*D.numberOfChannels*2),U(D.numberOfChannels*2),U(16),H(1635017060),H(O-B-4);for(let E=0;E<D.numberOfChannels;E++)j.push(D.getChannelData(E));for(;B<O;){for(let E=0;E<D.numberOfChannels;E++){let Q=Math.max(-1,Math.min(1,j[E][w]));Q=Q<0?Q*32768:Q*32767,M.setInt16(B,Q,!0),B+=2}w++}return S},z=async()=>{if(C.trim()){p(!0),c(null);try{await ut.processInput(void 0,C),b(""),r(!0),setTimeout(()=>r(!1),3e3),N&&N()}catch(D){console.error("Failed to process text:",D),c(D.message||"处理失败,请重试")}finally{p(!1)}}};return h.jsxs("div",{className:"w-full max-w-md mx-auto px-6 space-y-4",children:[h.jsx("div",{className:"flex items-center justify-center gap-4",children:h.jsxs("button",{onClick:L?o:u,disabled:s,className:`
relative p-8 rounded-full transition-all duration-300 shadow-2xl
${L?"bg-gradient-to-br from-red-400 to-red-600 animate-pulse scale-110":"bg-gradient-to-br from-purple-400 to-pink-500 hover:scale-105"}
text-white disabled:opacity-50 disabled:cursor-not-allowed
${!s&&!L?"hover:shadow-purple-300":""}
`,"aria-label":L?"停止录音":"开始录音",children:[L?h.jsx(l0,{size:36}):h.jsx(Hr,{size:36}),L&&h.jsx("span",{className:"absolute inset-0 rounded-full border-4 border-red-300 animate-ping"})]})}),L&&h.jsx("div",{className:"text-center",children:h.jsx("span",{className:"text-sm text-slate-600 animate-pulse",children:"正在录音... 点击停止"})}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"text",value:C,onChange:D=>b(D.target.value),onKeyPress:D=>D.key==="Enter"&&!D.shiftKey&&z(),placeholder:"或者在这里输入文字...",disabled:s||L,className:`\r
flex-1 px-5 py-3 rounded-full\r
bg-white/90 backdrop-blur-sm\r
border-2 border-slate-200\r
focus:outline-none focus:ring-2 focus:ring-purple-300 focus:border-transparent\r
disabled:opacity-50 disabled:cursor-not-allowed\r
placeholder:text-slate-400\r
transition-all duration-200\r
`}),h.jsx("button",{onClick:z,disabled:s||L||!C.trim(),className:`\r
px-6 py-3 rounded-full\r
bg-gradient-to-r from-purple-500 to-pink-500\r
hover:from-purple-600 hover:to-pink-600\r
text-white transition-all duration-200\r
disabled:opacity-50 disabled:cursor-not-allowed\r
shadow-lg hover:shadow-xl\r
flex items-center gap-2\r
`,"aria-label":"发送",children:s?h.jsx(al,{size:20,className:"animate-spin"}):h.jsx(_r,{size:20})})]}),s&&h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-purple-100 text-purple-700",children:[h.jsx(al,{size:16,className:"animate-spin"}),h.jsx("span",{className:"text-sm",children:"正在分析..."})]})}),m&&h.jsx("div",{className:"text-center animate-fade-in",children:h.jsxs("div",{className:"inline-flex items-center gap-2 px-6 py-3 rounded-full bg-green-100 text-green-700 shadow-lg",children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),h.jsx("span",{className:"text-sm font-medium",children:"记录成功!"})]})}),v&&h.jsx("div",{className:"text-center animate-fade-in",children:h.jsxs("div",{className:"inline-flex items-center gap-2 px-6 py-3 rounded-full bg-red-100 text-red-700 shadow-lg",children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),h.jsx("span",{className:"text-sm",children:v})]})}),h.jsx("div",{className:"text-center",children:h.jsxs("p",{className:"text-xs text-slate-400 leading-relaxed",children:["说出或写下你的想法、灵感、待办事项",h.jsx("br",{}),"我会帮你整理和记录"]})})]})}function rp(N){return{id:N.record_id,content:N.original_text,createdAt:new Date(N.timestamp).getTime(),sourceType:N.input_type==="audio"?ge.VOICE:ge.MANUAL}}function cp(N){return N&&{开心:_e.HAPPY,快乐:_e.HAPPY,平静:_e.CALM,冷静:_e.CALM,疲惫:_e.TIRED,累:_e.TIRED,焦虑:_e.ANXIOUS,紧张:_e.ANXIOUS,希望:_e.HOPEFUL,期待:_e.HOPEFUL}[N]||_e.CALM}function op(N,L){const R=new Date(N.timestamp).getTime(),C=20+(R+L*13)%60,b=20+(R+L*17)%60;return{id:N.record_id,type:cp(N.type),date:new Date(N.timestamp).getTime(),intensity:N.intensity?N.intensity/10:.5,x:C,y:b}}function fp(N){return{id:N.record_id,content:N.core_idea,createdAt:new Date(N.timestamp).getTime(),tags:N.tags||[]}}function dp(N){return{工作:"work",生活:"life",学习:"study",健康:"health"}[N||""]||"life"}function mp(N){const L=new Date(N.timestamp).getTime();let R;return N.time&&(N.time.includes("明天")?R=L+1440*60*1e3:N.time.includes("今天")&&(R=L)),{id:N.record_id,title:N.task,createdAt:L,scheduledAt:R,isDone:N.status==="completed"||N.status==="done",category:dp(N.category),location:N.location||void 0,time:N.time||void 0}}const hp=()=>{const N=Date.now(),L=3600*1e3,R=24*L;return[{id:"1",content:"早上6点醒来,窗外的鸟鸣声特别清脆。新的一天,充满期待。",createdAt:N-L*2,sourceType:ge.MOOD},{id:"2",content:"晨跑时看到日出,天空从深蓝渐变到橙粉色,美得让人想哭。",createdAt:N-L*1.5,sourceType:ge.VOICE},{id:"3",content:"咖啡店里的音乐很好听,是一首法语歌。要记得回去搜一下。",createdAt:N-L,sourceType:ge.INSPIRATION},{id:"4",content:"工作会议上提出的方案被采纳了,同事们的认可让我很开心。",createdAt:N-L*.5,sourceType:ge.MOOD},{id:"5",content:"午后的阳光透过百叶窗,在桌上投下一道道光影。时间仿佛静止了。",createdAt:N-R-L*6,sourceType:ge.MANUAL},{id:"6",content:"突然想到:如果每个人的记忆都能变成一本书,那会是什么样子?",createdAt:N-R-L*5,sourceType:ge.INSPIRATION},{id:"7",content:"下班路上遇到一只流浪猫,蹲下来和它对视了很久。它的眼睛很清澈。",createdAt:N-R-L*2,sourceType:ge.VOICE},{id:"8",content:"晚餐做了番茄炒蛋,虽然简单,但吃得很满足。生活的幸福就是这样。",createdAt:N-R-L,sourceType:ge.MOOD},{id:"9",content:"今天有点焦虑,deadline临近,但还有很多工作没完成。深呼吸,一步一步来。",createdAt:N-R*2-L*8,sourceType:ge.MOOD},{id:"10",content:"中午和老朋友视频通话,虽然各自忙碌,但友谊依然温暖。",createdAt:N-R*2-L*6,sourceType:ge.VOICE},{id:"11",content:"读到一句话:'不要因为走得太远,而忘记为什么出发。' 很有共鸣。",createdAt:N-R*2-L*3,sourceType:ge.MANUAL},{id:"12",content:"晚上加班到很晚,但看到项目进展顺利,疲惫中带着一丝成就感。",createdAt:N-R*2-L,sourceType:ge.MOOD},{id:"13",content:"周末去了郊外,看到一大片向日葵田。金黄色的花海,治愈了整个人。",createdAt:N-R*3-L*10,sourceType:ge.VOICE},{id:"14",content:"在书店翻到一本旧书,扉页上有人写的字:'愿你永远保持好奇心'。",createdAt:N-R*3-L*7,sourceType:ge.INSPIRATION},{id:"15",content:"下午茶时间,点了一块抹茶蛋糕。甜食真的能让心情变好。",createdAt:N-R*3-L*4,sourceType:ge.MOOD},{id:"16",content:"今天状态不太好,做什么都提不起劲。也许只是需要好好休息一下。",createdAt:N-R*4-L*9,sourceType:ge.MOOD},{id:"17",content:"妈妈打电话来,聊了很久。她说最近在学广场舞,听起来很开心。",createdAt:N-R*4-L*5,sourceType:ge.VOICE},{id:"18",content:"晚上看了一部老电影,《天使爱美丽》。生活需要一些小确幸和浪漫。",createdAt:N-R*4-L*2,sourceType:ge.MANUAL},{id:"19",content:"早起去菜市场,看到各种新鲜的蔬菜水果,感受到生活的烟火气。",createdAt:N-R*5-L*11,sourceType:ge.MOOD},{id:"20",content:"灵感:设计一个'慢生活'主题的摄影集,记录日常中被忽略的美好瞬间。",createdAt:N-R*5-L*8,sourceType:ge.INSPIRATION},{id:"21",content:"下午在公园散步,看到一对老夫妻手牵手。希望自己老了也能这样。",createdAt:N-R*5-L*4,sourceType:ge.VOICE},{id:"22",content:"工作上遇到了一些挫折,有点沮丧。但转念一想,这也是成长的机会。",createdAt:N-R*6-L*10,sourceType:ge.MOOD},{id:"23",content:"中午吃饭时,餐厅放的背景音乐是《月亮代表我的心》,突然很想家。",createdAt:N-R*6-L*6,sourceType:ge.MANUAL},{id:"24",content:"晚上和室友一起做饭,虽然厨艺不精,但笑声不断。这就是生活的乐趣。",createdAt:N-R*6-L*2,sourceType:ge.VOICE},{id:"25",content:"今天是周一,新的一周开始。给自己定个小目标:每天进步一点点。",createdAt:N-R*7-L*9,sourceType:ge.MOOD},{id:"26",content:"路过花店,买了一束雏菊。白色的花瓣,简单却很美。",createdAt:N-R*7-L*5,sourceType:ge.MANUAL},{id:"27",content:"晚上写日记时想到:记录生活不是为了回忆,而是为了更好地活在当下。",createdAt:N-R*7-L*1,sourceType:ge.INSPIRATION},{id:"28",content:"雨后的街道,空气中弥漫着泥土的清香。这是大自然的馈赠。",createdAt:N-R*10-L*7,sourceType:ge.VOICE},{id:"29",content:"完成了一个困扰很久的难题,那种豁然开朗的感觉太棒了!",createdAt:N-R*12-L*4,sourceType:ge.MOOD},{id:"30",content:"深夜听歌,突然被一句歌词击中:'我们都在时光里跌跌撞撞地成长'。",createdAt:N-R*14-L*2,sourceType:ge.MANUAL}]},vp=()=>{const N=Date.now();return[{id:"101",user:{name:"安静的观察者",avatarColor:"bg-indigo-200"},content:"有人也觉得自己在等待一些还没发生的事情吗?这是一种对未来的奇怪怀念。",createdAt:N-1e3*60*10,likeCount:12,isLiked:!1,commentCount:3},{id:"102",user:{name:"温柔的灵魂",avatarColor:"bg-pink-200"},content:"泡了一杯茶,看着蒸汽升起看了5分钟。这是我今天最美好的时刻。",createdAt:N-1e3*60*45,likeCount:28,isLiked:!0,commentCount:5},{id:"103",user:{name:"匿名",avatarColor:"bg-teal-200"},content:"今天我试着对自己更温柔一些。这比对别人温柔更难。",createdAt:N-1e3*60*60*2,likeCount:45,isLiked:!1,commentCount:8},{id:"104",user:{name:"云中漫步者",avatarColor:"bg-blue-200"},content:"今天的日落特别粉。",createdAt:N-1e3*60*60*5,likeCount:8,isLiked:!1,commentCount:0}]},pp={name:"小雅",birthday:"3月12日",moodStatus:"感觉平静而专注"},gp={isConnected:!0,batteryLevel:82,deviceName:"心灵伴侣吊坠"},xp=()=>{const N=Date.now(),L=3600*1e3;return[{id:"m1",type:_e.HAPPY,date:N-L*2,intensity:.9,x:25,y:30},{id:"m2",type:_e.HAPPY,date:N-L*5,intensity:.7,x:70,y:25},{id:"m3",type:_e.CALM,date:N-L*1,intensity:.8,x:35,y:45},{id:"m4",type:_e.CALM,date:N-L*8,intensity:.6,x:55,y:60},{id:"m5",type:_e.CALM,date:N-L*12,intensity:.75,x:20,y:70},{id:"m6",type:_e.TIRED,date:N-L*3,intensity:.5,x:65,y:50},{id:"m7",type:_e.TIRED,date:N-L*10,intensity:.4,x:45,y:75},{id:"m8",type:_e.ANXIOUS,date:N-L*4,intensity:.6,x:80,y:40},{id:"m9",type:_e.ANXIOUS,date:N-L*6,intensity:.55,x:30,y:55},{id:"m10",type:_e.HOPEFUL,date:N,intensity:.85,x:50,y:35},{id:"m11",type:_e.HOPEFUL,date:N-L*7,intensity:.7,x:75,y:65},{id:"m12",type:_e.HOPEFUL,date:N-L*11,intensity:.65,x:40,y:20}]},yp=()=>{const N=Date.now(),L=3600*1e3,R=24*L;return[{id:"i1",content:"如果云朵只是地球在做梦呢?",createdAt:N-L*2,tags:["随想","自然"]},{id:"i2",content:"设计概念:一个不显示数字的时钟,只用颜色代表一天的能量。",createdAt:N-L*5,tags:["设计","创意"]},{id:"i3",content:"旧书和咖啡的香气,是时光最温柔的记忆。",createdAt:N-L*8,tags:["生活","随想"]},{id:"i4",content:"记得在接电话前深呼吸,给自己三秒钟的准备时间。",createdAt:N-R,tags:["提醒","生活"]},{id:"i5",content:"也许每个人都是一座岛屿,而友谊是连接彼此的桥梁。",createdAt:N-R-L*3,tags:["随想","友情"]},{id:"i6",content:"学习新技能时,不要害怕犯错,错误是成长的阶梯。",createdAt:N-R*2,tags:["学习","成长"]},{id:"i7",content:"工作灵感:用番茄工作法,25分钟专注,5分钟放松。",createdAt:N-R*2-L*4,tags:["工作","提醒"]},{id:"i8",content:"雨后的空气里藏着大地的秘密。",createdAt:N-R*3,tags:["自然","随想"]},{id:"i9",content:"创意想法:设计一个记录每天小确幸的应用。",createdAt:N-R*3-L*6,tags:["创意","设计"]},{id:"i10",content:"真正的朋友,是那个在你沉默时也能理解你的人。",createdAt:N-R*4,tags:["友情","生活"]},{id:"i11",content:"每天写三件感恩的事,心态会慢慢变得更积极。",createdAt:N-R*5,tags:["成长","提醒"]},{id:"i12",content:"工作中遇到困难时,试着换个角度思考问题。",createdAt:N-R*5-L*2,tags:["工作","成长"]},{id:"i13",content:"学习笔记:费曼学习法 - 用简单的语言解释复杂的概念。",createdAt:N-R*6,tags:["学习","工作"]},{id:"i14",content:"窗外的鸟鸣声,是大自然送给城市的礼物。",createdAt:N-R*7,tags:["自然","生活"]},{id:"i15",content:"设计理念:少即是多,简洁才是最高级的美。",createdAt:N-R*8,tags:["设计","随想"]}]},Sp=()=>{const N=Date.now(),L=3600*1e3,R=24*L;return[{id:"t1",title:"慢慢喝一杯水",createdAt:N,scheduledAt:N+L/2,isDone:!1,category:"health"},{id:"t2",title:"读《小王子》20页",createdAt:N-L,scheduledAt:N+L*2,isDone:!1,category:"life"},{id:"t3",title:"回复小雪关于项目的邮件",createdAt:N-L*4,scheduledAt:N+R,isDone:!1,category:"work"},{id:"t4",title:"整理学习笔记",createdAt:N-L*6,scheduledAt:N+R,isDone:!1,category:"study"},{id:"t5",title:"晚上8点运动30分钟",createdAt:N-R,scheduledAt:N+L*8,isDone:!1,category:"health"},{id:"t6",title:"准备明天的会议材料",createdAt:N-R,scheduledAt:N+R,isDone:!1,category:"work"},{id:"t7",title:"买鲜花",createdAt:N-R,isDone:!0,category:"life"},{id:"t8",title:"完成英语作业",createdAt:N-R*2,isDone:!0,category:"study"},{id:"t9",title:"给植物浇水",createdAt:N-R*2,isDone:!0,category:"life"}]};function bp(){var se;const[N,L]=ie.useState(Xt.HOME),[R,C]=ie.useState(hp()),[b,s]=ie.useState(vp()),[p,v]=ie.useState(xp()),[c,m]=ie.useState(yp()),[r,x]=ie.useState(Sp()),[g,u]=ie.useState(!0),[o,f]=ie.useState(null),[y,T]=ie.useState(),[z,D]=ie.useState(),[O,S]=ie.useState(!1),[M,j]=ie.useState(!1),[w,B]=ie.useState(null);ie.useEffect(()=>{U()},[]);const U=async()=>{var ne,te;try{u(!0),f(null);const[fe,he,we,$e,Le]=await Promise.all([ut.getRecords().catch(()=>({records:[]})),ut.getMoods().catch(()=>({moods:[]})),ut.getInspirations().catch(()=>({inspirations:[]})),ut.getTodos().catch(()=>({todos:[]})),ut.getUserConfig().catch(()=>null)]);fe.records.length>0&&C(fe.records.map(rp)),he.moods.length>0&&v(he.moods.map((Qe,nl)=>op(Qe,nl))),we.inspirations.length>0&&m(we.inspirations.map(fp)),$e.todos.length>0&&x($e.todos.map(mp)),(ne=Le==null?void 0:Le.character)!=null&&ne.image_url&&T(Le.character.image_url),(te=Le==null?void 0:Le.character)!=null&&te.preferences&&D(Le.character.preferences)}catch(fe){console.error("Failed to load data:",fe),f("Failed to load data from server. Using mock data.")}finally{u(!1)}},H=(se=R.filter(ne=>ne.sourceType===ge.VOICE).sort((ne,te)=>te.createdAt-ne.createdAt)[0])==null?void 0:se.content,E=async ne=>{try{return await ut.chatWithAI(ne)}catch(te){return console.error("Failed to chat:",te),"抱歉,我现在有点累了,稍后再聊好吗?"}},Q="bg-[radial-gradient(ellipse_at_top_right,_var(--tw-gradient-stops))] from-purple-100 via-pink-50 to-blue-50",ee=ne=>{console.log(`Action clicked: ${ne}`),ne===jt.MOOD?B(jt.MOOD):ne===jt.INSPIRATION?B(jt.INSPIRATION):ne===jt.TODO&&B(jt.TODO)},P=()=>{B(null)},V=ne=>{const te={id:Date.now().toString(),user:{name:"Me",avatarColor:"bg-purple-300"},content:ne,createdAt:Date.now(),likeCount:0,isLiked:!1,commentCount:0};s([te,...b])},K=async(ne,te)=>{try{te&&console.log("Voice input:",ne);const fe=await ut.processInput(void 0,ne);await U(),console.log("Inspiration added:",fe)}catch(fe){console.error("Failed to add inspiration:",fe),alert("添加灵感失败,请重试")}},le=()=>{console.log("Add todo clicked")},re=async ne=>{const te=r.find(he=>he.id===ne);if(!te)return;const fe=te.isDone?"pending":"completed";x(r.map(he=>he.id===ne?{...he,isDone:!he.isDone}:he));try{await ut.updateTodoStatus(ne,fe)}catch(he){console.error("Failed to update todo:",he),x(r.map(we=>we.id===ne?{...we,isDone:te.isDone}:we))}},me=async ne=>{try{console.log("Generating character with preferences:",ne);const te=await ut.generateCharacter(ne);console.log("Character generated:",te),T(te.image_url),D(te.preferences),alert("AI 形象生成成功!")}catch(te){throw console.error("Failed to generate character:",te),te}},Y=ne=>{w&&B(null),L(ne)},F=()=>{j(!0)},ae=N===Xt.HOME;return h.jsxs("div",{className:`relative w-full h-screen overflow-hidden ${Q} text-slate-700`,children:[h.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none mix-blend-multiply bg-[url('https://grainy-gradients.vercel.app/noise.svg')]"}),h.jsxs("main",{className:"relative flex flex-col h-full items-center justify-between",children:[ae&&!w&&h.jsxs(h.Fragment,{children:[h.jsx(Ov,{onActionClick:ee}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full relative pt-24 pb-12",children:[h.jsx("div",{className:"absolute top-28 opacity-60 text-sm font-light tracking-widest text-slate-500 animate-pulse delay-700",children:"I'm here with you"}),h.jsx(zv,{imageUrl:y,latestRecord:H,onGreeting:ne=>console.log("AI greeting:",ne),onOpenChat:F}),h.jsx("div",{className:"mt-8 w-full",children:h.jsx(up,{onRecordComplete:U})})]}),h.jsx(Rv,{onClick:()=>S(!0)})]}),N===Xt.RECORD&&!w&&h.jsx(qv,{items:R}),N===Xt.COMMUNITY&&!w&&h.jsx(Qv,{posts:b,onAddPost:V}),N===Xt.MINE&&!w&&h.jsx(Jv,{profile:pp,deviceStatus:gp}),w===jt.MOOD&&h.jsx(ep,{items:p,onClose:P,characterImageUrl:y,onSendMessage:E}),w===jt.INSPIRATION&&h.jsx(np,{items:c,onClose:P,onAdd:K,characterImageUrl:y,onSendMessage:E}),w===jt.TODO&&h.jsx(sp,{items:r,onClose:P,onAdd:le,onToggleItem:re,characterImageUrl:y,onSendMessage:E}),h.jsx(Uv,{currentTab:N,onTabChange:Y})]}),h.jsx(Vv,{isOpen:O,onClose:()=>S(!1),onGenerate:me,onSelectHistory:ne=>{T(ne)},currentPreferences:z,currentImageUrl:y}),h.jsx(vs,{isOpen:M,onClose:()=>j(!1),characterImageUrl:y,onSendMessage:E})]})}const i0=document.getElementById("root");if(!i0)throw new Error("Could not find root element to mount to");const Ap=Bh.createRoot(i0);Ap.render(h.jsx(Th.StrictMode,{children:h.jsx(bp,{})}));