diff --git a/.DS_Store b/.DS_Store index 68a5c13..fc3b8cb 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.firebase/hosting.ZGlzdA.cache b/.firebase/hosting.ZGlzdA.cache index 62f44e6..30a5ce7 100644 --- a/.firebase/hosting.ZGlzdA.cache +++ b/.firebase/hosting.ZGlzdA.cache @@ -1,11 +1,13 @@ -index.html,1749845138732,a917111ad8ce6785e91b6c6aa2b19b5c654b047053d6db6555c307edb771e802 -vite.svg,1749845138228,12b282beddfe94d624e7f1155761299a42ce1e3eac8053ebe3f38bd1fa04816c -assets/index-BEKbNBMC.css,1749845138731,d983ac3a9adae79d7fbad53c93a5ec12acd575eb9c07dd8150d96c1e25062c53 -assets/purify.es-CQJ0hv7W.js,1749845138731,3acad7986851f0509b17d980c4bc827d53a8e421f17e370894dbf2d4a0c664a6 -assets/LogoImage2-CnRDdseu.png,1749845138732,a66cf9e4a92f730fb63be83da1b3a6737a0d34799ecc5491e8f4bedb65c1cec5 -assets/LogoImage1-BCZxbJ3r.png,1749845138732,0a6b7b39cda96fbc44f23ca5185f6e4d6c4e7dc144d58e6c3ffb6550a3e4b4ac -assets/LogoHeader-CUjJw69W.png,1749845138731,ccf0f72db9f9c41a70b0c04e254bcecaaa3888895bcf527f149d9ec7f034ea77 -assets/index.es-B4RW4VUM.js,1749845138732,640645992e0084f5d2fce79c1fb1877a3b0fabe19c50a6f2e705c54d4be1e242 -assets/BannerImage-BOAaKFKq.png,1749845138731,bd2c190e091547aff77f293723e5aa5b5a0c9bb54b046d34a4b6ab6694d74a97 -assets/html2canvas.esm-CBrSDip1.js,1749845138731,45cccd3537740565dfeff6c5791e8f548d813230bc75852908f9cd94dc95a0cd -assets/index-ftgeEDYX.js,1749845138732,d433f26d410452567bdfdbafe3f3bb446775eb90ff71a35c04d226efe1ef78f8 +index.html,1749989256616,474429312b97f7883e2a55ffd0d5512ac189a8c263f8783fa13b0afdb1eb85f5 +vite.svg,1749989255852,12b282beddfe94d624e7f1155761299a42ce1e3eac8053ebe3f38bd1fa04816c +assets/index-KKYGH1cM.css,1749989256617,f4308d34365633cc77d689ba983b6e9975a8680a7b3e8b3d9062ac160b452a76 +assets/LogoImage2-CnRDdseu.png,1749989256616,a66cf9e4a92f730fb63be83da1b3a6737a0d34799ecc5491e8f4bedb65c1cec5 +assets/ball-2L3qYoA5.png,1749989256616,0e8d7928863803039d5048359f9a54538133081f818f5fcde6f9ddf4282c9c18 +assets/LogoHeader-CUjJw69W.png,1749989256616,ccf0f72db9f9c41a70b0c04e254bcecaaa3888895bcf527f149d9ec7f034ea77 +assets/LogoImage1-BCZxbJ3r.png,1749989256617,0a6b7b39cda96fbc44f23ca5185f6e4d6c4e7dc144d58e6c3ffb6550a3e4b4ac +assets/LogoImage4-BLasCPcK.png,1749989256616,2b5d13b40e30f34278efbb79cfb718524a72d19c48ef3a05a73f752a6e0e3480 +assets/BannerImage-BOAaKFKq.png,1749989256617,bd2c190e091547aff77f293723e5aa5b5a0c9bb54b046d34a4b6ab6694d74a97 +assets/Lizard-j-rDX4sN.png,1749989256617,11d4a15ba7b59919d352f1fc5cd97acdf68fa2877120ae46a88c38ca0127f628 +assets/Qing-BHvJUCZo.png,1749989256617,7c46e13fdb2a66e64208a1f458d8dbb94932e4bcb03a02a17473185331593dd8 +assets/Eleanor-BaOjiqMk.png,1749989256617,3e1a0aed180077dac941315c7ee29f89c69ab942ccbe27830665cb6ff846773e +assets/index-DJdyAr2J.js,1749989256618,2dbce7cf64a8953ed64ecc6d1bc472464f4e1ac22040e88ca07430746c493a42 diff --git a/check_storage.js b/check_storage.js new file mode 100644 index 0000000..396cd57 --- /dev/null +++ b/check_storage.js @@ -0,0 +1 @@ +console.log(localStorage.getItem('emotionReadings')) diff --git a/dist/assets/Eleanor-BaOjiqMk.png b/dist/assets/Eleanor-BaOjiqMk.png new file mode 100644 index 0000000..f8f9c67 Binary files /dev/null and b/dist/assets/Eleanor-BaOjiqMk.png differ diff --git a/dist/assets/Lizard-j-rDX4sN.png b/dist/assets/Lizard-j-rDX4sN.png new file mode 100644 index 0000000..efd78ab Binary files /dev/null and b/dist/assets/Lizard-j-rDX4sN.png differ diff --git a/dist/assets/LogoImage4-BLasCPcK.png b/dist/assets/LogoImage4-BLasCPcK.png new file mode 100644 index 0000000..28c7e5b Binary files /dev/null and b/dist/assets/LogoImage4-BLasCPcK.png differ diff --git a/dist/assets/Qing-BHvJUCZo.png b/dist/assets/Qing-BHvJUCZo.png new file mode 100644 index 0000000..18552e7 Binary files /dev/null and b/dist/assets/Qing-BHvJUCZo.png differ diff --git a/dist/assets/ball-2L3qYoA5.png b/dist/assets/ball-2L3qYoA5.png new file mode 100644 index 0000000..07bf36e Binary files /dev/null and b/dist/assets/ball-2L3qYoA5.png differ diff --git a/dist/assets/index-7k0isLnD.js b/dist/assets/index-7k0isLnD.js deleted file mode 100644 index 33b3494..0000000 --- a/dist/assets/index-7k0isLnD.js +++ /dev/null @@ -1,347 +0,0 @@ -var iN=Object.defineProperty;var aN=(e,t,r)=>t in e?iN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var A0=(e,t,r)=>aN(e,typeof t!="symbol"?t+"":t,r);function sN(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var X4=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function oN(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var vd={exports:{}},k4={};/** - * @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 FL;function lN(){if(FL)return k4;FL=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,i,a){var s=null;if(a!==void 0&&(s=""+a),i.key!==void 0&&(s=""+i.key),"key"in i){a={};for(var u in i)u!=="key"&&(a[u]=i[u])}else a=i;return i=a.ref,{$$typeof:e,type:n,key:s,ref:i!==void 0?i:null,props:a}}return k4.Fragment=t,k4.jsx=r,k4.jsxs=r,k4}var _L;function uN(){return _L||(_L=1,vd.exports=lN()),vd.exports}var B=uN(),Ld={exports:{}},T4={},yd={exports:{}},Ed={};/** - * @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 kL;function cN(){return kL||(kL=1,function(e){function t(te,le){var fe=te.length;te.push(le);e:for(;0>>1,Y=te[Le];if(0>>1;Lei(Ae,fe))Cei(rt,Ae)?(te[Le]=rt,te[Ce]=fe,Le=Ce):(te[Le]=Ae,te[de]=fe,Le=de);else if(Cei(rt,fe))te[Le]=rt,te[Ce]=fe,Le=Ce;else break e}}return le}function i(te,le){var fe=te.sortIndex-le.sortIndex;return fe!==0?fe:te.id-le.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,u=s.now();e.unstable_now=function(){return s.now()-u}}var c=[],f=[],h=1,p=null,C=3,y=!1,E=!1,w=!1,I=!1,F=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function R(te){for(var le=r(f);le!==null;){if(le.callback===null)n(f);else if(le.startTime<=te)n(f),le.sortIndex=le.expirationTime,t(c,le);else break;le=r(f)}}function D(te){if(w=!1,R(te),!E)if(r(c)!==null)E=!0,P||(P=!0,M());else{var le=r(f);le!==null&&pe(D,le.startTime-te)}}var P=!1,U=-1,O=5,Z=-1;function G(){return I?!0:!(e.unstable_now()-Zte&&G());){var Le=p.callback;if(typeof Le=="function"){p.callback=null,C=p.priorityLevel;var Y=Le(p.expirationTime<=te);if(te=e.unstable_now(),typeof Y=="function"){p.callback=Y,R(te),le=!0;break t}p===r(c)&&n(c),R(te)}else n(c);p=r(c)}if(p!==null)le=!0;else{var ae=r(f);ae!==null&&pe(D,ae.startTime-te),le=!1}}break e}finally{p=null,C=fe,y=!1}le=void 0}}finally{le?M():P=!1}}}var M;if(typeof S=="function")M=function(){S($)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,ce=j.port2;j.port1.onmessage=$,M=function(){ce.postMessage(null)}}else M=function(){F($,0)};function pe(te,le){U=F(function(){te(e.unstable_now())},le)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(te){te.callback=null},e.unstable_forceFrameRate=function(te){0>te||125Le?(te.sortIndex=fe,t(f,te),r(c)===null&&te===r(f)&&(w?(k(U),U=-1):w=!0,pe(D,fe-Le))):(te.sortIndex=Y,t(c,te),E||y||(E=!0,P||(P=!0,M()))),te},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(te){var le=C;return function(){var fe=C;C=le;try{return te.apply(this,arguments)}finally{C=fe}}}}(Ed)),Ed}var TL;function fN(){return TL||(TL=1,yd.exports=cN()),yd.exports}var xd={exports:{}},P0={};/** - * @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 RL;function AN(){if(RL)return P0;RL=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function C(Y){return Y===null||typeof Y!="object"?null:(Y=p&&Y[p]||Y["@@iterator"],typeof Y=="function"?Y:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,w={};function I(Y,ae,de){this.props=Y,this.context=ae,this.refs=w,this.updater=de||y}I.prototype.isReactComponent={},I.prototype.setState=function(Y,ae){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,ae,"setState")},I.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function F(){}F.prototype=I.prototype;function k(Y,ae,de){this.props=Y,this.context=ae,this.refs=w,this.updater=de||y}var S=k.prototype=new F;S.constructor=k,E(S,I.prototype),S.isPureReactComponent=!0;var R=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},P=Object.prototype.hasOwnProperty;function U(Y,ae,de,Ae,Ce,rt){return de=rt.ref,{$$typeof:e,type:Y,key:ae,ref:de!==void 0?de:null,props:rt}}function O(Y,ae){return U(Y.type,ae,void 0,void 0,void 0,Y.props)}function Z(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===e}function G(Y){var ae={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(de){return ae[de]})}var $=/\/+/g;function M(Y,ae){return typeof Y=="object"&&Y!==null&&Y.key!=null?G(""+Y.key):ae.toString(36)}function j(){}function ce(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status=="string"?Y.then(j,j):(Y.status="pending",Y.then(function(ae){Y.status==="pending"&&(Y.status="fulfilled",Y.value=ae)},function(ae){Y.status==="pending"&&(Y.status="rejected",Y.reason=ae)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function pe(Y,ae,de,Ae,Ce){var rt=typeof Y;(rt==="undefined"||rt==="boolean")&&(Y=null);var We=!1;if(Y===null)We=!0;else switch(rt){case"bigint":case"string":case"number":We=!0;break;case"object":switch(Y.$$typeof){case e:case t:We=!0;break;case h:return We=Y._init,pe(We(Y._payload),ae,de,Ae,Ce)}}if(We)return Ce=Ce(Y),We=Ae===""?"."+M(Y,0):Ae,R(Ce)?(de="",We!=null&&(de=We.replace($,"$&/")+"/"),pe(Ce,ae,de,"",function(ke){return ke})):Ce!=null&&(Z(Ce)&&(Ce=O(Ce,de+(Ce.key==null||Y&&Y.key===Ce.key?"":(""+Ce.key).replace($,"$&/")+"/")+We)),ae.push(Ce)),1;We=0;var st=Ae===""?".":Ae+":";if(R(Y))for(var Be=0;Be"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),bd.exports=hN(),bd.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 UL;function gN(){if(UL)return T4;UL=1;var e=fN(),t=zp(),r=dN();function n(o){var l="https://react.dev/errors/"+o;if(1Y||(o.current=Le[Y],Le[Y]=null,Y--)}function Ae(o,l){Y++,Le[Y]=o.current,o.current=l}var Ce=ae(null),rt=ae(null),We=ae(null),st=ae(null);function Be(o,l){switch(Ae(We,l),Ae(rt,o),Ae(Ce,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?aL(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=aL(l),o=sL(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}de(Ce),Ae(Ce,o)}function ke(){de(Ce),de(rt),de(We)}function Oe(o){o.memoizedState!==null&&Ae(st,o);var l=Ce.current,A=sL(l,o.type);l!==A&&(Ae(rt,o),Ae(Ce,A))}function _e(o){rt.current===o&&(de(Ce),de(rt)),st.current===o&&(de(st),D4._currentValue=fe)}var ct=Object.prototype.hasOwnProperty,bt=e.unstable_scheduleCallback,Dt=e.unstable_cancelCallback,Nt=e.unstable_shouldYield,qt=e.unstable_requestPaint,xt=e.unstable_now,Te=e.unstable_getCurrentPriorityLevel,Ot=e.unstable_ImmediatePriority,Kt=e.unstable_UserBlockingPriority,dt=e.unstable_NormalPriority,Pt=e.unstable_LowPriority,Ft=e.unstable_IdlePriority,Ut=e.log,zt=e.unstable_setDisableYieldValue,o0=null,It=null;function Mt(o){if(typeof Ut=="function"&&zt(o),It&&typeof It.setStrictMode=="function")try{It.setStrictMode(o0,o)}catch{}}var Vt=Math.clz32?Math.clz32:Ke,a0=Math.log,oe=Math.LN2;function Ke(o){return o>>>=0,o===0?32:31-(a0(o)/oe|0)|0}var nt=256,it=4194304;function ge(o){var l=o&42;if(l!==0)return l;switch(o&-o){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:case 262144:case 524288:case 1048576:case 2097152:return o&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function ze(o,l,A){var m=o.pendingLanes;if(m===0)return 0;var x=0,Q=o.suspendedLanes,W=o.pingedLanes;o=o.warmLanes;var se=m&134217727;return se!==0?(m=se&~Q,m!==0?x=ge(m):(W&=se,W!==0?x=ge(W):A||(A=se&~o,A!==0&&(x=ge(A))))):(se=m&~Q,se!==0?x=ge(se):W!==0?x=ge(W):A||(A=m&~o,A!==0&&(x=ge(A)))),x===0?0:l!==0&&l!==x&&(l&Q)===0&&(Q=x&-x,A=l&-l,Q>=A||Q===32&&(A&4194048)!==0)?l:x}function X(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function ot(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 Ht(){var o=nt;return nt<<=1,(nt&4194048)===0&&(nt=256),o}function N(){var o=it;return it<<=1,(it&62914560)===0&&(it=4194304),o}function He(o){for(var l=[],A=0;31>A;A++)l.push(o);return l}function Ve(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function ne(o,l,A,m,x,Q){var W=o.pendingLanes;o.pendingLanes=A,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=A,o.entangledLanes&=A,o.errorRecoveryDisabledLanes&=A,o.shellSuspendCounter=0;var se=o.entanglements,Ee=o.expirationTimes,Ye=o.hiddenUpdates;for(A=W&~A;0)":-1x||Ee[m]!==Ye[x]){var At=` -`+Ee[m].replace(" at new "," at ");return o.displayName&&At.includes("")&&(At=At.replace("",o.displayName)),At}while(1<=m&&0<=x);break}}}finally{Xr=!1,Error.prepareStackTrace=A}return(A=o?o.displayName||o.name:"")?vn(A):""}function K1(o){switch(o.tag){case 26:case 27:case 5:return vn(o.type);case 16:return vn("Lazy");case 13:return vn("Suspense");case 19:return vn("SuspenseList");case 0:case 15:return Gn(o.type,!1);case 11:return Gn(o.type.render,!1);case 1:return Gn(o.type,!0);case 31:return vn("Activity");default:return""}}function re(o){try{var l="";do l+=K1(o),o=o.return;while(o);return l}catch(A){return` -Error generating stack: `+A.message+` -`+A.stack}}function ee(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function xe(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Ie(o){var l=xe(o)?"checked":"value",A=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),m=""+o[l];if(!o.hasOwnProperty(l)&&typeof A<"u"&&typeof A.get=="function"&&typeof A.set=="function"){var x=A.get,Q=A.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return x.call(this)},set:function(W){m=""+W,Q.call(this,W)}}),Object.defineProperty(o,l,{enumerable:A.enumerable}),{getValue:function(){return m},setValue:function(W){m=""+W},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Ue(o){o._valueTracker||(o._valueTracker=Ie(o))}function tt(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var A=l.getValue(),m="";return o&&(m=xe(o)?o.checked?"true":"false":o.value),o=m,o!==A?(l.setValue(o),!0):!1}function Ct(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var pt=/[\n"\\]/g;function Bt(o){return o.replace(pt,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Et(o,l,A,m,x,Q,W,se){o.name="",W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"?o.type=W:o.removeAttribute("type"),l!=null?W==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+ee(l)):o.value!==""+ee(l)&&(o.value=""+ee(l)):W!=="submit"&&W!=="reset"||o.removeAttribute("value"),l!=null?e0(o,W,ee(l)):A!=null?e0(o,W,ee(A)):m!=null&&o.removeAttribute("value"),x==null&&Q!=null&&(o.defaultChecked=!!Q),x!=null&&(o.checked=x&&typeof x!="function"&&typeof x!="symbol"),se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"?o.name=""+ee(se):o.removeAttribute("name")}function Wt(o,l,A,m,x,Q,W,se){if(Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"&&(o.type=Q),l!=null||A!=null){if(!(Q!=="submit"&&Q!=="reset"||l!=null))return;A=A!=null?""+ee(A):"",l=l!=null?""+ee(l):A,se||l===o.value||(o.value=l),o.defaultValue=l}m=m??x,m=typeof m!="function"&&typeof m!="symbol"&&!!m,o.checked=se?o.checked:!!m,o.defaultChecked=!!m,W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"&&(o.name=W)}function e0(o,l,A){l==="number"&&Ct(o.ownerDocument)===o||o.defaultValue===""+A||(o.defaultValue=""+A)}function L0(o,l,A,m){if(o=o.options,l){l={};for(var x=0;x"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),t1=!1;if(Vn)try{var M1={};Object.defineProperty(M1,"passive",{get:function(){t1=!0}}),window.addEventListener("test",M1,M1),window.removeEventListener("test",M1,M1)}catch{t1=!1}var Fr=null,Za=null,pa=null;function _r(){if(pa)return pa;var o,l=Za,A=l.length,m,x="value"in Fr?Fr.value:Fr.textContent,Q=x.length;for(o=0;o=mi),Ql=" ",Fl=!1;function Ca(o,l){switch(o){case"keyup":return B5.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _l(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var va=!1;function $1(o,l){switch(o){case"compositionend":return _l(l);case"keypress":return l.which!==32?null:(Fl=!0,Ql);case"textInput":return o=l.data,o===Ql&&Fl?null:o;default:return null}}function uc(o,l){if(va)return o==="compositionend"||!C1&&Ca(o,l)?(o=_r(),pa=Za=Fr=null,va=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:A,offset:l-o};o=m}e:{for(;A;){if(A.nextSibling){A=A.nextSibling;break e}A=A.parentNode}A=void 0}A=Ml(A)}}function Nl(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?Nl(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function Ol(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=Ct(o.document);l instanceof o.HTMLIFrameElement;){try{var A=typeof l.contentWindow.location.href=="string"}catch{A=!1}if(A)o=l.contentWindow;else break;l=Ct(o.document)}return l}function na(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var Ac=Vn&&"documentMode"in document&&11>=document.documentMode,U1=null,Qo=null,a2=null,Ul=!1;function T2(o,l,A){var m=A.window===A?A.document:A.nodeType===9?A:A.ownerDocument;Ul||U1==null||U1!==Ct(m)||(m=U1,"selectionStart"in m&&na(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),a2&&Ci(a2,m)||(a2=m,m=R6(Qo,"onSelect"),0>=W,x-=W,aa=1<<32-Vt(l)+x|A<Q?Q:8;var W=te.T,se={};te.T=se,g4(o,!1,l,A);try{var Ee=x(),Ye=te.S;if(Ye!==null&&Ye(se,Ee),Ee!==null&&typeof Ee=="object"&&typeof Ee.then=="function"){var At=K(Ee,m);Ko(o,l,At,ps(o))}else Ko(o,l,m,ps(o))}catch(vt){Ko(o,l,{then:function(){},status:"rejected",reason:vt},ps())}finally{le.p=Q,te.T=W}}function Wo(){}function Rs(o,l,A,m){if(o.tag!==5)throw Error(n(476));var x=Y2(o).queue;ls(o,x,l,fe,A===null?Wo:function(){return U5(o),A(m)})}function Y2(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:V1,lastRenderedState:fe},next:null};var A={};return l.next={memoizedState:A,baseState:A,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:V1,lastRenderedState:A},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function U5(o){var l=Y2(o).next.queue;Ko(o,l,{},ps())}function H5(){return si(D4)}function yi(){return Sn().memoizedState}function P5(){return Sn().memoizedState}function d4(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var A=ps();o=R0(A);var m=$r(l,o,A);m!==null&&(ms(m,l,A),V0(m,l,A)),l={cache:Uo()},o.payload=l;return}l=l.return}}function z5(o,l,A){var m=ps();A={lane:m,revertLane:0,action:A,hasEagerState:!1,eagerState:null,next:null},j5(o)?E6(l,A):(A=N2(o,l,A,m),A!==null&&(ms(A,o,m),oi(A,l,m)))}function qo(o,l,A){var m=ps();Ko(o,l,A,m)}function Ko(o,l,A,m){var x={lane:m,revertLane:0,action:A,hasEagerState:!1,eagerState:null,next:null};if(j5(o))E6(l,x);else{var Q=o.alternate;if(o.lanes===0&&(Q===null||Q.lanes===0)&&(Q=l.lastRenderedReducer,Q!==null))try{var W=l.lastRenderedState,se=Q(W,A);if(x.hasEagerState=!0,x.eagerState=se,zi(se,W))return n1(o,l,x,0),xn===null&&Ba(),!1}catch{}finally{}if(A=N2(o,l,x,m),A!==null)return ms(A,o,m),oi(A,l,m),!0}return!1}function g4(o,l,A,m){if(m={lane:2,revertLane:K7(),action:m,hasEagerState:!1,eagerState:null,next:null},j5(o)){if(l)throw Error(n(479))}else l=N2(o,A,m,2),l!==null&&ms(l,o,2)}function j5(o){var l=o.alternate;return o===O0||l!==null&&l===O0}function E6(o,l){Gl=mc=!0;var A=o.pending;A===null?l.next=l:(l.next=A.next,A.next=l),o.pending=l}function oi(o,l,A){if((A&4194048)!==0){var m=l.lanes;m&=o.pendingLanes,A|=m,l.lanes=A,Qe(o,A)}}var bc={readContext:si,use:_a,useCallback:cr,useContext:cr,useEffect:cr,useImperativeHandle:cr,useLayoutEffect:cr,useInsertionEffect:cr,useMemo:cr,useReducer:cr,useRef:cr,useState:cr,useDebugValue:cr,useDeferredValue:cr,useTransition:cr,useSyncExternalStore:cr,useId:cr,useHostTransitionStatus:cr,useFormState:cr,useActionState:cr,useOptimistic:cr,useMemoCache:cr,useCacheRefresh:cr},Jo={readContext:si,use:_a,useCallback:function(o,l){return Ti().memoizedState=[o,l===void 0?null:l],o},useContext:si,useEffect:U0,useImperativeHandle:function(o,l,A){A=A!=null?A.concat([o]):null,Mn(4194308,4,Zo.bind(null,l,o),A)},useLayoutEffect:function(o,l){return Mn(4194308,4,o,l)},useInsertionEffect:function(o,l){Mn(4,2,o,l)},useMemo:function(o,l){var A=Ti();l=l===void 0?null:l;var m=o();if(P2){Mt(!0);try{o()}finally{Mt(!1)}}return A.memoizedState=[m,l],m},useReducer:function(o,l,A){var m=Ti();if(A!==void 0){var x=A(l);if(P2){Mt(!0);try{A(l)}finally{Mt(!1)}}}else x=l;return m.memoizedState=m.baseState=x,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:x},m.queue=o,o=o.dispatch=z5.bind(null,O0,o),[m.memoizedState,o]},useRef:function(o){var l=Ti();return o={current:o},l.memoizedState=o},useState:function(o){o=c2(o);var l=o.queue,A=qo.bind(null,O0,l);return l.dispatch=A,[o.memoizedState,A]},useDebugValue:xc,useDeferredValue:function(o,l){var A=Ti();return h4(A,o,l)},useTransition:function(){var o=c2(!1);return o=ls.bind(null,O0,o.queue,!0,!1),Ti().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,A){var m=O0,x=Ti();if(ir){if(A===void 0)throw Error(n(407));A=A()}else{if(A=l(),xn===null)throw Error(n(349));(Cr&124)!==0||yc(m,l,A)}x.memoizedState=A;var Q={value:A,getSnapshot:l};return x.queue=Q,U0(zo.bind(null,m,Q,o),[o]),m.flags|=2048,f2(9,ka(),k5.bind(null,m,Q,A,l),null),A},useId:function(){var o=Ti(),l=xn.identifierPrefix;if(ir){var A=yn,m=aa;A=(m&~(1<<32-Vt(m)-1)).toString(32)+A,l="«"+l+"R"+A,A=S5++,0b0?(o1=d0,d0=null):o1=d0.sibling;var br=Je(Me,d0,Pe[b0],gt);if(br===null){d0===null&&(d0=o1);break}o&&d0&&br.alternate===null&&l(Me,d0),De=Q(br,De,b0),Z0===null?s0=br:Z0.sibling=br,Z0=br,d0=o1}if(b0===Pe.length)return A(Me,d0),ir&&Sa(Me,b0),s0;if(d0===null){for(;b0b0?(o1=d0,d0=null):o1=d0.sibling;var Lu=Je(Me,d0,br.value,gt);if(Lu===null){d0===null&&(d0=o1);break}o&&d0&&Lu.alternate===null&&l(Me,d0),De=Q(Lu,De,b0),Z0===null?s0=Lu:Z0.sibling=Lu,Z0=Lu,d0=o1}if(br.done)return A(Me,d0),ir&&Sa(Me,b0),s0;if(d0===null){for(;!br.done;b0++,br=Pe.next())br=vt(Me,br.value,gt),br!==null&&(De=Q(br,De,b0),Z0===null?s0=br:Z0.sibling=br,Z0=br);return ir&&Sa(Me,b0),s0}for(d0=m(d0);!br.done;b0++,br=Pe.next())br=Xe(d0,Me,b0,br.value,gt),br!==null&&(o&&br.alternate!==null&&d0.delete(br.key===null?b0:br.key),De=Q(br,De,b0),Z0===null?s0=br:Z0.sibling=br,Z0=br);return o&&d0.forEach(function(nN){return l(Me,nN)}),ir&&Sa(Me,b0),s0}function nn(Me,De,Pe,gt){if(typeof Pe=="object"&&Pe!==null&&Pe.type===E&&Pe.key===null&&(Pe=Pe.props.children),typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case C:e:{for(var s0=Pe.key;De!==null;){if(De.key===s0){if(s0=Pe.type,s0===E){if(De.tag===7){A(Me,De.sibling),gt=x(De,Pe.props.children),gt.return=Me,Me=gt;break e}}else if(De.elementType===s0||typeof s0=="object"&&s0!==null&&s0.$$typeof===O&&us(s0)===De.type){A(Me,De.sibling),gt=x(De,Pe.props),nu(gt,Pe),gt.return=Me,Me=gt;break e}A(Me,De);break}else l(Me,De);De=De.sibling}Pe.type===E?(gt=$a(Pe.props.children,Me.mode,gt,Pe.key),gt.return=Me,Me=gt):(gt=H1(Pe.type,Pe.key,Pe.props,null,Me.mode,gt),nu(gt,Pe),gt.return=Me,Me=gt)}return W(Me);case y:e:{for(s0=Pe.key;De!==null;){if(De.key===s0)if(De.tag===4&&De.stateNode.containerInfo===Pe.containerInfo&&De.stateNode.implementation===Pe.implementation){A(Me,De.sibling),gt=x(De,Pe.children||[]),gt.return=Me,Me=gt;break e}else{A(Me,De);break}else l(Me,De);De=De.sibling}gt=_i(Pe,Me.mode,gt),gt.return=Me,Me=gt}return W(Me);case O:return s0=Pe._init,Pe=s0(Pe._payload),nn(Me,De,Pe,gt)}if(pe(Pe))return I0(Me,De,Pe,gt);if(M(Pe)){if(s0=M(Pe),typeof s0!="function")throw Error(n(150));return Pe=s0.call(Pe),E0(Me,De,Pe,gt)}if(typeof Pe.then=="function")return nn(Me,De,Kn(Pe),gt);if(Pe.$$typeof===S)return nn(Me,De,oa(Me,Pe),gt);Ri(Me,Pe)}return typeof Pe=="string"&&Pe!==""||typeof Pe=="number"||typeof Pe=="bigint"?(Pe=""+Pe,De!==null&&De.tag===6?(A(Me,De.sibling),gt=x(De,Pe),gt.return=Me,Me=gt):(A(Me,De),gt=ai(Pe,Me.mode,gt),gt.return=Me,Me=gt),W(Me)):A(Me,De)}return function(Me,De,Pe,gt){try{ru=0;var s0=nn(Me,De,Pe,gt);return W2=null,s0}catch(d0){if(d0===i0||d0===ar)throw d0;var Z0=Fi(29,d0,null,Me.mode);return Z0.lanes=gt,Z0.return=Me,Z0}finally{}}}var cs=x6(!0),b6=x6(!1),a1=ae(null),Ns=null;function zr(o){var l=o.alternate;Ae(M0,M0.current&1),Ae(a1,o),Ns===null&&(l===null||jl.current!==null||l.memoizedState!==null)&&(Ns=o)}function tn(o){if(o.tag===22){if(Ae(M0,M0.current),Ae(a1,o),Ns===null){var l=o.alternate;l!==null&&l.memoizedState!==null&&(Ns=o)}}else F0()}function F0(){Ae(M0,M0.current),Ae(a1,a1.current)}function H0(o){de(a1),Ns===o&&(Ns=null),de(M0)}var M0=ae(0);function Z1(o){for(var l=o;l!==null;){if(l.tag===13){var A=l.memoizedState;if(A!==null&&(A=A.dehydrated,A===null||A.data==="$?"||ld(A)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}function iu(o,l,A,m){l=o.memoizedState,A=A(m,l),A=A==null?l:h({},l,A),o.memoizedState=A,o.lanes===0&&(o.updateQueue.baseState=A)}var Bc={enqueueSetState:function(o,l,A){o=o._reactInternals;var m=ps(),x=R0(m);x.payload=l,A!=null&&(x.callback=A),l=$r(o,x,m),l!==null&&(ms(l,o,m),V0(l,o,m))},enqueueReplaceState:function(o,l,A){o=o._reactInternals;var m=ps(),x=R0(m);x.tag=1,x.payload=l,A!=null&&(x.callback=A),l=$r(o,x,m),l!==null&&(ms(l,o,m),V0(l,o,m))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var A=ps(),m=R0(A);m.tag=2,l!=null&&(m.callback=l),l=$r(o,m,A),l!==null&&(ms(l,o,A),V0(l,o,A))}};function Os(o,l,A,m,x,Q,W){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(m,Q,W):l.prototype&&l.prototype.isPureReactComponent?!Ci(A,m)||!Ci(x,Q):!0}function Jn(o,l,A,m){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(A,m),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(A,m),l.state!==o&&Bc.enqueueReplaceState(l,l.state,null)}function y1(o,l){var A=l;if("ref"in l){A={};for(var m in l)m!=="ref"&&(A[m]=l[m])}if(o=o.defaultProps){A===l&&(A=h({},A));for(var x in o)A[x]===void 0&&(A[x]=o[x])}return A}var fs=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)};function G5(o){fs(o)}function la(o){console.error(o)}function au(o){fs(o)}function q2(o,l){try{var A=o.onUncaughtError;A(l.value,{componentStack:l.stack})}catch(m){setTimeout(function(){throw m})}}function As(o,l,A){try{var m=o.onCaughtError;m(A.value,{componentStack:A.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function wc(o,l,A){return A=R0(A),A.tag=3,A.payload={element:null},A.callback=function(){q2(o,l)},A}function V5(o){return o=R0(o),o.tag=3,o}function Z5(o,l,A,m){var x=A.type.getDerivedStateFromError;if(typeof x=="function"){var Q=m.value;o.payload=function(){return x(Q)},o.callback=function(){As(l,A,m)}}var W=A.stateNode;W!==null&&typeof W.componentDidCatch=="function"&&(o.callback=function(){As(l,A,m),typeof x!="function"&&(Au===null?Au=new Set([this]):Au.add(this));var se=m.stack;this.componentDidCatch(m.value,{componentStack:se!==null?se:""})})}function Y5(o,l,A,m,x){if(A.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(l=A.alternate,l!==null&&Qa(l,A,x,!0),A=a1.current,A!==null){switch(A.tag){case 13:return Ns===null?V7():A.alternate===null&&li===0&&(li=3),A.flags&=-257,A.flags|=65536,A.lanes=x,m===Zi?A.flags|=16384:(l=A.updateQueue,l===null?A.updateQueue=new Set([m]):l.add(m),Y7(o,m,x)),!1;case 22:return A.flags|=65536,m===Zi?A.flags|=16384:(l=A.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([m])},A.updateQueue=l):(A=l.retryQueue,A===null?l.retryQueue=new Set([m]):A.add(m)),Y7(o,m,x)),!1}throw Error(n(435,A.tag))}return Y7(o,m,x),V7(),!1}if(ir)return l=a1.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=x,m!==w0&&(o=Error(n(422),{cause:m}),No(Qi(o,A)))):(m!==w0&&(l=Error(n(423),{cause:m}),No(Qi(l,A))),o=o.current.alternate,o.flags|=65536,x&=-x,o.lanes|=x,m=Qi(m,A),x=wc(o.stateNode,m,x),Fa(o,x),li!==4&&(li=2)),!1;var Q=Error(n(520),{cause:m});if(Q=Qi(Q,A),v4===null?v4=[Q]:v4.push(Q),li!==4&&(li=2),l===null)return!0;m=Qi(m,A),A=l;do{switch(A.tag){case 3:return A.flags|=65536,o=x&-x,A.lanes|=o,o=wc(A.stateNode,m,o),Fa(A,o),!1;case 1:if(l=A.type,Q=A.stateNode,(A.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||Q!==null&&typeof Q.componentDidCatch=="function"&&(Au===null||!Au.has(Q))))return A.flags|=65536,x&=-x,A.lanes|=x,x=V5(x),Z5(x,o,A,m),Fa(A,x),!1}A=A.return}while(A!==null);return!1}var A2=Error(n(461)),Xn=!1;function Qn(o,l,A,m){l.child=o===null?b6(l,null,A,m):cs(l,o.child,A,m)}function su(o,l,A,m,x){A=A.render;var Q=l.ref;if("ref"in m){var W={};for(var se in m)se!=="ref"&&(W[se]=m[se])}else W=m;return ss(l),m=Zl(o,l,A,W,Q,x),se=z2(),o!==null&&!Xn?(F5(o,l,x),je(o,l,x)):(ir&&se&&O2(l),l.flags|=1,Qn(o,l,m,x),l.child)}function W5(o,l,A,m,x){if(o===null){var Q=A.type;return typeof Q=="function"&&!s2(Q)&&Q.defaultProps===void 0&&A.compare===null?(l.tag=15,l.type=Q,q5(o,l,Q,m,x)):(o=H1(A.type,null,m,l,l.mode,x),o.ref=l.ref,o.return=l,l.child=o)}if(Q=o.child,!qe(o,x)){var W=Q.memoizedProps;if(A=A.compare,A=A!==null?A:Ci,A(W,m)&&o.ref===l.ref)return je(o,l,x)}return l.flags|=1,o=Gi(Q,m),o.ref=l.ref,o.return=l,l.child=o}function q5(o,l,A,m,x){if(o!==null){var Q=o.memoizedProps;if(Ci(Q,m)&&o.ref===l.ref)if(Xn=!1,l.pendingProps=m=Q,qe(o,x))(o.flags&131072)!==0&&(Xn=!0);else return l.lanes=o.lanes,je(o,l,x)}return g(o,l,A,m,x)}function ou(o,l,A){var m=l.pendingProps,x=m.children,Q=o!==null?o.memoizedState:null;if(m.mode==="hidden"){if((l.flags&128)!==0){if(m=Q!==null?Q.baseLanes|A:A,o!==null){for(x=l.child=o.child,Q=0;x!==null;)Q=Q|x.lanes|x.childLanes,x=x.sibling;l.childLanes=Q&~m}else l.childLanes=0,l.child=null;return K5(o,l,m,A)}if((A&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&mt(l,Q!==null?Q.cachePool:null),Q!==null?D5(l,Q):gc(),tn(l);else return l.lanes=l.childLanes=536870912,K5(o,l,Q!==null?Q.baseLanes|A:A,A)}else Q!==null?(mt(l,Q.cachePool),D5(l,Q),F0(),l.memoizedState=null):(o!==null&&mt(l,null),gc(),F0());return Qn(o,l,x,A),l.child}function K5(o,l,A,m){var x=$e();return x=x===null?null:{parent:Rn._currentValue,pool:x},l.memoizedState={baseLanes:A,cachePool:x},o!==null&&mt(l,null),gc(),tn(l),o!==null&&Qa(o,l,m,!0),null}function d(o,l){var A=l.ref;if(A===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof A!="function"&&typeof A!="object")throw Error(n(284));(o===null||o.ref!==A)&&(l.flags|=4194816)}}function g(o,l,A,m,x){return ss(l),A=Zl(o,l,A,m,void 0,x),m=z2(),o!==null&&!Xn?(F5(o,l,x),je(o,l,x)):(ir&&m&&O2(l),l.flags|=1,Qn(o,l,A,x),l.child)}function b(o,l,A,m,x,Q){return ss(l),l.updateQueue=null,A=A4(l,m,A,x),vc(o),m=z2(),o!==null&&!Xn?(F5(o,l,Q),je(o,l,Q)):(ir&&m&&O2(l),l.flags|=1,Qn(o,l,A,Q),l.child)}function T(o,l,A,m,x){if(ss(l),l.stateNode===null){var Q=Ia,W=A.contextType;typeof W=="object"&&W!==null&&(Q=si(W)),Q=new A(m,Q),l.memoizedState=Q.state!==null&&Q.state!==void 0?Q.state:null,Q.updater=Bc,l.stateNode=Q,Q._reactInternals=l,Q=l.stateNode,Q.props=m,Q.state=l.memoizedState,Q.refs={},ur(l),W=A.contextType,Q.context=typeof W=="object"&&W!==null?si(W):Ia,Q.state=l.memoizedState,W=A.getDerivedStateFromProps,typeof W=="function"&&(iu(l,A,W,m),Q.state=l.memoizedState),typeof A.getDerivedStateFromProps=="function"||typeof Q.getSnapshotBeforeUpdate=="function"||typeof Q.UNSAFE_componentWillMount!="function"&&typeof Q.componentWillMount!="function"||(W=Q.state,typeof Q.componentWillMount=="function"&&Q.componentWillMount(),typeof Q.UNSAFE_componentWillMount=="function"&&Q.UNSAFE_componentWillMount(),W!==Q.state&&Bc.enqueueReplaceState(Q,Q.state,null),_s(l,m,Q,x),Ho(),Q.state=l.memoizedState),typeof Q.componentDidMount=="function"&&(l.flags|=4194308),m=!0}else if(o===null){Q=l.stateNode;var se=l.memoizedProps,Ee=y1(A,se);Q.props=Ee;var Ye=Q.context,At=A.contextType;W=Ia,typeof At=="object"&&At!==null&&(W=si(At));var vt=A.getDerivedStateFromProps;At=typeof vt=="function"||typeof Q.getSnapshotBeforeUpdate=="function",se=l.pendingProps!==se,At||typeof Q.UNSAFE_componentWillReceiveProps!="function"&&typeof Q.componentWillReceiveProps!="function"||(se||Ye!==W)&&Jn(l,Q,m,W),u0=!1;var Je=l.memoizedState;Q.state=Je,_s(l,m,Q,x),Ho(),Ye=l.memoizedState,se||Je!==Ye||u0?(typeof vt=="function"&&(iu(l,A,vt,m),Ye=l.memoizedState),(Ee=u0||Os(l,A,Ee,m,Je,Ye,W))?(At||typeof Q.UNSAFE_componentWillMount!="function"&&typeof Q.componentWillMount!="function"||(typeof Q.componentWillMount=="function"&&Q.componentWillMount(),typeof Q.UNSAFE_componentWillMount=="function"&&Q.UNSAFE_componentWillMount()),typeof Q.componentDidMount=="function"&&(l.flags|=4194308)):(typeof Q.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=m,l.memoizedState=Ye),Q.props=m,Q.state=Ye,Q.context=W,m=Ee):(typeof Q.componentDidMount=="function"&&(l.flags|=4194308),m=!1)}else{Q=l.stateNode,y0(o,l),W=l.memoizedProps,At=y1(A,W),Q.props=At,vt=l.pendingProps,Je=Q.context,Ye=A.contextType,Ee=Ia,typeof Ye=="object"&&Ye!==null&&(Ee=si(Ye)),se=A.getDerivedStateFromProps,(Ye=typeof se=="function"||typeof Q.getSnapshotBeforeUpdate=="function")||typeof Q.UNSAFE_componentWillReceiveProps!="function"&&typeof Q.componentWillReceiveProps!="function"||(W!==vt||Je!==Ee)&&Jn(l,Q,m,Ee),u0=!1,Je=l.memoizedState,Q.state=Je,_s(l,m,Q,x),Ho();var Xe=l.memoizedState;W!==vt||Je!==Xe||u0||o!==null&&o.dependencies!==null&&i1(o.dependencies)?(typeof se=="function"&&(iu(l,A,se,m),Xe=l.memoizedState),(At=u0||Os(l,A,At,m,Je,Xe,Ee)||o!==null&&o.dependencies!==null&&i1(o.dependencies))?(Ye||typeof Q.UNSAFE_componentWillUpdate!="function"&&typeof Q.componentWillUpdate!="function"||(typeof Q.componentWillUpdate=="function"&&Q.componentWillUpdate(m,Xe,Ee),typeof Q.UNSAFE_componentWillUpdate=="function"&&Q.UNSAFE_componentWillUpdate(m,Xe,Ee)),typeof Q.componentDidUpdate=="function"&&(l.flags|=4),typeof Q.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof Q.componentDidUpdate!="function"||W===o.memoizedProps&&Je===o.memoizedState||(l.flags|=4),typeof Q.getSnapshotBeforeUpdate!="function"||W===o.memoizedProps&&Je===o.memoizedState||(l.flags|=1024),l.memoizedProps=m,l.memoizedState=Xe),Q.props=m,Q.state=Xe,Q.context=Ee,m=At):(typeof Q.componentDidUpdate!="function"||W===o.memoizedProps&&Je===o.memoizedState||(l.flags|=4),typeof Q.getSnapshotBeforeUpdate!="function"||W===o.memoizedProps&&Je===o.memoizedState||(l.flags|=1024),m=!1)}return Q=m,d(o,l),m=(l.flags&128)!==0,Q||m?(Q=l.stateNode,A=m&&typeof A.getDerivedStateFromError!="function"?null:Q.render(),l.flags|=1,o!==null&&m?(l.child=cs(l,o.child,null,x),l.child=cs(l,null,A,x)):Qn(o,l,A,x),l.memoizedState=Q.state,o=l.child):o=je(o,l,x),o}function z(o,l,A,m){return U2(),l.flags|=256,Qn(o,l,A,m),l.child}var q={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function he(o){return{baseLanes:o,cachePool:_t()}}function we(o,l,A){return o=o!==null?o.childLanes&~A:0,l&&(o|=Hs),o}function Se(o,l,A){var m=l.pendingProps,x=!1,Q=(l.flags&128)!==0,W;if((W=Q)||(W=o!==null&&o.memoizedState===null?!1:(M0.current&2)!==0),W&&(x=!0,l.flags&=-129),W=(l.flags&32)!==0,l.flags&=-33,o===null){if(ir){if(x?zr(l):F0(),ir){var se=cn,Ee;if(Ee=se){e:{for(Ee=se,se=j1;Ee.nodeType!==8;){if(!se){se=null;break e}if(Ee=d2(Ee.nextSibling),Ee===null){se=null;break e}}se=Ee}se!==null?(l.memoizedState={dehydrated:se,treeContext:es!==null?{id:aa,overflow:yn}:null,retryLane:536870912,hydrationErrors:null},Ee=Fi(18,null,null,0),Ee.stateNode=se,Ee.return=l,l.child=Ee,En=l,cn=null,Ee=!0):Ee=!1}Ee||rs(l)}if(se=l.memoizedState,se!==null&&(se=se.dehydrated,se!==null))return ld(se)?l.lanes=32:l.lanes=536870912,null;H0(l)}return se=m.children,m=m.fallback,x?(F0(),x=l.mode,se=jt({mode:"hidden",children:se},x),m=$a(m,x,A,null),se.return=l,m.return=l,se.sibling=m,l.child=se,x=l.child,x.memoizedState=he(A),x.childLanes=we(o,W,A),l.memoizedState=q,m):(zr(l),ut(l,se))}if(Ee=o.memoizedState,Ee!==null&&(se=Ee.dehydrated,se!==null)){if(Q)l.flags&256?(zr(l),l.flags&=-257,l=Zt(o,l,A)):l.memoizedState!==null?(F0(),l.child=o.child,l.flags|=128,l=null):(F0(),x=m.fallback,se=l.mode,m=jt({mode:"visible",children:m.children},se),x=$a(x,se,A,null),x.flags|=2,m.return=l,x.return=l,m.sibling=x,l.child=m,cs(l,o.child,null,A),m=l.child,m.memoizedState=he(A),m.childLanes=we(o,W,A),l.memoizedState=q,l=x);else if(zr(l),ld(se)){if(W=se.nextSibling&&se.nextSibling.dataset,W)var Ye=W.dgst;W=Ye,m=Error(n(419)),m.stack="",m.digest=W,No({value:m,source:null,stack:null}),l=Zt(o,l,A)}else if(Xn||Qa(o,l,A,!1),W=(A&o.childLanes)!==0,Xn||W){if(W=xn,W!==null&&(m=A&-A,m=(m&42)!==0?1:Rt(m),m=(m&(W.suspendedLanes|A))!==0?0:m,m!==0&&m!==Ee.retryLane))throw Ee.retryLane=m,wa(o,m),ms(W,o,m),A2;se.data==="$?"||V7(),l=Zt(o,l,A)}else se.data==="$?"?(l.flags|=192,l.child=o.child,l=null):(o=Ee.treeContext,cn=d2(se.nextSibling),En=l,ir=!0,ts=null,j1=!1,o!==null&&(Ur[Vi++]=aa,Ur[Vi++]=yn,Ur[Vi++]=es,aa=o.id,yn=o.overflow,es=l),l=ut(l,m.children),l.flags|=4096);return l}return x?(F0(),x=m.fallback,se=l.mode,Ee=o.child,Ye=Ee.sibling,m=Gi(Ee,{mode:"hidden",children:m.children}),m.subtreeFlags=Ee.subtreeFlags&65011712,Ye!==null?x=Gi(Ye,x):(x=$a(x,se,A,null),x.flags|=2),x.return=l,m.return=l,m.sibling=x,l.child=m,m=x,x=l.child,se=o.child.memoizedState,se===null?se=he(A):(Ee=se.cachePool,Ee!==null?(Ye=Rn._currentValue,Ee=Ee.parent!==Ye?{parent:Ye,pool:Ye}:Ee):Ee=_t(),se={baseLanes:se.baseLanes|A,cachePool:Ee}),x.memoizedState=se,x.childLanes=we(o,W,A),l.memoizedState=q,m):(zr(l),A=o.child,o=A.sibling,A=Gi(A,{mode:"visible",children:m.children}),A.return=l,A.sibling=null,o!==null&&(W=l.deletions,W===null?(l.deletions=[o],l.flags|=16):W.push(o)),l.child=A,l.memoizedState=null,A)}function ut(o,l){return l=jt({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function jt(o,l){return o=Fi(22,o,null,l),o.lanes=0,o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},o}function Zt(o,l,A){return cs(l,o.child,null,A),o=ut(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function kt(o,l,A){o.lanes|=l;var m=o.alternate;m!==null&&(m.lanes|=l),Oo(o.return,l,A)}function r0(o,l,A,m,x){var Q=o.memoizedState;Q===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:m,tail:A,tailMode:x}:(Q.isBackwards=l,Q.rendering=null,Q.renderingStartTime=0,Q.last=m,Q.tail=A,Q.tailMode=x)}function An(o,l,A){var m=l.pendingProps,x=m.revealOrder,Q=m.tail;if(Qn(o,l,m.children,A),m=M0.current,(m&2)!==0)m=m&1|2,l.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&kt(o,A,l);else if(o.tag===19)kt(o,A,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}m&=1}switch(Ae(M0,m),x){case"forwards":for(A=l.child,x=null;A!==null;)o=A.alternate,o!==null&&Z1(o)===null&&(x=A),A=A.sibling;A=x,A===null?(x=l.child,l.child=null):(x=A.sibling,A.sibling=null),r0(l,!1,x,A,Q);break;case"backwards":for(A=null,x=l.child,l.child=null;x!==null;){if(o=x.alternate,o!==null&&Z1(o)===null){l.child=x;break}o=x.sibling,x.sibling=A,A=x,x=o}r0(l,!0,A,null,Q);break;case"together":r0(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function je(o,l,A){if(o!==null&&(l.dependencies=o.dependencies),fu|=l.lanes,(A&l.childLanes)===0)if(o!==null){if(Qa(o,l,A,!1),(A&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,A=Gi(o,o.pendingProps),l.child=A,A.return=l;o.sibling!==null;)o=o.sibling,A=A.sibling=Gi(o,o.pendingProps),A.return=l;A.sibling=null}return l.child}function qe(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&i1(o)))}function at(o,l,A){switch(l.tag){case 3:Be(l,l.stateNode.containerInfo),is(l,Rn,o.memoizedState.cache),U2();break;case 27:case 5:Oe(l);break;case 4:Be(l,l.stateNode.containerInfo);break;case 10:is(l,l.type,l.memoizedProps.value);break;case 13:var m=l.memoizedState;if(m!==null)return m.dehydrated!==null?(zr(l),l.flags|=128,null):(A&l.child.childLanes)!==0?Se(o,l,A):(zr(l),o=je(o,l,A),o!==null?o.sibling:null);zr(l);break;case 19:var x=(o.flags&128)!==0;if(m=(A&l.childLanes)!==0,m||(Qa(o,l,A,!1),m=(A&l.childLanes)!==0),x){if(m)return An(o,l,A);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),Ae(M0,M0.current),m)break;return null;case 22:case 23:return l.lanes=0,ou(o,l,A);case 24:is(l,Rn,o.memoizedState.cache)}return je(o,l,A)}function Tt(o,l,A){if(o!==null)if(o.memoizedProps!==l.pendingProps)Xn=!0;else{if(!qe(o,A)&&(l.flags&128)===0)return Xn=!1,at(o,l,A);Xn=(o.flags&131072)!==0}else Xn=!1,ir&&(l.flags&1048576)!==0&&To(l,z1,l.index);switch(l.lanes=0,l.tag){case 16:e:{o=l.pendingProps;var m=l.elementType,x=m._init;if(m=x(m._payload),l.type=m,typeof m=="function")s2(m)?(o=y1(m,o),l.tag=1,l=T(null,l,m,o,A)):(l.tag=0,l=g(null,l,m,o,A));else{if(m!=null){if(x=m.$$typeof,x===R){l.tag=11,l=su(null,l,m,o,A);break e}else if(x===U){l.tag=14,l=W5(null,l,m,o,A);break e}}throw l=ce(m)||m,Error(n(306,l,""))}}return l;case 0:return g(o,l,l.type,l.pendingProps,A);case 1:return m=l.type,x=y1(m,l.pendingProps),T(o,l,m,x,A);case 3:e:{if(Be(l,l.stateNode.containerInfo),o===null)throw Error(n(387));m=l.pendingProps;var Q=l.memoizedState;x=Q.element,y0(o,l),_s(l,m,null,A);var W=l.memoizedState;if(m=W.cache,is(l,Rn,m),m!==Q.cache&&as(l,[Rn],A,!0),Ho(),m=W.element,Q.isDehydrated)if(Q={element:m,isDehydrated:!1,cache:W.cache},l.updateQueue.baseState=Q,l.memoizedState=Q,l.flags&256){l=z(o,l,m,A);break e}else if(m!==x){x=Qi(Error(n(424)),l),No(x),l=z(o,l,m,A);break e}else{switch(o=l.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(cn=d2(o.firstChild),En=l,ir=!0,ts=null,j1=!0,A=b6(l,null,m,A),l.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling}else{if(U2(),m===x){l=je(o,l,A);break e}Qn(o,l,m,A)}l=l.child}return l;case 26:return d(o,l),o===null?(A=dL(l.type,null,l.pendingProps,null))?l.memoizedState=A:ir||(A=l.type,o=l.pendingProps,m=N6(We.current).createElement(A),m[n0]=l,m[Yt]=o,x1(m,A,o),lr(m),l.stateNode=m):l.memoizedState=dL(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return Oe(l),o===null&&ir&&(m=l.stateNode=fL(l.type,l.pendingProps,We.current),En=l,j1=!0,x=cn,gu(l.type)?(ud=x,cn=d2(m.firstChild)):cn=x),Qn(o,l,l.pendingProps.children,A),d(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&ir&&((x=m=cn)&&(m=_M(m,l.type,l.pendingProps,j1),m!==null?(l.stateNode=m,En=l,cn=d2(m.firstChild),j1=!1,x=!0):x=!1),x||rs(l)),Oe(l),x=l.type,Q=l.pendingProps,W=o!==null?o.memoizedProps:null,m=Q.children,ad(x,Q)?m=null:W!==null&&ad(x,W)&&(l.flags|=32),l.memoizedState!==null&&(x=Zl(o,l,Yl,null,null,A),D4._currentValue=x),d(o,l),Qn(o,l,m,A),l.child;case 6:return o===null&&ir&&((o=A=cn)&&(A=kM(A,l.pendingProps,j1),A!==null?(l.stateNode=A,En=l,cn=null,o=!0):o=!1),o||rs(l)),null;case 13:return Se(o,l,A);case 4:return Be(l,l.stateNode.containerInfo),m=l.pendingProps,o===null?l.child=cs(l,null,m,A):Qn(o,l,m,A),l.child;case 11:return su(o,l,l.type,l.pendingProps,A);case 7:return Qn(o,l,l.pendingProps,A),l.child;case 8:return Qn(o,l,l.pendingProps.children,A),l.child;case 12:return Qn(o,l,l.pendingProps.children,A),l.child;case 10:return m=l.pendingProps,is(l,l.type,m.value),Qn(o,l,m.children,A),l.child;case 9:return x=l.type._context,m=l.pendingProps.children,ss(l),x=si(x),m=m(x),l.flags|=1,Qn(o,l,m,A),l.child;case 14:return W5(o,l,l.type,l.pendingProps,A);case 15:return q5(o,l,l.type,l.pendingProps,A);case 19:return An(o,l,A);case 31:return m=l.pendingProps,A=l.mode,m={mode:m.mode,children:m.children},o===null?(A=jt(m,A),A.ref=l.ref,l.child=A,A.return=l,l=A):(A=Gi(o.child,m),A.ref=l.ref,l.child=A,A.return=l,l=A),l;case 22:return ou(o,l,A);case 24:return ss(l),m=si(Rn),o===null?(x=$e(),x===null&&(x=xn,Q=Uo(),x.pooledCache=Q,Q.refCount++,Q!==null&&(x.pooledCacheLanes|=A),x=Q),l.memoizedState={parent:m,cache:x},ur(l),is(l,Rn,x)):((o.lanes&A)!==0&&(y0(o,l),_s(l,null,null,A),Ho()),x=o.memoizedState,Q=l.memoizedState,x.parent!==m?(x={parent:m,cache:m},l.memoizedState=x,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=x),is(l,Rn,m)):(m=Q.cache,is(l,Rn,m),m!==x.cache&&as(l,[Rn],A,!0))),Qn(o,l,l.pendingProps.children,A),l.child;case 29:throw l.pendingProps}throw Error(n(156,l.tag))}function h0(o){o.flags|=4}function jr(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!vL(l)){if(l=a1.current,l!==null&&((Cr&4194048)===Cr?Ns!==null:(Cr&62914560)!==Cr&&(Cr&536870912)===0||l!==Ns))throw Ze=Zi,fn;o.flags|=8192}}function x0(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?N():536870912,o.lanes|=l,e3|=l)}function N0(o,l){if(!ir)switch(o.tailMode){case"hidden":l=o.tail;for(var A=null;l!==null;)l.alternate!==null&&(A=l),l=l.sibling;A===null?o.tail=null:A.sibling=null;break;case"collapsed":A=o.tail;for(var m=null;A!==null;)A.alternate!==null&&(m=A),A=A.sibling;m===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:m.sibling=null}}function C0(o){var l=o.alternate!==null&&o.alternate.child===o.child,A=0,m=0;if(l)for(var x=o.child;x!==null;)A|=x.lanes|x.childLanes,m|=x.subtreeFlags&65011712,m|=x.flags&65011712,x.return=o,x=x.sibling;else for(x=o.child;x!==null;)A|=x.lanes|x.childLanes,m|=x.subtreeFlags,m|=x.flags,x.return=o,x=x.sibling;return o.subtreeFlags|=m,o.childLanes=A,l}function Yi(o,l,A){var m=l.pendingProps;switch(Is(l),l.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return C0(l),null;case 1:return C0(l),null;case 3:return A=l.stateNode,m=null,o!==null&&(m=o.memoizedState.cache),l.memoizedState.cache!==m&&(l.flags|=2048),Li(Rn),ke(),A.pendingContext&&(A.context=A.pendingContext,A.pendingContext=null),(o===null||o.child===null)&&(Mo(l)?h0(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ss())),C0(l),null;case 26:return A=l.memoizedState,o===null?(h0(l),A!==null?(C0(l),jr(l,A)):(C0(l),l.flags&=-16777217)):A?A!==o.memoizedState?(h0(l),C0(l),jr(l,A)):(C0(l),l.flags&=-16777217):(o.memoizedProps!==m&&h0(l),C0(l),l.flags&=-16777217),null;case 27:_e(l),A=We.current;var x=l.type;if(o!==null&&l.stateNode!=null)o.memoizedProps!==m&&h0(l);else{if(!m){if(l.stateNode===null)throw Error(n(166));return C0(l),null}o=Ce.current,Mo(l)?Ro(l):(o=fL(x,m,A),l.stateNode=o,h0(l))}return C0(l),null;case 5:if(_e(l),A=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==m&&h0(l);else{if(!m){if(l.stateNode===null)throw Error(n(166));return C0(l),null}if(o=Ce.current,Mo(l))Ro(l);else{switch(x=N6(We.current),o){case 1:o=x.createElementNS("http://www.w3.org/2000/svg",A);break;case 2:o=x.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;default:switch(A){case"svg":o=x.createElementNS("http://www.w3.org/2000/svg",A);break;case"math":o=x.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;case"script":o=x.createElement("div"),o.innerHTML=" - + +
diff --git a/index.html b/index.html index 9469cda..1ac4a34 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + Toweel diff --git a/package-lock.json b/package-lock.json index 6560732..2b701a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,12 +10,14 @@ "dependencies": { "@react-pdf/renderer": "^4.3.0", "@react-spring/web": "^10.0.0", + "@reduxjs/toolkit": "^2.8.2", "@tailwindcss/vite": "^4.1.7", "framer-motion": "^12.16.0", "gsap": "^3.13.0", "motion": "^12.12.2", "react": "^19.1.0", "react-dom": "^19.1.0", + "react-redux": "^9.2.0", "react-router": "^7.6.0", "react-router-dom": "^7.6.0", "tailwindcss": "^4.1.7" @@ -1268,6 +1270,32 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, + "node_modules/@reduxjs/toolkit": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.8.2.tgz", + "integrity": "sha512-MYlOhQ0sLdw4ud48FoC5w0dH9VfWQjtCjreKwYTT3l+r427qYC5Y8PihNutepr8XrNaBUDQo9khWUwQxZaqt5A==", + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "@standard-schema/utils": "^0.3.0", + "immer": "^10.0.3", + "redux": "^5.0.1", + "redux-thunk": "^3.1.0", + "reselect": "^5.1.0" + }, + "peerDependencies": { + "react": "^16.9.0 || ^17.0.0 || ^18 || ^19", + "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-redux": { + "optional": true + } + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.40.2", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.40.2.tgz", @@ -1528,6 +1556,18 @@ "win32" ] }, + "node_modules/@standard-schema/spec": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", + "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", + "license": "MIT" + }, + "node_modules/@standard-schema/utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz", + "integrity": "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==", + "license": "MIT" + }, "node_modules/@swc/helpers": { "version": "0.5.17", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.17.tgz", @@ -1861,7 +1901,7 @@ "version": "19.1.4", "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.4.tgz", "integrity": "sha512-EB1yiiYdvySuIITtD5lhW4yPyJ31RkJkkDw794LaQYrxCSaQV/47y5o1FMC4zF9ZyjUjzJMZwbovEnT5yHTW6g==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "csstype": "^3.0.2" @@ -1877,6 +1917,12 @@ "@types/react": "^19.0.0" } }, + "node_modules/@types/use-sync-external-store": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz", + "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==", + "license": "MIT" + }, "node_modules/@vitejs/plugin-react": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.4.1.tgz", @@ -2207,7 +2253,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/debug": { @@ -2752,6 +2798,16 @@ "node": ">= 4" } }, + "node_modules/immer": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/immer/-/immer-10.1.1.tgz", + "integrity": "sha512-s2MPrmjovJcoMaHtx6K11Ra7oD05NT97w1IC5zpMkT6Atjr7H8LjaDd81iIxUYpMKSRRNMJE703M1Fhr/TctHw==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, "node_modules/import-fresh": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", @@ -3597,6 +3653,29 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "license": "MIT" }, + "node_modules/react-redux": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz", + "integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==", + "license": "MIT", + "dependencies": { + "@types/use-sync-external-store": "^0.0.6", + "use-sync-external-store": "^1.4.0" + }, + "peerDependencies": { + "@types/react": "^18.2.25 || ^19", + "react": "^18.0 || ^19", + "redux": "^5.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "redux": { + "optional": true + } + } + }, "node_modules/react-refresh": { "version": "0.17.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", @@ -3645,6 +3724,21 @@ "react-dom": ">=18" } }, + "node_modules/redux": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", + "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", + "license": "MIT" + }, + "node_modules/redux-thunk": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz", + "integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==", + "license": "MIT", + "peerDependencies": { + "redux": "^5.0.0" + } + }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -3654,6 +3748,12 @@ "node": ">=0.10.0" } }, + "node_modules/reselect": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz", + "integrity": "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==", + "license": "MIT" + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -3959,6 +4059,15 @@ "punycode": "^2.1.0" } }, + "node_modules/use-sync-external-store": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz", + "integrity": "sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index 60d80d2..00e7445 100644 --- a/package.json +++ b/package.json @@ -12,12 +12,14 @@ "dependencies": { "@react-pdf/renderer": "^4.3.0", "@react-spring/web": "^10.0.0", + "@reduxjs/toolkit": "^2.8.2", "@tailwindcss/vite": "^4.1.7", "framer-motion": "^12.16.0", "gsap": "^3.13.0", "motion": "^12.12.2", "react": "^19.1.0", "react-dom": "^19.1.0", + "react-redux": "^9.2.0", "react-router": "^7.6.0", "react-router-dom": "^7.6.0", "tailwindcss": "^4.1.7" diff --git a/src/assets/BackIcon.png b/src/assets/BackIcon.png new file mode 100644 index 0000000..455e45e Binary files /dev/null and b/src/assets/BackIcon.png differ diff --git a/src/assets/Eleanor.png b/src/assets/Eleanor.png new file mode 100644 index 0000000..f8f9c67 Binary files /dev/null and b/src/assets/Eleanor.png differ diff --git a/src/assets/Lizard.png b/src/assets/Lizard.png new file mode 100644 index 0000000..efd78ab Binary files /dev/null and b/src/assets/Lizard.png differ diff --git a/src/assets/LogoImage4.png b/src/assets/LogoImage4.png new file mode 100644 index 0000000..28c7e5b Binary files /dev/null and b/src/assets/LogoImage4.png differ diff --git a/src/assets/Qing.png b/src/assets/Qing.png new file mode 100644 index 0000000..18552e7 Binary files /dev/null and b/src/assets/Qing.png differ diff --git a/src/assets/ball.png b/src/assets/ball.png new file mode 100644 index 0000000..07bf36e Binary files /dev/null and b/src/assets/ball.png differ diff --git a/src/components/assistant/Assistant.jsx b/src/components/assistant/Assistant.jsx deleted file mode 100644 index 642bcaf..0000000 --- a/src/components/assistant/Assistant.jsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react' -import { motion } from 'framer-motion' - -function Assistant({ onOpenDialogue }) { - return ( - - - AI - - - ) -} - -export default Assistant \ No newline at end of file diff --git a/src/components/cardReading/CardReading.jsx b/src/components/cardReading/CardReading.jsx index 0a6762f..8c88281 100644 --- a/src/components/cardReading/CardReading.jsx +++ b/src/components/cardReading/CardReading.jsx @@ -1,9 +1,14 @@ import { motion, AnimatePresence } from 'framer-motion' import EmotionCard from '../emotion-card/EmotionCard' -import { useRef, useEffect } from 'react' +import { useRef, useEffect, useState } from 'react' +import SummaryContent from '../summary/SummaryContent' +import { useDispatch } from 'react-redux' +import { setSummaryOpen } from '../../store/slices/summarySlice' -const CardReading = ({ isOpen, onClose, onBackToWheel, emotionData, isLastCard, summaryReport }) => { +const CardReading = ({ isOpen, onClose, onBackToWheel, emotionData, isLastCard }) => { const dialogueRef = useRef(null); + const [showSummary, setShowSummary] = useState(false); + const dispatch = useDispatch(); const readingSteps = [ { @@ -58,6 +63,14 @@ const CardReading = ({ isOpen, onClose, onBackToWheel, emotionData, isLastCard, }, [isOpen]); const handleNextCard = () => { + console.log('handleNextCard called, isLastCard:', isLastCard); + + if (isLastCard) { + console.log('Processing last card...'); + // Only open the summary, data should already be in Redux + dispatch(setSummaryOpen(true)); + console.log('Summary opened'); + } onClose(); }; @@ -169,6 +182,19 @@ const CardReading = ({ isOpen, onClose, onBackToWheel, emotionData, isLastCard, )} + {showSummary && ( +
+
+ setShowSummary(false)} + showSharedContent={false} + /> +
+
+ )} ) } diff --git a/src/components/dialogue/DialogueModal.jsx b/src/components/dialogue/DialogueModal.jsx index 28b6ec8..e8786b4 100644 --- a/src/components/dialogue/DialogueModal.jsx +++ b/src/components/dialogue/DialogueModal.jsx @@ -1,13 +1,32 @@ 'use client' -import { useState, useRef, useEffect } from 'react' +import { useRef, useEffect, forwardRef, useImperativeHandle } from 'react' +// eslint-disable-next-line no-unused-vars import { motion, useAnimate, AnimatePresence } from 'framer-motion' +import { useDispatch, useSelector } from 'react-redux' import { analyzeEmotions } from '../../services/api' import { API_BASE_URL } from '../../services/api' import { checkMicrophonePermission, startRecording } from '../../utils/speechToText' import { LoadingAnimation } from '../../animations/LoadingAnimation' import ReadyModal from './ReadyModal' import LogoImage2 from '../../assets/LogoImage2.png' +import { structureSummaryReport, createReadingObject } from '../../utils/summaryReportUtils' +import { analyzeEmotionData } from '../../services/emotionAnalysis' +import { + setMessages, + addMessage, + setInput, + setPendingResponse, + setShowHistory, + setIsRecording, + setHasPermission, + setInitialAnalysis, + setHasProcessedMessage, + setNeedsMoreDetail, + setShowReadyModal, + setSessionId, + resetDialogueState, +} from '../../store/slices/dialogueSlice' const LoadingDots = () => { return ( @@ -69,115 +88,129 @@ const DownloadIcon = () => ( ) -const DialogueModal = ({ isOpen, onClose, onEmotionsAnalyzed }) => { - const [messages, setMessages] = useState([]) - const [input, setInput] = useState('') - const [pendingResponse, setPendingResponse] = useState(false) - const [showHistory, setShowHistory] = useState(false) - const [isRecording, setIsRecording] = useState(false) - const [hasPermission, setHasPermission] = useState(null) - const [initialAnalysis, setInitialAnalysis] = useState(null) - const [hasProcessedMessage, setHasProcessedMessage] = useState(false) - const [needsMoreDetail, setNeedsMoreDetail] = useState(false) - const [showReadyModal, setShowReadyModal] = useState(false) - const [sessionId, setSessionId] = useState(null); - const mediaRecorderRef = useRef(null) - const [scope, animate] = useAnimate() - const containerRef = useRef(null) - - // Reset state when modal opens +const DialogueModal = forwardRef(({ isOpen, onClose, onEmotionsAnalyzed }, ref) => { + const dispatch = useDispatch(); + const mediaRecorderRef = useRef(null); + const [scope, animate] = useAnimate(); + const containerRef = useRef(null); + const processingRef = useRef(false); + + // Select state from Redux store + const { + messages, + input, + pendingResponse, + showHistory, + isRecording, + hasPermission, + initialAnalysis, + // eslint-disable-next-line no-unused-vars + needsMoreDetail, + // eslint-disable-next-line no-unused-vars + showReadyModal, + sessionId, + } = useSelector((state) => state.dialogue); + + // Reset processing state when modal opens useEffect(() => { if (isOpen) { - setMessages([]) - setInput('') - setPendingResponse(false); - setSessionId(null); + processingRef.current = false; + dispatch(resetDialogueState()); // Fetch session_id from new API - fetch(`${API_BASE_URL}/search/session`) - .then(res => res.json()) - .then(data => { - if(data.session_id){ - console.log('📦 New session ID:', data.session_id); - setSessionId(data.session_id); - } - }) - .catch(err => { - console.error('❌ Failed to get session ID', err); - }); + fetch(`${API_BASE_URL}/search/session`) + .then(res => res.json()) + .then(data => { + if(data.session_id){ + console.log('📦 New session ID:', data.session_id); + dispatch(setSessionId(data.session_id)); + } + }) + .catch(err => { + console.error('❌ Failed to get session ID', err); + }); } - }, [isOpen]) + }, [isOpen, dispatch]); // Check microphone permission on mount useEffect(() => { if (isOpen) { - checkMicrophonePermission().then(setHasPermission) + checkMicrophonePermission().then(permission => { + dispatch(setHasPermission(permission)); + }); } - }, [isOpen]) + }, [isOpen, dispatch]); - const handleStartRecording = async () => { - try { - const recorder = await startRecording( - // onInterimResult callback - (transcript) => { - setInput(transcript) - }, - // onFinalResult callback - (transcript) => { - setInput(transcript) + // Handle AI response and emotion analysis + useEffect(() => { + if (!pendingResponse || !sessionId || processingRef.current) return; + + const analyzeEmotionsFromText = async () => { + try { + processingRef.current = true; + const lastUserMessage = messages.filter(msg => msg.sender === 'user').pop()?.text; + if (!lastUserMessage) return; + + const result = await analyzeEmotions(lastUserMessage, sessionId); + const ready = result.ready_for_search === true; + const isGuidanceReady = result.guidance_response?.toLowerCase().includes("ready for analysis"); + const hasText = !!result.accumulated_text; + + console.log('API Response:', result); + dispatch(setInitialAnalysis(result)); + + const moreDetail = result.needs_more_detail === true; + dispatch(setNeedsMoreDetail(moreDetail)); + + if (result.guidance_response) { + dispatch(addMessage({ sender: 'ai', text: result.guidance_response })); } - ) - mediaRecorderRef.current = recorder - setIsRecording(true) - } catch (error) { - console.error('Error starting recording:', error) - setMessages(prev => [ - ...prev, - { - sender: 'ai', - text: "I'm sorry, I couldn't access your microphone. Please check your permissions and try again." + + if (!moreDetail && (ready || isGuidanceReady) && sessionId && hasText) { + console.log('✅ ✅ Ready for search (fallback via guidance), showing ReadyModal'); + setTimeout(() => dispatch(setShowReadyModal(true)), 300); + } else { + console.log('⚠️ Not ready for search:', { + needsMoreDetail: moreDetail, + readyForSearch: ready, + hasSessionId: !!sessionId + }); } - ]) - } - } - const handleStopRecording = () => { - if (mediaRecorderRef.current) { - mediaRecorderRef.current.stop() - setIsRecording(false) - // Send the final transcript if there's any input - if (input.trim()) { - const userMessage = { sender: 'user', text: input } - setMessages(prev => [...prev, userMessage]) - setPendingResponse(true) - setInput('') // Clear the input box immediately after sending + } catch (error) { + console.error('❌ Error analyzing emotions:', error); + + const fallbackMessage = error.message.includes('Network') + ? "I'm having trouble connecting to the network. Please check your connection and try again." + : "I'm sorry, I had trouble analyzing your emotions. Could you try again?"; + + dispatch(addMessage({ sender: 'ai', text: fallbackMessage })); + } finally { + dispatch(setPendingResponse(false)); + dispatch(setHasProcessedMessage(true)); + processingRef.current = false; } - } - } + }; - const scrollToBottom = async () => { - const container = containerRef.current - if (container) { - await animate(container, { - scrollTop: container.scrollHeight - }, { duration: 0.6, ease: [0.17, 0.67, 0.83, 0.67] }) - } - } + analyzeEmotionsFromText(); + }, [pendingResponse, sessionId, messages, dispatch]); const handleSearch = async () => { - if (!sessionId || !initialAnalysis){ + if (!sessionId || !initialAnalysis) { console.warn('❌ Cannot run search: missing sessionId or analysis'); return; - }; + } try { console.log('🔍 Starting search with session id:', sessionId); + console.log('🔍 Initial analysis:', initialAnalysis); + const searchResult = await analyzeEmotions(messages[messages.length - 1].text, sessionId, { - execute_search: true, - accumulated_text: initialAnalysis.accumulated_text - }); + execute_search: true, + accumulated_text: initialAnalysis.accumulated_text + }); console.log('✅ Search result received:', searchResult); @@ -191,46 +224,30 @@ const DialogueModal = ({ isOpen, onClose, onEmotionsAnalyzed }) => { quote: item.quote || '' })); - // Generate summary report - const summaryReport = { - overallAnalysis: [ - `Based on your input, we've identified ${emotions.length} primary emotions that you're experiencing.`, - emotions.map(e => `${e.emotion} (${Math.floor(e.percentage)}%)`).join(', '), - 'Let\'s explore what these emotions mean for you.' - ], - keyInsights: emotions.map(e => e.analysis), - keyInsightsSummary: searchResult.rag_analysis.summary_report || 'These emotions suggest a complex emotional state that we can help you navigate.', - movingForward: [ - 'Understanding your emotions is the first step towards emotional well-being.', - 'Consider discussing these feelings with someone you trust.', - 'Remember that it\'s okay to feel this way, and you\'re not alone in your experience.' - ] - }; + // Create summary report using the utility function + const summaryReport = structureSummaryReport(searchResult.rag_analysis, emotions); console.log('✅ Processed emotions:', emotions); console.log('✅ Processed summary report:', summaryReport); if (onEmotionsAnalyzed) { - await onEmotionsAnalyzed(emotions, summaryReport); + // Close ReadyModal first + dispatch(setShowReadyModal(false)); + + // Then call onEmotionsAnalyzed + await onEmotionsAnalyzed(emotions, summaryReport, initialAnalysis.accumulated_text); console.log('✅ onEmotionsAnalyzed called successfully'); - // 🧠 Prepare reading object to store in history - const newReading = { - sessionId: searchResult.session_id, - timestamp: Date.now(), - title: searchResult.title || 'Untitled', - accumulated_text: initialAnalysis.accumulated_text, - cards: emotions, - summaryReport - }; - - // 🗃 Save to localStorage + // Create reading object using the utility function + const newReading = createReadingObject(searchResult, emotions, initialAnalysis.accumulated_text); + + // Save to localStorage const prev = JSON.parse(localStorage.getItem('emotionReadings') || '[]'); localStorage.setItem('emotionReadings', JSON.stringify([...prev, newReading])); console.log('💾 Saved session to localStorage'); - setShowReadyModal(false); + // Close DialogueModal onClose(); } else { console.warn('❌ onEmotionsAnalyzed callback not defined'); @@ -250,120 +267,85 @@ const DialogueModal = ({ isOpen, onClose, onEmotionsAnalyzed }) => { stack: error.stack, response: error.response }); - setMessages(prev => [ - ...prev, - { - sender: 'ai', - text: "I'm sorry, I had trouble searching for similar experiences. Could you try again?" - } - ]); + dispatch(addMessage({ + sender: 'ai', + text: "I'm sorry, I had trouble searching for similar experiences. Could you try again?" + })); } finally { - setPendingResponse(false); - setInitialAnalysis(null); + dispatch(setPendingResponse(false)); + dispatch(setInitialAnalysis(null)); } }; - const scrollToWheel = () => { - const wheelSection = document.querySelector('.wheel-container'); - if (wheelSection) { - wheelSection.scrollIntoView({ behavior: 'smooth', block: 'center' }); - } + const sendMessage = async () => { + if (!input.trim() || pendingResponse || processingRef.current) return; + + dispatch(setPendingResponse(true)); + dispatch(setHasProcessedMessage(false)); + dispatch(setNeedsMoreDetail(false)); + + dispatch(addMessage({ sender: 'user', text: input })); + dispatch(setInput('')); }; - // Handle AI response and emotion analysis - useEffect(() => { - if (!pendingResponse || hasProcessedMessage || !sessionId) return; - const analyzeEmotionsFromText = async () => { + const handleStartRecording = async () => { try { - if (!sessionId) { - console.warn("⏳ No sessionId — aborting analysis"); - return; - } - const lastUserMessage = [...messages].reverse().find(msg => msg.sender === 'user')?.text; - if (!lastUserMessage) return; - - const result = await analyzeEmotions(lastUserMessage, sessionId); - const ready = result.ready_for_search === true; - const isGuidanceReady = result.guidance_response?.toLowerCase().includes("ready for analysis"); - const hasText = !!result.accumulated_text; - -// console.log('🔍 API result flags:', { -// readyForSearchRaw: result.ready_for_search, -// readyParsed: ready, -// needsMoreDetail: result.needs_more_detail, -// sessionId: result.session_id, -// accumulatedText: result.accumulated_text, -// }); - - console.log('API Response:', result); - setInitialAnalysis(result); - - const moreDetail = result.needs_more_detail === true; - setNeedsMoreDetail(moreDetail); - - if (result.guidance_response) { - setMessages(prev => [ - ...prev, - { sender: 'ai', text: result.guidance_response } - ]); + const recorder = await startRecording( + // onInterimResult callback + (transcript) => { + dispatch(setInput(transcript)); + }, + // onFinalResult callback + (transcript) => { + dispatch(setInput(transcript)); + } + ); + mediaRecorderRef.current = recorder; + dispatch(setIsRecording(true)); + } catch (error) { + console.error('Error starting recording:', error); + dispatch(addMessage({ + sender: 'ai', + text: "I'm sorry, I couldn't access your microphone. Please check your permissions and try again." + })); } + }; - if (!moreDetail && (ready || isGuidanceReady) && sessionId && hasText) { - console.log('✅ ✅ Ready for search (fallback via guidance), showing ReadyModal'); - setTimeout(() => setShowReadyModal(true), 300); - } else { - console.log('⚠️ Not ready for search:', { - needsMoreDetail: moreDetail, - readyForSearch: ready, - hasSessionId: !!sessionId - }); + const handleStopRecording = () => { + if (mediaRecorderRef.current) { + mediaRecorderRef.current.stop(); + dispatch(setIsRecording(false)); + // Send the final transcript if there's any input + if (input.trim()) { + dispatch(addMessage({ sender: 'user', text: input })); + dispatch(setPendingResponse(true)); + dispatch(setInput('')); // Clear the input box immediately after sending + } } + }; - } catch (error) { - console.error('❌ Error analyzing emotions:', error); - - const fallbackMessage = error.message.includes('Network') - ? "I'm having trouble connecting to the network. Please check your connection and try again." - : "I'm sorry, I had trouble analyzing your emotions. Could you try again?"; - - setMessages(prev => [ - ...prev, - { sender: 'ai', text: fallbackMessage } - ]); - } finally { - setPendingResponse(false); - setHasProcessedMessage(true); - } -}; - - analyzeEmotionsFromText(); - }, [pendingResponse, messages, hasProcessedMessage, sessionId]); - - const sendMessage = async () => { - if (!input.trim()) return; - - const userMessage = { sender: 'user', text: input }; - - setMessages(prev => [...prev, userMessage]); - setInput(''); - setPendingResponse(true); - setHasProcessedMessage(false); // Reset processing state - setNeedsMoreDetail(false); // Reset the need for more input + const scrollToBottom = async () => { + const container = containerRef.current; + if (container) { + await animate(container, { + scrollTop: container.scrollHeight + }, { duration: 0.6, ease: [0.17, 0.67, 0.83, 0.67] }); + } }; // Scroll to bottom when messages change or when pending response changes useEffect(() => { if (isOpen) { - setTimeout(scrollToBottom, 100) + setTimeout(scrollToBottom, 100); } - }, [messages, pendingResponse, isOpen]) + }, [messages, pendingResponse, isOpen]); // Handle initial AI message useEffect(() => { if (isOpen && messages.length === 0) { - setMessages(prev => [...prev, initialAiMessages[0]]) + dispatch(setMessages([...initialAiMessages])); } - }, [isOpen, messages.length]) + }, [isOpen, messages.length, dispatch]); // Function to format message text with bold and line breaks const formatMessageText = (text) => { @@ -386,46 +368,100 @@ const DialogueModal = ({ isOpen, onClose, onEmotionsAnalyzed }) => { }); }; + const handleClose = () => { + console.log('DialogueModal: Close button clicked'); + dispatch(resetDialogueState()); + onClose(); + }; + + const handleEmotionAnalysis = async () => { + try { + if (!sessionId || !initialAnalysis) { + console.warn('❌ Cannot run emotion analysis: missing sessionId or analysis'); + return; + } + + const lastMessage = messages[messages.length - 1]?.text; + if (!lastMessage) { + console.warn('❌ No message found for emotion analysis'); + return; + } + + console.log('🔍 Starting emotion analysis with:', { + sessionId, + lastMessage, + initialAnalysis + }); + + const result = await analyzeEmotionData(lastMessage, sessionId, initialAnalysis); + + if (!result) { + console.warn('❌ No result returned from emotion analysis'); + return; + } + + if (result && onEmotionsAnalyzed) { + // Close ReadyModal first + dispatch(setShowReadyModal(false)); + + // Then call onEmotionsAnalyzed + await onEmotionsAnalyzed(result.emotions, result.summaryReport, result.accumulatedText); + console.log('✅ onEmotionsAnalyzed called successfully'); + + // Save to localStorage + const prev = JSON.parse(localStorage.getItem('emotionReadings') || '[]'); + localStorage.setItem('emotionReadings', JSON.stringify([...prev, result.reading])); + + console.log('💾 Saved session to localStorage'); + + // Close DialogueModal + onClose(); + } + } catch (error) { + console.error('❌ Error during emotion analysis:', error); + dispatch(addMessage({ + sender: 'ai', + text: "I'm sorry, I had trouble analyzing your emotions. Could you try again?" + })); + } finally { + dispatch(setPendingResponse(false)); + dispatch(setInitialAnalysis(null)); + } + }; + + // Expose both functions through ref + useImperativeHandle(ref, () => ({ + handleSearch, + handleEmotionAnalysis + })); + return ( <> - + {isOpen && (
- { - setSessionId(null); - onClose(); - setTimeout(scrollToWheel, 100); - }} + onClick={handleClose} > × - +
-
+
{/* Previous Answers Section */}
@@ -434,22 +470,19 @@ const DialogueModal = ({ isOpen, onClose, onEmotionsAnalyzed }) => { {messages .filter(msg => msg.sender === 'user') .map((msg, idx) => ( - {msg.text} - +
))}
{/* Main Dialogue Section */}
- @@ -457,25 +490,19 @@ const DialogueModal = ({ isOpen, onClose, onEmotionsAnalyzed }) => { messages .filter(msg => msg.sender === 'ai') .map((msg, idx) => ( - Toweel - {formatMessageText(msg.text)} - - +
+
)) ) : ( messages.length > 0 && ( @@ -484,65 +511,50 @@ const DialogueModal = ({ isOpen, onClose, onEmotionsAnalyzed }) => { .filter(msg => msg.sender === 'ai') .slice(-1) .map((msg, idx) => ( - {idx === 0 && ( - )} - {formatMessageText(msg.text)} - - + + ))} ) )} {pendingResponse && ( - - - - + + )} -
+