function ty(e,t){for(var n=0;nr[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function cu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fh={exports:{}},Eo={},Ih={exports:{}},Y={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var qs=Symbol.for("react.element"),ny=Symbol.for("react.portal"),ry=Symbol.for("react.fragment"),sy=Symbol.for("react.strict_mode"),iy=Symbol.for("react.profiler"),oy=Symbol.for("react.provider"),ay=Symbol.for("react.context"),ly=Symbol.for("react.forward_ref"),uy=Symbol.for("react.suspense"),cy=Symbol.for("react.memo"),dy=Symbol.for("react.lazy"),Vc=Symbol.iterator;function fy(e){return e===null||typeof e!="object"?null:(e=Vc&&e[Vc]||e["@@iterator"],typeof e=="function"?e:null)}var zh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Oh=Object.assign,$h={};function Fr(e,t,n){this.props=e,this.context=t,this.refs=$h,this.updater=n||zh}Fr.prototype.isReactComponent={};Fr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Fr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Bh(){}Bh.prototype=Fr.prototype;function du(e,t,n){this.props=e,this.context=t,this.refs=$h,this.updater=n||zh}var fu=du.prototype=new Bh;fu.constructor=du;Oh(fu,Fr.prototype);fu.isPureReactComponent=!0;var Fc=Array.isArray,Uh=Object.prototype.hasOwnProperty,hu={current:null},Wh={key:!0,ref:!0,__self:!0,__source:!0};function Hh(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Uh.call(t,r)&&!Wh.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1>>1,E=_[L];if(0>>1;Ls(te,F))Gs(be,te)?(_[L]=be,_[G]=F,L=G):(_[L]=te,_[X]=F,L=X);else if(Gs(be,F))_[L]=be,_[G]=F,L=G;else break e}}return N}function s(_,N){var F=_.sortIndex-N.sortIndex;return F!==0?F:_.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,f=null,u=3,h=!1,p=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(_){for(var N=n(c);N!==null;){if(N.callback===null)r(c);else if(N.startTime<=_)r(c),N.sortIndex=N.expirationTime,t(l,N);else break;N=n(c)}}function b(_){if(g=!1,w(_),!p)if(n(l)!==null)p=!0,A(S);else{var N=n(c);N!==null&&q(b,N.startTime-_)}}function S(_,N){p=!1,g&&(g=!1,v(j),j=-1),h=!0;var F=u;try{for(w(N),f=n(l);f!==null&&(!(f.expirationTime>N)||_&&!z());){var L=f.callback;if(typeof L=="function"){f.callback=null,u=f.priorityLevel;var E=L(f.expirationTime<=N);N=e.unstable_now(),typeof E=="function"?f.callback=E:f===n(l)&&r(l),w(N)}else r(l);f=n(l)}if(f!==null)var W=!0;else{var X=n(c);X!==null&&q(b,X.startTime-N),W=!1}return W}finally{f=null,u=F,h=!1}}var C=!1,P=null,j=-1,D=5,T=-1;function z(){return!(e.unstable_now()-T_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return u},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(_){switch(u){case 1:case 2:case 3:var N=3;break;default:N=u}var F=u;u=N;try{return _()}finally{u=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,N){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var F=u;u=_;try{return N()}finally{u=F}},e.unstable_scheduleCallback=function(_,N,F){var L=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0L?(_.sortIndex=F,t(c,_),n(l)===null&&_===n(c)&&(g?(v(j),j=-1):g=!0,q(b,F-L))):(_.sortIndex=E,t(l,_),p||h||(p=!0,A(S))),_},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(_){var N=u;return function(){var F=u;u=N;try{return _.apply(this,arguments)}finally{u=F}}}})(Xh);Kh.exports=Xh;var Cy=Kh.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Py=k,Ze=Cy;function M(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xa=Object.prototype.hasOwnProperty,jy=/^[: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]*$/,zc={},Oc={};function Ey(e){return Xa.call(Oc,e)?!0:Xa.call(zc,e)?!1:jy.test(e)?Oc[e]=!0:(zc[e]=!0,!1)}function Ty(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ny(e,t,n,r){if(t===null||typeof t>"u"||Ty(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function $e(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var _e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_e[e]=new $e(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];_e[t]=new $e(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_e[e]=new $e(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_e[e]=new $e(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){_e[e]=new $e(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_e[e]=new $e(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_e[e]=new $e(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_e[e]=new $e(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_e[e]=new $e(e,5,!1,e.toLowerCase(),null,!1,!1)});var mu=/[\-:]([a-z])/g;function gu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(mu,gu);_e[t]=new $e(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(mu,gu);_e[t]=new $e(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(mu,gu);_e[t]=new $e(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_e[e]=new $e(e,1,!1,e.toLowerCase(),null,!1,!1)});_e.xlinkHref=new $e("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_e[e]=new $e(e,1,!1,e.toLowerCase(),null,!0,!0)});function yu(e,t,n,r){var s=_e.hasOwnProperty(t)?_e[t]:null;(s!==null?s.type!==0:r||!(2a||s[o]!==i[a]){var l=` `+s[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{ia=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?rs(e):""}function My(e){switch(e.tag){case 5:return rs(e.type);case 16:return rs("Lazy");case 13:return rs("Suspense");case 19:return rs("SuspenseList");case 0:case 2:case 15:return e=oa(e.type,!1),e;case 11:return e=oa(e.type.render,!1),e;case 1:return e=oa(e.type,!0),e;default:return""}}function el(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case rr:return"Fragment";case nr:return"Portal";case Qa:return"Profiler";case vu:return"StrictMode";case Za:return"Suspense";case Ja:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Jh:return(e.displayName||"Context")+".Consumer";case Zh:return(e._context.displayName||"Context")+".Provider";case xu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case wu:return t=e.displayName||null,t!==null?t:el(e.type)||"Memo";case Zt:t=e._payload,e=e._init;try{return el(e(t))}catch{}}return null}function _y(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return el(t);case 8:return t===vu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function vn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ay(e){var t=tp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function oi(e){e._valueTracker||(e._valueTracker=Ay(e))}function np(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=tp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ui(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function tl(e,t){var n=t.checked;return fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Bc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=vn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rp(e,t){t=t.checked,t!=null&&yu(e,"checked",t,!1)}function nl(e,t){rp(e,t);var n=vn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?rl(e,t.type,n):t.hasOwnProperty("defaultValue")&&rl(e,t.type,vn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Uc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function rl(e,t,n){(t!=="number"||Ui(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ss=Array.isArray;function vr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=ai.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Cs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ls={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ly=["Webkit","ms","Moz","O"];Object.keys(ls).forEach(function(e){Ly.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ls[t]=ls[e]})});function ap(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ls.hasOwnProperty(e)&&ls[e]?(""+t).trim():t+"px"}function lp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=ap(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var Dy=fe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ol(e,t){if(t){if(Dy[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function al(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ll=null;function bu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ul=null,xr=null,wr=null;function qc(e){if(e=Xs(e)){if(typeof ul!="function")throw Error(M(280));var t=e.stateNode;t&&(t=Ao(t),ul(e.stateNode,e.type,t))}}function up(e){xr?wr?wr.push(e):wr=[e]:xr=e}function cp(){if(xr){var e=xr,t=wr;if(wr=xr=null,qc(e),t)for(e=0;e>>=0,e===0?32:31-(Hy(e)/qy|0)|0}var li=64,ui=4194304;function is(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Gi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=is(a):(i&=o,i!==0&&(r=is(i)))}else o=n&~s,o!==0?r=is(o):i!==0&&(r=is(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ys(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gt(t),e[t]=n}function Xy(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=cs),td=" ",nd=!1;function Mp(e,t){switch(e){case"keyup":return C1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _p(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var sr=!1;function j1(e,t){switch(e){case"compositionend":return _p(t);case"keypress":return t.which!==32?null:(nd=!0,td);case"textInput":return e=t.data,e===td&&nd?null:e;default:return null}}function E1(e,t){if(sr)return e==="compositionend"||!Nu&&Mp(e,t)?(e=Tp(),Mi=ju=sn=null,sr=!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)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=od(n)}}function Rp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vp(){for(var e=window,t=Ui();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ui(e.document)}return t}function Mu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function V1(e){var t=Vp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Rp(n.ownerDocument.documentElement,n)){if(r!==null&&Mu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=ad(n,i);var o=ad(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ir=null,ml=null,fs=null,gl=!1;function ld(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gl||ir==null||ir!==Ui(r)||(r=ir,"selectionStart"in r&&Mu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),fs&&Ms(fs,r)||(fs=r,r=Xi(ml,"onSelect"),0lr||(e.current=Sl[lr],Sl[lr]=null,lr--)}function J(e,t){lr++,Sl[lr]=e.current,e.current=t}var xn={},Ve=kn(xn),We=kn(!1),Un=xn;function Er(e,t){var n=e.type.contextTypes;if(!n)return xn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function He(e){return e=e.childContextTypes,e!=null}function Zi(){ie(We),ie(Ve)}function md(e,t,n){if(Ve.current!==xn)throw Error(M(168));J(Ve,t),J(We,n)}function Hp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(M(108,_y(e)||"Unknown",s));return fe({},n,r)}function Ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||xn,Un=Ve.current,J(Ve,e),J(We,We.current),!0}function gd(e,t,n){var r=e.stateNode;if(!r)throw Error(M(169));n?(e=Hp(e,t,Un),r.__reactInternalMemoizedMergedChildContext=e,ie(We),ie(Ve),J(Ve,e)):ie(We),J(We,n)}var Lt=null,Lo=!1,wa=!1;function qp(e){Lt===null?Lt=[e]:Lt.push(e)}function Y1(e){Lo=!0,qp(e)}function Cn(){if(!wa&&Lt!==null){wa=!0;var e=0,t=Z;try{var n=Lt;for(Z=1;e>=o,s-=o,Dt=1<<32-gt(t)+s|n<j?(D=P,P=null):D=P.sibling;var T=u(v,P,w[j],b);if(T===null){P===null&&(P=D);break}e&&P&&T.alternate===null&&t(v,P),y=i(T,y,j),C===null?S=T:C.sibling=T,C=T,P=D}if(j===w.length)return n(v,P),le&&An(v,j),S;if(P===null){for(;jj?(D=P,P=null):D=P.sibling;var z=u(v,P,T.value,b);if(z===null){P===null&&(P=D);break}e&&P&&z.alternate===null&&t(v,P),y=i(z,y,j),C===null?S=z:C.sibling=z,C=z,P=D}if(T.done)return n(v,P),le&&An(v,j),S;if(P===null){for(;!T.done;j++,T=w.next())T=f(v,T.value,b),T!==null&&(y=i(T,y,j),C===null?S=T:C.sibling=T,C=T);return le&&An(v,j),S}for(P=r(v,P);!T.done;j++,T=w.next())T=h(P,v,j,T.value,b),T!==null&&(e&&T.alternate!==null&&P.delete(T.key===null?j:T.key),y=i(T,y,j),C===null?S=T:C.sibling=T,C=T);return e&&P.forEach(function(V){return t(v,V)}),le&&An(v,j),S}function x(v,y,w,b){if(typeof w=="object"&&w!==null&&w.type===rr&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case ii:e:{for(var S=w.key,C=y;C!==null;){if(C.key===S){if(S=w.type,S===rr){if(C.tag===7){n(v,C.sibling),y=s(C,w.props.children),y.return=v,v=y;break e}}else if(C.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Zt&&xd(S)===C.type){n(v,C.sibling),y=s(C,w.props),y.ref=Xr(v,C,w),y.return=v,v=y;break e}n(v,C);break}else t(v,C);C=C.sibling}w.type===rr?(y=$n(w.props.children,v.mode,b,w.key),y.return=v,v=y):(b=Ii(w.type,w.key,w.props,null,v.mode,b),b.ref=Xr(v,y,w),b.return=v,v=b)}return o(v);case nr:e:{for(C=w.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){n(v,y.sibling),y=s(y,w.children||[]),y.return=v,v=y;break e}else{n(v,y);break}else t(v,y);y=y.sibling}y=Ta(w,v.mode,b),y.return=v,v=y}return o(v);case Zt:return C=w._init,x(v,y,C(w._payload),b)}if(ss(w))return p(v,y,w,b);if(Hr(w))return g(v,y,w,b);gi(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,y!==null&&y.tag===6?(n(v,y.sibling),y=s(y,w),y.return=v,v=y):(n(v,y),y=Ea(w,v.mode,b),y.return=v,v=y),o(v)):n(v,y)}return x}var Nr=Xp(!0),Qp=Xp(!1),no=kn(null),ro=null,dr=null,Du=null;function Ru(){Du=dr=ro=null}function Vu(e){var t=no.current;ie(no),e._currentValue=t}function Pl(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Sr(e,t){ro=e,Du=dr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ue=!0),e.firstContext=null)}function ut(e){var t=e._currentValue;if(Du!==e)if(e={context:e,memoizedValue:t,next:null},dr===null){if(ro===null)throw Error(M(308));dr=e,ro.dependencies={lanes:0,firstContext:e}}else dr=dr.next=e;return t}var Fn=null;function Fu(e){Fn===null?Fn=[e]:Fn.push(e)}function Zp(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Fu(t)):(n.next=s.next,s.next=n),t.interleaved=n,Bt(e,r)}function Bt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Jt=!1;function Iu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ft(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Bt(e,n)}return s=r.interleaved,s===null?(t.next=t,Fu(r)):(t.next=s.next,s.next=t),r.interleaved=t,Bt(e,n)}function Ai(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ku(e,n)}}function wd(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function so(e,t,n,r){var s=e.updateQueue;Jt=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;o=0,d=c=l=null,a=i;do{var u=a.lane,h=a.eventTime;if((r&u)===u){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,g=a;switch(u=t,h=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){f=p.call(h,f,u);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,u=typeof p=="function"?p.call(h,f,u):p,u==null)break e;f=fe({},f,u);break e;case 2:Jt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,u=s.effects,u===null?s.effects=[a]:u.push(a))}else h={eventTime:h,lane:u,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=h,l=f):d=d.next=h,o|=u;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;u=a,a=u.next,u.next=null,s.lastBaseUpdate=u,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);qn|=o,e.lanes=o,e.memoizedState=f}}function bd(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Sa.transition;Sa.transition={};try{e(!1),t()}finally{Z=n,Sa.transition=r}}function gm(){return ct().memoizedState}function Z1(e,t,n){var r=pn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ym(e))vm(t,n);else if(n=Zp(e,t,n,r),n!==null){var s=ze();yt(n,e,r,s),xm(n,t,r)}}function J1(e,t,n){var r=pn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ym(e))vm(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,xt(a,o)){var l=t.interleaved;l===null?(s.next=s,Fu(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=Zp(e,t,s,r),n!==null&&(s=ze(),yt(n,e,r,s),xm(n,t,r))}}function ym(e){var t=e.alternate;return e===de||t!==null&&t===de}function vm(e,t){hs=oo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ku(e,n)}}var ao={readContext:ut,useCallback:Ae,useContext:Ae,useEffect:Ae,useImperativeHandle:Ae,useInsertionEffect:Ae,useLayoutEffect:Ae,useMemo:Ae,useReducer:Ae,useRef:Ae,useState:Ae,useDebugValue:Ae,useDeferredValue:Ae,useTransition:Ae,useMutableSource:Ae,useSyncExternalStore:Ae,useId:Ae,unstable_isNewReconciler:!1},ev={readContext:ut,useCallback:function(e,t){return St().memoizedState=[e,t===void 0?null:t],e},useContext:ut,useEffect:kd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Di(4194308,4,dm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Di(4194308,4,e,t)},useInsertionEffect:function(e,t){return Di(4,2,e,t)},useMemo:function(e,t){var n=St();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=St();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Z1.bind(null,de,e),[r.memoizedState,e]},useRef:function(e){var t=St();return e={current:e},t.memoizedState=e},useState:Sd,useDebugValue:qu,useDeferredValue:function(e){return St().memoizedState=e},useTransition:function(){var e=Sd(!1),t=e[0];return e=Q1.bind(null,e[1]),St().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=de,s=St();if(le){if(n===void 0)throw Error(M(407));n=n()}else{if(n=t(),Ee===null)throw Error(M(349));Hn&30||rm(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,kd(im.bind(null,r,i,e),[e]),r.flags|=2048,Is(9,sm.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=St(),t=Ee.identifierPrefix;if(le){var n=Rt,r=Dt;n=(r&~(1<<32-gt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Vs++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[kt]=t,e[Ls]=r,Nm(e,t,!1,!1),t.stateNode=e;e:{switch(o=al(n,r),n){case"dialog":re("cancel",e),re("close",e),s=r;break;case"iframe":case"object":case"embed":re("load",e),s=r;break;case"video":case"audio":for(s=0;sAr&&(t.flags|=128,r=!0,Qr(i,!1),t.lanes=4194304)}else{if(!r)if(e=io(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Qr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!le)return Le(t),null}else 2*ge()-i.renderingStartTime>Ar&&n!==1073741824&&(t.flags|=128,r=!0,Qr(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ge(),t.sibling=null,n=ue.current,J(ue,r?n&1|2:n&1),t):(Le(t),null);case 22:case 23:return Zu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ye&1073741824&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function lv(e,t){switch(Au(t),t.tag){case 1:return He(t.type)&&Zi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Mr(),ie(We),ie(Ve),$u(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ou(t),null;case 13:if(ie(ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));Tr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ie(ue),null;case 4:return Mr(),null;case 10:return Vu(t.type._context),null;case 22:case 23:return Zu(),null;case 24:return null;default:return null}}var vi=!1,Re=!1,uv=typeof WeakSet=="function"?WeakSet:Set,I=null;function fr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pe(e,t,r)}else n.current=null}function Dl(e,t,n){try{n()}catch(r){pe(e,t,r)}}var Dd=!1;function cv(e,t){if(yl=Yi,e=Vp(),Mu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,d=0,f=e,u=null;t:for(;;){for(var h;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)u=f,f=h;for(;;){if(f===e)break t;if(u===n&&++c===s&&(a=o),u===i&&++d===r&&(l=o),(h=f.nextSibling)!==null)break;f=u,u=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(vl={focusedElem:e,selectionRange:n},Yi=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,x=p.memoizedState,v=t.stateNode,y=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:ft(t.type,g),x);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(b){pe(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return p=Dd,Dd=!1,p}function ps(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Dl(t,n,i)}s=s.next}while(s!==r)}}function Vo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Rl(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Am(e){var t=e.alternate;t!==null&&(e.alternate=null,Am(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[kt],delete t[Ls],delete t[bl],delete t[q1],delete t[G1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Lm(e){return e.tag===5||e.tag===3||e.tag===4}function Rd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qi));else if(r!==4&&(e=e.child,e!==null))for(Vl(e,t,n),e=e.sibling;e!==null;)Vl(e,t,n),e=e.sibling}function Fl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Fl(e,t,n),e=e.sibling;e!==null;)Fl(e,t,n),e=e.sibling}var Ne=null,ht=!1;function Yt(e,t,n){for(n=n.child;n!==null;)Dm(e,t,n),n=n.sibling}function Dm(e,t,n){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(To,n)}catch{}switch(n.tag){case 5:Re||fr(n,t);case 6:var r=Ne,s=ht;Ne=null,Yt(e,t,n),Ne=r,ht=s,Ne!==null&&(ht?(e=Ne,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ne.removeChild(n.stateNode));break;case 18:Ne!==null&&(ht?(e=Ne,n=n.stateNode,e.nodeType===8?xa(e.parentNode,n):e.nodeType===1&&xa(e,n),Ts(e)):xa(Ne,n.stateNode));break;case 4:r=Ne,s=ht,Ne=n.stateNode.containerInfo,ht=!0,Yt(e,t,n),Ne=r,ht=s;break;case 0:case 11:case 14:case 15:if(!Re&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Dl(n,t,o),s=s.next}while(s!==r)}Yt(e,t,n);break;case 1:if(!Re&&(fr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){pe(n,t,a)}Yt(e,t,n);break;case 21:Yt(e,t,n);break;case 22:n.mode&1?(Re=(r=Re)||n.memoizedState!==null,Yt(e,t,n),Re=r):Yt(e,t,n);break;default:Yt(e,t,n)}}function Vd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new uv),t.forEach(function(r){var s=xv.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function dt(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=o),r&=~i}if(r=s,r=ge()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fv(r/1960))-r,10e?16:e,on===null)var r=!1;else{if(e=on,on=null,co=0,K&6)throw Error(M(331));var s=K;for(K|=4,I=e.current;I!==null;){var i=I,o=i.child;if(I.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lge()-Xu?On(e,0):Ku|=n),qe(e,t)}function Bm(e,t){t===0&&(e.mode&1?(t=ui,ui<<=1,!(ui&130023424)&&(ui=4194304)):t=1);var n=ze();e=Bt(e,t),e!==null&&(Ys(e,t,n),qe(e,n))}function vv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bm(e,n)}function xv(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(M(314))}r!==null&&r.delete(t),Bm(e,n)}var Um;Um=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||We.current)Ue=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ue=!1,ov(e,t,n);Ue=!!(e.flags&131072)}else Ue=!1,le&&t.flags&1048576&&Gp(t,to,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ri(e,t),e=t.pendingProps;var s=Er(t,Ve.current);Sr(t,n),s=Uu(null,t,r,e,s,n);var i=Wu();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,He(r)?(i=!0,Ji(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Iu(t),s.updater=Ro,t.stateNode=s,s._reactInternals=t,El(t,r,e,n),t=Ml(null,t,r,!0,i,n)):(t.tag=0,le&&i&&_u(t),Ie(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ri(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=bv(r),e=ft(r,e),s){case 0:t=Nl(null,t,r,e,n);break e;case 1:t=_d(null,t,r,e,n);break e;case 11:t=Nd(null,t,r,e,n);break e;case 14:t=Md(null,t,r,ft(r.type,e),n);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ft(r,s),Nl(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ft(r,s),_d(e,t,r,s,n);case 3:e:{if(jm(t),e===null)throw Error(M(387));r=t.pendingProps,i=t.memoizedState,s=i.element,Jp(e,t),so(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=_r(Error(M(423)),t),t=Ad(e,t,r,n,s);break e}else if(r!==s){s=_r(Error(M(424)),t),t=Ad(e,t,r,n,s);break e}else for(Ke=dn(t.stateNode.containerInfo.firstChild),Qe=t,le=!0,pt=null,n=Qp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Tr(),r===s){t=Ut(e,t,n);break e}Ie(e,t,r,n)}t=t.child}return t;case 5:return em(t),e===null&&Cl(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,xl(r,s)?o=null:i!==null&&xl(r,i)&&(t.flags|=32),Pm(e,t),Ie(e,t,o,n),t.child;case 6:return e===null&&Cl(t),null;case 13:return Em(e,t,n);case 4:return zu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Nr(t,null,r,n):Ie(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ft(r,s),Nd(e,t,r,s,n);case 7:return Ie(e,t,t.pendingProps,n),t.child;case 8:return Ie(e,t,t.pendingProps.children,n),t.child;case 12:return Ie(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,J(no,r._currentValue),r._currentValue=o,i!==null)if(xt(i.value,o)){if(i.children===s.children&&!We.current){t=Ut(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Ft(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Pl(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(M(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Pl(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Ie(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Sr(t,n),s=ut(s),r=r(s),t.flags|=1,Ie(e,t,r,n),t.child;case 14:return r=t.type,s=ft(r,t.pendingProps),s=ft(r.type,s),Md(e,t,r,s,n);case 15:return km(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ft(r,s),Ri(e,t),t.tag=1,He(r)?(e=!0,Ji(t)):e=!1,Sr(t,n),wm(t,r,s),El(t,r,s,n),Ml(null,t,r,!0,e,n);case 19:return Tm(e,t,n);case 22:return Cm(e,t,n)}throw Error(M(156,t.tag))};function Wm(e,t){return yp(e,t)}function wv(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function at(e,t,n,r){return new wv(e,t,n,r)}function ec(e){return e=e.prototype,!(!e||!e.isReactComponent)}function bv(e){if(typeof e=="function")return ec(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xu)return 11;if(e===wu)return 14}return 2}function mn(e,t){var n=e.alternate;return n===null?(n=at(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ii(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")ec(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case rr:return $n(n.children,s,i,t);case vu:o=8,s|=8;break;case Qa:return e=at(12,n,t,s|2),e.elementType=Qa,e.lanes=i,e;case Za:return e=at(13,n,t,s),e.elementType=Za,e.lanes=i,e;case Ja:return e=at(19,n,t,s),e.elementType=Ja,e.lanes=i,e;case ep:return Io(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Zh:o=10;break e;case Jh:o=9;break e;case xu:o=11;break e;case wu:o=14;break e;case Zt:o=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=at(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function $n(e,t,n,r){return e=at(7,e,r,t),e.lanes=n,e}function Io(e,t,n,r){return e=at(22,e,r,t),e.elementType=ep,e.lanes=n,e.stateNode={isHidden:!1},e}function Ea(e,t,n){return e=at(6,e,null,t),e.lanes=n,e}function Ta(e,t,n){return t=at(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Sv(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=la(0),this.expirationTimes=la(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=la(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function tc(e,t,n,r,s,i,o,a,l){return e=new Sv(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=at(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Iu(i),e}function kv(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ym)}catch(e){console.error(e)}}Ym(),Yh.exports=et;var Tv=Yh.exports,Wd=Tv;Ka.createRoot=Wd.createRoot,Ka.hydrateRoot=Wd.hydrateRoot;/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Os(){return Os=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Km(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Mv(){return Math.random().toString(36).substr(2,8)}function qd(e,t){return{usr:e.state,key:e.key,idx:t}}function Bl(e,t,n,r){return n===void 0&&(n=null),Os({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Or(t):t,{state:n,key:t&&t.key||r||Mv()})}function po(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Or(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function _v(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=an.Pop,l=null,c=d();c==null&&(c=0,o.replaceState(Os({},o.state,{idx:c}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=an.Pop;let x=d(),v=x==null?null:x-c;c=x,l&&l({action:a,location:g.location,delta:v})}function u(x,v){a=an.Push;let y=Bl(g.location,x,v);c=d()+1;let w=qd(y,c),b=g.createHref(y);try{o.pushState(w,"",b)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(b)}i&&l&&l({action:a,location:g.location,delta:1})}function h(x,v){a=an.Replace;let y=Bl(g.location,x,v);c=d();let w=qd(y,c),b=g.createHref(y);o.replaceState(w,"",b),i&&l&&l({action:a,location:g.location,delta:0})}function p(x){let v=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof x=="string"?x:po(x);return y=y.replace(/ $/,"%20"),ve(v,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,v)}let g={get action(){return a},get location(){return e(s,o)},listen(x){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Hd,f),l=x,()=>{s.removeEventListener(Hd,f),l=null}},createHref(x){return t(s,x)},createURL:p,encodeLocation(x){let v=p(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:u,replace:h,go(x){return o.go(x)}};return g}var Gd;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Gd||(Gd={}));function Av(e,t,n){return n===void 0&&(n="/"),Lv(e,t,n)}function Lv(e,t,n,r){let s=typeof t=="string"?Or(t):t,i=ic(s.pathname||"/",n);if(i==null)return null;let o=Xm(e);Dv(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(ve(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=gn([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(ve(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Xm(i.children,t,d,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:$v(c,i.index),routesMeta:d})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of Qm(i.path))s(i,o,l)}),t}function Qm(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=Qm(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function Dv(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Bv(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Rv=/^:[\w-]+$/,Vv=3,Fv=2,Iv=1,zv=10,Ov=-2,Yd=e=>e==="*";function $v(e,t){let n=e.split("/"),r=n.length;return n.some(Yd)&&(r+=Ov),t&&(r+=Fv),n.filter(s=>!Yd(s)).reduce((s,i)=>s+(Rv.test(i)?Vv:i===""?Iv:zv),r)}function Bv(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function Uv(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let a=0;a{let{paramName:u,isOptional:h}=d;if(u==="*"){let g=a[f]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const p=a[f];return h&&!p?c[u]=void 0:c[u]=(p||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:e}}function Hv(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Km(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function qv(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Km(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ic(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Gv(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Or(e):e;return{pathname:n?n.startsWith("/")?n:Yv(n,t):t,search:Qv(r),hash:Zv(s)}}function Yv(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Na(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Kv(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function oc(e,t){let n=Kv(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ac(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Or(e):(s=Os({},e),ve(!s.pathname||!s.pathname.includes("?"),Na("?","pathname","search",s)),ve(!s.pathname||!s.pathname.includes("#"),Na("#","pathname","hash",s)),ve(!s.search||!s.search.includes("#"),Na("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let u=o.split("/");for(;u[0]==="..";)u.shift(),f-=1;s.pathname=u.join("/")}a=f>=0?t[f]:"/"}let l=Gv(s,a),c=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const gn=e=>e.join("/").replace(/\/\/+/g,"/"),Xv=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Qv=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Zv=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Jv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Zm=["post","put","patch","delete"];new Set(Zm);const ex=["get",...Zm];new Set(ex);/** * React Router v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function $s(){return $s=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),k.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=ac(c,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:gn([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,i,e])}function t0(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=k.useContext(Pn),{matches:s}=k.useContext(jn),{pathname:i}=En(),o=JSON.stringify(oc(s,r.v7_relativeSplatPath));return k.useMemo(()=>ac(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function sx(e,t){return ix(e,t)}function ix(e,t,n,r){$r()||ve(!1);let{navigator:s}=k.useContext(Pn),{matches:i}=k.useContext(jn),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=En(),d;if(t){var f;let x=typeof t=="string"?Or(t):t;l==="/"||(f=x.pathname)!=null&&f.startsWith(l)||ve(!1),d=x}else d=c;let u=d.pathname||"/",h=u;if(l!=="/"){let x=l.replace(/^\//,"").split("/");h="/"+u.replace(/^\//,"").split("/").slice(x.length).join("/")}let p=Av(e,{pathname:h}),g=cx(p&&p.map(x=>Object.assign({},x,{params:Object.assign({},a,x.params),pathname:gn([l,s.encodeLocation?s.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:gn([l,s.encodeLocation?s.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return t&&g?k.createElement(Uo.Provider,{value:{location:$s({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:an.Pop}},g):g}function ox(){let e=px(),t=Jv(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),n?k.createElement("pre",{style:s},n):null,null)}const ax=k.createElement(ox,null);class lx extends k.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?k.createElement(jn.Provider,{value:this.props.routeContext},k.createElement(Jm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ux(e){let{routeContext:t,match:n,children:r}=e,s=k.useContext(lc);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),k.createElement(jn.Provider,{value:t},r)}function cx(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||ve(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,f,u)=>{let h,p=!1,g=null,x=null;n&&(h=a&&f.route.id?a[f.route.id]:void 0,g=f.route.errorElement||ax,l&&(c<0&&u===0?(gx("route-fallback"),p=!0,x=null):c===u&&(p=!0,x=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,u+1)),y=()=>{let w;return h?w=g:p?w=x:f.route.Component?w=k.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,k.createElement(ux,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||u===0)?k.createElement(lx,{location:n.location,revalidation:n.revalidation,component:g,error:h,children:y(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):y()},null)}var n0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(n0||{}),r0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(r0||{});function dx(e){let t=k.useContext(lc);return t||ve(!1),t}function fx(e){let t=k.useContext(tx);return t||ve(!1),t}function hx(e){let t=k.useContext(jn);return t||ve(!1),t}function s0(e){let t=hx(),n=t.matches[t.matches.length-1];return n.route.id||ve(!1),n.route.id}function px(){var e;let t=k.useContext(Jm),n=fx(),r=s0();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function mx(){let{router:e}=dx(n0.UseNavigateStable),t=s0(r0.UseNavigateStable),n=k.useRef(!1);return e0(()=>{n.current=!0}),k.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,$s({fromRouteId:t},i)))},[e,t])}const Kd={};function gx(e,t,n){Kd[e]||(Kd[e]=!0)}function yx(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function vx(e){let{to:t,replace:n,state:r,relative:s}=e;$r()||ve(!1);let{future:i,static:o}=k.useContext(Pn),{matches:a}=k.useContext(jn),{pathname:l}=En(),c=Wo(),d=ac(t,oc(a,i.v7_relativeSplatPath),l,s==="path"),f=JSON.stringify(d);return k.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:s}),[c,f,s,n,r]),null}function _t(e){ve(!1)}function xx(e){let{basename:t="/",children:n=null,location:r,navigationType:s=an.Pop,navigator:i,static:o=!1,future:a}=e;$r()&&ve(!1);let l=t.replace(/^\/*/,"/"),c=k.useMemo(()=>({basename:l,navigator:i,static:o,future:$s({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=Or(r));let{pathname:d="/",search:f="",hash:u="",state:h=null,key:p="default"}=r,g=k.useMemo(()=>{let x=ic(d,l);return x==null?null:{location:{pathname:x,search:f,hash:u,state:h,key:p},navigationType:s}},[l,d,f,u,h,p,s]);return g==null?null:k.createElement(Pn.Provider,{value:c},k.createElement(Uo.Provider,{children:n,value:g}))}function wx(e){let{children:t,location:n}=e;return sx(Ul(t),n)}new Promise(()=>{});function Ul(e,t){t===void 0&&(t=[]);let n=[];return k.Children.forEach(e,(r,s)=>{if(!k.isValidElement(r))return;let i=[...t,s];if(r.type===k.Fragment){n.push.apply(n,Ul(r.props.children,i));return}r.type!==_t&&ve(!1),!r.props.index||!r.props.children||ve(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Ul(r.props.children,i)),n.push(o)}),n}/** * React Router DOM v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Wl(){return Wl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Sx(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function kx(e,t){return e.button===0&&(!t||t==="_self")&&!Sx(e)}function Hl(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function Cx(e,t){let n=Hl(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const Px=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],jx="6";try{window.__reactRouterVersion=jx}catch{}const Ex="startTransition",Xd=yy[Ex];function Tx(e){let{basename:t,children:n,future:r,window:s}=e,i=k.useRef();i.current==null&&(i.current=Nv({window:s,v5Compat:!0}));let o=i.current,[a,l]=k.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},d=k.useCallback(f=>{c&&Xd?Xd(()=>l(f)):l(f)},[l,c]);return k.useLayoutEffect(()=>o.listen(d),[o,d]),k.useEffect(()=>yx(r),[r]),k.createElement(xx,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const Nx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Mx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zi=k.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:c,preventScrollReset:d,viewTransition:f}=t,u=bx(t,Px),{basename:h}=k.useContext(Pn),p,g=!1;if(typeof c=="string"&&Mx.test(c)&&(p=c,Nx))try{let w=new URL(window.location.href),b=c.startsWith("//")?new URL(w.protocol+c):new URL(c),S=ic(b.pathname,h);b.origin===w.origin&&S!=null?c=S+b.search+b.hash:g=!0}catch{}let x=nx(c,{relative:s}),v=_x(c,{replace:o,state:a,target:l,preventScrollReset:d,relative:s,viewTransition:f});function y(w){r&&r(w),w.defaultPrevented||v(w)}return k.createElement("a",Wl({},u,{href:p||x,onClick:g||i?r:y,ref:n,target:l}))});var Qd;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Qd||(Qd={}));var Zd;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Zd||(Zd={}));function _x(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=t===void 0?{}:t,l=Wo(),c=En(),d=t0(e,{relative:o});return k.useCallback(f=>{if(kx(f,n)){f.preventDefault();let u=r!==void 0?r:po(c)===po(d);l(e,{replace:u,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[c,l,d,r,s,n,e,i,o,a])}function Ax(e){let t=k.useRef(Hl(e)),n=k.useRef(!1),r=En(),s=k.useMemo(()=>Cx(r.search,n.current?null:t.current),[r.search]),i=Wo(),o=k.useCallback((a,l)=>{const c=Hl(typeof a=="function"?a(s):a);n.current=!0,i("?"+c,l)},[i,s]);return[s,o]}let Lx={data:""},Dx=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Lx},Rx=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Vx=/\/\*[^]*?\*\/| +/g,Jd=/\n+/g,rn=(e,t)=>{let n="",r="",s="";for(let i in e){let o=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+o+";":r+=i[1]=="f"?rn(o,i):i+"{"+rn(o,i[1]=="k"?"":t)+"}":typeof o=="object"?r+=rn(o,t?t.replace(/([^,])+/g,a=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):i):o!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=rn.p?rn.p(i,o):i+":"+o+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Nt={},i0=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+i0(e[n]);return t}return e},Fx=(e,t,n,r,s)=>{let i=i0(e),o=Nt[i]||(Nt[i]=(l=>{let c=0,d=11;for(;c>>0;return"go"+d})(i));if(!Nt[o]){let l=i!==e?e:(c=>{let d,f,u=[{}];for(;d=Rx.exec(c.replace(Vx,""));)d[4]?u.shift():d[3]?(f=d[3].replace(Jd," ").trim(),u.unshift(u[0][f]=u[0][f]||{})):u[0][d[1]]=d[2].replace(Jd," ").trim();return u[0]})(e);Nt[o]=rn(s?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&Nt.g?Nt.g:null;return n&&(Nt.g=Nt[o]),((l,c,d,f)=>{f?c.data=c.data.replace(f,l):c.data.indexOf(l)===-1&&(c.data=d?l+c.data:c.data+l)})(Nt[o],t,r,a),o},Ix=(e,t,n)=>e.reduce((r,s,i)=>{let o=t[i];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":rn(a,""):a===!1?"":a}return r+s+(o??"")},"");function Ho(e){let t=this||{},n=e.call?e(t.p):e;return Fx(n.unshift?n.raw?Ix(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,Dx(t.target),t.g,t.o,t.k)}let o0,ql,Gl;Ho.bind({g:1});let Wt=Ho.bind({k:1});function zx(e,t,n,r){rn.p=t,o0=e,ql=n,Gl=r}function Tn(e,t){let n=this||{};return function(){let r=arguments;function s(i,o){let a=Object.assign({},i),l=a.className||s.className;n.p=Object.assign({theme:ql&&ql()},a),n.o=/ *go\d+/.test(l),a.className=Ho.apply(n,r)+(l?" "+l:"");let c=e;return e[0]&&(c=a.as||e,delete a.as),Gl&&c[0]&&Gl(a),o0(c,a)}return s}}var Ox=e=>typeof e=="function",mo=(e,t)=>Ox(e)?e(t):e,$x=(()=>{let e=0;return()=>(++e).toString()})(),a0=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),Bx=20,uc="default",l0=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:r}=t;return l0(e,{type:e.toasts.find(o=>o.id===r.id)?1:0,toast:r});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(o=>o.id===s||s===void 0?{...o,dismissed:!0,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},Oi=[],u0={toasts:[],pausedAt:void 0,settings:{toastLimit:Bx}},Ct={},c0=(e,t=uc)=>{Ct[t]=l0(Ct[t]||u0,e),Oi.forEach(([n,r])=>{n===t&&r(Ct[t])})},d0=e=>Object.keys(Ct).forEach(t=>c0(e,t)),Ux=e=>Object.keys(Ct).find(t=>Ct[t].toasts.some(n=>n.id===e)),qo=(e=uc)=>t=>{c0(t,e)},Wx={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Hx=(e={},t=uc)=>{let[n,r]=k.useState(Ct[t]||u0),s=k.useRef(Ct[t]);k.useEffect(()=>(s.current!==Ct[t]&&r(Ct[t]),Oi.push([t,r]),()=>{let o=Oi.findIndex(([a])=>a===t);o>-1&&Oi.splice(o,1)}),[t]);let i=n.toasts.map(o=>{var a,l,c;return{...e,...e[o.type],...o,removeDelay:o.removeDelay||((a=e[o.type])==null?void 0:a.removeDelay)||(e==null?void 0:e.removeDelay),duration:o.duration||((l=e[o.type])==null?void 0:l.duration)||(e==null?void 0:e.duration)||Wx[o.type],style:{...e.style,...(c=e[o.type])==null?void 0:c.style,...o.style}}});return{...n,toasts:i}},qx=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||$x()}),Zs=e=>(t,n)=>{let r=qx(t,e,n);return qo(r.toasterId||Ux(r.id))({type:2,toast:r}),r.id},ke=(e,t)=>Zs("blank")(e,t);ke.error=Zs("error");ke.success=Zs("success");ke.loading=Zs("loading");ke.custom=Zs("custom");ke.dismiss=(e,t)=>{let n={type:3,toastId:e};t?qo(t)(n):d0(n)};ke.dismissAll=e=>ke.dismiss(void 0,e);ke.remove=(e,t)=>{let n={type:4,toastId:e};t?qo(t)(n):d0(n)};ke.removeAll=e=>ke.remove(void 0,e);ke.promise=(e,t,n)=>{let r=ke.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?mo(t.success,s):void 0;return i?ke.success(i,{id:r,...n,...n==null?void 0:n.success}):ke.dismiss(r),s}).catch(s=>{let i=t.error?mo(t.error,s):void 0;i?ke.error(i,{id:r,...n,...n==null?void 0:n.error}):ke.dismiss(r)}),e};var Gx=1e3,Yx=(e,t="default")=>{let{toasts:n,pausedAt:r}=Hx(e,t),s=k.useRef(new Map).current,i=k.useCallback((f,u=Gx)=>{if(s.has(f))return;let h=setTimeout(()=>{s.delete(f),o({type:4,toastId:f})},u);s.set(f,h)},[]);k.useEffect(()=>{if(r)return;let f=Date.now(),u=n.map(h=>{if(h.duration===1/0)return;let p=(h.duration||0)+h.pauseDuration-(f-h.createdAt);if(p<0){h.visible&&ke.dismiss(h.id);return}return setTimeout(()=>ke.dismiss(h.id,t),p)});return()=>{u.forEach(h=>h&&clearTimeout(h))}},[n,r,t]);let o=k.useCallback(qo(t),[t]),a=k.useCallback(()=>{o({type:5,time:Date.now()})},[o]),l=k.useCallback((f,u)=>{o({type:1,toast:{id:f,height:u}})},[o]),c=k.useCallback(()=>{r&&o({type:6,time:Date.now()})},[r,o]),d=k.useCallback((f,u)=>{let{reverseOrder:h=!1,gutter:p=8,defaultPosition:g}=u||{},x=n.filter(w=>(w.position||g)===(f.position||g)&&w.height),v=x.findIndex(w=>w.id===f.id),y=x.filter((w,b)=>bw.visible).slice(...h?[y+1]:[0,y]).reduce((w,b)=>w+(b.height||0)+p,0)},[n]);return k.useEffect(()=>{n.forEach(f=>{if(f.dismissed)i(f.id,f.removeDelay);else{let u=s.get(f.id);u&&(clearTimeout(u),s.delete(f.id))}})},[n,i]),{toasts:n,handlers:{updateHeight:l,startPause:a,endPause:c,calculateOffset:d}}},Kx=Wt` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,Xx=Wt` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,Qx=Wt` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,Zx=Tn("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${Kx} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${Xx} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${e=>e.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${Qx} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,Jx=Wt` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,e2=Tn("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${e=>e.secondary||"#e0e0e0"}; border-right-color: ${e=>e.primary||"#616161"}; animation: ${Jx} 1s linear infinite; `,t2=Wt` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,n2=Wt` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,r2=Tn("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${t2} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${n2} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${e=>e.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,s2=Tn("div")` position: absolute; `,i2=Tn("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,o2=Wt` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,a2=Tn("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${o2} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,l2=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?k.createElement(a2,null,t):t:n==="blank"?null:k.createElement(i2,null,k.createElement(e2,{...r}),n!=="loading"&&k.createElement(s2,null,n==="error"?k.createElement(Zx,{...r}):k.createElement(r2,{...r})))},u2=e=>` 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,c2=e=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} `,d2="0%{opacity:0;} 100%{opacity:1;}",f2="0%{opacity:1;} 100%{opacity:0;}",h2=Tn("div")` display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; `,p2=Tn("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,m2=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=a0()?[d2,f2]:[u2(n),c2(n)];return{animation:t?`${Wt(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Wt(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},g2=k.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?m2(e.position||t||"top-center",e.visible):{opacity:0},i=k.createElement(l2,{toast:e}),o=k.createElement(p2,{...e.ariaProps},mo(e.message,e));return k.createElement(h2,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:i,message:o}):k.createElement(k.Fragment,null,i,o))});zx(k.createElement);var y2=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let i=k.useCallback(o=>{if(o){let a=()=>{let l=o.getBoundingClientRect().height;r(e,l)};a(),new MutationObserver(a).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return k.createElement("div",{ref:i,className:t,style:n},s)},v2=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:a0()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},x2=Ho` z-index: 9999; > * { pointer-events: auto; } `,bi=16,w2=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:i,containerStyle:o,containerClassName:a})=>{let{toasts:l,handlers:c}=Yx(n,i);return k.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:bi,left:bi,right:bi,bottom:bi,pointerEvents:"none",...o},className:a,onMouseEnter:c.startPause,onMouseLeave:c.endPause},l.map(d=>{let f=d.position||t,u=c.calculateOffset(d,{reverseOrder:e,gutter:r,defaultPosition:t}),h=v2(f,u);return k.createElement(y2,{id:d.id,key:d.id,onHeightUpdate:c.updateHeight,className:d.visible?x2:"",style:h},d.type==="custom"?mo(d.message,d):s?s(d):k.createElement(g2,{toast:d,position:f}))}))},he=ke;const f0=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Go=k.createContext({}),cc=k.createContext(null),Yo=typeof document<"u",b2=Yo?k.useLayoutEffect:k.useEffect,h0=k.createContext({strict:!1}),dc=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),S2="framerAppearId",p0="data-"+dc(S2);function k2(e,t,n,r){const{visualElement:s}=k.useContext(Go),i=k.useContext(h0),o=k.useContext(cc),a=k.useContext(f0).reducedMotion,l=k.useRef();r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:s,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;k.useInsertionEffect(()=>{c&&c.update(n,o)});const d=k.useRef(!!(n[p0]&&!window.HandoffComplete));return b2(()=>{c&&(c.render(),d.current&&c.animationState&&c.animationState.animateChanges())}),k.useEffect(()=>{c&&(c.updateFeatures(),!d.current&&c.animationState&&c.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),c}function pr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function C2(e,t,n){return k.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):pr(n)&&(n.current=r))},[t])}function Bs(e){return typeof e=="string"||Array.isArray(e)}function Ko(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const fc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],hc=["initial",...fc];function Xo(e){return Ko(e.animate)||hc.some(t=>Bs(e[t]))}function m0(e){return!!(Xo(e)||e.variants)}function P2(e,t){if(Xo(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Bs(n)?n:void 0,animate:Bs(r)?r:void 0}}return e.inherit!==!1?t:{}}function j2(e){const{initial:t,animate:n}=P2(e,k.useContext(Go));return k.useMemo(()=>({initial:t,animate:n}),[ef(t),ef(n)])}function ef(e){return Array.isArray(e)?e.join(" "):e}const tf={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Us={};for(const e in tf)Us[e]={isEnabled:t=>tf[e].some(n=>!!t[n])};function E2(e){for(const t in e)Us[t]={...Us[t],...e[t]}}const g0=k.createContext({}),y0=k.createContext({}),T2=Symbol.for("motionComponentSymbol");function N2({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){e&&E2(e);function i(a,l){let c;const d={...k.useContext(f0),...a,layoutId:M2(a)},{isStatic:f}=d,u=j2(a),h=r(a,f);if(!f&&Yo){u.visualElement=k2(s,h,d,t);const p=k.useContext(y0),g=k.useContext(h0).strict;u.visualElement&&(c=u.visualElement.loadFeatures(d,g,e,p))}return k.createElement(Go.Provider,{value:u},c&&u.visualElement?k.createElement(c,{visualElement:u.visualElement,...d}):null,n(s,a,C2(h,u.visualElement,l),h,f,u.visualElement))}const o=k.forwardRef(i);return o[T2]=s,o}function M2({layoutId:e}){const t=k.useContext(g0).id;return t&&e!==void 0?t+"-"+e:e}function _2(e){function t(r,s={}){return N2(e(r,s))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,s)=>(n.has(s)||n.set(s,t(s)),n.get(s))})}const A2=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function pc(e){return typeof e!="string"||e.includes("-")?!1:!!(A2.indexOf(e)>-1||/[A-Z]/.test(e))}const go={};function L2(e){Object.assign(go,e)}const Js=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Qn=new Set(Js);function v0(e,{layout:t,layoutId:n}){return Qn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!go[e]||e==="opacity")}const Ge=e=>!!(e&&e.getVelocity),D2={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},R2=Js.length;function V2(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,s){let i="";for(let o=0;ot=>typeof t=="string"&&t.startsWith(e),w0=x0("--"),Yl=x0("var(--"),F2=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,I2=(e,t)=>t&&typeof e=="number"?t.transform(e):e,wn=(e,t,n)=>Math.min(Math.max(n,e),t),Zn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ys={...Zn,transform:e=>wn(0,1,e)},Si={...Zn,default:1},vs=e=>Math.round(e*1e5)/1e5,Qo=/(-)?([\d]*\.?[\d])+/g,b0=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,z2=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function ei(e){return typeof e=="string"}const ti=e=>({test:t=>ei(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Qt=ti("deg"),Tt=ti("%"),B=ti("px"),O2=ti("vh"),$2=ti("vw"),nf={...Tt,parse:e=>Tt.parse(e)/100,transform:e=>Tt.transform(e*100)},rf={...Zn,transform:Math.round},S0={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,radius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,size:B,top:B,right:B,bottom:B,left:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,rotate:Qt,rotateX:Qt,rotateY:Qt,rotateZ:Qt,scale:Si,scaleX:Si,scaleY:Si,scaleZ:Si,skew:Qt,skewX:Qt,skewY:Qt,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:ys,originX:nf,originY:nf,originZ:B,zIndex:rf,fillOpacity:ys,strokeOpacity:ys,numOctaves:rf};function mc(e,t,n,r){const{style:s,vars:i,transform:o,transformOrigin:a}=e;let l=!1,c=!1,d=!0;for(const f in t){const u=t[f];if(w0(f)){i[f]=u;continue}const h=S0[f],p=I2(u,h);if(Qn.has(f)){if(l=!0,o[f]=p,!d)continue;u!==(h.default||0)&&(d=!1)}else f.startsWith("origin")?(c=!0,a[f]=p):s[f]=p}if(t.transform||(l||r?s.transform=V2(e.transform,n,d,r):s.transform&&(s.transform="none")),c){const{originX:f="50%",originY:u="50%",originZ:h=0}=a;s.transformOrigin=`${f} ${u} ${h}`}}const gc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function k0(e,t,n){for(const r in t)!Ge(t[r])&&!v0(r,n)&&(e[r]=t[r])}function B2({transformTemplate:e},t,n){return k.useMemo(()=>{const r=gc();return mc(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function U2(e,t,n){const r=e.style||{},s={};return k0(s,r,e),Object.assign(s,B2(e,t,n)),e.transformValues?e.transformValues(s):s}function W2(e,t,n){const r={},s=U2(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=s,r}const H2=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function yo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||H2.has(e)}let C0=e=>!yo(e);function q2(e){e&&(C0=t=>t.startsWith("on")?!yo(t):e(t))}try{q2(require("@emotion/is-prop-valid").default)}catch{}function G2(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(C0(s)||n===!0&&yo(s)||!t&&!yo(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function sf(e,t,n){return typeof e=="string"?e:B.transform(t+n*e)}function Y2(e,t,n){const r=sf(t,e.x,e.width),s=sf(n,e.y,e.height);return`${r} ${s}`}const K2={offset:"stroke-dashoffset",array:"stroke-dasharray"},X2={offset:"strokeDashoffset",array:"strokeDasharray"};function Q2(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?K2:X2;e[i.offset]=B.transform(-r);const o=B.transform(t),a=B.transform(n);e[i.array]=`${o} ${a}`}function yc(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,f,u){if(mc(e,c,d,u),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:g}=e;h.transform&&(g&&(p.transform=h.transform),delete h.transform),g&&(s!==void 0||i!==void 0||p.transform)&&(p.transformOrigin=Y2(g,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Q2(h,o,a,l,!1)}const P0=()=>({...gc(),attrs:{}}),vc=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Z2(e,t,n,r){const s=k.useMemo(()=>{const i=P0();return yc(i,t,{enableHardwareAcceleration:!1},vc(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};k0(i,e.style,e),s.style={...i,...s.style}}return s}function J2(e=!1){return(n,r,s,{latestValues:i},o)=>{const l=(pc(n)?Z2:W2)(r,i,o,n),d={...G2(r,typeof n=="string",e),...l,ref:s},{children:f}=r,u=k.useMemo(()=>Ge(f)?f.get():f,[f]);return k.createElement(n,{...d,children:u})}}function j0(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const E0=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function T0(e,t,n,r){j0(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(E0.has(s)?s:dc(s),t.attrs[s])}function xc(e,t){const{style:n}=e,r={};for(const s in n)(Ge(n[s])||t.style&&Ge(t.style[s])||v0(s,e))&&(r[s]=n[s]);return r}function N0(e,t){const n=xc(e,t);for(const r in e)if(Ge(e[r])||Ge(t[r])){const s=Js.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[s]=e[r]}return n}function wc(e,t,n,r={},s={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,s)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,s)),t}function ew(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const vo=e=>Array.isArray(e),tw=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),nw=e=>vo(e)?e[e.length-1]||0:e;function $i(e){const t=Ge(e)?e.get():e;return tw(t)?t.toValue():t}function rw({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,s,i){const o={latestValues:sw(r,s,i,e),renderState:t()};return n&&(o.mount=a=>n(r,a,o)),o}const M0=e=>(t,n)=>{const r=k.useContext(Go),s=k.useContext(cc),i=()=>rw(e,t,r,s);return n?i():ew(i)};function sw(e,t,n,r){const s={},i=r(e,{});for(const u in i)s[u]=$i(i[u]);let{initial:o,animate:a}=e;const l=Xo(e),c=m0(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?a:o;return f&&typeof f!="boolean"&&!Ko(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=wc(e,h);if(!p)return;const{transitionEnd:g,transition:x,...v}=p;for(const y in v){let w=v[y];if(Array.isArray(w)){const b=d?w.length-1:0;w=w[b]}w!==null&&(s[y]=w)}for(const y in g)s[y]=g[y]}),s}const ye=e=>e;class of{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function iw(e){let t=new of,n=new of,r=0,s=!1,i=!1;const o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{const f=d&&s,u=f?t:n;return c&&o.add(l),u.add(l)&&f&&s&&(r=t.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){i=!0;return}if(s=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let c=0;c(f[u]=iw(()=>n=!0),f),{}),o=f=>i[f].process(s),a=()=>{const f=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(f-s.timestamp,ow),1),s.timestamp=f,s.isProcessing=!0,ki.forEach(o),s.isProcessing=!1,n&&t&&(r=!1,e(a))},l=()=>{n=!0,r=!0,s.isProcessing||e(a)};return{schedule:ki.reduce((f,u)=>{const h=i[u];return f[u]=(p,g=!1,x=!1)=>(n||l(),h.schedule(p,g,x)),f},{}),cancel:f=>ki.forEach(u=>i[u].cancel(f)),state:s,steps:i}}const{schedule:oe,cancel:Ht,state:De,steps:Ma}=aw(typeof requestAnimationFrame<"u"?requestAnimationFrame:ye,!0),lw={useVisualState:M0({scrapeMotionValuesFromProps:N0,createRenderState:P0,onMount:(e,t,{renderState:n,latestValues:r})=>{oe.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),oe.render(()=>{yc(n,r,{enableHardwareAcceleration:!1},vc(t.tagName),e.transformTemplate),T0(t,n)})}})},uw={useVisualState:M0({scrapeMotionValuesFromProps:xc,createRenderState:gc})};function cw(e,{forwardMotionProps:t=!1},n,r){return{...pc(e)?lw:uw,preloadedFeatures:n,useRender:J2(t),createVisualElement:r,Component:e}}function Vt(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const _0=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Zo(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const dw=e=>t=>_0(t)&&e(t,Zo(t));function It(e,t,n,r){return Vt(e,t,dw(n),r)}const fw=(e,t)=>n=>t(e(n)),yn=(...e)=>e.reduce(fw);function A0(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const af=A0("dragHorizontal"),lf=A0("dragVertical");function L0(e){let t=!1;if(e==="y")t=lf();else if(e==="x")t=af();else{const n=af(),r=lf();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function D0(){const e=L0(!0);return e?(e(),!1):!0}class Nn{constructor(t){this.isMounted=!1,this.node=t}update(){}}function uf(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),s=(i,o)=>{if(i.pointerType==="touch"||D0())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[r]&&oe.update(()=>a[r](i,o))};return It(e.current,n,s,{passive:!e.getProps()[r]})}class hw extends Nn{mount(){this.unmount=yn(uf(this.node,!0),uf(this.node,!1))}unmount(){}}class pw extends Nn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=yn(Vt(this.node.current,"focus",()=>this.onFocus()),Vt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const R0=(e,t)=>t?e===t?!0:R0(e,t.parentElement):!1;function _a(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Zo(n))}class mw extends Nn{constructor(){super(...arguments),this.removeStartListeners=ye,this.removeEndListeners=ye,this.removeAccessibleListeners=ye,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),i=It(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:d,globalTapTarget:f}=this.node.getProps();oe.update(()=>{!f&&!R0(this.node.current,a.target)?d&&d(a,l):c&&c(a,l)})},{passive:!(r.onTap||r.onPointerUp)}),o=It(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=yn(i,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=i=>{if(i.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||_a("up",(l,c)=>{const{onTap:d}=this.node.getProps();d&&oe.update(()=>d(l,c))})};this.removeEndListeners(),this.removeEndListeners=Vt(this.node.current,"keyup",o),_a("down",(a,l)=>{this.startPress(a,l)})},n=Vt(this.node.current,"keydown",t),r=()=>{this.isPressing&&_a("cancel",(i,o)=>this.cancelPress(i,o))},s=Vt(this.node.current,"blur",r);this.removeAccessibleListeners=yn(n,s)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&oe.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!D0()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&oe.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=It(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Vt(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=yn(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Kl=new WeakMap,Aa=new WeakMap,gw=e=>{const t=Kl.get(e.target);t&&t(e)},yw=e=>{e.forEach(gw)};function vw({root:e,...t}){const n=e||document;Aa.has(n)||Aa.set(n,{});const r=Aa.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(yw,{root:e,...t})),r[s]}function xw(e,t,n){const r=vw(t);return Kl.set(e,n),r.observe(e),()=>{Kl.delete(e),r.unobserve(e)}}const ww={some:0,all:1};class bw extends Nn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:ww[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),u=c?d:f;u&&u(l)};return xw(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Sw(t,n))&&this.startObserver()}unmount(){}}function Sw({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const kw={inView:{Feature:bw},tap:{Feature:mw},focus:{Feature:pw},hover:{Feature:hw}};function V0(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rt[r]=n.get()),t}function Pw(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function Jo(e,t,n){const r=e.getProps();return wc(r,t,n!==void 0?n:r.custom,Cw(e),Pw(e))}let bc=ye;const Bn=e=>e*1e3,zt=e=>e/1e3,jw={current:!1},F0=e=>Array.isArray(e)&&typeof e[0]=="number";function I0(e){return!!(!e||typeof e=="string"&&z0[e]||F0(e)||Array.isArray(e)&&e.every(I0))}const as=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,z0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:as([0,.65,.55,1]),circOut:as([.55,0,1,.45]),backIn:as([.31,.01,.66,-.59]),backOut:as([.33,1.53,.69,.99])};function O0(e){if(e)return F0(e)?as(e):Array.isArray(e)?e.map(O0):z0[e]}function Ew(e,t,n,{delay:r=0,duration:s,repeat:i=0,repeatType:o="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const d=O0(a);return Array.isArray(d)&&(c.easing=d),e.animate(c,{delay:r,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}function Tw(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const $0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Nw=1e-7,Mw=12;function _w(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=$0(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>Nw&&++a_w(i,0,1,e,n);return i=>i===0||i===1?i:$0(s(i),t,r)}const Aw=ni(.42,0,1,1),Lw=ni(0,0,.58,1),B0=ni(.42,0,.58,1),Dw=e=>Array.isArray(e)&&typeof e[0]!="number",U0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,W0=e=>t=>1-e(1-t),Sc=e=>1-Math.sin(Math.acos(e)),H0=W0(Sc),Rw=U0(Sc),q0=ni(.33,1.53,.69,.99),kc=W0(q0),Vw=U0(kc),Fw=e=>(e*=2)<1?.5*kc(e):.5*(2-Math.pow(2,-10*(e-1))),Iw={linear:ye,easeIn:Aw,easeInOut:B0,easeOut:Lw,circIn:Sc,circInOut:Rw,circOut:H0,backIn:kc,backInOut:Vw,backOut:q0,anticipate:Fw},cf=e=>{if(Array.isArray(e)){bc(e.length===4);const[t,n,r,s]=e;return ni(t,n,r,s)}else if(typeof e=="string")return Iw[e];return e},Cc=(e,t)=>n=>!!(ei(n)&&z2.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),G0=(e,t,n)=>r=>{if(!ei(r))return r;const[s,i,o,a]=r.match(Qo);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},zw=e=>wn(0,255,e),La={...Zn,transform:e=>Math.round(zw(e))},zn={test:Cc("rgb","red"),parse:G0("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+La.transform(e)+", "+La.transform(t)+", "+La.transform(n)+", "+vs(ys.transform(r))+")"};function Ow(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Xl={test:Cc("#"),parse:Ow,transform:zn.transform},mr={test:Cc("hsl","hue"),parse:G0("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Tt.transform(vs(t))+", "+Tt.transform(vs(n))+", "+vs(ys.transform(r))+")"},Fe={test:e=>zn.test(e)||Xl.test(e)||mr.test(e),parse:e=>zn.test(e)?zn.parse(e):mr.test(e)?mr.parse(e):Xl.parse(e),transform:e=>ei(e)?e:e.hasOwnProperty("red")?zn.transform(e):mr.transform(e)},ce=(e,t,n)=>-n*e+n*t+e;function Da(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function $w({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Da(l,a,e+1/3),i=Da(l,a,e),o=Da(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}const Ra=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},Bw=[Xl,zn,mr],Uw=e=>Bw.find(t=>t.test(e));function df(e){const t=Uw(e);let n=t.parse(e);return t===mr&&(n=$w(n)),n}const Y0=(e,t)=>{const n=df(e),r=df(t),s={...n};return i=>(s.red=Ra(n.red,r.red,i),s.green=Ra(n.green,r.green,i),s.blue=Ra(n.blue,r.blue,i),s.alpha=ce(n.alpha,r.alpha,i),zn.transform(s))};function Ww(e){var t,n;return isNaN(e)&&ei(e)&&(((t=e.match(Qo))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(b0))===null||n===void 0?void 0:n.length)||0)>0}const K0={regex:F2,countKey:"Vars",token:"${v}",parse:ye},X0={regex:b0,countKey:"Colors",token:"${c}",parse:Fe.parse},Q0={regex:Qo,countKey:"Numbers",token:"${n}",parse:Zn.parse};function Va(e,{regex:t,countKey:n,token:r,parse:s}){const i=e.tokenised.match(t);i&&(e["num"+n]=i.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...i.map(s)))}function xo(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Va(n,K0),Va(n,X0),Va(n,Q0),n}function Z0(e){return xo(e).values}function J0(e){const{values:t,numColors:n,numVars:r,tokenised:s}=xo(e),i=t.length;return o=>{let a=s;for(let l=0;ltypeof e=="number"?0:e;function qw(e){const t=Z0(e);return J0(e)(t.map(Hw))}const bn={test:Ww,parse:Z0,createTransformer:J0,getAnimatableNone:qw},eg=(e,t)=>n=>`${n>0?t:e}`;function tg(e,t){return typeof e=="number"?n=>ce(e,t,n):Fe.test(e)?Y0(e,t):e.startsWith("var(")?eg(e,t):rg(e,t)}const ng=(e,t)=>{const n=[...e],r=n.length,s=e.map((i,o)=>tg(i,t[o]));return i=>{for(let o=0;o{const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=tg(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}},rg=(e,t)=>{const n=bn.createTransformer(t),r=xo(e),s=xo(t);return r.numVars===s.numVars&&r.numColors===s.numColors&&r.numNumbers>=s.numNumbers?yn(ng(r.values,s.values),n):eg(e,t)},Ws=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},ff=(e,t)=>n=>ce(e,t,n);function Yw(e){return typeof e=="number"?ff:typeof e=="string"?Fe.test(e)?Y0:rg:Array.isArray(e)?ng:typeof e=="object"?Gw:ff}function Kw(e,t,n){const r=[],s=n||Yw(e[0]),i=e.length-1;for(let o=0;ot[0];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=Kw(t,r,s),a=o.length,l=c=>{let d=0;if(a>1)for(;dl(wn(e[0],e[i-1],c)):l}function Xw(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Ws(0,t,r);e.push(ce(n,1,s))}}function Qw(e){const t=[0];return Xw(t,e.length-1),t}function Zw(e,t){return e.map(n=>n*t)}function Jw(e,t){return e.map(()=>t||B0).splice(0,e.length-1)}function wo({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Dw(r)?r.map(cf):cf(r),i={done:!1,value:t[0]},o=Zw(n&&n.length===t.length?n:Qw(t),e),a=sg(o,t,{ease:Array.isArray(s)?s:Jw(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}function ig(e,t){return t?e*(1e3/t):0}const e5=5;function og(e,t,n){const r=Math.max(t-e5,0);return ig(n-e(r),t-r)}const Fa=.001,t5=.01,n5=10,r5=.05,s5=1;function i5({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let s,i,o=1-t;o=wn(r5,s5,o),e=wn(t5,n5,zt(e)),o<1?(s=c=>{const d=c*o,f=d*e,u=d-n,h=Ql(c,o),p=Math.exp(-f);return Fa-u/h*p},i=c=>{const f=c*o*e,u=f*n+n,h=Math.pow(o,2)*Math.pow(c,2)*e,p=Math.exp(-f),g=Ql(Math.pow(c,2),o);return(-s(c)+Fa>0?-1:1)*((u-h)*p)/g}):(s=c=>{const d=Math.exp(-c*e),f=(c-n)*e+1;return-Fa+d*f},i=c=>{const d=Math.exp(-c*e),f=(n-c)*(e*e);return d*f});const a=5/e,l=a5(s,i,a);if(e=Bn(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const o5=12;function a5(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function c5(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!hf(e,u5)&&hf(e,l5)){const n=i5(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function ag({keyframes:e,restDelta:t,restSpeed:n,...r}){const s=e[0],i=e[e.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:d,velocity:f,isResolvedFromDuration:u}=c5({...r,velocity:-zt(r.velocity||0)}),h=f||0,p=l/(2*Math.sqrt(a*c)),g=i-s,x=zt(Math.sqrt(a/c)),v=Math.abs(g)<5;n||(n=v?.01:2),t||(t=v?.005:.5);let y;if(p<1){const w=Ql(x,p);y=b=>{const S=Math.exp(-p*x*b);return i-S*((h+p*x*g)/w*Math.sin(w*b)+g*Math.cos(w*b))}}else if(p===1)y=w=>i-Math.exp(-x*w)*(g+(h+x*g)*w);else{const w=x*Math.sqrt(p*p-1);y=b=>{const S=Math.exp(-p*x*b),C=Math.min(w*b,300);return i-S*((h+p*x*g)*Math.sinh(C)+w*g*Math.cosh(C))/w}}return{calculatedDuration:u&&d||null,next:w=>{const b=y(w);if(u)o.done=w>=d;else{let S=h;w!==0&&(p<1?S=og(y,w,b):S=0);const C=Math.abs(S)<=n,P=Math.abs(i-b)<=t;o.done=C&&P}return o.value=o.done?i:b,o}}}function pf({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const f=e[0],u={done:!1,value:f},h=j=>a!==void 0&&jl,p=j=>a===void 0?l:l===void 0||Math.abs(a-j)-g*Math.exp(-j/r),w=j=>v+y(j),b=j=>{const D=y(j),T=w(j);u.done=Math.abs(D)<=c,u.value=u.done?v:T};let S,C;const P=j=>{h(u.value)&&(S=j,C=ag({keyframes:[u.value,p(u.value)],velocity:og(w,j,u.value),damping:s,stiffness:i,restDelta:c,restSpeed:d}))};return P(0),{calculatedDuration:null,next:j=>{let D=!1;return!C&&S===void 0&&(D=!0,b(j),P(j)),S!==void 0&&j>S?C.next(j-S):(!D&&b(j),u)}}}const d5=e=>{const t=({timestamp:n})=>e(n);return{start:()=>oe.update(t,!0),stop:()=>Ht(t),now:()=>De.isProcessing?De.timestamp:performance.now()}},mf=2e4;function gf(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=mf?1/0:t}const f5={decay:pf,inertia:pf,tween:wo,keyframes:wo,spring:ag};function bo({autoplay:e=!0,delay:t=0,driver:n=d5,keyframes:r,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:d,onUpdate:f,...u}){let h=1,p=!1,g,x;const v=()=>{x=new Promise(L=>{g=L})};v();let y;const w=f5[s]||wo;let b;w!==wo&&typeof r[0]!="number"&&(b=sg([0,100],r,{clamp:!1}),r=[0,100]);const S=w({...u,keyframes:r});let C;a==="mirror"&&(C=w({...u,keyframes:[...r].reverse(),velocity:-(u.velocity||0)}));let P="idle",j=null,D=null,T=null;S.calculatedDuration===null&&i&&(S.calculatedDuration=gf(S));const{calculatedDuration:z}=S;let V=1/0,U=1/0;z!==null&&(V=z+o,U=V*(i+1)-o);let R=0;const Q=L=>{if(D===null)return;h>0&&(D=Math.min(D,L)),h<0&&(D=Math.min(L-U/h,D)),j!==null?R=j:R=Math.round(L-D)*h;const E=R-t*(h>=0?1:-1),W=h>=0?E<0:E>U;R=Math.max(E,0),P==="finished"&&j===null&&(R=U);let X=R,te=S;if(i){const Jn=Math.min(R,U)/V;let Mn=Math.floor(Jn),wt=Jn%1;!wt&&Jn>=1&&(wt=1),wt===1&&Mn--,Mn=Math.min(Mn,i+1),!!(Mn%2)&&(a==="reverse"?(wt=1-wt,o&&(wt-=o/V)):a==="mirror"&&(te=C)),X=wn(0,1,wt)*V}const G=W?{done:!1,value:r[0]}:te.next(X);b&&(G.value=b(G.value));let{done:be}=G;!W&&z!==null&&(be=h>=0?R>=U:R<=0);const ri=j===null&&(P==="finished"||P==="running"&&be);return f&&f(G.value),ri&&_(),G},A=()=>{y&&y.stop(),y=void 0},q=()=>{P="idle",A(),g(),v(),D=T=null},_=()=>{P="finished",d&&d(),A(),g()},N=()=>{if(p)return;y||(y=n(Q));const L=y.now();l&&l(),j!==null?D=L-j:(!D||P==="finished")&&(D=L),P==="finished"&&v(),T=D,j=null,P="running",y.start()};e&&N();const F={then(L,E){return x.then(L,E)},get time(){return zt(R)},set time(L){L=Bn(L),R=L,j!==null||!y||h===0?j=L:D=y.now()-L/h},get duration(){const L=S.calculatedDuration===null?gf(S):S.calculatedDuration;return zt(L)},get speed(){return h},set speed(L){L===h||!y||(h=L,F.time=zt(R))},get state(){return P},play:N,pause:()=>{P="paused",j=R},stop:()=>{p=!0,P!=="idle"&&(P="idle",c&&c(),q())},cancel:()=>{T!==null&&Q(T),q()},complete:()=>{P="finished"},sample:L=>(D=0,Q(L))};return F}function h5(e){let t;return()=>(t===void 0&&(t=e()),t)}const p5=h5(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),m5=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Ci=10,g5=2e4,y5=(e,t)=>t.type==="spring"||e==="backgroundColor"||!I0(t.ease);function v5(e,t,{onUpdate:n,onComplete:r,...s}){if(!(p5()&&m5.has(t)&&!s.repeatDelay&&s.repeatType!=="mirror"&&s.damping!==0&&s.type!=="inertia"))return!1;let o=!1,a,l,c=!1;const d=()=>{l=new Promise(w=>{a=w})};d();let{keyframes:f,duration:u=300,ease:h,times:p}=s;if(y5(t,s)){const w=bo({...s,repeat:0,delay:0});let b={done:!1,value:f[0]};const S=[];let C=0;for(;!b.done&&C{c=!1,g.cancel()},v=()=>{c=!0,oe.update(x),a(),d()};return g.onfinish=()=>{c||(e.set(Tw(f,s)),r&&r(),v())},{then(w,b){return l.then(w,b)},attachTimeline(w){return g.timeline=w,g.onfinish=null,ye},get time(){return zt(g.currentTime||0)},set time(w){g.currentTime=Bn(w)},get speed(){return g.playbackRate},set speed(w){g.playbackRate=w},get duration(){return zt(u)},play:()=>{o||(g.play(),Ht(x))},pause:()=>g.pause(),stop:()=>{if(o=!0,g.playState==="idle")return;const{currentTime:w}=g;if(w){const b=bo({...s,autoplay:!1});e.setWithVelocity(b.sample(w-Ci).value,b.sample(w).value,Ci)}v()},complete:()=>{c||g.finish()},cancel:v}}function x5({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const s=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:ye,pause:ye,stop:ye,then:i=>(i(),Promise.resolve()),cancel:ye,complete:ye});return t?bo({keyframes:[0,1],duration:0,delay:t,onComplete:s}):s()}const w5={type:"spring",stiffness:500,damping:25,restSpeed:10},b5=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),S5={type:"keyframes",duration:.8},k5={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},C5=(e,{keyframes:t})=>t.length>2?S5:Qn.has(e)?e.startsWith("scale")?b5(t[1]):w5:k5,Zl=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(bn.test(t)||t==="0")&&!t.startsWith("url(")),P5=new Set(["brightness","contrast","saturate","opacity"]);function j5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Qo)||[];if(!r)return e;const s=n.replace(r,"");let i=P5.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const E5=/([a-z-]*)\(.*?\)/g,Jl={...bn,getAnimatableNone:e=>{const t=e.match(E5);return t?t.map(j5).join(" "):e}},T5={...S0,color:Fe,backgroundColor:Fe,outlineColor:Fe,fill:Fe,stroke:Fe,borderColor:Fe,borderTopColor:Fe,borderRightColor:Fe,borderBottomColor:Fe,borderLeftColor:Fe,filter:Jl,WebkitFilter:Jl},Pc=e=>T5[e];function lg(e,t){let n=Pc(e);return n!==Jl&&(n=bn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ug=e=>/^0[^.\s]+$/.test(e);function N5(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||ug(e)}function M5(e,t,n,r){const s=Zl(t,n);let i;Array.isArray(n)?i=[...n]:i=[null,n];const o=r.from!==void 0?r.from:e.get();let a;const l=[];for(let c=0;cs=>{const i=jc(r,e)||{},o=i.delay||r.delay||0;let{elapsed:a=0}=r;a=a-Bn(o);const l=M5(t,e,n,i),c=l[0],d=l[l.length-1],f=Zl(e,c),u=Zl(e,d);let h={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...i,delay:-a,onUpdate:p=>{t.set(p),i.onUpdate&&i.onUpdate(p)},onComplete:()=>{s(),i.onComplete&&i.onComplete()}};if(_5(i)||(h={...h,...C5(e,h)}),h.duration&&(h.duration=Bn(h.duration)),h.repeatDelay&&(h.repeatDelay=Bn(h.repeatDelay)),!f||!u||jw.current||i.type===!1||A5.skipAnimations)return x5(h);if(!r.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=v5(t,e,h);if(p)return p}return bo(h)};function So(e){return!!(Ge(e)&&e.add)}const cg=e=>/^\-?\d*\.?\d+$/.test(e);function Tc(e,t){e.indexOf(t)===-1&&e.push(t)}function Nc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Mc{constructor(){this.subscriptions=[]}add(t){return Tc(this.subscriptions,t),()=>Nc(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i!isNaN(parseFloat(e));class D5{constructor(t,n={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,s=!0)=>{this.prev=this.current,this.current=r;const{delta:i,timestamp:o}=De;this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,oe.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>oe.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=L5(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Mc);const r=this.events[t].add(n);return t==="change"?()=>{r(),oe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ig(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Lr(e,t){return new D5(e,t)}const dg=e=>t=>t.test(e),R5={test:e=>e==="auto",parse:e=>e},fg=[Zn,B,Tt,Qt,$2,O2,R5],Jr=e=>fg.find(dg(e)),V5=[...fg,Fe,bn],F5=e=>V5.find(dg(e));function I5(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Lr(n))}function z5(e,t){const n=Jo(e,t);let{transitionEnd:r={},transition:s={},...i}=n?e.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const o in i){const a=nw(i[o]);I5(e,o,a)}}function O5(e,t,n){var r,s;const i=Object.keys(t).filter(a=>!e.hasValue(a)),o=i.length;if(o)for(let a=0;al.remove(f))),c.push(x)}return o&&Promise.all(c).then(()=>{o&&z5(e,o)}),c}function eu(e,t,n={}){const r=Jo(e,t,n.custom);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(hg(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=s;return H5(e,t,c+l,d,f,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[i,o]:[o,i];return l().then(()=>c())}else return Promise.all([i(),o(n.delay)])}function H5(e,t,n=0,r=0,s=1,i){const o=[],a=(e.variantChildren.size-1)*r,l=s===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(q5).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(eu(c,t,{...i,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function q5(e,t){return e.sortNodePosition(t)}function G5(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>eu(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=eu(e,t,n);else{const s=typeof t=="function"?Jo(e,t,n.custom):t;r=Promise.all(hg(e,s,n))}return r.then(()=>e.notify("AnimationComplete",t))}const Y5=[...fc].reverse(),K5=fc.length;function X5(e){return t=>Promise.all(t.map(({animation:n,options:r})=>G5(e,n,r)))}function Q5(e){let t=X5(e);const n=J5();let r=!0;const s=(l,c)=>{const d=Jo(e,c);if(d){const{transition:f,transitionEnd:u,...h}=d;l={...l,...h,...u}}return l};function i(l){t=l(e)}function o(l,c){const d=e.getProps(),f=e.getVariantContext(!0)||{},u=[],h=new Set;let p={},g=1/0;for(let v=0;vg&&S,T=!1;const z=Array.isArray(b)?b:[b];let V=z.reduce(s,{});C===!1&&(V={});const{prevResolvedValues:U={}}=w,R={...U,...V},Q=A=>{D=!0,h.has(A)&&(T=!0,h.delete(A)),w.needsAnimating[A]=!0};for(const A in R){const q=V[A],_=U[A];if(p.hasOwnProperty(A))continue;let N=!1;vo(q)&&vo(_)?N=!V0(q,_):N=q!==_,N?q!==void 0?Q(A):h.add(A):q!==void 0&&h.has(A)?Q(A):w.protectedKeys[A]=!0}w.prevProp=b,w.prevResolvedValues=V,w.isActive&&(p={...p,...V}),r&&e.blockInitialAnimation&&(D=!1),D&&(!P||T)&&u.push(...z.map(A=>({animation:A,options:{type:y,...l}})))}if(h.size){const v={};h.forEach(y=>{const w=e.getBaseTarget(y);w!==void 0&&(v[y]=w)}),u.push({animation:v})}let x=!!u.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?t(u):Promise.resolve()}function a(l,c,d){var f;if(n[l].isActive===c)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const u=o(d,l);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n}}function Z5(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!V0(t,e):!1}function _n(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function J5(){return{animate:_n(!0),whileInView:_n(),whileHover:_n(),whileTap:_n(),whileDrag:_n(),whileFocus:_n(),exit:_n()}}class e3 extends Nn{constructor(t){super(t),t.animationState||(t.animationState=Q5(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),Ko(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let t3=0;class n3 extends Nn{constructor(){super(...arguments),this.id=t3++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const r3={animation:{Feature:e3},exit:{Feature:n3}},yf=(e,t)=>Math.abs(e-t);function s3(e,t){const n=yf(e.x,t.x),r=yf(e.y,t.y);return Math.sqrt(n**2+r**2)}class pg{constructor(t,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=za(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,h=s3(f.offset,{x:0,y:0})>=3;if(!u&&!h)return;const{point:p}=f,{timestamp:g}=De;this.history.push({...p,timestamp:g});const{onStart:x,onMove:v}=this.handlers;u||(x&&x(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,f)},this.handlePointerMove=(f,u)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Ia(u,this.transformPagePoint),oe.update(this.updatePoint,!0)},this.handlePointerUp=(f,u)=>{this.end();const{onEnd:h,onSessionEnd:p,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=za(f.type==="pointercancel"?this.lastMoveEventInfo:Ia(u,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,x),p&&p(f,x)},!_0(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const o=Zo(t),a=Ia(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=De;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,za(a,this.history)),this.removeListeners=yn(It(this.contextWindow,"pointermove",this.handlePointerMove),It(this.contextWindow,"pointerup",this.handlePointerUp),It(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ht(this.updatePoint)}}function Ia(e,t){return t?{point:t(e.point)}:e}function vf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function za({point:e},t){return{point:e,delta:vf(e,mg(t)),offset:vf(e,i3(t)),velocity:o3(t,.1)}}function i3(e){return e[0]}function mg(e){return e[e.length-1]}function o3(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=mg(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Bn(t)));)n--;if(!r)return{x:0,y:0};const i=zt(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Je(e){return e.max-e.min}function tu(e,t=0,n=.01){return Math.abs(e-t)<=n}function xf(e,t,n,r=.5){e.origin=r,e.originPoint=ce(t.min,t.max,e.origin),e.scale=Je(n)/Je(t),(tu(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=ce(n.min,n.max,e.origin)-e.originPoint,(tu(e.translate)||isNaN(e.translate))&&(e.translate=0)}function xs(e,t,n,r){xf(e.x,t.x,n.x,r?r.originX:void 0),xf(e.y,t.y,n.y,r?r.originY:void 0)}function wf(e,t,n){e.min=n.min+t.min,e.max=e.min+Je(t)}function a3(e,t,n){wf(e.x,t.x,n.x),wf(e.y,t.y,n.y)}function bf(e,t,n){e.min=t.min-n.min,e.max=e.min+Je(t)}function ws(e,t,n){bf(e.x,t.x,n.x),bf(e.y,t.y,n.y)}function l3(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?ce(n,e,r.max):Math.min(e,n)),e}function Sf(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function u3(e,{top:t,left:n,bottom:r,right:s}){return{x:Sf(e.x,n,s),y:Sf(e.y,t,r)}}function kf(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Ws(t.min,t.max-r,e.min):r>s&&(n=Ws(e.min,e.max-s,t.min)),wn(0,1,n)}function f3(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const nu=.35;function h3(e=nu){return e===!1?e=0:e===!0&&(e=nu),{x:Cf(e,"left","right"),y:Cf(e,"top","bottom")}}function Cf(e,t,n){return{min:Pf(e,t),max:Pf(e,n)}}function Pf(e,t){return typeof e=="number"?e:e[t]||0}const jf=()=>({translate:0,scale:1,origin:0,originPoint:0}),gr=()=>({x:jf(),y:jf()}),Ef=()=>({min:0,max:0}),xe=()=>({x:Ef(),y:Ef()});function st(e){return[e("x"),e("y")]}function gg({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function p3({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function m3(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Oa(e){return e===void 0||e===1}function ru({scale:e,scaleX:t,scaleY:n}){return!Oa(e)||!Oa(t)||!Oa(n)}function Dn(e){return ru(e)||yg(e)||e.z||e.rotate||e.rotateX||e.rotateY}function yg(e){return Tf(e.x)||Tf(e.y)}function Tf(e){return e&&e!=="0%"}function ko(e,t,n){const r=e-n,s=t*r;return n+s}function Nf(e,t,n,r,s){return s!==void 0&&(e=ko(e,s,r)),ko(e,n,r)+t}function su(e,t=0,n=1,r,s){e.min=Nf(e.min,t,n,r,s),e.max=Nf(e.max,t,n,r,s)}function vg(e,{x:t,y:n}){su(e.x,t.translate,t.scale,t.originPoint),su(e.y,n.translate,n.scale,n.originPoint)}function g3(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function en(e,t){e.min=e.min+t,e.max=e.max+t}function _f(e,t,[n,r,s]){const i=t[s]!==void 0?t[s]:.5,o=ce(e.min,e.max,i);su(e,t[n],t[r],o,t.scale)}const y3=["x","scaleX","originX"],v3=["y","scaleY","originY"];function yr(e,t){_f(e.x,t,y3),_f(e.y,t,v3)}function xg(e,t){return gg(m3(e.getBoundingClientRect(),t))}function x3(e,t,n){const r=xg(e,n),{scroll:s}=t;return s&&(en(r.x,s.offset.x),en(r.y,s.offset.y)),r}const wg=({current:e})=>e?e.ownerDocument.defaultView:null,w3=new WeakMap;class b3{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=xe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Zo(d,"page").point)},i=(d,f)=>{const{drag:u,dragPropagation:h,onDragStart:p}=this.getProps();if(u&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=L0(u),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),st(x=>{let v=this.getAxisMotionValue(x).get()||0;if(Tt.test(v)){const{projection:y}=this.visualElement;if(y&&y.layout){const w=y.layout.layoutBox[x];w&&(v=Je(w)*(parseFloat(v)/100))}}this.originPoint[x]=v}),p&&oe.update(()=>p(d,f),!1,!0);const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(d,f)=>{const{dragPropagation:u,dragDirectionLock:h,onDirectionLock:p,onDrag:g}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:x}=f;if(h&&this.currentDirection===null){this.currentDirection=S3(x),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,x),this.updateAxis("y",f.point,x),this.visualElement.render(),g&&g(d,f)},a=(d,f)=>this.stop(d,f),l=()=>st(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new pg(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:wg(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&oe.update(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Pi(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=l3(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&pr(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=u3(s.layoutBox,n):this.constraints=!1,this.elastic=h3(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&st(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=f3(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!pr(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=x3(r,s.root,this.visualElement.getTransformPagePoint());let o=c3(s.layout.layoutBox,i);if(n){const a=n(p3(o));this.hasMutatedConstraints=!!a,a&&(o=gg(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=st(d=>{if(!Pi(d,n,this.currentDirection))return;let f=l&&l[d]||{};o&&(f={min:0,max:0});const u=s?200:1e6,h=s?40:1e7,p={type:"inertia",velocity:r?t[d]:0,bounceStiffness:u,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(Ec(t,r,0,n))}stopAnimation(){st(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){st(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){st(n=>{const{drag:r}=this.getProps();if(!Pi(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(t[n]-ce(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!pr(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};st(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();s[o]=d3({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),st(o=>{if(!Pi(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ce(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;w3.set(this.visualElement,this);const t=this.visualElement.current,n=It(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();pr(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),r();const o=Vt(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(st(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=nu,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Pi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function S3(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class k3 extends Nn{constructor(t){super(t),this.removeGroupControls=ye,this.removeListeners=ye,this.controls=new b3(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ye}unmount(){this.removeGroupControls(),this.removeListeners()}}const Af=e=>(t,n)=>{e&&oe.update(()=>e(t,n))};class C3 extends Nn{constructor(){super(...arguments),this.removePointerDownListener=ye}onPointerDown(t){this.session=new pg(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:wg(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Af(t),onStart:Af(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&oe.update(()=>s(i,o))}}}mount(){this.removePointerDownListener=It(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function P3(){const e=k.useContext(cc);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,s=k.useId();return k.useEffect(()=>r(s),[]),!t&&n?[!1,()=>n&&n(s)]:[!0]}const Bi={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Lf(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const es={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(B.test(e))e=parseFloat(e);else return e;const n=Lf(e,t.target.x),r=Lf(e,t.target.y);return`${n}% ${r}%`}},j3={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=bn.parse(e);if(s.length>5)return r;const i=bn.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ce(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}};class E3 extends Gs.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;L2(T3),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Bi.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||oe.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function bg(e){const[t,n]=P3(),r=k.useContext(g0);return Gs.createElement(E3,{...e,layoutGroup:r,switchLayoutGroup:k.useContext(y0),isPresent:t,safeToRemove:n})}const T3={borderRadius:{...es,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:es,borderTopRightRadius:es,borderBottomLeftRadius:es,borderBottomRightRadius:es,boxShadow:j3},Sg=["TopLeft","TopRight","BottomLeft","BottomRight"],N3=Sg.length,Df=e=>typeof e=="string"?parseFloat(e):e,Rf=e=>typeof e=="number"||B.test(e);function M3(e,t,n,r,s,i){s?(e.opacity=ce(0,n.opacity!==void 0?n.opacity:1,_3(r)),e.opacityExit=ce(t.opacity!==void 0?t.opacity:1,0,A3(r))):i&&(e.opacity=ce(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;ort?1:n(Ws(e,t,r))}function Ff(e,t){e.min=t.min,e.max=t.max}function rt(e,t){Ff(e.x,t.x),Ff(e.y,t.y)}function If(e,t,n,r,s){return e-=t,e=ko(e,1/n,r),s!==void 0&&(e=ko(e,1/s,r)),e}function L3(e,t=0,n=1,r=.5,s,i=e,o=e){if(Tt.test(t)&&(t=parseFloat(t),t=ce(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ce(i.min,i.max,r);e===i&&(a-=t),e.min=If(e.min,t,n,a,s),e.max=If(e.max,t,n,a,s)}function zf(e,t,[n,r,s],i,o){L3(e,t[n],t[r],t[s],t.scale,i,o)}const D3=["x","scaleX","originX"],R3=["y","scaleY","originY"];function Of(e,t,n,r){zf(e.x,t,D3,n?n.x:void 0,r?r.x:void 0),zf(e.y,t,R3,n?n.y:void 0,r?r.y:void 0)}function $f(e){return e.translate===0&&e.scale===1}function Cg(e){return $f(e.x)&&$f(e.y)}function V3(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function Pg(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function Bf(e){return Je(e.x)/Je(e.y)}class F3{constructor(){this.members=[]}add(t){Tc(this.members,t),t.scheduleRender()}remove(t){if(Nc(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Uf(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y;if((s||i)&&(r=`translate3d(${s}px, ${i}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:c,rotateY:d}=n;l&&(r+=`rotate(${l}deg) `),c&&(r+=`rotateX(${c}deg) `),d&&(r+=`rotateY(${d}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(r+=`scale(${o}, ${a})`),r||"none"}const I3=(e,t)=>e.depth-t.depth;class z3{constructor(){this.children=[],this.isDirty=!1}add(t){Tc(this.children,t),this.isDirty=!0}remove(t){Nc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(I3),this.isDirty=!1,this.children.forEach(t)}}function O3(e,t){const n=performance.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ht(r),e(i-t))};return oe.read(r,!0),()=>Ht(r)}function $3(e){window.MotionDebug&&window.MotionDebug.record(e)}function B3(e){return e instanceof SVGElement&&e.tagName!=="svg"}function U3(e,t,n){const r=Ge(e)?e:Lr(e);return r.start(Ec("",r,t,n)),r.animation}const Wf=["","X","Y","Z"],W3={visibility:"hidden"},Hf=1e3;let H3=0;const Rn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function jg({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=H3++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Rn.totalNodes=Rn.resolvedTargetDeltas=Rn.recalculatedProjection=0,this.nodes.forEach(Y3),this.nodes.forEach(J3),this.nodes.forEach(e4),this.nodes.forEach(K3),$3(Rn)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=O3(u,250),Bi.hasAnimatedSinceResize&&(Bi.hasAnimatedSinceResize=!1,this.nodes.forEach(Gf))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:u,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||d.getDefaultTransition()||i4,{onLayoutAnimationStart:x,onLayoutAnimationComplete:v}=d.getProps(),y=!this.targetLayout||!Pg(this.targetLayout,p)||h,w=!u&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||u&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const b={...jc(g,"layout"),onPlay:x,onComplete:v};(d.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else u||Gf(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ht(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(t4),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;dthis.update()))}clearAllSnapshots(){this.nodes.forEach(X3),this.sharedNodes.forEach(n4)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,oe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){oe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const S=b/1e3;Yf(f.x,o.x,S),Yf(f.y,o.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ws(u,this.layout.layoutBox,this.relativeParent.layout.layoutBox),r4(this.relativeTarget,this.relativeTargetOrigin,u,S),w&&V3(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=xe()),rt(w,this.relativeTarget)),g&&(this.animationValues=d,M3(d,c,this.latestValues,S,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ht(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=oe.update(()=>{Bi.hasAnimatedSinceResize=!0,this.currentAnimation=U3(0,Hf,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Hf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Eg(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||xe();const f=Je(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const u=Je(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+u}rt(a,l),yr(a,d),xs(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new F3),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let d=0;d{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(qf),this.root.sharedNodes.clear()}}}function q3(e){e.updateLayout()}function G3(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?st(f=>{const u=o?n.measuredBox[f]:n.layoutBox[f],h=Je(u);u.min=r[f].min,u.max=u.min+h}):Eg(i,n.layoutBox,r)&&st(f=>{const u=o?n.measuredBox[f]:n.layoutBox[f],h=Je(r[f]);u.max=u.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const a=gr();xs(a,r,n.layoutBox);const l=gr();o?xs(l,e.applyTransform(s,!0),n.measuredBox):xs(l,r,n.layoutBox);const c=!Cg(a);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:u,layout:h}=f;if(u&&h){const p=xe();ws(p,n.layoutBox,u.layoutBox);const g=xe();ws(g,r,h.layoutBox),Pg(p,g)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=p,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Y3(e){Rn.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function K3(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function X3(e){e.clearSnapshot()}function qf(e){e.clearMeasurements()}function Q3(e){e.isLayoutDirty=!1}function Z3(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Gf(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function J3(e){e.resolveTargetDelta()}function e4(e){e.calcProjection()}function t4(e){e.resetRotation()}function n4(e){e.removeLeadSnapshot()}function Yf(e,t,n){e.translate=ce(t.translate,0,n),e.scale=ce(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Kf(e,t,n,r){e.min=ce(t.min,n.min,r),e.max=ce(t.max,n.max,r)}function r4(e,t,n,r){Kf(e.x,t.x,n.x,r),Kf(e.y,t.y,n.y,r)}function s4(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const i4={duration:.45,ease:[.4,0,.1,1]},Xf=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),Qf=Xf("applewebkit/")&&!Xf("chrome/")?Math.round:ye;function Zf(e){e.min=Qf(e.min),e.max=Qf(e.max)}function o4(e){Zf(e.x),Zf(e.y)}function Eg(e,t,n){return e==="position"||e==="preserve-aspect"&&!tu(Bf(t),Bf(n),.2)}const a4=jg({attachResizeListener:(e,t)=>Vt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),$a={current:void 0},Tg=jg({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!$a.current){const e=new a4({});e.mount(window),e.setOptions({layoutScroll:!0}),$a.current=e}return $a.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),l4={pan:{Feature:C3},drag:{Feature:k3,ProjectionNode:Tg,MeasureLayout:bg}},u4=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function c4(e){const t=u4.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function iu(e,t,n=1){const[r,s]=c4(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return cg(o)?parseFloat(o):o}else return Yl(s)?iu(s,t,n+1):s}function d4(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(s=>{const i=s.get();if(!Yl(i))return;const o=iu(i,r);o&&s.set(o)});for(const s in t){const i=t[s];if(!Yl(i))continue;const o=iu(i,r);o&&(t[s]=o,n||(n={}),n[s]===void 0&&(n[s]=i))}return{target:t,transitionEnd:n}}const f4=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ng=e=>f4.has(e),h4=e=>Object.keys(e).some(Ng),Jf=e=>e===Zn||e===B,eh=(e,t)=>parseFloat(e.split(", ")[t]),th=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/);if(s)return eh(s[1],t);{const i=r.match(/^matrix\((.+)\)$/);return i?eh(i[1],e):0}},p4=new Set(["x","y","z"]),m4=Js.filter(e=>!p4.has(e));function g4(e){const t=[];return m4.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const Dr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:th(4,13),y:th(5,14)};Dr.translateX=Dr.x;Dr.translateY=Dr.y;const y4=(e,t,n)=>{const r=t.measureViewportBox(),s=t.current,i=getComputedStyle(s),{display:o}=i,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(c=>{a[c]=Dr[c](r,i)}),t.render();const l=t.measureViewportBox();return n.forEach(c=>{const d=t.getValue(c);d&&d.jump(a[c]),e[c]=Dr[c](l,i)}),e},v4=(e,t,n={},r={})=>{t={...t},r={...r};const s=Object.keys(t).filter(Ng);let i=[],o=!1;const a=[];if(s.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let d=n[l],f=Jr(d);const u=t[l];let h;if(vo(u)){const p=u.length,g=u[0]===null?1:0;d=u[g],f=Jr(d);for(let x=g;x=0?window.pageYOffset:null,c=y4(t,e,a);return i.length&&i.forEach(([d,f])=>{e.getValue(d).set(f)}),e.render(),Yo&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:r}}else return{target:t,transitionEnd:r}};function x4(e,t,n,r){return h4(t)?v4(e,t,n,r):{target:t,transitionEnd:r}}const w4=(e,t,n,r)=>{const s=d4(e,t,r);return t=s.target,r=s.transitionEnd,x4(e,t,n,r)},ou={current:null},Mg={current:!1};function b4(){if(Mg.current=!0,!!Yo)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ou.current=e.matches;e.addListener(t),t()}else ou.current=!1}function S4(e,t,n){const{willChange:r}=t;for(const s in t){const i=t[s],o=n[s];if(Ge(i))e.addValue(s,i),So(r)&&r.add(s);else if(Ge(o))e.addValue(s,Lr(i,{owner:e})),So(r)&&r.remove(s);else if(o!==i)if(e.hasValue(s)){const a=e.getValue(s);!a.hasAnimated&&a.set(i)}else{const a=e.getStaticValue(s);e.addValue(s,Lr(a!==void 0?a:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const nh=new WeakMap,_g=Object.keys(Us),k4=_g.length,rh=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],C4=hc.length;class P4{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>oe.render(this.render,!1,!0);const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=Xo(n),this.isVariantNode=m0(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(n,{});for(const f in d){const u=d[f];a[f]!==void 0&&Ge(u)&&(u.set(a[f],!1),So(c)&&c.add(f))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,nh.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Mg.current||b4(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ou.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){nh.delete(this.current),this.projection&&this.projection.unmount(),Ht(this.notifyUpdate),Ht(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=Qn.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&oe.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,s,i){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:i,layoutScroll:u,layoutRoot:h})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):xe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Lr(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,s=typeof r=="string"||typeof r=="object"?(n=wc(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Ge(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Mc),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Ag extends P4{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:s},i){let o=B5(r,t||{},this);if(s&&(n&&(n=s(n)),r&&(r=s(r)),o&&(o=s(o))),i){O5(this,r,o);const a=w4(this,r,o,n);n=a.transitionEnd,r=a.target}return{transition:t,transitionEnd:n,...r}}}function j4(e){return window.getComputedStyle(e)}class E4 extends Ag{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,n){if(Qn.has(n)){const r=Pc(n);return r&&r.default||0}else{const r=j4(t),s=(w0(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return xg(t,n)}build(t,n,r,s){mc(t,n,r,s.transformTemplate)}scrapeMotionValuesFromProps(t,n){return xc(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ge(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,s){j0(t,n,r,s)}}class T4 extends Ag{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Qn.has(n)){const r=Pc(n);return r&&r.default||0}return n=E0.has(n)?n:dc(n),t.getAttribute(n)}measureInstanceViewportBox(){return xe()}scrapeMotionValuesFromProps(t,n){return N0(t,n)}build(t,n,r,s){yc(t,n,r,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,r,s){T0(t,n,r,s)}mount(t){this.isSVGTag=vc(t.tagName),super.mount(t)}}const N4=(e,t)=>pc(e)?new T4(t,{enableHardwareAcceleration:!1}):new E4(t,{enableHardwareAcceleration:!0}),M4={layout:{ProjectionNode:Tg,MeasureLayout:bg}},_4={...r3,...kw,...l4,...M4},O=_2((e,t)=>cw(e,t,_4,N4)),A4={},sh=e=>{let t;const n=new Set,r=(d,f)=>{const u=typeof d=="function"?d(t):d;if(!Object.is(u,t)){const h=t;t=f??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(p=>p(t,h))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(A4?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,s,l);return l},L4=e=>e?sh(e):sh;var Lg={exports:{}},Dg={},Rg={exports:{}},Vg={};/** * @license React * use-sync-external-store-shim.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 Rr=k;function D4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var R4=typeof Object.is=="function"?Object.is:D4,V4=Rr.useState,F4=Rr.useEffect,I4=Rr.useLayoutEffect,z4=Rr.useDebugValue;function O4(e,t){var n=t(),r=V4({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return I4(function(){s.value=n,s.getSnapshot=t,Ba(s)&&i({inst:s})},[e,n,t]),F4(function(){return Ba(s)&&i({inst:s}),e(function(){Ba(s)&&i({inst:s})})},[e]),z4(n),n}function Ba(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!R4(e,n)}catch{return!0}}function $4(e,t){return t()}var B4=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$4:O4;Vg.useSyncExternalStore=Rr.useSyncExternalStore!==void 0?Rr.useSyncExternalStore:B4;Rg.exports=Vg;var U4=Rg.exports;/** * @license React * use-sync-external-store-shim/with-selector.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 ea=k,W4=U4;function H4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var q4=typeof Object.is=="function"?Object.is:H4,G4=W4.useSyncExternalStore,Y4=ea.useRef,K4=ea.useEffect,X4=ea.useMemo,Q4=ea.useDebugValue;Dg.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=Y4(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=X4(function(){function l(h){if(!c){if(c=!0,d=h,h=r(h),s!==void 0&&o.hasValue){var p=o.value;if(s(p,h))return f=p}return f=h}if(p=f,q4(d,h))return p;var g=r(h);return s!==void 0&&s(p,g)?(d=h,p):(d=h,f=g)}var c=!1,d,f,u=n===void 0?null:n;return[function(){return l(t())},u===null?void 0:function(){return l(u())}]},[t,n,r,s]);var a=G4(e,i[0],i[1]);return K4(function(){o.hasValue=!0,o.value=a},[a]),Q4(a),a};Lg.exports=Dg;var Z4=Lg.exports;const J4=cu(Z4),Fg={},{useDebugValue:eb}=Gs,{useSyncExternalStoreWithSelector:tb}=J4;let ih=!1;const nb=e=>e;function rb(e,t=nb,n){(Fg?"production":void 0)!=="production"&&n&&!ih&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),ih=!0);const r=tb(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return eb(r),r}const sb=e=>{(Fg?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?L4(e):e,n=(r,s)=>rb(t,r,s);return Object.assign(n,t),n},ib=e=>sb,ob={};function ab(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var i;const o=l=>l===null?null:JSON.parse(l,void 0),a=(i=n.getItem(s))!=null?i:null;return a instanceof Promise?a.then(o):o(a)},setItem:(s,i)=>n.setItem(s,JSON.stringify(i,void 0)),removeItem:s=>n.removeItem(s)}}const Hs=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Hs(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Hs(r)(n)}}}},lb=(e,t)=>(n,r,s)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:x=>x,version:0,merge:(x,v)=>({...v,...x}),...t},o=!1;const a=new Set,l=new Set;let c;try{c=i.getStorage()}catch{}if(!c)return e((...x)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...x)},r,s);const d=Hs(i.serialize),f=()=>{const x=i.partialize({...r()});let v;const y=d({state:x,version:i.version}).then(w=>c.setItem(i.name,w)).catch(w=>{v=w});if(v)throw v;return y},u=s.setState;s.setState=(x,v)=>{u(x,v),f()};const h=e((...x)=>{n(...x),f()},r,s);let p;const g=()=>{var x;if(!c)return;o=!1,a.forEach(y=>y(r()));const v=((x=i.onRehydrateStorage)==null?void 0:x.call(i,r()))||void 0;return Hs(c.getItem.bind(c))(i.name).then(y=>{if(y)return i.deserialize(y)}).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==i.version){if(i.migrate)return i.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var w;return p=i.merge(y,(w=r())!=null?w:h),n(p,!0),f()}).then(()=>{v==null||v(p,void 0),o=!0,l.forEach(y=>y(p))}).catch(y=>{v==null||v(void 0,y)})};return s.persist={setOptions:x=>{i={...i,...x},x.getStorage&&(c=x.getStorage())},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>o,onHydrate:x=>(a.add(x),()=>{a.delete(x)}),onFinishHydration:x=>(l.add(x),()=>{l.delete(x)})},g(),p||h},ub=(e,t)=>(n,r,s)=>{let i={storage:ab(()=>localStorage),partialize:g=>g,version:0,merge:(g,x)=>({...x,...g}),...t},o=!1;const a=new Set,l=new Set;let c=i.storage;if(!c)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...g)},r,s);const d=()=>{const g=i.partialize({...r()});return c.setItem(i.name,{state:g,version:i.version})},f=s.setState;s.setState=(g,x)=>{f(g,x),d()};const u=e((...g)=>{n(...g),d()},r,s);s.getInitialState=()=>u;let h;const p=()=>{var g,x;if(!c)return;o=!1,a.forEach(y=>{var w;return y((w=r())!=null?w:u)});const v=((x=i.onRehydrateStorage)==null?void 0:x.call(i,(g=r())!=null?g:u))||void 0;return Hs(c.getItem.bind(c))(i.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==i.version){if(i.migrate)return[!0,i.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var w;const[b,S]=y;if(h=i.merge(S,(w=r())!=null?w:u),n(h,!0),b)return d()}).then(()=>{v==null||v(h,void 0),h=r(),o=!0,l.forEach(y=>y(h))}).catch(y=>{v==null||v(void 0,y)})};return s.persist={setOptions:g=>{i={...i,...g},g.storage&&(c=g.storage)},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},i.skipHydration||p(),h||u},cb=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((ob?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),lb(e,t)):ub(e,t),db=cb,oh={currentUser:null,partnerUser:null,isLoading:!1,error:null,currentTrack:null,isPlaying:!1},ae=ib()(db(e=>({...oh,mixedPlaylists:[],memoryLane:[],theme:"green",setCurrentUser:t=>e({currentUser:t}),setPartnerUser:t=>e({partnerUser:t}),logout:()=>e({currentUser:null,partnerUser:null,currentTrack:null,isPlaying:!1,mixedPlaylists:[],memoryLane:[],error:null}),setLoading:t=>e({isLoading:t}),setError:t=>e({error:t}),setCurrentTrack:t=>e({currentTrack:t}),setIsPlaying:t=>e({isPlaying:t}),addMixedPlaylist:t=>e(n=>({mixedPlaylists:[...n.mixedPlaylists,t]})),removeMixedPlaylist:t=>e(n=>({mixedPlaylists:n.mixedPlaylists.filter(r=>r.id!==t)})),setMixedPlaylists:t=>e({mixedPlaylists:t}),addMemoryLaneItem:t=>e(n=>({memoryLane:[...n.memoryLane,t].sort((r,s)=>new Date(s.date).getTime()-new Date(r.date).getTime())})),removeMemoryLaneItem:t=>e(n=>({memoryLane:n.memoryLane.filter(r=>r.id!==t)})),setTheme:t=>e({theme:t}),clearAllData:()=>e({...oh,mixedPlaylists:[],memoryLane:[]})}),{name:"spotify-app-settings",partialize:e=>({theme:e.theme})}));function fb(){{const e="/api";try{const t=typeof window<"u"&&window.location.protocol==="https:",n=new URL(e,window.location.origin);if(t&&n.protocol==="http:"&&n.hostname==="159.195.9.107"&&(n.port==="8081"||n.port===""))return"https://159.195.9.107:3443"}catch{}return e}}const Br=fb();function qt(){try{const e=localStorage.getItem("spotify-user");if(!e)return null;const t=JSON.parse(e);return(t==null?void 0:t.jwt)||(t==null?void 0:t.token)||null}catch{return null}}async function Pt(e,t,n){const r=await fetch(`${Br}${e}`,{method:"POST",headers:{"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:qt()?{Authorization:`Bearer ${qt()}`}:{}},body:t?JSON.stringify(t):void 0});if(!r.ok){const s=await r.text();throw new Error(s||`Request failed: ${r.status}`)}return r.json()}async function se(e,t){const n=await fetch(`${Br}${e}`,{headers:{...t?{Authorization:`Bearer ${t}`}:qt()?{Authorization:`Bearer ${qt()}`}:{}}});if(!n.ok){const r=await n.text();throw new Error(r||`Request failed: ${n.status}`)}return n.json()}function hb(e){const t=qt(),n=new URL(`${Br}${e}`,window.location.origin);return t&&n.searchParams.set("token",t),new EventSource(n.toString())}async function pb(e,t,n){const r=await fetch(`${Br}${e}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",...qt()?{Authorization:`Bearer ${qt()}`}:{}},body:new URLSearchParams(t).toString()});if(!r.ok){const s=await r.text();throw new Error(s||`Request failed: ${r.status}`)}return r.json()}async function mb(e,t){const n=await fetch(`${Br}${e}`,{method:"DELETE",headers:{...t?{Authorization:`Bearer ${t}`}:qt()?{Authorization:`Bearer ${qt()}`}:{}}});if(!n.ok){const r=await n.text();throw new Error(r||`Request failed: ${n.status}`)}return n.json()}const Vr=e=>{const t={green:{primary:"bg-theme-green-primary text-white",secondary:"bg-theme-green-secondary text-white",accent:"bg-theme-green-accent text-white",border:"border-theme-green-primary",text:"text-theme-green-primary",gradient:"from-theme-green-primary to-theme-green-secondary",glass:"bg-theme-green-primary/10 border-theme-green-primary/30",hover:"hover:bg-theme-green-primary/20",cssVars:{primary:"#1db954",secondary:"#1ed760",accent:"#00e676"}},pink:{primary:"bg-theme-pink-primary text-white",secondary:"bg-theme-pink-secondary text-white",accent:"bg-theme-pink-accent text-white",border:"border-theme-pink-primary",text:"text-theme-pink-primary",gradient:"from-theme-pink-primary to-theme-pink-secondary",glass:"bg-theme-pink-primary/10 border-theme-pink-primary/30",hover:"hover:bg-theme-pink-primary/20",cssVars:{primary:"#ec4899",secondary:"#f472b6",accent:"#fb7185"}},blue:{primary:"bg-theme-blue-primary text-white",secondary:"bg-theme-blue-secondary text-white",accent:"bg-theme-blue-accent text-white",border:"border-theme-blue-primary",text:"text-theme-blue-primary",gradient:"from-theme-blue-primary to-theme-blue-secondary",glass:"bg-theme-blue-primary/10 border-theme-blue-primary/30",hover:"hover:bg-theme-blue-primary/20",cssVars:{primary:"#3b82f6",secondary:"#60a5fa",accent:"#93c5fd"}},red:{primary:"bg-theme-red-primary text-white",secondary:"bg-theme-red-secondary text-white",accent:"bg-theme-red-accent text-white",border:"border-theme-red-primary",text:"text-theme-red-primary",gradient:"from-theme-red-primary to-theme-red-secondary",glass:"bg-theme-red-primary/10 border-theme-red-primary/30",hover:"hover:bg-theme-red-primary/20",cssVars:{primary:"#dc2626",secondary:"#ef4444",accent:"#f87171"}},purple:{primary:"bg-theme-purple-primary text-white",secondary:"bg-theme-purple-secondary text-white",accent:"bg-theme-purple-accent text-white",border:"border-theme-purple-primary",text:"text-theme-purple-primary",gradient:"from-theme-purple-primary to-theme-purple-secondary",glass:"bg-theme-purple-primary/10 border-theme-purple-primary/30",hover:"hover:bg-theme-purple-primary/20",cssVars:{primary:"#8b5cf6",secondary:"#a78bfa",accent:"#c4b5fd"}},yellow:{primary:"bg-theme-yellow-primary text-black",secondary:"bg-theme-yellow-secondary text-black",accent:"bg-theme-yellow-accent text-black",border:"border-theme-yellow-primary",text:"text-theme-yellow-primary",gradient:"from-theme-yellow-primary to-theme-yellow-secondary",glass:"bg-theme-yellow-primary/10 border-theme-yellow-primary/30",hover:"hover:bg-theme-yellow-primary/20",cssVars:{primary:"#eab308",secondary:"#f59e0b",accent:"#fbbf24"}},turquoise:{primary:"bg-theme-turquoise-primary text-white",secondary:"bg-theme-turquoise-secondary text-white",accent:"bg-theme-turquoise-accent text-white",border:"border-theme-turquoise-primary",text:"text-theme-turquoise-primary",gradient:"from-theme-turquoise-primary to-theme-turquoise-secondary",glass:"bg-theme-turquoise-primary/10 border-theme-turquoise-primary/30",hover:"hover:bg-theme-turquoise-primary/20",cssVars:{primary:"#06b6d4",secondary:"#22d3ee",accent:"#67e8f9"}}},n=t[e]||t.green;if(typeof document<"u"){const r=document.documentElement;r.style.setProperty("--theme-primary",n.cssVars.primary),r.style.setProperty("--theme-secondary",n.cssVars.secondary),r.style.setProperty("--theme-accent",n.cssVars.accent)}return n},ah=e=>({green:120,pink:300,blue:360,red:245,purple:280,yellow:200,turquoise:40})[e]||120;function bs(e){let t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)}function au(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function gb(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function lh(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function uh(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function yb(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function vb(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function Ua(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function xb(e,t){let n=t[0]-e[0],r=t[1]-e[1],s=t[2]-e[2];return Math.sqrt(n*n+r*r+s*s)}function wb(e,t){let n=t[0]-e[0],r=t[1]-e[1],s=t[2]-e[2];return n*n+r*r+s*s}function ch(e){let t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r}function bb(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function Sb(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function lu(e,t){let n=t[0],r=t[1],s=t[2],i=n*n+r*r+s*s;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function Ig(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function dh(e,t,n){let r=t[0],s=t[1],i=t[2],o=n[0],a=n[1],l=n[2];return e[0]=s*l-i*a,e[1]=i*o-r*l,e[2]=r*a-s*o,e}function kb(e,t,n,r){let s=t[0],i=t[1],o=t[2];return e[0]=s+r*(n[0]-s),e[1]=i+r*(n[1]-i),e[2]=o+r*(n[2]-o),e}function Cb(e,t,n,r,s){const i=Math.exp(-r*s);let o=t[0],a=t[1],l=t[2];return e[0]=n[0]+(o-n[0])*i,e[1]=n[1]+(a-n[1])*i,e[2]=n[2]+(l-n[2])*i,e}function Pb(e,t,n){let r=t[0],s=t[1],i=t[2],o=n[3]*r+n[7]*s+n[11]*i+n[15];return o=o||1,e[0]=(n[0]*r+n[4]*s+n[8]*i+n[12])/o,e[1]=(n[1]*r+n[5]*s+n[9]*i+n[13])/o,e[2]=(n[2]*r+n[6]*s+n[10]*i+n[14])/o,e}function jb(e,t,n){let r=t[0],s=t[1],i=t[2],o=n[3]*r+n[7]*s+n[11]*i+n[15];return o=o||1,e[0]=(n[0]*r+n[4]*s+n[8]*i)/o,e[1]=(n[1]*r+n[5]*s+n[9]*i)/o,e[2]=(n[2]*r+n[6]*s+n[10]*i)/o,e}function Eb(e,t,n){let r=t[0],s=t[1],i=t[2];return e[0]=r*n[0]+s*n[3]+i*n[6],e[1]=r*n[1]+s*n[4]+i*n[7],e[2]=r*n[2]+s*n[5]+i*n[8],e}function Tb(e,t,n){let r=t[0],s=t[1],i=t[2],o=n[0],a=n[1],l=n[2],c=n[3],d=a*i-l*s,f=l*r-o*i,u=o*s-a*r,h=a*u-l*f,p=l*d-o*u,g=o*f-a*d,x=c*2;return d*=x,f*=x,u*=x,h*=2,p*=2,g*=2,e[0]=r+d+h,e[1]=s+f+p,e[2]=i+u+g,e}const Nb=function(){const e=[0,0,0],t=[0,0,0];return function(n,r){au(e,n),au(t,r),lu(e,e),lu(t,t);let s=Ig(e,t);return s>1?0:s<-1?Math.PI:Math.acos(s)}}();function Mb(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}class mt extends Array{constructor(t=0,n=t,r=t){return super(t,n,r),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}set(t,n=t,r=t){return t.length?this.copy(t):(gb(this,t,n,r),this)}copy(t){return au(this,t),this}add(t,n){return n?lh(this,t,n):lh(this,this,t),this}sub(t,n){return n?uh(this,t,n):uh(this,this,t),this}multiply(t){return t.length?yb(this,this,t):Ua(this,this,t),this}divide(t){return t.length?vb(this,this,t):Ua(this,this,1/t),this}inverse(t=this){return Sb(this,t),this}len(){return bs(this)}distance(t){return t?xb(this,t):bs(this)}squaredLen(){return ch(this)}squaredDistance(t){return t?wb(this,t):ch(this)}negate(t=this){return bb(this,t),this}cross(t,n){return n?dh(this,t,n):dh(this,this,t),this}scale(t){return Ua(this,this,t),this}normalize(){return lu(this,this),this}dot(t){return Ig(this,t)}equals(t){return Mb(this,t)}applyMatrix3(t){return Eb(this,this,t),this}applyMatrix4(t){return Pb(this,this,t),this}scaleRotateMatrix4(t){return jb(this,this,t),this}applyQuaternion(t){return Tb(this,this,t),this}angle(t){return Nb(this,t)}lerp(t,n){return kb(this,this,t,n),this}smoothLerp(t,n,r){return Cb(this,this,t,n,r),this}clone(){return new mt(this[0],this[1],this[2])}fromArray(t,n=0){return this[0]=t[n],this[1]=t[n+1],this[2]=t[n+2],this}toArray(t=[],n=0){return t[n]=this[0],t[n+1]=this[1],t[n+2]=this[2],t}transformDirection(t){const n=this[0],r=this[1],s=this[2];return this[0]=t[0]*n+t[4]*r+t[8]*s,this[1]=t[1]*n+t[5]*r+t[9]*s,this[2]=t[2]*n+t[6]*r+t[10]*s,this.normalize()}}const fh=new mt;let _b=1,Ab=1,hh=!1;class Lb{constructor(t,n={}){t.canvas||console.error("gl not passed as first argument to Geometry"),this.gl=t,this.attributes=n,this.id=_b++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let r in n)this.addAttribute(r,n[r])}addAttribute(t,n){if(this.attributes[t]=n,n.id=Ab++,n.size=n.size||1,n.type=n.type||(n.data.constructor===Float32Array?this.gl.FLOAT:n.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),n.target=t==="index"?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,n.normalized=n.normalized||!1,n.stride=n.stride||0,n.offset=n.offset||0,n.count=n.count||(n.stride?n.data.byteLength/n.stride:n.data.length/n.size),n.divisor=n.instanced||0,n.needsUpdate=!1,n.usage=n.usage||this.gl.STATIC_DRAW,n.buffer||this.updateAttribute(n),n.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==n.count*n.divisor)return console.warn("geometry has multiple instanced buffers of different length"),this.instancedCount=Math.min(this.instancedCount,n.count*n.divisor);this.instancedCount=n.count*n.divisor}else t==="index"?this.drawRange.count=n.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,n.count))}updateAttribute(t){const n=!t.buffer;n&&(t.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==t.buffer&&(this.gl.bindBuffer(t.target,t.buffer),this.glState.boundBuffer=t.buffer),n?this.gl.bufferData(t.target,t.data,t.usage):this.gl.bufferSubData(t.target,0,t.data),t.needsUpdate=!1}setIndex(t){this.addAttribute("index",t)}setDrawRange(t,n){this.drawRange.start=t,this.drawRange.count=n}setInstancedCount(t){this.instancedCount=t}createVAO(t){this.VAOs[t.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.bindAttributes(t)}bindAttributes(t){t.attributeLocations.forEach((n,{name:r,type:s})=>{if(!this.attributes[r]){console.warn(`active attribute ${r} not being supplied`);return}const i=this.attributes[r];this.gl.bindBuffer(i.target,i.buffer),this.glState.boundBuffer=i.buffer;let o=1;s===35674&&(o=2),s===35675&&(o=3),s===35676&&(o=4);const a=i.size/o,l=o===1?0:o*o*4,c=o===1?0:o*4;for(let d=0;d{const a=this.attributes[o];a.needsUpdate&&this.updateAttribute(a)});let r=2;((s=this.attributes.index)==null?void 0:s.type)===this.gl.UNSIGNED_INT&&(r=4),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(n,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*r,this.instancedCount):this.gl.renderer.drawArraysInstanced(n,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(n,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*r):this.gl.drawArrays(n,this.drawRange.start,this.drawRange.count)}getPosition(){const t=this.attributes.position;if(t.data)return t;if(!hh)return console.warn("No position buffer data found to compute bounds"),hh=!0}computeBoundingBox(t){t||(t=this.getPosition());const n=t.data,r=t.size;this.bounds||(this.bounds={min:new mt,max:new mt,center:new mt,scale:new mt,radius:1/0});const s=this.bounds.min,i=this.bounds.max,o=this.bounds.center,a=this.bounds.scale;s.set(1/0),i.set(-1/0);for(let l=0,c=n.length;l{let o=this.uniforms[i.uniformName];for(const a of i.nameComponents){if(!o)break;if(a in o)o=o[a];else{if(Array.isArray(o.value))break;o=void 0;break}}if(!o)return gh(`Active uniform ${i.name} has not been supplied`);if(o&&o.value===void 0)return gh(`${i.name} uniform is missing a value parameter`);if(o.value.texture)return n=n+1,o.value.update(n),Wa(this.gl,i.type,s,n);if(o.value.length&&o.value[0].texture){const a=[];return o.value.forEach(l=>{n=n+1,l.update(n),a.push(n)}),Wa(this.gl,i.type,s,a)}Wa(this.gl,i.type,s,o.value)}),this.applyState(),t&&this.gl.renderer.setFrontFace(this.frontFace===this.gl.CCW?this.gl.CW:this.gl.CCW)}remove(){this.gl.deleteProgram(this.program)}}function Wa(e,t,n,r){r=r.length?Vb(r):r;const s=e.renderer.state.uniformLocations.get(n);if(r.length)if(s===void 0||s.length!==r.length)e.renderer.state.uniformLocations.set(n,r.slice(0));else{if(Fb(s,r))return;s.set?s.set(r):Ib(s,r),e.renderer.state.uniformLocations.set(n,s)}else{if(s===r)return;e.renderer.state.uniformLocations.set(n,r)}switch(t){case 5126:return r.length?e.uniform1fv(n,r):e.uniform1f(n,r);case 35664:return e.uniform2fv(n,r);case 35665:return e.uniform3fv(n,r);case 35666:return e.uniform4fv(n,r);case 35670:case 5124:case 35678:case 36306:case 35680:case 36289:return r.length?e.uniform1iv(n,r):e.uniform1i(n,r);case 35671:case 35667:return e.uniform2iv(n,r);case 35672:case 35668:return e.uniform3iv(n,r);case 35673:case 35669:return e.uniform4iv(n,r);case 35674:return e.uniformMatrix2fv(n,!1,r);case 35675:return e.uniformMatrix3fv(n,!1,r);case 35676:return e.uniformMatrix4fv(n,!1,r)}}function mh(e){let t=e.split(` `);for(let n=0;n100||(console.warn(e),Ha++,Ha>100&&console.warn("More than 100 program warnings - stopping logs."))}const qa=new mt;let zb=1;class Ob{constructor({canvas:t=document.createElement("canvas"),width:n=300,height:r=150,dpr:s=1,alpha:i=!1,depth:o=!0,stencil:a=!1,antialias:l=!1,premultipliedAlpha:c=!1,preserveDrawingBuffer:d=!1,powerPreference:f="default",autoClear:u=!0,webgl:h=2}={}){const p={alpha:i,depth:o,stencil:a,antialias:l,premultipliedAlpha:c,preserveDrawingBuffer:d,powerPreference:f};this.dpr=s,this.alpha=i,this.color=!0,this.depth=o,this.stencil=a,this.premultipliedAlpha=c,this.autoClear=u,this.id=zb++,h===2&&(this.gl=t.getContext("webgl2",p)),this.isWebgl2=!!this.gl,this.gl||(this.gl=t.getContext("webgl",p)),this.gl||console.error("unable to create webgl context"),this.gl.renderer=this,this.setSize(n,r),this.state={},this.state.blendFunc={src:this.gl.ONE,dst:this.gl.ZERO},this.state.blendEquation={modeRGB:this.gl.FUNC_ADD},this.state.cullFace=!1,this.state.frontFace=this.gl.CCW,this.state.depthMask=!0,this.state.depthFunc=this.gl.LEQUAL,this.state.premultiplyAlpha=!1,this.state.flipY=!1,this.state.unpackAlignment=4,this.state.framebuffer=null,this.state.viewport={x:0,y:0,width:null,height:null},this.state.textureUnits=[],this.state.activeTextureUnit=0,this.state.boundBuffer=null,this.state.uniformLocations=new Map,this.state.currentProgram=null,this.extensions={},this.isWebgl2?(this.getExtension("EXT_color_buffer_float"),this.getExtension("OES_texture_float_linear")):(this.getExtension("OES_texture_float"),this.getExtension("OES_texture_float_linear"),this.getExtension("OES_texture_half_float"),this.getExtension("OES_texture_half_float_linear"),this.getExtension("OES_element_index_uint"),this.getExtension("OES_standard_derivatives"),this.getExtension("EXT_sRGB"),this.getExtension("WEBGL_depth_texture"),this.getExtension("WEBGL_draw_buffers")),this.getExtension("WEBGL_compressed_texture_astc"),this.getExtension("EXT_texture_compression_bptc"),this.getExtension("WEBGL_compressed_texture_s3tc"),this.getExtension("WEBGL_compressed_texture_etc1"),this.getExtension("WEBGL_compressed_texture_pvrtc"),this.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this.drawBuffers=this.getExtension("WEBGL_draw_buffers","drawBuffers","drawBuffersWEBGL"),this.parameters={},this.parameters.maxTextureUnits=this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.parameters.maxAnisotropy=this.getExtension("EXT_texture_filter_anisotropic")?this.gl.getParameter(this.getExtension("EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}setSize(t,n){this.width=t,this.height=n,this.gl.canvas.width=t*this.dpr,this.gl.canvas.height=n*this.dpr,this.gl.canvas.style&&Object.assign(this.gl.canvas.style,{width:t+"px",height:n+"px"})}setViewport(t,n,r=0,s=0){this.state.viewport.width===t&&this.state.viewport.height===n||(this.state.viewport.width=t,this.state.viewport.height=n,this.state.viewport.x=r,this.state.viewport.y=s,this.gl.viewport(r,s,t,n))}setScissor(t,n,r=0,s=0){this.gl.scissor(r,s,t,n)}enable(t){this.state[t]!==!0&&(this.gl.enable(t),this.state[t]=!0)}disable(t){this.state[t]!==!1&&(this.gl.disable(t),this.state[t]=!1)}setBlendFunc(t,n,r,s){this.state.blendFunc.src===t&&this.state.blendFunc.dst===n&&this.state.blendFunc.srcAlpha===r&&this.state.blendFunc.dstAlpha===s||(this.state.blendFunc.src=t,this.state.blendFunc.dst=n,this.state.blendFunc.srcAlpha=r,this.state.blendFunc.dstAlpha=s,r!==void 0?this.gl.blendFuncSeparate(t,n,r,s):this.gl.blendFunc(t,n))}setBlendEquation(t,n){t=t||this.gl.FUNC_ADD,!(this.state.blendEquation.modeRGB===t&&this.state.blendEquation.modeAlpha===n)&&(this.state.blendEquation.modeRGB=t,this.state.blendEquation.modeAlpha=n,n!==void 0?this.gl.blendEquationSeparate(t,n):this.gl.blendEquation(t))}setCullFace(t){this.state.cullFace!==t&&(this.state.cullFace=t,this.gl.cullFace(t))}setFrontFace(t){this.state.frontFace!==t&&(this.state.frontFace=t,this.gl.frontFace(t))}setDepthMask(t){this.state.depthMask!==t&&(this.state.depthMask=t,this.gl.depthMask(t))}setDepthFunc(t){this.state.depthFunc!==t&&(this.state.depthFunc=t,this.gl.depthFunc(t))}setStencilMask(t){this.state.stencilMask!==t&&(this.state.stencilMask=t,this.gl.stencilMask(t))}setStencilFunc(t,n,r){this.state.stencilFunc===t&&this.state.stencilRef===n&&this.state.stencilFuncMask===r||(this.state.stencilFunc=t||this.gl.ALWAYS,this.state.stencilRef=n||0,this.state.stencilFuncMask=r||0,this.gl.stencilFunc(t||this.gl.ALWAYS,n||0,r||0))}setStencilOp(t,n,r){this.state.stencilFail===t&&this.state.stencilDepthFail===n&&this.state.stencilDepthPass===r||(this.state.stencilFail=t,this.state.stencilDepthFail=n,this.state.stencilDepthPass=r,this.gl.stencilOp(t,n,r))}activeTexture(t){this.state.activeTextureUnit!==t&&(this.state.activeTextureUnit=t,this.gl.activeTexture(this.gl.TEXTURE0+t))}bindFramebuffer({target:t=this.gl.FRAMEBUFFER,buffer:n=null}={}){this.state.framebuffer!==n&&(this.state.framebuffer=n,this.gl.bindFramebuffer(t,n))}getExtension(t,n,r){return n&&this.gl[n]?this.gl[n].bind(this.gl):(this.extensions[t]||(this.extensions[t]=this.gl.getExtension(t)),n?this.extensions[t]?this.extensions[t][r].bind(this.extensions[t]):null:this.extensions[t])}sortOpaque(t,n){return t.renderOrder!==n.renderOrder?t.renderOrder-n.renderOrder:t.program.id!==n.program.id?t.program.id-n.program.id:t.zDepth!==n.zDepth?t.zDepth-n.zDepth:n.id-t.id}sortTransparent(t,n){return t.renderOrder!==n.renderOrder?t.renderOrder-n.renderOrder:t.zDepth!==n.zDepth?n.zDepth-t.zDepth:n.id-t.id}sortUI(t,n){return t.renderOrder!==n.renderOrder?t.renderOrder-n.renderOrder:t.program.id!==n.program.id?t.program.id-n.program.id:n.id-t.id}getRenderList({scene:t,camera:n,frustumCull:r,sort:s}){let i=[];if(n&&r&&n.updateFrustum(),t.traverse(o=>{if(!o.visible)return!0;o.draw&&(r&&o.frustumCulled&&n&&!n.frustumIntersectsMesh(o)||i.push(o))}),s){const o=[],a=[],l=[];i.forEach(c=>{c.program.transparent?c.program.depthTest?a.push(c):l.push(c):o.push(c),c.zDepth=0,!(c.renderOrder!==0||!c.program.depthTest||!n)&&(c.worldMatrix.getTranslation(qa),qa.applyMatrix4(n.projectionViewMatrix),c.zDepth=qa.z)}),o.sort(this.sortOpaque),a.sort(this.sortTransparent),l.sort(this.sortUI),i=o.concat(a,l)}return i}render({scene:t,camera:n,target:r=null,update:s=!0,sort:i=!0,frustumCull:o=!0,clear:a}){r===null?(this.bindFramebuffer(),this.setViewport(this.width*this.dpr,this.height*this.dpr)):(this.bindFramebuffer(r),this.setViewport(r.width,r.height)),(a||this.autoClear&&a!==!1)&&(this.depth&&(!r||r.depth)&&(this.enable(this.gl.DEPTH_TEST),this.setDepthMask(!0)),(this.stencil||!r||r.stencil)&&(this.enable(this.gl.STENCIL_TEST),this.setStencilMask(255)),this.gl.clear((this.color?this.gl.COLOR_BUFFER_BIT:0)|(this.depth?this.gl.DEPTH_BUFFER_BIT:0)|(this.stencil?this.gl.STENCIL_BUFFER_BIT:0))),s&&t.updateMatrixWorld(),n&&n.updateMatrixWorld(),this.getRenderList({scene:t,camera:n,frustumCull:o,sort:i}).forEach(c=>{c.draw({camera:n})})}}function $b(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function Bb(e,t,n,r,s){return e[0]=t,e[1]=n,e[2]=r,e[3]=s,e}function Ub(e,t){let n=t[0],r=t[1],s=t[2],i=t[3],o=n*n+r*r+s*s+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=r*o,e[2]=s*o,e[3]=i*o,e}function Wb(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Hb(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function qb(e,t,n){n=n*.5;let r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}function yh(e,t,n){let r=t[0],s=t[1],i=t[2],o=t[3],a=n[0],l=n[1],c=n[2],d=n[3];return e[0]=r*d+o*a+s*c-i*l,e[1]=s*d+o*l+i*a-r*c,e[2]=i*d+o*c+r*l-s*a,e[3]=o*d-r*a-s*l-i*c,e}function Gb(e,t,n){n*=.5;let r=t[0],s=t[1],i=t[2],o=t[3],a=Math.sin(n),l=Math.cos(n);return e[0]=r*l+o*a,e[1]=s*l+i*a,e[2]=i*l-s*a,e[3]=o*l-r*a,e}function Yb(e,t,n){n*=.5;let r=t[0],s=t[1],i=t[2],o=t[3],a=Math.sin(n),l=Math.cos(n);return e[0]=r*l-i*a,e[1]=s*l+o*a,e[2]=i*l+r*a,e[3]=o*l-s*a,e}function Kb(e,t,n){n*=.5;let r=t[0],s=t[1],i=t[2],o=t[3],a=Math.sin(n),l=Math.cos(n);return e[0]=r*l+s*a,e[1]=s*l-r*a,e[2]=i*l+o*a,e[3]=o*l-i*a,e}function Xb(e,t,n,r){let s=t[0],i=t[1],o=t[2],a=t[3],l=n[0],c=n[1],d=n[2],f=n[3],u,h,p,g,x;return h=s*l+i*c+o*d+a*f,h<0&&(h=-h,l=-l,c=-c,d=-d,f=-f),1-h>1e-6?(u=Math.acos(h),p=Math.sin(u),g=Math.sin((1-r)*u)/p,x=Math.sin(r*u)/p):(g=1-r,x=r),e[0]=g*s+x*l,e[1]=g*i+x*c,e[2]=g*o+x*d,e[3]=g*a+x*f,e}function Qb(e,t){let n=t[0],r=t[1],s=t[2],i=t[3],o=n*n+r*r+s*s+i*i,a=o?1/o:0;return e[0]=-n*a,e[1]=-r*a,e[2]=-s*a,e[3]=i*a,e}function Zb(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function Jb(e,t){let n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[s*3+s]&&(s=2);let i=(s+1)%3,o=(s+2)%3;r=Math.sqrt(t[s*3+s]-t[i*3+i]-t[o*3+o]+1),e[s]=.5*r,r=.5/r,e[3]=(t[i*3+o]-t[o*3+i])*r,e[i]=(t[i*3+s]+t[s*3+i])*r,e[o]=(t[o*3+s]+t[s*3+o])*r}return e}function eS(e,t,n="YXZ"){let r=Math.sin(t[0]*.5),s=Math.cos(t[0]*.5),i=Math.sin(t[1]*.5),o=Math.cos(t[1]*.5),a=Math.sin(t[2]*.5),l=Math.cos(t[2]*.5);return n==="XYZ"?(e[0]=r*o*l+s*i*a,e[1]=s*i*l-r*o*a,e[2]=s*o*a+r*i*l,e[3]=s*o*l-r*i*a):n==="YXZ"?(e[0]=r*o*l+s*i*a,e[1]=s*i*l-r*o*a,e[2]=s*o*a-r*i*l,e[3]=s*o*l+r*i*a):n==="ZXY"?(e[0]=r*o*l-s*i*a,e[1]=s*i*l+r*o*a,e[2]=s*o*a+r*i*l,e[3]=s*o*l-r*i*a):n==="ZYX"?(e[0]=r*o*l-s*i*a,e[1]=s*i*l+r*o*a,e[2]=s*o*a-r*i*l,e[3]=s*o*l+r*i*a):n==="YZX"?(e[0]=r*o*l+s*i*a,e[1]=s*i*l+r*o*a,e[2]=s*o*a-r*i*l,e[3]=s*o*l-r*i*a):n==="XZY"&&(e[0]=r*o*l-s*i*a,e[1]=s*i*l-r*o*a,e[2]=s*o*a+r*i*l,e[3]=s*o*l+r*i*a),e}const tS=$b,nS=Bb,rS=Wb,sS=Ub;class iS extends Array{constructor(t=0,n=0,r=0,s=1){super(t,n,r,s),this.onChange=()=>{},this._target=this;const i=["0","1","2","3"];return new Proxy(this,{set(o,a){const l=Reflect.set(...arguments);return l&&i.includes(a)&&o.onChange(),l}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set w(t){this._target[3]=t,this.onChange()}identity(){return Hb(this._target),this.onChange(),this}set(t,n,r,s){return t.length?this.copy(t):(nS(this._target,t,n,r,s),this.onChange(),this)}rotateX(t){return Gb(this._target,this._target,t),this.onChange(),this}rotateY(t){return Yb(this._target,this._target,t),this.onChange(),this}rotateZ(t){return Kb(this._target,this._target,t),this.onChange(),this}inverse(t=this._target){return Qb(this._target,t),this.onChange(),this}conjugate(t=this._target){return Zb(this._target,t),this.onChange(),this}copy(t){return tS(this._target,t),this.onChange(),this}normalize(t=this._target){return sS(this._target,t),this.onChange(),this}multiply(t,n){return n?yh(this._target,t,n):yh(this._target,this._target,t),this.onChange(),this}dot(t){return rS(this._target,t)}fromMatrix3(t){return Jb(this._target,t),this.onChange(),this}fromEuler(t,n){return eS(this._target,t,t.order),n||this.onChange(),this}fromAxisAngle(t,n){return qb(this._target,t,n),this.onChange(),this}slerp(t,n){return Xb(this._target,this._target,t,n),this.onChange(),this}fromArray(t,n=0){return this._target[0]=t[n],this._target[1]=t[n+1],this._target[2]=t[n+2],this._target[3]=t[n+3],this.onChange(),this}toArray(t=[],n=0){return t[n]=this[0],t[n+1]=this[1],t[n+2]=this[2],t[n+3]=this[3],t}}const oS=1e-6;function aS(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function lS(e,t,n,r,s,i,o,a,l,c,d,f,u,h,p,g,x){return e[0]=t,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=o,e[6]=a,e[7]=l,e[8]=c,e[9]=d,e[10]=f,e[11]=u,e[12]=h,e[13]=p,e[14]=g,e[15]=x,e}function uS(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function cS(e,t){let n=t[0],r=t[1],s=t[2],i=t[3],o=t[4],a=t[5],l=t[6],c=t[7],d=t[8],f=t[9],u=t[10],h=t[11],p=t[12],g=t[13],x=t[14],v=t[15],y=n*a-r*o,w=n*l-s*o,b=n*c-i*o,S=r*l-s*a,C=r*c-i*a,P=s*c-i*l,j=d*g-f*p,D=d*x-u*p,T=d*v-h*p,z=f*x-u*g,V=f*v-h*g,U=u*v-h*x,R=y*U-w*V+b*z+S*T-C*D+P*j;return R?(R=1/R,e[0]=(a*U-l*V+c*z)*R,e[1]=(s*V-r*U-i*z)*R,e[2]=(g*P-x*C+v*S)*R,e[3]=(u*C-f*P-h*S)*R,e[4]=(l*T-o*U-c*D)*R,e[5]=(n*U-s*T+i*D)*R,e[6]=(x*b-p*P-v*w)*R,e[7]=(d*P-u*b+h*w)*R,e[8]=(o*V-a*T+c*j)*R,e[9]=(r*T-n*V-i*j)*R,e[10]=(p*C-g*b+v*y)*R,e[11]=(f*b-d*C-h*y)*R,e[12]=(a*D-o*z-l*j)*R,e[13]=(n*z-r*D+s*j)*R,e[14]=(g*w-p*S-x*y)*R,e[15]=(d*S-f*w+u*y)*R,e):null}function zg(e){let t=e[0],n=e[1],r=e[2],s=e[3],i=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],u=e[11],h=e[12],p=e[13],g=e[14],x=e[15],v=t*o-n*i,y=t*a-r*i,w=t*l-s*i,b=n*a-r*o,S=n*l-s*o,C=r*l-s*a,P=c*p-d*h,j=c*g-f*h,D=c*x-u*h,T=d*g-f*p,z=d*x-u*p,V=f*x-u*g;return v*V-y*z+w*T+b*D-S*j+C*P}function vh(e,t,n){let r=t[0],s=t[1],i=t[2],o=t[3],a=t[4],l=t[5],c=t[6],d=t[7],f=t[8],u=t[9],h=t[10],p=t[11],g=t[12],x=t[13],v=t[14],y=t[15],w=n[0],b=n[1],S=n[2],C=n[3];return e[0]=w*r+b*a+S*f+C*g,e[1]=w*s+b*l+S*u+C*x,e[2]=w*i+b*c+S*h+C*v,e[3]=w*o+b*d+S*p+C*y,w=n[4],b=n[5],S=n[6],C=n[7],e[4]=w*r+b*a+S*f+C*g,e[5]=w*s+b*l+S*u+C*x,e[6]=w*i+b*c+S*h+C*v,e[7]=w*o+b*d+S*p+C*y,w=n[8],b=n[9],S=n[10],C=n[11],e[8]=w*r+b*a+S*f+C*g,e[9]=w*s+b*l+S*u+C*x,e[10]=w*i+b*c+S*h+C*v,e[11]=w*o+b*d+S*p+C*y,w=n[12],b=n[13],S=n[14],C=n[15],e[12]=w*r+b*a+S*f+C*g,e[13]=w*s+b*l+S*u+C*x,e[14]=w*i+b*c+S*h+C*v,e[15]=w*o+b*d+S*p+C*y,e}function dS(e,t,n){let r=n[0],s=n[1],i=n[2],o,a,l,c,d,f,u,h,p,g,x,v;return t===e?(e[12]=t[0]*r+t[4]*s+t[8]*i+t[12],e[13]=t[1]*r+t[5]*s+t[9]*i+t[13],e[14]=t[2]*r+t[6]*s+t[10]*i+t[14],e[15]=t[3]*r+t[7]*s+t[11]*i+t[15]):(o=t[0],a=t[1],l=t[2],c=t[3],d=t[4],f=t[5],u=t[6],h=t[7],p=t[8],g=t[9],x=t[10],v=t[11],e[0]=o,e[1]=a,e[2]=l,e[3]=c,e[4]=d,e[5]=f,e[6]=u,e[7]=h,e[8]=p,e[9]=g,e[10]=x,e[11]=v,e[12]=o*r+d*s+p*i+t[12],e[13]=a*r+f*s+g*i+t[13],e[14]=l*r+u*s+x*i+t[14],e[15]=c*r+h*s+v*i+t[15]),e}function fS(e,t,n){let r=n[0],s=n[1],i=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function hS(e,t,n,r){let s=r[0],i=r[1],o=r[2],a=Math.hypot(s,i,o),l,c,d,f,u,h,p,g,x,v,y,w,b,S,C,P,j,D,T,z,V,U,R,Q;return Math.abs(a)0?(v=Math.sqrt(x+1)*2,t[3]=.25*v,t[0]=(u-p)/v,t[1]=(h-c)/v,t[2]=(l-d)/v):a>f&&a>g?(v=Math.sqrt(1+a-f-g)*2,t[3]=(u-p)/v,t[0]=.25*v,t[1]=(l+d)/v,t[2]=(h+c)/v):f>g?(v=Math.sqrt(1+f-a-g)*2,t[3]=(h-c)/v,t[0]=(l+d)/v,t[1]=.25*v,t[2]=(u+p)/v):(v=Math.sqrt(1+g-a-f)*2,t[3]=(l-d)/v,t[0]=(h+c)/v,t[1]=(u+p)/v,t[2]=.25*v),t}}();function gS(e,t,n,r){let s=bs([e[0],e[1],e[2]]);const i=bs([e[4],e[5],e[6]]),o=bs([e[8],e[9],e[10]]);zg(e)<0&&(s=-s),n[0]=e[12],n[1]=e[13],n[2]=e[14];const l=e.slice(),c=1/s,d=1/i,f=1/o;l[0]*=c,l[1]*=c,l[2]*=c,l[4]*=d,l[5]*=d,l[6]*=d,l[8]*=f,l[9]*=f,l[10]*=f,$g(t,l),r[0]=s,r[1]=i,r[2]=o}function yS(e,t,n,r){const s=e,i=t[0],o=t[1],a=t[2],l=t[3],c=i+i,d=o+o,f=a+a,u=i*c,h=i*d,p=i*f,g=o*d,x=o*f,v=a*f,y=l*c,w=l*d,b=l*f,S=r[0],C=r[1],P=r[2];return s[0]=(1-(g+v))*S,s[1]=(h+b)*S,s[2]=(p-w)*S,s[3]=0,s[4]=(h-b)*C,s[5]=(1-(u+v))*C,s[6]=(x+y)*C,s[7]=0,s[8]=(p+w)*P,s[9]=(x-y)*P,s[10]=(1-(u+g))*P,s[11]=0,s[12]=n[0],s[13]=n[1],s[14]=n[2],s[15]=1,s}function vS(e,t){let n=t[0],r=t[1],s=t[2],i=t[3],o=n+n,a=r+r,l=s+s,c=n*o,d=r*o,f=r*a,u=s*o,h=s*a,p=s*l,g=i*o,x=i*a,v=i*l;return e[0]=1-f-p,e[1]=d+v,e[2]=u-x,e[3]=0,e[4]=d-v,e[5]=1-c-p,e[6]=h+g,e[7]=0,e[8]=u+x,e[9]=h-g,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function xS(e,t,n,r,s){let i=1/Math.tan(t/2),o=1/(r-s);return e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(s+r)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*s*r*o,e[15]=0,e}function wS(e,t,n,r,s,i,o){let a=1/(t-n),l=1/(r-s),c=1/(i-o);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+n)*a,e[13]=(s+r)*l,e[14]=(o+i)*c,e[15]=1,e}function bS(e,t,n,r){let s=t[0],i=t[1],o=t[2],a=r[0],l=r[1],c=r[2],d=s-n[0],f=i-n[1],u=o-n[2],h=d*d+f*f+u*u;h===0?u=1:(h=1/Math.sqrt(h),d*=h,f*=h,u*=h);let p=l*u-c*f,g=c*d-a*u,x=a*f-l*d;return h=p*p+g*g+x*x,h===0&&(c?a+=1e-6:l?c+=1e-6:l+=1e-6,p=l*u-c*f,g=c*d-a*u,x=a*f-l*d,h=p*p+g*g+x*x),h=1/Math.sqrt(h),p*=h,g*=h,x*=h,e[0]=p,e[1]=g,e[2]=x,e[3]=0,e[4]=f*x-u*g,e[5]=u*p-d*x,e[6]=d*g-f*p,e[7]=0,e[8]=d,e[9]=f,e[10]=u,e[11]=0,e[12]=s,e[13]=i,e[14]=o,e[15]=1,e}function xh(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function wh(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function SS(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}class Co extends Array{constructor(t=1,n=0,r=0,s=0,i=0,o=1,a=0,l=0,c=0,d=0,f=1,u=0,h=0,p=0,g=0,x=1){return super(t,n,r,s,i,o,a,l,c,d,f,u,h,p,g,x),this}get x(){return this[12]}get y(){return this[13]}get z(){return this[14]}get w(){return this[15]}set x(t){this[12]=t}set y(t){this[13]=t}set z(t){this[14]=t}set w(t){this[15]=t}set(t,n,r,s,i,o,a,l,c,d,f,u,h,p,g,x){return t.length?this.copy(t):(lS(this,t,n,r,s,i,o,a,l,c,d,f,u,h,p,g,x),this)}translate(t,n=this){return dS(this,n,t),this}rotate(t,n,r=this){return hS(this,r,t,n),this}scale(t,n=this){return fS(this,n,typeof t=="number"?[t,t,t]:t),this}add(t,n){return n?xh(this,t,n):xh(this,this,t),this}sub(t,n){return n?wh(this,t,n):wh(this,this,t),this}multiply(t,n){return t.length?n?vh(this,t,n):vh(this,this,t):SS(this,this,t),this}identity(){return uS(this),this}copy(t){return aS(this,t),this}fromPerspective({fov:t,aspect:n,near:r,far:s}={}){return xS(this,t,n,r,s),this}fromOrthogonal({left:t,right:n,bottom:r,top:s,near:i,far:o}){return wS(this,t,n,r,s,i,o),this}fromQuaternion(t){return vS(this,t),this}setPosition(t){return this.x=t[0],this.y=t[1],this.z=t[2],this}inverse(t=this){return cS(this,t),this}compose(t,n,r){return yS(this,t,n,r),this}decompose(t,n,r){return gS(this,t,n,r),this}getRotation(t){return $g(t,this),this}getTranslation(t){return pS(t,this),this}getScaling(t){return Og(t,this),this}getMaxScaleOnAxis(){return mS(this)}lookAt(t,n,r){return bS(this,t,n,r),this}determinant(){return zg(this)}fromArray(t,n=0){return this[0]=t[n],this[1]=t[n+1],this[2]=t[n+2],this[3]=t[n+3],this[4]=t[n+4],this[5]=t[n+5],this[6]=t[n+6],this[7]=t[n+7],this[8]=t[n+8],this[9]=t[n+9],this[10]=t[n+10],this[11]=t[n+11],this[12]=t[n+12],this[13]=t[n+13],this[14]=t[n+14],this[15]=t[n+15],this}toArray(t=[],n=0){return t[n]=this[0],t[n+1]=this[1],t[n+2]=this[2],t[n+3]=this[3],t[n+4]=this[4],t[n+5]=this[5],t[n+6]=this[6],t[n+7]=this[7],t[n+8]=this[8],t[n+9]=this[9],t[n+10]=this[10],t[n+11]=this[11],t[n+12]=this[12],t[n+13]=this[13],t[n+14]=this[14],t[n+15]=this[15],t}}function kS(e,t,n="YXZ"){return n==="XYZ"?(e[1]=Math.asin(Math.min(Math.max(t[8],-1),1)),Math.abs(t[8])<.99999?(e[0]=Math.atan2(-t[9],t[10]),e[2]=Math.atan2(-t[4],t[0])):(e[0]=Math.atan2(t[6],t[5]),e[2]=0)):n==="YXZ"?(e[0]=Math.asin(-Math.min(Math.max(t[9],-1),1)),Math.abs(t[9])<.99999?(e[1]=Math.atan2(t[8],t[10]),e[2]=Math.atan2(t[1],t[5])):(e[1]=Math.atan2(-t[2],t[0]),e[2]=0)):n==="ZXY"?(e[0]=Math.asin(Math.min(Math.max(t[6],-1),1)),Math.abs(t[6])<.99999?(e[1]=Math.atan2(-t[2],t[10]),e[2]=Math.atan2(-t[4],t[5])):(e[1]=0,e[2]=Math.atan2(t[1],t[0]))):n==="ZYX"?(e[1]=Math.asin(-Math.min(Math.max(t[2],-1),1)),Math.abs(t[2])<.99999?(e[0]=Math.atan2(t[6],t[10]),e[2]=Math.atan2(t[1],t[0])):(e[0]=0,e[2]=Math.atan2(-t[4],t[5]))):n==="YZX"?(e[2]=Math.asin(Math.min(Math.max(t[1],-1),1)),Math.abs(t[1])<.99999?(e[0]=Math.atan2(-t[9],t[5]),e[1]=Math.atan2(-t[2],t[0])):(e[0]=0,e[1]=Math.atan2(t[8],t[10]))):n==="XZY"&&(e[2]=Math.asin(-Math.min(Math.max(t[4],-1),1)),Math.abs(t[4])<.99999?(e[0]=Math.atan2(t[6],t[5]),e[1]=Math.atan2(t[8],t[0])):(e[0]=Math.atan2(-t[9],t[10]),e[1]=0)),e}const bh=new Co;class CS extends Array{constructor(t=0,n=t,r=t,s="YXZ"){super(t,n,r),this.order=s,this.onChange=()=>{},this._target=this;const i=["0","1","2"];return new Proxy(this,{set(o,a){const l=Reflect.set(...arguments);return l&&i.includes(a)&&o.onChange(),l}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set(t,n=t,r=t){return t.length?this.copy(t):(this._target[0]=t,this._target[1]=n,this._target[2]=r,this.onChange(),this)}copy(t){return this._target[0]=t[0],this._target[1]=t[1],this._target[2]=t[2],this.onChange(),this}reorder(t){return this._target.order=t,this.onChange(),this}fromRotationMatrix(t,n=this.order){return kS(this._target,t,n),this.onChange(),this}fromQuaternion(t,n=this.order,r){return bh.fromQuaternion(t),this._target.fromRotationMatrix(bh,n),r||this.onChange(),this}fromArray(t,n=0){return this._target[0]=t[n],this._target[1]=t[n+1],this._target[2]=t[n+2],this}toArray(t=[],n=0){return t[n]=this[0],t[n+1]=this[1],t[n+2]=this[2],t}}class PS{constructor(){this.parent=null,this.children=[],this.visible=!0,this.matrix=new Co,this.worldMatrix=new Co,this.matrixAutoUpdate=!0,this.worldMatrixNeedsUpdate=!1,this.position=new mt,this.quaternion=new iS,this.scale=new mt(1),this.rotation=new CS,this.up=new mt(0,1,0),this.rotation._target.onChange=()=>this.quaternion.fromEuler(this.rotation,!0),this.quaternion._target.onChange=()=>this.rotation.fromQuaternion(this.quaternion,void 0,!0)}setParent(t,n=!0){this.parent&&t!==this.parent&&this.parent.removeChild(this,!1),this.parent=t,n&&t&&t.addChild(this,!1)}addChild(t,n=!0){~this.children.indexOf(t)||this.children.push(t),n&&t.setParent(this,!1)}removeChild(t,n=!0){~this.children.indexOf(t)&&this.children.splice(this.children.indexOf(t),1),n&&t.setParent(null,!1)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.worldMatrixNeedsUpdate||t)&&(this.parent===null?this.worldMatrix.copy(this.matrix):this.worldMatrix.multiply(this.parent.worldMatrix,this.matrix),this.worldMatrixNeedsUpdate=!1,t=!0);for(let n=0,r=this.children.length;nr&&r({mesh:this,camera:t}));let n=this.program.cullFace&&this.worldMatrix.determinant()<0;this.program.use({flipFaces:n}),this.geometry.draw({mode:this.mode,program:this.program}),this.afterRenderCallbacks.forEach(r=>r&&r({mesh:this,camera:t}))}}function zS(e,t){return e[0]=t[0],e[1]=t[1],e}function OS(e,t,n){return e[0]=t,e[1]=n,e}function kh(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function Ch(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function $S(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}function BS(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}function Ga(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function US(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}function WS(e,t){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function Ph(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}function HS(e){var t=e[0],n=e[1];return t*t+n*n}function qS(e,t){return e[0]=-t[0],e[1]=-t[1],e}function GS(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function YS(e,t){var n=t[0],r=t[1],s=n*n+r*r;return s>0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e}function KS(e,t){return e[0]*t[0]+e[1]*t[1]}function jh(e,t){return e[0]*t[1]-e[1]*t[0]}function XS(e,t,n,r){var s=t[0],i=t[1];return e[0]=s+r*(n[0]-s),e[1]=i+r*(n[1]-i),e}function QS(e,t,n,r,s){const i=Math.exp(-r*s);let o=t[0],a=t[1];return e[0]=n[0]+(o-n[0])*i,e[1]=n[1]+(a-n[1])*i,e}function ZS(e,t,n){var r=t[0],s=t[1];return e[0]=n[0]*r+n[3]*s+n[6],e[1]=n[1]*r+n[4]*s+n[7],e}function JS(e,t,n){let r=t[0],s=t[1];return e[0]=n[0]*r+n[4]*s+n[12],e[1]=n[1]*r+n[5]*s+n[13],e}function ek(e,t){return e[0]===t[0]&&e[1]===t[1]}class _c extends Array{constructor(t=0,n=t){return super(t,n),this}get x(){return this[0]}get y(){return this[1]}set x(t){this[0]=t}set y(t){this[1]=t}set(t,n=t){return t.length?this.copy(t):(OS(this,t,n),this)}copy(t){return zS(this,t),this}add(t,n){return n?kh(this,t,n):kh(this,this,t),this}sub(t,n){return n?Ch(this,t,n):Ch(this,this,t),this}multiply(t){return t.length?$S(this,this,t):Ga(this,this,t),this}divide(t){return t.length?BS(this,this,t):Ga(this,this,1/t),this}inverse(t=this){return GS(this,t),this}len(){return Ph(this)}distance(t){return t?US(this,t):Ph(this)}squaredLen(){return this.squaredDistance()}squaredDistance(t){return t?WS(this,t):HS(this)}negate(t=this){return qS(this,t),this}cross(t,n){return n?jh(t,n):jh(this,t)}scale(t){return Ga(this,this,t),this}normalize(){return YS(this,this),this}dot(t){return KS(this,t)}equals(t){return ek(this,t)}applyMatrix3(t){return ZS(this,this,t),this}applyMatrix4(t){return JS(this,this,t),this}lerp(t,n){return XS(this,this,t,n),this}smoothLerp(t,n,r){return QS(this,this,t,n,r),this}clone(){return new _c(this[0],this[1])}fromArray(t,n=0){return this[0]=t[n],this[1]=t[n+1],this}toArray(t=[],n=0){return t[n]=this[0],t[n+1]=this[1],t}}class tk extends Lb{constructor(t,{attributes:n={}}={}){Object.assign(n,{position:{size:2,data:new Float32Array([-1,-1,3,-1,-1,3])},uv:{size:2,data:new Float32Array([0,0,2,0,0,2])}}),super(t,n)}}const nk=` attribute vec2 position; void main(){gl_Position=vec4(position,0.0,1.0);} `,rk=` #ifdef GL_ES precision lowp float; #endif uniform vec2 uResolution; uniform float uTime; uniform float uHueShift; uniform float uNoise; uniform float uScan; uniform float uScanFreq; uniform float uWarp; #define iTime uTime #define iResolution uResolution vec4 buf[8]; float rand(vec2 c){return fract(sin(dot(c,vec2(12.9898,78.233)))*43758.5453);} mat3 rgb2yiq=mat3(0.299,0.587,0.114,0.596,-0.274,-0.322,0.211,-0.523,0.312); mat3 yiq2rgb=mat3(1.0,0.956,0.621,1.0,-0.272,-0.647,1.0,-1.106,1.703); vec3 hueShiftRGB(vec3 col,float deg){ vec3 yiq=rgb2yiq*col; float rad=radians(deg); float cosh=cos(rad),sinh=sin(rad); vec3 yiqShift=vec3(yiq.x,yiq.y*cosh-yiq.z*sinh,yiq.y*sinh+yiq.z*cosh); return clamp(yiq2rgb*yiqShift,0.0,1.0); } vec4 sigmoid(vec4 x){return 1./(1.+exp(-x));} vec4 cppn_fn(vec2 coordinate,float in0,float in1,float in2){ buf[6]=vec4(coordinate.x,coordinate.y,0.3948333106474662+in0,0.36+in1); buf[7]=vec4(0.14+in2,sqrt(coordinate.x*coordinate.x+coordinate.y*coordinate.y),0.,0.); buf[0]=mat4(vec4(6.5404263,-3.6126034,0.7590882,-1.13613),vec4(2.4582713,3.1660357,1.2219609,0.06276096),vec4(-5.478085,-6.159632,1.8701609,-4.7742867),vec4(6.039214,-5.542865,-0.90925294,3.251348))*buf[6]+mat4(vec4(0.8473259,-5.722911,3.975766,1.6522468),vec4(-0.24321538,0.5839259,-1.7661959,-5.350116),vec4(0.,0.,0.,0.),vec4(0.,0.,0.,0.))*buf[7]+vec4(0.21808943,1.1243913,-1.7969975,5.0294676); buf[1]=mat4(vec4(-3.3522482,-6.0612736,0.55641043,-4.4719114),vec4(0.8631464,1.7432913,5.643898,1.6106541),vec4(2.4941394,-3.5012043,1.7184316,6.357333),vec4(3.310376,8.209261,1.1355612,-1.165539))*buf[6]+mat4(vec4(5.24046,-13.034365,0.009859298,15.870829),vec4(2.987511,3.129433,-0.89023495,-1.6822904),vec4(0.,0.,0.,0.),vec4(0.,0.,0.,0.))*buf[7]+vec4(-5.9457836,-6.573602,-0.8812491,1.5436668); buf[0]=sigmoid(buf[0]);buf[1]=sigmoid(buf[1]); buf[2]=mat4(vec4(-15.219568,8.095543,-2.429353,-1.9381982),vec4(-5.951362,4.3115187,2.6393783,1.274315),vec4(-7.3145227,6.7297835,5.2473326,5.9411426),vec4(5.0796127,8.979051,-1.7278991,-1.158976))*buf[6]+mat4(vec4(-11.967154,-11.608155,6.1486754,11.237008),vec4(2.124141,-6.263192,-1.7050359,-0.7021966),vec4(0.,0.,0.,0.),vec4(0.,0.,0.,0.))*buf[7]+vec4(-4.17164,-3.2281182,-4.576417,-3.6401186); buf[3]=mat4(vec4(3.1832156,-13.738922,1.879223,3.233465),vec4(0.64300746,12.768129,1.9141049,0.50990224),vec4(-0.049295485,4.4807224,1.4733979,1.801449),vec4(5.0039253,13.000481,3.3991797,-4.5561905))*buf[6]+mat4(vec4(-0.1285731,7.720628,-3.1425676,4.742367),vec4(0.6393625,3.714393,-0.8108378,-0.39174938),vec4(0.,0.,0.,0.),vec4(0.,0.,0.,0.))*buf[7]+vec4(-1.1811101,-21.621881,0.7851888,1.2329718); buf[2]=sigmoid(buf[2]);buf[3]=sigmoid(buf[3]); buf[4]=mat4(vec4(5.214916,-7.183024,2.7228765,2.6592617),vec4(-5.601878,-25.3591,4.067988,0.4602802),vec4(-10.57759,24.286327,21.102104,37.546658),vec4(4.3024497,-1.9625226,2.3458803,-1.372816))*buf[0]+mat4(vec4(-17.6526,-10.507558,2.2587414,12.462782),vec4(6.265566,-502.75443,-12.642513,0.9112289),vec4(-10.983244,20.741234,-9.701768,-0.7635988),vec4(5.383626,1.4819539,-4.1911616,-4.8444734))*buf[1]+mat4(vec4(12.785233,-16.345072,-0.39901125,1.7955981),vec4(-30.48365,-1.8345358,1.4542528,-1.1118771),vec4(19.872723,-7.337935,-42.941723,-98.52709),vec4(8.337645,-2.7312303,-2.2927687,-36.142323))*buf[2]+mat4(vec4(-16.298317,3.5471997,-0.44300047,-9.444417),vec4(57.5077,-35.609753,16.163465,-4.1534753),vec4(-0.07470326,-3.8656476,-7.0901804,3.1523974),vec4(-12.559385,-7.077619,1.490437,-0.8211543))*buf[3]+vec4(-7.67914,15.927437,1.3207729,-1.6686112); buf[5]=mat4(vec4(-1.4109162,-0.372762,-3.770383,-21.367174),vec4(-6.2103205,-9.35908,0.92529047,8.82561),vec4(11.460242,-22.348068,13.625772,-18.693201),vec4(-0.3429052,-3.9905605,-2.4626114,-0.45033523))*buf[0]+mat4(vec4(7.3481627,-4.3661838,-6.3037653,-3.868115),vec4(1.5462853,6.5488915,1.9701879,-0.58291394),vec4(6.5858274,-2.2180402,3.7127688,-1.3730392),vec4(-5.7973905,10.134961,-2.3395722,-5.965605))*buf[1]+mat4(vec4(-2.5132585,-6.6685553,-1.4029363,-0.16285264),vec4(-0.37908727,0.53738135,4.389061,-1.3024765),vec4(-0.70647055,2.0111287,-5.1659346,-3.728635),vec4(-13.562562,10.487719,-0.9173751,-2.6487076))*buf[2]+mat4(vec4(-8.645013,6.5546675,-6.3944063,-5.5933375),vec4(-0.57783127,-1.077275,36.91025,5.736769),vec4(14.283112,3.7146652,7.1452246,-4.5958776),vec4(2.7192075,3.6021907,-4.366337,-2.3653464))*buf[3]+vec4(-5.9000807,-4.329569,1.2427121,8.59503); buf[4]=sigmoid(buf[4]);buf[5]=sigmoid(buf[5]); buf[6]=mat4(vec4(-1.61102,0.7970257,1.4675229,0.20917463),vec4(-28.793737,-7.1390953,1.5025433,4.656581),vec4(-10.94861,39.66238,0.74318546,-10.095605),vec4(-0.7229728,-1.5483948,0.7301322,2.1687684))*buf[0]+mat4(vec4(3.2547753,21.489103,-1.0194173,-3.3100595),vec4(-3.7316632,-3.3792162,-7.223193,-0.23685838),vec4(13.1804495,0.7916005,5.338587,5.687114),vec4(-4.167605,-17.798311,-6.815736,-1.6451967))*buf[1]+mat4(vec4(0.604885,-7.800309,-7.213122,-2.741014),vec4(-3.522382,-0.12359311,-0.5258442,0.43852118),vec4(9.6752825,-22.853785,2.062431,0.099892326),vec4(-4.3196306,-17.730087,2.5184598,5.30267))*buf[2]+mat4(vec4(-6.545563,-15.790176,-6.0438633,-5.415399),vec4(-43.591583,28.551912,-16.00161,18.84728),vec4(4.212382,8.394307,3.0958717,8.657522),vec4(-5.0237565,-4.450633,-4.4768,-5.5010443))*buf[3]+mat4(vec4(1.6985557,-67.05806,6.897715,1.9004834),vec4(1.8680354,2.3915145,2.5231109,4.081538),vec4(11.158006,1.7294737,2.0738268,7.386411),vec4(-4.256034,-306.24686,8.258898,-17.132736))*buf[4]+mat4(vec4(1.6889864,-4.5852966,3.8534803,-6.3482175),vec4(1.3543309,-1.2640043,9.932754,2.9079645),vec4(-5.2770967,0.07150358,-0.13962056,3.3269649),vec4(28.34703,-4.918278,6.1044083,4.085355))*buf[5]+vec4(6.6818056,12.522166,-3.7075126,-4.104386); buf[7]=mat4(vec4(-8.265602,-4.7027016,5.098234,0.7509808),vec4(8.6507845,-17.15949,16.51939,-8.884479),vec4(-4.036479,-2.3946867,-2.6055532,-1.9866527),vec4(-2.2167742,-1.8135649,-5.9759874,4.8846445))*buf[0]+mat4(vec4(6.7790847,3.5076547,-2.8191125,-2.7028968),vec4(-5.743024,-0.27844876,1.4958696,-5.0517144),vec4(13.122226,15.735168,-2.9397483,-4.101023),vec4(-14.375265,-5.030483,-6.2599335,2.9848232))*buf[1]+mat4(vec4(4.0950394,-0.94011575,-5.674733,4.755022),vec4(4.3809423,4.8310084,1.7425908,-3.437416),vec4(2.117492,0.16342592,-104.56341,16.949184),vec4(-5.22543,-2.994248,3.8350096,-1.9364246))*buf[2]+mat4(vec4(-5.900337,1.7946124,-13.604192,-3.8060522),vec4(6.6583457,31.911177,25.164474,91.81147),vec4(11.840538,4.1503043,-0.7314397,6.768467),vec4(-6.3967767,4.034772,6.1714606,-0.32874924))*buf[3]+mat4(vec4(3.4992442,-196.91893,-8.923708,2.8142626),vec4(3.4806502,-3.1846354,5.1725626,5.1804223),vec4(-2.4009497,15.585794,1.2863957,2.0252278),vec4(-71.25271,-62.441242,-8.138444,0.50670296))*buf[4]+mat4(vec4(-12.291733,-11.176166,-7.3474145,4.390294),vec4(10.805477,5.6337385,-0.9385842,-4.7348723),vec4(-12.869276,-7.039391,5.3029537,7.5436664),vec4(1.4593618,8.91898,3.5101583,5.840625))*buf[5]+vec4(2.2415268,-6.705987,-0.98861027,-2.117676); buf[6]=sigmoid(buf[6]);buf[7]=sigmoid(buf[7]); buf[0]=mat4(vec4(1.6794263,1.3817469,2.9625452,0.),vec4(-1.8834411,-1.4806935,-3.5924516,0.),vec4(-1.3279216,-1.0918057,-2.3124623,0.),vec4(0.2662234,0.23235129,0.44178495,0.))*buf[0]+mat4(vec4(-0.6299101,-0.5945583,-0.9125601,0.),vec4(0.17828953,0.18300213,0.18182953,0.),vec4(-2.96544,-2.5819945,-4.9001055,0.),vec4(1.4195864,1.1868085,2.5176322,0.))*buf[1]+mat4(vec4(-1.2584374,-1.0552157,-2.1688404,0.),vec4(-0.7200217,-0.52666044,-1.438251,0.),vec4(0.15345335,0.15196142,0.272854,0.),vec4(0.945728,0.8861938,1.2766753,0.))*buf[2]+mat4(vec4(-2.4218085,-1.968602,-4.35166,0.),vec4(-22.683098,-18.0544,-41.954372,0.),vec4(0.63792,0.5470648,1.1078634,0.),vec4(-1.5489894,-1.3075932,-2.6444845,0.))*buf[3]+mat4(vec4(-0.49252132,-0.39877754,-0.91366625,0.),vec4(0.95609266,0.7923952,1.640221,0.),vec4(0.30616966,0.15693925,0.8639857,0.),vec4(1.1825981,0.94504964,2.176963,0.))*buf[4]+mat4(vec4(0.35446745,0.3293795,0.59547555,0.),vec4(-0.58784515,-0.48177817,-1.0614829,0.),vec4(2.5271258,1.9991658,4.6846647,0.),vec4(0.13042648,0.08864098,0.30187556,0.))*buf[5]+mat4(vec4(-1.7718065,-1.4033192,-3.3355875,0.),vec4(3.1664357,2.638297,5.378702,0.),vec4(-3.1724713,-2.6107926,-5.549295,0.),vec4(-2.851368,-2.249092,-5.3013067,0.))*buf[6]+mat4(vec4(1.5203838,1.2212278,2.8404984,0.),vec4(1.5210563,1.2651345,2.683903,0.),vec4(2.9789467,2.4364579,5.2347264,0.),vec4(2.2270417,1.8825914,3.8028636,0.))*buf[7]+vec4(-1.5468478,-3.6171484,0.24762098,0.); buf[0]=sigmoid(buf[0]); return vec4(buf[0].x,buf[0].y,buf[0].z,1.); } void mainImage(out vec4 fragColor,in vec2 fragCoord){ vec2 uv=fragCoord/uResolution.xy*2.-1.; uv.y*=-1.; uv+=uWarp*vec2(sin(uv.y*6.283+uTime*0.5),cos(uv.x*6.283+uTime*0.5))*0.05; fragColor=cppn_fn(uv,0.1*sin(0.3*uTime),0.1*sin(0.69*uTime),0.1*sin(0.44*uTime)); } void main(){ vec4 col;mainImage(col,gl_FragCoord.xy); col.rgb=hueShiftRGB(col.rgb,uHueShift); float scanline_val=sin(gl_FragCoord.y*uScanFreq)*0.5+0.5; col.rgb*=1.-(scanline_val*scanline_val)*uScan; col.rgb+=(rand(gl_FragCoord.xy+uTime)-0.5)*uNoise; gl_FragColor=vec4(clamp(col.rgb,0.0,1.0),1.0); } `;class sk extends k.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("ErrorBoundary caught an error:",t,n)}render(){return this.state.hasError?this.props.fallback||m.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",background:"radial-gradient(circle at center, rgba(0,0,0,0.8) 0%, rgba(0,0,0,1) 100%)",zIndex:-1,pointerEvents:"none"}}):this.props.children}}function ik({hueShift:e=60,noiseIntensity:t=.03,scanlineIntensity:n=.08,speed:r=.4,scanlineFrequency:s=.6,warpAmount:i=.15,resolutionScale:o=1}){const a=k.useRef(null);return k.useEffect(()=>{const l=a.current;if(!l){console.error("DarkVeil: Canvas not found");return}let c,d,f;try{c=new Ob({dpr:Math.min(window.devicePixelRatio,2),canvas:l});const x=c.gl;if(!x){console.error("DarkVeil: WebGL context not available");return}const v=new tk(x);d=new Rb(x,{vertex:nk,fragment:rk,uniforms:{uTime:{value:0},uResolution:{value:new _c},uHueShift:{value:e},uNoise:{value:t},uScan:{value:n},uScanFreq:{value:s},uWarp:{value:i}}}),f=new IS(x,{geometry:v,program:d}),console.log("DarkVeil: Successfully initialized")}catch(x){console.error("DarkVeil: Initialization error:",x);return}const u=()=>{const x=window.innerWidth,v=window.innerHeight;c.setSize(x*o,v*o),d.uniforms.uResolution.value.set(x,v)};window.addEventListener("resize",u),u();const h=performance.now();let p=0;const g=()=>{d.uniforms.uTime.value=(performance.now()-h)/1e3*r,d.uniforms.uHueShift.value=e,d.uniforms.uNoise.value=t,d.uniforms.uScan.value=n,d.uniforms.uScanFreq.value=s,d.uniforms.uWarp.value=i,c.render({scene:f}),p=requestAnimationFrame(g)};return g(),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",u)}},[e,t,n,r,s,i,o]),m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"radial-gradient(circle at center, rgba(50,20,80,0.8) 0%, rgba(20,10,40,0.9) 50%, rgba(0,0,0,1) 100%)",zIndex:-10,pointerEvents:"none"}}),m.jsx("canvas",{ref:a,style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:-5,pointerEvents:"none",display:"block"}})]})}function Eh(e){return m.jsx(sk,{children:m.jsx(ik,{...e})})}/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var ok={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.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ak=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),ee=(e,t)=>{const n=k.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:a="",children:l,...c},d)=>k.createElement("svg",{ref:d,...ok,width:s,height:s,stroke:r,strokeWidth:o?Number(i)*24/Number(s):i,className:["lucide",`lucide-${ak(e)}`,a].join(" "),...c},[...t.map(([f,u])=>k.createElement(f,u)),...Array.isArray(l)?l:[l]]));return n.displayName=`${e}`,n};/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lk=ee("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uk=ee("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ck=ee("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dk=ee("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Po=ee("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bg=ee("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xe=ee("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fk=ee("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Th=ee("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hk=ee("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vt=ee("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pk=ee("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ug=ee("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nh=ee("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ac=ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mh=ee("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yn=ee("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mk=ee("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wg=ee("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gk=ee("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ss=ee("User",[["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"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hg=ee("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yk=ee("Volume2",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vk=ee("Wand2",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72Z",key:"1bcowg"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xk=ee("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.294.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=ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function qg(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t{const t=kk(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(Lc);return a[0]===""&&a.length!==1&&a.shift(),Gg(a,t)||Sk(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Gg=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Gg(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Lc);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Ah=/^\[(.+)\]$/,Sk=e=>{if(Ah.test(e)){const t=Ah.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},kk=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Pk(Object.entries(e.classGroups),n).forEach(([i,o])=>{uu(o,r,i,t)}),r},uu=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Lh(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(Ck(s)){uu(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{uu(o,Lh(t,i),n,r)})})},Lh=(e,t)=>{let n=e;return t.split(Lc).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Ck=e=>e.isThemeGetter,Pk=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[n,s]}):e,jk=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},Yg="!",Ek=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const l=[];let c=0,d=0,f;for(let x=0;xd?f-d:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:o}):o},Tk=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Nk=e=>({cache:jk(e.cacheSize),parseClassName:Ek(e),...bk(e)}),Mk=/\s+/,_k=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(Mk);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:d,hasImportantModifier:f,baseClassName:u,maybePostfixModifierPosition:h}=n(c);let p=!!h,g=r(p?u.substring(0,h):u);if(!g){if(!p){a=c+(a.length>0?" "+a:a);continue}if(g=r(u),!g){a=c+(a.length>0?" "+a:a);continue}p=!1}const x=Tk(d).join(":"),v=f?x+Yg:x,y=v+g;if(i.includes(y))continue;i.push(y);const w=s(g,p);for(let b=0;b0?" "+a:a)}return a};function Ak(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rf(d),e());return n=Nk(c),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=_k(l,n);return s(l,d),d}return function(){return i(Ak.apply(null,arguments))}}const ne=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Xg=/^\[(?:([a-z-]+):)?(.+)\]$/i,Dk=/^\d+\/\d+$/,Rk=new Set(["px","full","screen"]),Vk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fk=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ik=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,zk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ok=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mt=e=>Cr(e)||Rk.has(e)||Dk.test(e),Kt=e=>Ur(e,"length",Yk),Cr=e=>!!e&&!Number.isNaN(Number(e)),Ya=e=>Ur(e,"number",Cr),ts=e=>!!e&&Number.isInteger(Number(e)),$k=e=>e.endsWith("%")&&Cr(e.slice(0,-1)),H=e=>Xg.test(e),Xt=e=>Vk.test(e),Bk=new Set(["length","size","percentage"]),Uk=e=>Ur(e,Bk,Qg),Wk=e=>Ur(e,"position",Qg),Hk=new Set(["image","url"]),qk=e=>Ur(e,Hk,Xk),Gk=e=>Ur(e,"",Kk),ns=()=>!0,Ur=(e,t,n)=>{const r=Xg.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Yk=e=>Fk.test(e)&&!Ik.test(e),Qg=()=>!1,Kk=e=>zk.test(e),Xk=e=>Ok.test(e),Qk=()=>{const e=ne("colors"),t=ne("spacing"),n=ne("blur"),r=ne("brightness"),s=ne("borderColor"),i=ne("borderRadius"),o=ne("borderSpacing"),a=ne("borderWidth"),l=ne("contrast"),c=ne("grayscale"),d=ne("hueRotate"),f=ne("invert"),u=ne("gap"),h=ne("gradientColorStops"),p=ne("gradientColorStopPositions"),g=ne("inset"),x=ne("margin"),v=ne("opacity"),y=ne("padding"),w=ne("saturate"),b=ne("scale"),S=ne("sepia"),C=ne("skew"),P=ne("space"),j=ne("translate"),D=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",H,t],V=()=>[H,t],U=()=>["",Mt,Kt],R=()=>["auto",Cr,H],Q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>["start","end","center","between","around","evenly","stretch"],N=()=>["","0",H],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[Cr,H];return{cacheSize:500,separator:":",theme:{colors:[ns],spacing:[Mt,Kt],blur:["none","",Xt,H],brightness:L(),borderColor:[e],borderRadius:["none","","full",Xt,H],borderSpacing:V(),borderWidth:U(),contrast:L(),grayscale:N(),hueRotate:L(),invert:N(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[$k,Kt],inset:z(),margin:z(),opacity:L(),padding:V(),saturate:L(),scale:L(),sepia:N(),skew:L(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",H]}],container:["container"],columns:[{columns:[Xt]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Q(),H]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ts,H]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",H]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",ts,H]}],"grid-cols":[{"grid-cols":[ns]}],"col-start-end":[{col:["auto",{span:["full",ts,H]},H]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[ns]}],"row-start-end":[{row:["auto",{span:[ts,H]},H]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",H]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",H]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",H,t]}],"min-w":[{"min-w":[H,t,"min","max","fit"]}],"max-w":[{"max-w":[H,t,"none","full","min","max","fit","prose",{screen:[Xt]},Xt]}],h:[{h:[H,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[H,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[H,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[H,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Xt,Kt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ya]}],"font-family":[{font:[ns]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",H]}],"line-clamp":[{"line-clamp":["none",Cr,Ya]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Mt,H]}],"list-image":[{"list-image":["none",H]}],"list-style-type":[{list:["none","disc","decimal",H]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Mt,Kt]}],"underline-offset":[{"underline-offset":["auto",Mt,H]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",H]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Q(),Wk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Uk]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},qk]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...A(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:A()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...A()]}],"outline-offset":[{"outline-offset":[Mt,H]}],"outline-w":[{outline:[Mt,Kt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Mt,Kt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Xt,Gk]}],"shadow-color":[{shadow:[ns]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Xt,H]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",H]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",H]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",H]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ts,H]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",H]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",H]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",H]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Mt,Kt,Ya]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Zk=Lk(Qk);function Dh(...e){return Zk(wk(e))}function Zg(e){const t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return`${t}:${n.toString().padStart(2,"0")}`}function Pr(e){const t=new Date(e),r=(new Date().getTime()-t.getTime())/(1e3*60*60);return r<1?`${Math.floor(r*60)}m ago`:r<24?`${Math.floor(r)}h ago`:`${Math.floor(r/24)}d ago`}const Jk=()=>{var V,U,R,Q,A,q,_,N,F,L;const[e,t]=k.useState(!1),[n,r]=k.useState(!1),[s,i]=k.useState({x:0,y:0}),[o,a]=k.useState(!1),[l,c]=k.useState({x:0,y:0}),{currentUser:d,partnerUser:f,logout:u,theme:h,setTheme:p,setPartnerUser:g}=ae(),[x,v]=k.useState(""),[y,w]=k.useState(!1),[b,S]=k.useState(!1),C=En(),P=[{name:"Dashboard",href:"/",icon:Xe},{name:"Last Listened",href:"/last-listened",icon:vt},{name:"Mixed Playlist",href:"/mixed-playlist",icon:Ug},{name:"Memory Lane",href:"/memory-lane",icon:Yn}],j=()=>{u(),localStorage.removeItem("spotify-user"),localStorage.removeItem("spotify-partner")},D=async()=>{var E,W;if(!(!((E=d==null?void 0:d.user)!=null&&E.id)||!((W=f==null?void 0:f.user)!=null&&W.id))&&confirm(`Are you sure you want to remove ${f.user.display_name} as your partner?`)){S(!0);try{await Pt("/partners/remove",{partnerId:f.user.id})}catch(X){try{await Pt("/partners/clear",{userId:d.user.id})}catch(te){console.error("Failed to remove partner:",X,te)}}finally{g(null),localStorage.removeItem("spotify-partner"),S(!1)}}},T=Vr(h);k.useEffect(()=>{Vr(h)},[h]),k.useEffect(()=>{if(n){const E=Math.min(600,window.innerWidth-40),W=Math.min(window.innerHeight*.9,800),X=(window.innerWidth-E)/2,te=(window.innerHeight-W)/2;i({x:X,y:te})}},[n]),k.useEffect(()=>{const E=X=>{o&&i({x:X.clientX-l.x,y:X.clientY-l.y})},W=()=>{a(!1)};return o&&(document.addEventListener("mousemove",E),document.addEventListener("mouseup",W)),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",W)}},[o,l]);const z=E=>{a(!0),c({x:E.clientX-s.x,y:E.clientY-s.y})};return m.jsxs(O.nav,{initial:{y:-100,opacity:0},animate:{y:0,opacity:1},className:"sticky top-0 z-50",style:{background:"rgba(0, 0, 0, 0.8)",backdropFilter:"blur(20px)",borderBottom:"1px solid rgba(255, 255, 255, 0.05)"},children:[m.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[m.jsxs("div",{className:"flex justify-between items-center h-16",children:[m.jsxs(zi,{to:"/",className:"flex items-center space-x-2",children:[m.jsx(O.div,{whileHover:{scale:1.1,rotate:5},className:"w-8 h-8 rounded-full flex items-center justify-center",style:{background:`linear-gradient(135deg, ${((V=T.cssVars)==null?void 0:V.primary)||"#1db954"} 0%, ${((U=T.cssVars)==null?void 0:U.secondary)||"#1ed760"} 100%)`},children:m.jsx(Xe,{className:"w-5 h-5 text-white"})}),m.jsx("span",{className:"text-xl font-bold gradient-text",children:"Our Musical Journey"})]}),m.jsx("div",{className:"hidden md:flex items-center space-x-1",children:P.map(E=>{var X,te,G,be;const W=C.pathname===E.href;return m.jsxs(zi,{to:E.href,className:Dh("flex items-center space-x-2 px-4 py-2 rounded-xl transition-all duration-300",W?"text-white":"text-white/60 hover:text-white hover:bg-white/5"),style:W?{background:`linear-gradient(135deg, ${((X=T.cssVars)==null?void 0:X.primary)||"#1db954"}15 0%, ${((te=T.cssVars)==null?void 0:te.secondary)||"#1ed760"}10 100%)`,border:`1px solid ${((G=T.cssVars)==null?void 0:G.primary)||"#1db954"}30`}:{},children:[m.jsx(E.icon,{className:"w-4 h-4",style:{color:W?(be=T.cssVars)==null?void 0:be.primary:void 0}}),m.jsx("span",{className:"font-medium",children:E.name})]},E.name)})}),m.jsxs("div",{className:"hidden md:flex items-center space-x-4",children:[!f&&m.jsxs("div",{className:"flex items-center space-x-2",children:[m.jsx("input",{value:x,onChange:E=>v(E.target.value),placeholder:"Partner Spotify ID",className:"bg-white/10 text-white text-sm px-2 py-1 rounded"}),m.jsx("button",{disabled:y||!x,onClick:async()=>{var E;if(!(!((E=d==null?void 0:d.user)!=null&&E.id)||!x)){w(!0);try{await Pt("/partners/request",{toUid:x})}finally{w(!1)}}},className:`${T.primary} ${T.hover} text-white px-3 py-1 rounded text-sm disabled:opacity-50`,children:y?"Sending...":"Send Request"})]}),f&&m.jsxs(O.div,{initial:{scale:0},animate:{scale:1},className:"flex items-center space-x-2 text-sm text-white/70",children:[m.jsx(Ss,{className:"w-4 h-4"}),m.jsxs("span",{children:["+ ",(R=f.user)==null?void 0:R.display_name]})]}),m.jsxs(O.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>r(!0),className:"flex items-center space-x-2 px-3 py-2 rounded-xl text-white/60 hover:text-white transition-all duration-300",style:{color:(Q=T.cssVars)==null?void 0:Q.primary},onMouseEnter:E=>{E.currentTarget.style.background="rgba(255, 255, 255, 0.05)"},onMouseLeave:E=>{E.currentTarget.style.background="transparent"},children:[m.jsx(Mh,{className:"w-4 h-4"}),m.jsx("span",{className:"hidden lg:block",children:"Settings"})]}),m.jsxs(O.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:j,className:"flex items-center space-x-2 px-3 py-2 rounded-xl text-white/60 hover:text-white transition-all duration-300",onMouseEnter:E=>{E.currentTarget.style.background="rgba(239, 68, 68, 0.1)"},onMouseLeave:E=>{E.currentTarget.style.background="transparent"},children:[m.jsx(Th,{className:"w-4 h-4"}),m.jsx("span",{className:"hidden lg:block",children:"Logout"})]})]}),m.jsx("button",{onClick:()=>t(!e),className:"md:hidden p-2 rounded-lg text-white/70 hover:text-white hover:bg-white/10 transition-all duration-300",children:e?m.jsx(_h,{className:"w-6 h-6"}):m.jsx(hk,{className:"w-6 h-6"})})]}),e&&m.jsx(O.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"md:hidden py-4 border-t border-white/10",children:m.jsxs("div",{className:"space-y-2",children:[P.map(E=>{var X,te,G,be;const W=C.pathname===E.href;return m.jsxs(zi,{to:E.href,onClick:()=>t(!1),className:Dh("flex items-center space-x-3 px-4 py-3 rounded-xl transition-all duration-300",W?"text-white":"text-white/60 hover:text-white hover:bg-white/5"),style:W?{background:`linear-gradient(135deg, ${((X=T.cssVars)==null?void 0:X.primary)||"#1db954"}15 0%, ${((te=T.cssVars)==null?void 0:te.secondary)||"#1ed760"}10 100%)`,border:`1px solid ${((G=T.cssVars)==null?void 0:G.primary)||"#1db954"}30`}:{},children:[m.jsx(E.icon,{className:"w-5 h-5",style:{color:W?(be=T.cssVars)==null?void 0:be.primary:void 0}}),m.jsx("span",{className:"font-medium",children:E.name})]},E.name)}),m.jsxs("div",{className:"pt-4 border-t border-white/10",children:[f&&m.jsxs("div",{className:"flex items-center space-x-3 px-4 py-2 text-sm text-white/70",children:[m.jsx(Ss,{className:"w-4 h-4"}),m.jsxs("span",{children:["Connected with ",(A=f.user)==null?void 0:A.display_name]})]}),m.jsxs("button",{onClick:()=>{r(!0),t(!1)},className:"w-full flex items-center space-x-3 px-4 py-3 rounded-xl text-white/60 hover:text-white transition-all duration-300",style:{color:(q=T.cssVars)==null?void 0:q.primary},onMouseEnter:E=>{E.currentTarget.style.background="rgba(255, 255, 255, 0.05)"},onMouseLeave:E=>{E.currentTarget.style.background="transparent"},children:[m.jsx(Mh,{className:"w-5 h-5"}),m.jsx("span",{className:"font-medium",children:"Settings"})]}),m.jsxs("button",{onClick:j,className:"w-full flex items-center space-x-3 px-4 py-3 rounded-xl text-white/60 hover:text-white transition-all duration-300",onMouseEnter:E=>{E.currentTarget.style.background="rgba(239, 68, 68, 0.1)"},onMouseLeave:E=>{E.currentTarget.style.background="transparent"},children:[m.jsx(Th,{className:"w-5 h-5"}),m.jsx("span",{className:"font-medium",children:"Logout"})]})]})]})})]}),n&&m.jsxs(m.Fragment,{children:[m.jsx(O.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-md z-40",onClick:()=>r(!1)}),m.jsxs(O.div,{initial:{opacity:0,scale:.8,y:30},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:30},className:"fixed z-50 overflow-hidden",style:{left:s.x,top:s.y,width:Math.min(600,window.innerWidth-40),height:Math.min(window.innerHeight*.9,800),background:"linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(20,20,20,0.95) 50%, rgba(0,0,0,0.9) 100%)",backdropFilter:"blur(24px) saturate(180%)",WebkitBackdropFilter:"blur(24px) saturate(180%)",border:"1px solid rgba(255,255,255,0.2)",borderRadius:"16px",boxShadow:"0 25px 50px rgba(0,0,0,0.5)",cursor:o?"grabbing":"default"},children:[m.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-white/20 cursor-grab active:cursor-grabbing select-none",onMouseDown:z,style:{background:"linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)"},children:[m.jsxs("div",{className:"flex items-center space-x-3",children:[m.jsxs("div",{className:"flex space-x-2",children:[m.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),m.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),m.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"})]}),m.jsx("h2",{className:"text-lg font-semibold text-white",children:"Settings"})]}),m.jsx("button",{onClick:()=>r(!1),className:"text-white/70 hover:text-white hover:bg-white/10 p-2 rounded-lg transition-all duration-200",children:m.jsx(_h,{className:"w-5 h-5"})})]}),m.jsx("div",{className:"overflow-y-auto p-4 sm:p-6",style:{height:"calc(100% - 60px)"},children:m.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[(d==null?void 0:d.user)&&m.jsxs("div",{children:[m.jsx("h3",{className:"text-lg font-semibold text-white mb-4 drop-shadow-md",children:"Your Account"}),m.jsxs("div",{className:"rounded-xl p-4 border border-white/20 transition-all duration-300 hover:border-white/30 hover:shadow-lg hover:shadow-white/5",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},onMouseEnter:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%)"},onMouseLeave:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)"},children:[m.jsx("div",{className:"text-sm text-white/70 mb-2 font-medium",children:"Spotify ID"}),m.jsx("div",{className:"text-white font-mono text-sm break-all rounded-lg p-3 mb-3",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.1)"},children:d.user.id}),m.jsxs("div",{className:"text-sm text-white/80",children:["Display Name: ",m.jsx("span",{className:"text-white font-medium",children:d.user.display_name})]})]})]}),m.jsxs("div",{children:[m.jsx("h3",{className:"text-lg font-semibold text-white mb-4 drop-shadow-md",children:"Partner"}),f?m.jsx("div",{className:"rounded-xl p-4 border border-white/20 transition-all duration-300 hover:border-white/30 hover:shadow-lg hover:shadow-white/5",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},onMouseEnter:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%)"},onMouseLeave:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)"},children:m.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between space-y-3 sm:space-y-0",children:[m.jsxs("div",{className:"flex items-center space-x-3 sm:space-x-4",children:[m.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-gradient-to-br from-purple-500 to-pink-500 rounded-full flex items-center justify-center shadow-lg",children:m.jsx(Ss,{className:"w-5 h-5 sm:w-6 sm:h-6 text-white"})}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-white font-semibold text-base sm:text-lg truncate",children:(_=f.user)==null?void 0:_.display_name}),m.jsx("div",{className:"text-xs text-white/70 break-all rounded px-2 py-1 mt-1 inline-block",style:{background:"rgba(0,0,0,0.3)",border:"1px solid rgba(255,255,255,0.1)"},children:(N=f.user)==null?void 0:N.id}),m.jsx("div",{className:"text-sm text-green-400 font-medium mt-2",children:"βœ“ Connected"})]})]}),m.jsxs("button",{onClick:D,disabled:b,className:"flex items-center space-x-2 p-2 sm:p-3 text-red-400 hover:text-red-300 rounded-xl transition-all duration-200 disabled:opacity-50 self-start sm:self-auto",style:{background:"rgba(239, 68, 68, 0.1)"},onMouseEnter:E=>{E.currentTarget.style.background="rgba(239, 68, 68, 0.2)"},onMouseLeave:E=>{E.currentTarget.style.background="rgba(239, 68, 68, 0.1)"},children:[m.jsx(Wg,{className:"w-4 h-4 sm:w-5 sm:h-5"}),m.jsx("span",{className:"text-sm sm:hidden",children:"Remove"})]})]})}):m.jsxs("div",{className:"rounded-xl p-4 border border-white/20 space-y-4 transition-all duration-300 hover:border-white/30 hover:shadow-lg hover:shadow-white/5",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},onMouseEnter:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%)"},onMouseLeave:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)"},children:[m.jsxs("div",{children:[m.jsx("label",{className:"text-sm text-white/70 mb-2 block font-medium",children:"Partner Spotify ID"}),m.jsx("input",{value:x,onChange:E=>v(E.target.value),placeholder:"Enter partner's Spotify ID...",className:"w-full text-white text-sm px-4 py-3 rounded-xl placeholder-white/50 border focus:outline-none transition-all",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.2)"},onFocus:E=>{E.target.style.border="1px solid rgba(255,255,255,0.4)"},onBlur:E=>{E.target.style.border="1px solid rgba(255,255,255,0.2)"}})]}),m.jsx("button",{disabled:y||!x,onClick:async()=>{var E;if(!(!((E=d==null?void 0:d.user)!=null&&E.id)||!x)){w(!0);try{await Pt("/partners/request",{toUid:x}),v("")}finally{w(!1)}}},className:"w-full text-white px-4 py-3 rounded-xl text-sm disabled:opacity-50 transition-all duration-200 font-medium",style:{background:`linear-gradient(135deg, ${((F=T.cssVars)==null?void 0:F.primary)||"#1db954"} 0%, ${((L=T.cssVars)==null?void 0:L.secondary)||"#1ed760"} 100%)`},onMouseEnter:E=>{var W;E.currentTarget.style.transform="translateY(-1px)",E.currentTarget.style.boxShadow=`0 8px 25px ${((W=T.cssVars)==null?void 0:W.primary)||"#1db954"}40`},onMouseLeave:E=>{E.currentTarget.style.transform="translateY(0)",E.currentTarget.style.boxShadow="none"},children:y?"Sending...":"Send Partner Request"})]})]}),m.jsxs("div",{children:[m.jsx("h3",{className:"text-lg font-semibold text-white mb-4 drop-shadow-md",children:"Color Theme"}),m.jsx("div",{className:"rounded-xl p-4 border border-white/20 transition-all duration-300 hover:border-white/30 hover:shadow-lg hover:shadow-white/5",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},onMouseEnter:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%)"},onMouseLeave:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)"},children:m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3",children:[{name:"Green",value:"green",color:"from-green-500 to-emerald-500"},{name:"Pink",value:"pink",color:"from-pink-500 to-rose-500"},{name:"Blue",value:"blue",color:"from-blue-400 to-cyan-400"},{name:"Red",value:"red",color:"from-red-600 to-red-800"},{name:"Purple",value:"purple",color:"from-purple-500 to-violet-600"},{name:"Yellow",value:"yellow",color:"from-yellow-400 to-orange-500"},{name:"Turquoise",value:"turquoise",color:"from-cyan-400 to-blue-500"}].map(E=>{var W,X,te;return m.jsxs("button",{onClick:()=>p(E.value),className:"flex items-center space-x-3 p-3 rounded-xl border transition-all duration-200",style:{border:h===E.value?`2px solid ${((W=T.cssVars)==null?void 0:W.primary)||"#1db954"}`:"1px solid rgba(255,255,255,0.2)",background:h===E.value?`linear-gradient(135deg, ${((X=T.cssVars)==null?void 0:X.primary)||"#1db954"}15 0%, ${((te=T.cssVars)==null?void 0:te.secondary)||"#1ed760"}10 100%)`:"rgba(255,255,255,0.02)"},onMouseEnter:G=>{var be;h!==E.value?(G.currentTarget.style.background="rgba(255,255,255,0.08)",G.currentTarget.style.border="1px solid rgba(255,255,255,0.4)",G.currentTarget.style.transform="translateY(-2px)",G.currentTarget.style.boxShadow="0 4px 12px rgba(0,0,0,0.3)"):(G.currentTarget.style.transform="translateY(-1px)",G.currentTarget.style.boxShadow=`0 6px 20px ${((be=T.cssVars)==null?void 0:be.primary)||"#1db954"}30`)},onMouseLeave:G=>{h!==E.value?(G.currentTarget.style.background="rgba(255,255,255,0.02)",G.currentTarget.style.border="1px solid rgba(255,255,255,0.2)",G.currentTarget.style.transform="translateY(0)",G.currentTarget.style.boxShadow="none"):(G.currentTarget.style.transform="translateY(0)",G.currentTarget.style.boxShadow="none")},children:[m.jsx("div",{className:`w-5 h-5 rounded-full bg-gradient-to-r ${E.color} shadow-sm`}),m.jsx("span",{className:"text-white text-sm font-medium",children:E.name})]},E.value)})})})]})]})})]})]})]})};var Jg={exports:{}};(function(e){var t=function(){var n="https://api.spotify.com/v1",r=null,s=null,i=function(u,h){return u.abort=h,u},o=function(u,h){var p;if(s!==null){var g=s.defer();u(function(x){g.resolve(x)},function(x){g.reject(x)}),p=g.promise}else window.Promise&&(p=new window.Promise(u));return p?new i(p,h):null},a=function(){var u=Array.prototype.slice.call(arguments),h=u[0],p=u.slice(1);return h=h||{},p.forEach(function(g){for(var x in g)g.hasOwnProperty(x)&&(h[x]=g[x])}),h},l=function(u,h){var p="";for(var g in h)if(h.hasOwnProperty(g)){var x=h[g];p+=encodeURIComponent(g)+"="+encodeURIComponent(x)+"&"}return p.length>0&&(p=p.substring(0,p.length-1),u=u+"?"+p),u},c=function(u,h){var p=new XMLHttpRequest,g=function(x,v){function y(C){x&&x(C),h&&h(null,C)}function w(){v&&v(p),h&&h(p,null)}var b=u.type||"GET";if(p.open(b,l(u.url,u.params)),r&&p.setRequestHeader("Authorization","Bearer "+r),p.onreadystatechange=function(){if(p.readyState===4){var C=null;try{C=p.responseText?JSON.parse(p.responseText):""}catch(P){console.error(P)}p.status>=200&&p.status<300?y(C):w()}},b==="GET")p.send(null);else{var S=null;u.postData&&(u.contentType==="image/jpeg"?(S=u.postData,p.setRequestHeader("Content-Type",u.contentType)):(S=JSON.stringify(u.postData),p.setRequestHeader("Content-Type","application/json"))),p.send(S)}};return h?(g(),null):o(g,function(){p.abort()})},d=function(u,h,p,g){var x={},v=null;typeof h=="object"?(x=h,v=p):typeof h=="function"&&(v=h);var y=u.type||"GET";return y!=="GET"&&u.postData&&!g?u.postData=a(u.postData,x):u.params=a(u.params,x),c(u,v)},f=function(){};return f.prototype={constructor:t},f.prototype.getGeneric=function(u,h){var p={url:u};return d(p,h)},f.prototype.getMe=function(u,h){var p={url:n+"/me"};return d(p,u,h)},f.prototype.getMySavedTracks=function(u,h){var p={url:n+"/me/tracks"};return d(p,u,h)},f.prototype.addToMySavedTracks=function(u,h,p){var g={url:n+"/me/tracks",type:"PUT",postData:u};return d(g,h,p)},f.prototype.removeFromMySavedTracks=function(u,h,p){var g={url:n+"/me/tracks",type:"DELETE",postData:u};return d(g,h,p)},f.prototype.containsMySavedTracks=function(u,h,p){var g={url:n+"/me/tracks/contains",params:{ids:u.join(",")}};return d(g,h,p)},f.prototype.getMySavedAlbums=function(u,h){var p={url:n+"/me/albums"};return d(p,u,h)},f.prototype.addToMySavedAlbums=function(u,h,p){var g={url:n+"/me/albums",type:"PUT",postData:u};return d(g,h,p)},f.prototype.removeFromMySavedAlbums=function(u,h,p){var g={url:n+"/me/albums",type:"DELETE",postData:u};return d(g,h,p)},f.prototype.containsMySavedAlbums=function(u,h,p){var g={url:n+"/me/albums/contains",params:{ids:u.join(",")}};return d(g,h,p)},f.prototype.getMyTopArtists=function(u,h){var p={url:n+"/me/top/artists"};return d(p,u,h)},f.prototype.getMyTopTracks=function(u,h){var p={url:n+"/me/top/tracks"};return d(p,u,h)},f.prototype.getMyRecentlyPlayedTracks=function(u,h){var p={url:n+"/me/player/recently-played"};return d(p,u,h)},f.prototype.followUsers=function(u,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:u.join(","),type:"user"}};return d(p,h)},f.prototype.followArtists=function(u,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:u.join(","),type:"artist"}};return d(p,h)},f.prototype.followPlaylist=function(u,h,p){var g={url:n+"/playlists/"+u+"/followers",type:"PUT",postData:{}};return d(g,h,p)},f.prototype.unfollowUsers=function(u,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:u.join(","),type:"user"}};return d(p,h)},f.prototype.unfollowArtists=function(u,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:u.join(","),type:"artist"}};return d(p,h)},f.prototype.unfollowPlaylist=function(u,h){var p={url:n+"/playlists/"+u+"/followers",type:"DELETE"};return d(p,h)},f.prototype.isFollowingUsers=function(u,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:u.join(","),type:"user"}};return d(p,h)},f.prototype.isFollowingArtists=function(u,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:u.join(","),type:"artist"}};return d(p,h)},f.prototype.areFollowingPlaylist=function(u,h,p){var g={url:n+"/playlists/"+u+"/followers/contains",type:"GET",params:{ids:h.join(",")}};return d(g,p)},f.prototype.getFollowedArtists=function(u,h){var p={url:n+"/me/following",type:"GET",params:{type:"artist"}};return d(p,u,h)},f.prototype.getUser=function(u,h,p){var g={url:n+"/users/"+encodeURIComponent(u)};return d(g,h,p)},f.prototype.getUserPlaylists=function(u,h,p){var g;return typeof u=="string"?g={url:n+"/users/"+encodeURIComponent(u)+"/playlists"}:(g={url:n+"/me/playlists"},p=h,h=u),d(g,h,p)},f.prototype.getPlaylist=function(u,h,p){var g={url:n+"/playlists/"+u};return d(g,h,p)},f.prototype.getPlaylistTracks=function(u,h,p){var g={url:n+"/playlists/"+u+"/tracks"};return d(g,h,p)},f.prototype.getPlaylistCoverImage=function(u,h){var p={url:n+"/playlists/"+u+"/images"};return d(p,h)},f.prototype.createPlaylist=function(u,h,p){var g={url:n+"/users/"+encodeURIComponent(u)+"/playlists",type:"POST",postData:h};return d(g,h,p)},f.prototype.changePlaylistDetails=function(u,h,p){var g={url:n+"/playlists/"+u,type:"PUT",postData:h};return d(g,h,p)},f.prototype.addTracksToPlaylist=function(u,h,p,g){var x={url:n+"/playlists/"+u+"/tracks",type:"POST",postData:{uris:h}};return d(x,p,g,!0)},f.prototype.replaceTracksInPlaylist=function(u,h,p){var g={url:n+"/playlists/"+u+"/tracks",type:"PUT",postData:{uris:h}};return d(g,{},p)},f.prototype.reorderTracksInPlaylist=function(u,h,p,g,x){var v={url:n+"/playlists/"+u+"/tracks",type:"PUT",postData:{range_start:h,insert_before:p}};return d(v,g,x)},f.prototype.removeTracksFromPlaylist=function(u,h,p){var g=h.map(function(v){return typeof v=="string"?{uri:v}:v}),x={url:n+"/playlists/"+u+"/tracks",type:"DELETE",postData:{tracks:g}};return d(x,{},p)},f.prototype.removeTracksFromPlaylistWithSnapshotId=function(u,h,p,g){var x=h.map(function(y){return typeof y=="string"?{uri:y}:y}),v={url:n+"/playlists/"+u+"/tracks",type:"DELETE",postData:{tracks:x,snapshot_id:p}};return d(v,{},g)},f.prototype.removeTracksFromPlaylistInPositions=function(u,h,p,g){var x={url:n+"/playlists/"+u+"/tracks",type:"DELETE",postData:{positions:h,snapshot_id:p}};return d(x,{},g)},f.prototype.uploadCustomPlaylistCoverImage=function(u,h,p){var g={url:n+"/playlists/"+u+"/images",type:"PUT",postData:h.replace(/^data:image\/jpeg;base64,/,""),contentType:"image/jpeg"};return d(g,{},p)},f.prototype.getAlbum=function(u,h,p){var g={url:n+"/albums/"+u};return d(g,h,p)},f.prototype.getAlbumTracks=function(u,h,p){var g={url:n+"/albums/"+u+"/tracks"};return d(g,h,p)},f.prototype.getAlbums=function(u,h,p){var g={url:n+"/albums/",params:{ids:u.join(",")}};return d(g,h,p)},f.prototype.getTrack=function(u,h,p){var g={};return g.url=n+"/tracks/"+u,d(g,h,p)},f.prototype.getTracks=function(u,h,p){var g={url:n+"/tracks/",params:{ids:u.join(",")}};return d(g,h,p)},f.prototype.getArtist=function(u,h,p){var g={url:n+"/artists/"+u};return d(g,h,p)},f.prototype.getArtists=function(u,h,p){var g={url:n+"/artists/",params:{ids:u.join(",")}};return d(g,h,p)},f.prototype.getArtistAlbums=function(u,h,p){var g={url:n+"/artists/"+u+"/albums"};return d(g,h,p)},f.prototype.getArtistTopTracks=function(u,h,p,g){var x={url:n+"/artists/"+u+"/top-tracks",params:{country:h}};return d(x,p,g)},f.prototype.getArtistRelatedArtists=function(u,h,p){var g={url:n+"/artists/"+u+"/related-artists"};return d(g,h,p)},f.prototype.getFeaturedPlaylists=function(u,h){var p={url:n+"/browse/featured-playlists"};return d(p,u,h)},f.prototype.getNewReleases=function(u,h){var p={url:n+"/browse/new-releases"};return d(p,u,h)},f.prototype.getCategories=function(u,h){var p={url:n+"/browse/categories"};return d(p,u,h)},f.prototype.getCategory=function(u,h,p){var g={url:n+"/browse/categories/"+u};return d(g,h,p)},f.prototype.getCategoryPlaylists=function(u,h,p){var g={url:n+"/browse/categories/"+u+"/playlists"};return d(g,h,p)},f.prototype.search=function(u,h,p,g){var x={url:n+"/search/",params:{q:u,type:h.join(",")}};return d(x,p,g)},f.prototype.searchAlbums=function(u,h,p){return this.search(u,["album"],h,p)},f.prototype.searchArtists=function(u,h,p){return this.search(u,["artist"],h,p)},f.prototype.searchTracks=function(u,h,p){return this.search(u,["track"],h,p)},f.prototype.searchPlaylists=function(u,h,p){return this.search(u,["playlist"],h,p)},f.prototype.searchShows=function(u,h,p){return this.search(u,["show"],h,p)},f.prototype.searchEpisodes=function(u,h,p){return this.search(u,["episode"],h,p)},f.prototype.getAudioFeaturesForTrack=function(u,h){var p={};return p.url=n+"/audio-features/"+u,d(p,{},h)},f.prototype.getAudioFeaturesForTracks=function(u,h){var p={url:n+"/audio-features",params:{ids:u}};return d(p,{},h)},f.prototype.getAudioAnalysisForTrack=function(u,h){var p={};return p.url=n+"/audio-analysis/"+u,d(p,{},h)},f.prototype.getRecommendations=function(u,h){var p={url:n+"/recommendations"};return d(p,u,h)},f.prototype.getAvailableGenreSeeds=function(u){var h={url:n+"/recommendations/available-genre-seeds"};return d(h,{},u)},f.prototype.getMyDevices=function(u){var h={url:n+"/me/player/devices"};return d(h,{},u)},f.prototype.getMyCurrentPlaybackState=function(u,h){var p={url:n+"/me/player"};return d(p,u,h)},f.prototype.getMyCurrentPlayingTrack=function(u,h){var p={url:n+"/me/player/currently-playing"};return d(p,u,h)},f.prototype.transferMyPlayback=function(u,h,p){var g=h||{};g.device_ids=u;var x={type:"PUT",url:n+"/me/player",postData:g};return d(x,h,p)},f.prototype.play=function(u,h){u=u||{};var p="device_id"in u?{device_id:u.device_id}:null,g={};["context_uri","uris","offset","position_ms"].forEach(function(y){y in u&&(g[y]=u[y])});var x={type:"PUT",url:n+"/me/player/play",params:p,postData:g},v=typeof u=="function"?u:{};return d(x,v,h)},f.prototype.queue=function(u,h,p){h=h||{};var g="device_id"in h?{uri:u,device_id:h.device_id}:{uri:u},x={type:"POST",url:n+"/me/player/queue",params:g};return d(x,h,p)},f.prototype.pause=function(u,h){u=u||{};var p="device_id"in u?{device_id:u.device_id}:null,g={type:"PUT",url:n+"/me/player/pause",params:p};return d(g,u,h)},f.prototype.skipToNext=function(u,h){u=u||{};var p="device_id"in u?{device_id:u.device_id}:null,g={type:"POST",url:n+"/me/player/next",params:p};return d(g,u,h)},f.prototype.skipToPrevious=function(u,h){u=u||{};var p="device_id"in u?{device_id:u.device_id}:null,g={type:"POST",url:n+"/me/player/previous",params:p};return d(g,u,h)},f.prototype.seek=function(u,h,p){h=h||{};var g={position_ms:u};"device_id"in h&&(g.device_id=h.device_id);var x={type:"PUT",url:n+"/me/player/seek",params:g};return d(x,h,p)},f.prototype.setRepeat=function(u,h,p){h=h||{};var g={state:u};"device_id"in h&&(g.device_id=h.device_id);var x={type:"PUT",url:n+"/me/player/repeat",params:g};return d(x,h,p)},f.prototype.setVolume=function(u,h,p){h=h||{};var g={volume_percent:u};"device_id"in h&&(g.device_id=h.device_id);var x={type:"PUT",url:n+"/me/player/volume",params:g};return d(x,h,p)},f.prototype.setShuffle=function(u,h,p){h=h||{};var g={state:u};"device_id"in h&&(g.device_id=h.device_id);var x={type:"PUT",url:n+"/me/player/shuffle",params:g};return d(x,h,p)},f.prototype.getShow=function(u,h,p){var g={};return g.url=n+"/shows/"+u,d(g,h,p)},f.prototype.getShows=function(u,h,p){var g={url:n+"/shows/",params:{ids:u.join(",")}};return d(g,h,p)},f.prototype.getMySavedShows=function(u,h){var p={url:n+"/me/shows"};return d(p,u,h)},f.prototype.addToMySavedShows=function(u,h,p){var g={url:n+"/me/shows",type:"PUT",postData:u};return d(g,h,p)},f.prototype.removeFromMySavedShows=function(u,h,p){var g={url:n+"/me/shows",type:"DELETE",postData:u};return d(g,h,p)},f.prototype.containsMySavedShows=function(u,h,p){var g={url:n+"/me/shows/contains",params:{ids:u.join(",")}};return d(g,h,p)},f.prototype.getShowEpisodes=function(u,h,p){var g={url:n+"/shows/"+u+"/episodes"};return d(g,h,p)},f.prototype.getEpisode=function(u,h,p){var g={};return g.url=n+"/episodes/"+u,d(g,h,p)},f.prototype.getEpisodes=function(u,h,p){var g={url:n+"/episodes/",params:{ids:u.join(",")}};return d(g,h,p)},f.prototype.getAccessToken=function(){return r},f.prototype.setAccessToken=function(u){r=u},f.prototype.setPromiseImplementation=function(u){var h=!1;try{var p=new u(function(g){g()});typeof p.then=="function"&&typeof p.catch=="function"&&(h=!0)}catch(g){console.error(g)}if(h)s=u;else throw new Error("Unsupported implementation of Promises/A+")},f}();e.exports=t})(Jg);var e6=Jg.exports;const t6=cu(e6),n6="7cab80d02df44a5bb96725be60a45875",ey="https://159.195.9.107:3443/callback.html";console.log("πŸ” Debug - Current redirect URI:",ey);console.log("πŸ” Debug - Environment VITE_REDIRECT_URI:","https://159.195.9.107:3443/callback.html");const jo=new t6,r6=()=>{const e=["user-read-private","user-read-email","user-read-recently-played","user-top-read","playlist-read-private","playlist-read-collaborative","playlist-modify-public","playlist-modify-private","user-read-playback-state","user-modify-playback-state","user-read-currently-playing","ugc-image-upload"].join(" "),n=`https://accounts.spotify.com/authorize?${new URLSearchParams({client_id:n6,response_type:"code",redirect_uri:ey,scope:e,show_dialog:"true"}).toString()}`;return console.log("πŸ” Debug - Generated Spotify Auth URL:",n),n},s6=async(e,t)=>{jo.setAccessToken(e),await jo.play({uris:[t]})},i6=async e=>{jo.setAccessToken(e),await jo.pause()},o6=()=>{const[e,t]=k.useState(!1),n=()=>{t(!0),window.location.href=r6()},r=[{icon:vt,title:"Last Listened",description:"Discover what your partner is listening to right now and play it instantly"},{icon:Yn,title:"Mixed Playlist",description:"AI-powered playlists that blend your musical tastes perfectly"},{icon:Xe,title:"Memory Lane",description:"Create beautiful musical memories and shared experiences together"}];return m.jsx("div",{className:"min-h-screen flex items-center justify-center px-4 bg-black",children:m.jsxs("div",{className:"max-w-4xl w-full relative",children:[m.jsxs(O.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{duration:.8},className:"text-center mb-12",children:[m.jsx(O.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,type:"spring",stiffness:200},className:"w-20 h-20 mx-auto mb-6 bg-gradient-to-br from-pink-500 to-red-500 rounded-full flex items-center justify-center",children:m.jsx(Xe,{className:"w-10 h-10 text-white"})}),m.jsxs("h1",{className:"text-5xl md:text-6xl font-bold mb-4",children:[m.jsx("span",{className:"gradient-text",children:"Our Musical"}),m.jsx("br",{}),m.jsx("span",{className:"text-white",children:"Journey"})]}),m.jsx("p",{className:"text-xl text-white/70 max-w-2xl mx-auto leading-relaxed",children:"A private space where two hearts connect through music. Discover, share, and create beautiful musical memories together."})]}),m.jsx(O.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{delay:.4,duration:.8},className:"grid md:grid-cols-3 gap-6 mb-12",children:r.map((s,i)=>m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5+i*.1},whileHover:{y:-8,scale:1.03},className:"glass-bubble rounded-3xl p-8 text-center group cursor-pointer",children:[m.jsx(O.div,{whileHover:{rotate:15,scale:1.15},className:"w-16 h-16 mx-auto mb-6 bg-gradient-to-br from-purple-500/30 via-blue-500/30 to-pink-500/30 rounded-2xl flex items-center justify-center backdrop-blur-sm",children:m.jsx(s.icon,{className:"w-8 h-8 text-white"})}),m.jsx("h3",{className:"text-2xl font-bold text-white mb-3",children:s.title}),m.jsx("p",{className:"text-white/70 text-sm leading-relaxed",children:s.description})]},s.title))}),m.jsxs(O.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.8,duration:.6},className:"glass-fluid rounded-3xl p-10 max-w-lg mx-auto",children:[m.jsxs("div",{className:"text-center mb-8",children:[m.jsx(O.div,{initial:{scale:0},animate:{scale:1},transition:{delay:1,type:"spring",stiffness:200},className:"w-20 h-20 mx-auto mb-6 bg-gradient-to-br from-purple-500/30 via-blue-500/30 to-pink-500/30 rounded-2xl flex items-center justify-center backdrop-blur-sm",children:m.jsx(Hg,{className:"w-10 h-10 text-white"})}),m.jsx("h2",{className:"text-3xl font-bold text-white mb-3",children:"Begin Your Journey"}),m.jsx("p",{className:"text-white/70 text-lg",children:"Connect your Spotify account to start your musical love story"})]}),m.jsx(O.button,{whileHover:{scale:1.05,boxShadow:"0 15px 40px rgba(147, 51, 234, 0.4)"},whileTap:{scale:.95},onClick:n,disabled:e,className:"w-full bg-gradient-to-r from-purple-600 via-blue-600 to-pink-600 hover:from-purple-700 hover:via-blue-700 hover:to-pink-700 text-white font-bold py-5 px-8 rounded-2xl transition-all duration-300 flex items-center justify-center space-x-3 disabled:opacity-50 shadow-2xl",children:e?m.jsx("div",{className:"w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin"}):m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-lg",children:"Connect with Spotify"}),m.jsx(lk,{className:"w-6 h-6"})]})}),m.jsx("p",{className:"text-sm text-white/60 text-center mt-6 leading-relaxed",children:"We'll only access your listening history and playlist data to create your personalized musical journey"})]}),m.jsx(O.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:1,duration:.6},className:"text-center mt-12",children:m.jsx("p",{className:"text-white/40 text-sm",children:"Made with πŸ’• for a special someone"})})]})})},a6=()=>{var P,j,D,T,z,V,U,R,Q,A,q,_,N,F,L,E,W,X,te,G,be,ri,Jn,Mn,wt,ta,Dc;const{currentUser:e,partnerUser:t,theme:n}=ae(),r=Vr(n),[s,i]=k.useState([]),[o,a]=k.useState(!1),[l,c]=k.useState(null),[d,f]=k.useState(""),[u,h]=k.useState(!1),[p,g]=k.useState(null),[x,v]=k.useState(null);k.useEffect(()=>{let $;const me=async()=>{var Pe,Te,nt;try{const er=(Pe=e==null?void 0:e.user)==null?void 0:Pe.id;if(er){const na=await se(`/users/${er}/recently-played`),Wr=ae.getState().currentUser;Wr&&ae.getState().setCurrentUser({...Wr,recentlyPlayed:na})}const Rc=(nt=(Te=ae.getState().partnerUser)==null?void 0:Te.user)==null?void 0:nt.id;if(Rc){const na=await se(`/users/${Rc}/recently-played`),Wr=ae.getState().partnerUser;Wr&&ae.getState().setPartnerUser({...Wr,recentlyPlayed:na})}}catch{}$=setTimeout(me,3e4)};return me(),()=>clearTimeout($)},[(P=e==null?void 0:e.user)==null?void 0:P.id,(j=t==null?void 0:t.user)==null?void 0:j.id]),k.useEffect(()=>{(async()=>{var me;if((me=e==null?void 0:e.user)!=null&&me.id){a(!0);try{const Pe=await se(`/partners/requests/${e.user.id}`);i(Pe)}catch{i([])}finally{a(!1)}}})()},[(D=e==null?void 0:e.user)==null?void 0:D.id]),k.useEffect(()=>{let $;const me=async()=>{var Te;if((Te=e==null?void 0:e.user)!=null&&Te.id)try{const nt=await se(`/users/${e.user.id}/status`);c(nt)}catch{}},Pe=()=>{if(!(l!=null&&l.nextSyncAt)){f("");return}const Te=l.nextSyncAt-Date.now();if(Te<=0){f("now");return}const nt=Math.floor(Te/6e4),er=Math.floor(Te%6e4/1e3);f(`${nt}m ${er}s`)};return me(),$=setInterval(()=>{Pe()},1e3),()=>clearInterval($)},[(T=e==null?void 0:e.user)==null?void 0:T.id,l==null?void 0:l.nextSyncAt]),k.useEffect(()=>{let $;const me=async()=>{var Pe,Te;try{const nt=(Pe=e==null?void 0:e.user)==null?void 0:Pe.id;nt&&(g(await se(`/users/${nt}/now-playing`)),(Te=t==null?void 0:t.user)!=null&&Te.id?v(await se(`/users/${t.user.id}/now-playing`)):v(null))}catch{}$=setTimeout(me,8e3)};return me(),()=>clearTimeout($)},[(z=e==null?void 0:e.user)==null?void 0:z.id,(V=t==null?void 0:t.user)==null?void 0:V.id]);const y=async()=>{var $;if(($=e==null?void 0:e.user)!=null&&$.id){h(!0);try{await Pt(`/users/${e.user.id}/sync`);const me=await se(`/users/${e.user.id}/status`);c(me);const[Pe,Te]=await Promise.all([se(`/users/${e.user.id}/recently-played`),se(`/users/${e.user.id}/top-tracks?time_range=short_term`)]),nt=ae.getState().currentUser;nt&&ae.getState().setCurrentUser({...nt,recentlyPlayed:Pe,topTracks:Te.map(er=>er.track)}),he.success("Synced latest data")}catch{he.error("Failed to sync")}finally{h(!1)}}},w=async $=>{await Pt(`/partners/requests/${$}/accept`),i(me=>me.filter(Pe=>Pe.id!==$))},b=async $=>{await Pt(`/partners/requests/${$}/decline`),i(me=>me.filter(Pe=>Pe.id!==$))},S=[{title:"Last Listened",description:"See what your partner is listening to right now",icon:vt,href:"/last-listened",primaryColor:((U=r.cssVars)==null?void 0:U.primary)||"#1db954",secondaryColor:((R=r.cssVars)==null?void 0:R.secondary)||"#1ed760",accentColor:((Q=r.cssVars)==null?void 0:Q.accent)||"#00e676"},{title:"Mixed Playlist",description:"Create AI-powered playlists blending both your tastes",icon:Ug,href:"/mixed-playlist",primaryColor:((A=r.cssVars)==null?void 0:A.secondary)||"#1ed760",secondaryColor:((q=r.cssVars)==null?void 0:q.accent)||"#00e676",accentColor:((_=r.cssVars)==null?void 0:_.primary)||"#1db954"},{title:"Memory Lane",description:"Your shared musical journey and memories",icon:Yn,href:"/memory-lane",primaryColor:((N=r.cssVars)==null?void 0:N.accent)||"#00e676",secondaryColor:((F=r.cssVars)==null?void 0:F.primary)||"#1db954",accentColor:((L=r.cssVars)==null?void 0:L.secondary)||"#1ed760"}],C=()=>{var $;return($=e==null?void 0:e.recentlyPlayed)!=null&&$[0]?Pr(e.recentlyPlayed[0].played_at):null};return m.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:[m.jsxs("h1",{className:"text-4xl font-bold text-white mb-2",children:["Welcome back, ",m.jsx("span",{className:"gradient-text",children:(E=e==null?void 0:e.user)==null?void 0:E.display_name})]}),m.jsx("p",{className:"text-white/70 text-lg",children:"Ready to explore your musical connection together?"})]}),m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"grid md:grid-cols-2 gap-6 mb-8",children:[m.jsxs("div",{className:"glass rounded-2xl p-6",children:[m.jsx("div",{className:"text-white/70 mb-2",children:"You"}),p!=null&&p.is_playing&&(p!=null&&p.item)?m.jsxs("div",{className:"flex items-center gap-4",children:[m.jsx("img",{src:((te=(X=(W=p.item.album)==null?void 0:W.images)==null?void 0:X[0])==null?void 0:te.url)||"/placeholder-album.png",className:"w-14 h-14 rounded"}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"text-white font-semibold truncate",children:p.item.name}),m.jsx("div",{className:"text-white/70 text-sm truncate",children:(G=p.item.artists)==null?void 0:G.map($=>$.name).join(", ")})]})]}):m.jsx("div",{className:"text-white/50",children:"Not playing"})]}),m.jsxs("div",{className:"glass rounded-2xl p-6",children:[m.jsx("div",{className:"text-white/70 mb-2",children:"Partner"}),x!=null&&x.is_playing&&(x!=null&&x.item)?m.jsxs("div",{className:"flex items-center gap-4",children:[m.jsx("img",{src:((Jn=(ri=(be=x.item.album)==null?void 0:be.images)==null?void 0:ri[0])==null?void 0:Jn.url)||"/placeholder-album.png",className:"w-14 h-14 rounded"}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"text-white font-semibold truncate",children:x.item.name}),m.jsx("div",{className:"text-white/70 text-sm truncate",children:(Mn=x.item.artists)==null?void 0:Mn.map($=>$.name).join(", ")})]})]}):m.jsx("div",{className:"text-white/50",children:"Not playing"})]})]}),m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"mb-8",children:[m.jsxs("div",{className:"flex items-center justify-between mb-4",children:[m.jsx("div",{className:"text-white/70 text-sm",children:(l==null?void 0:l.lastSyncedAt)&&m.jsxs("span",{children:["Last sync: ",new Date(l.lastSyncedAt).toLocaleTimeString()," β€’ Next in: ",d||"β€”"]})}),m.jsx("button",{onClick:y,disabled:u,className:"bg-white/10 hover:bg-white/20 text-white px-4 py-2 rounded-lg text-sm disabled:opacity-50",children:u?"Refreshing…":"Hard Refresh"})]}),t?m.jsx("div",{className:"glass-bubble rounded-3xl p-8 border border-spotify-green/30 glow",children:m.jsxs("div",{className:"flex items-center space-x-6",children:[m.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-spotify-green to-green-600 rounded-2xl flex items-center justify-center",children:m.jsx(Xe,{className:"w-8 h-8 text-white"})}),m.jsxs("div",{children:[m.jsxs("h3",{className:"text-xl font-semibold text-white",children:["Connected with ",(wt=t.user)==null?void 0:wt.display_name]}),m.jsx("p",{className:"text-white/70",children:"Your musical journey is ready to begin! πŸ’•"})]})]})}):m.jsx("div",{className:"glass-bubble rounded-3xl p-8 border border-orange-500/30",children:m.jsxs("div",{className:"flex items-center space-x-6",children:[m.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-orange-500 to-red-500 rounded-2xl flex items-center justify-center",children:m.jsx(Ac,{className:"w-8 h-8 text-white"})}),m.jsxs("div",{children:[m.jsx("h3",{className:"text-xl font-semibold text-white",children:"Invite your partner"}),m.jsx("p",{className:"text-white/70 mb-2",children:"Ask your partner to search you in the app and send a request."}),o?m.jsx("div",{className:"text-white/60",children:"Loading requests..."}):s.length>0?m.jsx("div",{className:"space-y-3",children:s.map($=>m.jsxs("div",{className:"flex items-center justify-between bg-white/5 rounded-lg p-3",children:[m.jsxs("div",{className:"text-white/80 text-sm",children:["Request from ",$.from_user_id]}),m.jsxs("div",{className:"space-x-2",children:[m.jsx("button",{onClick:()=>w($.id),className:"bg-spotify-green hover:bg-spotify-green/90 text-white px-3 py-1 rounded-md text-sm",children:"Accept"}),m.jsx("button",{onClick:()=>b($.id),className:"bg-white/10 hover:bg-white/20 text-white px-3 py-1 rounded-md text-sm",children:"Decline"})]})]},$.id))}):m.jsx("div",{className:"text-white/60 text-sm",children:"No incoming requests yet"})]})]})})]}),m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[m.jsx("div",{className:"glass-bubble rounded-2xl p-6",children:m.jsxs("div",{className:"flex items-center space-x-4",children:[m.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500/30 to-cyan-500/30 rounded-xl flex items-center justify-center",children:m.jsx(Po,{className:"w-6 h-6 text-blue-400"})}),m.jsxs("div",{children:[m.jsx("p",{className:"text-white/70 text-sm",children:"Your last played"}),m.jsx("p",{className:"text-white font-semibold",children:C()||"No recent plays"})]})]})}),m.jsx("div",{className:"glass-bubble rounded-2xl p-6",children:m.jsxs("div",{className:"flex items-center space-x-4",children:[m.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-green-500/30 to-emerald-500/30 rounded-xl flex items-center justify-center",children:m.jsx(gk,{className:"w-6 h-6 text-green-400"})}),m.jsxs("div",{children:[m.jsx("p",{className:"text-white/70 text-sm",children:"Top tracks analyzed"}),m.jsxs("p",{className:"text-white font-semibold",children:[((ta=e==null?void 0:e.topTracks)==null?void 0:ta.length)||0," songs"]})]})]})}),m.jsx("div",{className:"glass-bubble rounded-2xl p-6",children:m.jsxs("div",{className:"flex items-center space-x-4",children:[m.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-purple-500/30 to-pink-500/30 rounded-xl flex items-center justify-center",children:m.jsx(Ss,{className:"w-6 h-6 text-purple-400"})}),m.jsxs("div",{children:[m.jsx("p",{className:"text-white/70 text-sm",children:"Recently played"}),m.jsxs("p",{className:"text-white font-semibold",children:[((Dc=e==null?void 0:e.recentlyPlayed)==null?void 0:Dc.length)||0," tracks"]})]})]})})]}),m.jsx(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},className:"grid md:grid-cols-3 gap-6",children:S.map(($,me)=>m.jsx(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4+me*.1},whileHover:{y:-5,scale:1.02},children:m.jsx(zi,{to:$.href,children:m.jsxs("div",{className:`glass rounded-2xl p-6 h-full border ${$.borderColor} group cursor-pointer transition-all duration-300 hover:shadow-xl`,children:[m.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center mb-4 group-hover:scale-110 transition-transform duration-300",style:{background:`linear-gradient(135deg, ${$.primaryColor}20 0%, ${$.secondaryColor}10 100%)`,border:`1px solid ${$.primaryColor}30`},children:m.jsx($.icon,{className:"w-6 h-6",style:{color:$.primaryColor}})}),m.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:$.title}),m.jsx("p",{className:"text-white/70 text-sm leading-relaxed mb-4",children:$.description}),m.jsx("div",{className:"w-full h-1 rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:`linear-gradient(90deg, ${$.primaryColor} 0%, ${$.secondaryColor} 100%)`}})]})})},$.title))}),(e==null?void 0:e.recentlyPlayed)&&e.recentlyPlayed.length>0&&m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.6},className:"mt-8",children:[m.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"Your Recent Activity"}),m.jsx("div",{className:"glass rounded-2xl p-6",children:m.jsx("div",{className:"space-y-4",children:e.recentlyPlayed.slice(0,3).map(($,me)=>{var Pe,Te;return m.jsxs(O.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.7+me*.1},className:"flex items-center space-x-4 p-3 rounded-lg hover:bg-white/5 transition-colors",children:[m.jsx("img",{src:((Pe=$.track.album.images[0])==null?void 0:Pe.url)||"/placeholder-album.png",alt:$.track.album.name,className:"w-12 h-12 rounded-lg object-cover"}),m.jsxs("div",{className:"flex-1",children:[m.jsx("h4",{className:"text-white font-medium",children:$.track.name}),m.jsx("p",{className:"text-white/70 text-sm",children:(Te=$.track.artists[0])==null?void 0:Te.name})]}),m.jsx("div",{className:"text-white/50 text-sm",children:Pr($.played_at)})]},$.track.id)})})})]})]})};let ji=!1;const Rh=()=>{const[e]=Ax(),t=Wo(),{setCurrentUser:n,setPartnerUser:r,currentUser:s}=ae(),[i,o]=k.useState("loading"),[a,l]=k.useState("");k.useEffect(()=>{(async()=>{if(ji){console.log("πŸ” CallbackPage - Already processing globally, skipping...");return}ji=!0,console.log("πŸ” CallbackPage - Global processing flag set to TRUE");try{const u=e.get("code"),h=e.get("error");if(console.log("πŸ” CallbackPage - Code:",u),console.log("πŸ” CallbackPage - Error:",h),h)throw new Error("Spotify authorization was denied");if(!u)throw new Error("No authorization code received");l("Exchanging authorization code..."),console.log("πŸ” CallbackPage - Exchanging code with backend...");const p=await pb("/auth/exchange",{code:u});l("Syncing your music data..."),await Pt(`/users/${p.uid}/sync`,void 0,p.token),l("Loading your profile...");const[g,x,v]=await Promise.all([se(`/users/${p.uid}`),se(`/users/${p.uid}/recently-played`),se(`/users/${p.uid}/top-tracks?time_range=short_term`)]),y={user:g,accessToken:p.access_token,refreshToken:p.refresh_token,isAuthenticated:!0,recentlyPlayed:x,topTracks:v.map(w=>w.track),topArtists:[],jwt:p.token};localStorage.setItem("spotify-user",JSON.stringify(y)),s?(r(y),localStorage.setItem("spotify-partner",JSON.stringify(y)),l("Partner connected! Your musical journey begins...")):(n(y),l("Welcome! Setting up your musical journey...")),o("success"),he.success(s?"Partner connected successfully!":"Successfully connected to Spotify!",{duration:3e3}),setTimeout(()=>{t("/"),setTimeout(()=>{ji=!1,console.log("πŸ” CallbackPage - Global processing flag set to FALSE (after success)")},1e3)},2e3)}catch(u){console.error("πŸ” CallbackPage - ERROR:",u),console.error("πŸ” CallbackPage - Error details:",{message:u instanceof Error?u.message:"Unknown error",stack:u instanceof Error?u.stack:void 0}),o("error"),l(u instanceof Error?u.message:"An unexpected error occurred"),he.error("Failed to connect to Spotify. Please try again."),setTimeout(()=>{t("/"),setTimeout(()=>{ji=!1,console.log("πŸ” CallbackPage - Global processing flag set to FALSE (after error)")},1e3)},3e3)}})()},[e,t,n,r,s]);const c=()=>{switch(i){case"loading":return m.jsx(fk,{className:"w-12 h-12 text-spotify-green animate-spin"});case"success":return m.jsx(dk,{className:"w-12 h-12 text-green-400"});case"error":return m.jsx(xk,{className:"w-12 h-12 text-red-400"})}},d=()=>{switch(i){case"loading":return"border-spotify-green/30";case"success":return"border-green-400/30";case"error":return"border-red-400/30"}};return m.jsx("div",{className:"min-h-screen flex items-center justify-center px-4 bg-black",children:m.jsxs(O.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"glass-fluid rounded-3xl p-10 max-w-md w-full text-center",children:[m.jsx(O.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,type:"spring",stiffness:200},className:`w-20 h-20 mx-auto mb-6 rounded-full border-2 flex items-center justify-center ${d()}`,children:c()}),m.jsxs(O.h2,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},className:"text-2xl font-bold text-white mb-4",children:[i==="loading"&&"Connecting...",i==="success"&&"Success!",i==="error"&&"Connection Failed"]}),m.jsx(O.p,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:"text-white/70 mb-6",children:a}),i==="loading"&&m.jsx(O.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},className:"w-full bg-white/10 rounded-full h-2 mb-4",children:m.jsx(O.div,{className:"bg-spotify-green h-2 rounded-full",initial:{width:0},animate:{width:"100%"},transition:{duration:3,ease:"easeInOut"}})}),i==="error"&&m.jsx(O.button,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>t("/"),className:"bg-spotify-green hover:bg-spotify-green/90 text-white font-semibold py-3 px-6 rounded-lg transition-all duration-300",children:"Try Again"}),i==="success"&&m.jsx(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},className:"text-spotify-green text-sm",children:"Redirecting you to your musical journey..."})]})})},l6=()=>{var g,x,v;const{currentUser:e,partnerUser:t,currentTrack:n,isPlaying:r,setCurrentTrack:s,setIsPlaying:i,theme:o}=ae(),a=Vr(o),[l,c]=k.useState(!1),[d,f]=k.useState(null),u=k.useMemo(()=>{const y=((e==null?void 0:e.recentlyPlayed)||[]).map(P=>({who:"you",played_at:new Date(P.played_at).getTime(),track:P.track,key:`you-${P.track.id}-${P.played_at}`})),w=((t==null?void 0:t.recentlyPlayed)||[]).map(P=>({who:"partner",played_at:new Date(P.played_at).getTime(),track:P.track,key:`partner-${P.track.id}-${P.played_at}`})),b=[...y,...w].sort((P,j)=>j.played_at-P.played_at).slice(0,30),S=new Set,C=new Set;return b.forEach(P=>{const j=P.track.id;S.has(j)?C.add(j):S.add(j)}),{items:b,overlaps:C}},[e==null?void 0:e.recentlyPlayed,t==null?void 0:t.recentlyPlayed]),h=async(y,w)=>{var b,S;if(!(e!=null&&e.accessToken)){he.error("Not authenticated with Spotify");return}try{c(!0),f(w),r&&d===w?(await i6(e.accessToken),i(!1),s(null),f(null)):(await s6(e.accessToken,y),i(!0),s(((S=(b=e.recentlyPlayed)==null?void 0:b.find(C=>C.track.id===w))==null?void 0:S.track)||null)),he.success(r&&d===w?"Paused":"Now playing")}catch(C){console.error("Playback error:",C),he.error("Failed to play track. Make sure Spotify is open on your device.")}finally{c(!1)}},p=({user:y,title:w,isPartner:b=!1})=>{var C,P,j,D,T;if(!((C=y==null?void 0:y.recentlyPlayed)!=null&&C.length))return m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-8 text-center",children:[m.jsx(vt,{className:"w-16 h-16 mx-auto mb-4 text-white/30"}),m.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"No recent activity"}),m.jsxs("p",{className:"text-white/70",children:[b?"Your partner":"You"," haven't played any music recently"]})]});const S=y.recentlyPlayed[0];return m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-6",children:[m.jsxs("div",{className:"flex items-center space-x-4 mb-6",children:[m.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center ${b?"bg-gradient-to-br from-pink-500 to-purple-600":"bg-gradient-to-br from-blue-500 to-cyan-600"}`,children:m.jsx(Ss,{className:"w-6 h-6 text-white"})}),m.jsxs("div",{children:[m.jsx("h2",{className:"text-2xl font-bold text-white",children:w}),m.jsxs("p",{className:"text-white/70",children:["Last played: ",Pr(S.played_at)]})]})]}),m.jsx(O.div,{whileHover:{scale:1.02},className:"bg-white/5 rounded-xl p-6 mb-6 border border-white/10",children:m.jsxs("div",{className:"flex items-center space-x-6",children:[m.jsxs("div",{className:"relative",children:[m.jsx("img",{src:((P=S.track.album.images[0])==null?void 0:P.url)||"/placeholder-album.png",alt:S.track.album.name,className:"w-20 h-20 rounded-lg object-cover"}),r&&d===S.track.id&&m.jsx("div",{className:"absolute inset-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${((j=a.cssVars)==null?void 0:j.primary)||"#1db954"}20`},children:m.jsx(yk,{className:"w-6 h-6",style:{color:((D=a.cssVars)==null?void 0:D.primary)||"#1db954"}})})]}),m.jsxs("div",{className:"flex-1",children:[m.jsx("h3",{className:"text-xl font-semibold text-white mb-1",children:S.track.name}),m.jsx("p",{className:"text-white/70 mb-2",children:S.track.artists.map(z=>z.name).join(", ")}),m.jsxs("p",{className:"text-white/50 text-sm",children:[S.track.album.name," β€’ ",Zg(S.track.duration_ms)]})]}),m.jsxs("div",{className:"flex items-center space-x-3",children:[m.jsx("button",{onClick:()=>h(S.track.external_urls.spotify,S.track.id),disabled:l,className:"w-12 h-12 rounded-full flex items-center justify-center transition-all duration-300 text-white disabled:opacity-50",style:{backgroundColor:r&&d===S.track.id?"#ef4444":((T=a.cssVars)==null?void 0:T.primary)||"#1db954"},onMouseEnter:z=>{l||(z.currentTarget.style.opacity="0.9")},onMouseLeave:z=>{l||(z.currentTarget.style.opacity="1")},children:l&&d===S.track.id?m.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}):r&&d===S.track.id?m.jsx(pk,{className:"w-5 h-5"}):m.jsx(Nh,{className:"w-5 h-5 ml-0.5"})}),m.jsx("a",{href:S.track.external_urls.spotify,target:"_blank",rel:"noopener noreferrer",className:"w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition-colors",children:m.jsx(Bg,{className:"w-4 h-4 text-white"})})]})]})}),m.jsxs("div",{children:[m.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center space-x-2",children:[m.jsx(Po,{className:"w-5 h-5"}),m.jsx("span",{children:"Recent History"})]}),m.jsx("div",{className:"space-y-3",children:y.recentlyPlayed.slice(0,5).map((z,V)=>{var U,R,Q;return m.jsxs(O.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:V*.1},className:"flex items-center space-x-4 p-3 rounded-lg hover:bg-white/5 transition-colors group",children:[m.jsx("img",{src:((U=z.track.album.images[0])==null?void 0:U.url)||"/placeholder-album.png",alt:z.track.album.name,className:"w-12 h-12 rounded-lg object-cover"}),m.jsxs("div",{className:"flex-1",children:[m.jsx("h4",{className:"text-white font-medium group-hover:text-spotify-green transition-colors",children:z.track.name}),m.jsx("p",{className:"text-white/70 text-sm",children:(R=z.track.artists[0])==null?void 0:R.name})]}),m.jsx("div",{className:"text-white/50 text-sm",children:Pr(z.played_at)}),m.jsx("button",{onClick:()=>h(z.track.external_urls.spotify,z.track.id),disabled:l,className:"opacity-0 group-hover:opacity-100 w-8 h-8 rounded-full flex items-center justify-center transition-all disabled:opacity-50",style:{backgroundColor:((Q=a.cssVars)==null?void 0:Q.primary)||"#1db954"},onMouseEnter:A=>{l||(A.currentTarget.style.opacity="0.9")},onMouseLeave:A=>{l||(A.currentTarget.style.opacity="1")},children:m.jsx(Nh,{className:"w-4 h-4 text-white ml-0.5"})})]},z.track.id)})})]})]})};return m.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:[m.jsxs("h1",{className:"text-4xl font-bold text-white mb-2 flex items-center space-x-3",children:[m.jsx(Xe,{className:"w-10 h-10",style:{color:((g=a.cssVars)==null?void 0:g.primary)||"#1db954"}}),m.jsx("span",{children:"What's Playing"})]}),m.jsx("p",{className:"text-white/70 text-lg",children:"Discover what you and your partner are listening to right now"})]}),m.jsxs("div",{className:"grid lg:grid-cols-2 gap-8",children:[e&&m.jsx(p,{user:e,title:`${(x=e.user)==null?void 0:x.display_name}'s Music`,isPartner:!1}),t&&m.jsx(p,{user:t,title:`${(v=t.user)==null?void 0:v.display_name}'s Music`,isPartner:!0}),!t&&m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-8 text-center",children:[m.jsx(Xe,{className:"w-16 h-16 mx-auto mb-4 text-pink-400"}),m.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"Waiting for your partner"}),m.jsx("p",{className:"text-white/70 mb-4",children:"Invite your partner to connect their Spotify account to see their music"}),m.jsx("button",{className:"bg-pink-500 hover:bg-pink-600 text-white px-6 py-3 rounded-lg transition-colors",children:"Send Invitation"})]})]}),e&&t&&m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-8 mt-8",children:[m.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center space-x-2",children:[m.jsx(Po,{className:"w-5 h-5"}),m.jsx("span",{children:"Shared Timeline"})]}),m.jsx("div",{className:"space-y-3",children:u.items.map(y=>{var w,b,S,C,P;return m.jsxs("div",{className:"flex items-center gap-4 p-3 rounded-lg bg-white/5",children:[m.jsx("img",{src:((S=(b=(w=y.track.album)==null?void 0:w.images)==null?void 0:b[0])==null?void 0:S.url)||"/placeholder-album.png",alt:((C=y.track.album)==null?void 0:C.name)||"Album",className:"w-10 h-10 rounded"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-white font-medium truncate",children:y.track.name}),u.overlaps.has(y.track.id)&&m.jsx("span",{className:"text-pink-400 text-sm",children:"πŸ’•"})]}),m.jsx("div",{className:"text-white/70 text-sm truncate",children:(P=y.track.artists)==null?void 0:P.map(j=>j.name).join(", ")})]}),m.jsxs("div",{className:"text-white/50 text-xs w-32 text-right",children:[Pr(new Date(y.played_at).toISOString()),m.jsx("div",{className:"text-white/60",children:y.who==="you"?"You":"Partner"})]})]},y.key)})})]})]})},u6=({imageUrl:e,alt:t,fallbackGradient:n})=>{const[r,s]=k.useState(null),[i,o]=k.useState(!0),[a,l]=k.useState(!1);return k.useEffect(()=>{e.startsWith("http")?(s(e),o(!1)):(async()=>{try{const d=await fetch(`${Br}${e}`);if(d.ok){const f=await d.json();s(f.dataUrl)}else l(!0)}catch{l(!0)}finally{o(!1)}})()},[e]),i?m.jsx("div",{className:"w-full h-full bg-gradient-to-br from-gray-500 to-gray-600 flex items-center justify-center",children:m.jsx(vt,{className:"w-8 h-8 text-white animate-pulse"})}):a||!r?m.jsx("div",{className:`w-full h-full flex items-center justify-center ${n}`,children:m.jsx(vt,{className:"w-8 h-8 text-white"})}):m.jsx("img",{src:r,alt:t,className:"w-full h-full object-cover",onError:()=>l(!0)})};function Vh(e){var r;const t=(r=e.vibe)==null?void 0:r.toLowerCase(),n=e.genres||[];if(t)switch(t){case"energetic":return"bg-gradient-to-br from-red-500 to-orange-500";case"chill":return"bg-gradient-to-br from-blue-500 to-teal-500";case"romantic":return"bg-gradient-to-br from-pink-500 to-rose-500";case"party":return"bg-gradient-to-br from-purple-500 to-pink-500";case"workout":return"bg-gradient-to-br from-green-500 to-lime-500";case"study":return"bg-gradient-to-br from-indigo-500 to-blue-500";case"sad":return"bg-gradient-to-br from-gray-500 to-slate-500";case"happy":return"bg-gradient-to-br from-yellow-500 to-orange-500"}if(n.length>0)switch(n[0].toLowerCase()){case"pop":return"bg-gradient-to-br from-pink-500 to-purple-500";case"rock":return"bg-gradient-to-br from-red-500 to-black";case"hip-hop":case"rap":return"bg-gradient-to-br from-yellow-500 to-red-500";case"electronic":case"edm":return"bg-gradient-to-br from-cyan-500 to-blue-500";case"jazz":return"bg-gradient-to-br from-amber-500 to-orange-500";case"classical":return"bg-gradient-to-br from-slate-500 to-gray-600";case"country":return"bg-gradient-to-br from-green-600 to-yellow-600";case"r&b":return"bg-gradient-to-br from-purple-600 to-pink-600";case"indie":return"bg-gradient-to-br from-teal-500 to-green-500";case"alternative":return"bg-gradient-to-br from-gray-600 to-purple-600"}return"bg-gradient-to-br from-purple-500 to-pink-500"}const c6=()=>{var V,U,R,Q;const{currentUser:e,partnerUser:t,mixedPlaylists:n,addMixedPlaylist:r,removeMixedPlaylist:s,setMixedPlaylists:i,theme:o}=ae(),a=Vr(o),[l,c]=k.useState(!1),[d,f]=k.useState(!1),[u,h]=k.useState(null),[p,g]=k.useState(""),[x,v]=k.useState(""),[y,w]=k.useState(!0),[b,S]=k.useState(!1),C=x.split(",").map(A=>A.trim()).filter(A=>A.length>0);k.useEffect(()=>{(async()=>{if(e!=null&&e.jwt)try{console.log("Loading playlists from database...");const q=await se("/playlists/mixed",e.jwt);console.log("Loaded playlists:",q.playlists);const _=q.playlists.map(N=>{var L;const F=N.track_uris?JSON.parse(N.track_uris):[];return console.log("Processing playlist:",N.name,"track_uris count:",F.length,"raw track_uris:",((L=N.track_uris)==null?void 0:L.substring(0,100))+"..."),{id:N.id,name:N.name,description:N.description,tracks:[],createdAt:new Date(N.created_at),createdBy:"AI Magic ✨",spotifyId:N.creator_spotify_id,spotifyUrl:N.creator_spotify_url,partnerSpotifyId:N.partner_spotify_id,partnerSpotifyUrl:N.partner_spotify_url,vibe:N.vibe,genres:N.genres?JSON.parse(N.genres):[],trackUris:F,spotifyImageUrl:N.creator_spotify_image_url}});i(_)}catch(q){console.error("Failed to load playlists:",q)}})()},[e==null?void 0:e.jwt]);const P=async()=>{var A,q,_,N,F,L;if(!u||!((A=e==null?void 0:e.user)!=null&&A.id)){he.error("Unable to create playlist");return}if(!(e!=null&&e.jwt)){he.error("Please login again");return}f(!0);try{const E={partnerId:((q=t==null?void 0:t.user)==null?void 0:q.id)||e.user.id,createForBoth:!1,includeKnown:!0,name:u.name,description:u.description},W=await Pt("/playlists/mixed",E,e.jwt);r({...u,spotifyId:(N=(_=W==null?void 0:W.createdFor)==null?void 0:_.creator)==null?void 0:N.playlistId,spotifyUrl:(L=(F=W==null?void 0:W.createdFor)==null?void 0:F.creator)==null?void 0:L.url}),he.success("Playlist created on Spotify!"),h(null)}catch(E){console.error("Spotify playlist creation error:",E),he.error("Failed to create playlist on Spotify")}finally{f(!1)}},j=async()=>{var A,q,_,N;if(!((A=e==null?void 0:e.user)!=null&&A.id)||!((q=t==null?void 0:t.user)!=null&&q.id)){he.error("Missing users");return}if(!(e!=null&&e.jwt)){he.error("Please login again");return}f(!0);try{const F={partnerId:t.user.id,createForBoth:b,includeKnown:y,vibe:p||void 0,genres:C.length?C:void 0,description:(u==null?void 0:u.description)||"An AI-blended mix with fresh recommendations"},L=await Pt("/playlists/mixed",F,e.jwt);b&&L.createdFor.partnerError?he.success("Your playlist created! Partner sync failed: "+L.createdFor.partnerError):b&&L.createdFor.partner?he.success("Enhanced playlist created on both accounts!"):he.success("Enhanced playlist created!");const E={id:L.id,name:L.name,description:F.description,tracks:[],createdAt:new Date,createdBy:"AI Magic ✨",spotifyId:L.createdFor.creator.playlistId,spotifyUrl:L.createdFor.creator.url,partnerSpotifyId:(_=L.createdFor.partner)==null?void 0:_.playlistId,partnerSpotifyUrl:(N=L.createdFor.partner)==null?void 0:N.url,vibe:F.vibe,genres:F.genres||[],trackUris:L.trackUris||[],spotifyImageUrl:L.spotifyImageUrl};r(E),h(null)}catch(F){console.error(F),he.error("Failed to create enhanced playlist")}finally{f(!1)}},D=()=>{u&&(r(u),h(null),he.success("Playlist saved locally!"))},T=({playlist:A,isNew:q=!1})=>{var _;return m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},whileHover:{scale:1.02},className:`glass rounded-2xl p-6 ${q?"border-spotify-green/50":"border-white/10"}`,children:[m.jsxs("div",{className:"flex items-start justify-between mb-4",children:[m.jsxs("div",{className:"flex items-center space-x-4",children:[m.jsxs("div",{className:`w-16 h-16 rounded-xl flex items-center justify-center overflow-hidden ${q?"bg-gradient-to-br from-spotify-green to-green-600":"bg-gradient-to-br from-purple-500 to-pink-500"}`,children:[q?m.jsx(Yn,{className:"w-8 h-8 text-white"}):A.spotifyImageUrl?m.jsx(u6,{imageUrl:A.spotifyImageUrl,alt:A.name,fallbackGradient:Vh(A)}):null,!q&&m.jsx("div",{className:`w-full h-full flex items-center justify-center ${A.spotifyImageUrl?"bg-gradient-to-br from-purple-500 to-pink-500":Vh(A)}`,style:{display:A.spotifyImageUrl?"none":"flex"},children:m.jsx(vt,{className:"w-8 h-8 text-white"})})]}),m.jsxs("div",{children:[m.jsx("h3",{className:"text-xl font-semibold text-white",children:A.name}),m.jsx("p",{className:"text-white/70 text-sm",children:A.description}),m.jsxs("div",{className:"flex flex-wrap gap-1 mt-1 mb-1",children:[A.vibe&&m.jsx("span",{className:"px-2 py-0.5 bg-blue-500/20 text-blue-300 text-xs rounded-full",children:A.vibe}),A.genres&&A.genres.length>0&&A.genres.slice(0,2).map((N,F)=>m.jsx("span",{className:"px-2 py-0.5 bg-green-500/20 text-green-300 text-xs rounded-full",children:N},F))]}),m.jsxs("p",{className:"text-white/50 text-xs",children:["Created ",q?"just now":new Date(A.createdAt).toLocaleDateString()," β€’ ",A.tracks.length||((_=A.trackUris)==null?void 0:_.length)||0," tracks"]})]})]}),m.jsxs("div",{className:"flex items-center space-x-2",children:[A.spotifyUrl&&m.jsx("a",{href:A.spotifyUrl,target:"_blank",rel:"noopener noreferrer",className:"w-8 h-8 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition-colors",title:"Open in Spotify",children:m.jsx(Bg,{className:"w-4 h-4 text-white"})}),A.partnerSpotifyUrl&&m.jsx("a",{href:A.partnerSpotifyUrl,target:"_blank",rel:"noopener noreferrer",className:"w-8 h-8 rounded-full bg-pink-500/20 hover:bg-pink-500/30 flex items-center justify-center transition-colors",title:"Partner's playlist in Spotify",children:m.jsx(Xe,{className:"w-4 h-4 text-pink-400"})}),!q&&m.jsx("button",{onClick:async()=>{try{e!=null&&e.jwt&&await mb(`/playlists/mixed/${A.id}`,e.jwt),s(A.id),he.success("Playlist deleted successfully")}catch(N){console.error("Failed to delete playlist:",N),he.error("Failed to delete playlist")}},className:"w-8 h-8 rounded-full bg-red-500/20 hover:bg-red-500/30 flex items-center justify-center transition-colors",children:m.jsx(Wg,{className:"w-4 h-4 text-red-400"})})]})]}),m.jsx("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:A.tracks.length>0?m.jsxs(m.Fragment,{children:[A.tracks.slice(0,5).map((N,F)=>{var L,E,W,X,te,G;return m.jsxs(O.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:F*.1},className:"flex items-center space-x-3 p-2 rounded-lg hover:bg-white/5 transition-colors",children:[m.jsx("img",{src:((W=(E=(L=N.album)==null?void 0:L.images)==null?void 0:E[0])==null?void 0:W.url)||"/placeholder-album.png",alt:((X=N.album)==null?void 0:X.name)||"Unknown Album",className:"w-10 h-10 rounded-lg object-cover"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("h4",{className:"text-white font-medium truncate",children:N.name}),m.jsx("p",{className:"text-white/70 text-sm truncate",children:((G=(te=N.artists)==null?void 0:te[0])==null?void 0:G.name)||"Unknown Artist"})]}),m.jsx("div",{className:"text-white/50 text-sm",children:Zg(N.duration_ms)})]},N.id)}),A.tracks.length>5&&m.jsxs("div",{className:"text-center text-white/50 text-sm py-2",children:["+",A.tracks.length-5," more tracks"]})]}):A.trackUris&&A.trackUris.length>0?m.jsx("div",{className:"text-center py-4"}):m.jsx("div",{className:"text-center text-white/50 text-sm py-4",children:"No tracks available"})}),q&&m.jsxs("div",{className:"flex items-center space-x-3 mt-6 pt-4 border-t border-white/10",children:[m.jsx("button",{onClick:P,disabled:d||b,className:"flex-1 bg-spotify-green hover:bg-spotify-green/90 text-white font-semibold py-3 px-4 rounded-lg transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:d?m.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}):m.jsxs(m.Fragment,{children:[m.jsx(Ac,{className:"w-4 h-4"}),m.jsx("span",{children:b?"Disabled (using Create for both)":"Create on Spotify"})]})}),m.jsx("button",{onClick:D,className:"px-4 py-3 bg-white/10 hover:bg-white/20 text-white rounded-lg transition-colors",children:"Save Locally"})]})]})},z=(e==null?void 0:e.topTracks)&&(t==null?void 0:t.topTracks);return m.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:[m.jsxs("h1",{className:"text-4xl font-bold text-white mb-2 flex items-center space-x-3",children:[m.jsx(Yn,{className:"w-10 h-10",style:{color:((V=a.cssVars)==null?void 0:V.primary)||"#1db954"}}),m.jsx("span",{children:"Mixed Playlists"})]}),m.jsx("p",{className:"text-white/70 text-lg",children:"AI-powered playlists that perfectly blend your musical tastes together"})]}),z&&m.jsx(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"mb-8",children:m.jsxs("div",{className:"glass rounded-2xl p-8 text-center",style:{borderColor:`${((U=a.cssVars)==null?void 0:U.primary)||"#1db954"}30`},children:[m.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full flex items-center justify-center",style:{background:`linear-gradient(135deg, ${((R=a.cssVars)==null?void 0:R.primary)||"#1db954"} 0%, ${((Q=a.cssVars)==null?void 0:Q.secondary)||"#1ed760"} 100%)`},children:m.jsx(vk,{className:"w-8 h-8 text-white"})}),m.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Create Your Perfect Mix"}),m.jsx("p",{className:"text-white/70 mb-6 max-w-2xl mx-auto",children:"Our AI analyzes both your music tastes and creates a playlist that represents your unique musical connection"}),m.jsxs("div",{className:"mt-4 text-white/50 text-sm",children:["Analyzing ",e.topTracks.length+t.topTracks.length," tracks from both users"]}),m.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-left mt-8",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Vibe"}),m.jsxs("select",{className:"w-full bg-white/10 text-white rounded-lg p-2 appearance-none focus:outline-none focus:ring-2 focus:ring-spotify-green",value:p,onChange:A=>g(A.target.value),children:[m.jsx("option",{value:"",children:"Auto"}),m.jsx("option",{value:"energetic",children:"Energetic"}),m.jsx("option",{value:"chill",children:"Chill"}),m.jsx("option",{value:"happy",children:"Happy"}),m.jsx("option",{value:"sad",children:"Sad"}),m.jsx("option",{value:"party",children:"Party"}),m.jsx("option",{value:"focus",children:"Focus"})]})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Genres (comma-separated)"}),m.jsx("input",{className:"w-full bg-white/10 text-white rounded-lg p-2 placeholder-white/60 focus:outline-none focus:ring-2 focus:ring-spotify-green",placeholder:"pop, rock, edm",value:x,onChange:A=>v(A.target.value)})]}),m.jsxs("label",{className:"flex items-center space-x-2 text-white/80",children:[m.jsx("input",{type:"checkbox",checked:y,onChange:A=>w(A.target.checked)}),m.jsx("span",{children:"Include songs we already know"})]}),m.jsxs("label",{className:"flex items-center space-x-2 text-white/80",children:[m.jsx("input",{type:"checkbox",checked:b,onChange:A=>S(A.target.checked)}),m.jsx("span",{children:"Create playlist on both accounts"}),b&&m.jsx("span",{className:"text-xs text-pink-400 ml-2",children:"✨ Synced"})]})]}),m.jsx("div",{className:"flex items-center justify-center gap-3 mt-6",children:m.jsx("button",{onClick:j,disabled:d,className:"bg-white/10 hover:bg-white/20 text-white font-semibold py-3 px-4 rounded-lg transition-colors disabled:opacity-50",children:"Create Enhanced Playlist"})})]})}),u&&m.jsxs(O.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"mb-8",children:[m.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"✨ Your New Playlist"}),m.jsx(T,{playlist:u,isNew:!0})]}),n.length>0&&m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},children:[m.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"Your Mixed Playlists"}),m.jsx("div",{className:"grid gap-6",children:n.map(A=>m.jsx(T,{playlist:A},A.id))})]}),!z&&m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-12 text-center",children:[m.jsx(Xe,{className:"w-16 h-16 mx-auto mb-4 text-pink-400"}),m.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:t?"Loading music data":"Waiting for your partner"}),m.jsx("p",{className:"text-white/70",children:t?"We need to analyze both your music tastes to create the perfect mixed playlist":"Invite your partner to connect their Spotify account to start creating mixed playlists"})]}),n.length===0&&z&&!u&&m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-12 text-center",children:[m.jsx(vt,{className:"w-16 h-16 mx-auto mb-4 text-white/30"}),m.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"No playlists yet"}),m.jsx("p",{className:"text-white/70",children:"Create your first mixed playlist to start your musical journey together"})]})]})},d6=()=>{const{currentUser:e,partnerUser:t,memoryLane:n,addMemoryLaneItem:r}=ae(),[s,i]=k.useState(!1),[o,a]=k.useState({title:"",description:"",type:"milestone"});k.useEffect(()=>{var u,h,p,g,x,v,y,w,b,S,C,P;e&&t&&n.length===0&&[{id:"1",type:"milestone",title:"First Musical Connection",description:`${(u=e.user)==null?void 0:u.display_name} and ${(h=t.user)==null?void 0:h.display_name} discovered their shared love for music`,date:new Date(Date.now()-6048e5),users:[((p=e.user)==null?void 0:p.id)||"",((g=t.user)==null?void 0:g.id)||""]},{id:"2",type:"shared_track",title:"Shared Love for This Song",description:`Both of you have been listening to "${((v=(x=e.recentlyPlayed)==null?void 0:x[0])==null?void 0:v.track.name)||"Your favorite track"}" recently`,track:(w=(y=e.recentlyPlayed)==null?void 0:y[0])==null?void 0:w.track,date:new Date(Date.now()-2592e5),users:[((b=e.user)==null?void 0:b.id)||"",((S=t.user)==null?void 0:S.id)||""]},{id:"3",type:"playlist_created",title:"Our First Mixed Playlist",description:"Created a beautiful blend of your musical tastes",date:new Date(Date.now()-864e5),users:[((C=e.user)==null?void 0:C.id)||"",((P=t.user)==null?void 0:P.id)||""]}].forEach(D=>{r(D)})},[e,t,n.length,r]);const l=()=>{var h,p;if(!o.title.trim()||!o.description.trim()){he.error("Please fill in both title and description");return}const u={id:Date.now().toString(),...o,date:new Date,users:[((h=e==null?void 0:e.user)==null?void 0:h.id)||"",((p=t==null?void 0:t.user)==null?void 0:p.id)||""]};r(u),a({title:"",description:"",type:"milestone"}),i(!1),he.success("Memory added to your journey!")},c=u=>{switch(u){case"shared_track":return m.jsx(vt,{className:"w-5 h-5"});case"playlist_created":return m.jsx(Yn,{className:"w-5 h-5"});case"milestone":return m.jsx(mk,{className:"w-5 h-5"});default:return m.jsx(Xe,{className:"w-5 h-5"})}},d=u=>{switch(u){case"shared_track":return"from-blue-500 to-cyan-500";case"playlist_created":return"from-purple-500 to-pink-500";case"milestone":return"from-yellow-500 to-orange-500";default:return"from-pink-500 to-red-500"}},f=({memory:u,index:h})=>{var p,g;return m.jsxs(O.div,{initial:{opacity:0,x:-50},animate:{opacity:1,x:0},transition:{delay:h*.1},className:"relative",children:[hi(!0),className:"bg-gradient-to-r from-pink-500 to-red-500 hover:from-pink-600 hover:to-red-600 text-white font-semibold py-3 px-6 rounded-xl transition-all duration-300 flex items-center space-x-2",children:[m.jsx(Ac,{className:"w-5 h-5"}),m.jsx("span",{children:"Add Memory"})]})]})}),s&&m.jsx(O.div,{initial:{opacity:0},animate:{opacity:1},className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",onClick:()=>i(!1),children:m.jsxs(O.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},onClick:u=>u.stopPropagation(),className:"glass rounded-2xl p-8 max-w-md w-full",children:[m.jsx("h3",{className:"text-2xl font-bold text-white mb-6",children:"Add a New Memory"}),m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-white/70 text-sm font-medium mb-2",children:"Title"}),m.jsx("input",{type:"text",value:o.title,onChange:u=>a({...o,title:u.target.value}),className:"w-full px-4 py-3 bg-white/10 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-spotify-green",placeholder:"What's this memory about?"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-white/70 text-sm font-medium mb-2",children:"Description"}),m.jsx("textarea",{value:o.description,onChange:u=>a({...o,description:u.target.value}),className:"w-full px-4 py-3 bg-white/10 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-spotify-green h-24 resize-none",placeholder:"Tell the story of this memory..."})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-white/70 text-sm font-medium mb-2",children:"Type"}),m.jsxs("select",{value:o.type,onChange:u=>a({...o,type:u.target.value}),className:"w-full px-4 py-3 bg-white/10 border border-white/20 rounded-lg text-white focus:outline-none focus:border-spotify-green",children:[m.jsx("option",{value:"milestone",children:"Milestone"}),m.jsx("option",{value:"shared_track",children:"Shared Track"}),m.jsx("option",{value:"playlist_created",children:"Playlist Created"})]})]})]}),m.jsxs("div",{className:"flex items-center space-x-3 mt-6",children:[m.jsx("button",{onClick:l,className:"flex-1 bg-spotify-green hover:bg-spotify-green/90 text-white font-semibold py-3 px-4 rounded-lg transition-colors",children:"Add Memory"}),m.jsx("button",{onClick:()=>i(!1),className:"px-4 py-3 bg-white/10 hover:bg-white/20 text-white rounded-lg transition-colors",children:"Cancel"})]})]})}),m.jsx("div",{className:"space-y-8",children:n.length>0?n.map((u,h)=>m.jsx(f,{memory:u,index:h},u.id)):m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-12 text-center",children:[m.jsx(ck,{className:"w-16 h-16 mx-auto mb-4 text-white/30"}),m.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"No memories yet"}),m.jsx("p",{className:"text-white/70 mb-6",children:"Start creating beautiful musical memories together"}),m.jsx("button",{onClick:()=>i(!0),className:"bg-gradient-to-r from-pink-500 to-red-500 hover:from-pink-600 hover:to-red-600 text-white font-semibold py-3 px-6 rounded-xl transition-all duration-300",children:"Create First Memory"})]})}),n.length>0&&m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},className:"mt-12 grid grid-cols-1 md:grid-cols-3 gap-6",children:[m.jsxs("div",{className:"glass rounded-2xl p-6 text-center",children:[m.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-gradient-to-br from-pink-500 to-red-500 rounded-full flex items-center justify-center",children:m.jsx(Xe,{className:"w-6 h-6 text-white"})}),m.jsx("h4",{className:"text-2xl font-bold text-white mb-1",children:n.length}),m.jsx("p",{className:"text-white/70 text-sm",children:"Memories Created"})]}),m.jsxs("div",{className:"glass rounded-2xl p-6 text-center",children:[m.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-gradient-to-br from-blue-500 to-cyan-500 rounded-full flex items-center justify-center",children:m.jsx(vt,{className:"w-6 h-6 text-white"})}),m.jsx("h4",{className:"text-2xl font-bold text-white mb-1",children:n.filter(u=>u.type==="shared_track").length}),m.jsx("p",{className:"text-white/70 text-sm",children:"Shared Tracks"})]}),m.jsxs("div",{className:"glass rounded-2xl p-6 text-center",children:[m.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-gradient-to-br from-purple-500 to-pink-500 rounded-full flex items-center justify-center",children:m.jsx(Yn,{className:"w-6 h-6 text-white"})}),m.jsx("h4",{className:"text-2xl font-bold text-white mb-1",children:n.filter(u=>u.type==="playlist_created").length}),m.jsx("p",{className:"text-white/70 text-sm",children:"Playlists Created"})]})]})]})};function f6(e,t){if(!e||!t)return 0;const n=["energy","valence"];let r=0,s=0;for(const i of n)typeof e[i]=="number"&&typeof t[i]=="number"&&(r+=1-Math.min(1,Math.abs(e[i]-t[i])),s++);return s?Math.round(r/s*100):0}const h6=()=>{var u,h;const{currentUser:e,partnerUser:t}=ae(),[n,r]=k.useState(null),[s,i]=k.useState(null),[o,a]=k.useState(null),[l,c]=k.useState(null);k.useEffect(()=>{let p;const g=async()=>{var x,v,y,w;try{const b=(x=e==null?void 0:e.user)==null?void 0:x.id;if(b){const C=await se(`/users/${b}/now-playing`);r(C);const P=(v=C==null?void 0:C.item)==null?void 0:v.id;if(P){const j=await se(`/users/${b}/audio-features?ids=${P}`);a(((j==null?void 0:j.audio_features)||[])[0]||null)}}const S=(y=t==null?void 0:t.user)==null?void 0:y.id;if(S){const C=await se(`/users/${S}/now-playing`);i(C);const P=(w=C==null?void 0:C.item)==null?void 0:w.id;if(P){const j=await se(`/users/${S}/audio-features?ids=${P}`);c(((j==null?void 0:j.audio_features)||[])[0]||null)}}}catch{}p=setTimeout(g,8e3)};return g(),()=>clearTimeout(p)},[(u=e==null?void 0:e.user)==null?void 0:u.id,(h=t==null?void 0:t.user)==null?void 0:h.id]);const d=k.useMemo(()=>f6(o,l),[o,l]),f=({data:p,who:g})=>{var v,y,w;if(!(p!=null&&p.is_playing)||!(p!=null&&p.item))return m.jsxs("div",{className:"glass rounded-2xl p-6 text-white/70",children:[g," is not playing"]});const x=p.item;return m.jsxs("div",{className:"glass rounded-2xl p-6 flex items-center gap-4",children:[m.jsx("img",{src:((w=(y=(v=x==null?void 0:x.album)==null?void 0:v.images)==null?void 0:y[0])==null?void 0:w.url)||"/placeholder-album.png",alt:x==null?void 0:x.name,className:"w-16 h-16 rounded"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-white font-semibold truncate",children:x==null?void 0:x.name}),m.jsx("div",{className:"text-white/70 text-sm truncate",children:((x==null?void 0:x.artists)||[]).map(b=>b.name).join(", ")})]}),m.jsx("div",{className:"flex gap-1",children:[...Array(12)].map((b,S)=>m.jsx("div",{className:"w-1 bg-spotify-green/60 animate-pulse",style:{height:`${(Math.sin(S)*.5+.5)*32+8}px`,animationDelay:`${S*50}ms`}},S))})]})};return m.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-6",children:[m.jsx("h1",{className:"text-3xl font-bold text-white",children:"Live Dashboard"}),m.jsx("p",{className:"text-white/70",children:"See what you are both playing right now"})]}),m.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[m.jsx(f,{data:n,who:"You"}),m.jsx(f,{data:s,who:"Partner"})]}),(n==null?void 0:n.is_playing)&&(s==null?void 0:s.is_playing)&&m.jsxs(O.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-6 mt-6 text-center",children:[m.jsx("div",{className:"text-white/80",children:"Harmony Match"}),m.jsxs("div",{className:"text-4xl font-extrabold text-white mt-1",children:[d,"%"]})]})]})};function p6(){var o,a;const{currentUser:e,partnerUser:t,isLoading:n,theme:r}=ae(),s=En();console.log("πŸ” App - Current location:",s.pathname),k.useEffect(()=>{Vr(r)},[r]),k.useEffect(()=>{const l=localStorage.getItem("spotify-user"),c=localStorage.getItem("spotify-partner");if(l)try{const d=JSON.parse(l);ae.getState().setCurrentUser(d)}catch(d){console.error("Failed to parse stored user data:",d),localStorage.removeItem("spotify-user")}if(c)try{const d=JSON.parse(c);ae.getState().setPartnerUser(d)}catch(d){console.error("Failed to parse stored partner data:",d),localStorage.removeItem("spotify-partner")}},[]),k.useEffect(()=>{(async()=>{var d,f;const c=(f=(d=ae.getState().currentUser)==null?void 0:d.user)==null?void 0:f.id;if(c&&!ae.getState().partnerUser)try{const u=await se(`/partners/partner/${c}`);if(u.partnerId){const[h,p,g]=await Promise.all([se(`/users/${u.partnerId}`),se(`/users/${u.partnerId}/recently-played`),se(`/users/${u.partnerId}/top-tracks?time_range=short_term`)]);ae.getState().setPartnerUser({user:h,accessToken:null,refreshToken:null,isAuthenticated:!0,recentlyPlayed:p,topTracks:g.map(x=>x.track),topArtists:[]})}}catch{}})()},[(o=e==null?void 0:e.user)==null?void 0:o.id]),k.useEffect(()=>{var d,f;const l=(f=(d=ae.getState().currentUser)==null?void 0:d.user)==null?void 0:f.id;if(!l)return;const c=hb(`/partners/events/${l}`);return c.onmessage=async u=>{var h,p;if(u.data)try{const g=JSON.parse(u.data);if((g==null?void 0:g.type)==="partner:connected"||(g==null?void 0:g.type)==="partner:disconnected"){const x=await se(`/partners/partner/${l}`),v=((p=(h=ae.getState().partnerUser)==null?void 0:h.user)==null?void 0:p.id)||null;if(!(x!=null&&x.partnerId)&&v){ae.getState().setPartnerUser(null),localStorage.removeItem("spotify-partner");return}if(x!=null&&x.partnerId&&x.partnerId!==v)try{const[y,w,b]=await Promise.all([se(`/users/${x.partnerId}`),se(`/users/${x.partnerId}/recently-played`),se(`/users/${x.partnerId}/top-tracks?time_range=short_term`)]);ae.getState().setPartnerUser({user:y,accessToken:null,refreshToken:null,isAuthenticated:!0,recentlyPlayed:w,topTracks:b.map(S=>S.track),topArtists:[]})}catch{}}(g==null?void 0:g.type)==="partner:request"||(g==null||g.type)}catch{}},c.onerror=()=>{try{c.close()}catch{}},()=>{try{c.close()}catch{}}},[(a=e==null?void 0:e.user)==null?void 0:a.id]);const i=(e==null?void 0:e.isAuthenticated)||!1;return n?m.jsxs("div",{className:"min-h-screen flex items-center justify-center relative",children:[m.jsx(Eh,{hueShift:ah(r)}),m.jsxs(O.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"glass-fluid rounded-3xl p-10 flex flex-col items-center space-y-6 relative z-20",children:[m.jsx("div",{className:"w-16 h-16 border-4 border-t-transparent rounded-full animate-spin",style:{borderColor:"var(--theme-primary) var(--theme-primary) var(--theme-primary) transparent"}}),m.jsx("p",{className:"text-white font-medium text-lg",children:"Loading your musical journey..."})]})]}):m.jsxs("div",{className:"min-h-screen relative overflow-hidden",children:[m.jsx(Eh,{hueShift:ah(r)}),m.jsxs("div",{className:"relative z-20",children:[i&&m.jsx(Jk,{}),m.jsxs(wx,{children:[m.jsx(_t,{path:"/",element:i?m.jsx(a6,{}):m.jsx(o6,{})}),m.jsx(_t,{path:"/callback",element:m.jsx(Rh,{})}),m.jsx(_t,{path:"/callback.html",element:m.jsx(Rh,{})}),i&&m.jsxs(m.Fragment,{children:[m.jsx(_t,{path:"/last-listened",element:m.jsx(l6,{})}),m.jsx(_t,{path:"/mixed-playlist",element:m.jsx(c6,{})}),m.jsx(_t,{path:"/memory-lane",element:m.jsx(d6,{})}),m.jsx(_t,{path:"/live",element:m.jsx(h6,{})})]}),m.jsx(_t,{path:"*",element:m.jsx(vx,{to:"/",replace:!0})})]})]})]})}Ka.createRoot(document.getElementById("root")).render(m.jsx(Gs.StrictMode,{children:m.jsxs(Tx,{children:[m.jsx(p6,{}),m.jsx(w2,{position:"top-right",toastOptions:{duration:4e3,style:{background:"rgba(255, 255, 255, 0.1)",backdropFilter:"blur(20px)",border:"1px solid rgba(255, 255, 255, 0.2)",color:"#fff"}}})]})}));