import{c as m0,g as h0,b as as,r as B,j as n,d as dl,e as Gi,u as Li,Q as x0,a as g0}from"./query-CekM4sc-.js";import{r as p0,N as So,u as dh,L as at,O as b0,d as v0,c as wo,b as y0,R as dt,a as zo,B as j0}from"./vendor-I9o4r1Ax.js";import{m as Ae,A as ns,u as N0}from"./motion-DPqEPCxV.js";import{S as S0}from"./radix-bJ91Laj3.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))o(h);new MutationObserver(h=>{for(const g of h)if(g.type==="childList")for(const b of g.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&o(b)}).observe(document,{childList:!0,subtree:!0});function f(h){const g={};return h.integrity&&(g.integrity=h.integrity),h.referrerPolicy&&(g.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?g.credentials="include":h.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function o(h){if(h.ep)return;h.ep=!0;const g=f(h);fetch(h.href,g)}})();var oo={exports:{}},es={},ro={exports:{}},fo={};/** * @license React * scheduler.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Om;function w0(){return Om||(Om=1,(function(c){function r(A,O){var K=A.length;A.push(O);e:for(;0>>1,D=A[pe];if(0>>1;peh(ue,K))Ceh(ze,ue)?(A[pe]=ze,A[Ce]=K,pe=Ce):(A[pe]=ue,A[we]=K,pe=we);else if(Ceh(ze,K))A[pe]=ze,A[Ce]=K,pe=Ce;else break e}}return O}function h(A,O){var K=A.sortIndex-O.sortIndex;return K!==0?K:A.id-O.id}if(c.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var g=performance;c.unstable_now=function(){return g.now()}}else{var b=Date,S=b.now();c.unstable_now=function(){return b.now()-S}}var M=[],v=[],E=1,N=null,C=3,L=!1,Q=!1,J=!1,Y=!1,ne=typeof setTimeout=="function"?setTimeout:null,fe=typeof clearTimeout=="function"?clearTimeout:null,xe=typeof setImmediate<"u"?setImmediate:null;function se(A){for(var O=f(v);O!==null;){if(O.callback===null)o(v);else if(O.startTime<=A)o(v),O.sortIndex=O.expirationTime,r(M,O);else break;O=f(v)}}function ce(A){if(J=!1,se(A),!Q)if(f(M)!==null)Q=!0,V||(V=!0,Je());else{var O=f(v);O!==null&&tt(ce,O.startTime-A)}}var V=!1,ge=-1,U=5,Be=-1;function Kl(){return Y?!0:!(c.unstable_now()-BeA&&Kl());){var pe=N.callback;if(typeof pe=="function"){N.callback=null,C=N.priorityLevel;var D=pe(N.expirationTime<=A);if(A=c.unstable_now(),typeof D=="function"){N.callback=D,se(A),O=!0;break t}N===f(M)&&o(M),se(A)}else o(M);N=f(M)}if(N!==null)O=!0;else{var Xe=f(v);Xe!==null&&tt(ce,Xe.startTime-A),O=!1}}break e}finally{N=null,C=K,L=!1}O=void 0}}finally{O?Je():V=!1}}}var Je;if(typeof xe=="function")Je=function(){xe(Yt)};else if(typeof MessageChannel<"u"){var Jl=new MessageChannel,Qt=Jl.port2;Jl.port1.onmessage=Yt,Je=function(){Qt.postMessage(null)}}else Je=function(){ne(Yt,0)};function tt(A,O){ge=ne(function(){A(c.unstable_now())},O)}c.unstable_IdlePriority=5,c.unstable_ImmediatePriority=1,c.unstable_LowPriority=4,c.unstable_NormalPriority=3,c.unstable_Profiling=null,c.unstable_UserBlockingPriority=2,c.unstable_cancelCallback=function(A){A.callback=null},c.unstable_forceFrameRate=function(A){0>A||125pe?(A.sortIndex=K,r(v,A),f(M)===null&&A===f(v)&&(J?(fe(ge),ge=-1):J=!0,tt(ce,K-pe))):(A.sortIndex=D,r(M,A),Q||L||(Q=!0,V||(V=!0,Je()))),A},c.unstable_shouldYield=Kl,c.unstable_wrapCallback=function(A){var O=C;return function(){var K=C;C=O;try{return A.apply(this,arguments)}finally{C=K}}}})(fo)),fo}var Dm;function z0(){return Dm||(Dm=1,ro.exports=w0()),ro.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Um;function A0(){if(Um)return es;Um=1;var c=z0(),r=m0(),f=p0();function o(e){var t="https://react.dev/errors/"+e;if(1D||(e.current=pe[D],pe[D]=null,D--)}function ue(e,t){D++,pe[D]=e.current,e.current=t}var Ce=Xe(null),ze=Xe(null),Me=Xe(null),Xt=Xe(null);function $l(e,t){switch(ue(Me,t),ue(ze,e),ue(Ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?lm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=lm(t),e=am(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}we(Ce),ue(Ce,e)}function ke(){we(Ce),we(ze),we(Me)}function ya(e){e.memoizedState!==null&&ue(Xt,e);var t=Ce.current,l=am(t,e.type);t!==l&&(ue(ze,e),ue(Ce,l))}function Vt(e){ze.current===e&&(we(Ce),we(ze)),Xt.current===e&&(we(Xt),Wn._currentValue=K)}var xl,ja;function Nt(e){if(xl===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);xl=t&&t[1]||"",ja=-1)":-1s||m[a]!==j[s]){var k=` `+m[a].replace(" at new "," at ");return e.displayName&&k.includes("")&&(k=k.replace("",e.displayName)),k}while(1<=a&&0<=s);break}}}finally{Zi=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Nt(l):""}function Xh(e,t){switch(e.tag){case 26:case 27:case 5:return Nt(e.type);case 16:return Nt("Lazy");case 13:return e.child!==t&&t!==null?Nt("Suspense Fallback"):Nt("Suspense");case 19:return Nt("SuspenseList");case 0:case 15:return Ki(e.type,!1);case 11:return Ki(e.type.render,!1);case 1:return Ki(e.type,!0);case 31:return Nt("Activity");default:return""}}function Co(e){try{var t="",l=null;do t+=Xh(e,l),l=e,e=e.return;while(e);return t}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}var Ji=Object.prototype.hasOwnProperty,$i=c.unstable_scheduleCallback,Wi=c.unstable_cancelCallback,Vh=c.unstable_shouldYield,Zh=c.unstable_requestPaint,ft=c.unstable_now,Kh=c.unstable_getCurrentPriorityLevel,Oo=c.unstable_ImmediatePriority,Do=c.unstable_UserBlockingPriority,ds=c.unstable_NormalPriority,Jh=c.unstable_LowPriority,Uo=c.unstable_IdlePriority,$h=c.log,Wh=c.unstable_setDisableYieldValue,un=null,mt=null;function gl(e){if(typeof $h=="function"&&Wh(e),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(un,e)}catch{}}var ht=Math.clz32?Math.clz32:Ph,Fh=Math.log,Ih=Math.LN2;function Ph(e){return e>>>=0,e===0?32:31-(Fh(e)/Ih|0)|0}var fs=256,ms=262144,hs=4194304;function Wl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function xs(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,i=e.suspendedLanes,u=e.pingedLanes;e=e.warmLanes;var d=a&134217727;return d!==0?(a=d&~i,a!==0?s=Wl(a):(u&=d,u!==0?s=Wl(u):l||(l=d&~e,l!==0&&(s=Wl(l))))):(d=a&~i,d!==0?s=Wl(d):u!==0?s=Wl(u):l||(l=a&~e,l!==0&&(s=Wl(l)))),s===0?0:t!==0&&t!==s&&(t&i)===0&&(i=s&-s,l=t&-t,i>=l||i===32&&(l&4194048)!==0)?t:s}function on(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ex(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ho(){var e=hs;return hs<<=1,(hs&62914560)===0&&(hs=4194304),e}function Fi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function rn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function tx(e,t,l,a,s,i){var u=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var d=e.entanglements,m=e.expirationTimes,j=e.hiddenUpdates;for(l=u&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var cx=/[\n"\\]/g;function wt(e){return e.replace(cx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ac(e,t,l,a,s,i,u,d){e.name="",u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.type=u:e.removeAttribute("type"),t!=null?u==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+St(t)):e.value!==""+St(t)&&(e.value=""+St(t)):u!=="submit"&&u!=="reset"||e.removeAttribute("value"),t!=null?nc(e,u,St(t)):l!=null?nc(e,u,St(l)):a!=null&&e.removeAttribute("value"),s==null&&i!=null&&(e.defaultChecked=!!i),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.name=""+St(d):e.removeAttribute("name")}function $o(e,t,l,a,s,i,u,d){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){lc(e);return}l=l!=null?""+St(l):"",t=t!=null?""+St(t):l,d||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=d?e.checked:!!a,e.defaultChecked=!!a,u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.name=u),lc(e)}function nc(e,t,l){t==="number"&&bs(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function ka(e,t,l,a){if(e=e.options,t){t={};for(var s=0;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oc=!1;if(Jt)try{var hn={};Object.defineProperty(hn,"passive",{get:function(){oc=!0}}),window.addEventListener("test",hn,hn),window.removeEventListener("test",hn,hn)}catch{oc=!1}var bl=null,rc=null,ys=null;function lr(){if(ys)return ys;var e,t=rc,l=t.length,a,s="value"in bl?bl.value:bl.textContent,i=s.length;for(e=0;e=pn),ur=" ",or=!1;function rr(e,t){switch(e){case"keyup":return Ux.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ea=!1;function Bx(e,t){switch(e){case"compositionend":return dr(t);case"keypress":return t.which!==32?null:(or=!0,ur);case"textInput":return e=t.data,e===ur&&or?null:e;default:return null}}function Rx(e,t){if(Ea)return e==="compositionend"||!xc&&rr(e,t)?(e=lr(),ys=rc=bl=null,Ea=!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:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=vr(l)}}function jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jr(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=bs(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=bs(e.document)}return t}function bc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Zx=Jt&&"documentMode"in document&&11>=document.documentMode,Ca=null,vc=null,jn=null,yc=!1;function Sr(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;yc||Ca==null||Ca!==bs(a)||(a=Ca,"selectionStart"in a&&bc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),jn&&yn(jn,a)||(jn=a,a=mi(vc,"onSelect"),0>=u,s-=u,Ht=1<<32-ht(t)+s|l<F?(le=G,G=null):le=G.sibling;var de=w(p,G,y[F],_);if(de===null){G===null&&(G=le);break}e&&G&&de.alternate===null&&t(p,G),x=i(de,x,F),re===null?X=de:re.sibling=de,re=de,G=le}if(F===y.length)return l(p,G),ae&&Wt(p,F),X;if(G===null){for(;FF?(le=G,G=null):le=G.sibling;var Gl=w(p,G,de.value,_);if(Gl===null){G===null&&(G=le);break}e&&G&&Gl.alternate===null&&t(p,G),x=i(Gl,x,F),re===null?X=Gl:re.sibling=Gl,re=Gl,G=le}if(de.done)return l(p,G),ae&&Wt(p,F),X;if(G===null){for(;!de.done;F++,de=y.next())de=T(p,de.value,_),de!==null&&(x=i(de,x,F),re===null?X=de:re.sibling=de,re=de);return ae&&Wt(p,F),X}for(G=a(G);!de.done;F++,de=y.next())de=z(G,p,F,de.value,_),de!==null&&(e&&de.alternate!==null&&G.delete(de.key===null?F:de.key),x=i(de,x,F),re===null?X=de:re.sibling=de,re=de);return e&&G.forEach(function(f0){return t(p,f0)}),ae&&Wt(p,F),X}function Ne(p,x,y,_){if(typeof y=="object"&&y!==null&&y.type===J&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case L:e:{for(var X=y.key;x!==null;){if(x.key===X){if(X=y.type,X===J){if(x.tag===7){l(p,x.sibling),_=s(x,y.props.children),_.return=p,p=_;break e}}else if(x.elementType===X||typeof X=="object"&&X!==null&&X.$$typeof===U&&ca(X)===x.type){l(p,x.sibling),_=s(x,y.props),kn(_,y),_.return=p,p=_;break e}l(p,x);break}else t(p,x);x=x.sibling}y.type===J?(_=la(y.props.children,p.mode,_,y.key),_.return=p,p=_):(_=Ms(y.type,y.key,y.props,null,p.mode,_),kn(_,y),_.return=p,p=_)}return u(p);case Q:e:{for(X=y.key;x!==null;){if(x.key===X)if(x.tag===4&&x.stateNode.containerInfo===y.containerInfo&&x.stateNode.implementation===y.implementation){l(p,x.sibling),_=s(x,y.children||[]),_.return=p,p=_;break e}else{l(p,x);break}else t(p,x);x=x.sibling}_=kc(y,p.mode,_),_.return=p,p=_}return u(p);case U:return y=ca(y),Ne(p,x,y,_)}if(tt(y))return q(p,x,y,_);if(Je(y)){if(X=Je(y),typeof X!="function")throw Error(o(150));return y=X.call(y),Z(p,x,y,_)}if(typeof y.then=="function")return Ne(p,x,Bs(y),_);if(y.$$typeof===xe)return Ne(p,x,Os(p,y),_);Rs(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,x!==null&&x.tag===6?(l(p,x.sibling),_=s(x,y),_.return=p,p=_):(l(p,x),_=Ac(y,p.mode,_),_.return=p,p=_),u(p)):l(p,x)}return function(p,x,y,_){try{An=0;var X=Ne(p,x,y,_);return Qa=null,X}catch(G){if(G===Ya||G===Us)throw G;var re=gt(29,G,null,p.mode);return re.lanes=_,re.return=p,re}finally{}}}var oa=Zr(!0),Kr=Zr(!1),Sl=!1;function qc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function wl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function zl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(me&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=Ts(e),Mr(e,null,l),t}return _s(e,a,t,l),Ts(e)}function _n(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Ro(e,l)}}function Lc(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var s=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var u={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?s=i=u:i=i.next=u,l=l.next}while(l!==null);i===null?s=i=t:i=i.next=t}else s=i=t;l={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Yc=!1;function Tn(){if(Yc){var e=La;if(e!==null)throw e}}function Mn(e,t,l,a){Yc=!1;var s=e.updateQueue;Sl=!1;var i=s.firstBaseUpdate,u=s.lastBaseUpdate,d=s.shared.pending;if(d!==null){s.shared.pending=null;var m=d,j=m.next;m.next=null,u===null?i=j:u.next=j,u=m;var k=e.alternate;k!==null&&(k=k.updateQueue,d=k.lastBaseUpdate,d!==u&&(d===null?k.firstBaseUpdate=j:d.next=j,k.lastBaseUpdate=m))}if(i!==null){var T=s.baseState;u=0,k=j=m=null,d=i;do{var w=d.lane&-536870913,z=w!==d.lane;if(z?(te&w)===w:(a&w)===w){w!==0&&w===Ga&&(Yc=!0),k!==null&&(k=k.next={lane:0,tag:d.tag,payload:d.payload,callback:null,next:null});e:{var q=e,Z=d;w=t;var Ne=l;switch(Z.tag){case 1:if(q=Z.payload,typeof q=="function"){T=q.call(Ne,T,w);break e}T=q;break e;case 3:q.flags=q.flags&-65537|128;case 0:if(q=Z.payload,w=typeof q=="function"?q.call(Ne,T,w):q,w==null)break e;T=N({},T,w);break e;case 2:Sl=!0}}w=d.callback,w!==null&&(e.flags|=64,z&&(e.flags|=8192),z=s.callbacks,z===null?s.callbacks=[w]:z.push(w))}else z={lane:w,tag:d.tag,payload:d.payload,callback:d.callback,next:null},k===null?(j=k=z,m=T):k=k.next=z,u|=w;if(d=d.next,d===null){if(d=s.shared.pending,d===null)break;z=d,d=z.next,z.next=null,s.lastBaseUpdate=z,s.shared.pending=null}}while(!0);k===null&&(m=T),s.baseState=m,s.firstBaseUpdate=j,s.lastBaseUpdate=k,i===null&&(s.shared.lanes=0),Ml|=u,e.lanes=u,e.memoizedState=T}}function Jr(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function $r(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;ei?i:8;var u=A.T,d={};A.T=d,cu(e,!1,t,l);try{var m=s(),j=A.S;if(j!==null&&j(d,m),m!==null&&typeof m=="object"&&typeof m.then=="function"){var k=tg(m,a);On(e,t,k,jt(e))}else On(e,t,a,jt(e))}catch(T){On(e,t,{then:function(){},status:"rejected",reason:T},jt())}finally{O.p=i,u!==null&&d.types!==null&&(u.types=d.types),A.T=u}}function cg(){}function su(e,t,l,a){if(e.tag!==5)throw Error(o(476));var s=kd(e).queue;Ad(e,s,t,K,l===null?cg:function(){return _d(e),l(a)})}function kd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:el,lastRenderedState:K},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:el,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function _d(e){var t=kd(e);t.next===null&&(t=e.alternate.memoizedState),On(e,t.next.queue,{},jt())}function iu(){return Fe(Wn)}function Td(){return He().memoizedState}function Md(){return He().memoizedState}function ug(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=jt();e=wl(l);var a=zl(t,e,l);a!==null&&(rt(a,t,l),_n(a,t,l)),t={cache:Uc()},e.payload=t;return}t=t.return}}function og(e,t,l){var a=jt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Js(e)?Cd(t,l):(l=wc(e,t,l,a),l!==null&&(rt(l,e,a),Od(l,t,a)))}function Ed(e,t,l){var a=jt();On(e,t,l,a)}function On(e,t,l,a){var s={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Js(e))Cd(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var u=t.lastRenderedState,d=i(u,l);if(s.hasEagerState=!0,s.eagerState=d,xt(d,u))return _s(e,t,s,0),Se===null&&ks(),!1}catch{}finally{}if(l=wc(e,t,s,a),l!==null)return rt(l,e,a),Od(l,t,a),!0}return!1}function cu(e,t,l,a){if(a={lane:2,revertLane:qu(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Js(e)){if(t)throw Error(o(479))}else t=wc(e,l,a,2),t!==null&&rt(t,e,2)}function Js(e){var t=e.alternate;return e===$||t!==null&&t===$}function Cd(e,t){Va=Ls=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Od(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Ro(e,l)}}var Dn={readContext:Fe,use:Xs,useCallback:Oe,useContext:Oe,useEffect:Oe,useImperativeHandle:Oe,useLayoutEffect:Oe,useInsertionEffect:Oe,useMemo:Oe,useReducer:Oe,useRef:Oe,useState:Oe,useDebugValue:Oe,useDeferredValue:Oe,useTransition:Oe,useSyncExternalStore:Oe,useId:Oe,useHostTransitionStatus:Oe,useFormState:Oe,useActionState:Oe,useOptimistic:Oe,useMemoCache:Oe,useCacheRefresh:Oe};Dn.useEffectEvent=Oe;var Dd={readContext:Fe,use:Xs,useCallback:function(e,t){return lt().memoizedState=[e,t===void 0?null:t],e},useContext:Fe,useEffect:pd,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Zs(4194308,4,jd.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Zs(4194308,4,e,t)},useInsertionEffect:function(e,t){Zs(4,2,e,t)},useMemo:function(e,t){var l=lt();t=t===void 0?null:t;var a=e();if(ra){gl(!0);try{e()}finally{gl(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=lt();if(l!==void 0){var s=l(t);if(ra){gl(!0);try{l(t)}finally{gl(!1)}}}else s=t;return a.memoizedState=a.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},a.queue=e,e=e.dispatch=og.bind(null,$,e),[a.memoizedState,e]},useRef:function(e){var t=lt();return e={current:e},t.memoizedState=e},useState:function(e){e=eu(e);var t=e.queue,l=Ed.bind(null,$,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:au,useDeferredValue:function(e,t){var l=lt();return nu(l,e,t)},useTransition:function(){var e=eu(!1);return e=Ad.bind(null,$,e.queue,!0,!1),lt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=$,s=lt();if(ae){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),Se===null)throw Error(o(349));(te&127)!==0||td(a,t,l)}s.memoizedState=l;var i={value:l,getSnapshot:t};return s.queue=i,pd(ad.bind(null,a,i,e),[e]),a.flags|=2048,Ka(9,{destroy:void 0},ld.bind(null,a,i,l,t),null),l},useId:function(){var e=lt(),t=Se.identifierPrefix;if(ae){var l=Bt,a=Ht;l=(a&~(1<<32-ht(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Ys++,0<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof a.is=="string"?u.createElement("select",{is:a.is}):u.createElement("select"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is=="string"?u.createElement(s,{is:a.is}):u.createElement(s)}}i[$e]=t,i[nt]=a;e:for(u=t.child;u!==null;){if(u.tag===5||u.tag===6)i.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break e;for(;u.sibling===null;){if(u.return===null||u.return===t)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}t.stateNode=i;e:switch(Pe(i,s,a),s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ll(t)}}return Te(t),ju(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ll(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=Me.current,Ra(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,s=We,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[$e]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||em(e.nodeValue,l)),e||jl(t,!0)}else e=hi(e).createTextNode(a),e[$e]=t,t.stateNode=e}return Te(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ra(t),l!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[$e]=t}else aa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Te(t),e=!1}else l=Ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(bt(t),t):(bt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Te(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ra(t),a!==null&&a.dehydrated!==null){if(e===null){if(!s)throw Error(o(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));s[$e]=t}else aa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Te(t),s=!1}else s=Ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(bt(t),t):(bt(t),null)}return bt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,s=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(s=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==s&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Ps(t,t.updateQueue),Te(t),null);case 4:return ke(),e===null&&Qu(t.stateNode.containerInfo),Te(t),null;case 10:return It(t.type),Te(t),null;case 19:if(we(Ue),a=t.memoizedState,a===null)return Te(t),null;if(s=(t.flags&128)!==0,i=a.rendering,i===null)if(s)Hn(a,!1);else{if(De!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Gs(e),i!==null){for(t.flags|=128,Hn(a,!1),e=i.updateQueue,t.updateQueue=e,Ps(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Er(l,e),l=l.sibling;return ue(Ue,Ue.current&1|2),ae&&Wt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ft()>ni&&(t.flags|=128,s=!0,Hn(a,!1),t.lanes=4194304)}else{if(!s)if(e=Gs(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Ps(t,e),Hn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!ae)return Te(t),null}else 2*ft()-a.renderingStartTime>ni&&l!==536870912&&(t.flags|=128,s=!0,Hn(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(e=a.last,e!==null?e.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ft(),e.sibling=null,l=Ue.current,ue(Ue,s?l&1|2:l&1),ae&&Wt(t,a.treeForkCount),e):(Te(t),null);case 22:case 23:return bt(t),Xc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Te(t),t.subtreeFlags&6&&(t.flags|=8192)):Te(t),l=t.updateQueue,l!==null&&Ps(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&we(ia),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),It(Re),Te(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function hg(e,t){switch(Tc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return It(Re),ke(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Vt(t),null;case 31:if(t.memoizedState!==null){if(bt(t),t.alternate===null)throw Error(o(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(bt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return we(Ue),null;case 4:return ke(),null;case 10:return It(t.type),null;case 22:case 23:return bt(t),Xc(),e!==null&&we(ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return It(Re),null;case 25:return null;default:return null}}function nf(e,t){switch(Tc(t),t.tag){case 3:It(Re),ke();break;case 26:case 27:case 5:Vt(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&bt(t);break;case 13:bt(t);break;case 19:we(Ue);break;case 10:It(t.type);break;case 22:case 23:bt(t),Xc(),e!==null&&we(ia);break;case 24:It(Re)}}function Bn(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var s=a.next;l=s;do{if((l.tag&e)===e){a=void 0;var i=l.create,u=l.inst;a=i(),u.destroy=a}l=l.next}while(l!==s)}}catch(d){ve(t,t.return,d)}}function _l(e,t,l){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var i=s.next;a=i;do{if((a.tag&e)===e){var u=a.inst,d=u.destroy;if(d!==void 0){u.destroy=void 0,s=t;var m=l,j=d;try{j()}catch(k){ve(s,m,k)}}}a=a.next}while(a!==i)}}catch(k){ve(t,t.return,k)}}function sf(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{$r(t,l)}catch(a){ve(e,e.return,a)}}}function cf(e,t,l){l.props=da(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){ve(e,t,a)}}function Rn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(s){ve(e,t,s)}}function Rt(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(s){ve(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(s){ve(e,t,s)}else l.current=null}function uf(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(s){ve(e,e.return,s)}}function Nu(e,t,l){try{var a=e.stateNode;Hg(a,e.type,l,t),a[nt]=t}catch(s){ve(e,e.return,s)}}function of(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ul(e.type)||e.tag===4}function Su(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||of(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ul(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function wu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Kt));else if(a!==4&&(a===27&&Ul(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(wu(e,t,l),e=e.sibling;e!==null;)wu(e,t,l),e=e.sibling}function ei(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&Ul(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(ei(e,t,l),e=e.sibling;e!==null;)ei(e,t,l),e=e.sibling}function rf(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Pe(t,a,l),t[$e]=e,t[nt]=l}catch(i){ve(e,e.return,i)}}var al=!1,Le=!1,zu=!1,df=typeof WeakSet=="function"?WeakSet:Set,Ze=null;function xg(e,t){if(e=e.containerInfo,Zu=ji,e=Nr(e),bc(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var s=a.anchorOffset,i=a.focusNode;a=a.focusOffset;try{l.nodeType,i.nodeType}catch{l=null;break e}var u=0,d=-1,m=-1,j=0,k=0,T=e,w=null;t:for(;;){for(var z;T!==l||s!==0&&T.nodeType!==3||(d=u+s),T!==i||a!==0&&T.nodeType!==3||(m=u+a),T.nodeType===3&&(u+=T.nodeValue.length),(z=T.firstChild)!==null;)w=T,T=z;for(;;){if(T===e)break t;if(w===l&&++j===s&&(d=u),w===i&&++k===a&&(m=u),(z=T.nextSibling)!==null)break;T=w,w=T.parentNode}T=z}l=d===-1||m===-1?null:{start:d,end:m}}else l=null}l=l||{start:0,end:0}}else l=null;for(Ku={focusedElem:e,selectionRange:l},ji=!1,Ze=t;Ze!==null;)if(t=Ze,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ze=e;else for(;Ze!==null;){switch(t=Ze,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),Pe(i,a,l),i[$e]=e,Ve(i),a=i;break e;case"link":var u=pm("link","href",s).get(a+(l.href||""));if(u){for(var d=0;dNe&&(u=Ne,Ne=Z,Z=u);var p=yr(d,Z),x=yr(d,Ne);if(p&&x&&(z.rangeCount!==1||z.anchorNode!==p.node||z.anchorOffset!==p.offset||z.focusNode!==x.node||z.focusOffset!==x.offset)){var y=T.createRange();y.setStart(p.node,p.offset),z.removeAllRanges(),Z>Ne?(z.addRange(y),z.extend(x.node,x.offset)):(y.setEnd(x.node,x.offset),z.addRange(y))}}}}for(T=[],z=d;z=z.parentNode;)z.nodeType===1&&T.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;dl?32:l,A.T=null,l=Cu,Cu=null;var i=Cl,u=ul;if(Ye=0,Ia=Cl=null,ul=0,(me&6)!==0)throw Error(o(331));var d=me;if(me|=4,Nf(i.current),vf(i,i.current,u,l),me=d,Xn(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(un,i)}catch{}return!0}finally{O.p=s,A.T=a,Gf(e,t)}}function Yf(e,t,l){t=At(l,t),t=du(e.stateNode,t,2),e=zl(e,t,2),e!==null&&(rn(e,2),qt(e))}function ve(e,t,l){if(e.tag===3)Yf(e,e,l);else for(;t!==null;){if(t.tag===3){Yf(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(El===null||!El.has(a))){e=At(l,e),l=Yd(2),a=zl(t,l,2),a!==null&&(Qd(l,a,t,e),rn(a,2),qt(a));break}}t=t.return}}function Hu(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new bg;var s=new Set;a.set(t,s)}else s=a.get(t),s===void 0&&(s=new Set,a.set(t,s));s.has(l)||(_u=!0,s.add(l),e=Sg.bind(null,e,t,l),t.then(e,e))}function Sg(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Se===e&&(te&l)===l&&(De===4||De===3&&(te&62914560)===te&&300>ft()-ai?(me&2)===0&&Pa(e,0):Tu|=l,Fa===te&&(Fa=0)),qt(e)}function Qf(e,t){t===0&&(t=Ho()),e=ta(e,t),e!==null&&(rn(e,t),qt(e))}function wg(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Qf(e,l)}function zg(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,s=e.memoizedState;s!==null&&(l=s.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),Qf(e,l)}function Ag(e,t){return $i(e,t)}var ri=null,tn=null,Bu=!1,di=!1,Ru=!1,Dl=0;function qt(e){e!==tn&&e.next===null&&(tn===null?ri=tn=e:tn=tn.next=e),di=!0,Bu||(Bu=!0,_g())}function Xn(e,t){if(!Ru&&di){Ru=!0;do for(var l=!1,a=ri;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var i=0;else{var u=a.suspendedLanes,d=a.pingedLanes;i=(1<<31-ht(42|e)+1)-1,i&=s&~(u&~d),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,Kf(a,i))}else i=te,i=xs(a,a===Se?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||on(a,i)||(l=!0,Kf(a,i));a=a.next}while(l);Ru=!1}}function kg(){Xf()}function Xf(){di=Bu=!1;var e=0;Dl!==0&&Rg()&&(e=Dl);for(var t=ft(),l=null,a=ri;a!==null;){var s=a.next,i=Vf(a,t);i===0?(a.next=null,l===null?ri=s:l.next=s,s===null&&(tn=l)):(l=a,(e!==0||(i&3)!==0)&&(di=!0)),a=s}Ye!==0&&Ye!==5||Xn(e),Dl!==0&&(Dl=0)}function Vf(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes&-62914561;0d)break;var k=m.transferSize,T=m.initiatorType;k&&tm(T)&&(m=m.responseEnd,u+=k*(m"u"?null:document;function mm(e,t,l){var a=ln;if(a&&typeof t=="string"&&t){var s=wt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),fm.has(s)||(fm.add(s),e={rel:e,crossOrigin:l,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),Pe(t,"link",e),Ve(t),a.head.appendChild(t)))}}function Kg(e){ol.D(e),mm("dns-prefetch",e,null)}function Jg(e,t){ol.C(e,t),mm("preconnect",e,t)}function $g(e,t,l){ol.L(e,t,l);var a=ln;if(a&&e&&t){var s='link[rel="preload"][as="'+wt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+wt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+wt(l.imageSizes)+'"]')):s+='[href="'+wt(e)+'"]';var i=s;switch(t){case"style":i=an(e);break;case"script":i=nn(e)}Ct.has(i)||(e=N({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Ct.set(i,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Jn(i))||t==="script"&&a.querySelector($n(i))||(t=a.createElement("link"),Pe(t,"link",e),Ve(t),a.head.appendChild(t)))}}function Wg(e,t){ol.m(e,t);var l=ln;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+wt(a)+'"][href="'+wt(e)+'"]',i=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=nn(e)}if(!Ct.has(i)&&(e=N({rel:"modulepreload",href:e},t),Ct.set(i,e),l.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector($n(i)))return}a=l.createElement("link"),Pe(a,"link",e),Ve(a),l.head.appendChild(a)}}}function Fg(e,t,l){ol.S(e,t,l);var a=ln;if(a&&e){var s=za(a).hoistableStyles,i=an(e);t=t||"default";var u=s.get(i);if(!u){var d={loading:0,preload:null};if(u=a.querySelector(Jn(i)))d.loading=5;else{e=N({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Ct.get(i))&&eo(e,l);var m=u=a.createElement("link");Ve(m),Pe(m,"link",e),m._p=new Promise(function(j,k){m.onload=j,m.onerror=k}),m.addEventListener("load",function(){d.loading|=1}),m.addEventListener("error",function(){d.loading|=2}),d.loading|=4,gi(u,t,a)}u={type:"stylesheet",instance:u,count:1,state:d},s.set(i,u)}}}function Ig(e,t){ol.X(e,t);var l=ln;if(l&&e){var a=za(l).hoistableScripts,s=nn(e),i=a.get(s);i||(i=l.querySelector($n(s)),i||(e=N({src:e,async:!0},t),(t=Ct.get(s))&&to(e,t),i=l.createElement("script"),Ve(i),Pe(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(s,i))}}function Pg(e,t){ol.M(e,t);var l=ln;if(l&&e){var a=za(l).hoistableScripts,s=nn(e),i=a.get(s);i||(i=l.querySelector($n(s)),i||(e=N({src:e,async:!0,type:"module"},t),(t=Ct.get(s))&&to(e,t),i=l.createElement("script"),Ve(i),Pe(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(s,i))}}function hm(e,t,l,a){var s=(s=Me.current)?xi(s):null;if(!s)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=an(l.href),l=za(s).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=an(l.href);var i=za(s).hoistableStyles,u=i.get(e);if(u||(s=s.ownerDocument||s,u={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,u),(i=s.querySelector(Jn(e)))&&!i._p&&(u.instance=i,u.state.loading=5),Ct.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ct.set(e,l),i||e0(s,e,l,u.state))),t&&a===null)throw Error(o(528,""));return u}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=nn(l),l=za(s).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function an(e){return'href="'+wt(e)+'"'}function Jn(e){return'link[rel="stylesheet"]['+e+"]"}function xm(e){return N({},e,{"data-precedence":e.precedence,precedence:null})}function e0(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Pe(t,"link",l),Ve(t),e.head.appendChild(t))}function nn(e){return'[src="'+wt(e)+'"]'}function $n(e){return"script[async]"+e}function gm(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+wt(l.href)+'"]');if(a)return t.instance=a,Ve(a),a;var s=N({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ve(a),Pe(a,"style",s),gi(a,l.precedence,e),t.instance=a;case"stylesheet":s=an(l.href);var i=e.querySelector(Jn(s));if(i)return t.state.loading|=4,t.instance=i,Ve(i),i;a=xm(l),(s=Ct.get(s))&&eo(a,s),i=(e.ownerDocument||e).createElement("link"),Ve(i);var u=i;return u._p=new Promise(function(d,m){u.onload=d,u.onerror=m}),Pe(i,"link",a),t.state.loading|=4,gi(i,l.precedence,e),t.instance=i;case"script":return i=nn(l.src),(s=e.querySelector($n(i)))?(t.instance=s,Ve(s),s):(a=l,(s=Ct.get(i))&&(a=N({},l),to(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),Ve(s),Pe(s,"link",a),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,gi(a,l.precedence,e));return t.instance}function gi(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,i=s,u=0;u title"):null)}function t0(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function vm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function l0(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var s=an(a.href),i=t.querySelector(Jn(s));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=bi.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=i,Ve(i);return}i=t.ownerDocument||t,a=xm(a),(s=Ct.get(s))&&eo(a,s),i=i.createElement("link"),Ve(i);var u=i;u._p=new Promise(function(d,m){u.onload=d,u.onerror=m}),Pe(i,"link",a),l.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=bi.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var lo=0;function a0(e,t){return e.stylesheets&&e.count===0&&yi(e,e.stylesheets),0lo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function bi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)yi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vi=null;function yi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vi=new Map,t.forEach(n0,e),vi=null,bi.call(e))}function n0(e,t){if(!(t.state.loading&4)){var l=vi.get(e);if(l)var a=l.get(null);else{l=new Map,vi.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(r){console.error(r)}}return c(),oo.exports=A0(),oo.exports}var _0=k0();const T0=h0(_0),Bm=c=>{let r;const f=new Set,o=(v,E)=>{const N=typeof v=="function"?v(r):v;if(!Object.is(N,r)){const C=r;r=E??(typeof N!="object"||N===null)?N:Object.assign({},r,N),f.forEach(L=>L(r,C))}},h=()=>r,S={setState:o,getState:h,getInitialState:()=>M,subscribe:v=>(f.add(v),()=>f.delete(v))},M=r=c(o,h,S);return S},M0=(c=>c?Bm(c):Bm),E0=c=>c;function C0(c,r=E0){const f=as.useSyncExternalStore(c.subscribe,as.useCallback(()=>r(c.getState()),[c,r]),as.useCallback(()=>r(c.getInitialState()),[c,r]));return as.useDebugValue(f),f}const Rm=c=>{const r=M0(c),f=o=>C0(r,o);return Object.assign(f,r),f},fh=(c=>c?Rm(c):Rm),O0="";class Ui extends Error{constructor(r,f){super(f),this.status=r,this.name="ApiError"}}function D0(){const c=document.cookie.match(/(?:^|;\s*)__sp_csrf=([^;]*)/);return c?decodeURIComponent(c[1]):null}async function _i(c,r){const f=r?.method?.toUpperCase()??"GET",o=f==="POST"||f==="DELETE"||f==="PATCH"?D0():null,h=await fetch(`${O0}${c}`,{...r,credentials:"include",headers:{"Content-Type":"application/json",...o?{"X-CSRF-Token":o}:{},...r?.headers}});if(h.status===401)throw window.location.replace("/"),new Ui(401,"Unauthorized");if(h.status!==204){if(!h.ok){const g=await h.json().catch(()=>({error:h.statusText}));throw new Ui(h.status,g.error??`HTTP ${h.status}`)}return h.json()}}const et={get:c=>_i(c),post:(c,r)=>_i(c,{method:"POST",body:r!=null?JSON.stringify(r):void 0}),patch:(c,r)=>_i(c,{method:"PATCH",body:r!=null?JSON.stringify(r):void 0}),delete:(c,r)=>_i(c,{method:"DELETE",body:r!=null?JSON.stringify(r):void 0})},ml=fh(c=>({user:null,hydrated:!1,hydrate:async()=>{try{const r=await fetch("/api/user/me",{credentials:"include"});if(!r.ok){c({user:null,hydrated:!0});return}const f=await r.json();c({user:f,hydrated:!0})}catch{c({user:null,hydrated:!0})}},logout:async()=>{try{await et.post("/api/auth/logout")}catch(r){if(!(r instanceof Ui&&r.status===401))throw r}c({user:null}),window.location.replace("/")}}));/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const U0=c=>c.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),H0=c=>c.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,f,o)=>o?o.toUpperCase():f.toLowerCase()),qm=c=>{const r=H0(c);return r.charAt(0).toUpperCase()+r.slice(1)},mh=(...c)=>c.filter((r,f,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===f).join(" ").trim();/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var B0={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.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const R0=B.forwardRef(({color:c="currentColor",size:r=24,strokeWidth:f=2,absoluteStrokeWidth:o,className:h="",children:g,iconNode:b,...S},M)=>B.createElement("svg",{ref:M,...B0,width:r,height:r,stroke:c,strokeWidth:o?Number(f)*24/Number(r):f,className:mh("lucide",h),...S},[...b.map(([v,E])=>B.createElement(v,E)),...Array.isArray(g)?g:[g]]));/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const W=(c,r)=>{const f=B.forwardRef(({className:o,...h},g)=>B.createElement(R0,{ref:g,iconNode:r,className:mh(`lucide-${U0(qm(c))}`,`lucide-${c}`,o),...h}));return f.displayName=qm(c),f};/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const q0=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],hh=W("arrow-right",q0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const G0=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],xh=W("book-marked",G0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const L0=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Ke=W("book-open",L0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Y0=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],Yi=W("brain",Y0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Q0=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],X0=W("calendar",Q0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const V0=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ba=W("check",V0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Z0=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ss=W("chevron-left",Z0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const K0=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],cs=W("chevron-right",K0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const J0=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],gh=W("circle-check-big",J0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $0=[["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z",key:"1tn4o7"}],["path",{d:"m6.2 5.3 3.1 3.9",key:"iuk76l"}],["path",{d:"m12.4 3.4 3.1 4",key:"6hsd6n"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z",key:"ltgou9"}]],Gm=W("clapperboard",$0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const W0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Xl=W("clock",W0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const F0=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],I0=W("crown",F0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const P0=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],ph=W("download",P0);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const e1=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],bh=W("eye-off",e1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const t1=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vh=W("eye",t1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const l1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]],ga=W("film",l1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const a1=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],cn=W("fingerprint",a1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const n1=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],Ao=W("github",n1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const s1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],yh=W("globe",s1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const i1=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],jh=W("layout-dashboard",i1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const c1=[["path",{d:"M12 12H3",key:"18klou"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M12 18H3",key:"11ftsu"}],["path",{d:"m16 12 5 3-5 3v-6Z",key:"zpskkp"}]],u1=W("list-video",c1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const o1=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],us=W("list",o1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const r1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],ko=W("lock",r1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const d1=[["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"}]],f1=W("log-out",d1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const m1=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],Nh=W("mail",m1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const h1=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Lm=W("monitor",h1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const x1=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Ym=W("moon",x1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const g1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],p1=W("pen",g1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const b1=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Yl=W("play",b1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const v1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vo=W("plus",v1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const y1=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Vl=W("search",y1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const j1=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],pa=W("sparkles",j1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const N1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Qi=W("star",N1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const S1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Qm=W("sun",S1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const w1=[["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"}]],z1=W("trash-2",w1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const A1=[["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"}]],is=W("trending-up",A1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const k1=[["path",{d:"M7 21h10",key:"1b0cd5"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}]],os=W("tv-minimal",k1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _1=[["rect",{width:"20",height:"15",x:"2",y:"7",rx:"2",ry:"2",key:"10ag99"}],["polyline",{points:"17 2 12 7 7 2",key:"11pgbg"}]],_o=W("tv",_1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const T1=[["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"}]],To=W("user",T1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const M1=[["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"}]],E1=W("users",M1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const C1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Xi=W("x",C1);/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const O1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],hl=W("zap",O1);function Sh(c){var r,f,o="";if(typeof c=="string"||typeof c=="number")o+=c;else if(typeof c=="object")if(Array.isArray(c)){var h=c.length;for(r=0;r{const f=new Array(c.length+r.length);for(let o=0;o({classGroupId:c,validator:r}),zh=(c=new Map,r=null,f)=>({nextPart:c,validators:r,classGroupId:f}),Hi="-",Xm=[],H1="arbitrary..",B1=c=>{const r=q1(c),{conflictingClassGroups:f,conflictingClassGroupModifiers:o}=c;return{getClassGroupId:b=>{if(b.startsWith("[")&&b.endsWith("]"))return R1(b);const S=b.split(Hi),M=S[0]===""&&S.length>1?1:0;return Ah(S,M,r)},getConflictingClassGroupIds:(b,S)=>{if(S){const M=o[b],v=f[b];return M?v?D1(v,M):M:v||Xm}return f[b]||Xm}}},Ah=(c,r,f)=>{if(c.length-r===0)return f.classGroupId;const h=c[r],g=f.nextPart.get(h);if(g){const v=Ah(c,r+1,g);if(v)return v}const b=f.validators;if(b===null)return;const S=r===0?c.join(Hi):c.slice(r).join(Hi),M=b.length;for(let v=0;vc.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=c.slice(1,-1),f=r.indexOf(":"),o=r.slice(0,f);return o?H1+o:void 0})(),q1=c=>{const{theme:r,classGroups:f}=c;return G1(f,r)},G1=(c,r)=>{const f=zh();for(const o in c){const h=c[o];Mo(h,f,o,r)}return f},Mo=(c,r,f,o)=>{const h=c.length;for(let g=0;g{if(typeof c=="string"){Y1(c,r,f);return}if(typeof c=="function"){Q1(c,r,f,o);return}X1(c,r,f,o)},Y1=(c,r,f)=>{const o=c===""?r:kh(r,c);o.classGroupId=f},Q1=(c,r,f,o)=>{if(V1(c)){Mo(c(o),r,f,o);return}r.validators===null&&(r.validators=[]),r.validators.push(U1(f,c))},X1=(c,r,f,o)=>{const h=Object.entries(c),g=h.length;for(let b=0;b{let f=c;const o=r.split(Hi),h=o.length;for(let g=0;g"isThemeGetter"in c&&c.isThemeGetter===!0,Z1=c=>{if(c<1)return{get:()=>{},set:()=>{}};let r=0,f=Object.create(null),o=Object.create(null);const h=(g,b)=>{f[g]=b,r++,r>c&&(r=0,o=f,f=Object.create(null))};return{get(g){let b=f[g];if(b!==void 0)return b;if((b=o[g])!==void 0)return h(g,b),b},set(g,b){g in f?f[g]=b:h(g,b)}}},yo="!",Vm=":",K1=[],Zm=(c,r,f,o,h)=>({modifiers:c,hasImportantModifier:r,baseClassName:f,maybePostfixModifierPosition:o,isExternal:h}),J1=c=>{const{prefix:r,experimentalParseClassName:f}=c;let o=h=>{const g=[];let b=0,S=0,M=0,v;const E=h.length;for(let J=0;JM?v-M:void 0;return Zm(g,L,C,Q)};if(r){const h=r+Vm,g=o;o=b=>b.startsWith(h)?g(b.slice(h.length)):Zm(K1,!1,b,void 0,!0)}if(f){const h=o;o=g=>f({className:g,parseClassName:h})}return o},$1=c=>{const r=new Map;return c.orderSensitiveModifiers.forEach((f,o)=>{r.set(f,1e6+o)}),f=>{const o=[];let h=[];for(let g=0;g0&&(h.sort(),o.push(...h),h=[]),o.push(b)):h.push(b)}return h.length>0&&(h.sort(),o.push(...h)),o}},W1=c=>({cache:Z1(c.cacheSize),parseClassName:J1(c),sortModifiers:$1(c),postfixLookupClassGroupIds:F1(c),...B1(c)}),F1=c=>{const r=Object.create(null),f=c.postfixLookupClassGroups;if(f)for(let o=0;o{const{parseClassName:f,getClassGroupId:o,getConflictingClassGroupIds:h,sortModifiers:g,postfixLookupClassGroupIds:b}=r,S=[],M=c.trim().split(I1);let v="";for(let E=M.length-1;E>=0;E-=1){const N=M[E],{isExternal:C,modifiers:L,hasImportantModifier:Q,baseClassName:J,maybePostfixModifierPosition:Y}=f(N);if(C){v=N+(v.length>0?" "+v:v);continue}let ne=!!Y,fe;if(ne){const ge=J.substring(0,Y);fe=o(ge);const U=fe&&b[fe]?o(J):void 0;U&&U!==fe&&(fe=U,ne=!1)}else fe=o(J);if(!fe){if(!ne){v=N+(v.length>0?" "+v:v);continue}if(fe=o(J),!fe){v=N+(v.length>0?" "+v:v);continue}ne=!1}const xe=L.length===0?"":L.length===1?L[0]:g(L).join(":"),se=Q?xe+yo:xe,ce=se+fe;if(S.indexOf(ce)>-1)continue;S.push(ce);const V=h(fe,ne);for(let ge=0;ge0?" "+v:v)}return v},ep=(...c)=>{let r=0,f,o,h="";for(;r{if(typeof c=="string")return c;let r,f="";for(let o=0;o{let f,o,h,g;const b=M=>{const v=r.reduce((E,N)=>N(E),c());return f=W1(v),o=f.cache.get,h=f.cache.set,g=S,S(M)},S=M=>{const v=o(M);if(v)return v;const E=P1(M,f);return h(M,E),E};return g=b,(...M)=>g(ep(...M))},lp=[],Qe=c=>{const r=f=>f[c]||lp;return r.isThemeGetter=!0,r},Th=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Mh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ap=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,np=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sp=/\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$/,ip=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cp=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,up=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ll=c=>ap.test(c),I=c=>!!c&&!Number.isNaN(Number(c)),Gt=c=>!!c&&Number.isInteger(Number(c)),mo=c=>c.endsWith("%")&&I(c.slice(0,-1)),rl=c=>np.test(c),Eh=()=>!0,op=c=>sp.test(c)&&!ip.test(c),Eo=()=>!1,rp=c=>cp.test(c),dp=c=>up.test(c),fp=c=>!H(c)&&!R(c),mp=c=>c.startsWith("@container")&&(c[10]==="/"&&c[11]!==void 0||c[11]==="s"&&c[16]!==void 0&&c.startsWith("-size/",10)||c[11]==="n"&&c[18]!==void 0&&c.startsWith("-normal/",10)),hp=c=>Zl(c,Dh,Eo),H=c=>Th.test(c),ha=c=>Zl(c,Uh,op),Km=c=>Zl(c,Np,I),xp=c=>Zl(c,Bh,Eh),gp=c=>Zl(c,Hh,Eo),Jm=c=>Zl(c,Ch,Eo),pp=c=>Zl(c,Oh,dp),Ti=c=>Zl(c,Rh,rp),R=c=>Mh.test(c),ts=c=>va(c,Uh),bp=c=>va(c,Hh),$m=c=>va(c,Ch),vp=c=>va(c,Dh),yp=c=>va(c,Oh),Mi=c=>va(c,Rh,!0),jp=c=>va(c,Bh,!0),Zl=(c,r,f)=>{const o=Th.exec(c);return o?o[1]?r(o[1]):f(o[2]):!1},va=(c,r,f=!1)=>{const o=Mh.exec(c);return o?o[1]?r(o[1]):f:!1},Ch=c=>c==="position"||c==="percentage",Oh=c=>c==="image"||c==="url",Dh=c=>c==="length"||c==="size"||c==="bg-size",Uh=c=>c==="length",Np=c=>c==="number",Hh=c=>c==="family-name",Bh=c=>c==="number"||c==="weight",Rh=c=>c==="shadow",Sp=()=>{const c=Qe("color"),r=Qe("font"),f=Qe("text"),o=Qe("font-weight"),h=Qe("tracking"),g=Qe("leading"),b=Qe("breakpoint"),S=Qe("container"),M=Qe("spacing"),v=Qe("radius"),E=Qe("shadow"),N=Qe("inset-shadow"),C=Qe("text-shadow"),L=Qe("drop-shadow"),Q=Qe("blur"),J=Qe("perspective"),Y=Qe("aspect"),ne=Qe("ease"),fe=Qe("animate"),xe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],se=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ce=()=>[...se(),R,H],V=()=>["auto","hidden","clip","visible","scroll"],ge=()=>["auto","contain","none"],U=()=>[R,H,M],Be=()=>[Ll,"full","auto",...U()],Kl=()=>[Gt,"none","subgrid",R,H],Yt=()=>["auto",{span:["full",Gt,R,H]},Gt,R,H],Je=()=>[Gt,"auto",R,H],Jl=()=>["auto","min","max","fr",R,H],Qt=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],tt=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...U()],O=()=>[Ll,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],K=()=>[Ll,"screen","full","dvw","lvw","svw","min","max","fit",...U()],pe=()=>[Ll,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],D=()=>[c,R,H],Xe=()=>[...se(),$m,Jm,{position:[R,H]}],we=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",vp,hp,{size:[R,H]}],Ce=()=>[mo,ts,ha],ze=()=>["","none","full",v,R,H],Me=()=>["",I,ts,ha],Xt=()=>["solid","dashed","dotted","double"],$l=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ke=()=>[I,mo,$m,Jm],ya=()=>["","none",Q,R,H],Vt=()=>["none",I,R,H],xl=()=>["none",I,R,H],ja=()=>[I,R,H],Nt=()=>[Ll,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rl],breakpoint:[rl],color:[Eh],container:[rl],"drop-shadow":[rl],ease:["in","out","in-out"],font:[fp],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rl],shadow:[rl],spacing:["px",I],text:[rl],"text-shadow":[rl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ll,H,R,Y]}],container:["container"],"container-type":[{"@container":["","normal","size",R,H]}],"container-named":[mp],columns:[{columns:[I,H,R,S]}],"break-after":[{"break-after":xe()}],"break-before":[{"break-before":xe()}],"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"],sr:["sr-only","not-sr-only"],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:ce()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:ge()}],"overscroll-x":[{"overscroll-x":ge()}],"overscroll-y":[{"overscroll-y":ge()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Be()}],"inset-x":[{"inset-x":Be()}],"inset-y":[{"inset-y":Be()}],start:[{"inset-s":Be(),start:Be()}],end:[{"inset-e":Be(),end:Be()}],"inset-bs":[{"inset-bs":Be()}],"inset-be":[{"inset-be":Be()}],top:[{top:Be()}],right:[{right:Be()}],bottom:[{bottom:Be()}],left:[{left:Be()}],visibility:["visible","invisible","collapse"],z:[{z:[Gt,"auto",R,H]}],basis:[{basis:[Ll,"full","auto",S,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[I,Ll,"auto","initial","none",H]}],grow:[{grow:["",I,R,H]}],shrink:[{shrink:["",I,R,H]}],order:[{order:[Gt,"first","last","none",R,H]}],"grid-cols":[{"grid-cols":Kl()}],"col-start-end":[{col:Yt()}],"col-start":[{"col-start":Je()}],"col-end":[{"col-end":Je()}],"grid-rows":[{"grid-rows":Kl()}],"row-start-end":[{row:Yt()}],"row-start":[{"row-start":Je()}],"row-end":[{"row-end":Je()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Jl()}],"auto-rows":[{"auto-rows":Jl()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...Qt(),"normal"]}],"justify-items":[{"justify-items":[...tt(),"normal"]}],"justify-self":[{"justify-self":["auto",...tt()]}],"align-content":[{content:["normal",...Qt()]}],"align-items":[{items:[...tt(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...tt(),{baseline:["","last"]}]}],"place-content":[{"place-content":Qt()}],"place-items":[{"place-items":[...tt(),"baseline"]}],"place-self":[{"place-self":["auto",...tt()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...pe()]}],"min-block-size":[{"min-block":["auto",...pe()]}],"max-block-size":[{"max-block":["none",...pe()]}],w:[{w:[S,"screen",...O()]}],"min-w":[{"min-w":[S,"screen","none",...O()]}],"max-w":[{"max-w":[S,"screen","none","prose",{screen:[b]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",f,ts,ha]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,jp,xp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",mo,H]}],"font-family":[{font:[bp,gp,r]}],"font-features":[{"font-features":[H]}],"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:[h,R,H]}],"line-clamp":[{"line-clamp":[I,"none",R,Km]}],leading:[{leading:[g,...U()]}],"list-image":[{"list-image":["none",R,H]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",R,H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Xt(),"wavy"]}],"text-decoration-thickness":[{decoration:[I,"from-font","auto",R,ha]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[I,"auto",R,H]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"tab-size":[{tab:[Gt,R,H]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",R,H]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",R,H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Xe()}],"bg-repeat":[{bg:we()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Gt,R,H],radial:["",R,H],conic:[Gt,R,H]},yp,pp]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:Ce()}],"gradient-via-pos":[{via:Ce()}],"gradient-to-pos":[{to:Ce()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:ze()}],"rounded-s":[{"rounded-s":ze()}],"rounded-e":[{"rounded-e":ze()}],"rounded-t":[{"rounded-t":ze()}],"rounded-r":[{"rounded-r":ze()}],"rounded-b":[{"rounded-b":ze()}],"rounded-l":[{"rounded-l":ze()}],"rounded-ss":[{"rounded-ss":ze()}],"rounded-se":[{"rounded-se":ze()}],"rounded-ee":[{"rounded-ee":ze()}],"rounded-es":[{"rounded-es":ze()}],"rounded-tl":[{"rounded-tl":ze()}],"rounded-tr":[{"rounded-tr":ze()}],"rounded-br":[{"rounded-br":ze()}],"rounded-bl":[{"rounded-bl":ze()}],"border-w":[{border:Me()}],"border-w-x":[{"border-x":Me()}],"border-w-y":[{"border-y":Me()}],"border-w-s":[{"border-s":Me()}],"border-w-e":[{"border-e":Me()}],"border-w-bs":[{"border-bs":Me()}],"border-w-be":[{"border-be":Me()}],"border-w-t":[{"border-t":Me()}],"border-w-r":[{"border-r":Me()}],"border-w-b":[{"border-b":Me()}],"border-w-l":[{"border-l":Me()}],"divide-x":[{"divide-x":Me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Xt(),"hidden","none"]}],"divide-style":[{divide:[...Xt(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...Xt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[I,R,H]}],"outline-w":[{outline:["",I,ts,ha]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",E,Mi,Ti]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",N,Mi,Ti]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:Me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[I,ha]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":Me()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",C,Mi,Ti]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[I,R,H]}],"mix-blend":[{"mix-blend":[...$l(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$l()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[I]}],"mask-image-linear-from-pos":[{"mask-linear-from":ke()}],"mask-image-linear-to-pos":[{"mask-linear-to":ke()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":ke()}],"mask-image-t-to-pos":[{"mask-t-to":ke()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":ke()}],"mask-image-r-to-pos":[{"mask-r-to":ke()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":ke()}],"mask-image-b-to-pos":[{"mask-b-to":ke()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":ke()}],"mask-image-l-to-pos":[{"mask-l-to":ke()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":ke()}],"mask-image-x-to-pos":[{"mask-x-to":ke()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":ke()}],"mask-image-y-to-pos":[{"mask-y-to":ke()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[R,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":ke()}],"mask-image-radial-to-pos":[{"mask-radial-to":ke()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":se()}],"mask-image-conic-pos":[{"mask-conic":[I]}],"mask-image-conic-from-pos":[{"mask-conic-from":ke()}],"mask-image-conic-to-pos":[{"mask-conic-to":ke()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Xe()}],"mask-repeat":[{mask:we()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",R,H]}],filter:[{filter:["","none",R,H]}],blur:[{blur:ya()}],brightness:[{brightness:[I,R,H]}],contrast:[{contrast:[I,R,H]}],"drop-shadow":[{"drop-shadow":["","none",L,Mi,Ti]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",I,R,H]}],"hue-rotate":[{"hue-rotate":[I,R,H]}],invert:[{invert:["",I,R,H]}],saturate:[{saturate:[I,R,H]}],sepia:[{sepia:["",I,R,H]}],"backdrop-filter":[{"backdrop-filter":["","none",R,H]}],"backdrop-blur":[{"backdrop-blur":ya()}],"backdrop-brightness":[{"backdrop-brightness":[I,R,H]}],"backdrop-contrast":[{"backdrop-contrast":[I,R,H]}],"backdrop-grayscale":[{"backdrop-grayscale":["",I,R,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[I,R,H]}],"backdrop-invert":[{"backdrop-invert":["",I,R,H]}],"backdrop-opacity":[{"backdrop-opacity":[I,R,H]}],"backdrop-saturate":[{"backdrop-saturate":[I,R,H]}],"backdrop-sepia":[{"backdrop-sepia":["",I,R,H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",R,H]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[I,"initial",R,H]}],ease:[{ease:["linear","initial",ne,R,H]}],delay:[{delay:[I,R,H]}],animate:[{animate:["none",fe,R,H]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[J,R,H]}],"perspective-origin":[{"perspective-origin":ce()}],rotate:[{rotate:Vt()}],"rotate-x":[{"rotate-x":Vt()}],"rotate-y":[{"rotate-y":Vt()}],"rotate-z":[{"rotate-z":Vt()}],scale:[{scale:xl()}],"scale-x":[{"scale-x":xl()}],"scale-y":[{"scale-y":xl()}],"scale-z":[{"scale-z":xl()}],"scale-3d":["scale-3d"],skew:[{skew:ja()}],"skew-x":[{"skew-x":ja()}],"skew-y":[{"skew-y":ja()}],transform:[{transform:[R,H,"","none","gpu","cpu"]}],"transform-origin":[{origin:ce()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Nt()}],"translate-x":[{"translate-x":Nt()}],"translate-y":[{"translate-y":Nt()}],"translate-z":[{"translate-z":Nt()}],"translate-none":["translate-none"],zoom:[{zoom:[Gt,R,H]}],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",R,H]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",R,H]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[I,ts,ha,Km]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},wp=tp(Sp);function ie(...c){return wp(wh(c))}function zp(c){if(!c)return"";const r=Math.floor(c/60),f=c%60;return r>0?`${r}h ${f>0?`${f}m`:""}`.trim():`${f}m`}function Ap(c,r){let f;try{f=c()}catch{return}return{getItem:h=>{var g;const b=M=>M===null?null:JSON.parse(M,void 0),S=(g=f.getItem(h))!=null?g:null;return S instanceof Promise?S.then(b):b(S)},setItem:(h,g)=>f.setItem(h,JSON.stringify(g,void 0)),removeItem:h=>f.removeItem(h)}}const jo=c=>r=>{try{const f=c(r);return f instanceof Promise?f:{then(o){return jo(o)(f)},catch(o){return this}}}catch(f){return{then(o){return this},catch(o){return jo(o)(f)}}}},kp=(c,r)=>(f,o,h)=>{let g={storage:Ap(()=>window.localStorage),partialize:Y=>Y,version:0,merge:(Y,ne)=>({...ne,...Y}),...r},b=!1,S=0;const M=new Set,v=new Set;let E=g.storage;if(!E)return c((...Y)=>{console.warn(`[zustand persist middleware] Unable to update item '${g.name}', the given storage is currently unavailable.`),f(...Y)},o,h);const N=()=>{const Y=g.partialize({...o()});return E.setItem(g.name,{state:Y,version:g.version})},C=h.setState;h.setState=(Y,ne)=>(C(Y,ne),N());const L=c((...Y)=>(f(...Y),N()),o,h);h.getInitialState=()=>L;let Q;const J=()=>{var Y,ne;if(!E)return;const fe=++S;b=!1,M.forEach(se=>{var ce;return se((ce=o())!=null?ce:L)});const xe=((ne=g.onRehydrateStorage)==null?void 0:ne.call(g,(Y=o())!=null?Y:L))||void 0;return jo(E.getItem.bind(E))(g.name).then(se=>{if(se)if(typeof se.version=="number"&&se.version!==g.version){if(g.migrate){const ce=g.migrate(se.state,se.version);return ce instanceof Promise?ce.then(V=>[!0,V]):[!0,ce]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,se.state];return[!1,void 0]}).then(se=>{var ce;if(fe!==S)return;const[V,ge]=se;if(Q=g.merge(ge,(ce=o())!=null?ce:L),f(Q,!0),V)return N()}).then(()=>{fe===S&&(xe?.(o(),void 0),Q=o(),b=!0,v.forEach(se=>se(Q)))}).catch(se=>{fe===S&&xe?.(void 0,se)})};return h.persist={setOptions:Y=>{g={...g,...Y},Y.storage&&(E=Y.storage)},clearStorage:()=>{E?.removeItem(g.name)},getOptions:()=>g,rehydrate:()=>J(),hasHydrated:()=>b,onHydrate:Y=>(M.add(Y),()=>{M.delete(Y)}),onFinishHydration:Y=>(v.add(Y),()=>{v.delete(Y)})},g.skipHydration||J(),Q||L},_p=kp,ho=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",No=c=>document.documentElement.classList.toggle("dark",c==="dark"),Bi=fh()(_p((c,r)=>({theme:"system",resolved:ho(),setTheme:f=>{const o=f==="system"?ho():f;No(o),c({theme:f,resolved:o})}}),{name:"sp-theme",onRehydrateStorage:()=>c=>{if(!c)return;const r=c.theme==="system"?ho():c.theme;No(r),c.resolved=r}}));typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",c=>{if(Bi.getState().theme==="system"){const r=c.matches?"dark":"light";No(r),Bi.setState({resolved:r})}});function rs({compact:c=!1}){const{theme:r,setTheme:f}=Bi();if(c){const o=r==="dark"?Ym:r==="light"?Qm:Lm,h=r==="dark"?"light":r==="light"?"system":"dark";return n.jsx("button",{onClick:()=>f(h),className:"flex h-8 w-8 items-center justify-center rounded-[8px] text-fg-muted transition-colors hover:bg-surface hover:text-fg","aria-label":"Toggle theme",children:n.jsx(o,{className:"h-4 w-4"})})}return n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[13px] text-fg-muted",children:"Appearance"}),n.jsx("div",{className:"flex rounded-[8px] border border-border bg-surface p-0.5 gap-0.5",children:["light","system","dark"].map(o=>{const h=o==="light"?Qm:o==="dark"?Ym:Lm;return n.jsx("button",{onClick:()=>f(o),className:ie("flex h-6 w-6 items-center justify-center rounded-[6px] transition-all",r===o?"bg-elevated text-fg shadow-sm":"text-fg-subtle hover:text-fg-muted"),"aria-label":`${o} mode`,children:n.jsx(h,{className:"h-3.5 w-3.5"})},o)})})]})}const Tp=[{to:"/dashboard",icon:jh,label:"Home"},{to:"/search",icon:Vl,label:"Discover"},{to:"/history",icon:Xl,label:"History"},{to:"/lists",icon:u1,label:"Lists"}],Mp=[{to:"/books",icon:Ke,label:"Reading Shelf"}],Ep=[{to:"/profile",icon:To,label:"Profile"}];function Wm({to:c,icon:r,label:f}){return n.jsx(So,{to:c,className:({isActive:o})=>ie("group flex items-center gap-3 rounded-lg px-3 py-2.5 text-[13.5px] font-medium transition-all duration-150",o?"bg-accent/10 text-accent":"text-fg-muted hover:bg-surface hover:text-fg"),children:({isActive:o})=>n.jsxs(n.Fragment,{children:[n.jsx(r,{className:ie("h-[17px] w-[17px] shrink-0 transition-colors",o?"text-accent":"text-fg-subtle group-hover:text-fg-muted")}),f]})})}function Cp(){return n.jsxs("aside",{className:"fixed inset-y-0 left-0 z-40 hidden w-60 flex-col border-r border-border bg-bg lg:flex",children:[n.jsxs("div",{className:"flex h-14 shrink-0 items-center gap-2.5 px-5",children:[n.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[8px] bg-gradient-to-br from-accent to-violet-600 shadow-sm",children:n.jsx(hl,{className:"h-4 w-4 text-white",fill:"white"})}),n.jsx("span",{className:"text-[15px] font-bold tracking-tight text-fg",children:"StreamPulse"})]}),n.jsxs("nav",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-4",children:[n.jsxs("div",{children:[n.jsx("p",{className:"mb-1 px-3 text-[10px] font-bold uppercase tracking-widest text-fg-subtle",children:"Watch"}),n.jsx("div",{className:"space-y-0.5",children:Tp.map(c=>n.jsx(Wm,{...c},c.to))})]}),n.jsxs("div",{children:[n.jsx("p",{className:"mb-1 px-3 text-[10px] font-bold uppercase tracking-widest text-fg-subtle",children:"Read"}),n.jsx("div",{className:"space-y-0.5",children:Mp.map(c=>n.jsx(So,{to:c.to,className:({isActive:r})=>ie("group flex items-center gap-3 rounded-lg px-3 py-2.5 text-[13.5px] font-medium transition-all duration-150",r?"bg-book/10 text-book":"text-fg-muted hover:bg-surface hover:text-fg"),children:({isActive:r})=>n.jsxs(n.Fragment,{children:[n.jsx(Ke,{className:ie("h-[17px] w-[17px] shrink-0 transition-colors",r?"text-book":"text-fg-subtle group-hover:text-fg-muted")}),"Reading Shelf"]})},c.to))})]})]}),n.jsxs("div",{className:"border-t border-border px-3 py-3 space-y-0.5",children:[Ep.map(c=>n.jsx(Wm,{...c},c.to)),n.jsx("div",{className:"px-3 pt-2",children:n.jsx(rs,{})})]})]})}const Op={"/dashboard":"Home","/search":"Discover","/history":"History","/lists":"Lists","/books":"Reading Shelf","/profile":"Profile"};function Dp(){const{pathname:c}=dh(),{user:r}=ml(),f=Op[c]??"StreamPulse";return n.jsxs("header",{className:ie("sticky top-0 z-30 flex h-14 items-center justify-between px-4 lg:px-6","glass-heavy border-b border-border"),children:[n.jsxs("div",{className:"flex items-center gap-2.5 lg:gap-0",children:[n.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[8px] bg-gradient-to-br from-accent to-violet-600 lg:hidden",children:n.jsx(hl,{className:"h-3.5 w-3.5 text-white",fill:"white"})}),n.jsxs("span",{className:"text-[15px] font-bold text-fg lg:text-[14px] lg:font-semibold lg:text-fg-muted",children:[n.jsx("span",{className:"lg:hidden",children:"StreamPulse"}),n.jsx("span",{className:"hidden lg:inline",children:f})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[c!=="/search"&&n.jsx(at,{to:"/search",className:"flex h-8 w-8 items-center justify-center rounded-lg text-fg-muted transition-colors hover:bg-surface hover:text-fg lg:hidden",children:n.jsx(Vl,{className:"h-4 w-4"})}),n.jsx("div",{className:"lg:hidden",children:n.jsx(rs,{compact:!0})}),r&&n.jsx(at,{to:"/profile",children:n.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-gradient-to-br from-accent/80 to-violet-600/80 text-[12px] font-bold text-white shadow-sm select-none",children:(r.display_name??r.username).charAt(0).toUpperCase()})})]})]})}const Up=[{to:"/dashboard",icon:jh,label:"Home"},{to:"/search",icon:Vl,label:"Search"},{to:"/history",icon:Xl,label:"History"},{to:"/books",icon:Ke,label:"Books"},{to:"/profile",icon:To,label:"Profile"}];function Hp(){return n.jsx("nav",{className:"fixed inset-x-0 bottom-0 z-40 glass-heavy border-t border-border safe-bottom lg:hidden",children:n.jsx("div",{className:"flex items-center px-2",children:Up.map(({to:c,icon:r,label:f})=>n.jsx(So,{to:c,className:({isActive:o})=>ie("flex flex-1 flex-col items-center gap-1 py-2.5 transition-colors rounded-lg mx-0.5",o?"text-accent":"text-fg-muted"),children:({isActive:o})=>n.jsxs(n.Fragment,{children:[n.jsx("div",{className:ie("flex h-8 w-8 items-center justify-center rounded-lg transition-colors",o&&"bg-accent/10"),children:n.jsx(r,{className:ie("h-5 w-5",o&&"drop-shadow-[0_0_8px_var(--accent)]")})}),n.jsx("span",{className:"text-[10px] font-medium",children:f})]})},c))})})}function Bp(){const c=dh();return n.jsxs("div",{className:"flex min-h-dvh bg-bg",children:[n.jsx(Cp,{}),n.jsxs("div",{className:"flex flex-1 flex-col lg:ml-60",children:[n.jsx(Dp,{}),n.jsx("main",{className:"flex-1 overflow-x-hidden pb-20 lg:pb-0",children:n.jsx(Ae.div,{initial:{opacity:0,y:14},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.22,ease:[.22,1,.36,1]},children:n.jsx(b0,{})},c.pathname)})]}),n.jsx(Hp,{})]})}function he({className:c,rounded:r="md",...f}){return n.jsx("div",{className:ie("animate-shimmer",r==="sm"&&"rounded-sm",r==="md"&&"rounded-md",r==="lg"&&"rounded-lg",r==="full"&&"rounded-full",c),...f})}const qh={sm:"w-[100px]",md:"w-[148px]",lg:"w-[190px]"};function Gh({mediaKey:c,title:r,year:f,posterUrl:o,type:h,rating:g,vibe:b,watched:S=!1,size:M="md",className:v}){const[E,N]=B.useState(!1),[C,L]=B.useState(!1),Q=c.split("_")[1];return n.jsx(Ae.div,{className:ie("group relative shrink-0 cursor-pointer",qh[M],v),whileHover:{scale:1.035,y:-4},whileTap:{scale:.97},transition:{type:"spring",stiffness:400,damping:28},children:n.jsxs(at,{to:`/${h}/${Q}`,className:"block",children:[n.jsxs("div",{className:"poster relative overflow-hidden rounded-xl bg-surface shadow-lg transition-shadow duration-300 group-hover:shadow-2xl group-hover:shadow-black/40",children:[!E&&n.jsx(he,{className:"absolute inset-0 h-full w-full",rounded:"lg"}),o&&!C?n.jsx("img",{src:o,alt:r,className:ie("h-full w-full object-cover transition-all duration-500",E?"opacity-100":"opacity-0","group-hover:scale-[1.04] group-hover:brightness-[0.75]"),onLoad:()=>N(!0),onError:()=>{L(!0),N(!0)},loading:"lazy",decoding:"async"}):n.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-gradient-to-br from-surface to-elevated p-3 gap-2",children:[n.jsx("div",{className:"rounded-full bg-border/40 p-3",children:n.jsx(Yl,{className:"h-5 w-5 text-fg-subtle"})}),n.jsx("span",{className:"text-center text-[10px] font-medium text-fg-muted leading-snug",children:r})]}),n.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center opacity-0 transition-opacity duration-200 group-hover:opacity-100",children:[n.jsx("div",{className:"flex h-11 w-11 items-center justify-center rounded-full bg-white/90 shadow-xl backdrop-blur-sm ring-2 ring-white/20 dark:bg-black/70",children:n.jsx(Yl,{className:"ml-0.5 h-5 w-5 text-fg",fill:"currentColor"})}),g!=null&&n.jsxs("div",{className:"absolute bottom-2 left-2 flex items-center gap-1 rounded-full bg-black/60 px-2 py-0.5 backdrop-blur-sm",children:[n.jsx(Qi,{className:"h-2.5 w-2.5 fill-yellow-400 text-yellow-400"}),n.jsx("span",{className:"text-[10px] font-semibold text-white",children:g.toFixed(1)})]})]}),S&&n.jsx("div",{className:"absolute right-1.5 top-1.5 flex h-5 w-5 items-center justify-center rounded-full bg-accent shadow-md",children:n.jsx(ba,{className:"h-3 w-3 text-white",strokeWidth:3})}),n.jsx("div",{className:"absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-black/50 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-0"})]}),n.jsxs("div",{className:"mt-2 space-y-0.5 px-0.5",children:[n.jsx("p",{className:"truncate text-[13px] font-semibold text-fg leading-tight",children:r}),n.jsxs("p",{className:"text-[11px] text-fg-muted",children:[f&&n.jsx("span",{children:f}),f&&b&&n.jsx("span",{className:"mx-1 text-fg-subtle",children:"·"}),b&&n.jsx("span",{className:"truncate",children:b})]})]})]})})}function Lh({size:c="md"}){const r=qh[c];return n.jsxs("div",{className:ie("shrink-0",r),children:[n.jsx(he,{className:"poster rounded-xl"}),n.jsx(he,{className:"mt-2 h-3.5 w-3/4 rounded-md"}),n.jsx(he,{className:"mt-1 h-3 w-1/2 rounded-md"})]})}function Rp({title:c,subtitle:r,href:f,items:o,loading:h=!1,skeletonCount:g=8,className:b}){const S=B.useRef(null),M=v=>{S.current?.scrollBy({left:v==="right"?320:-320,behavior:"smooth"})};return n.jsxs("section",{className:ie("relative",b),children:[n.jsxs("div",{className:"mb-3 flex items-center justify-between px-4 lg:px-6",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-baseline gap-2.5",children:[n.jsx("h2",{className:"text-[17px] font-bold text-fg",children:c}),f&&n.jsx(at,{to:f,className:"text-[13px] font-medium text-accent hover:underline",children:"See all"})]}),r&&n.jsx("p",{className:"mt-0.5 text-[12px] text-fg-muted",children:r})]}),n.jsx("div",{className:"hidden gap-1 lg:flex",children:["left","right"].map(v=>n.jsx("button",{onClick:()=>M(v),className:"flex h-7 w-7 items-center justify-center rounded-full border border-border bg-surface/80 text-fg-muted transition-all hover:bg-elevated hover:text-fg hover:border-accent/30",children:v==="left"?n.jsx(ss,{className:"h-3.5 w-3.5"}):n.jsx(cs,{className:"h-3.5 w-3.5"})},v))})]}),n.jsx("div",{className:"relative",children:n.jsx("div",{ref:S,className:"scrollbar-hide flex gap-3 overflow-x-auto px-4 pb-2 lg:px-6",style:{WebkitMaskImage:"linear-gradient(to right, transparent 0%, black 2%, black 94%, transparent 100%)"},children:h?Array.from({length:g}).map((v,E)=>n.jsx(Lh,{},E)):o?.map(v=>n.jsx(Gh,{mediaKey:v.media_key,title:v.title,year:v.release_year,posterUrl:v.poster_url,type:v.media_type,vibe:v.ai_vibe},v.media_key))})})]})}function Ei({label:c,value:r,icon:f,color:o,loading:h}){return h?n.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-border/50 bg-surface/60 px-4 py-3",children:[n.jsx(he,{className:"h-8 w-8 rounded-lg"}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(he,{className:"h-5 w-12 rounded"}),n.jsx(he,{className:"h-3 w-16 rounded"})]})]}):n.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-border/40 bg-surface/60 px-4 py-3 transition-colors hover:bg-surface",children:[n.jsx("div",{className:ie("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg",o),children:f}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[20px] font-bold leading-tight text-fg",children:(r??0).toLocaleString()}),n.jsx("p",{className:"text-[11px] font-medium text-fg-muted",children:c})]})]})}function qp({record:c}){const r=c.media_key.startsWith("show_"),f=c.media_key.split("_")[1],o=r?"show":"movie",h=Gp(c.watched_at);return n.jsxs(at,{to:`/${o}/${f}`,className:"group flex items-center gap-3 rounded-xl px-3 py-2.5 -mx-1 transition-colors hover:bg-surface",children:[n.jsx("div",{className:"relative h-14 w-10 shrink-0 overflow-hidden rounded-[8px] bg-elevated shadow-sm",children:c.poster_url?n.jsx("img",{src:c.poster_url,alt:c.title??"",className:"h-full w-full object-cover transition-transform duration-300 group-hover:scale-105",loading:"lazy"}):n.jsx("div",{className:"flex h-full w-full items-center justify-center bg-gradient-to-br from-surface to-elevated",children:r?n.jsx(os,{className:"h-4 w-4 text-fg-subtle"}):n.jsx(ga,{className:"h-4 w-4 text-fg-subtle"})})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"truncate text-[13px] font-semibold text-fg",children:c.title??"Unknown title"}),n.jsxs("p",{className:"text-[11px] text-fg-muted",children:[c.release_year&&n.jsx("span",{children:c.release_year}),c.release_year&&h&&n.jsx("span",{className:"mx-1.5 text-fg-subtle",children:"·"}),h&&n.jsx("span",{className:"text-fg-subtle",children:h})]})]}),n.jsx("div",{className:"shrink-0 opacity-0 transition-opacity group-hover:opacity-100",children:n.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-accent/10",children:n.jsx(Yl,{className:"ml-0.5 h-3 w-3 text-accent",fill:"currentColor"})})})]})}function Gp(c){const r=Date.now()-new Date(c).getTime(),f=Math.floor(r/6e4);if(f<60)return`${f}m ago`;const o=Math.floor(f/60);if(o<24)return`${o}h ago`;const h=Math.floor(o/24);return h<7?`${h}d ago`:new Date(c).toLocaleDateString("en-US",{month:"short",day:"numeric"})}function Lp(){const{user:c}=ml(),{data:r,isLoading:f}=dl({queryKey:["dashboard"],queryFn:()=>et.get("/api/dashboard")}),{data:o,isLoading:h}=dl({queryKey:["trends"],queryFn:()=>et.get("/api/trends"),staleTime:300*1e3}),g=new Date().getHours(),b=g<5?"Good night":g<12?"Good morning":g<17?"Good afternoon":"Good evening",S=c?.display_name??c?.username??"",M=r?.recent??[],v=o?.top_10??[];return n.jsxs("div",{className:"animate-fade-up",children:[n.jsxs("div",{className:"relative overflow-hidden px-4 pb-6 pt-8 lg:px-6 lg:pt-10",children:[n.jsxs("div",{className:"pointer-events-none absolute inset-0",children:[n.jsx("div",{className:"absolute -top-20 left-1/4 h-64 w-64 rounded-full bg-accent/6 blur-[100px]"}),n.jsx("div",{className:"absolute -top-10 right-1/4 h-48 w-48 rounded-full bg-book/5 blur-[80px]"})]}),n.jsxs("div",{className:"relative",children:[n.jsxs("h1",{className:"text-[28px] font-bold tracking-tight text-fg lg:text-[32px]",children:[b,S?`, ${S}`:""]}),n.jsx("p",{className:"mt-1 text-[14px] text-fg-muted",children:"What are you watching or reading today?"}),n.jsx("div",{className:"mt-4 flex gap-2 flex-wrap",children:[{to:"/search",icon:is,label:"Discover",color:"text-accent"},{to:"/history",icon:Xl,label:"History",color:"text-fg-muted"},{to:"/books",icon:Ke,label:"Reading",color:"text-book"}].map(({to:E,icon:N,label:C,color:L})=>n.jsxs(at,{to:E,className:"flex items-center gap-1.5 rounded-full border border-border bg-surface/60 px-3.5 py-1.5 text-[12px] font-semibold transition-all hover:bg-surface hover:border-border/80",children:[n.jsx(N,{className:ie("h-3.5 w-3.5",L)}),n.jsx("span",{className:"text-fg-muted",children:C})]},E))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-2 px-4 lg:grid-cols-4 lg:px-6",children:[n.jsx(Ei,{label:"Movies",value:r?.stats.movies,icon:n.jsx(ga,{className:"h-4 w-4 text-white"}),color:"bg-indigo-500",loading:f}),n.jsx(Ei,{label:"Shows",value:r?.stats.shows,icon:n.jsx(os,{className:"h-4 w-4 text-white"}),color:"bg-violet-500",loading:f}),n.jsx(Ei,{label:"Episodes",value:r?.stats.episodes,icon:n.jsx(Yl,{className:"h-4 w-4 text-white",fill:"white"}),color:"bg-pink-500",loading:f}),n.jsx(Ei,{label:"Books read",value:r?.stats.books??0,icon:n.jsx(Ke,{className:"h-4 w-4 text-white"}),color:"bg-amber-500",loading:f})]}),n.jsx("div",{className:"mt-8",children:n.jsx(Rp,{title:"Trending now",subtitle:"Popular with StreamPulse users",href:"/search",items:v,loading:h,skeletonCount:8})}),n.jsxs("div",{className:"mt-8 grid gap-6 px-4 lg:grid-cols-[1fr_280px] lg:px-6 lg:pb-8",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[n.jsx("h2",{className:"text-[17px] font-bold text-fg",children:"Continue watching"}),n.jsx(at,{to:"/history",className:"text-[13px] font-medium text-accent hover:underline",children:"All history"})]}),n.jsx("div",{className:"rounded-2xl border border-border/50 bg-surface/40 px-3 py-1 divide-y divide-border/30",children:f?Array.from({length:5}).map((E,N)=>n.jsxs("div",{className:"flex items-center gap-3 py-3",children:[n.jsx(he,{className:"h-14 w-10 shrink-0 rounded-[8px]"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(he,{className:"h-3.5 w-36 rounded-md"}),n.jsx(he,{className:"h-3 w-24 rounded-md"})]})]},N)):M.length>0?M.slice(0,8).map(E=>n.jsx(qp,{record:E},E.id)):n.jsxs("div",{className:"py-12 text-center",children:[n.jsx("div",{className:"mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-2xl bg-elevated",children:n.jsx(Yl,{className:"h-6 w-6 text-fg-subtle"})}),n.jsx("p",{className:"text-[14px] font-semibold text-fg-muted",children:"Nothing watched yet"}),n.jsx("p",{className:"mt-1 text-[12px] text-fg-subtle",children:"Search for a movie or show to start tracking"}),n.jsx(at,{to:"/search",className:"mt-3 inline-block text-[12px] font-medium text-accent hover:underline",children:"Start discovering →"})]})})]}),n.jsxs("div",{children:[n.jsx("h2",{className:"mb-4 text-[17px] font-bold text-fg",children:"Quick access"}),n.jsx("div",{className:"space-y-2",children:[{to:"/search",icon:is,label:"Discover",sub:"Movies, shows & books",accent:"bg-indigo-500/10 text-indigo-400"},{to:"/history",icon:Xl,label:"Watch history",sub:"Your logged watches",accent:"bg-violet-500/10 text-violet-400"},{to:"/lists",icon:ga,label:"My lists",sub:"Curated collections",accent:"bg-pink-500/10 text-pink-400"},{to:"/books",icon:Ke,label:"Reading shelf",sub:"Books you're tracking",accent:"bg-amber-500/10 text-amber-400"}].map(({to:E,icon:N,label:C,sub:L,accent:Q})=>n.jsxs(at,{to:E,className:"flex items-center gap-3 rounded-xl border border-border/40 bg-surface/50 p-3 transition-all hover:bg-surface hover:border-border/70 group",children:[n.jsx("div",{className:ie("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg transition-colors",Q),children:n.jsx(N,{className:"h-4.5 w-4.5"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"text-[13px] font-semibold text-fg",children:C}),n.jsx("p",{className:"text-[11px] text-fg-muted",children:L})]}),n.jsx(Yl,{className:"h-3.5 w-3.5 shrink-0 text-fg-subtle opacity-0 transition-opacity group-hover:opacity-100"})]},E))})]})]}),n.jsx("div",{className:"pb-6 lg:pb-0"})]})}const fl=B.forwardRef(({className:c,icon:r,error:f,...o},h)=>n.jsxs("div",{className:"relative w-full",children:[r&&n.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-fg-muted",children:r}),n.jsx("input",{ref:h,className:ie("w-full rounded-[10px] border border-border bg-surface px-3 py-2","text-[14px] text-fg placeholder:text-fg-muted","transition-all duration-150 outline-none","focus:border-accent focus:ring-2 focus:ring-accent/20","disabled:opacity-50 disabled:cursor-not-allowed",r&&"pl-9",f&&"border-danger focus:border-danger focus:ring-danger/20",c),...o}),f&&n.jsx("p",{className:"mt-1 text-[12px] text-danger",children:f})]}));fl.displayName="Input";const Fm=c=>typeof c=="boolean"?`${c}`:c===0?"0":c,Im=wh,Yh=(c,r)=>f=>{var o;if(r?.variants==null)return Im(c,f?.class,f?.className);const{variants:h,defaultVariants:g}=r,b=Object.keys(h).map(v=>{const E=f?.[v],N=g?.[v];if(E===null)return null;const C=Fm(E)||Fm(N);return h[v][C]}),S=f&&Object.entries(f).reduce((v,E)=>{let[N,C]=E;return C===void 0||(v[N]=C),v},{}),M=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((v,E)=>{let{class:N,className:C,...L}=E;return Object.entries(L).every(Q=>{let[J,Y]=Q;return Array.isArray(Y)?Y.includes({...g,...S}[J]):{...g,...S}[J]===Y})?[...v,N,C]:v},[]);return Im(c,b,M,f?.class,f?.className)},Yp=Yh("inline-flex items-center justify-center gap-2 font-medium transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg disabled:pointer-events-none disabled:opacity-40 select-none cursor-pointer",{variants:{variant:{primary:"bg-accent text-accent-fg hover:bg-accent-hover active:scale-[0.97] shadow-sm rounded-[10px]",secondary:"bg-surface text-fg hover:bg-elevated active:scale-[0.97] border border-border rounded-[10px]",ghost:"text-fg-muted hover:bg-surface hover:text-fg active:scale-[0.97] rounded-[8px]",danger:"bg-danger/10 text-danger hover:bg-danger/20 active:scale-[0.97] rounded-[10px]",outline:"border border-border bg-transparent text-fg hover:bg-surface active:scale-[0.97] rounded-[10px]"},size:{xs:"h-7 px-2.5 text-[12px]",sm:"h-8 px-3 text-[13px]",md:"h-9 px-4 text-[14px]",lg:"h-10 px-5 text-[15px]",xl:"h-11 px-6 text-[15px]",icon:"h-9 w-9 rounded-[8px]","icon-sm":"h-7 w-7 rounded-[6px]","icon-lg":"h-10 w-10 rounded-[10px]"}},defaultVariants:{variant:"primary",size:"md"}}),oe=B.forwardRef(({className:c,variant:r,size:f,asChild:o=!1,...h},g)=>{const b=o?S0:"button";return n.jsx(b,{className:ie(Yp({variant:r,size:f,className:c})),ref:g,...h})});oe.displayName="Button";const Qp=Yh("inline-flex items-center rounded-full font-medium",{variants:{variant:{default:"bg-surface border border-border text-fg-muted",accent:"bg-accent/12 text-accent",success:"bg-success/12 text-success",warning:"bg-warning/12 text-warning",danger:"bg-danger/12 text-danger",pro:"bg-gradient-to-r from-accent to-violet-500 text-white shadow-sm",outline:"border border-border text-fg-muted"},size:{sm:"px-1.5 py-px text-[11px]",md:"px-2 py-0.5 text-[12px]",lg:"px-2.5 py-1 text-[13px]"}},defaultVariants:{variant:"default",size:"md"}});function Xp({className:c,variant:r,size:f,...o}){return n.jsx("span",{className:ie(Qp({variant:r,size:f,className:c})),...o})}function Qh(c,r){const[f,o]=B.useState(c);return B.useEffect(()=>{const h=setTimeout(()=>o(c),r);return()=>clearTimeout(h)},[c,r]),f}function Vp({book:c}){return n.jsxs("div",{className:"flex gap-3 rounded-2xl border border-border/40 bg-surface/60 p-3 transition-all hover:bg-surface hover:border-border/70",children:[n.jsx("div",{className:"relative h-[90px] w-[60px] shrink-0 overflow-hidden rounded-lg bg-elevated",children:c.cover_url?n.jsx("img",{src:c.cover_url,alt:c.title,className:"h-full w-full object-cover",loading:"lazy"}):n.jsx("div",{className:"flex h-full w-full items-center justify-center bg-gradient-to-br from-book/15 to-book/5",children:n.jsx(Ke,{className:"h-4 w-4 text-book/50"})})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"text-[13px] font-semibold text-fg leading-snug line-clamp-2",children:c.title}),c.authors&&n.jsx("p",{className:"mt-0.5 text-[11px] text-fg-muted",children:c.authors}),c.original_publish_date&&n.jsx("p",{className:"mt-0.5 text-[11px] text-fg-subtle",children:new Date(c.original_publish_date).getFullYear()}),c.ai_vibe&&n.jsx("p",{className:"mt-1.5 text-[11px] italic text-fg-muted line-clamp-1",children:c.ai_vibe})]})]})}function Zp(){const{user:c}=ml(),r=c?.plan==="pro"||c?.plan==="founder",[f,o]=B.useState(""),[h,g]=B.useState("keyword"),[b,S]=B.useState("media"),M=B.useRef(null),v=Qh(f,350),{data:E,isLoading:N,isFetching:C}=dl({queryKey:["search-media",h,v],queryFn:()=>{const V=h==="nl"?`/api/search/nl?q=${encodeURIComponent(v)}`:`/api/search?q=${encodeURIComponent(v)}`;return et.get(V)},enabled:b==="media"&&v.trim().length>1}),{data:L,isLoading:Q,isFetching:J}=dl({queryKey:["search-books",v],queryFn:()=>et.get(`/api/books/search?q=${encodeURIComponent(v)}`),enabled:b==="books"&&v.trim().length>1}),Y=B.useCallback(()=>{o(""),M.current?.focus()},[]),ne=E?.results??[],fe=L?.results??[],xe=(N||C)&&b==="media"&&v.trim().length>1,se=(Q||J)&&b==="books"&&v.trim().length>1,ce=b==="media"?ne.length:fe.length;return n.jsxs("div",{className:"px-4 py-6 lg:px-6",children:[n.jsxs("div",{className:"mb-6",children:[n.jsx("h1",{className:"text-[26px] font-bold tracking-tight text-fg",children:"Discover"}),n.jsx("p",{className:"mt-0.5 text-[14px] text-fg-muted",children:"Find movies, shows and books"})]}),n.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(fl,{ref:M,value:f,onChange:V=>o(V.target.value),placeholder:b==="books"?"Search books, authors…":h==="nl"?"Describe what you want to watch…":"Search movies, shows…",icon:n.jsx(Vl,{className:"h-4 w-4"}),autoFocus:!0}),f&&n.jsx("button",{onClick:Y,className:"absolute right-3 top-1/2 -translate-y-1/2 rounded-full p-0.5 text-fg-muted transition-colors hover:text-fg",children:n.jsx(Xi,{className:"h-3.5 w-3.5"})})]}),r&&b==="media"&&n.jsxs(oe,{variant:h==="nl"?"primary":"secondary",size:"sm",onClick:()=>g(V=>V==="nl"?"keyword":"nl"),className:"shrink-0 gap-1.5",children:[n.jsx(pa,{className:"h-3.5 w-3.5"}),n.jsx("span",{className:"hidden sm:inline",children:"AI"})]})]}),n.jsxs("div",{className:"mb-5 flex gap-1.5",children:[n.jsxs("button",{onClick:()=>S("media"),className:ie("flex items-center gap-2 rounded-full px-4 py-2 text-[13px] font-semibold transition-all",b==="media"?"bg-accent text-white shadow-sm shadow-accent/30":"bg-surface text-fg-muted hover:bg-elevated border border-border/50"),children:[n.jsx(ga,{className:"h-3.5 w-3.5"}),"Movies & Shows"]}),n.jsxs("button",{onClick:()=>S("books"),className:ie("flex items-center gap-2 rounded-full px-4 py-2 text-[13px] font-semibold transition-all",b==="books"?"bg-book text-white shadow-sm shadow-book/30":"bg-surface text-fg-muted hover:bg-elevated border border-border/50"),children:[n.jsx(Ke,{className:"h-3.5 w-3.5"}),"Books"]})]}),h==="nl"&&b==="media"&&n.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[n.jsxs(Xp,{variant:"pro",className:"gap-1",children:[n.jsx(pa,{className:"h-3 w-3"}),"AI search active"]}),n.jsx("button",{onClick:()=>g("keyword"),className:"text-[12px] text-fg-muted hover:text-fg transition-colors",children:"Switch to keyword"})]}),b==="media"&&(xe?n.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",children:Array.from({length:12}).map((V,ge)=>n.jsx(Lh,{},ge))}):ne.length>0?n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"mb-4 text-[13px] text-fg-muted",children:[ce," result",ce!==1?"s":"",v&&n.jsxs(n.Fragment,{children:[" for ",n.jsxs("span",{className:"font-semibold text-fg",children:['"',v,'"']})]})]}),n.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",children:ne.map(V=>n.jsx(Gh,{mediaKey:V.media_key,title:V.title,year:V.release_year,posterUrl:V.poster_url,type:V.media_type,vibe:V.ai_vibe},V.media_key))})]}):v.trim().length>1?n.jsx(Ci,{icon:n.jsx(ga,{className:"h-8 w-8 text-fg-subtle"}),title:`No results for "${v}"`,sub:"Try different keywords or AI search"}):n.jsx(Ci,{icon:n.jsx(Vl,{className:"h-8 w-8 text-fg-subtle"}),title:"Search for movies & shows",sub:r?"Try keywords or switch to AI search":"Upgrade to Pro for AI-powered search"})),b==="books"&&(se?n.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Array.from({length:8}).map((V,ge)=>n.jsxs("div",{className:"flex gap-3 rounded-2xl border border-border/40 bg-surface/60 p-3",children:[n.jsx("div",{className:"h-[90px] w-[60px] shrink-0 rounded-lg bg-elevated animate-shimmer"}),n.jsxs("div",{className:"flex-1 space-y-2 pt-1",children:[n.jsx("div",{className:"h-4 w-3/4 rounded-lg bg-elevated animate-shimmer"}),n.jsx("div",{className:"h-3 w-1/2 rounded-lg bg-elevated animate-shimmer"})]})]},ge))}):fe.length>0?n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"mb-4 text-[13px] text-fg-muted",children:[ce," result",ce!==1?"s":"",v&&n.jsxs(n.Fragment,{children:[" for ",n.jsxs("span",{className:"font-semibold text-fg",children:['"',v,'"']})]})]}),n.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:fe.map(V=>n.jsx(Vp,{book:V},V.id))})]}):v.trim().length>1?n.jsx(Ci,{icon:n.jsx(Ke,{className:"h-8 w-8 text-fg-subtle"}),title:`No books found for "${v}"`,sub:"Try a different title or author name"}):n.jsx(Ci,{icon:n.jsx(Ke,{className:"h-8 w-8 text-fg-subtle"}),title:"Search for books",sub:"Find books to add to your reading shelf"})),n.jsx("div",{className:"pb-6 lg:pb-0"})]})}function Ci({icon:c,title:r,sub:f}){return n.jsxs("div",{className:"py-16 text-center",children:[n.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-elevated",children:c}),n.jsx("p",{className:"text-[15px] font-bold text-fg-muted",children:r}),n.jsx("p",{className:"mt-1 text-[13px] text-fg-subtle",children:f})]})}function Kp({genre:c}){return n.jsx("span",{className:"rounded-full border border-border/60 bg-surface/60 px-3 py-1 text-[12px] font-medium text-fg-muted backdrop-blur-sm",children:c})}function Oi({icon:c,label:r}){return n.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-border/40 bg-black/30 px-2.5 py-1 backdrop-blur-sm",children:[n.jsx("span",{className:"text-white/60",children:c}),n.jsx("span",{className:"text-[12px] font-medium text-white/90",children:r})]})}function Pm({type:c}){const{id:r}=v0(),f=wo(),o=Gi(),[h,g]=B.useState(!1),{data:b,isLoading:S}=dl({queryKey:["media",c,r],queryFn:()=>et.get(`/api/media/${c}s/${r}`),enabled:!!r}),M=Li({mutationFn:()=>et.post("/api/watch",{media_key:`${c}_${r}`,watched_at:new Date().toISOString()}),onSuccess:()=>{g(!0),o.invalidateQueries({queryKey:["dashboard"]}),o.invalidateQueries({queryKey:["history"]})}});if(S)return n.jsx(Jp,{});if(!b)return n.jsxs("div",{className:"flex flex-col items-center justify-center py-24 gap-4",children:[n.jsx("div",{className:"rounded-2xl bg-elevated p-5",children:n.jsx(os,{className:"h-10 w-10 text-fg-subtle"})}),n.jsx("p",{className:"text-[15px] font-medium text-fg-muted",children:"Media not found"}),n.jsxs(oe,{variant:"ghost",size:"sm",className:"gap-1.5",onClick:()=>f(-1),children:[n.jsx(ss,{className:"h-4 w-4"})," Go back"]})]});const v=c==="movie"?b:null,E=c==="show"?b:null,N=b.title,C=v?.release_year??E?.first_year,L=b.poster_url,Q=b.backdrop_url,J=b.overview,Y=v?.rating??E?.rating??null,ne=b.genres,fe=b.cast,xe=v?v.directors:E?.creators,se=c==="movie"?"Directed by":"Created by",ce=v?.runtime,V=b.ai,ge=v?.tagline;return n.jsxs("div",{className:"pb-12 animate-fade-in",children:[n.jsxs("div",{className:"relative h-[45vh] min-h-[260px] max-h-[500px] w-full overflow-hidden",children:[Q?n.jsx(Ae.img,{src:Q,alt:"",className:"h-full w-full object-cover",initial:{scale:1.05},animate:{scale:1},transition:{duration:.7,ease:[.22,1,.36,1]},loading:"eager"}):L?n.jsx("div",{className:"h-full w-full scale-110 bg-cover bg-center blur-3xl opacity-25",style:{backgroundImage:`url(${L})`}}):n.jsx("div",{className:"h-full w-full bg-gradient-to-br from-accent/20 via-bg to-bg"}),n.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-bg via-bg/50 to-transparent"}),n.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-bg/30 to-transparent"}),n.jsxs("button",{onClick:()=>f(-1),className:"absolute left-4 top-4 flex items-center gap-1 rounded-full bg-black/50 px-3 py-1.5 text-[13px] font-medium text-white/90 backdrop-blur-md transition-colors hover:bg-black/70",children:[n.jsx(ss,{className:"h-4 w-4"})," Back"]}),(C||Y||ce)&&n.jsxs("div",{className:"absolute bottom-4 left-4 flex flex-wrap items-center gap-2",children:[C&&n.jsx(Oi,{icon:n.jsx(X0,{className:"h-3 w-3"}),label:String(C)}),Y!=null&&n.jsx(Oi,{icon:n.jsx(Qi,{className:"h-3 w-3 fill-yellow-400 text-yellow-400"}),label:Y.toFixed(1)}),ce&&n.jsx(Oi,{icon:n.jsx(Xl,{className:"h-3 w-3"}),label:zp(ce)}),E?.total_seasons!=null&&n.jsx(Oi,{icon:n.jsx(Gm,{className:"h-3 w-3"}),label:`${E.total_seasons} season${E.total_seasons!==1?"s":""}`})]})]}),n.jsxs("div",{className:"px-4 lg:px-6 -mt-4 relative z-10",children:[n.jsxs("div",{className:"flex gap-5 items-start",children:[L&&n.jsx("div",{className:"hidden sm:block shrink-0 -mt-24 z-10",children:n.jsx("img",{src:L,alt:N,className:"h-[200px] w-[134px] rounded-2xl object-cover shadow-2xl ring-2 ring-border",loading:"eager"})}),n.jsxs("div",{className:"flex-1 min-w-0 pt-2",children:[n.jsx("h1",{className:"text-[28px] font-bold leading-tight tracking-tight text-fg lg:text-[34px]",children:N}),ge&&n.jsx("p",{className:"mt-1.5 text-[14px] italic text-fg-muted",children:ge}),V?.one_liner&&!ge&&n.jsx("p",{className:"mt-1.5 text-[14px] italic text-fg-muted",children:V.one_liner}),b.original_language&&b.original_language!=="en"&&n.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[n.jsx(yh,{className:"h-3.5 w-3.5 text-fg-subtle"}),n.jsx("span",{className:"text-[12px] font-medium text-fg-muted uppercase tracking-wide",children:b.original_language})]}),ne&&ne.length>0&&n.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:ne.slice(0,4).map(U=>n.jsx(Kp,{genre:U},U))}),n.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[n.jsx(oe,{variant:h||M.isSuccess?"secondary":"primary",size:"md",className:"gap-2 shadow-md shadow-accent/20",onClick:()=>M.mutate(),disabled:M.isPending||h||M.isSuccess,children:h||M.isSuccess?n.jsxs(n.Fragment,{children:[n.jsx(ba,{className:"h-4 w-4"})," Logged"]}):M.isPending?"Logging…":n.jsxs(n.Fragment,{children:[n.jsx(Yl,{className:"h-4 w-4",fill:"currentColor"})," Log watch"]})}),n.jsxs(oe,{variant:"outline",size:"md",className:"gap-2",children:[n.jsx(vo,{className:"h-4 w-4"})," Add to list"]})]})]})]}),n.jsxs("div",{className:"mt-8 grid gap-4 lg:grid-cols-2",children:[J&&n.jsxs("div",{className:"rounded-2xl border border-border/40 bg-surface/60 p-5 backdrop-blur-sm lg:col-span-2",children:[n.jsx("p",{className:"mb-2 text-[11px] font-bold uppercase tracking-widest text-fg-subtle",children:"Overview"}),n.jsx("p",{className:"text-[14px] leading-relaxed text-fg-muted",children:J})]}),V&&n.jsxs("div",{className:"rounded-2xl border border-accent/20 bg-accent/5 p-5 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(pa,{className:"h-4 w-4 text-accent"}),n.jsx("p",{className:"text-[12px] font-bold uppercase tracking-widest text-accent/80",children:"AI Insights"})]}),V.vibe&&n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-fg-subtle",children:"Vibe"}),n.jsx("p",{className:"mt-1 text-[13px] text-fg-muted",children:V.vibe})]}),V.mood&&V.mood.length>0&&n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-fg-subtle",children:"Mood"}),n.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:V.mood.map(U=>n.jsx("span",{className:"rounded-full bg-accent/10 px-2.5 py-0.5 text-[11px] font-medium text-accent/80",children:U},U))})]}),V.watch_context&&V.watch_context.length>0&&n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-fg-subtle",children:"Best watched"}),n.jsx("p",{className:"mt-1 text-[13px] text-fg-muted",children:Array.isArray(V.watch_context)?V.watch_context.join(", "):V.watch_context})]})]}),n.jsxs("div",{className:"space-y-3",children:[xe&&xe.length>0&&n.jsxs("div",{className:"rounded-2xl border border-border/40 bg-surface/60 p-5",children:[n.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[n.jsx(Gm,{className:"h-3.5 w-3.5 text-fg-subtle"}),n.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-fg-subtle",children:se})]}),n.jsx("p",{className:"text-[13px] text-fg-muted leading-relaxed",children:xe.join(", ")})]}),fe&&fe.length>0&&n.jsxs("div",{className:"rounded-2xl border border-border/40 bg-surface/60 p-5",children:[n.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[n.jsx(E1,{className:"h-3.5 w-3.5 text-fg-subtle"}),n.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-fg-subtle",children:"Starring"})]}),n.jsx("p",{className:"text-[13px] text-fg-muted leading-relaxed",children:fe.slice(0,6).join(", ")})]})]})]})]})]})}function Jp(){return n.jsxs("div",{className:"pb-8",children:[n.jsx(he,{className:"h-[45vh] min-h-[260px] w-full",rounded:"sm"}),n.jsxs("div",{className:"px-4 lg:px-6 mt-6 space-y-4",children:[n.jsx(he,{className:"h-9 w-72 rounded-xl"}),n.jsx(he,{className:"h-4 w-44 rounded-lg"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(he,{className:"h-9 w-32 rounded-xl"}),n.jsx(he,{className:"h-9 w-28 rounded-xl"})]}),n.jsx(he,{className:"h-40 w-full rounded-2xl"}),n.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[n.jsx(he,{className:"h-32 rounded-2xl"}),n.jsx(he,{className:"h-32 rounded-2xl"})]})]})]})}function $p(c){const r=new Map;for(const f of c){const h=new Date(f.watched_at).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),g=r.get(h)??[];g.push(f),r.set(h,g)}return[...r.entries()]}function Wp({record:c,onDelete:r}){const f=c.media_key.startsWith("show_"),o=c.media_key.split("_")[1],h=f?"show":"movie",g=new Date(c.watched_at).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"});return n.jsxs("div",{className:"group flex items-center gap-3 rounded-xl px-2 py-2.5 -mx-2 transition-colors hover:bg-surface/60",children:[n.jsx(at,{to:`/${h}/${o}`,className:"relative h-14 w-10 shrink-0 overflow-hidden rounded-[8px] bg-elevated shadow-sm",children:c.poster_url?n.jsx("img",{src:c.poster_url,alt:c.title??"",className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-105",loading:"lazy"}):n.jsx("div",{className:"flex h-full w-full items-center justify-center bg-gradient-to-br from-surface to-elevated",children:f?n.jsx(os,{className:"h-4 w-4 text-fg-subtle"}):n.jsx(ga,{className:"h-4 w-4 text-fg-subtle"})})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx(at,{to:`/${h}/${o}`,children:n.jsx("p",{className:"truncate text-[13px] font-semibold text-fg hover:text-accent transition-colors",children:c.title??"Unknown title"})}),n.jsxs("p",{className:"text-[11px] text-fg-muted",children:[c.release_year&&n.jsx("span",{children:c.release_year}),c.release_year&&n.jsx("span",{className:"mx-1.5 text-fg-subtle",children:"·"}),n.jsx("span",{className:"text-fg-subtle",children:g})]})]}),n.jsx("button",{onClick:()=>r(c.id),className:ie("shrink-0 rounded-full p-1.5 transition-all","opacity-0 group-hover:opacity-100","text-fg-subtle hover:bg-danger/10 hover:text-danger"),"aria-label":"Remove watch",children:n.jsx(z1,{className:"h-3.5 w-3.5"})})]})}function Fp(){const[c,r]=B.useState(1),f=Gi(),{data:o,isLoading:h}=dl({queryKey:["history",c],queryFn:()=>et.get(`/api/watch?page=${c}&pageSize=40`)}),g=Li({mutationFn:v=>et.delete(`/api/watch/${v}`),onSuccess:()=>{f.invalidateQueries({queryKey:["history"]}),f.invalidateQueries({queryKey:["dashboard"]})}}),b=o?.records??[],S=o?Math.ceil(o.total/o.pageSize):1,M=$p(b);return n.jsxs("div",{className:"px-4 py-6 lg:px-6",children:[n.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-[26px] font-bold tracking-tight text-fg",children:"Watch History"}),o&&n.jsxs("p",{className:"mt-0.5 text-[14px] text-fg-muted",children:[o.total.toLocaleString()," entries logged"]})]}),n.jsx("a",{href:"/api/export?format=csv",download:!0,children:n.jsxs(oe,{variant:"outline",size:"sm",className:"gap-2",children:[n.jsx(ph,{className:"h-3.5 w-3.5"}),"Export"]})})]}),h?n.jsx("div",{className:"space-y-8",children:Array.from({length:3}).map((v,E)=>n.jsxs("div",{children:[n.jsx(he,{className:"mb-3 h-3.5 w-48 rounded-lg"}),n.jsx("div",{className:"space-y-1",children:Array.from({length:4}).map((N,C)=>n.jsxs("div",{className:"flex items-center gap-3 py-3",children:[n.jsx(he,{className:"h-14 w-10 shrink-0 rounded-[8px]"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(he,{className:"h-3.5 w-40 rounded-lg"}),n.jsx(he,{className:"h-3 w-28 rounded-lg"})]})]},C))})]},E))}):b.length===0?n.jsxs("div",{className:"py-24 text-center",children:[n.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-3xl bg-elevated",children:n.jsx(Xl,{className:"h-8 w-8 text-fg-subtle",strokeWidth:1.5})}),n.jsx("p",{className:"text-[16px] font-bold text-fg-muted",children:"No watches logged yet"}),n.jsx("p",{className:"mt-1 text-[13px] text-fg-subtle",children:"Start by searching for something to watch"})]}):n.jsxs("div",{className:"space-y-8",children:[M.map(([v,E])=>n.jsxs("div",{children:[n.jsx("p",{className:"mb-2 text-[11px] font-bold uppercase tracking-widest text-fg-subtle",children:v}),n.jsx("div",{className:"divide-y divide-border/30 rounded-2xl border border-border/40 bg-surface/40 px-3",children:E.map(N=>n.jsx(Wp,{record:N,onDelete:C=>g.mutate(C)},N.id))})]},v)),S>1&&n.jsxs("div",{className:"flex items-center justify-center gap-3 pt-2 pb-6",children:[n.jsx(oe,{variant:"outline",size:"sm",disabled:c<=1,onClick:()=>r(v=>v-1),children:"Previous"}),n.jsxs("span",{className:"text-[13px] font-medium text-fg-muted",children:[c," / ",S]}),n.jsx(oe,{variant:"outline",size:"sm",disabled:c>=S,onClick:()=>r(v=>v+1),children:"Next"})]})]})]})}function Ip({onClose:c}){const[r,f]=B.useState(""),[o,h]=B.useState(!1),g=Gi(),b=Li({mutationFn:()=>et.post("/api/lists",{name:r,is_public:o}),onSuccess:()=>{g.invalidateQueries({queryKey:["lists"]}),c()}});return n.jsx(Ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-end justify-center bg-black/60 backdrop-blur-sm sm:items-center",onClick:S=>S.target===S.currentTarget&&c(),children:n.jsxs(Ae.div,{initial:{y:48,opacity:0},animate:{y:0,opacity:1},exit:{y:48,opacity:0},transition:{type:"spring",stiffness:420,damping:34},className:"w-full max-w-md rounded-t-3xl bg-surface border-t border-border/50 p-6 pb-8 sm:rounded-3xl sm:border",children:[n.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[n.jsx("h2",{className:"text-[17px] font-bold text-fg",children:"New list"}),n.jsx("button",{onClick:c,className:"rounded-full p-1.5 text-fg-muted transition-colors hover:bg-elevated hover:text-fg",children:n.jsx(Xi,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx(fl,{placeholder:"List name",value:r,onChange:S=>f(S.target.value),autoFocus:!0,onKeyDown:S=>{S.key==="Enter"&&r.trim()&&b.mutate()}}),n.jsxs("button",{type:"button",onClick:()=>h(S=>!S),className:"flex w-full items-center gap-3 rounded-xl border border-border bg-surface/60 px-3 py-2.5 text-left transition-colors hover:bg-elevated",children:[n.jsx("div",{className:ie("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg transition-colors",o?"bg-accent/15 text-accent":"bg-elevated text-fg-muted"),children:o?n.jsx(yh,{className:"h-4 w-4"}):n.jsx(ko,{className:"h-4 w-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[13px] font-semibold text-fg",children:o?"Public":"Private"}),n.jsx("p",{className:"text-[11px] text-fg-muted",children:o?"Anyone with the link can view":"Only you can see this list"})]})]})]}),n.jsx(oe,{variant:"primary",size:"lg",className:"mt-5 w-full",disabled:!r.trim()||b.isPending,onClick:()=>b.mutate(),children:b.isPending?"Creating…":"Create list"})]})})}function Pp({list:c}){return n.jsx(at,{to:`/lists/${c.id}`,children:n.jsxs(Ae.div,{whileHover:{scale:1.01},transition:{type:"spring",stiffness:400,damping:30},className:"flex items-center gap-3 rounded-2xl border border-border/40 bg-surface/60 p-4 transition-all hover:bg-surface hover:border-border/70 group",children:[n.jsx("div",{className:ie("flex h-10 w-10 shrink-0 items-center justify-center rounded-xl",c.is_public?"bg-accent/10 text-accent":"bg-elevated text-fg-muted"),children:n.jsx(us,{className:"h-5 w-5"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("p",{className:"truncate text-[14px] font-semibold text-fg",children:c.name}),n.jsx("span",{className:ie("shrink-0 rounded-full border px-2 py-px text-[10px] font-semibold",c.is_public?"border-accent/30 bg-accent/10 text-accent":"border-border text-fg-subtle"),children:c.is_public?"Public":"Private"})]}),n.jsxs("p",{className:"mt-0.5 text-[11px] text-fg-subtle",children:[(c.item_count??0).toLocaleString()," ",c.item_count===1?"item":"items"]})]}),n.jsx(cs,{className:"h-4 w-4 shrink-0 text-fg-subtle opacity-0 transition-opacity group-hover:opacity-100"})]})})}function eb(){const[c,r]=B.useState(!1),{data:f,isLoading:o}=dl({queryKey:["lists"],queryFn:()=>et.get("/api/lists")}),h=f?.lists??[];return n.jsxs("div",{className:"px-4 py-6 lg:px-6",children:[n.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-[26px] font-bold tracking-tight text-fg",children:"My Lists"}),!o&&n.jsxs("p",{className:"mt-0.5 text-[14px] text-fg-muted",children:[h.length," collection",h.length!==1?"s":""]})]}),n.jsxs(oe,{variant:"primary",size:"sm",className:"gap-2 shadow-sm shadow-accent/20",onClick:()=>r(!0),children:[n.jsx(vo,{className:"h-4 w-4"})," New list"]})]}),o?n.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Array.from({length:6}).map((g,b)=>n.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border/40 bg-surface/60 p-4",children:[n.jsx(he,{className:"h-10 w-10 shrink-0 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(he,{className:"h-4 w-32 rounded-lg"}),n.jsx(he,{className:"h-3 w-16 rounded-lg"})]})]},b))}):h.length===0?n.jsxs("div",{className:"py-24 text-center",children:[n.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-3xl bg-elevated",children:n.jsx(us,{className:"h-8 w-8 text-fg-subtle",strokeWidth:1.5})}),n.jsx("p",{className:"text-[16px] font-bold text-fg-muted",children:"No lists yet"}),n.jsx("p",{className:"mt-1 text-[13px] text-fg-subtle",children:"Curate your favourite movies and shows"}),n.jsxs(oe,{variant:"primary",size:"sm",className:"mt-4 gap-2",onClick:()=>r(!0),children:[n.jsx(vo,{className:"h-4 w-4"})," Create your first list"]})]}):n.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:h.map(g=>n.jsx(Pp,{list:g},g.id))}),n.jsx(ns,{children:c&&n.jsx(Ip,{onClose:()=>r(!1)})}),n.jsx("div",{className:"pb-6 lg:pb-0"})]})}const tb={all:"All books",reading:"Currently reading",want_to_read:"Want to read",read:"Finished",dnf:"Did not finish"},eh={reading:"bg-book/10 text-book border-book/20",want_to_read:"bg-indigo-500/10 text-indigo-400 border-indigo-500/20",read:"bg-success/10 text-success border-success/20",dnf:"bg-fg-muted/10 text-fg-muted border-fg-muted/20"},lb={reading:n.jsx(Xl,{className:"h-3 w-3"}),want_to_read:n.jsx(xh,{className:"h-3 w-3"}),read:n.jsx(gh,{className:"h-3 w-3"})};function ab({rating:c,max:r=5}){const f=Math.floor(c),o=c%1>=.5;return n.jsxs("div",{className:"flex items-center gap-0.5",children:[Array.from({length:r}).map((h,g)=>{const b=get.get("/api/books/shelf")}),S=g?.shelf??[],M={reading:S.filter(N=>N.status==="reading").length,want_to_read:S.filter(N=>N.status==="want_to_read").length,read:S.filter(N=>N.status==="read").length},v=S.filter(N=>{if(c!=="all"&&N.status!==c)return!1;if(h){const C=h.toLowerCase();return N.book?.title.toLowerCase().includes(C)||(N.book?.authors?.toLowerCase().includes(C)??!1)}return!0}),E=S.filter(N=>N.status==="reading");return n.jsxs("div",{className:"px-4 py-6 lg:px-6",children:[n.jsxs("div",{className:"mb-6 flex items-start justify-between",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-[26px] font-bold tracking-tight text-fg",children:"Reading Shelf"}),n.jsx("p",{className:"mt-0.5 text-[14px] text-fg-muted",children:S.length>0?`${S.length} books tracked`:"Track your reading journey"})]}),n.jsxs(at,{to:"/search",className:"flex items-center gap-1.5 rounded-xl border border-border/60 bg-surface/60 px-3 py-2 text-[13px] font-semibold text-fg-muted transition-all hover:bg-surface hover:text-fg",children:[n.jsx(is,{className:"h-4 w-4"}),"Find books"]})]}),!b&&E.length>0&&n.jsxs("div",{className:"mb-6",children:[n.jsx("h2",{className:"mb-3 text-[14px] font-bold text-fg-muted uppercase tracking-wide",children:"Currently reading"}),n.jsx("div",{className:"flex gap-3 overflow-x-auto scrollbar-hide pb-1",children:E.map(N=>{const C=N.custom_page_count&&N.pages_read_so_far?Math.round(N.pages_read_so_far/N.custom_page_count*100):null;return n.jsxs("div",{className:"shrink-0 w-44 rounded-2xl border border-book/20 bg-book/5 p-3 flex flex-col gap-2",children:[N.book?.cover_url?n.jsx("div",{className:"h-28 w-full overflow-hidden rounded-xl",children:n.jsx("img",{src:N.book.cover_url,alt:N.book.title,className:"h-full w-full object-cover",loading:"lazy"})}):n.jsx("div",{className:"h-28 w-full rounded-xl bg-book/10 flex items-center justify-center",children:n.jsx(Ke,{className:"h-8 w-8 text-book/50"})}),n.jsx("p",{className:"text-[12px] font-bold text-fg line-clamp-2 leading-tight",children:N.book?.title}),C!==null&&n.jsxs("div",{children:[n.jsx("div",{className:"flex justify-between mb-1",children:n.jsxs("span",{className:"text-[10px] text-book font-medium",children:[C,"%"]})}),n.jsx("div",{className:"h-1.5 rounded-full bg-book/15 overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-book transition-all",style:{width:`${C}%`}})})]})]},N.id)})})]}),!b&&S.length>0&&n.jsxs("div",{className:"mb-6 grid grid-cols-3 gap-2",children:[n.jsx(xo,{count:M.reading,label:"Reading",active:c==="reading",onClick:()=>r(N=>N==="reading"?"all":"reading"),icon:n.jsx(Xl,{className:"h-3.5 w-3.5 text-book"}),accent:"bg-book/10 text-book"}),n.jsx(xo,{count:M.want_to_read,label:"Want to read",active:c==="want_to_read",onClick:()=>r(N=>N==="want_to_read"?"all":"want_to_read"),icon:n.jsx(xh,{className:"h-3.5 w-3.5 text-indigo-400"}),accent:"bg-indigo-500/10 text-indigo-400"}),n.jsx(xo,{count:M.read,label:"Finished",active:c==="read",onClick:()=>r(N=>N==="read"?"all":"read"),icon:n.jsx(gh,{className:"h-3.5 w-3.5 text-success"}),accent:"bg-success/10 text-success"})]}),S.length>0&&n.jsx("div",{className:"mb-5",children:n.jsx(fl,{placeholder:"Search your shelf…",value:f,onChange:N=>o(N.target.value),icon:n.jsx(Vl,{className:"h-4 w-4"})})}),S.length>3&&n.jsx("div",{className:"mb-5 flex gap-1.5 overflow-x-auto scrollbar-hide pb-1",children:["all","reading","want_to_read","read"].map(N=>n.jsx("button",{onClick:()=>r(N),className:ie("shrink-0 rounded-full px-4 py-1.5 text-[12px] font-semibold transition-all",c===N?"bg-accent text-white shadow-sm shadow-accent/30":"bg-surface text-fg-muted hover:bg-elevated hover:text-fg border border-border/40"),children:N==="all"?"All":N==="reading"?"Reading":N==="want_to_read"?"Want to read":"Finished"},N))}),b?n.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Array.from({length:6}).map((N,C)=>n.jsxs("div",{className:"flex gap-4 rounded-2xl border border-border/40 bg-surface/60 p-4",children:[n.jsx(he,{className:"h-[110px] w-[73px] shrink-0 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-2 pt-1",children:[n.jsx(he,{className:"h-4 w-3/4 rounded-lg"}),n.jsx(he,{className:"h-3 w-1/2 rounded-lg"}),n.jsx(he,{className:"mt-2 h-3 w-20 rounded-full"})]})]},C))}):v.length===0?n.jsxs("div",{className:"py-20 text-center",children:[n.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-3xl bg-gradient-to-br from-book/20 to-book/5",children:n.jsx(Ke,{className:"h-8 w-8 text-book",strokeWidth:1.5})}),n.jsx("p",{className:"text-[16px] font-bold text-fg-muted",children:S.length===0?"Your shelf is empty":"No books match"}),n.jsx("p",{className:"mt-1 text-[13px] text-fg-subtle",children:S.length===0?"Search for books to add them to your shelf":"Try a different filter"}),S.length===0&&n.jsx(at,{to:"/search",className:"mt-4 inline-block rounded-xl bg-book/10 px-4 py-2 text-[13px] font-semibold text-book transition-colors hover:bg-book/20",children:"Find books →"})]}):n.jsx(ns,{mode:"popLayout",children:n.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:v.map(N=>n.jsx(nb,{entry:N},N.id))})}),n.jsx("div",{className:"pb-6 lg:pb-0"})]})}const ib="modulepreload",cb=function(c){return"/"+c},th={},Vi=function(r,f,o){let h=Promise.resolve();if(f&&f.length>0){let b=function(v){return Promise.all(v.map(E=>Promise.resolve(E).then(N=>({status:"fulfilled",value:N}),N=>({status:"rejected",reason:N}))))};document.getElementsByTagName("link");const S=document.querySelector("meta[property=csp-nonce]"),M=S?.nonce||S?.getAttribute("nonce");h=b(f.map(v=>{if(v=cb(v),v in th)return;th[v]=!0;const E=v.endsWith(".css"),N=E?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${N}`))return;const C=document.createElement("link");if(C.rel=E?"stylesheet":ib,E||(C.as="script"),C.crossOrigin="",C.href=v,M&&C.setAttribute("nonce",M),document.head.appendChild(C),E)return new Promise((L,Q)=>{C.addEventListener("load",L),C.addEventListener("error",()=>Q(new Error(`Unable to preload CSS for ${v}`)))})}))}function g(b){const S=new Event("vite:preloadError",{cancelable:!0});if(S.payload=b,window.dispatchEvent(S),!S.defaultPrevented)throw b}return h.then(b=>{for(const S of b||[])S.status==="rejected"&&g(S.reason);return r().catch(g)})};function ub({user:c}){const[r,f]=B.useState(!1),[o,h]=B.useState(c.display_name??""),g=Gi(),b=Li({mutationFn:()=>et.patch("/api/user/profile",{display_name:o.trim()||null}),onSuccess:()=>{g.invalidateQueries({queryKey:["me"]}),f(!1)}});return r?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(fl,{value:o,onChange:S=>h(S.target.value),className:"h-9 text-[15px] font-semibold",autoFocus:!0,onKeyDown:S=>{S.key==="Enter"&&b.mutate(),S.key==="Escape"&&f(!1)}}),n.jsx("button",{onClick:()=>b.mutate(),disabled:b.isPending,className:"rounded-full p-1.5 bg-accent/10 text-accent transition-colors hover:bg-accent/20",children:n.jsx(ba,{className:"h-3.5 w-3.5"})}),n.jsx("button",{onClick:()=>f(!1),className:"rounded-full p-1.5 text-fg-muted transition-colors hover:bg-surface",children:n.jsx(Xi,{className:"h-3.5 w-3.5"})})]}):n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("p",{className:"text-[22px] font-bold text-fg",children:c.display_name??c.username}),n.jsx("button",{onClick:()=>f(!0),className:"rounded-full p-1 text-fg-subtle transition-colors hover:bg-surface hover:text-fg",children:n.jsx(p1,{className:"h-3.5 w-3.5"})})]})}const lh={founder:"from-yellow-500 to-amber-500",pro:"from-accent to-violet-600",free:"from-fg-muted to-fg-subtle"},ob=[{key:"movies",label:"Movies",icon:ga,color:"text-indigo-400"},{key:"shows",label:"Shows",icon:os,color:"text-violet-400"},{key:"episodes",label:"Episodes",icon:Yl,color:"text-pink-400"},{key:"books",label:"Books",icon:Ke,color:"text-amber-400"}];function rb(){const{user:c,logout:r}=ml(),[f,o]=B.useState(!1),{data:h,isLoading:g}=dl({queryKey:["user-stats"],queryFn:()=>et.get("/api/user/stats")}),b=async()=>{o(!0);try{const{startRegistration:v}=await Vi(async()=>{const{startRegistration:C}=await import("./index-BDkarAkX.js");return{startRegistration:C}},[]),E=await et.post("/api/auth/passkey/register/options"),N=await v(E);await et.post("/api/auth/passkey/register/verify",N)}catch(v){console.error("Passkey registration failed",v)}finally{o(!1)}};if(!c)return null;const S=(c.display_name??c.username).charAt(0).toUpperCase(),M=lh[c.plan]??lh.free;return n.jsxs("div",{className:"px-4 py-6 lg:px-6 max-w-2xl",children:[n.jsx("h1",{className:"mb-6 text-[26px] font-bold tracking-tight text-fg",children:"Profile"}),n.jsxs("div",{className:"mb-6 flex items-center gap-4",children:[n.jsx(Ae.div,{className:ie("flex h-16 w-16 items-center justify-center rounded-2xl text-[26px] font-bold text-white shadow-lg select-none bg-gradient-to-br",M),whileHover:{scale:1.06},transition:{type:"spring",stiffness:400,damping:28},children:S}),n.jsxs("div",{className:"min-w-0",children:[n.jsx(ub,{user:c}),n.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[n.jsxs("p",{className:"text-[13px] text-fg-muted",children:["@",c.username]}),n.jsxs("span",{className:ie("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-bold text-white bg-gradient-to-r",M),children:[(c.plan==="founder"||c.plan==="pro")&&n.jsx(I0,{className:"h-2.5 w-2.5"}),c.plan==="free"&&n.jsx(To,{className:"h-2.5 w-2.5"}),c.plan]})]})]})]}),n.jsx("div",{className:"mb-6 grid grid-cols-2 gap-2 sm:grid-cols-4",children:ob.map(({key:v,label:E,icon:N,color:C})=>g?n.jsxs("div",{className:"rounded-2xl border border-border/40 bg-surface/60 p-4",children:[n.jsx(he,{className:"mx-auto mb-2 h-8 w-16 rounded-lg"}),n.jsx(he,{className:"mx-auto h-3 w-14 rounded"})]},v):n.jsxs("div",{className:"rounded-2xl border border-border/40 bg-surface/60 p-4 text-center",children:[n.jsx(N,{className:ie("mx-auto mb-2 h-5 w-5",C)}),n.jsx("p",{className:"text-[24px] font-bold text-fg leading-none",children:(h?.[v]??0).toLocaleString()}),n.jsx("p",{className:"mt-1 text-[11px] font-medium text-fg-muted",children:E})]},v))}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"rounded-2xl border border-border/40 bg-surface/60 p-4",children:n.jsx(rs,{})}),n.jsxs("div",{className:"rounded-2xl border border-border/40 bg-surface/60 p-4",children:[n.jsx("p",{className:"mb-3 text-[11px] font-bold uppercase tracking-widest text-fg-subtle",children:"Security"}),n.jsxs(oe,{variant:"secondary",size:"sm",className:"w-full gap-2 justify-center",onClick:b,disabled:f,children:[n.jsx(cn,{className:"h-4 w-4"}),f?"Setting up…":"Register a passkey"]})]}),c.plan==="free"&&n.jsx("div",{className:"rounded-2xl border border-accent/25 bg-gradient-to-br from-accent/8 to-violet-600/5 p-4",children:n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[14px] font-bold text-fg",children:"Upgrade to Pro"}),n.jsx("p",{className:"mt-0.5 text-[12px] text-fg-muted",children:"AI natural language search, advanced stats, and more."})]}),n.jsx(oe,{variant:"primary",size:"sm",className:"shrink-0",children:"Upgrade"})]})}),n.jsxs(oe,{variant:"danger",size:"sm",className:"w-full gap-2 justify-center",onClick:()=>void r(),children:[n.jsx(f1,{className:"h-4 w-4"}),"Sign out"]})]}),n.jsx("div",{className:"pb-6 lg:pb-0"})]})}const db=new Set(["google","github","trakt"]);function fb(){const c=wo(),{hydrate:r}=ml(),[f,o]=B.useState(null);return B.useEffect(()=>{const h=new URLSearchParams(window.location.search),g=h.get("code"),b=h.get("state"),S=h.get("error");if(S||!g||!b){c(`/?error=${encodeURIComponent(S??"missing_params")}`,{replace:!0});return}const M=b.split(":")[0];if(!db.has(M)){c("/?error=invalid_state",{replace:!0});return}et.post("/api/auth/exchange",{code:g,state:b,provider:M}).then(()=>r()).then(()=>c("/dashboard",{replace:!0})).catch(v=>o(v.message??"Authentication failed."))},[]),f?n.jsxs("div",{className:"fixed inset-0 flex flex-col items-center justify-center gap-4 bg-bg",children:[n.jsx("p",{className:"text-sm text-danger",children:f}),n.jsx("a",{href:"/login",className:"text-sm text-accent underline",children:"Back to login"})]}):n.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-bg",children:n.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-border border-t-accent"})})}const ah="cf-turnstile-script",mb=B.forwardRef(({siteKey:c,onVerify:r,onExpire:f,onError:o,className:h},g)=>{const b=B.useRef(null),S=B.useRef(null),{resolved:M}=Bi(),v=B.useRef(r),E=B.useRef(f),N=B.useRef(o);return B.useEffect(()=>{v.current=r},[r]),B.useEffect(()=>{E.current=f},[f]),B.useEffect(()=>{N.current=o},[o]),B.useEffect(()=>{let C=null;const L=()=>{!b.current||!window.turnstile||S.current||(S.current=window.turnstile.render(b.current,{sitekey:c,theme:M,callback:Q=>v.current(Q),"expired-callback":()=>{E.current?.()},"error-callback":()=>{N.current?.()}}))};if(window.turnstile)L();else if(document.getElementById(ah))C=setInterval(()=>{window.turnstile&&(C&&clearInterval(C),L())},100);else{const Q=document.createElement("script");Q.id=ah,Q.src="https://challenges.cloudflare.com/turnstile/v0/api.js",Q.async=!0,Q.defer=!0,Q.onload=L,document.head.appendChild(Q)}return()=>{C&&clearInterval(C),S.current&&window.turnstile&&(window.turnstile.remove(S.current),S.current=null)}},[c,M]),B.useImperativeHandle(g,()=>({reset:()=>{S.current&&window.turnstile&&window.turnstile.reset(S.current)}})),n.jsx("div",{ref:b,className:h})});mb.displayName="TurnstileWidget";const hb="",xa="";function xb(){return n.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",children:[n.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),n.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),n.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z",fill:"#FBBC05"}),n.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})}function gb(){return n.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"#ED1C24",opacity:"0.18"}),n.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-5l5-3-5-3v6z",fill:"#ED1C24"})]})}function Lt({children:c,delay:r=0,className:f=""}){const o=B.useRef(null),h=N0(o,{once:!0,margin:"-60px"});return n.jsx(Ae.div,{ref:o,initial:{opacity:0,y:32},animate:h?{opacity:1,y:0}:{},transition:{duration:.6,delay:r,ease:[.22,1,.36,1]},className:f,children:c})}function pb(){const[c,r]=B.useState([]);return B.useEffect(()=>{fetch(`${xa}/api/public/featured`).then(f=>f.json()).then(f=>{const o=[...f.movies??[],...f.shows??[]];r(o)}).catch(()=>{})},[]),c}const Ri=[["#7c3aed","#4f46e5"],["#db2777","#9333ea"],["#0891b2","#7c3aed"],["#059669","#0891b2"],["#d97706","#dc2626"],["#7c3aed","#ec4899"],["#1d4ed8","#7c3aed"],["#be185d","#7c3aed"],["#0f766e","#1d4ed8"],["#b45309","#7c3aed"],["#9333ea","#4f46e5"],["#dc2626","#9333ea"]],qi=["Dune: Part Two","Oppenheimer","The Bear","Succession","Project Hail Mary","Shogun","The Batman","Andor","Slow Horses","Station Eleven","The Midnight Library","Poor Things"];function bb({idx:c,style:r}){const[f,o]=Ri[c%Ri.length];return n.jsx("div",{className:"poster rounded-lg overflow-hidden shadow-xl flex-shrink-0 relative",style:{background:`linear-gradient(135deg, ${f}, ${o})`,width:80,...r},children:n.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-end pb-2 px-1",children:n.jsx("span",{className:"text-white/80 text-[7px] font-semibold text-center leading-tight line-clamp-2",children:qi[c%qi.length]})})})}const nh=[["#7c3aed","#4f46e5"],["#d97706","#b45309"],["#0891b2","#0f766e"],["#dc2626","#9333ea"],["#059669","#0891b2"],["#be185d","#9333ea"]],sh=["Project Hail Mary","Atomic Habits","The Road","Klara and the Sun","Dune","Midnight Library"];function vb({idx:c}){const[r,f]=nh[c%nh.length];return n.jsx("div",{className:"book-cover rounded-md overflow-hidden shadow-lg flex-shrink-0 relative",style:{background:`linear-gradient(160deg, ${r}, ${f})`,width:56},children:n.jsx("div",{className:"absolute inset-0 flex flex-col justify-end pb-1.5 px-1",children:n.jsx("span",{className:"text-white/80 text-[6px] font-semibold leading-tight line-clamp-2 text-center",children:sh[c%sh.length]})})})}const ih=72,ch=12;function go({baseItems:c,direction:r,duration:f}){const o=[...c,...c],h=c.length*(ih+ch);return n.jsx(Ae.div,{animate:{x:r==="left"?[0,-h]:[-h,0]},transition:{duration:f,repeat:1/0,ease:"linear"},className:"flex",style:{gap:ch,width:"max-content"},children:o.map((g,b)=>n.jsx("div",{className:"shrink-0 overflow-hidden rounded-lg",style:{width:ih,aspectRatio:"2/3"},children:g.poster?n.jsx("img",{src:g.poster,alt:g.title,className:"h-full w-full object-cover rounded-lg",style:{aspectRatio:"2/3"},loading:"lazy",decoding:"async"}):n.jsx("div",{className:"h-full w-full rounded-lg flex flex-col items-center justify-end pb-2 px-1",style:{background:`linear-gradient(135deg, ${g.color[0]}, ${g.color[1]})`},children:n.jsx("span",{className:"text-white/80 text-[7px] font-semibold text-center leading-tight line-clamp-2",children:g.title})})},b))})}function po(c,r=0){return Array.from({length:c},(f,o)=>{const h=(o+r)%Ri.length;return{title:qi[h%qi.length],poster:null,color:Ri[h]}})}function bo(c,r){return c.length===0?[]:c.length>=r?c.slice(0,r):Array.from({length:r},(f,o)=>c[o%c.length])}function yb(){const{user:c,hydrated:r}=ml();return n.jsx("header",{className:"fixed top-0 inset-x-0 z-50 glass-heavy border-b border-border/50",children:n.jsxs("div",{className:"mx-auto max-w-6xl px-4 h-14 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"relative flex h-8 w-8 items-center justify-center rounded-xl bg-gradient-to-br from-accent to-violet-600 shadow-lg shadow-accent/25",children:n.jsx(hl,{className:"h-4 w-4 text-white",fill:"white"})}),n.jsx("span",{className:"text-[17px] font-bold tracking-tight text-fg",children:"StreamPulse"})]}),n.jsxs("nav",{className:"hidden md:flex items-center gap-6 text-[13px] font-medium text-fg-muted",children:[n.jsx("a",{href:"#features",className:"hover:text-fg transition-colors",children:"Features"}),n.jsx("a",{href:"#pricing",className:"hover:text-fg transition-colors",children:"Pricing"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(rs,{compact:!0}),r&&c?n.jsx(at,{to:"/dashboard",children:n.jsxs(oe,{variant:"primary",size:"sm",className:"gap-1.5",children:["Dashboard ",n.jsx(cs,{className:"h-3.5 w-3.5"})]})}):n.jsx("a",{href:"#auth",children:n.jsx(oe,{variant:"primary",size:"sm",children:"Sign in"})})]})]})})}function jb({items:c}){const r=c.length>0,f=r?bo(c.slice(0,20),8):po(12,0),o=r?bo(c.slice(20,40),8):po(12,4),h=r?bo(c.slice(40,60),8):po(12,8);return n.jsxs("section",{className:"relative min-h-dvh flex flex-col items-center justify-center pt-14 overflow-hidden",children:[n.jsxs("div",{className:"pointer-events-none absolute inset-0",children:[n.jsx("div",{className:"absolute -top-32 left-1/2 -translate-x-1/2 h-[500px] w-[800px] rounded-full bg-accent/10 blur-[140px]"}),n.jsx("div",{className:"absolute bottom-0 left-0 h-[400px] w-[400px] rounded-full bg-book/8 blur-[120px]"}),n.jsx("div",{className:"absolute top-1/3 right-0 h-[300px] w-[300px] rounded-full bg-accent/8 blur-[100px]"})]}),n.jsxs("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:[n.jsx("div",{className:"absolute top-16 opacity-20 dark:opacity-15",children:n.jsx(go,{baseItems:f,direction:"left",duration:30})}),n.jsx("div",{className:"absolute top-40 opacity-15 dark:opacity-10",children:n.jsx(go,{baseItems:o,direction:"right",duration:35})}),n.jsx("div",{className:"absolute bottom-16 opacity-15 dark:opacity-10",children:n.jsx(go,{baseItems:h,direction:"left",duration:40})})]}),n.jsxs("div",{className:"relative z-10 flex flex-col items-center text-center px-4 max-w-3xl",children:[n.jsxs(Ae.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.5,ease:[.22,1,.36,1]},className:"mb-5 inline-flex items-center gap-2 rounded-full border border-accent/30 bg-accent/10 px-4 py-1.5 text-[12px] font-semibold text-accent uppercase tracking-wider",children:[n.jsx(pa,{className:"h-3.5 w-3.5"}),"Beta launching August 2026"]}),n.jsxs(Ae.h1,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},transition:{duration:.6,delay:.1,ease:[.22,1,.36,1]},className:"text-[44px] sm:text-[64px] font-bold tracking-tight leading-[1.08] text-fg",children:["Everything you",n.jsx("br",{}),n.jsx("span",{className:"animate-gradient bg-gradient-to-r from-accent via-violet-400 to-book bg-clip-text text-transparent",children:"watch and read,"}),n.jsx("br",{}),"in one place."]}),n.jsx(Ae.p,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.6,delay:.2,ease:[.22,1,.36,1]},className:"mt-5 text-[17px] text-fg-muted leading-relaxed max-w-xl",children:"StreamPulse tracks your movies, TV shows, and books with AI-powered insights, smart watchlists, and beautiful statistics — built entirely on Cloudflare's edge."}),n.jsxs(Ae.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.6,delay:.3,ease:[.22,1,.36,1]},className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:[n.jsx("a",{href:"#auth",className:"block",children:n.jsxs(oe,{variant:"primary",size:"xl",className:"gap-2 shadow-xl shadow-accent/30 px-7",children:["Start for free ",n.jsx(cs,{className:"h-4 w-4"})]})}),n.jsx("a",{href:"#features",children:n.jsx(oe,{variant:"secondary",size:"xl",className:"px-7",children:"Explore features"})})]}),n.jsx(Ae.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.8,delay:.5},className:"mt-10 flex flex-wrap items-center justify-center gap-x-6 gap-y-2 text-[12px] text-fg-subtle",children:["No credit card required","Free forever plan","Edge-powered — globally fast"].map(g=>n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(ba,{className:"h-3.5 w-3.5 text-success"}),g]},g))})]}),n.jsx(Ae.div,{animate:{y:[0,8,0]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},className:"absolute bottom-8 left-1/2 -translate-x-1/2 text-fg-subtle",children:n.jsx("div",{className:"h-8 w-5 rounded-full border-2 border-fg-subtle/30 flex items-start justify-center pt-1.5",children:n.jsx("div",{className:"h-1.5 w-1 rounded-full bg-fg-subtle/50"})})})]})}function Nb(){const c=[{value:"10M+",label:"Titles in catalogue"},{value:"3",label:"Media categories"},{value:"AI",label:"Powered insights"},{value:"100%",label:"Edge-deployed"}];return n.jsx(Lt,{children:n.jsx("div",{className:"border-y border-border bg-surface/50",children:n.jsx("div",{className:"mx-auto max-w-5xl px-4 py-8 grid grid-cols-2 md:grid-cols-4 gap-8",children:c.map(r=>n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"text-[32px] font-bold text-accent",children:r.value}),n.jsx("div",{className:"text-[13px] text-fg-muted mt-0.5",children:r.label})]},r.label))})})})}function Di({icon:c,accent:r,eyebrow:f,title:o,description:h,bullets:g,mockup:b,flip:S=!1}){return n.jsx(Lt,{children:n.jsxs("div",{className:`flex flex-col ${S?"md:flex-row-reverse":"md:flex-row"} gap-10 md:gap-16 items-center`,children:[n.jsxs("div",{className:"flex-1 space-y-5",children:[n.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[11px] font-semibold uppercase tracking-wider",style:{borderColor:`${r}40`,color:r,background:`${r}12`},children:[n.jsx(c,{className:"h-3.5 w-3.5"}),f]}),n.jsx("h2",{className:"text-[28px] sm:text-[36px] font-bold tracking-tight text-fg leading-tight",children:o}),n.jsx("p",{className:"text-[15px] text-fg-muted leading-relaxed",children:h}),n.jsx("ul",{className:"space-y-2.5",children:g.map(M=>n.jsxs("li",{className:"flex items-start gap-2.5 text-[14px] text-fg-muted",children:[n.jsx(ba,{className:"mt-0.5 h-4 w-4 shrink-0 text-success"}),M]},M))})]}),n.jsx("div",{className:"flex-1 w-full",children:b})]})})}function Sb(){return n.jsxs("div",{className:"card-glow rounded-2xl bg-surface p-4 space-y-3",children:[n.jsxs("div",{className:"relative rounded-xl overflow-hidden h-40",style:{background:"linear-gradient(135deg, #1e1b4b, #4c1d95, #7c3aed)"},children:[n.jsx("div",{className:"hero-vignette absolute inset-0"}),n.jsxs("div",{className:"absolute bottom-3 left-4",children:[n.jsx("div",{className:"text-white font-bold text-[15px]",children:"Dune: Part Two"}),n.jsx("div",{className:"flex gap-1.5 mt-1",children:["Sci-Fi","Epic","2024"].map(c=>n.jsx("span",{className:"rounded-full bg-white/15 px-2 py-0.5 text-[10px] text-white/80",children:c},c))})]})]}),n.jsx("div",{className:"flex gap-2 overflow-hidden",children:[0,1,2,3,4].map(c=>n.jsx(bb,{idx:c,style:{width:56}},c))}),n.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-elevated px-3 py-2.5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-[12px] font-semibold text-fg",children:"Mark as watched"}),n.jsx("div",{className:"text-[10px] text-fg-muted",children:"Add rating & review"})]}),n.jsx("div",{className:"h-7 w-7 rounded-full bg-accent flex items-center justify-center",children:n.jsx(ba,{className:"h-3.5 w-3.5 text-white"})})]})]})}function wb(){return n.jsxs("div",{className:"card-glow rounded-2xl bg-surface p-4 space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(Ke,{className:"h-4 w-4 text-book"}),n.jsx("span",{className:"text-[13px] font-semibold text-fg",children:"Reading shelf"}),n.jsx("span",{className:"ml-auto text-[11px] text-fg-subtle",children:"6 books"})]}),n.jsx("div",{className:"flex gap-2",children:[0,1,2,3,4,5].map(c=>n.jsx(vb,{idx:c},c))}),n.jsxs("div",{className:"rounded-xl bg-elevated px-3 py-2.5",children:[n.jsxs("div",{className:"flex justify-between items-start mb-2",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-[12px] font-semibold text-fg",children:"Atomic Habits"}),n.jsx("div",{className:"text-[10px] text-fg-muted",children:"James Clear · 320 pages"})]}),n.jsx("span",{className:"text-[10px] font-medium text-book",children:"Reading"})]}),n.jsx("div",{className:"h-1.5 rounded-full bg-container overflow-hidden",children:n.jsx(Ae.div,{initial:{width:0},animate:{width:"68%"},transition:{duration:1.2,delay:.5,ease:[.22,1,.36,1]},className:"h-full rounded-full bg-book"})}),n.jsx("div",{className:"text-[10px] text-fg-subtle mt-1",children:"68% complete"})]})]})}function zb(){return n.jsxs("div",{className:"card-glow rounded-2xl bg-surface p-4 space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"h-7 w-7 rounded-full bg-gradient-to-br from-accent to-violet-500 flex items-center justify-center",children:n.jsx(Yi,{className:"h-3.5 w-3.5 text-white"})}),n.jsx("span",{className:"text-[13px] font-semibold text-fg",children:"AI Insights"}),n.jsx("span",{className:"ml-auto rounded-full bg-accent/15 px-2 py-0.5 text-[10px] font-semibold text-accent",children:"Pro"})]}),n.jsxs("div",{className:"rounded-xl bg-elevated p-3 text-[12px] text-fg-muted leading-relaxed border border-accent/10",children:[n.jsx("span",{className:"text-accent font-medium",children:"StreamPulse AI: "}),"Based on your love for Denis Villeneuve films and hard sci-fi novels, you'll likely enjoy ",n.jsx("span",{className:"text-fg font-medium",children:"Arrival"})," and ",n.jsx("span",{className:"text-fg font-medium",children:"The Ministry for the Future"}),"."]}),n.jsxs("div",{className:"rounded-xl bg-elevated px-3 py-2.5 flex items-center gap-2 border border-border",children:[n.jsx(Vl,{className:"h-3.5 w-3.5 text-fg-muted"}),n.jsx("span",{className:"text-[12px] text-fg-subtle flex-1",children:"Show me slow-burn thrillers I haven't seen yet…"}),n.jsx(pa,{className:"h-3.5 w-3.5 text-accent"})]}),n.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{label:"Watched",value:"184"},{label:"Books read",value:"42"},{label:"Hours",value:"312"}].map(c=>n.jsxs("div",{className:"rounded-lg bg-elevated p-2 text-center",children:[n.jsx("div",{className:"text-[18px] font-bold text-fg",children:c.value}),n.jsx("div",{className:"text-[10px] text-fg-muted",children:c.label})]},c.label))})]})}function Ab(){const c=[{title:"Oppenheimer",type:"Movie",color:"#4f46e5"},{title:"The Bear S3",type:"Show",color:"#0891b2"},{title:"Slow Horses",type:"Show",color:"#059669"}];return n.jsxs("div",{className:"card-glow rounded-2xl bg-surface p-4 space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(us,{className:"h-4 w-4 text-accent"}),n.jsx("span",{className:"text-[13px] font-semibold text-fg",children:"My watchlist · Public"}),n.jsx("span",{className:"ml-auto text-[11px] text-fg-subtle",children:"3 items"})]}),c.map((r,f)=>n.jsxs(Ae.div,{initial:{opacity:0,x:-12},animate:{opacity:1,x:0},transition:{delay:f*.12,duration:.4,ease:[.22,1,.36,1]},className:"flex items-center gap-3 rounded-xl bg-elevated px-3 py-2.5",children:[n.jsx("div",{className:"h-9 w-[26px] rounded poster shrink-0",style:{background:`linear-gradient(135deg, ${r.color}, #7c3aed)`}}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-[12px] font-semibold text-fg truncate",children:r.title}),n.jsx("div",{className:"text-[10px] text-fg-muted",children:r.type})]}),n.jsx("span",{className:"text-[10px] font-medium text-fg-subtle",children:"Watchlist"})]},r.title)),n.jsx("div",{className:"rounded-xl border border-dashed border-border px-3 py-2 text-center text-[11px] text-fg-subtle cursor-pointer hover:border-accent/40 hover:text-fg-muted transition-colors",children:"+ Add title"})]})}function kb(){const c=[{icon:hl,number:"01",title:"Create your account",description:"Sign up in seconds with Google, GitHub, Trakt, or email. No credit card required — free forever.",accent:"#8b5cf6"},{icon:ph,number:"02",title:"Import your history",description:"Already on Trakt or Goodreads? Import everything with one click. Your history is yours.",accent:"#f59e0b"},{icon:is,number:"03",title:"Explore your data",description:"Beautiful stats, AI recommendations, and smart watchlists — all powered by the edge.",accent:"#8b5cf6"}];return n.jsx(Lt,{children:n.jsxs("section",{className:"mx-auto max-w-5xl px-4 py-20",children:[n.jsxs("div",{className:"text-center mb-14",children:[n.jsx("h2",{className:"text-[32px] sm:text-[40px] font-bold tracking-tight text-fg",children:"Up and running in minutes"}),n.jsx("p",{className:"mt-3 text-[15px] text-fg-muted max-w-lg mx-auto",children:"No complex setup. No long onboarding. Just sign up and start tracking."})]}),n.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:c.map((r,f)=>{const o=r.icon;return n.jsx(Lt,{delay:f*.1,children:n.jsxs("div",{className:"relative rounded-2xl border border-border bg-surface p-6 group hover:border-accent/30 transition-colors duration-300",children:[n.jsx("div",{className:"absolute top-0 left-0 right-0 h-px rounded-t-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:`linear-gradient(90deg, transparent, ${r.accent}60, transparent)`}}),n.jsxs("div",{className:"flex items-start justify-between mb-5",children:[n.jsx("div",{className:"flex h-11 w-11 items-center justify-center rounded-xl",style:{background:`${r.accent}18`},children:n.jsx(o,{className:"h-5 w-5",style:{color:r.accent}})}),n.jsx("span",{className:"text-[32px] font-bold text-border leading-none",children:r.number})]}),n.jsx("h3",{className:"text-[16px] font-bold text-fg mb-2",children:r.title}),n.jsx("p",{className:"text-[13px] text-fg-muted leading-relaxed",children:r.description})]})},r.number)})})]})})}function _b(){return n.jsxs("section",{id:"features",className:"mx-auto max-w-5xl px-4 py-24 space-y-24",children:[n.jsx("div",{className:"text-center mb-4",children:n.jsxs(Lt,{children:[n.jsx("h2",{className:"text-[36px] sm:text-[44px] font-bold tracking-tight text-fg",children:"Everything in one dashboard"}),n.jsx("p",{className:"mt-3 text-[16px] text-fg-muted max-w-xl mx-auto",children:"One app for every story — whether it plays or reads."})]})}),n.jsx(Di,{icon:_o,accent:"#8b5cf6",eyebrow:"Movies & TV Shows",title:"Your entire watch history, beautifully organised.",description:"Log what you watch as you watch it. Rate episodes, track series progress, and get TMDB-powered metadata including cast, crew, and backdrop art.",bullets:["Automatic episode tracking for ongoing series","Import your history from Trakt with one click","Rich detail pages with cast, ratings, and trailers","Discover what your friends are watching"],mockup:n.jsx(Sb,{})}),n.jsx(Di,{icon:Ke,accent:"#f59e0b",eyebrow:"Books",title:"Track every book, review every page.",description:"Catalogue your reading life with Google Books and OpenLibrary data. Log reading progress, write reviews, and build shelves others can follow.",bullets:["Reading progress with page-level tracking","Import your Goodreads library instantly","Buy links via open affiliate network","Reading stats and yearly goals"],mockup:n.jsx(wb,{}),flip:!0}),n.jsx(Di,{icon:Yi,accent:"#8b5cf6",eyebrow:"AI — Pro feature",title:"Recommendations that actually know you.",description:"Vectorize-powered semantic search and a Gemini-based recommendation engine that understands your taste, not just your history.",bullets:['Natural language search: "slow-burn thrillers set in Scandinavia"',"Personalised picks based on mood and genre patterns","AI-generated summaries and thematic tags","Powered by Cloudflare AI Gateway — private by design"],mockup:n.jsx(zb,{})}),n.jsx(Di,{icon:us,accent:"#8b5cf6",eyebrow:"Lists & sharing",title:"Build lists. Share taste.",description:"Create named watchlists, share them publicly with a permalink, and discover curated lists from the community.",bullets:["Public and private list visibility","Shareable permalink for every list","Collaborative lists (Pro)","Export your data as CSV any time"],mockup:n.jsx(Ab,{}),flip:!0})]})}function Tb(){const c=[{icon:_o,label:"Movie & show tracking"},{icon:Ke,label:"Book shelf"},{icon:Yi,label:"AI recommendations"},{icon:Vl,label:"Natural language search"},{icon:is,label:"Watch statistics"},{icon:us,label:"Custom watchlists"},{icon:Qi,label:"Ratings & reviews"},{icon:cn,label:"Passkey login"},{icon:Ao,label:"GitHub / Google / Trakt OAuth"},{icon:pa,label:"Trakt import"}];return n.jsx(Lt,{children:n.jsx("section",{className:"border-y border-border bg-surface/40 py-12",children:n.jsxs("div",{className:"mx-auto max-w-5xl px-4",children:[n.jsx("p",{className:"text-center text-[12px] uppercase tracking-widest text-fg-subtle mb-6 font-semibold",children:"Everything included"}),n.jsx("div",{className:"flex flex-wrap justify-center gap-2.5",children:c.map(r=>n.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-border bg-surface px-3.5 py-1.5 text-[13px] text-fg-muted",children:[n.jsx(r.icon,{className:"h-3.5 w-3.5 text-accent"}),r.label]},r.label))})]})})})}const Mb=["Movies & TV show tracking","Book shelf & reading progress","Watch & reading history","Ratings and reviews","Custom watchlists (up to 5)","Basic statistics","Trakt / Google / GitHub login","Passkey authentication","CSV export"],Eb=["Everything in Free","AI-powered recommendations","Natural language search","Unlimited custom lists","Collaborative lists","Advanced statistics & trends","Priority support","Early access to new features","Founder badge (lifetime)"];function uh({plan:c,price:r,period:f,features:o,missing:h,cta:g,highlighted:b}){return n.jsxs("div",{className:`relative rounded-2xl p-6 flex flex-col gap-6 transition-all ${b?"bg-gradient-to-b from-accent/10 to-surface border border-accent/40 shadow-2xl shadow-accent/10":"bg-surface border border-border"}`,children:[b&&n.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 rounded-full bg-accent px-4 py-1 text-[11px] font-bold text-white uppercase tracking-wider shadow-lg shadow-accent/30",children:"Most popular"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[13px] font-semibold text-fg-muted uppercase tracking-widest",children:c}),n.jsxs("div",{className:"flex items-baseline gap-1.5 mt-2",children:[n.jsx("span",{className:"text-[42px] font-bold text-fg tracking-tight",children:r}),f&&n.jsx("span",{className:"text-[14px] text-fg-muted",children:f})]})]}),n.jsx("a",{href:"#auth",className:"block",children:n.jsx(oe,{variant:b?"primary":"secondary",size:"lg",className:`w-full ${b?"shadow-lg shadow-accent/25":""}`,children:g})}),n.jsxs("ul",{className:"space-y-2.5",children:[o.map(S=>n.jsxs("li",{className:"flex items-start gap-2.5 text-[13px] text-fg-muted",children:[n.jsx(ba,{className:"mt-0.5 h-4 w-4 shrink-0 text-success"}),S]},S)),h?.map(S=>n.jsxs("li",{className:"flex items-start gap-2.5 text-[13px] text-fg-subtle line-through",children:[n.jsx(Xi,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-subtle/50"}),S]},S))]})]})}function Cb(){return n.jsxs("section",{id:"pricing",className:"mx-auto max-w-4xl px-4 py-24",children:[n.jsx(Lt,{children:n.jsxs("div",{className:"text-center mb-12",children:[n.jsx("h2",{className:"text-[36px] sm:text-[44px] font-bold tracking-tight text-fg",children:"Simple, honest pricing"}),n.jsx("p",{className:"mt-3 text-[16px] text-fg-muted max-w-lg mx-auto",children:"Start free, upgrade when you want the AI magic."})]})}),n.jsxs(Lt,{delay:.1,children:[n.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[n.jsx(uh,{plan:"Free",price:"€0",period:"forever",features:Mb,missing:["AI recommendations","Natural language search","Unlimited lists"],cta:"Get started free"}),n.jsx(uh,{plan:"Pro",price:"€40",period:"/ year",features:Eb,cta:"Go Pro",highlighted:!0})]}),n.jsx("p",{className:"mt-6 text-center text-[12px] text-fg-subtle",children:"Billed annually via Paddle · Secure checkout · Cancel any time"})]})]})}function Ob(){return n.jsx(Lt,{children:n.jsxs("section",{className:"relative overflow-hidden mx-4 mb-16 rounded-3xl border border-accent/20 bg-gradient-to-br from-accent/10 via-surface to-surface py-16 px-6 text-center",children:[n.jsx("div",{className:"pointer-events-none absolute inset-0",children:n.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 h-64 w-64 rounded-full bg-accent/15 blur-[80px]"})}),n.jsxs("div",{className:"relative z-10 max-w-xl mx-auto",children:[n.jsx("div",{className:"mb-4 inline-flex h-14 w-14 items-center justify-center rounded-2xl bg-gradient-to-br from-accent to-violet-600 shadow-2xl shadow-accent/30 mx-auto",children:n.jsx(hl,{className:"h-7 w-7 text-white",fill:"white"})}),n.jsx("h2",{className:"text-[32px] sm:text-[40px] font-bold tracking-tight text-fg",children:"Ready to track everything?"}),n.jsx("p",{className:"mt-3 text-[15px] text-fg-muted",children:"Beta opens August 1, 2026. Join free today — no credit card needed."}),n.jsx("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:n.jsx("a",{href:"#auth",className:"block",children:n.jsxs(oe,{variant:"primary",size:"xl",className:"gap-2 shadow-xl shadow-accent/30 px-8",children:["Create free account ",n.jsx(cs,{className:"h-4 w-4"})]})})})]})]})})}function Db(){const[c,r]=B.useState(""),[f,o]=B.useState(""),[h,g]=B.useState(!1),[b,S]=B.useState(!1),[M,v]=B.useState(null),[E,N]=B.useState(null),C=B.useRef(null),L=async Q=>{if(Q.preventDefault(),!(!c.trim()||!f)){S(!0),v(null);try{const J=await fetch(`${xa}/api/auth/login`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:c.trim(),password:f,...E?{turnstileToken:E}:{}})}),Y=await J.json();J.ok?Y.mfa_required?window.location.href="/login":window.location.replace("/dashboard"):(v(Y.error??"Sign-in failed."),C.current?.reset(),N(null))}catch{v("Connection error. Please try again."),C.current?.reset(),N(null)}finally{S(!1)}}};return n.jsxs("form",{onSubmit:L,className:"space-y-3",noValidate:!0,children:[n.jsx(fl,{type:"email",placeholder:"Email address",value:c,onChange:Q=>r(Q.target.value),icon:n.jsx(Nh,{className:"h-3.5 w-3.5"}),autoComplete:"email",required:!0,disabled:b}),n.jsxs("div",{className:"relative",children:[n.jsx(fl,{type:h?"text":"password",placeholder:"Password",value:f,onChange:Q=>o(Q.target.value),icon:n.jsx(ko,{className:"h-3.5 w-3.5"}),autoComplete:"current-password",required:!0,disabled:b,className:"pr-10"}),n.jsx("button",{type:"button",onClick:()=>g(Q=>!Q),className:"absolute inset-y-0 right-3 flex items-center text-fg-muted hover:text-fg transition-colors",tabIndex:-1,"aria-label":h?"Hide password":"Show password",children:h?n.jsx(bh,{className:"h-3.5 w-3.5"}):n.jsx(vh,{className:"h-3.5 w-3.5"})})]}),hb,M&&n.jsx("p",{className:"text-center text-[12px] text-danger",children:M}),n.jsx(oe,{type:"submit",variant:"primary",size:"lg",className:"w-full gap-2 shadow-lg shadow-accent/20",disabled:b||!c||!f||!1,children:b?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-accent-fg/40 border-t-accent-fg"}),"Signing in…"]}):n.jsxs(n.Fragment,{children:["Sign in ",n.jsx(hh,{className:"h-4 w-4"})]})})]})}function Ub(){const[c,r]=B.useState("oauth"),[f,o]=B.useState(!1),[h,g]=B.useState(null),b=async()=>{o(!0),g(null);try{const{startAuthentication:S}=await Vi(async()=>{const{startAuthentication:N}=await import("./index-BDkarAkX.js");return{startAuthentication:N}},[]),M=await fetch(`${xa}/api/auth/passkey/login/options`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}}).then(N=>N.json()),v=await S(M),E=await fetch(`${xa}/api/auth/passkey/login/verify`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)});if(E.ok)window.location.replace("/dashboard");else{const{error:N}=await E.json();g(N??"Passkey failed")}}catch(S){g(S instanceof Error?S.message:"Passkey cancelled")}finally{o(!1)}};return n.jsx(Lt,{children:n.jsx("section",{id:"auth",className:"py-20 px-4",children:n.jsx("div",{className:"mx-auto max-w-md",children:n.jsxs("div",{className:"relative rounded-3xl border border-accent/20 bg-gradient-to-b from-accent/8 via-surface to-surface p-8 shadow-2xl shadow-accent/5",children:[n.jsx("div",{className:"pointer-events-none absolute -top-16 left-1/2 -translate-x-1/2 h-32 w-64 rounded-full bg-accent/15 blur-[60px]"}),n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"mb-6 text-center",children:[n.jsx("div",{className:"mb-4 inline-flex h-12 w-12 items-center justify-center rounded-2xl bg-gradient-to-br from-accent to-violet-600 shadow-xl shadow-accent/25",children:n.jsx(hl,{className:"h-6 w-6 text-white",fill:"white"})}),n.jsx("h2",{className:"text-[22px] font-bold tracking-tight text-fg",children:"Sign in or create a free account"}),n.jsx("p",{className:"mt-1.5 text-[13px] text-fg-muted",children:"No credit card required · Free forever"})]}),n.jsxs("div",{className:"mb-5 flex rounded-xl bg-elevated p-1 gap-1",children:[n.jsx("button",{type:"button",onClick:()=>r("oauth"),className:`flex-1 rounded-[8px] py-2 text-[13px] font-semibold transition-all duration-150 ${c==="oauth"?"bg-surface text-fg shadow-sm":"text-fg-muted hover:text-fg"}`,children:"Social login"}),n.jsx("button",{type:"button",onClick:()=>r("email"),className:`flex-1 rounded-[8px] py-2 text-[13px] font-semibold transition-all duration-150 ${c==="email"?"bg-surface text-fg shadow-sm":"text-fg-muted hover:text-fg"}`,children:"Email & password"})]}),c==="oauth"?n.jsxs("div",{className:"space-y-2.5",children:[n.jsx("a",{href:`${xa}/api/auth/exchange?provider=google`,className:"block",children:n.jsxs(oe,{variant:"outline",size:"lg",className:"w-full gap-3 font-medium",children:[n.jsx(xb,{}),"Continue with Google"]})}),n.jsx("a",{href:`${xa}/api/auth/exchange?provider=github`,className:"block",children:n.jsxs(oe,{variant:"outline",size:"lg",className:"w-full gap-3 font-medium",children:[n.jsx(Ao,{className:"h-4 w-4 shrink-0"}),"Continue with GitHub"]})}),n.jsx("a",{href:`${xa}/api/auth/exchange?provider=trakt`,className:"block",children:n.jsxs(oe,{variant:"outline",size:"lg",className:"w-full gap-3 font-medium",children:[n.jsx(gb,{}),"Continue with Trakt"]})})]}):n.jsx(Db,{}),n.jsxs("div",{className:"relative flex items-center py-4 mt-2",children:[n.jsx("div",{className:"flex-1 border-t border-border"}),n.jsx("span",{className:"mx-3 text-[11px] font-semibold uppercase tracking-widest text-fg-subtle",children:"or"}),n.jsx("div",{className:"flex-1 border-t border-border"})]}),n.jsxs(oe,{variant:"secondary",size:"lg",className:"w-full gap-3 font-medium",onClick:b,disabled:f,children:[f?n.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-border border-t-fg-muted"}):n.jsx(cn,{className:"h-4 w-4 shrink-0"}),f?"Authenticating…":"Sign in with Passkey"]}),h&&n.jsx("p",{className:"mt-2 text-center text-[12px] text-danger",children:h}),n.jsx("p",{className:"mt-6 text-center text-[11px] text-fg-subtle",children:"By continuing, you agree to our terms of service."})]})]})})})})}function Hb(){return n.jsx("footer",{className:"border-t border-border",children:n.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-8 flex flex-col sm:flex-row items-center justify-between gap-4 text-[12px] text-fg-subtle",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-lg bg-gradient-to-br from-accent to-violet-600",children:n.jsx(hl,{className:"h-3 w-3 text-white",fill:"white"})}),n.jsx("span",{className:"font-semibold text-fg-muted",children:"StreamPulse"}),n.jsx("span",{children:"· Built on Cloudflare Workers"})]}),n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("a",{href:"#auth",className:"hover:text-fg-muted transition-colors",children:"Sign in"}),n.jsx("a",{href:"#pricing",className:"hover:text-fg-muted transition-colors",children:"Pricing"}),n.jsx("span",{children:"© 2026 TheWebDexter Tech"})]})]})})}function Bb(){const c=pb(),r=c.length>0?c:[];return n.jsxs("div",{className:"min-h-dvh flex flex-col",children:[n.jsx(yb,{}),n.jsxs("main",{className:"flex-1",children:[n.jsx(jb,{items:r}),n.jsx(Nb,{}),n.jsx(kb,{}),n.jsx(_b,{}),n.jsx(Tb,{}),n.jsx(Cb,{}),n.jsx(Ob,{}),n.jsx(Ub,{})]}),n.jsx(Hb,{})]})}const Ql="",Rb="";function qb(){return n.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",children:[n.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),n.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),n.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z",fill:"#FBBC05"}),n.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})}function Gb(){return n.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"#ED1C24",opacity:"0.18"}),n.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-5l5-3-5-3v6z",fill:"#ED1C24"})]})}const oh=[["#7c3aed","#4f46e5"],["#db2777","#9333ea"],["#0891b2","#7c3aed"],["#059669","#0891b2"],["#d97706","#dc2626"],["#7c3aed","#ec4899"],["#1d4ed8","#7c3aed"],["#be185d","#7c3aed"],["#0f766e","#1d4ed8"],["#b45309","#7c3aed"],["#9333ea","#4f46e5"],["#dc2626","#9333ea"]],rh=["Dune: Part Two","Oppenheimer","The Bear","Succession","Shogun","Andor","Slow Horses","Station Eleven","The Batman","Poor Things","The Midnight Library","Project Hail Mary"];function Lb({idx:c}){const[r,f]=oh[c%oh.length];return n.jsx("div",{className:"shrink-0 rounded-lg overflow-hidden shadow-lg",style:{width:64,aspectRatio:"2/3",background:`linear-gradient(135deg, ${r}, ${f})`},children:n.jsx("div",{className:"h-full flex flex-col justify-end pb-1.5 px-1",children:n.jsx("span",{className:"text-white/70 text-[6px] font-semibold text-center leading-tight line-clamp-2",children:rh[c%rh.length]})})})}function ls({count:c,direction:r,duration:f,offset:o=0}){const h=Array.from({length:c*2},(b,S)=>S+o),g=c*74;return n.jsx(Ae.div,{animate:{x:r==="left"?[0,-g]:[-g,0]},transition:{duration:f,repeat:1/0,ease:"linear"},className:"flex",style:{gap:10,width:"max-content"},children:h.map(b=>n.jsx(Lb,{idx:b},b))})}function Yb(){return n.jsxs("div",{className:"hidden lg:flex flex-col relative w-[480px] flex-shrink-0 overflow-hidden",children:[n.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[#0d0b1e] via-[#0f0e20] to-[#12101e]"}),n.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#09090e] via-transparent to-transparent"}),n.jsx("div",{className:"absolute -top-20 -left-20 h-72 w-72 rounded-full bg-accent/12 blur-[100px]"}),n.jsx("div",{className:"absolute bottom-32 right-0 h-64 w-64 rounded-full bg-violet-500/8 blur-[80px]"}),n.jsxs("div",{className:"absolute top-0 left-0 right-0 pt-8 space-y-3 opacity-30",children:[n.jsx(ls,{count:8,direction:"left",duration:28,offset:0}),n.jsx(ls,{count:8,direction:"right",duration:34,offset:4}),n.jsx(ls,{count:8,direction:"left",duration:30,offset:8}),n.jsx(ls,{count:8,direction:"right",duration:26,offset:2}),n.jsx(ls,{count:8,direction:"left",duration:32,offset:6})]}),n.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-[#09090e] pointer-events-none",style:{top:"35%"}}),n.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-10",children:[n.jsxs("div",{className:"flex items-center gap-2.5 mb-8",children:[n.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-xl bg-gradient-to-br from-accent to-violet-600 shadow-lg shadow-accent/30",children:n.jsx(hl,{className:"h-4.5 w-4.5 text-white",fill:"white"})}),n.jsx("span",{className:"text-[18px] font-bold tracking-tight text-white",children:"StreamPulse"})]}),n.jsxs("h2",{className:"text-[28px] font-bold leading-snug tracking-tight text-white mb-2",children:["Your entire media life,",n.jsx("br",{}),n.jsx("span",{className:"text-accent/90",children:"beautifully tracked."})]}),n.jsx("p",{className:"text-[14px] text-white/50 mb-8 leading-relaxed",children:"Movies, TV shows, and books — all in one place with AI-powered insights."}),n.jsx("ul",{className:"space-y-3",children:[{icon:_o,label:"Movies & TV show tracking"},{icon:Ke,label:"Book shelf & reading progress"},{icon:Yi,label:"AI recommendations & search (Pro)"},{icon:pa,label:"Edge-powered — globally fast"}].map(({icon:c,label:r})=>n.jsxs("li",{className:"flex items-center gap-3 text-[13px] text-white/60",children:[n.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-accent/20",children:n.jsx(c,{className:"h-3 w-3 text-accent"})}),r]},r))})]})]})}const Qb={access_denied:"Sign-in was cancelled.",missing_params:"Sign-in failed — missing parameters.",invalid_state:"Sign-in failed — invalid state."};function Xb({oauthError:c}){return n.jsxs(Ae.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:8},transition:{duration:.2},className:"space-y-2.5",children:[n.jsx("a",{href:`${Ql}/api/auth/exchange?provider=google`,className:"block",children:n.jsxs(oe,{variant:"outline",size:"lg",className:"w-full gap-3 font-medium",children:[n.jsx(qb,{}),"Continue with Google"]})}),n.jsx("a",{href:`${Ql}/api/auth/exchange?provider=github`,className:"block",children:n.jsxs(oe,{variant:"outline",size:"lg",className:"w-full gap-3 font-medium",children:[n.jsx(Ao,{className:"h-4 w-4 shrink-0"}),"Continue with GitHub"]})}),n.jsx("a",{href:`${Ql}/api/auth/exchange?provider=trakt`,className:"block",children:n.jsxs(oe,{variant:"outline",size:"lg",className:"w-full gap-3 font-medium",children:[n.jsx(Gb,{}),"Continue with Trakt"]})}),c&&n.jsx("p",{className:"text-center text-[12px] text-danger pt-1",children:c})]},"oauth")}function Vb({onMFA:c}){const[r,f]=B.useState(""),[o,h]=B.useState(""),[g,b]=B.useState(!1),[S,M]=B.useState(!1),[v,E]=B.useState(null),[N,C]=B.useState(null),L=B.useRef(null),Q=async J=>{if(J.preventDefault(),!(!r.trim()||!o)){M(!0),E(null);try{const Y=await fetch(`${Ql}/api/auth/login`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r.trim(),password:o,...N?{turnstileToken:N}:{}})}),ne=await Y.json();Y.ok?ne.mfa_required&&ne.mfa_token?c(ne.mfa_token):window.location.replace("/dashboard"):(E(ne.error??"Sign-in failed. Please try again."),L.current?.reset(),C(null))}catch{E("Connection error. Please try again."),L.current?.reset(),C(null)}finally{M(!1)}}};return n.jsx(Ae.div,{initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},transition:{duration:.2},children:n.jsxs("form",{onSubmit:Q,className:"space-y-3",noValidate:!0,children:[n.jsx(fl,{type:"email",placeholder:"Email address",value:r,onChange:J=>f(J.target.value),icon:n.jsx(Nh,{className:"h-3.5 w-3.5"}),autoComplete:"email",required:!0,disabled:S}),n.jsxs("div",{className:"relative",children:[n.jsx(fl,{type:g?"text":"password",placeholder:"Password",value:o,onChange:J=>h(J.target.value),icon:n.jsx(ko,{className:"h-3.5 w-3.5"}),autoComplete:"current-password",required:!0,disabled:S,className:"pr-10"}),n.jsx("button",{type:"button",onClick:()=>b(J=>!J),className:"absolute inset-y-0 right-3 flex items-center text-fg-muted hover:text-fg transition-colors",tabIndex:-1,"aria-label":g?"Hide password":"Show password",children:g?n.jsx(bh,{className:"h-3.5 w-3.5"}):n.jsx(vh,{className:"h-3.5 w-3.5"})})]}),Rb,v&&n.jsx("p",{className:"text-center text-[12px] text-danger",children:v}),n.jsx(oe,{type:"submit",variant:"primary",size:"lg",className:"w-full gap-2 shadow-lg shadow-accent/20",disabled:S||!r||!o||!1,children:S?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-accent-fg/40 border-t-accent-fg"}),"Signing in…"]}):n.jsxs(n.Fragment,{children:["Sign in ",n.jsx(hh,{className:"h-4 w-4"})]})})]})},"email")}function Zb({mfaToken:c,onBack:r}){const[f,o]=B.useState(!1),[h,g]=B.useState(null),b=async()=>{o(!0),g(null);try{const{startAuthentication:S}=await Vi(async()=>{const{startAuthentication:L}=await import("./index-BDkarAkX.js");return{startAuthentication:L}},[]),M=await fetch(`${Ql}/api/auth/passkey/login/options`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}}).then(L=>L.json()),{flowId:v,...E}=M,N=await S(E),C=await fetch(`${Ql}/api/auth/passkey/mfa/verify`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({...N,mfa_token:c,...v?{flowId:v}:{}})});if(C.ok)window.location.replace("/dashboard");else{const{error:L}=await C.json();g(L??"Verification failed. Please try again.")}}catch(S){g(S instanceof Error?S.message:"Passkey cancelled or failed.")}finally{o(!1)}};return n.jsxs(Ae.div,{initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},transition:{duration:.25},className:"space-y-5",children:[n.jsxs("div",{className:"text-center space-y-1.5",children:[n.jsx("div",{className:"inline-flex h-14 w-14 items-center justify-center rounded-2xl bg-gradient-to-br from-accent to-violet-600 shadow-xl shadow-accent/25 mx-auto mb-2",children:n.jsx(cn,{className:"h-7 w-7 text-white"})}),n.jsx("h3",{className:"text-[18px] font-bold text-fg",children:"One more step"}),n.jsx("p",{className:"text-[13px] text-fg-muted leading-relaxed",children:"Your account has a passkey set up for two-factor authentication. Use your passkey to confirm your identity."})]}),n.jsx(oe,{variant:"primary",size:"lg",className:"w-full gap-3 shadow-lg shadow-accent/20",onClick:b,disabled:f,children:f?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-accent-fg/40 border-t-accent-fg"}),"Verifying…"]}):n.jsxs(n.Fragment,{children:[n.jsx(cn,{className:"h-4 w-4"}),"Verify with Passkey"]})}),h&&n.jsx("p",{className:"text-center text-[12px] text-danger",children:h}),n.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 mx-auto text-[12px] text-fg-muted hover:text-fg transition-colors",children:[n.jsx(ss,{className:"h-3.5 w-3.5"}),"Back to sign in"]})]})}function Kb(){const[c,r]=B.useState(!1),[f,o]=B.useState(null),h=async()=>{r(!0),o(null);try{const{startAuthentication:g}=await Vi(async()=>{const{startAuthentication:v}=await import("./index-BDkarAkX.js");return{startAuthentication:v}},[]),b=await fetch(`${Ql}/api/auth/passkey/login/options`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}}).then(v=>v.json()),S=await g(b),M=await fetch(`${Ql}/api/auth/passkey/login/verify`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)});if(M.ok)window.location.replace("/dashboard");else{const{error:v}=await M.json();o(v??"Passkey sign-in failed.")}}catch(g){o(g instanceof Error?g.message:"Passkey cancelled.")}finally{r(!1)}};return n.jsxs("div",{className:"space-y-2",children:[n.jsxs(oe,{variant:"secondary",size:"lg",className:"w-full gap-3 font-medium",onClick:h,disabled:c,children:[c?n.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-border border-t-fg-muted"}):n.jsx(cn,{className:"h-4 w-4 shrink-0"}),c?"Authenticating…":"Sign in with Passkey"]}),f&&n.jsx("p",{className:"text-center text-[12px] text-danger",children:f})]})}function Jb(){const[c,r]=B.useState("oauth"),[f,o]=B.useState(null),h=new URLSearchParams(window.location.search).get("error"),g=h?Qb[h]??"Sign-in failed. Please try again.":null;return n.jsxs("div",{className:"flex min-h-dvh bg-bg overflow-hidden",children:[n.jsx(Yb,{}),n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center px-4 py-12 relative",children:[n.jsx("div",{className:"absolute right-4 top-4 z-10",children:n.jsx(rs,{compact:!0})}),n.jsxs("a",{href:"/",className:"absolute left-4 top-4 z-10 flex items-center gap-1.5 text-[12px] text-fg-muted hover:text-fg transition-colors",children:[n.jsx(ss,{className:"h-3.5 w-3.5"}),"Home"]}),n.jsxs(Ae.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},transition:{duration:.45,ease:[.22,1,.36,1]},className:"w-full max-w-[380px]",children:[n.jsxs("div",{className:"mb-8 flex flex-col items-center gap-3",children:[n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute inset-0 rounded-2xl bg-accent/25 blur-lg"}),n.jsx("div",{className:"relative flex h-14 w-14 items-center justify-center rounded-2xl bg-gradient-to-br from-accent to-violet-600 shadow-2xl shadow-accent/30",children:n.jsx(hl,{className:"h-7 w-7 text-white",fill:"white"})})]}),n.jsxs("div",{className:"text-center",children:[n.jsx("h1",{className:"text-[22px] font-bold tracking-tight text-fg",children:"Welcome back"}),n.jsx("p",{className:"mt-1 text-[13px] text-fg-muted",children:"Sign in to your StreamPulse account"})]})]}),n.jsx(ns,{mode:"wait",children:f?n.jsx(Ae.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.2},children:n.jsx(Zb,{mfaToken:f,onBack:()=>o(null)})},"mfa"):n.jsxs(Ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[n.jsxs("div",{className:"mb-5 flex rounded-xl bg-elevated p-1 gap-1",children:[n.jsx("button",{type:"button",onClick:()=>r("oauth"),className:`flex-1 rounded-[8px] py-2 text-[13px] font-semibold transition-all duration-150 ${c==="oauth"?"bg-surface text-fg shadow-sm":"text-fg-muted hover:text-fg"}`,children:"Social login"}),n.jsx("button",{type:"button",onClick:()=>r("email"),className:`flex-1 rounded-[8px] py-2 text-[13px] font-semibold transition-all duration-150 ${c==="email"?"bg-surface text-fg shadow-sm":"text-fg-muted hover:text-fg"}`,children:"Email & password"})]}),n.jsx(ns,{mode:"wait",children:c==="oauth"?n.jsx(Xb,{oauthError:g},"oauth"):n.jsx(Vb,{onMFA:b=>o(b)},"email")}),n.jsxs("div",{className:"mt-5",children:[n.jsxs("div",{className:"relative flex items-center py-3",children:[n.jsx("div",{className:"flex-1 border-t border-border"}),n.jsx("span",{className:"mx-3 text-[11px] font-semibold uppercase tracking-widest text-fg-subtle",children:"or"}),n.jsx("div",{className:"flex-1 border-t border-border"})]}),n.jsx(Kb,{})]})]},"auth")}),n.jsxs("p",{className:"mt-7 text-center text-[11px] text-fg-subtle",children:["By continuing, you agree to our"," ",n.jsx("span",{className:"underline underline-offset-2 cursor-pointer hover:text-fg-muted transition-colors",children:"Terms of Service"}),"."]})]})]})]})}function $b(){const c=wo();return n.jsx("div",{className:"flex min-h-dvh flex-col items-center justify-center bg-bg px-6 text-center",children:n.jsxs(Ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,ease:[.22,1,.36,1]},children:[n.jsx("p",{className:"text-[80px] font-black leading-none text-fg/10 select-none",children:"404"}),n.jsx("h1",{className:"mt-2 text-[22px] font-bold text-fg",children:"Page not found"}),n.jsx("p",{className:"mt-2 text-[14px] text-fg-muted",children:"This page doesn't exist or you don't have access."}),n.jsxs("div",{className:"mt-6 flex items-center justify-center gap-3",children:[n.jsx(oe,{variant:"primary",size:"sm",onClick:()=>c("/"),children:"Go home"}),n.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>c(-1),children:"Go back"})]})]})})}function Wb(){const{user:c,hydrated:r}=ml();return r?c?n.jsx(zo,{to:"/dashboard",replace:!0}):n.jsx(Bb,{}):n.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-bg",children:n.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-border border-t-accent"})})}function Fb({children:c}){const{user:r,hydrated:f}=ml();return f?r?n.jsx(n.Fragment,{children:c}):n.jsx(zo,{to:"/",replace:!0}):n.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-bg",children:n.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-border border-t-accent"})})}function Ib(){const{hydrate:c}=ml();return B.useEffect(()=>{c()},[c]),n.jsx(ns,{mode:"wait",children:n.jsxs(y0,{children:[n.jsx(dt,{path:"/",element:n.jsx(Wb,{})}),n.jsx(dt,{path:"/login",element:n.jsx(Jb,{})}),n.jsx(dt,{path:"/auth/callback",element:n.jsx(fb,{})}),n.jsxs(dt,{element:n.jsx(Fb,{children:n.jsx(Bp,{})}),children:[n.jsx(dt,{index:!0,element:n.jsx(zo,{to:"/dashboard",replace:!0})}),n.jsx(dt,{path:"/dashboard",element:n.jsx(Lp,{})}),n.jsx(dt,{path:"/search",element:n.jsx(Zp,{})}),n.jsx(dt,{path:"/movie/:id",element:n.jsx(Pm,{type:"movie"})}),n.jsx(dt,{path:"/show/:id",element:n.jsx(Pm,{type:"show"})}),n.jsx(dt,{path:"/history",element:n.jsx(Fp,{})}),n.jsx(dt,{path:"/lists",element:n.jsx(eb,{})}),n.jsx(dt,{path:"/books",element:n.jsx(sb,{})}),n.jsx(dt,{path:"/profile",element:n.jsx(rb,{})})]}),n.jsx(dt,{path:"*",element:n.jsx($b,{})})]})})}const Pb=new x0({defaultOptions:{queries:{staleTime:5*6e4,retry:(c,r)=>r instanceof Ui&&r.status===404?!1:c<2,refetchOnWindowFocus:!1}}});T0.createRoot(document.getElementById("root")).render(n.jsx(as.StrictMode,{children:n.jsx(g0,{client:Pb,children:n.jsx(j0,{children:n.jsx(Ib,{})})})}));