Files
echo-nexus/_next/static/chunks/ec678d526829a3c4.js
T

14 lines
389 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16015,(e,t,s)=>{},98547,(e,t,s)=>{var r=e.i(47167);e.r(16015);var a=e.r(71645),i=a&&"object"==typeof a&&"default"in a?a:{default:a},n=void 0!==r.default&&r.default.env&&!0,o=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,s=t.name,r=void 0===s?"stylesheet":s,a=t.optimizeForSpeed,i=void 0===a?n:a;c(o(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof i,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=i,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,s=e.prototype;return s.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},s.isOptimizeForSpeed=function(){return this._optimizeForSpeed},s.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(n||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,s){return"number"==typeof s?e._serverSheet.cssRules[s]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),s},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},s.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},s.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},s.insertRule=function(e,t){if(c(o(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var s=this.getSheet();"number"!=typeof t&&(t=s.cssRules.length);try{s.insertRule(e,t)}catch(t){return n||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},s.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var s="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!s.cssRules[e])return e;s.deleteRule(e);try{s.insertRule(t,e)}catch(r){n||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),s.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];c(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},s.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},s.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},s.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,s){return s?t=t.concat(Array.prototype.map.call(e.getSheetForTag(s).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},s.makeStyleTag=function(e,t,s){t&&c(o(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var a=document.head||document.getElementsByTagName("head")[0];return s?a.insertBefore(r,s):a.appendChild(r),r},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var s=0;s<t.length;s++){var r=t[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,s=e.length;s;)t=33*t^e.charCodeAt(--s);return t>>>0},u={};function h(e,t){if(!t)return"jsx-"+e;var s=String(t),r=e+s;return u[r]||(u[r]="jsx-"+d(e+"-"+s)),u[r]}function f(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var s=e+t;return u[s]||(u[s]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[s]}var m=function(){function e(e){var t=void 0===e?{}:e,s=t.styleSheet,r=void 0===s?null:s,a=t.optimizeForSpeed,i=void 0!==a&&a;this._sheet=r||new l({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),r&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var s=this.getIdAndRules(e),r=s.styleId,a=s.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var i=a.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=i,this._instancesCounts[r]=1},t.remove=function(e){var t=this,s=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(s in this._instancesCounts,"styleId: `"+s+"` not found"),this._instancesCounts[s]-=1,this._instancesCounts[s]<1){var r=this._fromServer&&this._fromServer[s];r?(r.parentNode.removeChild(r),delete this._fromServer[s]):(this._indices[s].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[s]),delete this._instancesCounts[s]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],s=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return s[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,s;return t=this.cssRules(),void 0===(s=e)&&(s={}),t.map(function(e){var t=e[0],r=e[1];return i.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:s.nonce?s.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,s=e.dynamic,r=e.id;if(s){var a=h(r,s);return{styleId:a,rules:Array.isArray(t)?t.map(function(e){return f(a,e)}):[f(a,t)]}}return{styleId:h(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),p=a.createContext(null);function x(){return new m}function g(){return a.useContext(p)}p.displayName="StyleSheetContext";var b=i.default.useInsertionEffect||i.default.useLayoutEffect,y="u">typeof window?x():void 0;function v(e){var t=y||g();return t&&("u"<typeof window?t.add(e):b(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}v.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},s.StyleRegistry=function(e){var t=e.registry,s=e.children,r=a.useContext(p),n=a.useState(function(){return r||t||x()})[0];return i.default.createElement(p.Provider,{value:n},s)},s.createStyleRegistry=x,s.style=v,s.useStyleRegistry=g},37902,(e,t,s)=>{t.exports=e.r(98547).style},67585,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let r=e.r(32061);function a({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new r.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,s)=>{"use strict";function r(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"encodeURIPath",{enumerable:!0,get:function(){return r}})},52157,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"PreloadChunks",{enumerable:!0,get:function(){return l}});let r=e.r(43476),a=e.r(74080),i=e.r(63599),n=e.r(9885),o=e.r(43369);function l({moduleIds:e}){if("u">typeof window)return null;let t=i.workAsyncStorage.getStore();if(void 0===t)return null;let s=[];if(t.reactLoadableManifest&&e){let r=t.reactLoadableManifest;for(let t of e){if(!r[t])continue;let e=r[t].files;s.push(...e)}}if(0===s.length)return null;let l=(0,o.getDeploymentIdQueryOrEmptyString)();return(0,r.jsx)(r.Fragment,{children:s.map(e=>{let s=`${t.assetPrefix}/_next/${(0,n.encodeURIPath)(e)}${l}`;return e.endsWith(".css")?(0,r.jsx)("link",{precedence:"dynamic",href:s,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,a.preload)(s,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return c}});let r=e.r(43476),a=e.r(71645),i=e.r(67585),n=e.r(52157);function o(e){return{default:e&&"default"in e?e.default:e}}let l={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},c=function(e){let t={...l,...e},s=(0,a.lazy)(()=>t.loader().then(o)),c=t.loading;function d(e){let o=c?(0,r.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,d=l?a.Suspense:a.Fragment,u=t.ssr?(0,r.jsxs)(r.Fragment,{children:["u"<typeof window?(0,r.jsx)(n.PreloadChunks,{moduleIds:t.modules}):null,(0,r.jsx)(s,{...e})]}):(0,r.jsx)(i.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(s,{...e})});return(0,r.jsx)(d,{...l?{fallback:o}:{},children:u})}return d.displayName="LoadableComponent",d}},70703,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return a}});let r=e.r(55682)._(e.r(69093));function a(e,t){let s={};"function"==typeof e&&(s.loader=e);let a={...s,...t};return(0,r.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},52683,e=>{"use strict";let t,s,r,a,i,n;var o,l,c,d=e.i(43476),u=e.i(71645);function h({className:e}){let t=(0,u.useRef)(null);return(0,u.useEffect)(()=>{let e=t.current;if(!e)return;let s=e.getContext("2d");if(!s)return;let r=0,a=0,i=1,n=[],o=[],l=0,c=performance.now(),d=["#34d399","#fb7185","#fbbf24","#e879f9","#a5f3fc"];function u(){i=Math.min(2,window.devicePixelRatio||1),r=e.clientWidth,a=e.clientHeight,e.width=Math.floor(r*i),e.height=Math.floor(a*i),s.setTransform(i,0,0,i,0,0),n=Array.from({length:Math.min(220,Math.floor(r*a/7e3))},()=>({x:Math.random()*r,y:Math.random()*a,z:Math.random(),r:1.4*Math.random()+.2,tw:Math.random()*Math.PI*2,hue:.15>Math.random()?Math.floor(Math.random()*d.length):-1}))}u();let h=new ResizeObserver(u);return h.observe(e),l=requestAnimationFrame(function e(t){let i=t-c;c=t;let u=s.createRadialGradient(.5*r,.4*a,0,.5*r,.5*a,.8*Math.max(r,a));u.addColorStop(0,"#1a0f2e"),u.addColorStop(.45,"#0d0a1f"),u.addColorStop(1,"#050410"),s.fillStyle=u,s.fillRect(0,0,r,a),s.globalCompositeOperation="screen";for(let e=0;e<3;e++){let i=r*(.2+.3*e)+40*Math.sin(t/9e3+e),n=a*(.3+e%2*.4)+30*Math.cos(t/11e3+e),o=Math.max(80,Math.min(r,a)*(.25+.05*e)),l=s.createRadialGradient(i,n,0,i,n,o),c=0===e?"rgba(232,121,249,0.10)":1===e?"rgba(52,211,153,0.08)":"rgba(251,113,133,0.08)";l.addColorStop(0,c),l.addColorStop(1,"rgba(0,0,0,0)"),s.fillStyle=l,s.beginPath(),s.arc(i,n,o,0,2*Math.PI),s.fill()}for(let e of(s.globalCompositeOperation="source-over",n)){e.tw+=.02+.04*e.z;let t=.4+.35*Math.sin(e.tw)+.3*e.z;e.hue>=0?(s.fillStyle=d[e.hue],s.globalAlpha=Math.max(0,Math.min(1,t)),s.beginPath(),s.arc(e.x,e.y,1.6*e.r,0,2*Math.PI),s.fill(),s.globalAlpha=Math.max(0,Math.min(1,.25*t)),s.beginPath(),s.arc(e.x,e.y,4*e.r,0,2*Math.PI)):(s.fillStyle=`rgba(220,230,255,${Math.max(0,Math.min(1,t))})`,s.beginPath(),s.arc(e.x,e.y,e.r,0,2*Math.PI)),s.fill(),e.y+=.02+.05*e.z,e.y>a+2&&(e.y=-2,e.x=Math.random()*r)}s.globalAlpha=1,.04>Math.random()&&function(){if(o.length>60)return;let e=d[Math.floor(Math.random()*d.length)];o.push({x:Math.random()*r,y:a+10,vx:(Math.random()-.5)*.3,vy:-(.5*Math.random()+.2),life:0,maxLife:600+800*Math.random(),color:e})}(),s.globalCompositeOperation="screen";for(let e=o.length-1;e>=0;e--){let t=o[e];if(t.life+=i,t.x+=t.vx*i*.06,t.y+=t.vy*i*.06,t.life>t.maxLife||t.y<-10){o.splice(e,1);continue}let r=.7*Math.sin(t.life/t.maxLife*Math.PI);s.fillStyle=t.color,s.globalAlpha=r,s.beginPath(),s.arc(t.x,t.y,1.6,0,2*Math.PI),s.fill(),s.globalAlpha=.2*r,s.beginPath(),s.arc(t.x,t.y,5,0,2*Math.PI),s.fill()}s.globalAlpha=1,s.globalCompositeOperation="source-over",l=requestAnimationFrame(e)}),()=>{cancelAnimationFrame(l),h.disconnect()}},[]),(0,d.jsx)("canvas",{ref:t,className:e,"aria-hidden":"true"})}var f=e.i(18533),m=e.i(52664),p=e.i(25147),x=e.i(75254);let g=(0,x.default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var b=e.i(9778),y=e.i(67240);e.i(74080);var v=e.i(91918),w=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let s=(0,v.createSlot)(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:a,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,d.jsx)(a?s:t,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),j="Progress",[N,k]=function(e,t=[]){let s=[],r=()=>{let t=s.map(e=>u.createContext(e));return function(s){let r=s?.[e]||t;return u.useMemo(()=>({[`__scope${e}`]:{...s,[e]:r}}),[s,r])}};return r.scopeName=e,[function(t,r){let a=u.createContext(r);a.displayName=t+"Context";let i=s.length;s=[...s,r];let n=t=>{let{scope:s,children:r,...n}=t,o=s?.[e]?.[i]||a,l=u.useMemo(()=>n,Object.values(n));return(0,d.jsx)(o.Provider,{value:l,children:r})};return n.displayName=t+"Provider",[n,function(s,n){let o=n?.[e]?.[i]||a,l=u.useContext(o);if(l)return l;if(void 0!==r)return r;throw Error(`\`${s}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let s=()=>{let s=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=s.reduce((t,{useScope:s,scopeName:r})=>{let a=s(e)[`__scope${r}`];return{...t,...a}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return s.scopeName=t.scopeName,s}(r,...t)]}(j),[S,T]=N(j),C=u.forwardRef((e,t)=>{var s,r;let{__scopeProgress:a,value:i=null,max:n,getValueLabel:o=P,...l}=e;(n||0===n)&&!R(n)&&console.error((s=`${n}`,`Invalid prop \`max\` of value \`${s}\` supplied to \`Progress\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`));let c=R(n)?n:100;null===i||$(i,c)||console.error((r=`${i}`,`Invalid prop \`value\` of value \`${r}\` supplied to \`Progress\`. The \`value\` prop must be:
- a positive number
- less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`));let u=$(i,c)?i:null,h=M(u)?o(u,c):void 0;return(0,d.jsx)(S,{scope:a,value:u,max:c,children:(0,d.jsx)(w.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":M(u)?u:void 0,"aria-valuetext":h,role:"progressbar","data-state":_(u,c),"data-value":u??void 0,"data-max":c,...l,ref:t})})});C.displayName=j;var E="ProgressIndicator",A=u.forwardRef((e,t)=>{let{__scopeProgress:s,...r}=e,a=T(E,s);return(0,d.jsx)(w.div,{"data-state":_(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});function P(e,t){return`${Math.round(e/t*100)}%`}function _(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function M(e){return"number"==typeof e}function R(e){return M(e)&&!isNaN(e)&&e>0}function $(e,t){return M(e)&&!isNaN(e)&&e<=t&&e>=0}A.displayName=E;var O=e.i(75157);function D({className:e,value:t,...s}){return(0,d.jsx)(C,{"data-slot":"progress",className:(0,O.cn)("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...s,children:(0,d.jsx)(A,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function L({onPrestige:e}){let t=(0,f.useGameStore)(e=>e.crystals),s=(0,f.useGameStore)(e=>e.crystalsPerSec),r=(0,f.useGameStore)(e=>e.insights),a=(0,f.useGameStore)(e=>e.contact),i=(0,f.useGameStore)(e=>e.ascensions),n=(0,f.useGameStore)(e=>e.blueprints);return(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 sm:gap-x-4 px-3.5 py-2.5 rounded-2xl border border-white/10 bg-black/40 backdrop-blur-md",children:[(0,d.jsx)(B,{icon:(0,d.jsx)(p.Gem,{className:"h-4 w-4 text-emerald-400"}),label:"记忆晶体",value:(0,m.formatNum)(t),sub:`+${s.toFixed(1)}/s`,glow:"rgba(52,211,153,0.4)"}),(0,d.jsx)("div",{className:"h-9 w-px bg-gradient-to-b from-transparent via-white/15 to-transparent hidden sm:block"}),(0,d.jsx)(B,{icon:(0,d.jsx)(g,{className:"h-4 w-4 text-amber-400"}),label:"技术洞见",value:(0,m.formatNum)(r),sub:"解码产出",glow:"rgba(251,191,36,0.4)"}),(0,d.jsx)("div",{className:"h-9 w-px bg-gradient-to-b from-transparent via-white/15 to-transparent hidden sm:block"}),(0,d.jsxs)("div",{className:"flex-1 min-w-[200px] flex flex-col gap-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(b.Waves,{className:"h-4 w-4 text-fuchsia-400 shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"接触进度"}),(0,d.jsxs)("span",{className:"text-xs font-tech font-semibold text-fuchsia-300 ml-auto tabular-nums",children:[a.toFixed(1),"%"]}),a>=100&&(0,d.jsx)("button",{onClick:e,className:"text-[10px] px-2 py-0.5 rounded-full bg-fuchsia-500/20 border border-fuchsia-400/50 text-fuchsia-200 hover:bg-fuchsia-500/30 transition animate-pulse whitespace-nowrap ml-1",children:"飞升"})]}),(0,d.jsx)(D,{value:a,className:"h-1.5 bg-white/10 [&>div]:bg-gradient-to-r [&>div]:from-fuchsia-500 [&>div]:to-rose-400"})]}),(0,d.jsx)("div",{className:"h-9 w-px bg-gradient-to-b from-transparent via-white/15 to-transparent hidden sm:block"}),(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,d.jsx)(y.RotateCcw,{className:"h-4 w-4 text-rose-400 shrink-0"}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground leading-none",children:"飞升"}),(0,d.jsxs)("div",{className:"flex items-baseline gap-1.5",children:[(0,d.jsx)("span",{className:"text-sm font-tech font-semibold leading-none tabular-nums",children:i}),(0,d.jsxs)("span",{className:"text-amber-300 text-xs leading-none",children:["×",n.length]})]})]})]})]})}function B({icon:e,label:t,value:s,sub:r,glow:a}){return(0,d.jsxs)("div",{className:"flex items-center gap-2.5",style:{filter:`drop-shadow(0 0 6px ${a})`},children:[e,(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground leading-none",children:t}),(0,d.jsxs)("div",{className:"flex items-baseline gap-1.5",children:[(0,d.jsx)("span",{className:"text-sm font-tech font-semibold leading-none tabular-nums",children:s}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground/80 whitespace-nowrap",children:r})]})]})]})}var I=e.i(37902),F=e.i(74911),V=e.i(31334);let z=["晶核深处传来一阵微弱的震颤…","以太族的余响在谐振中回荡。","你听见了一句无法辨认的低语。","星海的寂静被你的脉冲短暂打破。","晶体表面的纹路闪烁,像是某种回应。","回响核心记录着每一次触碰。","虚空深处,有什么在倾听。","谐振频率与你的脉冲产生了共鸣。","这是以太族留下的第一道印记。","晶体内部的光,比星辰更古老。","你的脉冲唤醒了一段沉睡的频率。","维度薄膜因你的触碰而微微颤动。","采矿不是掠夺,是聆听。","每一颗晶体,都是一封跨越时间的信。","以太族信任你,所以留下了这些。"],G={mining:"以太族从不掠夺星海,他们与矿脉共振,让晶体自愿献出光芒。",decoding:"谐振法则是以太族的核心遗产——思维可被编码为共振序列。",expedition:"他们留下的遗迹不是废墟,是故意设置的试炼场。",narrative:"记忆校音,是以太族赋予后来者的第一项礼物。"};function U(e,t){if(Math.random()<t){if(0===e.length)return"";let t=Math.floor(Math.random()*e.length);return e[t]}return null}function H({value:e,format:t=e=>e.toFixed(0),speed:s=.18,threshold:r=.5,className:a,as:i="span"}){let n=(0,u.useRef)(null),o=(0,u.useRef)(e),l=(0,u.useRef)(e),c=(0,u.useRef)(null),d=(0,u.useRef)(t);return d.current=t,l.current=e,(0,u.useEffect)(()=>{let e=()=>{let t=o.current,a=l.current,i=a-t;if(Math.abs(i)<r)t!==a&&(o.current=a,n.current&&(n.current.textContent=d.current(a)));else{let e=t+i*s;o.current=e,n.current&&(n.current.textContent=d.current(e))}c.current=requestAnimationFrame(e)};return c.current=requestAnimationFrame(e),()=>{c.current&&cancelAnimationFrame(c.current)}},[s,r]),(0,u.createElement)(i,{ref:n,className:a,"data-animated-number":!0},t(e))}let W="#34d399",q="#e879f9",Y="#fb7185",K="#fbbf24";function X(e){return e>=5?K:e>=3?q:W}function Z(){let e=(0,f.useGameStore)(e=>e.pulse),t=(0,f.useGameStore)(e=>e._combo),{toast:s}=(0,F.useToast)(),[r,a]=(0,u.useState)([]),i=(0,u.useRef)(0),n=(0,u.useRef)(null),o=(0,u.useRef)(null);(0,u.useRef)(0);let[l,c]=(0,u.useState)(0),h=(0,u.useRef)([]),m=(0,u.useRef)([]),p=(0,u.useRef)([]),x=(0,u.useRef)([]),g=(0,u.useRef)(t),b=(0,u.useRef)(0),y=(0,u.useRef)(0),v=(0,u.useRef)(50);(0,u.useEffect)(()=>{g.current=t;let e=f.useGameStore.getState();y.current=e.crystals,v.current=e.crystalCap;let s=f.useGameStore.subscribe(e=>{e.crystals!==y.current&&(y.current=e.crystals),e.crystalCap!==v.current&&(v.current=e.crystalCap)});return()=>s()},[t]);let w=(0,u.useRef)({x:0,y:0,inside:!1}),j=(0,u.useCallback)((e,t)=>{let s=.28*Math.min(e,t),r=[];[{count:14,rMul:.95,speed:.6,color:W},{count:10,rMul:1.15,speed:-.4,color:q},{count:8,rMul:1.35,speed:.3,color:Y}].forEach(e=>{for(let t=0;t<e.count;t++)r.push({angle:2*Math.PI*t/e.count+.3*Math.random(),radius:s*e.rMul,baseRadius:s*e.rMul,speed:e.speed*(.8+.4*Math.random()),size:1.5+2*Math.random(),color:e.color,alpha:.5+.4*Math.random(),phase:Math.random()*Math.PI*2})}),h.current=r;let a=[];for(let s=0;s<40;s++)a.push({x:Math.random()*e,y:Math.random()*t,vx:(Math.random()-.5)*8,vy:(Math.random()-.5)*8,size:.5+1.5*Math.random(),alpha:.2+.5*Math.random(),twinkle:Math.random()*Math.PI*2});m.current=a},[]),N=(0,u.useCallback)((e,t,s)=>{let r=X(s.combo),a=performance.now();p.current.push({born:a,color:W,maxRadius:140,duration:700}),s.combo>=3&&p.current.push({born:a+100,color:q,maxRadius:170,duration:800}),s.combo>=5&&p.current.push({born:a+200,color:K,maxRadius:200,duration:900});let i=10+2*Math.min(10,s.combo);for(let s=0;s<i;s++){let n=2*Math.PI*s/i+.4*Math.random(),o=120+180*Math.random();x.current.push({x:e,y:t,vx:Math.cos(n)*o,vy:Math.sin(n)*o,size:2+3*Math.random(),color:r,born:a,life:600+300*Math.random()})}h.current.forEach(e=>{e.radius=e.baseRadius*(1.25+.15*Math.random())})},[]),k=(0,u.useCallback)(t=>{let r=e();if(!r)return;let n=t.currentTarget.getBoundingClientRect(),o=t.clientX-n.left,l=t.clientY-n.top,d=i.current++,u=X(r.combo);if(a(e=>[...e,{id:d,x:o,y:l,text:`+${r.gain.toFixed(1)}`,born:Date.now(),color:u}]),N(o,l,r),c(e=>e+1),(0,V.sfx)(r.combo>=3?"pulseCombo":"pulse",{combo:r.combo}),setTimeout(()=>{a(e=>e.filter(e=>e.id!==d))},900),r.combo>=5&&r.combo%5==0){let e=U(z,.6);s({title:`\xd7${r.combo} 连击!`,description:e?`「${e}」`:"谐振叠加,产能飙升。"})}else if(r.combo>=3&&r.combo%3==0){let e=U(z,.3);e&&s({title:"低语",description:`「${e}」`})}},[e,s,N]);(0,u.useEffect)(()=>{let e=n.current,t=o.current;if(!e||!t)return;let s=e.getContext("2d");if(!s)return;let r=0,a=performance.now(),i=Math.min(window.devicePixelRatio||1,2),l=()=>{let r=t.getBoundingClientRect();i=Math.min(window.devicePixelRatio||1,2),e.width=Math.max(1,Math.floor(r.width*i)),e.height=Math.max(1,Math.floor(r.height*i)),e.style.width=`${r.width}px`,e.style.height=`${r.height}px`,s.setTransform(i,0,0,i,0,0),j(r.width,r.height)};l();let c=new ResizeObserver(l);c.observe(t);let d=t=>{let n=Math.min(.05,(t-a)/1e3);a=t;let o=e.width/i,l=e.height/i,c=o/2,u=l/2,f=.28*Math.min(o,l);s.clearRect(0,0,o,l),m.current.forEach(e=>{e.x+=e.vx*n,e.y+=e.vy*n,e.twinkle+=2*n,e.x<0&&(e.x=o),e.x>o&&(e.x=0),e.y<0&&(e.y=l),e.y>l&&(e.y=0);let t=.5+.5*Math.sin(e.twinkle);s.globalAlpha=e.alpha*t,s.fillStyle="#ffffff",s.beginPath(),s.arc(e.x,e.y,e.size,0,2*Math.PI),s.fill()}),s.globalAlpha=1;let g=.85+.15*Math.sin(.001*t),j=s.createRadialGradient(c,u,.3*f,c,u,2.2*f);j.addColorStop(0,`rgba(52,211,153,${.18*g})`),j.addColorStop(.5,`rgba(232,121,249,${.1*g})`),j.addColorStop(1,"rgba(0,0,0,0)"),s.fillStyle=j,s.fillRect(0,0,o,l),s.lineWidth=2.5,s.strokeStyle="rgba(255,255,255,0.06)",s.beginPath(),s.arc(c,u,1.45*f,0,2*Math.PI),s.stroke();let N=Math.min(100,y.current/Math.max(1,v.current)*100);b.current=N;let k=1.45*f,S=s.createLinearGradient(c-k,u-k,c+k,u+k);S.addColorStop(0,W),S.addColorStop(.5,q),S.addColorStop(1,Y),s.strokeStyle=S,s.lineWidth=3,s.lineCap="round",s.shadowBlur=8,s.shadowColor=W,s.beginPath(),s.arc(c,u,k,-Math.PI/2,-Math.PI/2+2*Math.PI*N/100),s.stroke(),s.shadowBlur=0,h.current.forEach(e=>{e.angle+=e.speed*n,e.radius+=(e.baseRadius-e.radius)*Math.min(1,4*n);let r=c+Math.cos(e.angle)*e.radius,a=u+Math.sin(e.angle)*e.radius,i=.7+.3*Math.sin(.005*t+e.phase);s.globalAlpha=e.alpha*i,s.fillStyle=e.color,s.shadowBlur=10,s.shadowColor=e.color,s.beginPath(),s.arc(r,a,e.size,0,2*Math.PI),s.fill(),s.globalAlpha=e.alpha*i*.4,s.strokeStyle=e.color,s.lineWidth=.6*e.size,s.beginPath(),s.moveTo(r,a),s.lineTo(c+Math.cos(e.angle-.08*e.speed)*(e.radius-2),u+Math.sin(e.angle-.08*e.speed)*(e.radius-2)),s.stroke()}),s.globalAlpha=1,s.shadowBlur=0;let T=.95*f,C=0,E=0;if(w.current.inside){let e=w.current.x-c,t=w.current.y-u,s=Math.hypot(e,t);s>.1&&(C=e/s*Math.min(8,.05*s),E=t/s*Math.min(8,.05*s))}let A=c+C,P=u+E,_=s.createRadialGradient(A-.25*T,P-.3*T,.1*T,A,P,T);_.addColorStop(0,"rgba(255,255,255,0.95)"),_.addColorStop(.3,`rgba(52,211,153,${.85*g})`),_.addColorStop(.65,"rgba(232,121,249,0.55)"),_.addColorStop(1,"rgba(251,113,133,0.2)"),s.fillStyle=_,s.shadowBlur=30,s.shadowColor=W,s.beginPath(),s.arc(A,P,T,0,2*Math.PI),s.fill(),s.save(),s.translate(A,P),s.globalAlpha=.25,s.strokeStyle="rgba(255,255,255,0.6)",s.lineWidth=.8;let M=.7*T;for(let e=0;e<3;e++){let r=M*(1-.3*e);s.beginPath();for(let a=0;a<6;a++){let i=Math.PI/3*a+2e-4*t*(e%2?1:-1),n=Math.cos(i)*r,o=Math.sin(i)*r;0===a?s.moveTo(n,o):s.lineTo(n,o)}s.closePath(),s.stroke()}s.restore(),s.globalAlpha=.4,s.fillStyle="#ffffff",s.beginPath(),s.ellipse(A-.25*T,P-.35*T,.35*T,.18*T,-.4,0,2*Math.PI),s.fill(),s.globalAlpha=1,s.shadowBlur=0,p.current=p.current.filter(e=>{let r=t-e.born;if(r<0||r>e.duration)return r<=e.duration+50;let a=r/e.duration,i=e.maxRadius*a;return s.globalAlpha=(1-a)*.8,s.strokeStyle=e.color,s.lineWidth=2.5*(1-.5*a),s.shadowBlur=12,s.shadowColor=e.color,s.beginPath(),s.arc(c,u,i,0,2*Math.PI),s.stroke(),s.shadowBlur=0,!0}),p.current=p.current.filter(e=>t-e.born<e.duration),s.globalAlpha=1,x.current=x.current.filter(e=>{let r=t-e.born;if(r>e.life)return!1;e.x+=e.vx*n,e.y+=e.vy*n,e.vx*=.96,e.vy*=.96;let a=r/e.life;return s.globalAlpha=1-a,s.fillStyle=e.color,s.shadowBlur=8,s.shadowColor=e.color,s.beginPath(),s.arc(e.x,e.y,e.size*(1-.5*a),0,2*Math.PI),s.fill(),!0}),s.globalAlpha=1,s.shadowBlur=0,r=requestAnimationFrame(d)};return r=requestAnimationFrame(d),()=>{cancelAnimationFrame(r),c.disconnect()}},[j]);let S=(0,u.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();w.current={x:e.clientX-t.left,y:e.clientY-t.top,inside:!0}},[]),T=(0,u.useCallback)(()=>{w.current.inside=!1},[]);return(0,d.jsxs)("div",{className:"jsx-dda3ce20a1930cc3 relative flex flex-col items-center justify-center gap-4 select-none",children:[t>1&&(0,d.jsxs)("div",{className:"jsx-dda3ce20a1930cc3 absolute -top-2 left-1/2 -translate-x-1/2 px-3 py-1 rounded-full bg-rose-500/20 border border-rose-400/40 text-rose-200 text-xs font-mono animate-pulse z-10",children:["×",t," 连击"]}),(0,d.jsxs)("button",{onClick:k,onMouseMove:S,onMouseLeave:T,"aria-label":"脉冲扫描,获取记忆晶体",className:"jsx-dda3ce20a1930cc3 relative h-52 w-52 sm:h-64 sm:w-64 rounded-full focus:outline-none group",children:[(0,d.jsx)("div",{ref:o,className:"jsx-dda3ce20a1930cc3 absolute inset-0 rounded-full overflow-hidden",children:(0,d.jsx)("canvas",{ref:n,className:"jsx-dda3ce20a1930cc3 block w-full h-full"})}),(0,d.jsxs)("div",{style:{animation:"echo-spin 18s linear infinite"},className:"jsx-dda3ce20a1930cc3 absolute inset-2 rounded-full border border-emerald-400/30 pointer-events-none",children:[(0,d.jsx)("div",{className:"jsx-dda3ce20a1930cc3 absolute top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 h-2 w-2 rounded-full bg-emerald-300 shadow-[0_0_8px_#34d399]"}),(0,d.jsx)("div",{className:"jsx-dda3ce20a1930cc3 absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2 h-1.5 w-1.5 rounded-full bg-rose-300 shadow-[0_0_8px_#fb7185]"})]}),(0,d.jsx)("div",{style:{animation:"echo-spin 24s linear infinite reverse"},className:"jsx-dda3ce20a1930cc3 absolute inset-6 rounded-full border border-fuchsia-400/20 border-dashed pointer-events-none"}),(0,d.jsx)("div",{style:{animation:"echo-ring 0.7s ease-out forwards"},className:"jsx-dda3ce20a1930cc3 absolute inset-8 rounded-full border-2 border-emerald-400/60 pointer-events-none"},`ring-${l}`),r.map(e=>(0,d.jsx)("span",{style:{left:e.x,top:e.y,color:e.color,transform:"translate(-50%, -50%)",animation:"echo-float 0.9s ease-out forwards",textShadow:`0 0 8px ${e.color}`},className:"jsx-dda3ce20a1930cc3 absolute pointer-events-none font-mono font-bold text-sm z-10",children:e.text},e.id))]}),(0,d.jsx)(J,{combo:t}),(0,d.jsx)(I.default,{id:"dda3ce20a1930cc3",children:"@keyframes echo-spin{to{transform:rotate(360deg)}}@keyframes echo-float{0%{opacity:1;transform:translate(-50%,-50%)scale(1)}to{opacity:0;transform:translate(-50%,-180%)scale(1.3)}}@keyframes echo-ring{0%{opacity:.8;transform:scale(.8)}to{opacity:0;transform:scale(1.6)}}"})]})}function J({combo:e}){let t=(0,f.useGameStore)(e=>e.crystals),s=(0,f.useGameStore)(e=>e.crystalCap),r=(0,f.useGameStore)(e=>e.crystalsPerSec),a=Math.min(100,t/Math.max(1,s)*100);return(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("div",{className:"text-2xl font-mono font-bold text-emerald-300 tabular-nums",style:{textShadow:"0 0 12px rgba(52,211,153,0.5)"},children:(0,d.jsx)(H,{value:t,format:m.formatNum,speed:.22})}),(0,d.jsxs)("div",{className:"text-xs text-muted-foreground mt-0.5",children:["记忆晶体 · ",(0,d.jsx)(H,{value:r,format:e=>e.toFixed(1),speed:.3}),"/s · 上限"," ",(0,m.formatNum)(s)]}),(0,d.jsxs)("div",{className:"text-[11px] text-muted-foreground/70 mt-2",children:["点击晶体发起",(0,d.jsx)("span",{className:"text-emerald-300",children:"脉冲扫描"}),",连击叠加加成"]}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground/50 mt-1 tabular-nums",children:["仓库 ",(0,d.jsx)(H,{value:a,format:e=>e.toFixed(1),speed:.25}),"% · 连击 ×",Math.max(1,e)]})]})}var Q=e.i(69992),ee=e.i(19455),et=e.i(37727),es=e.i(83086);let er=(0,x.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),ea=(0,x.default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),ei=(0,x.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function en(){let e=(0,f.useGameStore)(e=>e.activePuzzle),t=(0,f.useGameStore)(e=>e.clickNode),s=(0,f.useGameStore)(e=>e.undoStep),r=(0,f.useGameStore)(e=>e.retryPuzzle),a=(0,f.useGameStore)(e=>e.abandonPuzzle),{toast:i}=(0,F.useToast)(),[n,o]=(0,u.useState)(null),[l,c]=(0,u.useState)(null),[h,p]=(0,u.useState)(!1);if(!e)return null;let{grid:x,rows:g,cols:b,target:v,path:w,stepLimit:j,tier:N}=e,k=w.length,S=v[k],T=w.length>0&&w.length<v.length&&!(0,Q.isSolvable)(e),C=()=>{s(),p(!1),c(null)},E=100/b,A=100/g,P=w.map(e=>x.find(t=>t.id===e)).filter(Boolean);return(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 flex flex-col gap-4 h-full",children:[(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 flex items-center justify-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-xs text-muted-foreground mr-1",children:"目标谐振"}),v.map((e,t)=>{let s=t<k,r=t===k,a=m.COLOR_VISUAL[e];return(0,d.jsxs)("div",{style:{background:`radial-gradient(circle at 35% 30%, ${a.hex}, ${a.hex}aa 60%, ${a.hex}44)`,boxShadow:r?`0 0 18px ${a.glow}, 0 0 36px ${a.glow}`:`0 0 8px ${a.glow}`,"--tw-ring-color":a.hex},className:`jsx-35ab0418fdc54847 relative h-9 w-9 rounded-full flex items-center justify-center transition-all duration-300 ${s?"opacity-30 scale-90":""} ${r?"scale-125 ring-2 ring-offset-2 ring-offset-background":""}`,children:[s&&(0,d.jsx)(er,{className:"h-4 w-4 text-white"}),r&&(0,d.jsx)("span",{style:{color:a.hex},className:"jsx-35ab0418fdc54847 absolute -bottom-5 text-[10px] font-medium",children:"下一个"})]},t)})]}),(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 relative flex-1 min-h-[260px] rounded-2xl border border-white/10 bg-black/30 backdrop-blur-sm overflow-hidden",children:[(0,d.jsx)("div",{style:{backgroundImage:"linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px)",backgroundSize:`${E}% ${A}%`},className:"jsx-35ab0418fdc54847 absolute inset-0 opacity-20"}),(0,d.jsx)("svg",{className:"jsx-35ab0418fdc54847 absolute inset-0 w-full h-full pointer-events-none",children:P.map((e,t)=>{if(0===t)return null;let s=P[t-1],r=(s.col+.5)*E,a=(s.row+.5)*A,i=(e.col+.5)*E,n=(e.row+.5)*A,o=m.COLOR_VISUAL[e.color];return(0,d.jsx)("line",{x1:`${r}%`,y1:`${a}%`,x2:`${i}%`,y2:`${n}%`,stroke:o.hex,strokeWidth:2.5,strokeLinecap:"round",style:{filter:`drop-shadow(0 0 4px ${o.glow})`},className:"jsx-35ab0418fdc54847 echo-path-line"},t)})}),x.map(s=>{let r=m.COLOR_VISUAL[s.color],a=s.used,u=void 0!==S&&s.color===S&&!a,f=0===w.length&&u&&(0,Q.canStartFrom)(e,s.id),x=0===w.length&&u&&!f,g=n===s.id,y=l?.id===s.id,v=(s.col+.5)*E,j=(s.row+.5)*A;return(0,d.jsx)("button",{onClick:()=>(e=>{let s=t(e.id);if(s.ok&&s.finished){p(!1),(0,V.sfx)("decodeSuccess"),s.failReason&&s.failReason.split(",").filter(Boolean).length&&((0,V.sfx)("fragmentUnlock"),i({title:"✦ 记忆碎片浮现",description:"新的回响被拼入图谱,前往「记忆图谱」查看。"})),i({title:"谐振闭合!",description:"晶体解码成功,记忆已释放。"});return}s.ok?((0,V.sfx)("decodeClick",{color:e.color}),c({id:e.id,ok:!0}),setTimeout(()=>c(null),280),!1!==s.solvable||h||(p(!0),i({title:"谐振受阻",description:"此路不通,建议撤销上一步或重排。"})),!0===s.solvable&&p(!1)):((0,V.sfx)("decodeFail"),c({id:e.id,ok:!1}),setTimeout(()=>c(null),280))})(s),onMouseEnter:()=>o(s.id),onMouseLeave:()=>o(null),disabled:a,style:{left:`${v}%`,top:`${j}%`,width:`min(${100/b*.62}%, 56px)`,aspectRatio:"1",background:a?"rgba(255,255,255,0.04)":`radial-gradient(circle at 35% 30%, ${r.hex}, ${r.hex}cc 55%, ${r.hex}55)`,boxShadow:a?"inset 0 0 12px rgba(0,0,0,0.5)":f?`0 0 16px ${r.glow}, 0 0 32px ${r.glow}, inset 0 0 10px rgba(255,255,255,0.5)`:u?`0 0 10px ${r.glow}, 0 0 20px ${r.glow}, inset 0 0 6px rgba(255,255,255,0.3)`:`0 0 6px ${r.glow}`,border:f?`2px solid ${r.hex}`:u?`1.5px solid ${r.hex}aa`:"1px solid rgba(255,255,255,0.12)",opacity:a?.35:x?.5:1,transform:`translate(-50%, -50%) scale(${g&&!a?1.12:y?l?.ok?1.25:.8:1})`,animation:f?"echo-pulse 1.2s ease-in-out infinite":u&&!x?"echo-pulse 1.6s ease-in-out infinite":void 0},"aria-label":`${r.label}色节点 ${s.row+1}-${s.col+1}`,className:"jsx-35ab0418fdc54847 absolute rounded-full transition-[box-shadow,background,border,opacity] duration-200 focus:outline-none disabled:cursor-not-allowed",children:!a&&(0,d.jsx)("span",{style:{background:"radial-gradient(circle at 35% 30%, rgba(255,255,255,0.5), transparent 45%)"},className:"jsx-35ab0418fdc54847 absolute inset-0 rounded-full"})},s.id)})]}),T&&(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 flex items-center gap-2 px-3 py-2 rounded-lg border border-rose-400/40 bg-rose-950/40 text-rose-200 text-xs animate-pulse",children:[(0,d.jsx)(ei,{className:"h-3.5 w-3.5 shrink-0"}),(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847",children:"谐振受阻,此路已无解。"}),(0,d.jsxs)(ee.Button,{size:"sm",variant:"outline",onClick:C,className:"h-6 px-2 ml-auto border-rose-400/50 text-rose-100 hover:bg-rose-500/20 text-[11px]",children:[(0,d.jsx)(ea,{className:"h-3 w-3 mr-1"}),"撤销"]})]}),(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 flex items-center gap-2 text-xs",children:[(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-muted-foreground",children:"步数"}),(0,d.jsxs)("span",{className:`jsx-35ab0418fdc54847 font-mono font-semibold ${w.length>=j?"text-rose-400":"text-foreground"}`,children:[w.length," / ",j]}),(0,d.jsxs)("span",{className:"jsx-35ab0418fdc54847 ml-2 text-muted-foreground",children:["T",N]})]}),(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 flex items-center gap-1.5",children:[(0,d.jsxs)(ee.Button,{variant:"ghost",size:"sm",onClick:C,disabled:0===w.length,className:"h-7",children:[(0,d.jsx)(ea,{className:"h-3.5 w-3.5 mr-1"}),"撤销"]}),(0,d.jsxs)(ee.Button,{variant:"ghost",size:"sm",onClick:()=>{r(),p(!1),c(null)},className:"h-7",children:[(0,d.jsx)(y.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),"重排"]}),(0,d.jsxs)(ee.Button,{variant:"ghost",size:"sm",onClick:()=>{a(),c(null),p(!1)},className:"h-7",children:[(0,d.jsx)(et.X,{className:"h-3.5 w-3.5 mr-1"}),"放回"]})]})]}),(0,d.jsx)("p",{className:"jsx-35ab0418fdc54847 text-[11px] text-muted-foreground/80 text-center leading-relaxed",children:0===w.length?(0,d.jsxs)(d.Fragment,{children:["点击",(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-emerald-300",children:"高亮"}),"的可行起点开始,按目标顺序走",(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-emerald-300",children:"相邻同色"}),"节点;走错可",(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-rose-300",children:"撤销"}),"。"]}):(0,d.jsxs)(d.Fragment,{children:["按「目标谐振」顺序,点击",(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-emerald-300",children:"上下左右相邻"}),"的同色节点。每个节点仅可使用一次;走错可",(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-rose-300",children:"撤销"}),"。"]})}),(0,d.jsx)(I.default,{id:"35ab0418fdc54847",children:"@keyframes echo-pulse{0%,to{filter:brightness()}50%{filter:brightness(1.4)}}@keyframes echo-line{0%{stroke-dashoffset:100px}to{stroke-dashoffset:0}}.echo-path-line{stroke-dasharray:100;animation:.4s ease-out forwards echo-line}"})]})}function eo(){let e=(0,f.useGameStore)(e=>e.activePuzzle),t=(0,f.useGameStore)(e=>e.pendingCrystals),s=(0,f.useGameStore)(e=>e.startDecode),r=(0,f.useGameStore)(e=>e.crystalsPerSec),a=(0,f.useGameStore)(e=>e.crystalCap),i=(0,f.useGameStore)(e=>e.crystals);return e?(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)(es.Sparkles,{className:"h-4 w-4 text-rose-400"}),(0,d.jsx)("h3",{className:"text-sm font-semibold",children:"解码共振阵列"})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0",children:(0,d.jsx)(en,{})})]}):(0,d.jsxs)("div",{className:"jsx-53059b9e32765d5f h-full flex flex-col",children:[(0,d.jsxs)("div",{className:"jsx-53059b9e32765d5f flex items-center gap-2 mb-3",children:[(0,d.jsx)(es.Sparkles,{className:"h-4 w-4 text-rose-400"}),(0,d.jsx)("h3",{className:"jsx-53059b9e32765d5f text-sm font-semibold",children:"待解码晶体"}),(0,d.jsxs)("span",{className:"jsx-53059b9e32765d5f text-xs text-muted-foreground ml-auto",children:["产能 ",r.toFixed(1),"/s · ",Math.floor(i),"/",Math.floor(a)]})]}),0===t.length?(0,d.jsxs)("div",{className:"jsx-53059b9e32765d5f flex-1 flex flex-col items-center justify-center text-center gap-3 rounded-2xl border border-dashed border-white/10 bg-black/20 p-6",children:[(0,d.jsxs)("div",{className:"jsx-53059b9e32765d5f relative h-16 w-16",children:[(0,d.jsx)("div",{className:"jsx-53059b9e32765d5f absolute inset-0 rounded-full bg-rose-500/20 blur-xl animate-pulse"}),(0,d.jsx)("div",{className:"jsx-53059b9e32765d5f absolute inset-2 rounded-full border-2 border-rose-400/40 rotate-45"}),(0,d.jsx)("div",{className:"jsx-53059b9e32765d5f absolute inset-4 rounded-full bg-rose-500/30"})]}),(0,d.jsx)("p",{className:"jsx-53059b9e32765d5f text-sm text-muted-foreground",children:"晶体正在生成中…"}),(0,d.jsx)("p",{className:"jsx-53059b9e32765d5f text-xs text-muted-foreground/70 max-w-[220px]",children:"自治无人机每数秒回收一颗记忆晶体,点击下方晶体开启解码。"})]}):(0,d.jsx)("div",{className:"jsx-53059b9e32765d5f flex-1 grid grid-cols-2 sm:grid-cols-3 gap-3 content-start max-h-[420px] overflow-y-auto echo-scroll pr-1",children:t.map(e=>(0,d.jsx)(el,{crystal:e,onClick:()=>s(e.id)},e.id))}),(0,d.jsx)(I.default,{id:"53059b9e32765d5f",children:".echo-scroll::-webkit-scrollbar{width:6px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:3px}.echo-scroll::-webkit-scrollbar-track{background:0 0}"})]})}function el({crystal:e,onClick:t}){let s=1===e.tier?"#34d399":2===e.tier?"#fbbf24":"#e879f9",r=1===e.tier?"常见":2===e.tier?"稀有":"史诗";return(0,d.jsxs)("button",{onClick:t,className:"group relative aspect-square rounded-2xl border border-white/10 bg-black/40 hover:border-white/40 transition-all duration-300 hover:scale-[1.04] focus:outline-none overflow-hidden",style:{boxShadow:`inset 0 0 24px ${s}22`},children:[(0,d.jsx)("div",{className:"absolute inset-0 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none",style:{background:`linear-gradient(120deg, transparent 30%, ${s}40 50%, transparent 70%)`,backgroundSize:"200% 100%",animation:"echo-border-flow 2s linear infinite",mixBlendMode:"screen"}}),(0,d.jsx)("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none overflow-hidden",children:(0,d.jsx)("div",{className:"absolute inset-x-0 h-px",style:{background:`linear-gradient(90deg, transparent, ${s}, transparent)`,animation:"echo-scan 1.8s ease-in-out infinite"}})}),(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,d.jsxs)("div",{className:"relative h-12 w-12 transition-transform duration-500 group-hover:rotate-[200deg] group-hover:scale-110",style:{filter:`drop-shadow(0 0 12px ${s}88)`},children:[(0,d.jsx)("div",{className:"absolute inset-0 rotate-45 rounded-md",style:{background:`linear-gradient(135deg, ${s}, ${s}66)`,border:`1px solid ${s}`}}),(0,d.jsx)("div",{className:"absolute inset-2 rotate-45 rounded-sm",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.5), transparent)"}})]})}),(0,d.jsxs)("div",{className:"absolute top-1.5 left-1.5 z-10 text-[10px] font-mono font-semibold px-1.5 py-0.5 rounded bg-black/60 backdrop-blur-sm border",style:{color:s,borderColor:`${s}40`},children:["T",e.tier]}),(0,d.jsx)("div",{className:"absolute top-1.5 right-1.5 z-10 text-[9px] text-white/60 font-mono tracking-wider",children:r}),(0,d.jsxs)("div",{className:"absolute inset-x-0 bottom-0 z-10 bg-gradient-to-t from-black/85 via-black/50 to-transparent pt-4 pb-1.5 px-1 text-center opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:[(0,d.jsxs)("div",{className:"text-[12px] font-mono font-bold leading-none",style:{color:s},children:["+",e.value]}),(0,d.jsx)("div",{className:"text-[8px] text-white/60 uppercase tracking-[0.15em] mt-0.5",children:"解码 →"})]})]})}function ec({className:e,...t}){return(0,d.jsx)("div",{"data-slot":"card",className:(0,O.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}let ed=(0,x.default)("pickaxe",[["path",{d:"M14.531 12.469 6.619 20.38a1 1 0 1 1-3-3l7.912-7.912",key:"we99rg"}],["path",{d:"M15.686 4.314A12.5 12.5 0 0 0 5.461 2.958 1 1 0 0 0 5.58 4.71a22 22 0 0 1 6.318 3.393",key:"1w6hck"}],["path",{d:"M17.7 3.7a1 1 0 0 0-1.4 0l-4.6 4.6a1 1 0 0 0 0 1.4l2.6 2.6a1 1 0 0 0 1.4 0l4.6-4.6a1 1 0 0 0 0-1.4z",key:"15hgfx"}],["path",{d:"M19.686 8.314a12.501 12.501 0 0 1 1.356 10.225 1 1 0 0 1-1.751-.119 22 22 0 0 0-3.393-6.319",key:"452b4h"}]]),eu=(0,x.default)("scan-line",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]]),eh=(0,x.default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);var ef=e.i(10980);let em=(0,x.default)("lock",[["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"}]]),ep={Pickaxe:ed,ScanLine:eu,Rocket:eh,BookOpen:ef.BookOpen},ex={mining:"#34d399",decoding:"#fb7185",expedition:"#fbbf24",narrative:"#e879f9"};function eg(){let e=(0,f.useGameStore)(e=>e.tech),t=(0,f.useGameStore)(e=>e.insights),s=(0,f.useGameStore)(e=>e.buyTech);return(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd flex flex-col gap-3 h-full",children:[(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd flex items-center justify-between",children:[(0,d.jsx)("h3",{className:"jsx-fbf3fdae687a84dd text-sm font-semibold",children:"技术树"}),(0,d.jsxs)("span",{className:"jsx-fbf3fdae687a84dd text-xs text-muted-foreground",children:["洞见 ",(0,d.jsx)("span",{className:"jsx-fbf3fdae687a84dd text-amber-300 font-mono",children:(0,m.formatNum)(t)})]})]}),(0,d.jsx)("div",{className:"jsx-fbf3fdae687a84dd flex-1 overflow-y-auto echo-scroll pr-1 space-y-3",children:["mining","decoding","expedition","narrative"].map(r=>{let a=m.TECH_BRANCH_META[r],i=ep[a.icon],n=ex[r],o=m.TECH_TREE.filter(e=>e.branch===r);return(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd",children:[(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd flex items-center gap-2 mb-1.5 px-1",children:[(0,d.jsx)(i,{className:"jsx-fbf3fdae687a84dd h-3.5 w-3.5"}),(0,d.jsx)("span",{style:{color:n},className:"jsx-fbf3fdae687a84dd text-xs font-medium",children:a.name}),(0,d.jsx)("span",{className:"jsx-fbf3fdae687a84dd text-[10px] text-muted-foreground/70 truncate flex-1",children:a.desc})]}),(0,d.jsxs)("p",{className:"jsx-fbf3fdae687a84dd text-[9px] italic text-muted-foreground/50 px-1 mb-1.5 truncate",children:["「",G[r]??"","」"]}),(0,d.jsx)("div",{className:"jsx-fbf3fdae687a84dd grid gap-1.5",children:o.map(r=>{let a=(e[r.id]??0)>=1,i=t>=r.cost;return(0,d.jsx)(ec,{className:`p-2.5 transition-all duration-200 ${a?"bg-white/5 border-white/10":i?"bg-black/30 border-white/15 hover:border-white/30 cursor-pointer":"bg-black/20 border-white/5 opacity-60"}`,style:a?{boxShadow:`inset 0 0 0 1px ${n}44, 0 0 12px ${n}22`}:void 0,children:(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd flex items-center gap-1.5",children:[(0,d.jsx)("span",{style:{color:a?n:void 0},className:"jsx-fbf3fdae687a84dd text-xs font-semibold truncate",children:r.name}),a&&(0,d.jsx)(er,{className:"h-3 w-3",style:{color:n}})]}),(0,d.jsx)("p",{className:"jsx-fbf3fdae687a84dd text-[10px] text-muted-foreground/80 truncate",children:r.desc})]}),!a&&(0,d.jsxs)(ee.Button,{size:"sm",variant:i?"default":"ghost",disabled:!i,onClick:()=>{s(r.id)&&(0,V.sfx)("techBuy")},className:"h-7 px-2 text-[11px] shrink-0",style:i?{background:`${n}22`,border:`1px solid ${n}66`,color:n}:void 0,children:[(0,d.jsx)(em,{className:"h-2.5 w-2.5 mr-1"}),r.cost]})]})},r.id)})})]},r)})}),(0,d.jsx)(I.default,{id:"fbf3fdae687a84dd",children:".echo-scroll::-webkit-scrollbar{width:5px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff1f;border-radius:3px}.echo-scroll::-webkit-scrollbar-track{background:0 0}"})]})}var eb=e.i(48425),ey=e.i(96626),ev=e.i(30030),ew=e.i(20783),ej=e.i(30207),eN=u.createContext(void 0);function ek(e){let t=u.useContext(eN);return e||t||"ltr"}var eS=e.i(34620),eT=e.i(81140),eC="ScrollArea",[eE,eA]=(0,ev.createContextScope)(eC),[eP,e_]=eE(eC),eM=u.forwardRef((e,t)=>{let{__scopeScrollArea:s,type:r="hover",dir:a,scrollHideDelay:i=600,...n}=e,[o,l]=u.useState(null),[c,h]=u.useState(null),[f,m]=u.useState(null),[p,x]=u.useState(null),[g,b]=u.useState(null),[y,v]=u.useState(0),[w,j]=u.useState(0),[N,k]=u.useState(!1),[S,T]=u.useState(!1),C=(0,ew.useComposedRefs)(t,e=>l(e)),E=ek(a);return(0,d.jsx)(eP,{scope:s,type:r,dir:E,scrollHideDelay:i,scrollArea:o,viewport:c,onViewportChange:h,content:f,onContentChange:m,scrollbarX:p,onScrollbarXChange:x,scrollbarXEnabled:N,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:S,onScrollbarYEnabledChange:T,onCornerWidthChange:v,onCornerHeightChange:j,children:(0,d.jsx)(eb.Primitive.div,{dir:E,...n,ref:C,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});eM.displayName=eC;var eR="ScrollAreaViewport",e$=u.forwardRef((e,t)=>{let{__scopeScrollArea:s,children:r,nonce:a,...i}=e,n=e_(eR,s),o=u.useRef(null),l=(0,ew.useComposedRefs)(t,o,n.onViewportChange);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),(0,d.jsx)(eb.Primitive.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:n.scrollbarXEnabled?"scroll":"hidden",overflowY:n.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,d.jsx)("div",{ref:n.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});e$.displayName=eR;var eO="ScrollAreaScrollbar",eD=u.forwardRef((e,t)=>{let{forceMount:s,...r}=e,a=e_(eO,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:n}=a,o="horizontal"===e.orientation;return u.useEffect(()=>(o?i(!0):n(!0),()=>{o?i(!1):n(!1)}),[o,i,n]),"hover"===a.type?(0,d.jsx)(eL,{...r,ref:t,forceMount:s}):"scroll"===a.type?(0,d.jsx)(eB,{...r,ref:t,forceMount:s}):"auto"===a.type?(0,d.jsx)(eI,{...r,ref:t,forceMount:s}):"always"===a.type?(0,d.jsx)(eF,{...r,ref:t}):null});eD.displayName=eO;var eL=u.forwardRef((e,t)=>{let{forceMount:s,...r}=e,a=e_(eO,e.__scopeScrollArea),[i,n]=u.useState(!1);return u.useEffect(()=>{let e=a.scrollArea,t=0;if(e){let s=()=>{window.clearTimeout(t),n(!0)},r=()=>{t=window.setTimeout(()=>n(!1),a.scrollHideDelay)};return e.addEventListener("pointerenter",s),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",s),e.removeEventListener("pointerleave",r)}}},[a.scrollArea,a.scrollHideDelay]),(0,d.jsx)(ey.Presence,{present:s||i,children:(0,d.jsx)(eI,{"data-state":i?"visible":"hidden",...r,ref:t})})}),eB=u.forwardRef((e,t)=>{var s;let{forceMount:r,...a}=e,i=e_(eO,e.__scopeScrollArea),n="horizontal"===e.orientation,o=e3(()=>c("SCROLL_END"),100),[l,c]=(s={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},u.useReducer((e,t)=>s[e][t]??e,"hidden"));return u.useEffect(()=>{if("idle"===l){let e=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,i.scrollHideDelay,c]),u.useEffect(()=>{let e=i.viewport,t=n?"scrollLeft":"scrollTop";if(e){let s=e[t],r=()=>{let r=e[t];s!==r&&(c("SCROLL"),o()),s=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[i.viewport,n,c,o]),(0,d.jsx)(ey.Presence,{present:r||"hidden"!==l,children:(0,d.jsx)(eF,{"data-state":"hidden"===l?"hidden":"visible",...a,ref:t,onPointerEnter:(0,eT.composeEventHandlers)(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:(0,eT.composeEventHandlers)(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),eI=u.forwardRef((e,t)=>{let s=e_(eO,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,n]=u.useState(!1),o="horizontal"===e.orientation,l=e3(()=>{if(s.viewport){let e=s.viewport.offsetWidth<s.viewport.scrollWidth,t=s.viewport.offsetHeight<s.viewport.scrollHeight;n(o?e:t)}},10);return e4(s.viewport,l),e4(s.content,l),(0,d.jsx)(ey.Presence,{present:r||i,children:(0,d.jsx)(eF,{"data-state":i?"visible":"hidden",...a,ref:t})})}),eF=u.forwardRef((e,t)=>{let{orientation:s="vertical",...r}=e,a=e_(eO,e.__scopeScrollArea),i=u.useRef(null),n=u.useRef(0),[o,l]=u.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=eQ(o.viewport,o.content),h={...r,sizes:o,onSizesChange:l,hasThumb:!!(c>0&&c<1),onThumbChange:e=>i.current=e,onThumbPointerUp:()=>n.current=0,onThumbPointerDown:e=>n.current=e};function f(e,t){return function(e,t,s,r="ltr"){let a=e0(s),i=t||a/2,n=s.scrollbar.paddingStart+i,o=s.scrollbar.size-s.scrollbar.paddingEnd-(a-i),l=s.content-s.viewport;return e2([n,o],"ltr"===r?[0,l]:[-1*l,0])(e)}(e,n.current,o,t)}return"horizontal"===s?(0,d.jsx)(eV,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){let e=e1(a.viewport.scrollLeft,o,a.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=f(e,a.dir))}}):"vertical"===s?(0,d.jsx)(ez,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){let e=e1(a.viewport.scrollTop,o);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=f(e))}}):null}),eV=u.forwardRef((e,t)=>{let{sizes:s,onSizesChange:r,...a}=e,i=e_(eO,e.__scopeScrollArea),[n,o]=u.useState(),l=u.useRef(null),c=(0,ew.useComposedRefs)(t,l,i.onScrollbarXChange);return u.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),(0,d.jsx)(eH,{"data-orientation":"horizontal",...a,ref:c,sizes:s,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":e0(s)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,s)=>{if(i.viewport){var r,a;let n=i.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),r=n,a=s,r>0&&r<a&&t.preventDefault()}},onResize:()=>{l.current&&i.viewport&&n&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:eJ(n.paddingLeft),paddingEnd:eJ(n.paddingRight)}})}})}),ez=u.forwardRef((e,t)=>{let{sizes:s,onSizesChange:r,...a}=e,i=e_(eO,e.__scopeScrollArea),[n,o]=u.useState(),l=u.useRef(null),c=(0,ew.useComposedRefs)(t,l,i.onScrollbarYChange);return u.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),(0,d.jsx)(eH,{"data-orientation":"vertical",...a,ref:c,sizes:s,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":e0(s)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,s)=>{if(i.viewport){var r,a;let n=i.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),r=n,a=s,r>0&&r<a&&t.preventDefault()}},onResize:()=>{l.current&&i.viewport&&n&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:eJ(n.paddingTop),paddingEnd:eJ(n.paddingBottom)}})}})}),[eG,eU]=eE(eO),eH=u.forwardRef((e,t)=>{let{__scopeScrollArea:s,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:n,onThumbPointerDown:o,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:h,onResize:f,...m}=e,p=e_(eO,s),[x,g]=u.useState(null),b=(0,ew.useComposedRefs)(t,e=>g(e)),y=u.useRef(null),v=u.useRef(""),w=p.viewport,j=r.content-r.viewport,N=(0,ej.useCallbackRef)(h),k=(0,ej.useCallbackRef)(l),S=e3(f,10);function T(e){y.current&&c({x:e.clientX-y.current.left,y:e.clientY-y.current.top})}return u.useEffect(()=>{let e=e=>{let t=e.target;x?.contains(t)&&N(e,j)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[w,x,j,N]),u.useEffect(k,[r,k]),e4(x,S),e4(p.content,S),(0,d.jsx)(eG,{scope:s,scrollbar:x,hasThumb:a,onThumbChange:(0,ej.useCallbackRef)(i),onThumbPointerUp:(0,ej.useCallbackRef)(n),onThumbPositionChange:k,onThumbPointerDown:(0,ej.useCallbackRef)(o),children:(0,d.jsx)(eb.Primitive.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:(0,eT.composeEventHandlers)(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),y.current=x.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),T(e))}),onPointerMove:(0,eT.composeEventHandlers)(e.onPointerMove,T),onPointerUp:(0,eT.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=""),y.current=null})})})}),eW="ScrollAreaThumb",eq=u.forwardRef((e,t)=>{let{forceMount:s,...r}=e,a=eU(eW,e.__scopeScrollArea);return(0,d.jsx)(ey.Presence,{present:s||a.hasThumb,children:(0,d.jsx)(eY,{ref:t,...r})})}),eY=u.forwardRef((e,t)=>{let{__scopeScrollArea:s,style:r,...a}=e,i=e_(eW,s),n=eU(eW,s),{onThumbPositionChange:o}=n,l=(0,ew.useComposedRefs)(t,e=>n.onThumbChange(e)),c=u.useRef(void 0),h=e3(()=>{c.current&&(c.current(),c.current=void 0)},100);return u.useEffect(()=>{let e=i.viewport;if(e){let t=()=>{h(),c.current||(c.current=e5(e,o),o())};return o(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[i.viewport,h,o]),(0,d.jsx)(eb.Primitive.div,{"data-state":n.hasThumb?"visible":"hidden",...a,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:(0,eT.composeEventHandlers)(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),s=e.clientX-t.left,r=e.clientY-t.top;n.onThumbPointerDown({x:s,y:r})}),onPointerUp:(0,eT.composeEventHandlers)(e.onPointerUp,n.onThumbPointerUp)})});eq.displayName=eW;var eK="ScrollAreaCorner",eX=u.forwardRef((e,t)=>{let s=e_(eK,e.__scopeScrollArea),r=!!(s.scrollbarX&&s.scrollbarY);return"scroll"!==s.type&&r?(0,d.jsx)(eZ,{...e,ref:t}):null});eX.displayName=eK;var eZ=u.forwardRef((e,t)=>{let{__scopeScrollArea:s,...r}=e,a=e_(eK,s),[i,n]=u.useState(0),[o,l]=u.useState(0),c=!!(i&&o);return e4(a.scrollbarX,()=>{let e=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(e),l(e)}),e4(a.scrollbarY,()=>{let e=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(e),n(e)}),c?(0,d.jsx)(eb.Primitive.div,{...r,ref:t,style:{width:i,height:o,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0,...e.style}}):null});function eJ(e){return e?parseInt(e,10):0}function eQ(e,t){let s=e/t;return isNaN(s)?0:s}function e0(e){let t=eQ(e.viewport,e.content),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-s)*t,18)}function e1(e,t,s="ltr"){let r=e0(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,n=t.content-t.viewport,o=function(e,[t,s]){return Math.min(s,Math.max(t,e))}(e,"ltr"===s?[0,n]:[-1*n,0]);return e2([0,n],[0,i-r])(o)}function e2(e,t){return s=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(s-e[0])}}var e5=(e,t=()=>{})=>{let s={left:e.scrollLeft,top:e.scrollTop},r=0;return!function a(){let i={left:e.scrollLeft,top:e.scrollTop},n=s.left!==i.left,o=s.top!==i.top;(n||o)&&t(),s=i,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function e3(e,t){let s=(0,ej.useCallbackRef)(e),r=u.useRef(0);return u.useEffect(()=>()=>window.clearTimeout(r.current),[]),u.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(s,t)},[s,t])}function e4(e,t){let s=(0,ej.useCallbackRef)(t);(0,eS.useLayoutEffect)(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,s])}function e7({className:e,children:t,...s}){return(0,d.jsxs)(eM,{"data-slot":"scroll-area",className:(0,O.cn)("relative",e),...s,children:[(0,d.jsx)(e$,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,d.jsx)(e9,{}),(0,d.jsx)(eX,{})]})}function e9({className:e,orientation:t="vertical",...s}){return(0,d.jsx)(eD,{"data-slot":"scroll-area-scrollbar",orientation:t,className:(0,O.cn)("flex touch-none p-px transition-colors select-none","vertical"===t&&"h-full w-2.5 border-l border-l-transparent","horizontal"===t&&"h-2.5 flex-col border-t border-t-transparent",e),...s,children:(0,d.jsx)(eq,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}let e8=["","寂灭前夜","谐振纪","飞升潮","回响纪","接触纪"];function e6(){let e=(0,f.useGameStore)(e=>e.fragments),t=(0,f.useGameStore)(e=>e.totalDecoded),s=(0,f.nextFragmentThreshold)(t),[r,a]=(0,u.useState)(null),i=m.FRAGMENTS.filter(e=>1===e.era),n=i.filter(t=>e[t.id]).length;return(0,d.jsxs)("div",{className:"flex flex-col gap-2 h-full",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-1.5",children:[(0,d.jsx)(ef.BookOpen,{className:"h-4 w-4 text-fuchsia-400"}),"记忆图谱"]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n,"/",i.length," · 第一纪元"]})]}),s&&(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground/80 px-1",children:["再解码 ",(0,d.jsx)("span",{className:"text-fuchsia-300 font-mono",children:s-t})," 颗 → 下一个碎片"]}),(0,d.jsx)(e7,{className:"flex-1 min-h-0",children:(0,d.jsx)("div",{className:"grid grid-cols-2 gap-2 pr-2",children:i.map((t,s)=>{let r=!!e[t.id];return(0,d.jsxs)("button",{onClick:()=>r&&a(t),disabled:!r,className:`relative aspect-[4/3] rounded-xl border text-left p-2 transition-all duration-300 overflow-hidden ${r?"border-fuchsia-400/40 bg-gradient-to-br from-fuchsia-950/40 to-black/40 hover:border-fuchsia-400/70 hover:scale-[1.02] cursor-pointer":"border-white/5 bg-black/30 cursor-not-allowed"}`,style:r?{boxShadow:"0 0 16px rgba(232,121,249,0.15)"}:void 0,children:[(0,d.jsx)("span",{className:`absolute top-1.5 right-1.5 text-[9px] font-mono ${r?"text-fuchsia-300/70":"text-white/20"}`,children:String(s+1).padStart(2,"0")}),r?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"absolute -top-3 -right-3 h-12 w-12 rounded-full bg-fuchsia-500/20 blur-xl"}),(0,d.jsx)(es.Sparkles,{className:"h-3 w-3 text-fuchsia-300 mb-1"}),(0,d.jsx)("div",{className:"text-[11px] font-semibold text-fuchsia-100 leading-tight",children:t.title}),(0,d.jsxs)("div",{className:"text-[9px] text-muted-foreground mt-1 line-clamp-2",children:[t.echo.slice(0,28),"…"]})]}):(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-1",children:[(0,d.jsx)(em,{className:"h-4 w-4 text-white/20"}),(0,d.jsxs)("span",{className:"text-[9px] text-white/30",children:["需解码 ",t.threshold," 颗"]})]})]},t.id)})})}),r&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm",onClick:()=>a(null),children:(0,d.jsxs)(ec,{className:"max-w-md w-full p-5 bg-gradient-to-br from-fuchsia-950/60 to-black/80 border-fuchsia-400/40",onClick:e=>e.stopPropagation(),style:{boxShadow:"0 0 40px rgba(232,121,249,0.25)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)(es.Sparkles,{className:"h-4 w-4 text-fuchsia-300"}),(0,d.jsxs)("span",{className:"text-[10px] text-fuchsia-300/70 font-mono",children:["第 ",r.era," 纪元 · ",e8[r.era]||""]})]}),(0,d.jsx)("h4",{className:"text-lg font-bold text-fuchsia-100 mb-3",children:r.title}),(0,d.jsxs)("p",{className:"text-sm text-foreground/90 leading-relaxed italic",children:["「",r.echo,"」"]}),(0,d.jsx)("button",{onClick:()=>a(null),className:"mt-4 text-xs text-muted-foreground hover:text-foreground transition",children:"关闭"})]})})]})}var te=e.i(76639),tt=e.i(70273),ts=e.i(60645),tr=e.i(43625);function ta({open:e,onOpenChange:t}){let s=(0,f.useGameStore)(),r=(0,f.useGameStore)(e=>e.doPrestige),{toast:a}=(0,F.useToast)(),[i,n]=(0,u.useState)(!1),[o,l]=(0,u.useState)(!1),c=(0,ts.computeNewBlueprints)(s);(0,ts.computePrestigeBonus)(s);let h=Math.min(m.PRESTIGE.maxBlueprints,s.blueprints.length+c),p=(0,tr.constellationProgress)(s.constellation??[]);return(0,d.jsx)(te.Dialog,{open:e,onOpenChange:t,children:(0,d.jsxs)(te.DialogContent,{className:"bg-gradient-to-br from-fuchsia-950/70 to-black/90 border-fuchsia-400/40",children:[(0,d.jsxs)(te.DialogHeader,{children:[(0,d.jsxs)(te.DialogTitle,{className:"flex items-center gap-2 text-fuchsia-100",children:[(0,d.jsx)(y.RotateCcw,{className:"h-5 w-5"}),"飞升 · 跨越维度"]}),(0,d.jsx)(te.DialogDescription,{className:"text-fuchsia-200/70",children:"当接触进度满溢,你将跨越维度与以太族相会。本次飞升将重置资源与技术,但保留记忆图谱与蓝图加成。"})]}),(0,d.jsxs)("div",{className:"space-y-3 py-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-fuchsia-400/30 bg-fuchsia-950/30 p-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-sm text-fuchsia-200",children:"本次获得蓝图"}),(0,d.jsxs)("span",{className:"text-2xl font-mono font-bold text-fuchsia-100",children:["+",c]})]}),(0,d.jsxs)("p",{className:"text-[11px] text-muted-foreground mt-1",children:["蓝图总数将达 ",h,"/",m.PRESTIGE.maxBlueprints,"(每 ",m.PRESTIGE.blueprintsPerDecode," 次解码产出 1 张)"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,d.jsx)(ti,{label:"产能",value:`+${(h*m.PRESTIGE.perBlueprint.crystalsPerSecMult*100).toFixed(0)}%`,color:"#34d399"}),(0,d.jsx)(ti,{label:"洞见",value:`+${(h*m.PRESTIGE.perBlueprint.insightMult*100).toFixed(0)}%`,color:"#fbbf24"}),(0,d.jsx)(ti,{label:"接触",value:`+${(h*m.PRESTIGE.perBlueprint.contactRateMult*100).toFixed(0)}%`,color:"#e879f9"})]}),(0,d.jsxs)("div",{className:"text-[11px] text-muted-foreground space-y-1 pt-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(es.Sparkles,{className:"h-3 w-3 text-fuchsia-400"}),"保留:记忆图谱、累计解码数、飞升次数、蓝图、星图天赋"]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(y.RotateCcw,{className:"h-3 w-3 text-rose-400"}),"重置:晶体、洞见、技术树、接触进度、待解码晶体"]})]}),(0,d.jsx)("div",{className:"rounded-lg border border-fuchsia-400/30 bg-gradient-to-r from-fuchsia-950/40 to-purple-950/40 p-2.5",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(tt.Star,{className:"h-4 w-4 text-fuchsia-300"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("div",{className:"text-[12px] text-fuchsia-200 font-bold",children:"星图觉醒预告"}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground",children:["飞升后将从 3 道随机天赋中选 1,永久获得加成",p.unlocked<p.total&&(0,d.jsxs)("span",{className:"text-fuchsia-300/80",children:[" · 当前 ",p.unlocked,"/",p.total]})]})]}),(0,d.jsx)("div",{className:"text-[10px] text-fuchsia-300/70 font-mono",children:p.unlocked<p.total?"✦ 可觉醒":"✧ 已圆满"})]})}),(0,d.jsxs)("div",{className:"rounded-lg border border-violet-400/25 bg-violet-950/20 p-2.5 flex items-center gap-2",children:[(0,d.jsx)(ef.BookOpen,{className:"h-4 w-4 text-violet-300 flex-shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 text-[10px] text-violet-100/70 leading-relaxed",children:["本次飞升将铭刻入",(0,d.jsx)("span",{className:"text-violet-200 font-bold",children:"回响编年史"}),", 记录本周目的解码、探险、星潮与觉醒天赋,形成永恒叙事时间轴。"]})]})]}),(0,d.jsxs)(te.DialogFooter,{children:[(0,d.jsx)(ee.Button,{variant:"ghost",onClick:()=>t(!1),children:"取消"}),(0,d.jsx)(ee.Button,{disabled:i&&!o,onClick:()=>{if(!i){n(!0),l(!1),window.setTimeout(()=>l(!0),900);return}let e=r();t(!1),n(!1),l(!1),e&&((0,V.sfx)("prestige"),window.setTimeout(()=>(0,V.sfx)("chronicle"),600),a({title:"✦ 飞升成功",description:`获得 ${e.newBp} 张蓝图,进入第 ${s.ascensions+2} 周目。编年史已铭刻新纪元。`}))},className:"bg-gradient-to-r from-fuchsia-600 to-rose-500 hover:from-fuchsia-500 hover:to-rose-400 text-white border-0",children:i?o?"再次确认飞升":"请确认…":c<=0?"飞升(无新蓝图)":"飞升"})]})]})})}function ti({label:e,value:t,color:s}){return(0,d.jsxs)("div",{className:"rounded-lg border p-2 text-center",style:{borderColor:`${s}44`,background:`${s}11`},children:[(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground",children:e}),(0,d.jsx)("div",{className:"text-sm font-mono font-bold",style:{color:s},children:t})]})}var tn=e.i(69340),to="Switch",[tl,tc]=(0,ev.createContextScope)(to),[td,tu]=tl(to),th=u.forwardRef((e,t)=>{let{__scopeSwitch:s,name:r,checked:a,defaultChecked:i,required:n,disabled:o,value:l="on",onCheckedChange:c,form:h,...f}=e,[m,p]=u.useState(null),x=(0,ew.useComposedRefs)(t,e=>p(e)),g=u.useRef(!1),b=!m||h||!!m.closest("form"),[y,v]=(0,tn.useControllableState)({prop:a,defaultProp:i??!1,onChange:c,caller:to});return(0,d.jsxs)(td,{scope:s,checked:y,disabled:o,children:[(0,d.jsx)(eb.Primitive.button,{type:"button",role:"switch","aria-checked":y,"aria-required":n,"data-state":tx(y),"data-disabled":o?"":void 0,disabled:o,value:l,...f,ref:x,onClick:(0,eT.composeEventHandlers)(e.onClick,e=>{v(e=>!e),b&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),b&&(0,d.jsx)(tp,{control:m,bubbles:!g.current,name:r,value:l,checked:y,required:n,disabled:o,form:h,style:{transform:"translateX(-100%)"}})]})});th.displayName=to;var tf="SwitchThumb",tm=u.forwardRef((e,t)=>{let{__scopeSwitch:s,...r}=e,a=tu(tf,s);return(0,d.jsx)(eb.Primitive.span,{"data-state":tx(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});tm.displayName=tf;var tp=u.forwardRef(({__scopeSwitch:e,control:t,checked:s,bubbles:r=!0,...a},i)=>{let n,o=u.useRef(null),l=(0,ew.useComposedRefs)(o,i),c=(n=u.useRef({value:s,previous:s}),u.useMemo(()=>(n.current.value!==s&&(n.current.previous=n.current.value,n.current.value=s),n.current.previous),[s])),h=function(e){let[t,s]=u.useState(void 0);return(0,eS.useLayoutEffect)(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,a;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;s({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}s(void 0)},[e]),t}(t);return u.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(c!==s&&t){let a=new Event("click",{bubbles:r});t.call(e,s),e.dispatchEvent(a)}},[c,s,r]),(0,d.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...a,tabIndex:-1,ref:l,style:{...a.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function tx(e){return e?"checked":"unchecked"}function tg({className:e,...t}){return(0,d.jsx)(th,{"data-slot":"switch",className:(0,O.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,d.jsx)(tm,{"data-slot":"switch-thumb",className:(0,O.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}tp.displayName="SwitchBubbleInput";var tb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let s=(0,v.createSlot)(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:a,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,d.jsx)(a?s:t,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ty=u.forwardRef((e,t)=>(0,d.jsx)(tb.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));function tv({className:e,...t}){return(0,d.jsx)(ty,{"data-slot":"label",className:(0,O.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}ty.displayName="Label";let tw=(0,x.default)("trash-2",[["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"}]]),tj=(0,x.default)("github",[["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"}]]),tN=(0,x.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),tk=(0,x.default)("graduation-cap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]),tS=(0,x.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),tT=[{id:"welcome",placement:"bottom",title:"✦ 欢迎来到回响星核",body:"你是一台苏醒在深空遗迹中的自治无人机。在这里,你需要采矿、解码以太文明遗留的记忆晶体,逐步拼凑出一段跨越维度的叙事。\n\n本引导将带你认识 5 个核心玩法,约 1 分钟。可随时跳过。"},{id:"crystal",target:"crystal-orb",placement:"right",title:"① 脉冲扫描 · 采矿",body:"点击中央的「记忆晶体」发起脉冲扫描,获得记忆晶体。\n\n连续点击可触发连击,连击越高单次产出越多。无人机也会每秒自动采集(+0.4/s 起)。",expectAction:"pulse"},{id:"decode",target:"decode-panel",placement:"left",title:"② 谐振序列 · 解码",body:"记忆晶体存满后,点击右侧「待解码晶体」开启谐振谜题:按目标色序依次点击相邻同色节点重建回路。\n\n解码成功 → 获得技术洞见 + 记忆碎片(叙事片段)。这是游戏的核心解谜层。",expectAction:"decode-start"},{id:"tech",target:"tab-tech",placement:"top",title:"③ 技术树 · 成长",body:"用「技术洞见」在「技术」标签升级 4 大分支:产能 / 解码 / 仓库 / 探险。\n\n每个分支 3 级,策略性地分配洞见是关键。",expectAction:"tech-buy"},{id:"expedition",target:"tab-expedition",placement:"top",title:"④ 遗迹探险 · 肉鸽",body:"累积足够实力后,「探险」标签可深入遗迹:6 种节点(战斗/宝藏/抉择/解谜/休整/BOSS)程序化路径,有生命系统,失败保留奖励。\n\n这是放置之外的主动玩法层。",expectAction:"expedition-start"},{id:"prestige",target:"prestige-btn",placement:"bottom",title:"⑤ 飞升 · 多周目",body:"「接触进度」满 100% 后可飞升:重置进度,获得永久蓝图加成 + 星图天赋(3 选 1 draft)+ 编年史记录。\n\n多周目叠加,越飞越强。还有每日信标挑战、6 种星潮事件等你探索。"},{id:"done",placement:"bottom",title:"✦ 回响已唤醒",body:"教程结束!后续可在「设置 → 重新查看教程」再次查看。\n\n深空之中,回响永续。祝你考古愉快。"}],tC="echo-nexus-tutorial-v1";function tE({open:e,onOpenChange:t}){let s=(0,f.useGameStore)(e=>e.soundOn),r=(0,f.useGameStore)(e=>e.toggleSound),a=(0,f.useGameStore)(e=>e.hardReset),i=(0,f.useGameStore)(e=>e.ascensions),n=(0,f.useGameStore)(e=>e.totalDecoded),{toast:o}=(0,F.useToast)(),[l,c]=(0,u.useState)(!1);return(0,d.jsx)(te.Dialog,{open:e,onOpenChange:t,children:(0,d.jsxs)(te.DialogContent,{className:"bg-gradient-to-br from-slate-900/80 to-black/90 border-white/15",children:[(0,d.jsxs)(te.DialogHeader,{children:[(0,d.jsx)(te.DialogTitle,{children:"设置"}),(0,d.jsx)(te.DialogDescription,{children:"游戏偏好与存档管理"})]}),(0,d.jsxs)("div",{className:"space-y-4 py-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-white/10 bg-black/30 p-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)(tv,{className:"text-sm",children:"音效反馈"}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"脉冲、解码、探险、飞升等程序化音效"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(ee.Button,{size:"sm",variant:"ghost",className:"h-7 px-2 text-muted-foreground hover:text-foreground",onClick:()=>(0,V.sfx)("decodeSuccess"),"aria-label":"试听音效",children:(0,d.jsx)(tN,{className:"h-3.5 w-3.5"})}),(0,d.jsx)(tg,{checked:s,onCheckedChange:r})]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-white/10 bg-black/30 p-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)(tv,{className:"text-sm",children:"新手教程"}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"重新查看 5 步玩法引导"})]}),(0,d.jsxs)(ee.Button,{size:"sm",variant:"outline",className:"h-7 px-2 text-[11px] border-fuchsia-400/40 text-fuchsia-200 hover:bg-fuchsia-500/10",onClick:()=>{try{localStorage.removeItem(tC)}catch{}window.dispatchEvent(new CustomEvent("echo-nexus-tutorial-restart")),t(!1)},children:[(0,d.jsx)(tk,{className:"h-3.5 w-3.5 mr-1"}),"重看教程"]})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-white/10 bg-black/30 p-3 text-xs space-y-1.5",children:[(0,d.jsxs)("div",{className:"flex justify-between",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"累计解码"}),(0,d.jsxs)("span",{className:"font-mono",children:[n," 颗"]})]}),(0,d.jsxs)("div",{className:"flex justify-between",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"飞升周目"}),(0,d.jsx)("span",{className:"font-mono",children:i})]}),(0,d.jsxs)("div",{className:"flex justify-between",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"存档位置"}),(0,d.jsx)("span",{className:"font-mono text-[10px]",children:"浏览器本地"})]})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-rose-500/30 bg-rose-950/20 p-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,d.jsx)(ei,{className:"h-4 w-4 text-rose-400"}),(0,d.jsx)("span",{className:"text-sm font-medium text-rose-200",children:"危险操作"})]}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground mb-2",children:"清空所有进度,包括记忆图谱与飞升记录,不可恢复。"}),(0,d.jsxs)(ee.Button,{variant:"outline",size:"sm",className:"border-rose-500/40 text-rose-300 hover:bg-rose-500/10",onClick:()=>{l?(a(),c(!1),t(!1),o({title:"存档已清空",description:"一切归零,重新开始。"})):c(!0)},children:[(0,d.jsx)(tw,{className:"h-3.5 w-3.5 mr-1"}),l?"再次点击确认清空":"清空存档"]})]}),(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)("a",{href:"https://gitea-pages.atdunbg.xyz/Super_Z/echo-nexus/",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs text-emerald-300/80 hover:text-emerald-200 transition px-1 py-1 rounded hover:bg-emerald-500/5",children:[(0,d.jsx)(tS,{className:"h-3.5 w-3.5"}),"在线游玩(gitea-pages"]}),(0,d.jsxs)("a",{href:"https://git.atdunbg.xyz/Super_Z/echo-nexus",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition px-1 py-1 rounded hover:bg-white/5",children:[(0,d.jsx)(tj,{className:"h-3.5 w-3.5"}),"git.atdunbg.xyz/Super_Z/echo-nexus"]})]})]}),(0,d.jsx)(te.DialogFooter,{children:(0,d.jsx)(ee.Button,{variant:"ghost",onClick:()=>t(!1),children:"关闭"})})]})})}var tA=e.i(44915),tP=e.i(36121);let t_=(0,x.default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),tM=(0,x.default)("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);var tR=e.i(62568);let t$=(0,x.default)("heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);var tO=e.i(39312),tD=e.i(63059);let tL=(0,x.default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]),tB={combat:{icon:tP.Swords,color:"#fb7185",label:"战斗",bg:"rgba(251,113,133,0.15)"},treasure:{icon:p.Gem,color:"#fbbf24",label:"宝藏",bg:"rgba(251,191,36,0.15)"},choice:{icon:t_,color:"#a5f3fc",label:"抉择",bg:"rgba(165,243,252,0.15)"},puzzle:{icon:tM,color:"#e879f9",label:"解谜",bg:"rgba(232,121,249,0.15)"},rest:{icon:t$,color:"#34d399",label:"休整",bg:"rgba(52,211,153,0.15)"},boss:{icon:tR.Skull,color:"#f43f5e",label:"BOSS",bg:"rgba(244,63,94,0.2)"}};function tI(){let e=(0,f.useGameStore)(e=>e.activeExpedition),t=(0,f.useGameStore)(e=>e.energy),s=(0,f.useGameStore)(e=>e.energyMax),r=(0,f.useGameStore)(e=>e.lastEnergyTick),a=(0,f.useGameStore)(e=>e.expeditionLog),i=(0,f.useGameStore)(e=>e.totalExpeditions),n=(0,f.useGameStore)(e=>e.lastExpeditionSummary),o=(0,f.useGameStore)(e=>(0,tA.computeEnergyRegenInterval)(e)),l=(0,f.useGameStore)(e=>e.startExpedition),c=(0,f.useGameStore)(e=>e.resolveCurrentNode),h=(0,f.useGameStore)(e=>e.advanceNode),p=(0,f.useGameStore)(e=>e.abortExpedition),{toast:x}=(0,F.useToast)(),[g,b]=(0,u.useState)(null),[y,v]=(0,u.useState)(()=>Date.now());(0,u.useEffect)(()=>{let e=setInterval(()=>v(Date.now()),1e3);return()=>clearInterval(e)},[]);let w=1e3*o,j=y-r,N=t>=s?100:Math.min(100,j/w*100),k=o<tA.EXPEDITION_CONFIG.energyRegenSec,S=t>=s?0:Math.max(0,Math.ceil((w-j)/1e3)),T=t>=tA.EXPEDITION_CONFIG.energyCost;if(!e||e.finished)return(0,d.jsxs)("div",{className:"h-full overflow-y-auto echo-scroll space-y-3 pr-0.5",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-1.5",children:[(0,d.jsx)(eh,{className:"h-4 w-4 text-amber-400"}),"遗迹探险"]}),(0,d.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["已探索 ",i," 次"]})]}),n&&(0,d.jsxs)("div",{className:`rounded-xl border p-2.5 relative overflow-hidden ${"victory"===n.result?"border-emerald-400/40 bg-emerald-950/20":"defeat"===n.result?"border-rose-400/40 bg-rose-950/20":"border-amber-400/30 bg-amber-950/10"}`,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,d.jsx)("span",{className:"text-[11px] font-semibold flex items-center gap-1",children:"victory"===n.result?"✦ 上次探险:胜利":"defeat"===n.result?"✕ 上次探险:失败":"→ 上次探险:撤退"}),(0,d.jsxs)("span",{className:"text-[9px] text-muted-foreground font-mono",children:[n.nodeCount," 节点"]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2.5 text-[10px]",children:[n.rewards.crystals>0&&(0,d.jsxs)("span",{className:"text-emerald-300",children:["+",(0,m.formatNum)(n.rewards.crystals)," 晶体"]}),n.rewards.insights>0&&(0,d.jsxs)("span",{className:"text-amber-300",children:["+",n.rewards.insights," 洞见"]}),n.rewards.contact>0&&(0,d.jsxs)("span",{className:"text-fuchsia-300",children:["+",n.rewards.contact.toFixed(1)," 接触"]}),0===n.rewards.crystals&&0===n.rewards.insights&&(0,d.jsx)("span",{className:"text-muted-foreground/60",children:"无奖励"})]})]}),(0,d.jsxs)("div",{className:"rounded-xl border border-amber-400/20 bg-amber-950/20 p-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(tO.Zap,{className:"h-3.5 w-3.5 text-amber-400"}),(0,d.jsx)("span",{className:"text-xs text-amber-200",children:"探险能量"})]}),(0,d.jsxs)("span",{className:"text-xs font-mono text-amber-100",children:[t," / ",s]})]}),t<s?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(D,{value:N,className:"h-1.5 bg-black/40 [&>div]:bg-gradient-to-r [&>div]:from-amber-500 [&>div]:to-yellow-300"}),(0,d.jsxs)("p",{className:"text-[10px] text-muted-foreground/70 mt-1 flex items-center gap-1",children:[(0,d.jsx)("span",{children:"下一点能量"}),(0,d.jsxs)("span",{className:"text-amber-300 font-mono font-semibold",children:[S,"s"]}),(0,d.jsx)("span",{children:"后恢复"}),k&&(0,d.jsxs)("span",{className:"text-emerald-400/80 ml-1",children:["⚡ ",o.toFixed(0),"s/点 (已加速)"]})]})]}):(0,d.jsx)("p",{className:"text-[10px] text-amber-300/80 mt-0.5",children:"能量已满,可立即出发"})]}),(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 rounded-2xl border border-dashed border-amber-400/20 bg-black/30 p-4 py-5 relative",children:[(0,d.jsx)("div",{className:"absolute -top-10 -right-10 h-32 w-32 rounded-full bg-amber-500/10 blur-2xl"}),(0,d.jsx)("div",{className:"relative",children:(0,d.jsx)("div",{className:`h-14 w-14 rounded-full bg-gradient-to-br from-amber-500/30 to-rose-500/20 flex items-center justify-center mx-auto ${T?"animate-pulse":""}`,style:{boxShadow:"0 0 30px rgba(251,191,36,0.3)"},children:(0,d.jsx)(eh,{className:"h-6 w-6 text-amber-300"})})}),(0,d.jsxs)("div",{className:"text-center space-y-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium text-amber-100",children:"深入以太遗迹"}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground/80 max-w-[260px] leading-relaxed",children:"程序化生成的 5-7 节点路径,每节点触发战斗/宝藏/抉择/解谜/休整事件,终点 BOSS 必给记忆碎片。"})]}),(0,d.jsxs)("div",{className:"w-full grid grid-cols-3 gap-1.5 text-[10px]",children:[(0,d.jsxs)("div",{className:"rounded-md border border-emerald-400/20 bg-emerald-950/15 px-1.5 py-1 text-center",children:[(0,d.jsx)("div",{className:"text-emerald-300 font-semibold",children:"晶体/洞见"}),(0,d.jsx)("div",{className:"text-muted-foreground/60 text-[9px] mt-0.5",children:"主线成长资源"})]}),(0,d.jsxs)("div",{className:"rounded-md border border-fuchsia-400/20 bg-fuchsia-950/15 px-1.5 py-1 text-center",children:[(0,d.jsx)("div",{className:"text-fuchsia-300 font-semibold",children:"接触进度"}),(0,d.jsx)("div",{className:"text-muted-foreground/60 text-[9px] mt-0.5",children:"飞升必需"})]}),(0,d.jsxs)("div",{className:"rounded-md border border-amber-400/20 bg-amber-950/15 px-1.5 py-1 text-center",children:[(0,d.jsx)("div",{className:"text-amber-300 font-semibold",children:"记忆碎片"}),(0,d.jsx)("div",{className:"text-muted-foreground/60 text-[9px] mt-0.5",children:"BOSS 必给"})]})]}),(0,d.jsxs)(ee.Button,{onClick:()=>{let e=l();e.ok?((0,V.sfx)("expeditionStart"),x({title:"探险队出发",description:"深入遗迹,谨慎前行。"}),b(null)):x({title:"无法出发",description:e.reason,variant:"destructive"})},disabled:!T,className:"bg-gradient-to-r from-amber-600 to-rose-500 hover:from-amber-500 hover:to-rose-400 text-white border-0 w-full",children:[(0,d.jsx)(eh,{className:"h-4 w-4 mr-1.5"}),T?`出发(消耗 ${tA.EXPEDITION_CONFIG.energyCost} 能量)`:`能量不足(${S}s 后恢复)`]}),(0,d.jsx)("div",{className:"w-full flex items-center justify-center gap-2 flex-wrap text-[9px] text-muted-foreground/60 pt-1 border-t border-white/5",children:Object.entries(tB).map(([e,t])=>{let s=t.icon;return(0,d.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,d.jsx)(s,{className:"h-2.5 w-2.5",style:{color:t.color}}),t.label]},e)})})]}),a.length>0&&(0,d.jsxs)("div",{className:"rounded-xl border border-white/5 bg-black/20 p-2 max-h-28 overflow-y-auto echo-scroll",children:[(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground/60 mb-1 px-1",children:"最近探险记录"}),a.slice(0,4).map((e,t)=>(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground/70 px-1 py-0.5 border-b border-white/5 last:border-0",children:[(0,d.jsx)("span",{className:"text-amber-300/60",children:""})," ",e.result,e.rewards&&(0,d.jsx)("span",{className:"text-emerald-300/70 ml-1",children:e.rewards})]},t))]})]});let C=e.nodes[e.currentNode],E=tB[C.type],A=E.icon,P=e.hp/e.maxHp*100,_=(e.currentNode+ +!!C.cleared)/e.nodes.length*100;return(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 h-full overflow-y-auto echo-scroll space-y-2.5 pr-0.5",children:[(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-1.5",children:[(0,d.jsx)(eh,{className:"h-3.5 w-3.5 text-amber-400"}),(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-xs font-semibold",children:"遗迹探险"}),(0,d.jsxs)("span",{className:"jsx-df1c681cdb543264 text-[10px] text-muted-foreground",children:["第 ",e.currentNode+1,"/",e.nodes.length," 节点"]})]}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-[10px] text-muted-foreground",children:"探险力"}),(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-xs font-mono font-semibold text-amber-300",children:e.power})]})]}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264",children:[(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center justify-between mb-0.5",children:[(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-1",children:[(0,d.jsx)(t$,{className:"h-3 w-3 text-rose-400"}),(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-[10px] text-muted-foreground",children:"探险队生命"})]}),(0,d.jsxs)("span",{className:`jsx-df1c681cdb543264 text-[10px] font-mono ${P<30?"text-rose-400":"text-foreground"}`,children:[e.hp," / ",e.maxHp]})]}),(0,d.jsx)(D,{value:P,className:"h-1.5 bg-black/40 [&>div]:bg-gradient-to-r [&>div]:from-rose-500 [&>div]:to-emerald-400"})]}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 rounded-xl border border-white/10 bg-black/30 p-2.5",children:[(0,d.jsx)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-1 overflow-x-auto echo-scroll pb-1",children:e.nodes.map((t,s)=>{let r=tB[t.type],a=r.icon,i=s===e.currentNode,n=t.cleared,o=s<e.currentNode;return(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center shrink-0",children:[(0,d.jsxs)("div",{style:{background:n||o?"rgba(255,255,255,0.04)":r.bg,border:i?`1.5px solid ${r.color}`:"1px solid rgba(255,255,255,0.08)",boxShadow:i?`0 0 12px ${r.color}66`:"none"},title:`${r.label} \xb7 ${t.title}`,className:`jsx-df1c681cdb543264 relative h-9 w-9 rounded-lg flex items-center justify-center transition-all duration-300 ${i?"scale-125":""}`,children:[(0,d.jsx)(a,{style:{color:n||o?"#666":r.color},className:`jsx-df1c681cdb543264 h-4 w-4 ${n||o?"opacity-30":""}`}),n&&(0,d.jsx)("div",{className:"jsx-df1c681cdb543264 absolute -top-1 -right-1 h-3 w-3 rounded-full bg-emerald-500/80 flex items-center justify-center",children:(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-[8px] text-white",children:"✓"})})]}),s<e.nodes.length-1&&(0,d.jsx)(tD.ChevronRight,{className:`h-3 w-3 mx-0.5 ${o||i&&n?"text-amber-400/60":"text-white/15"}`})]},t.id)})}),(0,d.jsx)("div",{className:"jsx-df1c681cdb543264 mt-1.5",children:(0,d.jsx)(D,{value:_,className:"h-1 bg-black/40 [&>div]:bg-gradient-to-r [&>div]:from-amber-500 [&>div]:to-rose-400"})})]}),(0,d.jsxs)("div",{style:{borderColor:`${E.color}44`,background:`linear-gradient(135deg, ${E.color}11, rgba(0,0,0,0.4))`,boxShadow:`0 0 20px ${E.color}22`},className:"jsx-df1c681cdb543264 rounded-xl border p-3 relative overflow-hidden",children:[(0,d.jsx)("div",{style:{background:`${E.color}22`},className:"jsx-df1c681cdb543264 absolute -top-8 -right-8 h-24 w-24 rounded-full blur-2xl"}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 relative",children:[(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-2 mb-1.5",children:[(0,d.jsx)("div",{style:{background:E.bg,border:`1px solid ${E.color}44`},className:"jsx-df1c681cdb543264 h-8 w-8 rounded-lg flex items-center justify-center",children:(0,d.jsx)(A,{style:{color:E.color},className:"jsx-df1c681cdb543264 h-4 w-4"})}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264",children:[(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-1.5",children:[(0,d.jsx)("span",{style:{background:E.bg,color:E.color},className:"jsx-df1c681cdb543264 text-[10px] font-mono px-1.5 py-0.5 rounded",children:E.label}),"combat"===C.type&&(0,d.jsxs)("span",{className:"jsx-df1c681cdb543264 text-[10px] text-muted-foreground",children:["胜率 ",Math.round(100*(0,tA.combatWinRate)(e.power,C.difficulty)),"%"]}),C.difficulty>0&&(0,d.jsxs)("span",{className:"jsx-df1c681cdb543264 text-[10px] text-muted-foreground/60",children:["难度 ",C.difficulty]})]}),(0,d.jsx)("h4",{style:{color:E.color},className:"jsx-df1c681cdb543264 text-sm font-semibold mt-0.5",children:C.title})]})]}),(0,d.jsx)("p",{className:"jsx-df1c681cdb543264 text-[11px] text-muted-foreground/90 leading-relaxed",children:C.desc}),g&&(0,d.jsx)("div",{className:"jsx-df1c681cdb543264 mt-2 px-2 py-1.5 rounded-lg bg-black/40 border border-white/10",children:(0,d.jsx)("p",{className:"jsx-df1c681cdb543264 text-[11px] text-foreground/90",children:g})})]})]}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-1.5",children:[C.cleared?e.currentNode<e.nodes.length-1?(0,d.jsxs)(ee.Button,{onClick:()=>{h(),b(null)},className:"flex-1 h-8",variant:"outline",children:[(0,d.jsx)(tD.ChevronRight,{className:"h-3.5 w-3.5 mr-1"}),"前进"]}):(0,d.jsx)("div",{className:"jsx-df1c681cdb543264 flex-1 text-center text-xs text-emerald-300 py-1.5",children:"探险已完成 ✓"}):(0,d.jsxs)(ee.Button,{onClick:()=>{let e=c();e&&(b(e.log),e.ended?"victory"===e.endReason?(0,V.sfx)("expeditionVictory"):(0,V.sfx)("expeditionDefeat"):(0,V.sfx)("expeditionNode"),x({title:e.ended?"victory"===e.endReason?"✦ 探险胜利!":"探险失败":"节点结算",description:e.log,variant:"defeat"===e.endReason?"destructive":"default"}))},className:"flex-1 bg-gradient-to-r from-amber-600 to-rose-500 hover:from-amber-500 hover:to-rose-400 text-white border-0 h-8",children:[(0,d.jsx)(es.Sparkles,{className:"h-3.5 w-3.5 mr-1"}),"探索节点"]}),(0,d.jsx)(ee.Button,{onClick:()=>{p(),x({title:"探险队撤退",description:"保留已获奖励,安全返回。"}),b(null)},variant:"ghost",size:"sm",className:"h-8 px-2 text-muted-foreground hover:text-rose-300",children:(0,d.jsx)(tL,{className:"h-3.5 w-3.5"})})]}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-2 text-[10px] px-1",children:[(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-muted-foreground/60",children:"本次已获:"}),e.rewards.crystals>0&&(0,d.jsxs)("span",{className:"jsx-df1c681cdb543264 text-emerald-300",children:[(0,m.formatNum)(e.rewards.crystals),"晶体"]}),e.rewards.insights>0&&(0,d.jsxs)("span",{className:"jsx-df1c681cdb543264 text-amber-300",children:[e.rewards.insights,"洞见"]}),e.rewards.contact>0&&(0,d.jsxs)("span",{className:"jsx-df1c681cdb543264 text-fuchsia-300",children:[e.rewards.contact.toFixed(1),"接触"]}),0===e.rewards.crystals&&0===e.rewards.insights&&(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-muted-foreground/40",children:"暂无"})]}),(0,d.jsx)(I.default,{id:"df1c681cdb543264",children:".echo-scroll::-webkit-scrollbar{width:4px;height:4px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff1f;border-radius:2px}.echo-scroll::-webkit-scrollbar-track{background:0 0}"})]})}var tF=e.i(32142),tV=e.i(64030);let tz=(0,x.default)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]),tG=[{key:"all",label:"全部",color:"#a78bfa"},{key:"unlocked",label:"已解锁",color:"#34d399"},{key:"locked",label:"未解锁",color:"#fb7185"}];function tU(){let e=(0,f.useGameStore)(e=>e.achievements),[t,s]=(0,u.useState)("all"),r=Object.values(e).filter(Boolean).length,a=(0,tF.achievementBonuses)(e),i=tF.ACHIEVEMENTS.length,n=i>0?r/i*100:0,o=(0,u.useMemo)(()=>tF.ACHIEVEMENTS.filter(s=>{let r=!!e[s.id];return"unlocked"===t?r:"locked"!==t||!r}),[e,t]);return(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex flex-col gap-2.5 h-full min-h-0",children:[(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center justify-between gap-2",children:[(0,d.jsxs)("h3",{className:"jsx-89979d12e77b884d text-sm font-semibold flex items-center gap-1.5 shrink-0",children:[(0,d.jsx)(tV.Trophy,{className:"h-4 w-4 text-amber-400"}),"成就"]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-2 text-[10px] font-mono",children:[(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-amber-300",children:r}),(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-muted-foreground/50",children:"/"}),(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-muted-foreground",children:i}),(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-muted-foreground/60",children:["(",n.toFixed(0),"%)"]})]})]}),(0,d.jsx)("div",{className:"jsx-89979d12e77b884d h-1 rounded-full bg-black/40 overflow-hidden",children:(0,d.jsx)("div",{style:{width:`${n}%`,boxShadow:"0 0 8px rgba(251,191,36,0.5)"},className:"jsx-89979d12e77b884d h-full bg-gradient-to-r from-amber-500 via-rose-400 to-fuchsia-400 transition-all duration-500"})}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d rounded-lg border border-amber-400/20 bg-amber-950/20 px-2.5 py-1.5 flex items-center gap-2 text-[10px] flex-wrap",children:[(0,d.jsx)(es.Sparkles,{className:"h-3 w-3 text-amber-400 shrink-0"}),(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-amber-300/80",children:"永久加成"}),a.crystalsPerSecPct>0&&(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-emerald-300",children:["产能 +",a.crystalsPerSecPct,"%"]}),a.insightPct>0&&(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-fuchsia-300",children:["洞见 +",a.insightPct,"%"]}),0===a.crystalsPerSecPct&&0===a.insightPct&&(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-muted-foreground/60",children:"达成成就解锁永久加成"})]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-1 text-[10px]",children:[(0,d.jsx)(tz,{className:"h-3 w-3 text-muted-foreground/60 shrink-0"}),tG.map(e=>{let a=t===e.key,n="all"===e.key?i:"unlocked"===e.key?r:i-r;return(0,d.jsxs)("button",{onClick:()=>s(e.key),style:a?{color:e.color,boxShadow:`inset 0 0 0 1px ${e.color}55`}:void 0,className:`jsx-89979d12e77b884d px-2 py-0.5 rounded-md transition-all ${a?"bg-white/10 text-foreground":"text-muted-foreground/70 hover:text-foreground hover:bg-white/5"}`,children:[e.label,(0,d.jsx)("span",{className:"jsx-89979d12e77b884d ml-1 font-mono opacity-70",children:n})]},e.key)})]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex-1 min-h-0 overflow-y-auto echo-scroll pr-1 space-y-1.5",children:[0===o.length&&(0,d.jsx)("div",{className:"jsx-89979d12e77b884d text-center text-[11px] text-muted-foreground/60 py-6",children:"该分类下暂无成就"}),o.map(t=>{let s=!!e[t.id];return(0,d.jsxs)("div",{style:s?{boxShadow:`inset 0 0 14px ${t.color}10`}:void 0,className:`jsx-89979d12e77b884d relative rounded-lg border px-2.5 py-2 transition-all duration-300 min-h-[68px] flex items-center ${s?"border-white/15 bg-black/30":"border-white/5 bg-black/15 opacity-70"}`,children:[s&&(0,d.jsx)("div",{style:{background:t.color},className:"jsx-89979d12e77b884d absolute -top-6 -right-6 h-16 w-16 rounded-full blur-2xl opacity-40 pointer-events-none"}),(0,d.jsx)("div",{style:{background:s?`${t.color}22`:"rgba(255,255,255,0.04)",border:`1px solid ${s?t.color+"55":"rgba(255,255,255,0.08)"}`,color:s?t.color:"#666",boxShadow:s?`0 0 10px ${t.color}33`:"none"},className:"jsx-89979d12e77b884d shrink-0 h-10 w-10 rounded-lg flex items-center justify-center text-lg mr-2.5",children:s?t.icon:(0,d.jsx)(em,{className:"h-4 w-4"})}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d min-w-0 flex-1 flex flex-col gap-0.5",children:[(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-1.5",children:[(0,d.jsx)("span",{style:{color:s?t.color:"rgba(255,255,255,0.5)"},className:"jsx-89979d12e77b884d text-[11px] font-semibold truncate",children:t.name}),s&&(0,d.jsx)("span",{style:{background:`${t.color}22`,color:t.color},className:"jsx-89979d12e77b884d text-[8px] px-1 py-0 rounded shrink-0 font-mono",children:"✓"})]}),(0,d.jsx)("div",{className:"jsx-89979d12e77b884d text-[10px] text-muted-foreground/80 leading-tight line-clamp-2",children:t.desc}),s&&(0,d.jsxs)("div",{style:{color:t.color+"cc"},className:"jsx-89979d12e77b884d text-[9px] mt-0.5 font-mono truncate",children:["✦ ",t.rewardText]})]})]},t.id)})]}),(0,d.jsx)(I.default,{id:"89979d12e77b884d",children:".echo-scroll::-webkit-scrollbar{width:5px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff24;border-radius:3px}.echo-scroll::-webkit-scrollbar-track{background:0 0}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}"})]})}var tH=e.i(47167);let tW=(0,u.createContext)({});function tq(e){let t=(0,u.useRef)(null);return null===t.current&&(t.current=e()),t.current}let tY="u">typeof window,tK=tY?u.useLayoutEffect:u.useEffect,tX=(0,u.createContext)(null);function tZ(e){return"object"==typeof e&&null!==e}function tJ(e){return tZ(e)&&"offsetHeight"in e}var tQ=u;let t0=(0,u.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function t1(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class t2 extends tQ.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=t.offsetParent,s=tJ(e)&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=s-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function t5({children:e,isPresent:t,anchorX:s,root:r}){let a=(0,tQ.useId)(),i=(0,tQ.useRef)(null),n=(0,tQ.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=(0,tQ.useContext)(t0),l=function(...e){return u.useCallback(function(...e){return t=>{let s=!1,r=e.map(e=>{let r=t1(e,t);return s||"function"!=typeof r||(s=!0),r});if(s)return()=>{for(let t=0;t<r.length;t++){let s=r[t];"function"==typeof s?s():t1(e[t],null)}}}}(...e),e)}(i,e.props?.ref??e?.ref);return(0,tQ.useInsertionEffect)(()=>{let{width:e,height:l,top:c,left:d,right:u}=n.current;if(t||!i.current||!e||!l)return;let h="left"===s?`left: ${d}`:`right: ${u}`;i.current.dataset.motionPopId=a;let f=document.createElement("style");o&&(f.nonce=o);let m=r??document.head;return m.appendChild(f),f.sheet&&f.sheet.insertRule(`
[data-motion-pop-id="${a}"] {
position: absolute !important;
width: ${e}px !important;
height: ${l}px !important;
${h}px !important;
top: ${c}px !important;
}
`),()=>{m.contains(f)&&m.removeChild(f)}},[t]),(0,d.jsx)(t2,{isPresent:t,childRef:i,sizeRef:n,children:tQ.cloneElement(e,{ref:l})})}let t3=({children:e,initial:t,isPresent:s,onExitComplete:r,custom:a,presenceAffectsLayout:i,mode:n,anchorX:o,root:l})=>{let c=tq(t4),h=(0,u.useId)(),f=!0,m=(0,u.useMemo)(()=>(f=!1,{id:h,initial:t,isPresent:s,custom:a,onExitComplete:e=>{for(let t of(c.set(e,!0),c.values()))if(!t)return;r&&r()},register:e=>(c.set(e,!1),()=>c.delete(e))}),[s,c,r]);return i&&f&&(m={...m}),(0,u.useMemo)(()=>{c.forEach((e,t)=>c.set(t,!1))},[s]),u.useEffect(()=>{s||c.size||!r||r()},[s]),"popLayout"===n&&(e=(0,d.jsx)(t5,{isPresent:s,anchorX:o,root:l,children:e})),(0,d.jsx)(tX.Provider,{value:m,children:e})};function t4(){return new Map}function t7(e=!0){let t=(0,u.useContext)(tX);if(null===t)return[!0,null];let{isPresent:s,onExitComplete:r,register:a}=t,i=(0,u.useId)();(0,u.useEffect)(()=>{if(e)return a(i)},[e]);let n=(0,u.useCallback)(()=>e&&r&&r(i),[i,r,e]);return!s&&r?[!1,n]:[!0]}let t9=e=>e.key||"";function t8(e){let t=[];return u.Children.forEach(e,e=>{(0,u.isValidElement)(e)&&t.push(e)}),t}let t6=({children:e,custom:t,initial:s=!0,onExitComplete:r,presenceAffectsLayout:a=!0,mode:i="sync",propagate:n=!1,anchorX:o="left",root:l})=>{let[c,h]=t7(n),f=(0,u.useMemo)(()=>t8(e),[e]),m=n&&!c?[]:f.map(t9),p=(0,u.useRef)(!0),x=(0,u.useRef)(f),g=tq(()=>new Map),b=(0,u.useRef)(new Set),[y,v]=(0,u.useState)(f),[w,j]=(0,u.useState)(f);tK(()=>{p.current=!1,x.current=f;for(let e=0;e<w.length;e++){let t=t9(w[e]);m.includes(t)?(g.delete(t),b.current.delete(t)):!0!==g.get(t)&&g.set(t,!1)}},[w,m.length,m.join("-")]);let N=[];if(f!==y){let e=[...f];for(let t=0;t<w.length;t++){let s=w[t],r=t9(s);m.includes(r)||(e.splice(t,0,s),N.push(s))}return"wait"===i&&N.length&&(e=N),j(t8(e)),v(f),null}let{forceRender:k}=(0,u.useContext)(tW);return(0,d.jsx)(d.Fragment,{children:w.map(e=>{let u=t9(e),y=(!n||!!c)&&(f===w||m.includes(u));return(0,d.jsx)(t3,{isPresent:y,initial:(!p.current||!!s)&&void 0,custom:t,presenceAffectsLayout:a,mode:i,root:l,onExitComplete:y?void 0:()=>{if(b.current.has(u)||(b.current.add(u),!g.has(u)))return;g.set(u,!0);let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(k?.(),j(x.current),n&&h?.(),r&&r())},anchorX:o,children:e},u)})})},se=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],st=new Set(se),ss=(e,t,s)=>s>t?t:s<e?e:s,sr={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},sa={...sr,transform:e=>ss(0,1,e)},si={...sr,default:1},sn=e=>Math.round(1e5*e)/1e5,so=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,sl=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,sc=(e,t)=>s=>!!("string"==typeof s&&sl.test(s)&&s.startsWith(e)||t&&null!=s&&Object.prototype.hasOwnProperty.call(s,t)),sd=(e,t,s)=>r=>{if("string"!=typeof r)return r;let[a,i,n,o]=r.match(so);return{[e]:parseFloat(a),[t]:parseFloat(i),[s]:parseFloat(n),alpha:void 0!==o?parseFloat(o):1}},su={...sr,transform:e=>Math.round(ss(0,255,e))},sh={test:sc("rgb","red"),parse:sd("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:r=1})=>"rgba("+su.transform(e)+", "+su.transform(t)+", "+su.transform(s)+", "+sn(sa.transform(r))+")"},sf={test:sc("#"),parse:function(e){let t="",s="",r="",a="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),r=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),r=e.substring(3,4),a=e.substring(4,5),t+=t,s+=s,r+=r,a+=a),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}},transform:sh.transform},sm=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),sp=sm("deg"),sx=sm("%"),sg=sm("px"),sb=sm("vh"),sy=sm("vw"),sv={...sx,parse:e=>sx.parse(e)/100,transform:e=>sx.transform(100*e)},sw={test:sc("hsl","hue"),parse:sd("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:r=1})=>"hsla("+Math.round(e)+", "+sx.transform(sn(t))+", "+sx.transform(sn(s))+", "+sn(sa.transform(r))+")"},sj={test:e=>sh.test(e)||sf.test(e)||sw.test(e),parse:e=>sh.test(e)?sh.parse(e):sw.test(e)?sw.parse(e):sf.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?sh.transform(e):sw.transform(e),getAnimatableNone:e=>{let t=sj.parse(e);return t.alpha=0,sj.transform(t)}},sN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,sk="number",sS="color",sT=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function sC(e){let t=e.toString(),s=[],r={color:[],number:[],var:[]},a=[],i=0,n=t.replace(sT,e=>(sj.test(e)?(r.color.push(i),a.push(sS),s.push(sj.parse(e))):e.startsWith("var(")?(r.var.push(i),a.push("var"),s.push(e)):(r.number.push(i),a.push(sk),s.push(parseFloat(e))),++i,"${}")).split("${}");return{values:s,split:n,indexes:r,types:a}}function sE(e){return sC(e).values}function sA(e){let{split:t,types:s}=sC(e),r=t.length;return e=>{let a="";for(let i=0;i<r;i++)if(a+=t[i],void 0!==e[i]){let t=s[i];t===sk?a+=sn(e[i]):t===sS?a+=sj.transform(e[i]):a+=e[i]}return a}}let sP=e=>"number"==typeof e?0:sj.test(e)?sj.getAnimatableNone(e):e,s_={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(so)?.length||0)+(e.match(sN)?.length||0)>0},parse:sE,createTransformer:sA,getAnimatableNone:function(e){let t=sE(e);return sA(e)(t.map(sP))}},sM=new Set(["brightness","contrast","saturate","opacity"]);function sR(e){let[t,s]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[r]=s.match(so)||[];if(!r)return e;let a=s.replace(r,""),i=+!!sM.has(t);return r!==s&&(i*=100),t+"("+i+a+")"}let s$=/\b([a-z-]*)\(.*?\)/gu,sO={...s_,getAnimatableNone:e=>{let t=e.match(s$);return t?t.map(sR).join(" "):e}},sD={...sr,transform:Math.round},sL={borderWidth:sg,borderTopWidth:sg,borderRightWidth:sg,borderBottomWidth:sg,borderLeftWidth:sg,borderRadius:sg,radius:sg,borderTopLeftRadius:sg,borderTopRightRadius:sg,borderBottomRightRadius:sg,borderBottomLeftRadius:sg,width:sg,maxWidth:sg,height:sg,maxHeight:sg,top:sg,right:sg,bottom:sg,left:sg,inset:sg,insetBlock:sg,insetBlockStart:sg,insetBlockEnd:sg,insetInline:sg,insetInlineStart:sg,insetInlineEnd:sg,padding:sg,paddingTop:sg,paddingRight:sg,paddingBottom:sg,paddingLeft:sg,paddingBlock:sg,paddingBlockStart:sg,paddingBlockEnd:sg,paddingInline:sg,paddingInlineStart:sg,paddingInlineEnd:sg,margin:sg,marginTop:sg,marginRight:sg,marginBottom:sg,marginLeft:sg,marginBlock:sg,marginBlockStart:sg,marginBlockEnd:sg,marginInline:sg,marginInlineStart:sg,marginInlineEnd:sg,backgroundPositionX:sg,backgroundPositionY:sg,rotate:sp,rotateX:sp,rotateY:sp,rotateZ:sp,scale:si,scaleX:si,scaleY:si,scaleZ:si,skew:sp,skewX:sp,skewY:sp,distance:sg,translateX:sg,translateY:sg,translateZ:sg,x:sg,y:sg,z:sg,perspective:sg,transformPerspective:sg,opacity:sa,originX:sv,originY:sv,originZ:sg,zIndex:sD,fillOpacity:sa,strokeOpacity:sa,numOctaves:sD},sB={...sL,color:sj,backgroundColor:sj,outlineColor:sj,fill:sj,stroke:sj,borderColor:sj,borderTopColor:sj,borderRightColor:sj,borderBottomColor:sj,borderLeftColor:sj,filter:sO,WebkitFilter:sO},sI=e=>sB[e],sF=()=>({translate:0,scale:1,origin:0,originPoint:0}),sV=()=>({x:sF(),y:sF()}),sz=()=>({min:0,max:0}),sG=()=>({x:sz(),y:sz()}),sU=e=>!!(e&&e.getVelocity),sH=new Set(["width","height","top","left","right","bottom",...se]),sW=e=>t=>t.test(e),sq=[sr,sg,sx,sp,sy,sb,{test:e=>"auto"===e,parse:e=>e}],sY=e=>sq.find(sW(e)),sK=()=>{},sX=()=>{};tH.default;let sZ=e=>t=>"string"==typeof t&&t.startsWith(e),sJ=sZ("--"),sQ=sZ("var(--"),s0=e=>!!sQ(e)&&s1.test(e.split("/*")[0].trim()),s1=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function s2(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}let s5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,s3=e=>180*e/Math.PI,s4=e=>s9(s3(Math.atan2(e[1],e[0]))),s7={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:s4,rotateZ:s4,skewX:e=>s3(Math.atan(e[1])),skewY:e=>s3(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},s9=e=>((e%=360)<0&&(e+=360),e),s8=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),s6=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),re={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:s8,scaleY:s6,scale:e=>(s8(e)+s6(e))/2,rotateX:e=>s9(s3(Math.atan2(e[6],e[5]))),rotateY:e=>s9(s3(Math.atan2(-e[2],e[0]))),rotateZ:s4,rotate:s4,skewX:e=>s3(Math.atan(e[4])),skewY:e=>s3(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function rt(e){return+!!e.includes("scale")}function rs(e,t){let s,r;if(!e||"none"===e)return rt(t);let a=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(a)s=re,r=a;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=s7,r=t}if(!r)return rt(t);let i=s[t],n=r[1].split(",").map(rr);return"function"==typeof i?i(n):n[i]}function rr(e){return parseFloat(e.trim())}let ra=e=>e===sr||e===sg,ri=new Set(["x","y","z"]),rn=se.filter(e=>!ri.has(e)),ro={width:({x:e},{paddingLeft:t="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),height:({y:e},{paddingTop:t="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>rs(t,"x"),y:(e,{transform:t})=>rs(t,"y")};ro.translateX=ro.x,ro.translateY=ro.y;let rl=e=>e,rc={},rd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ru(e,t){let s=!1,r=!0,a={delta:0,timestamp:0,isProcessing:!1},i=()=>s=!0,n=rd.reduce((e,s)=>(e[s]=function(e,t){let s=new Set,r=new Set,a=!1,i=!1,n=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){n.has(t)&&(d.schedule(t),e()),l++,t(o)}let d={schedule:(e,t=!1,i=!1)=>{let o=i&&a?s:r;return t&&n.add(e),o.has(e)||o.add(e),e},cancel:e=>{r.delete(e),n.delete(e)},process:e=>{if(o=e,a){i=!0;return}a=!0,[s,r]=[r,s],s.forEach(c),t,l=0,s.clear(),a=!1,i&&(i=!1,d.process(e))}};return d}(i,t?s:void 0),e),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:d,update:u,preRender:h,render:f,postRender:m}=n,p=()=>{let i=rc.useManualTiming?a.timestamp:performance.now();s=!1,rc.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(i-a.timestamp,40),1)),a.timestamp=i,a.isProcessing=!0,o.process(a),l.process(a),c.process(a),d.process(a),u.process(a),h.process(a),f.process(a),m.process(a),a.isProcessing=!1,s&&t&&(r=!1,e(p))};return{schedule:rd.reduce((t,i)=>{let o=n[i];return t[i]=(t,i=!1,n=!1)=>(!s&&(s=!0,r=!0,a.isProcessing||e(p)),o.schedule(t,i,n)),t},{}),cancel:e=>{for(let t=0;t<rd.length;t++)n[rd[t]].cancel(e)},state:a,steps:n}}let{schedule:rh,cancel:rf,state:rm,steps:rp}=ru("u">typeof requestAnimationFrame?requestAnimationFrame:rl,!0),rx=new Set,rg=!1,rb=!1,ry=!1;function rv(){if(rb){let e=Array.from(rx).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),s=new Map;t.forEach(e=>{let t,r=(t=[],rn.forEach(s=>{let r=e.getValue(s);void 0!==r&&(t.push([s,r.get()]),r.set(+!!s.startsWith("scale")))}),t);r.length&&(s.set(e,r),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=s.get(e);t&&t.forEach(([t,s])=>{e.getValue(t)?.set(s)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}rb=!1,rg=!1,rx.forEach(e=>e.complete(ry)),rx.clear()}function rw(){rx.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(rb=!0)})}class rj{constructor(e,t,s,r,a,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=s,this.motionValue=r,this.element=a,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(rx.add(this),rg||(rg=!0,rh.read(rw),rh.resolveKeyframes(rv))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:s,motionValue:r}=this;if(null===e[0]){let a=r?.get(),i=e[e.length-1];if(void 0!==a)e[0]=a;else if(s&&t){let r=s.readValue(t,i);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=i),r&&void 0===a&&r.set(e[0])}for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),rx.delete(this)}cancel(){"scheduled"===this.state&&(rx.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function rN(e,t){let s=sI(e);return s!==sO&&(s=s_),s.getAnimatableNone?s.getAnimatableNone(t):void 0}let rk=new Set(["auto","none","0"]);class rS extends rj{constructor(e,t,s,r,a){super(e,t,s,r,a,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:s}=this;if(!t||!t.current)return;super.readKeyframes();for(let s=0;s<e.length;s++){let r=e[s];if("string"==typeof r&&s0(r=r.trim())){let a=function e(t,s,r=1){sX(r<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[a,i]=function(e){let t=s5.exec(e);if(!t)return[,];let[,s,r,a]=t;return[`--${s??r}`,a]}(t);if(!a)return;let n=window.getComputedStyle(s).getPropertyValue(a);if(n){let e=n.trim();return/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)?parseFloat(e):e}return s0(i)?e(i,s,r+1):i}(r,t.current);void 0!==a&&(e[s]=a),s===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!sH.has(s)||2!==e.length)return;let[r,a]=e,i=sY(r),n=sY(a);if(s2(r)!==s2(a)&&ro[s]){this.needsMeasurement=!0;return}if(i!==n)if(ra(i)&&ra(n))for(let t=0;t<e.length;t++){let s=e[t];"string"==typeof s&&(e[t]=parseFloat(s))}else ro[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,s=[];for(let t=0;t<e.length;t++)(null===e[t]||function(e){if("number"==typeof e)return 0===e;if(null===e)return!0;return"none"===e||"0"===e||/^0[^.\s]+$/u.test(e)}(e[t]))&&s.push(t);s.length&&function(e,t,s){let r,a=0;for(;a<e.length&&!r;){let t=e[a];"string"==typeof t&&!rk.has(t)&&sC(t).values.length&&(r=e[a]),a++}if(r&&s)for(let a of t)e[a]=rN(s,r)}(e,s,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:s}=this;if(!e||!e.current)return;"height"===s&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ro[s](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];void 0!==r&&e.getValue(s,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:s}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let a=s.length-1,i=s[a];s[a]=ro[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,s])=>{e.getValue(t).set(s)}),this.resolveNoneKeyframes()}}function rT(e,t){-1===e.indexOf(t)&&e.push(t)}function rC(e,t){let s=e.indexOf(t);s>-1&&e.splice(s,1)}class rE{constructor(){this.subscriptions=[]}add(e){return rT(this.subscriptions,e),()=>rC(this.subscriptions,e)}notify(e,t,s){let r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,s);else for(let a=0;a<r;a++){let r=this.subscriptions[a];r&&r(e,t,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let{schedule:rA}=ru(queueMicrotask,!1);function rP(){t=void 0}let r_={now:()=>(void 0===t&&r_.set(rm.isProcessing||rc.useManualTiming?rm.timestamp:performance.now()),t),set:e=>{t=e,queueMicrotask(rP)}};class rM{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=r_.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=r_.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new rE);let s=this.events[e].add(t);return"change"===e?()=>{s(),rh.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,s){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return n&&n.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;let t=r_.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let s=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),s?1e3/s*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function rR(e,t){return new rM(e,t)}let r$=[...sq,sj,s_],rO={current:null},rD={current:!1},rL="u">typeof window,rB=new WeakMap;function rI(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function rF(e){return"string"==typeof e||Array.isArray(e)}let rV=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rz=["initial",...rV];function rG(e){return rI(e.animate)||rz.some(t=>rF(e[t]))}function rU(e){return!!(rG(e)||e.variants)}function rH(e){let t=[{},{}];return e?.values.forEach((e,s)=>{t[0][s]=e.get(),t[1][s]=e.getVelocity()}),t}function rW(e,t,s,r){if("function"==typeof t){let[a,i]=rH(r);t=t(void 0!==s?s:e.custom,a,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[a,i]=rH(r);t=t(void 0!==s?s:e.custom,a,i)}return t}let rq=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],rY={};class rK{scrapeMotionValuesFromProps(e,t,s){return{}}constructor({parent:e,props:t,presenceContext:s,reducedMotionConfig:r,blockInitialAnimation:a,visualState:i},n={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=rj,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=r_.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,rh.render(this.render,!1,!0))};const{latestValues:o,renderState:l}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=t.initial?{...o}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=n,this.blockInitialAnimation=!!a,this.isControllingVariants=rG(t),this.isVariantNode=rU(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==o[e]&&sU(t)&&t.set(o[e])}}mount(e){this.current=e,rB.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(rD.current||function(){if(rD.current=!0,rL)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>rO.current=e.matches;e.addEventListener("change",t),t()}else rO.current=!1}(),this.shouldReduceMotion=rO.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),rf(this.notifyUpdate),rf(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){let s;this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let r=st.has(e);r&&this.onBindTransform&&this.onBindTransform();let a=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&rh.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"u">typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{a(),s&&s(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in rY){let t=rY[e];if(!t)continue;let{isEnabled:s,Feature:r}=t;if(!this.features[e]&&r&&s(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):sG()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<rq.length;t++){let s=rq[t];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);let r=e["on"+s];r&&(this.propEventSubscriptions[s]=this.on(s,r))}this.prevMotionValues=function(e,t,s){for(let r in t){let a=t[r],i=s[r];if(sU(a))e.addValue(r,a);else if(sU(i))e.addValue(r,rR(a,{owner:e}));else if(i!==a)if(e.hasValue(r)){let t=e.getValue(r);!0===t.liveStyle?t.jump(a):t.hasAnimated||t.set(a)}else{let t=e.getStaticValue(r);e.addValue(r,rR(void 0!==t?t:a,{owner:e}))}}for(let r in s)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let s=this.values.get(e);t!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return void 0===s&&void 0!==t&&(s=rR(null===t?void 0:t,{owner:this}),this.addValue(e,s)),s}readValue(e,t){let s=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];if(null!=s){let r,a;if("string"==typeof s&&(r=s,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(r)||(a=s,/^0[^.\s]+$/u.test(a))))s=parseFloat(s);else{let r;r=s,!r$.find(sW(r))&&s_.test(t)&&(s=rN(e,t))}this.setBaseTarget(e,sU(s)?s.get():s)}return sU(s)?s.get():s}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let t,{initial:s}=this.props;if("string"==typeof s||"object"==typeof s){let r=rW(this.props,s,this.presenceContext?.custom);r&&(t=r[e])}if(s&&void 0!==t)return t;let r=this.getBaseTargetFromProps(this.props,e);return void 0===r||sU(r)?void 0!==this.initialValues[e]&&void 0===t?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new rE),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){rA.render(this.render)}}class rX extends rK{constructor(){super(...arguments),this.KeyframeResolver=rS}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){let s=e.style;return s?s[t]:void 0}removeValueFromRenderState(e,{vars:t,style:s}){delete t[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;sU(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function rZ(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}let rJ=(e,t)=>t&&"number"==typeof e?t.transform(e):e,rQ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},r0=se.length;function r1(e,t,s){let{style:r,vars:a,transformOrigin:i}=e,n=!1,o=!1;for(let e in t){let s=t[e];if(st.has(e)){n=!0;continue}if(sJ(e)){a[e]=s;continue}{let t=rJ(s,sL[e]);e.startsWith("origin")?(o=!0,i[e]=t):r[e]=t}}if(!t.transform&&(n||s?r.transform=function(e,t,s){let r="",a=!0;for(let i=0;i<r0;i++){let n=se[i],o=e[n];if(void 0===o)continue;let l=!0;if(!(l="number"==typeof o?o===+!!n.startsWith("scale"):0===parseFloat(o))||s){let e=rJ(o,sL[n]);if(!l){a=!1;let t=rQ[n]||n;r+=`${t}(${e}) `}s&&(t[n]=e)}}return r=r.trim(),s?r=s(t,a?"":r):a&&(r="none"),r}(t,e.transform,s):r.transform&&(r.transform="none")),o){let{originX:e="50%",originY:t="50%",originZ:s=0}=i;r.transformOrigin=`${e} ${t} ${s}`}}let r2={offset:"stroke-dashoffset",array:"stroke-dasharray"},r5={offset:"strokeDashoffset",array:"strokeDasharray"},r3=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function r4(e,{attrX:t,attrY:s,attrScale:r,pathLength:a,pathSpacing:i=1,pathOffset:n=0,...o},l,c,d){if(r1(e,o,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:u,style:h}=e;for(let e of(u.transform&&(h.transform=u.transform,delete u.transform),(h.transform||u.transformOrigin)&&(h.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),h.transform&&(h.transformBox=d?.transformBox??"fill-box",delete u.transformBox),r3))void 0!==u[e]&&(h[e]=u[e],delete u[e]);void 0!==t&&(u.x=t),void 0!==s&&(u.y=s),void 0!==r&&(u.scale=r),void 0!==a&&function(e,t,s=1,r=0,a=!0){e.pathLength=1;let i=a?r2:r5;e[i.offset]=sg.transform(-r);let n=sg.transform(t),o=sg.transform(s);e[i.array]=`${n} ${o}`}(u,a,i,n,!1)}let r7=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),r9=e=>"string"==typeof e&&"svg"===e.toLowerCase();function r8(e,{style:t,vars:s},r,a){let i,n=e.style;for(i in t)n[i]=t[i];for(i in a?.applyProjectionStyles(n,r),s)n.setProperty(i,s[i])}function r6(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let ae={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e)if(!sg.test(e))return e;else e=parseFloat(e);let s=r6(e,t.target.x),r=r6(e,t.target.y);return`${s}% ${r}%`}},at=(e,t,s)=>e+(t-e)*s,as={borderRadius:{...ae,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ae,borderTopRightRadius:ae,borderBottomLeftRadius:ae,borderBottomRightRadius:ae,boxShadow:{correct:(e,{treeScale:t,projectionDelta:s})=>{let r=s_.parse(e);if(r.length>5)return e;let a=s_.createTransformer(e),i=+("number"!=typeof r[0]),n=s.x.scale*t.x,o=s.y.scale*t.y;r[0+i]/=n,r[1+i]/=o;let l=at(n,o,.5);return"number"==typeof r[2+i]&&(r[2+i]/=l),"number"==typeof r[3+i]&&(r[3+i]/=l),a(r)}}};function ar(e,{layout:t,layoutId:s}){return st.has(e)||e.startsWith("origin")||(t||void 0!==s)&&(!!as[e]||"opacity"===e)}function aa(e,t,s){let r=e.style,a=t?.style,i={};if(!r)return i;for(let t in r)(sU(r[t])||a&&sU(a[t])||ar(t,e)||s?.getValue(t)?.liveStyle!==void 0)&&(i[t]=r[t]);return i}function ai(e,t,s){let r=aa(e,t,s);for(let s in e)(sU(e[s])||sU(t[s]))&&(r[-1!==se.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=e[s]);return r}class an extends rX{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=sG}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(st.has(t)){let e=sI(t);return e&&e.default||0}return t=r7.has(t)?t:rZ(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,s){return ai(e,t,s)}build(e,t,s){r4(e,t,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,t,s,r){for(let s in r8(e,t,void 0,r),t.attrs)e.setAttribute(r7.has(s)?s:rZ(s),t.attrs[s])}mount(e){this.isSVGTag=r9(e.tagName),super.mount(e)}}function ao({top:e,left:t,right:s,bottom:r}){return{x:{min:t,max:s},y:{min:e,max:r}}}function al(e){return void 0===e||1===e}function ac({scale:e,scaleX:t,scaleY:s}){return!al(e)||!al(t)||!al(s)}function ad(e){return ac(e)||au(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function au(e){var t,s;return(t=e.x)&&"0%"!==t||(s=e.y)&&"0%"!==s}function ah(e,t,s,r,a){return void 0!==a&&(e=r+a*(e-r)),r+s*(e-r)+t}function af(e,t=0,s=1,r,a){e.min=ah(e.min,t,s,r,a),e.max=ah(e.max,t,s,r,a)}function am(e,{x:t,y:s}){af(e.x,t.translate,t.scale,t.originPoint),af(e.y,s.translate,s.scale,s.originPoint)}function ap(e,t){e.min=e.min+t,e.max=e.max+t}function ax(e,t,s,r,a=.5){let i=at(e.min,e.max,a);af(e,t,s,i,r)}function ag(e,t){ax(e.x,t.x,t.scaleX,t.scale,t.originX),ax(e.y,t.y,t.scaleY,t.scale,t.originY)}function ab(e,t){return ao(function(e,t){if(!t)return e;let s=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}class ay extends rX{constructor(){super(...arguments),this.type="html",this.renderInstance=r8}readValueFromInstance(e,t){if(st.has(t))return this.projection?.isProjecting?rt(t):((e,t)=>{let{transform:s="none"}=getComputedStyle(e);return rs(s,t)})(e,t);{let s=window.getComputedStyle(e),r=(sJ(t)?s.getPropertyValue(t):s[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return ab(e,t)}build(e,t,s){r1(e,t,s.transformTemplate)}scrapeMotionValuesFromProps(e,t,s){return aa(e,t,s)}}let av=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function aw(e){if("string"!=typeof e||e.includes("-"));else if(av.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}let aj=(0,u.createContext)({strict:!1}),aN=(0,u.createContext)({});function ak(e){return Array.isArray(e)?e.join(" "):e}let aS=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function aT(e,t,s){for(let r in t)sU(t[r])||ar(r,s)||(e[r]=t[r])}let aC=()=>({...aS(),attrs:{}}),aE=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function aA(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||aE.has(e)}let aP=e=>!aA(e);try{o=(()=>{let e=Error("Cannot find module '@emotion/is-prop-valid'");throw e.code="MODULE_NOT_FOUND",e})().default,"function"==typeof o&&(aP=e=>e.startsWith("on")?!aA(e):o(e))}catch{}function a_(e){return sU(e)?e.get():e}let aM=e=>(t,s)=>{let r=(0,u.useContext)(aN),a=(0,u.useContext)(tX),i=()=>(function({scrapeMotionValuesFromProps:e,createRenderState:t},s,r,a){return{latestValues:function(e,t,s,r){let a={},i=r(e,{});for(let e in i)a[e]=a_(i[e]);let{initial:n,animate:o}=e,l=rG(e),c=rU(e);t&&c&&!l&&!1!==e.inherit&&(void 0===n&&(n=t.initial),void 0===o&&(o=t.animate));let d=!!s&&!1===s.initial,u=(d=d||!1===n)?o:n;if(u&&"boolean"!=typeof u&&!rI(u)){let t=Array.isArray(u)?u:[u];for(let s=0;s<t.length;s++){let r=rW(e,t[s]);if(r){let{transitionEnd:e,transition:t,...s}=r;for(let e in s){let t=s[e];if(Array.isArray(t)){let e=d?t.length-1:0;t=t[e]}null!==t&&(a[e]=t)}for(let t in e)a[t]=e[t]}}}return a}(s,r,a,e),renderState:t()}})(e,t,r,a);return s?i():tq(i)},aR=aM({scrapeMotionValuesFromProps:aa,createRenderState:aS}),a$=aM({scrapeMotionValuesFromProps:ai,createRenderState:aC}),aO={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},aD=!1;function aL(){return!function(){if(aD)return;let e={};for(let t in aO)e[t]={isEnabled:e=>aO[t].some(t=>!!e[t])};rY=e,aD=!0}(),rY}let aB=Symbol.for("motionComponentSymbol"),aI="data-"+rZ("framerAppearId"),aF=(0,u.createContext)({});function aV(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function az(e,{forwardMotionProps:t=!1,type:s}={},r,a){r&&function(e){let t=aL();for(let s in e)t[s]={...t[s],...e[s]};rY=t}(r);let i=s?"svg"===s:aw(e),n=i?a$:aR;function o(s,r){var o;let l,c,h,f={...(0,u.useContext)(t0),...s,layoutId:function({layoutId:e}){let t=(0,u.useContext)(tW).id;return t&&void 0!==e?t+"-"+e:e}(s)},{isStatic:m}=f,p=function(e){let{initial:t,animate:s}=function(e,t){if(rG(e)){let{initial:t,animate:s}=e;return{initial:!1===t||rF(t)?t:void 0,animate:rF(s)?s:void 0}}return!1!==e.inherit?t:{}}(e,(0,u.useContext)(aN));return(0,u.useMemo)(()=>({initial:t,animate:s}),[ak(t),ak(s)])}(s),x=n(s,m);if(!m&&tY){(0,u.useContext)(aj).strict;let t=function(e){let{drag:t,layout:s}=aL();if(!t&&!s)return{};let r={...t,...s};return{MeasureLayout:t?.isEnabled(e)||s?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(f);l=t.MeasureLayout,p.visualElement=function(e,t,s,r,a,i){let{visualElement:n}=(0,u.useContext)(aN),o=(0,u.useContext)(aj),l=(0,u.useContext)(tX),c=(0,u.useContext)(t0).reducedMotion,d=(0,u.useRef)(null);r=r||o.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:n,props:s,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:c,isSVG:i}));let h=d.current,f=(0,u.useContext)(aF);h&&!h.projection&&a&&("html"===h.type||"svg"===h.type)&&function(e,t,s,r){let{layoutId:a,layout:i,drag:n,dragConstraints:o,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:a,layout:i,alwaysMeasureLayout:!!n||o&&aV(o),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}(d.current,s,a,f);let m=(0,u.useRef)(!1);(0,u.useInsertionEffect)(()=>{h&&m.current&&h.update(s,l)});let p=s[aI],x=(0,u.useRef)(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return tK(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),x.current&&h.animationState&&h.animationState.animateChanges())}),(0,u.useEffect)(()=>{h&&(!x.current&&h.animationState&&h.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p)}),x.current=!1),h.enteringChildren=void 0)}),h}(e,x,f,a,t.ProjectionNode,i)}return(0,d.jsxs)(aN.Provider,{value:p,children:[l&&p.visualElement?(0,d.jsx)(l,{visualElement:p.visualElement,...f}):null,function(e,t,s,{latestValues:r},a,i=!1,n){let o=(n??aw(e)?function(e,t,s,r){let a=(0,u.useMemo)(()=>{let s=aC();return r4(s,t,r9(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){let t={};aT(t,e.style,e),a.style={...t,...a.style}}return a}:function(e,t){let s,r,a={},i=(s=e.style||{},aT(r={},s,e),Object.assign(r,function({transformTemplate:e},t){return(0,u.useMemo)(()=>{let s=aS();return r1(s,t,e),Object.assign({},s.vars,s.style)},[t])}(e,t)),r);return e.drag&&!1!==e.dragListener&&(a.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=i,a})(t,r,a,e),l=function(e,t,s){let r={};for(let a in e)("values"!==a||"object"!=typeof e.values)&&(aP(a)||!0===s&&aA(a)||!t&&!aA(a)||e.draggable&&a.startsWith("onDrag"))&&(r[a]=e[a]);return r}(t,"string"==typeof e,i),c=e!==u.Fragment?{...l,...o,ref:s}:{},{children:d}=t,h=(0,u.useMemo)(()=>sU(d)?d.get():d,[d]);return(0,u.createElement)(e,{...c,children:h})}(e,s,(o=p.visualElement,c=(0,u.useRef)(r),(0,u.useInsertionEffect)(()=>{c.current=r}),h=(0,u.useRef)(null),(0,u.useCallback)(e=>{e&&x.onMount?.(e),o&&(e?o.mount(e):o.unmount());let t=c.current;if("function"==typeof t)if(e){let s=t(e);"function"==typeof s&&(h.current=s)}else h.current?(h.current(),h.current=null):t(e);else t&&(t.current=e)},[o])),x,m,t,i)]})}o.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;let l=(0,u.forwardRef)(o);return l[aB]=e,l}class aG{constructor(e){this.isMounted=!1,this.node=e}update(){}}function aU(e,t,s){let r=e.getProps();return rW(r,t,void 0!==s?s:r.custom,e)}function aH(e,t){return e?.[t]??e?.default??e}let aW=e=>Array.isArray(e);function aq(e,t){let s=e.getValue("willChange");if(sU(s)&&s.add)return s.add(t);if(!s&&rc.WillChange){let s=new rc.WillChange("auto");e.addValue("willChange",s),s.add(t)}}let aY=e=>1e3*e,aK=(e,t)=>s=>t(e(s)),aX=(...e)=>e.reduce(aK),aZ={layout:0,mainThread:0,waapi:0};function aJ(e,t,s){return(s<0&&(s+=1),s>1&&(s-=1),s<1/6)?e+(t-e)*6*s:s<.5?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function aQ(e,t){return s=>s>0?t:e}let a0=(e,t,s)=>{let r=e*e,a=s*(t*t-r)+r;return a<0?0:Math.sqrt(a)},a1=[sf,sh,sw];function a2(e){let t=a1.find(t=>t.test(e));if(sK(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let s=t.parse(e);return t===sw&&(s=function({hue:e,saturation:t,lightness:s,alpha:r}){e/=360,s/=100;let a=0,i=0,n=0;if(t/=100){let r=s<.5?s*(1+t):s+t-s*t,o=2*s-r;a=aJ(o,r,e+1/3),i=aJ(o,r,e),n=aJ(o,r,e-1/3)}else a=i=n=s;return{red:Math.round(255*a),green:Math.round(255*i),blue:Math.round(255*n),alpha:r}}(s)),s}let a5=(e,t)=>{let s=a2(e),r=a2(t);if(!s||!r)return aQ(e,t);let a={...s};return e=>(a.red=a0(s.red,r.red,e),a.green=a0(s.green,r.green,e),a.blue=a0(s.blue,r.blue,e),a.alpha=at(s.alpha,r.alpha,e),sh.transform(a))},a3=new Set(["none","hidden"]);function a4(e,t){return s=>at(e,t,s)}function a7(e){return"number"==typeof e?a4:"string"==typeof e?s0(e)?aQ:sj.test(e)?a5:a6:Array.isArray(e)?a9:"object"==typeof e?sj.test(e)?a5:a8:aQ}function a9(e,t){let s=[...e],r=s.length,a=e.map((e,s)=>a7(e)(e,t[s]));return e=>{for(let t=0;t<r;t++)s[t]=a[t](e);return s}}function a8(e,t){let s={...e,...t},r={};for(let a in s)void 0!==e[a]&&void 0!==t[a]&&(r[a]=a7(e[a])(e[a],t[a]));return e=>{for(let t in r)s[t]=r[t](e);return s}}let a6=(e,t)=>{let s=s_.createTransformer(t),r=sC(e),a=sC(t);if(!(r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length))return sK(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),aQ(e,t);if(a3.has(e)&&!a.values.length||a3.has(t)&&!r.values.length)return a3.has(e)?s=>s<=0?e:t:s=>s>=1?t:e;return aX(a9(function(e,t){let s=[],r={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){let i=t.types[a],n=e.indexes[i][r[i]],o=e.values[n]??0;s[a]=o,r[i]++}return s}(r,a),a.values),s)};function ie(e,t,s){return"number"==typeof e&&"number"==typeof t&&"number"==typeof s?at(e,t,s):a7(e)(e,t)}let it=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>rh.update(t,e),stop:()=>rf(t),now:()=>rm.isProcessing?rm.timestamp:r_.now()}},is=(e,t,s=10)=>{let r="",a=Math.max(Math.round(t/s),2);for(let t=0;t<a;t++)r+=Math.round(1e4*e(t/(a-1)))/1e4+", ";return`linear(${r.substring(0,r.length-2)})`};function ir(e){let t=0,s=e.next(t);for(;!s.done&&t<2e4;)t+=50,s=e.next(t);return t>=2e4?1/0:t}function ia(e,t,s){var r,a;let i=Math.max(t-5,0);return r=s-e(i),(a=t-i)?1e3/a*r:0}let ii=.01,io=2,il=.005,ic=.5;function id(e,t){return e*Math.sqrt(1-t*t)}let iu=["duration","bounce"],ih=["stiffness","damping","mass"];function im(e,t){return t.some(t=>void 0!==e[t])}function ip(e=.3,t=.3){let s,r="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:a,restDelta:i}=r,n=r.keyframes[0],o=r.keyframes[r.keyframes.length-1],l={done:!1,value:n},{stiffness:c,damping:d,mass:u,duration:h,velocity:f,isResolvedFromDuration:m}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!im(e,ih)&&im(e,iu))if(e.visualDuration){let s=2*Math.PI/(1.2*e.visualDuration),r=s*s,a=2*ss(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:1,stiffness:r,damping:a}}else{let s=function({duration:e=800,bounce:t=.3,velocity:s=0,mass:r=1}){let a,i;sK(e<=aY(10),"Spring duration must be 10 seconds or less","spring-duration-limit");let n=1-t;n=ss(.05,1,n),e=ss(.01,10,e/1e3),n<1?(a=t=>{let r=t*n,a=r*e;return .001-(r-s)/id(t,n)*Math.exp(-a)},i=t=>{let r=t*n*e,i=Math.pow(n,2)*Math.pow(t,2)*e,o=Math.exp(-r),l=id(Math.pow(t,2),n);return(r*s+s-i)*o*(-a(t)+.001>0?-1:1)/l}):(a=t=>-.001+Math.exp(-t*e)*((t-s)*e+1),i=t=>e*e*(s-t)*Math.exp(-t*e));let o=function(e,t,s){let r=s;for(let s=1;s<12;s++)r-=e(r)/t(r);return r}(a,i,5/e);if(e=aY(e),isNaN(o))return{stiffness:100,damping:10,duration:e};{let t=Math.pow(o,2)*r;return{stiffness:t,damping:2*n*Math.sqrt(r*t),duration:e}}}(e);(t={...t,...s,mass:1}).isResolvedFromDuration=!0}return t}({...r,velocity:-((r.velocity||0)/1e3)}),p=f||0,x=d/(2*Math.sqrt(c*u)),g=o-n,b=Math.sqrt(c/u)/1e3,y=5>Math.abs(g);if(a||(a=y?ii:io),i||(i=y?il:ic),x<1){let e=id(b,x);s=t=>o-Math.exp(-x*b*t)*((p+x*b*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(1===x)s=e=>o-Math.exp(-b*e)*(g+(p+b*g)*e);else{let e=b*Math.sqrt(x*x-1);s=t=>{let s=Math.exp(-x*b*t),r=Math.min(e*t,300);return o-s*((p+x*b*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}let v={calculatedDuration:m&&h||null,next:e=>{let t=s(e);if(m)l.done=e>=h;else{let r=0===e?p:0;x<1&&(r=0===e?aY(p):ia(s,e,t));let n=Math.abs(o-t)<=i;l.done=Math.abs(r)<=a&&n}return l.value=l.done?o:t,l},toString:()=>{let e=Math.min(ir(v),2e4),t=is(t=>v.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return v}function ix({keyframes:e,velocity:t=0,power:s=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:i=500,modifyTarget:n,min:o,max:l,restDelta:c=.5,restSpeed:d}){let u,h,f=e[0],m={done:!1,value:f},p=s*t,x=f+p,g=void 0===n?x:n(x);g!==x&&(p=g-f);let b=e=>-p*Math.exp(-e/r),y=e=>g+b(e),v=e=>{let t=b(e),s=y(e);m.done=Math.abs(t)<=c,m.value=m.done?g:s},w=e=>{let t;if(t=m.value,void 0!==o&&t<o||void 0!==l&&t>l){var s;u=e,h=ip({keyframes:[m.value,(s=m.value,void 0===o?l:void 0===l||Math.abs(o-s)<Math.abs(l-s)?o:l)],velocity:ia(y,e,m.value),damping:a,stiffness:i,restDelta:c,restSpeed:d})}};return w(0),{calculatedDuration:null,next:e=>{let t=!1;return(h||void 0!==u||(t=!0,v(e),w(e)),void 0!==u&&e>=u)?h.next(e-u):(t||v(e),m)}}}ip.applyToOptions=e=>{let t=function(e,t=100,s){let r=s({...e,keyframes:[0,t]}),a=Math.min(ir(r),2e4);return{type:"keyframes",ease:e=>r.next(a*e).value/t,duration:a/1e3}}(e,100,ip);return e.ease=t.ease,e.duration=aY(t.duration),e.type="keyframes",e};let ig=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e;function ib(e,t,s,r){return e===t&&s===r?rl:a=>0===a||1===a?a:ig(function(e,t,s,r,a){let i,n,o=0;do(i=ig(n=t+(s-t)/2,r,a)-e)>0?s=n:t=n;while(Math.abs(i)>1e-7&&++o<12)return n}(a,0,1,e,s),t,r)}let iy=ib(.42,0,1,1),iv=ib(0,0,.58,1),iw=ib(.42,0,.58,1),ij=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,iN=e=>t=>1-e(1-t),ik=ib(.33,1.53,.69,.99),iS=iN(ik),iT=ij(iS),iC=e=>(e*=2)<1?.5*iS(e):.5*(2-Math.pow(2,-10*(e-1))),iE=e=>1-Math.sin(Math.acos(e)),iA=iN(iE),iP=ij(iE),i_=e=>Array.isArray(e)&&"number"==typeof e[0],iM={linear:rl,easeIn:iy,easeInOut:iw,easeOut:iv,circIn:iE,circInOut:iP,circOut:iA,backIn:iS,backInOut:iT,backOut:ik,anticipate:iC},iR=e=>{if(i_(e)){sX(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,s,r,a]=e;return ib(t,s,r,a)}return"string"==typeof e?(sX(void 0!==iM[e],`Invalid easing type '${e}'`,"invalid-easing-type"),iM[e]):e},i$=(e,t,s)=>{let r=t-e;return 0===r?1:(s-e)/r};function iO({duration:e=300,keyframes:t,times:s,ease:r="easeInOut"}){var a;let i,n=Array.isArray(r)&&"number"!=typeof r[0]?r.map(iR):iR(r),o={done:!1,value:t[0]},l=function(e,t,{clamp:s=!0,ease:r,mixer:a}={}){let i=e.length;if(sX(i===t.length,"Both input and output ranges must be the same length","range-length"),1===i)return()=>t[0];if(2===i&&t[0]===t[1])return()=>t[1];let n=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());let o=function(e,t,s){let r=[],a=s||rc.mix||ie,i=e.length-1;for(let s=0;s<i;s++){let i=a(e[s],e[s+1]);t&&(i=aX(Array.isArray(t)?t[s]||rl:t,i)),r.push(i)}return r}(t,r,a),l=o.length,c=s=>{if(n&&s<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(s<e[r+1]);r++);let a=i$(e[r],e[r+1],s);return o[r](a)};return s?t=>c(ss(e[0],e[i-1],t)):c}((a=s&&s.length===t.length?s:(!function(e,t){let s=e[e.length-1];for(let r=1;r<=t;r++){let a=i$(0,t,r);e.push(at(s,1,a))}}(i=[0],t.length-1),i),a.map(t=>t*e)),t,{ease:Array.isArray(n)?n:t.map(()=>n||iw).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(o.value=l(t),o.done=t>=e,o)}}let iD=e=>null!==e;function iL(e,{repeat:t,repeatType:s="loop"},r,a=1){let i=e.filter(iD),n=a<0||t&&"loop"!==s&&t%2==1?0:i.length-1;return n&&void 0!==r?r:i[n]}let iB={decay:ix,inertia:ix,tween:iO,keyframes:iO,spring:ip};function iI(e){"string"==typeof e.type&&(e.type=iB[e.type])}class iF{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}let iV=e=>e/100;class iz extends iF{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==r_.now()&&this.tick(r_.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},aZ.mainThread++,this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){let{options:e}=this;iI(e);let{type:t=iO,repeat:s=0,repeatDelay:r=0,repeatType:a,velocity:i=0}=e,{keyframes:n}=e,o=t||iO;o!==iO&&"number"!=typeof n[0]&&(this.mixKeyframes=aX(iV,ie(n[0],n[1])),n=[0,100]);let l=o({...e,keyframes:n});"mirror"===a&&(this.mirroredGenerator=o({...e,keyframes:[...n].reverse(),velocity:-i})),null===l.calculatedDuration&&(l.calculatedDuration=ir(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=l}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){let{generator:s,totalDuration:r,mixKeyframes:a,mirroredGenerator:i,resolvedDuration:n,calculatedDuration:o}=this;if(null===this.startTime)return s.next(0);let{delay:l=0,keyframes:c,repeat:d,repeatType:u,repeatDelay:h,type:f,onUpdate:m,finalKeyframe:p}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let x=this.currentTime-l*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?x<0:x>r;this.currentTime=Math.max(x,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);let b=this.currentTime,y=s;if(d){let e=Math.min(this.currentTime,r)/n,t=Math.floor(e),s=e%1;!s&&e>=1&&(s=1),1===s&&t--,(t=Math.min(t,d+1))%2&&("reverse"===u?(s=1-s,h&&(s-=h/n)):"mirror"===u&&(y=i)),b=ss(0,1,s)*n}let v=g?{done:!1,value:c[0]}:y.next(b);a&&(v.value=a(v.value));let{done:w}=v;g||null===o||(w=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let j=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return j&&f!==ix&&(v.value=iL(c,this.options,p,this.speed)),m&&m(v.value),j&&this.finish(),v}then(e,t){return this.finished.then(e,t)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return this.currentTime/1e3}set time(e){e=aY(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(r_.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:e=it,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();let s=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=s):null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime||(this.startTime=t??s),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(r_.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,aZ.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function iG(e){let t;return()=>(void 0===t&&(t=e()),t)}let iU=iG(()=>void 0!==window.ScrollTimeline),iH={},iW=(a=iG(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0}),()=>iH.linearEasing??a()),iq=([e,t,s,r])=>`cubic-bezier(${e}, ${t}, ${s}, ${r})`,iY={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:iq([0,.65,.55,1]),circOut:iq([.55,0,1,.45]),backIn:iq([.31,.01,.66,-.59]),backOut:iq([.33,1.53,.69,.99])};function iK(e){return"function"==typeof e&&"applyToOptions"in e}class iX extends iF{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:s,keyframes:r,pseudoElement:a,allowFlatten:i=!1,finalKeyframe:n,onComplete:o}=e;this.isPseudoElement=!!a,this.allowFlatten=i,this.options=e,sX("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:e,...t}){return iK(e)&&iW()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=function(e,t,s,{delay:r=0,duration:a=300,repeat:i=0,repeatType:n="loop",ease:o="easeOut",times:l}={},c){let d={[t]:s};l&&(d.offset=l);let u=function e(t,s){if(t)return"function"==typeof t?iW()?is(t,s):"ease-out":i_(t)?iq(t):Array.isArray(t)?t.map(t=>e(t,s)||iY.easeOut):iY[t]}(o,a);Array.isArray(u)&&(d.easing=u);let h={delay:r,duration:a,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===n?"alternate":"normal"};c&&(h.pseudoElement=c);let f=e.animate(d,h);return f}(t,s,r,l,a),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){let e=iL(r,this.options,n,this.speed);this.updateMotionValue?this.updateMotionValue(e):s.startsWith("--")?t.style.setProperty(s,e):t.style[s]=e,this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=aY(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&iU())?(this.animation.timeline=e,rl):t(this)}}let iZ={anticipate:iC,backInOut:iT,circInOut:iP};class iJ extends iX{constructor(e){!function(e){"string"==typeof e.ease&&e.ease in iZ&&(e.ease=iZ[e.ease])}(e),iI(e),super(e),void 0!==e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:s,onComplete:r,element:a,...i}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);let n=new iz({...i,autoplay:!1}),o=Math.max(10,r_.now()-this.startTime),l=ss(0,10,o-10);t.setWithVelocity(n.sample(Math.max(0,o-l)).value,n.sample(o).value,l),n.stop()}}let iQ=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(s_.test(e)||"0"===e)&&!e.startsWith("url("));function i0(e){e.duration=0,e.type="keyframes"}let i1=new Set(["opacity","clipPath","filter","transform"]),i2=iG(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class i5 extends iF{constructor({autoplay:e=!0,delay:t=0,type:s="keyframes",repeat:r=0,repeatDelay:a=0,repeatType:i="loop",keyframes:n,name:o,motionValue:l,element:c,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=r_.now();const u={autoplay:e,delay:t,type:s,repeat:r,repeatDelay:a,repeatType:i,name:o,motionValue:l,element:c,...d},h=c?.KeyframeResolver||rj;this.keyframeResolver=new h(n,(e,t,s)=>this.onKeyframesResolved(e,t,u,!s),o,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,s,r){this.keyframeResolver=void 0;let{name:a,type:i,velocity:n,delay:o,isHandoff:l,onUpdate:c}=s;this.resolvedAt=r_.now(),!function(e,t,s,r){let a=e[0];if(null===a)return!1;if("display"===t||"visibility"===t)return!0;let i=e[e.length-1],n=iQ(a,t),o=iQ(i,t);return sK(n===o,`You are trying to animate ${t} from "${a}" to "${i}". "${n?i:a}" is not an animatable value.`,"value-not-animatable"),!!n&&!!o&&(function(e){let t=e[0];if(1===e.length)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}(e)||("spring"===s||iK(s))&&r)}(e,a,i,n)&&((rc.instantAnimations||!o)&&c?.(iL(e,s,t)),e[0]=e[e.length-1],i0(s),s.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...s,keyframes:e},u=!l&&function(e){let{motionValue:t,name:s,repeatDelay:r,repeatType:a,damping:i,type:n}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:o,transformTemplate:l}=t.owner.getProps();return i2()&&s&&i1.has(s)&&("transform"!==s||!l)&&!o&&!r&&"mirror"!==a&&0!==i&&"inertia"!==n}(d)?new iJ({...d,element:d.motionValue.owner.current}):new iz(d);u.finished.then(()=>this.notifyFinished()).catch(rl),this.pendingTimeline&&(this.stopTimeline=u.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=u}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ry=!0,rw(),rv(),ry=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let i3={type:"spring",stiffness:500,damping:25,restSpeed:10},i4={type:"keyframes",duration:.8},i7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},i9=e=>null!==e,i8=(e,t,s,r={},a,i)=>n=>{let o=aH(r,e)||{},l=o.delay||r.delay||0,{elapsed:c=0}=r;c-=aY(l);let d={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{n(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:i?void 0:a};!function({when:e,delay:t,delayChildren:s,staggerChildren:r,staggerDirection:a,repeat:i,repeatType:n,repeatDelay:o,from:l,elapsed:c,...d}){return!!Object.keys(d).length}(o)&&Object.assign(d,((e,{keyframes:t})=>t.length>2?i4:st.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:i3:i7)(e,d)),d.duration&&(d.duration=aY(d.duration)),d.repeatDelay&&(d.repeatDelay=aY(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let u=!1;if(!1!==d.type&&(0!==d.duration||d.repeatDelay)||(i0(d),0===d.delay&&(u=!0)),(rc.instantAnimations||rc.skipAnimations)&&(u=!0,i0(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,u&&!i&&void 0!==t.get()){let e=function(e,{repeat:t,repeatType:s="loop"},r){let a=e.filter(i9),i=t&&"loop"!==s&&t%2==1?0:a.length-1;return a[i]}(d.keyframes,o);if(void 0!==e)return void rh.update(()=>{d.onUpdate(e),d.onComplete()})}return o.isSync?new iz(d):new i5(d)};function i6(e,t,{delay:s=0,transitionOverride:r,type:a}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:n,...o}=t;r&&(i=r);let l=[],c=a&&e.animationState&&e.animationState.getState()[a];for(let t in o){let r=e.getValue(t,e.latestValues[t]??null),a=o[t];if(void 0===a||c&&function({protectedKeys:e,needsAnimating:t},s){let r=e.hasOwnProperty(s)&&!0!==t[s];return t[s]=!1,r}(c,t))continue;let n={delay:s,...aH(i||{},t)},d=r.get();if(void 0!==d&&!r.isAnimating&&!Array.isArray(a)&&a===d&&!n.velocity)continue;let u=!1;if(window.MotionHandoffAnimation){let s=e.props[aI];if(s){let e=window.MotionHandoffAnimation(s,t,rh);null!==e&&(n.startTime=e,u=!0)}}aq(e,t),r.start(i8(t,r,a,e.shouldReduceMotion&&sH.has(t)?{type:!1}:n,e,u));let h=r.animation;h&&l.push(h)}return n&&Promise.all(l).then(()=>{rh.update(()=>{n&&function(e,t){let{transitionEnd:s={},transition:r={},...a}=aU(e,t)||{};for(let t in a={...a,...s}){var i;let s=aW(i=a[t])?i[i.length-1]||0:i;e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,rR(s))}}(e,n)})}),l}function ne(e,t,s,r=0,a=1){let i=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),n=e.size,o=(n-1)*r;return"function"==typeof s?s(i,n):1===a?i*r:o-i*r}function nt(e,t,s={}){let r=aU(e,t,"exit"===s.type?e.presenceContext?.custom:void 0),{transition:a=e.getDefaultTransition()||{}}=r||{};s.transitionOverride&&(a=s.transitionOverride);let i=r?()=>Promise.all(i6(e,r,s)):()=>Promise.resolve(),n=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:i=0,staggerChildren:n,staggerDirection:o}=a;return function(e,t,s=0,r=0,a=0,i=1,n){let o=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),o.push(nt(l,t,{...n,delay:s+("function"==typeof r?0:r)+ne(e.variantChildren,l,r,a,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(o)}(e,t,r,i,n,o,s)}:()=>Promise.resolve(),{when:o}=a;if(!o)return Promise.all([i(),n(s.delay)]);{let[e,t]="beforeChildren"===o?[i,n]:[n,i];return e().then(()=>t())}}let ns=rz.length;function nr(e,t){if(!Array.isArray(t))return!1;let s=t.length;if(s!==e.length)return!1;for(let r=0;r<s;r++)if(t[r]!==e[r])return!1;return!0}let na=[...rV].reverse(),ni=rV.length;function nn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function no(){return{animate:nn(!0),whileInView:nn(),whileHover:nn(),whileTap:nn(),whileDrag:nn(),whileFocus:nn(),exit:nn()}}let nl=0;function nc(e){return[e("x"),e("y")]}let nd=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function nu(e){return nd.has(e.tagName)||!0===e.isContentEditable}function nh(e,t,s,r={passive:!0}){return e.addEventListener(t,s,r),()=>e.removeEventListener(t,s)}let nf={x:!1,y:!1};function nm(e){return e.max-e.min}function np(e,t,s,r=.5){e.origin=r,e.originPoint=at(t.min,t.max,e.origin),e.scale=nm(s)/nm(t),e.translate=at(s.min,s.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function nx(e,t,s,r){np(e.x,t.x,s.x,r?r.originX:void 0),np(e.y,t.y,s.y,r?r.originY:void 0)}function ng(e,t,s){e.min=s.min+t.min,e.max=e.min+nm(t)}function nb(e,t,s){e.min=t.min-s.min,e.max=e.min+nm(t)}function ny(e,t,s){nb(e.x,t.x,s.x),nb(e.y,t.y,s.y)}let nv=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function nw(e){return{point:{x:e.pageX,y:e.pageY}}}function nj(e,t,s,r){return nh(e,t,e=>nv(e)&&s(e,nw(e)),r)}let nN=({current:e})=>e?e.ownerDocument.defaultView:null,nk=(e,t)=>Math.abs(e-t),nS=new Set(["auto","scroll"]);class nT{constructor(e,t,{transformPagePoint:s,contextWindow:r=window,dragSnapToOrigin:a=!1,distanceThreshold:i=3,element:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let s=nA(this.lastMoveEventInfo,this.history),r=null!==this.startEvent,a=(e=s.offset,t={x:0,y:0},Math.sqrt(nk(e.x,t.x)**2+nk(e.y,t.y)**2)>=this.distanceThreshold);if(!r&&!a)return;let{point:i}=s,{timestamp:n}=rm;this.history.push({...i,timestamp:n});let{onStart:o,onMove:l}=this.handlers;r||(o&&o(this.lastMoveEvent,s),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,s)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=nC(t,this.transformPagePoint),rh.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:s,onSessionEnd:r,resumeAnimation:a}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&a&&a(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let i=nA("pointercancel"===e.type?this.lastMoveEventInfo:nC(t,this.transformPagePoint),this.history);this.startEvent&&s&&s(e,i),r&&r(e,i)},!nv(e))return;this.dragSnapToOrigin=a,this.handlers=t,this.transformPagePoint=s,this.distanceThreshold=i,this.contextWindow=r||window;const o=nC(nw(e),this.transformPagePoint),{point:l}=o,{timestamp:c}=rm;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=t;d&&d(e,nA(o,this.history)),this.removeListeners=aX(nj(this.contextWindow,"pointermove",this.handlePointerMove),nj(this.contextWindow,"pointerup",this.handlePointerUp),nj(this.contextWindow,"pointercancel",this.handlePointerUp)),n&&this.startScrollTracking(n)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(nS.has(e.overflowX)||nS.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let s=e===window,r=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},a={x:r.x-t.x,y:r.y-t.y};(0!==a.x||0!==a.y)&&(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(e,r),rh.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),rf(this.updatePoint)}}function nC(e,t){return t?{point:t(e.point)}:e}function nE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function nA({point:e},t){return{point:e,delta:nE(e,nP(t)),offset:nE(e,t[0]),velocity:function(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,r=null,a=nP(e);for(;s>=0&&(r=e[s],!(a.timestamp-r.timestamp>aY(.1)));)s--;if(!r)return{x:0,y:0};let i=(a.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};let n={x:(a.x-r.x)/i,y:(a.y-r.y)/i};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}(t,.1)}}function nP(e){return e[e.length-1]}function n_(e,t,s){return{min:void 0!==t?e.min+t:void 0,max:void 0!==s?e.max+s-(e.max-e.min):void 0}}function nM(e,t){let s=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,r]=[r,s]),{min:s,max:r}}function nR(e,t,s){return{min:n$(e,t),max:n$(e,s)}}function n$(e,t){return"number"==typeof e?e:e[t]||0}let nO=new WeakMap;class nD{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=sG(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:s}={}){let{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;let a=e=>{t?(this.stopAnimation(),this.snapToCursor(nw(e).point)):this.pauseAnimation()},i=(e,t)=>{this.stopAnimation();let{drag:s,dragPropagation:r,onDragStart:a}=this.getProps();if(s&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){if("x"===e||"y"===e)if(nf[e])return null;else return nf[e]=!0,()=>{nf[e]=!1};return nf.x||nf.y?null:(nf.x=nf.y=!0,()=>{nf.x=nf.y=!1})}(s),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),nc(e=>{let t=this.getAxisMotionValue(e).get()||0;if(sx.test(t)){let{projection:s}=this.visualElement;if(s&&s.layout){let r=s.layout.layoutBox[e];r&&(t=nm(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),a&&rh.postRender(()=>a(e,t)),aq(this.visualElement,"transform");let{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},n=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:s,dragDirectionLock:r,onDirectionLock:a,onDrag:i}=this.getProps();if(!s&&!this.openDragLock)return;let{offset:n}=t;if(r&&null===this.currentDirection){this.currentDirection=function(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}(n),null!==this.currentDirection&&a&&a(this.currentDirection);return}this.updateAxis("x",t.point,n),this.updateAxis("y",t.point,n),this.visualElement.render(),i&&i(e,t)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>nc(e=>"paused"===this.getAnimationState(e)&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new nT(e,{onSessionStart:a,onStart:i,onMove:n,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:nN(this.visualElement),element:this.visualElement.current})}stop(e,t){let s=e||this.latestPointerEvent,r=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!r||!s)return;let{velocity:i}=r;this.startAnimation(i);let{onDragEnd:n}=this.getProps();n&&rh.postRender(()=>n(s,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,s){let{drag:r}=this.getProps();if(!s||!nL(e,r,this.currentDirection))return;let a=this.getAxisMotionValue(e),i=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:s},r){return void 0!==t&&e<t?e=r?at(t,e,r.min):Math.max(e,t):void 0!==s&&e>s&&(e=r?at(s,e,r.max):Math.min(e,s)),e}(i,this.constraints[e],this.elastic[e])),a.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&aV(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=function(e,{top:t,left:s,bottom:r,right:a}){return{x:n_(e.x,s,a),y:n_(e.y,t,r)}}(s.layoutBox,e):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:nR(e,"left","right"),y:nR(e,"top","bottom")}}(t),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&nc(e=>{var t,r;let a;!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=(t=s.layoutBox[e],r=this.constraints[e],a={},void 0!==r.min&&(a.min=r.min-t.min),void 0!==r.max&&(a.max=r.max-t.min),a))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!aV(t))return!1;let r=t.current;sX(null!==r,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:a}=this.visualElement;if(!a||!a.layout)return!1;let i=function(e,t,s){let r=ab(e,s),{scroll:a}=t;return a&&(ap(r.x,a.offset.x),ap(r.y,a.offset.y)),r}(r,a.root,this.visualElement.getTransformPagePoint()),n=(e=a.layout.layoutBox,{x:nM(e.x,i.x),y:nM(e.y,i.y)});if(s){let e=s(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(n));this.hasMutatedConstraints=!!e,e&&(n=ao(e))}return n}startAnimation(e){let{drag:t,dragMomentum:s,dragElastic:r,dragTransition:a,dragSnapToOrigin:i,onDragTransitionEnd:n}=this.getProps(),o=this.constraints||{};return Promise.all(nc(n=>{if(!nL(n,t,this.currentDirection))return;let l=o&&o[n]||{};i&&(l={min:0,max:0});let c={type:"inertia",velocity:s?e[n]:0,bounceStiffness:r?200:1e6,bounceDamping:r?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(n,c)})).then(n)}startAxisValueAnimation(e,t){let s=this.getAxisMotionValue(e);return aq(this.visualElement,e),s.start(i8(e,s,0,t,this.visualElement,!1))}stopAnimation(){nc(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){nc(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps();return s[t]||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){nc(t=>{let{drag:s}=this.getProps();if(!nL(t,s,this.currentDirection))return;let{projection:r}=this.visualElement,a=this.getAxisMotionValue(t);if(r&&r.layout){let{min:s,max:i}=r.layout.layoutBox[t],n=a.get()||0;a.set(e[t]-at(s,i,.5)+n)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:s}=this.visualElement;if(!aV(t)||!s||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};nc(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){var s,a;let i,n,o,l=t.get();r[e]=(s={min:l,max:l},a=this.constraints[e],i=.5,n=nm(s),(o=nm(a))>n?i=i$(a.min,a.max-n,s.min):n>o&&(i=i$(s.min,s.max-o,a.min)),ss(0,1,i))}});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),nc(t=>{if(!nL(t,e,null))return;let s=this.getAxisMotionValue(t),{min:a,max:i}=this.constraints[t];s.set(at(a,i,r[t]))})}addListeners(){if(!this.visualElement.current)return;nO.set(this.visualElement,this);let e=nj(this.visualElement.current,"pointerdown",e=>{let{drag:t,dragListener:s=!0}=this.getProps();t&&s&&!nu(e.target)&&this.start(e)}),t=()=>{let{dragConstraints:e}=this.getProps();aV(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,r=s.addEventListener("measure",t);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),rh.read(t);let a=nh(window,"resize",()=>this.scalePositionWithinConstraints()),i=s.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(nc(t=>{let s=this.getAxisMotionValue(t);s&&(this.originPoint[t]+=e[t].translate,s.set(s.get()+e[t].translate))}),this.visualElement.render())});return()=>{a(),e(),r(),i&&i()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:s=!1,dragPropagation:r=!1,dragConstraints:a=!1,dragElastic:i=.35,dragMomentum:n=!0}=e;return{...e,drag:t,dragDirectionLock:s,dragPropagation:r,dragConstraints:a,dragElastic:i,dragMomentum:n}}}function nL(e,t,s){return(!0===t||t===e)&&(null===s||s===e)}let nB=e=>(t,s)=>{e&&rh.postRender(()=>e(t,s))},nI={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var nF=u;let nV=!1;class nz extends nF.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:s,layoutId:r}=this.props,{projection:a}=e;a&&(t.group&&t.group.add(a),s&&s.register&&r&&s.register(a),nV&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),nI.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:s,drag:r,isPresent:a}=this.props,{projection:i}=s;return i&&(i.isPresent=a,nV=!0,r||e.layoutDependency!==t||void 0===t||e.isPresent!==a?i.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?i.promote():i.relegate()||rh.postRender(()=>{let e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),rA.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:s}=this.props,{projection:r}=e;nV=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),s&&s.deregister&&s.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function nG(e){let[t,s]=t7(),r=(0,nF.useContext)(tW);return(0,d.jsx)(nz,{...e,layoutGroup:r,switchLayoutGroup:(0,nF.useContext)(aF),isPresent:t,safeToRemove:s})}function nU(e,t,s,r,a){return e-=t,e=r+1/s*(e-r),void 0!==a&&(e=r+1/a*(e-r)),e}function nH(e,t,[s,r,a],i,n){!function(e,t=0,s=1,r=.5,a,i=e,n=e){if(sx.test(t)&&(t=parseFloat(t),t=at(n.min,n.max,t/100)-n.min),"number"!=typeof t)return;let o=at(i.min,i.max,r);e===i&&(o-=t),e.min=nU(e.min,t,s,o,a),e.max=nU(e.max,t,s,o,a)}(e,t[s],t[r],t[a],t.scale,i,n)}let nW=["x","scaleX","originX"],nq=["y","scaleY","originY"];function nY(e,t,s,r){nH(e.x,t,nW,s?s.x:void 0,r?r.x:void 0),nH(e.y,t,nq,s?s.y:void 0,r?r.y:void 0)}function nK(e,t){e.min=t.min,e.max=t.max}function nX(e,t){nK(e.x,t.x),nK(e.y,t.y)}function nZ(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function nJ(e){return 0===e.translate&&1===e.scale}function nQ(e){return nJ(e.x)&&nJ(e.y)}function n0(e,t){return e.min===t.min&&e.max===t.max}function n1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function n2(e,t){return n1(e.x,t.x)&&n1(e.y,t.y)}function n5(e){return nm(e.x)/nm(e.y)}function n3(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}let n4=["TopLeft","TopRight","BottomLeft","BottomRight"],n7=n4.length,n9=e=>"string"==typeof e?parseFloat(e):e,n8=e=>"number"==typeof e||sg.test(e);function n6(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let oe=os(0,.5,iA),ot=os(.5,.95,rl);function os(e,t,s){return r=>r<e?0:r>t?1:s(i$(e,t,r))}function or(e){return tZ(e)&&"ownerSVGElement"in e}let oa=(e,t)=>e.depth-t.depth;class oi{constructor(){this.children=[],this.isDirty=!1}add(e){rT(this.children,e),this.isDirty=!0}remove(e){rC(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(oa),this.isDirty=!1,this.children.forEach(e)}}class on{constructor(){this.members=[]}add(e){rT(this.members,e),e.scheduleRender()}remove(e){if(rC(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t,s=this.members.findIndex(t=>e===t);if(0===s)return!1;for(let e=s;e>=0;e--){let s=this.members[e];if(!1!==s.isPresent){t=s;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,t&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:r}=e.options;!1===r&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:s}=e;t.onExitComplete&&t.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let oo=["","X","Y","Z"],ol=0;function oc(e,t,s,r){let{latestValues:a}=t;a[e]&&(s[e]=a[e],t.setStaticValue(e,0),r&&(r[e]=0))}function od({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(e={},s=t?.()){this.id=ol++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(of),this.nodes.forEach(ov),this.nodes.forEach(ow),this.nodes.forEach(om)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new oi)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new rE),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let s=this.eventHandlers.get(e);s&&s.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=or(t)&&!(or(t)&&"svg"===t.tagName),this.instance=t;let{layoutId:s,layout:r,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||s)&&(this.isLayoutDirty=!0),e){let s,r=0,a=()=>this.root.updateBlockedByResize=!1;rh.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;if(e!==r){let t,i;r=e,this.root.updateBlockedByResize=!0,s&&s(),t=r_.now(),i=({timestamp:e})=>{let s=e-t;s>=250&&(rf(i),a(s-250))},rh.setup(i,!0),s=()=>rf(i),nI.hasAnimatedSinceResize&&(nI.hasAnimatedSinceResize=!1,this.nodes.forEach(oy))}})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&a&&(s||r)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:s,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let i=this.options.transition||a.getDefaultTransition()||oC,{onLayoutAnimationStart:n,onLayoutAnimationComplete:o}=a.getProps(),l=!this.targetLayout||!n2(this.targetLayout,r),c=!t&&s;if(this.options.layoutRoot||this.resumeFrom||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...aH(i,"layout"),onPlay:n,onComplete:o};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,c)}else t||oy(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),rf(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(oj),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:s}=t.options;if(!s)return;let r=s.props[aI];if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:e,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",rh,!(e||s))}let{parent:a}=t;a&&!a.hasCheckedOptimisedAppear&&e(a)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:s}=this.options;if(void 0===t&&!s)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ox);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(og);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ob),this.nodes.forEach(ou),this.nodes.forEach(oh)):this.nodes.forEach(og),this.clearAllSnapshots();let e=r_.now();rm.delta=ss(0,1e3/60,e-rm.timestamp),rm.timestamp=e,rm.isProcessing=!0,rp.update.process(rm),rp.preRender.process(rm),rp.render.process(rm),rm.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,rA.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(op),this.sharedNodes.forEach(oN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rh.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rh.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||nm(this.snapshot.measuredBox.x)||nm(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=sG(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!a)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!nQ(this.projectionDelta),s=this.getTransformTemplate(),r=s?s(this.latestValues,""):void 0,i=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||ad(this.latestValues)||i)&&(a(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let s=this.measurePageBox(),r=this.removeElementScroll(s);return e&&(r=this.removeTransform(r)),oP((t=r).x),oP(t.y),{animationId:this.root.animationId,measuredBox:s,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return sG();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(oM))){let{scroll:e}=this.root;e&&(ap(t.x,e.offset.x),ap(t.y,e.offset.y))}return t}removeElementScroll(e){let t=sG();if(nX(t,e),this.scroll?.wasRoot)return t;for(let s=0;s<this.path.length;s++){let r=this.path[s],{scroll:a,options:i}=r;r!==this.root&&a&&i.layoutScroll&&(a.wasRoot&&nX(t,e),ap(t.x,a.offset.x),ap(t.y,a.offset.y))}return t}applyTransform(e,t=!1){let s=sG();nX(s,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&ag(s,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),ad(r.latestValues)&&ag(s,r.latestValues)}return ad(this.latestValues)&&ag(s,this.latestValues),s}removeTransform(e){let t=sG();nX(t,e);for(let e=0;e<this.path.length;e++){let s=this.path[e];if(!s.instance||!ad(s.latestValues))continue;ac(s.latestValues)&&s.updateSnapshot();let r=sG();nX(r,s.measurePageBox()),nY(t,s.latestValues,s.snapshot?s.snapshot.layoutBox:void 0,r)}return ad(this.latestValues)&&nY(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==rm.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);let s=!!this.resumingFrom||this!==t;if(!(e||s&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:a}=this.options;if(!this.layout||!(r||a))return;this.resolvedRelativeTargetAt=rm.timestamp;let i=this.getClosestProjectingParent();if(i&&this.linkedParentVersion!==i.layoutVersion&&!i.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(i&&i.layout?this.createRelativeTarget(i,this.layout.layoutBox,i.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=sG(),this.targetWithTransforms=sG()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var n,o,l;this.forceRelativeParentToResolveTarget(),n=this.target,o=this.relativeTarget,l=this.relativeParent.target,ng(n.x,o.x,l.x),ng(n.y,o.y,l.y)}else this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):nX(this.target,this.layout.layoutBox),am(this.target,this.targetDelta)):nX(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,i&&!!i.resumingFrom==!!this.resumingFrom&&!i.options.layoutScroll&&i.target&&1!==this.animationProgress?this.createRelativeTarget(i,this.target,i.target):this.relativeParent=this.relativeTarget=void 0)}}getClosestProjectingParent(){if(!(!this.parent||ac(this.parent.latestValues)||au(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,s){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=sG(),this.relativeTargetOrigin=sG(),ny(this.relativeTargetOrigin,t,s),nX(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,s=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(s=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),this.resolvedRelativeTargetAt===rm.timestamp&&(s=!1),s)return;let{layout:r,layoutId:a}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||a))return;nX(this.layoutCorrected,this.layout.layoutBox);let i=this.treeScale.x,n=this.treeScale.y;!function(e,t,s,r=!1){let a,i,n=s.length;if(n){t.x=t.y=1;for(let o=0;o<n;o++){i=(a=s[o]).projectionDelta;let{visualElement:n}=a.options;(!n||!n.props.style||"contents"!==n.props.style.display)&&(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&ag(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,am(e,i)),r&&ad(a.latestValues)&&ag(e,a.latestValues))}t.x<1.0000000000001&&t.x>.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=sG());let{target:o}=e;if(!o){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(nZ(this.prevProjectionDelta.x,this.projectionDelta.x),nZ(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),nx(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.treeScale.x===i&&this.treeScale.y===n&&n3(this.projectionDelta.x,this.prevProjectionDelta.x)&&n3(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=sV(),this.projectionDelta=sV(),this.projectionDeltaWithTransform=sV()}setAnimationOrigin(e,t=!1){let s,r=this.snapshot,a=r?r.latestValues:{},i={...this.latestValues},n=sV();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=sG(),l=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),d=!c||c.members.length<=1,u=!!(l&&!d&&!0===this.options.crossfade&&!this.path.some(oT));this.animationProgress=0,this.mixTargetDelta=t=>{let r=t/1e3;if(ok(n.x,e.x,r),ok(n.y,e.y,r),this.setTargetDelta(n),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var c,h,f,m,p,x;ny(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f=this.relativeTarget,m=this.relativeTargetOrigin,p=o,x=r,oS(f.x,m.x,p.x,x),oS(f.y,m.y,p.y,x),s&&(c=this.relativeTarget,h=s,n0(c.x,h.x)&&n0(c.y,h.y))&&(this.isProjectionDirty=!1),s||(s=sG()),nX(s,this.relativeTarget)}l&&(this.animationValues=i,function(e,t,s,r,a,i){a?(e.opacity=at(0,s.opacity??1,oe(r)),e.opacityExit=at(t.opacity??1,0,ot(r))):i&&(e.opacity=at(t.opacity??1,s.opacity??1,r));for(let a=0;a<n7;a++){let i=`border${n4[a]}Radius`,n=n6(t,i),o=n6(s,i);(void 0!==n||void 0!==o)&&(n||(n=0),o||(o=0),0===n||0===o||n8(n)===n8(o)?(e[i]=Math.max(at(n9(n),n9(o),r),0),(sx.test(o)||sx.test(n))&&(e[i]+="%")):e[i]=o)}(t.rotate||s.rotate)&&(e.rotate=at(t.rotate||0,s.rotate||0,r))}(i,a,this.latestValues,r,u,d)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=r},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(rf(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rh.update(()=>{var t,s,r;let a;nI.hasAnimatedSinceResize=!0,aZ.layout++,this.motionValue||(this.motionValue=rR(0)),this.currentAnimation=(t=this.motionValue,s=[0,1e3],r={...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{aZ.layout--},onComplete:()=>{aZ.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}},(a=sU(t)?t:rR(t)).start(i8("",a,s,r)),a.animation),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:s,layout:r,latestValues:a}=e;if(t&&s&&r){if(this!==e&&this.layout&&r&&o_(this.options.animationType,this.layout.layoutBox,r.layoutBox)){s=this.target||sG();let t=nm(this.layout.layoutBox.x);s.x.min=e.target.x.min,s.x.max=s.x.min+t;let r=nm(this.layout.layoutBox.y);s.y.min=e.target.y.min,s.y.max=s.y.min+r}nX(t,s),ag(t,a),nx(this.projectionDeltaWithTransform,this.layoutCorrected,t,a)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new on),this.sharedNodes.get(e).add(t);let s=t.options.initialPromotionConfig;t.promote({transition:s?s.transition:void 0,preserveFollowOpacity:s&&s.shouldPreserveFollowOpacity?s.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:s}={}){let r=this.getStack();r&&r.promote(this,s),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:s}=e;if((s.z||s.rotate||s.rotateX||s.rotateY||s.rotateZ||s.skewX||s.skewY)&&(t=!0),!t)return;let r={};s.z&&oc("z",e,r,this.animationValues);for(let t=0;t<oo.length;t++)oc(`rotate${oo[t]}`,e,r,this.animationValues),oc(`skew${oo[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility="hidden";return}let s=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=a_(t?.pointerEvents)||"",e.transform=s?s(this.latestValues,""):"none";return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=a_(t?.pointerEvents)||""),this.hasProjected&&!ad(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1);return}e.visibility="";let a=r.animationValues||r.latestValues;this.applyTransformsToTarget();let i=function(e,t,s){let r="",a=e.x.translate/t.x,i=e.y.translate/t.y,n=s?.z||0;if((a||i||n)&&(r=`translate3d(${a}px, ${i}px, ${n}px) `),(1!==t.x||1!==t.y)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),s){let{transformPerspective:e,rotate:t,rotateX:a,rotateY:i,skewX:n,skewY:o}=s;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),a&&(r+=`rotateX(${a}deg) `),i&&(r+=`rotateY(${i}deg) `),n&&(r+=`skewX(${n}deg) `),o&&(r+=`skewY(${o}deg) `)}let o=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==o||1!==l)&&(r+=`scale(${o}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,a);s&&(i=s(a,i)),e.transform=i;let{x:n,y:o}=this.projectionDelta;for(let t in e.transformOrigin=`${100*n.origin}% ${100*o.origin}% 0`,r.animationValues?e.opacity=r===this?a.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:e.opacity=r===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0,as){if(void 0===a[t])continue;let{correct:s,applyTo:n,isCSSVariable:o}=as[t],l="none"===i?a[t]:s(a[t],r);if(n){let t=n.length;for(let s=0;s<t;s++)e[n[s]]=l}else o?this.options.visualElement.renderState.vars[t]=l:e[t]=l}this.options.layoutId&&(e.pointerEvents=r===this?a_(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(ox),this.root.sharedNodes.clear()}}}function ou(e){e.updateLayout()}function oh(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:s,measuredBox:r}=e.layout,{animationType:a}=e.options,i=t.source!==e.layout.source;"size"===a?nc(e=>{let r=i?t.measuredBox[e]:t.layoutBox[e],a=nm(r);r.min=s[e].min,r.max=r.min+a}):o_(a,t.layoutBox,s)&&nc(r=>{let a=i?t.measuredBox[r]:t.layoutBox[r],n=nm(s[r]);a.max=a.min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+n)});let n=sV();nx(n,s,t.layoutBox);let o=sV();i?nx(o,e.applyTransform(r,!0),t.measuredBox):nx(o,s,t.layoutBox);let l=!nQ(n),c=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:a,layout:i}=r;if(a&&i){let n=sG();ny(n,t.layoutBox,a.layoutBox);let o=sG();ny(o,s,i.layoutBox),n2(n,o)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=o,e.relativeTargetOrigin=n,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:o,layoutDelta:n,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function of(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function om(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function op(e){e.clearSnapshot()}function ox(e){e.clearMeasurements()}function og(e){e.isLayoutDirty=!1}function ob(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function oy(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ov(e){e.resolveTargetDelta()}function ow(e){e.calcProjection()}function oj(e){e.resetSkewAndRotation()}function oN(e){e.removeLeadSnapshot()}function ok(e,t,s){e.translate=at(t.translate,0,s),e.scale=at(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function oS(e,t,s,r){e.min=at(t.min,s.min,r),e.max=at(t.max,s.max,r)}function oT(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let oC={duration:.45,ease:[.4,0,.1,1]},oE=e=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),oA=oE("applewebkit/")&&!oE("chrome/")?Math.round:rl;function oP(e){e.min=oA(e.min),e.max=oA(e.max)}function o_(e,t,s){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(n5(t)-n5(s)))}function oM(e){return e!==e.root&&e.scroll?.wasRoot}let oR=od({attachResizeListener:(e,t)=>nh(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),o$={current:void 0},oO=od({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!o$.current){let e=new oR({});e.mount(window),e.setOptions({layoutScroll:!0}),o$.current=e}return o$.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});function oD(e,t){let s=function(e,t,s){if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document,s=(void 0)??t.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}(e),r=new AbortController;return[s,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function oL(e){return!("touch"===e.pointerType||nf.x||nf.y)}function oB(e,t,s){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===s);let a=r["onHover"+s];a&&rh.postRender(()=>a(t,nw(t)))}let oI=(e,t)=>!!t&&(e===t||oI(e,t.parentElement)),oF=new WeakSet;function oV(e){return t=>{"Enter"===t.key&&e(t)}}function oz(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function oG(e){return nv(e)&&!(nf.x||nf.y)}function oU(e,t,s){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===s);let a=r["onTap"+("End"===s?"":s)];a&&rh.postRender(()=>a(t,nw(t)))}let oH=new WeakMap,oW=new WeakMap,oq=e=>{let t=oH.get(e.target);t&&t(e)},oY=e=>{e.forEach(oq)},oK={some:0,all:1},oX=function(e,t){if("u"<typeof Proxy)return az;let s=new Map,r=(s,r)=>az(s,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(a,i)=>"create"===i?r:(s.has(i)||s.set(i,az(i,void 0,e,t)),s.get(i))})}({animation:{Feature:class extends aG{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:s})=>(function(e,t,s={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t))r=Promise.all(t.map(t=>nt(e,t,s)));else if("string"==typeof t)r=nt(e,t,s);else{let a="function"==typeof t?aU(e,t,s.custom):t;r=Promise.all(i6(e,a,s))}return r.then(()=>{e.notify("AnimationComplete",t)})})(e,t,s))),s=no(),r=!0,a=t=>(s,r)=>{let a=aU(e,r,"exit"===t?e.presenceContext?.custom:void 0);if(a){let{transition:e,transitionEnd:t,...r}=a;s={...s,...r,...t}}return s};function i(i){let{props:n}=e,o=function e(t){if(!t)return;if(!t.isControllingVariants){let s=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(s.initial=t.props.initial),s}let s={};for(let e=0;e<ns;e++){let r=rz[e],a=t.props[r];(rF(a)||!1===a)&&(s[r]=a)}return s}(e.parent)||{},l=[],c=new Set,d={},u=1/0;for(let t=0;t<ni;t++){var h,f;let m=na[t],p=s[m],x=void 0!==n[m]?n[m]:o[m],g=rF(x),b=m===i?p.isActive:null;!1===b&&(u=t);let y=x===o[m]&&x!==n[m]&&g;if(y&&r&&e.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...d},!p.isActive&&null===b||!x&&!p.prevProp||rI(x)||"boolean"==typeof x)continue;let v=(h=p.prevProp,"string"==typeof(f=x)?f!==h:!!Array.isArray(f)&&!nr(f,h)),w=v||m===i&&p.isActive&&!y&&g||t>u&&g,j=!1,N=Array.isArray(x)?x:[x],k=N.reduce(a(m),{});!1===b&&(k={});let{prevResolvedValues:S={}}=p,T={...S,...k},C=t=>{w=!0,c.has(t)&&(j=!0,c.delete(t)),p.needsAnimating[t]=!0;let s=e.getValue(t);s&&(s.liveStyle=!1)};for(let e in T){let t=k[e],s=S[e];if(!d.hasOwnProperty(e))(aW(t)&&aW(s)?nr(t,s):t===s)?void 0!==t&&c.has(e)?C(e):p.protectedKeys[e]=!0:null!=t?C(e):c.add(e)}p.prevProp=x,p.prevResolvedValues=k,p.isActive&&(d={...d,...k}),r&&e.blockInitialAnimation&&(w=!1);let E=y&&v,A=!E||j;w&&A&&l.push(...N.map(t=>{let s={type:m};if("string"==typeof t&&r&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,a=aU(r,t);if(r.enteringChildren&&a){let{delayChildren:t}=a.transition||{};s.delay=ne(r.enteringChildren,e,t)}}return{animation:t,options:s}}))}if(c.size){let t={};if("boolean"!=typeof n.initial){let s=aU(e,Array.isArray(n.initial)?n.initial[0]:n.initial);s&&s.transition&&(t.transition=s.transition)}c.forEach(s=>{let r=e.getBaseTarget(s),a=e.getValue(s);a&&(a.liveStyle=!0),t[s]=r??null}),l.push({animation:t})}let m=!!l.length;return r&&(!1===n.initial||n.initial===n.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){if(s[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),s[t].isActive=r;let a=i(t);for(let e in s)s[e].protectedKeys={};return a},setAnimateFunction:function(s){t=s(e)},getState:()=>s,reset:()=>{s=no()}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();rI(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends aG{constructor(){super(...arguments),this.id=nl++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;let r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}},inView:{Feature:class extends aG{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;let t;this.unmount();let{viewport:s={}}=this.node.getProps(),{root:r,margin:a,amount:i="some",once:n}=s,o={root:r?r.current:void 0,rootMargin:a,threshold:"number"==typeof i?i:oK[i]},l=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,n&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:s,onViewportLeave:r}=this.node.getProps(),a=t?s:r;a&&a(e)};return e=this.node.current,t=function({root:e,...t}){let s=e||document;oW.has(s)||oW.set(s,{});let r=oW.get(s),a=JSON.stringify(t);return r[a]||(r[a]=new IntersectionObserver(oY,{root:e,...t})),r[a]}(o),oH.set(e,l),t.observe(e),()=>{oH.delete(e),t.unobserve(e)}}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends aG{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,s={}){let[r,a,i]=oD(e,s),n=e=>{let r=e.currentTarget;if(!oG(e))return;oF.add(r);let i=t(r,e),n=(e,t)=>{window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",l),oF.has(r)&&oF.delete(r),oG(e)&&"function"==typeof i&&i(e,{success:t})},o=e=>{n(e,r===window||r===document||s.useGlobalTarget||oI(r,e.target))},l=e=>{n(e,!1)};window.addEventListener("pointerup",o,a),window.addEventListener("pointercancel",l,a)};return r.forEach(e=>{(s.useGlobalTarget?window:e).addEventListener("pointerdown",n,a),tJ(e)&&(e.addEventListener("focus",e=>((e,t)=>{let s=e.currentTarget;if(!s)return;let r=oV(()=>{if(oF.has(s))return;oz(s,"down");let e=oV(()=>{oz(s,"up")});s.addEventListener("keyup",e,t),s.addEventListener("blur",()=>oz(s,"cancel"),t)});s.addEventListener("keydown",r,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",r),t)})(e,a)),nu(e)||e.hasAttribute("tabindex")||(e.tabIndex=0))}),i}(e,(e,t)=>(oU(this.node,t,"Start"),(e,{success:t})=>oU(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends aG{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=aX(nh(this.node.current,"focus",()=>this.onFocus()),nh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends aG{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,s={}){let[r,a,i]=oD(e,s),n=e=>{if(!oL(e))return;let{target:s}=e,r=t(s,e);if("function"!=typeof r||!s)return;let i=e=>{oL(e)&&(r(e),s.removeEventListener("pointerleave",i))};s.addEventListener("pointerleave",i,a)};return r.forEach(e=>{e.addEventListener("pointerenter",n,a)}),i}(e,(e,t)=>(oB(this.node,t,"Start"),e=>oB(this.node,e,"End"))))}unmount(){}}},pan:{Feature:class extends aG{constructor(){super(...arguments),this.removePointerDownListener=rl}onPointerDown(e){this.session=new nT(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nN(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:s,onPanEnd:r}=this.node.getProps();return{onSessionStart:nB(e),onStart:nB(t),onMove:s,onEnd:(e,t)=>{delete this.session,r&&rh.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=nj(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends aG{constructor(e){super(e),this.removeGroupControls=rl,this.removeListeners=rl,this.controls=new nD(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||rl}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:oO,MeasureLayout:nG},layout:{ProjectionNode:oO,MeasureLayout:nG}},(e,t)=>t.isSVG??aw(e)?new an(t):new ay(t,{allowProjection:e!==u.Fragment}));function oZ(){let e=(0,f.useGameStore)(e=>e._achievementQueue),t=(0,f.useGameStore)(e=>e.consumeAchievementQueue),{toast:s}=(0,F.useToast)(),[r,a]=(0,u.useState)([]);return((0,u.useEffect)(()=>{if(0!==e.length)for(let e of t()){(0,V.sfx)("achievement");let t=Date.now()+Math.random();a(s=>[...s,{achievement:e,id:t}]),setTimeout(()=>{a(e=>e.filter(e=>e.id!==t))},4e3),s({title:`成就解锁:${e.name}`,description:`${e.desc} 奖励:${e.rewardText}`})}},[e,t,s]),0===r.length)?null:(0,d.jsx)("div",{className:"fixed inset-0 z-[120] pointer-events-none flex items-center justify-center",children:(0,d.jsx)(t6,{children:r.map((e,t)=>{let s=e.achievement,a=(t-(r.length-1)/2)*140;return(0,d.jsx)(oX.div,{initial:{opacity:0,scale:.4,y:40,rotateX:-30},animate:{opacity:1,scale:1,y:a,rotateX:0},exit:{opacity:0,scale:.6,y:-60},transition:{type:"spring",stiffness:280,damping:22},className:"absolute",style:{transformOrigin:"center center"},children:(0,d.jsxs)("div",{className:"relative rounded-2xl border-2 px-8 py-5 backdrop-blur-xl overflow-hidden",style:{borderColor:s.color,background:`linear-gradient(135deg, ${s.color}22, rgba(5,4,16,0.92))`,boxShadow:`0 0 60px ${s.color}66, 0 0 120px ${s.color}33, inset 0 0 30px ${s.color}11`,minWidth:320,maxWidth:420},children:[(0,d.jsx)("div",{className:"absolute -top-20 -right-20 h-40 w-40 rounded-full blur-3xl opacity-50",style:{background:s.color}}),(0,d.jsx)(oX.div,{className:"absolute inset-0 rounded-2xl opacity-20",style:{background:`conic-gradient(from 0deg, transparent, ${s.color}, transparent, ${s.color}, transparent)`},animate:{rotate:360},transition:{duration:8,repeat:1/0,ease:"linear"}}),(0,d.jsxs)("div",{className:"relative flex items-center gap-4",children:[(0,d.jsx)(oX.div,{className:"shrink-0 h-16 w-16 rounded-2xl flex items-center justify-center text-3xl",style:{background:`${s.color}33`,border:`2px solid ${s.color}`,boxShadow:`0 0 20px ${s.color}88, inset 0 0 12px ${s.color}44`},animate:{boxShadow:[`0 0 20px ${s.color}88, inset 0 0 12px ${s.color}44`,`0 0 40px ${s.color}cc, inset 0 0 20px ${s.color}66`,`0 0 20px ${s.color}88, inset 0 0 12px ${s.color}44`]},transition:{duration:2,repeat:1/0},children:s.icon}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)(oX.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.15},className:"text-[10px] font-mono uppercase tracking-[0.2em] mb-0.5",style:{color:s.color},children:"✦ Achievement Unlocked"}),(0,d.jsx)(oX.h3,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.2},className:"text-lg font-bold truncate",style:{color:s.color,textShadow:`0 0 12px ${s.color}66`},children:s.name}),(0,d.jsx)(oX.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},className:"text-[11px] text-muted-foreground/90 truncate",children:s.desc}),(0,d.jsxs)(oX.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.4},className:"mt-1.5 inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-mono font-semibold",style:{background:`${s.color}22`,border:`1px solid ${s.color}55`,color:s.color},children:["▸ ",s.rewardText]})]})]}),(0,d.jsx)(oX.div,{className:"absolute bottom-0 left-0 h-0.5",style:{background:s.color},initial:{width:"100%"},animate:{width:"0%"},transition:{duration:4,ease:"linear"}})]})},e.id)})})})}function oJ(){let e=(0,f.useGameStore)(e=>e.constellation??[]),t=(0,u.useRef)(null),s=(0,u.useRef)(null),[r,a]=(0,u.useState)({w:360,h:360}),[i,n]=(0,u.useState)(null),o=(0,u.useMemo)(()=>new Set(e),[e]);(0,u.useEffect)(()=>{let e=s.current;if(!e)return;let t=new ResizeObserver(()=>{let t=e.getBoundingClientRect();a({w:Math.max(280,t.width),h:Math.max(280,Math.min(420,t.width))})});return t.observe(e),()=>t.disconnect()},[]);let l=(0,u.useMemo)(()=>{let e=r.w/2;return{cx:e,cy:r.h/2,radius:.32*Math.min(r.w,r.h)}},[r]),c=(0,u.useMemo)(()=>(0,tr.getConstellationLayout)(l.cx,l.cy,l.radius).map(e=>{let t=(0,tr.getStarsInCategory)(e.category,e.cx,e.cy,1);return{...e,stars:t}}),[l]);(0,u.useEffect)(()=>{let s=t.current;if(!s)return;let a=s.getContext("2d");if(!a)return;let i=window.devicePixelRatio||1;s.width=r.w*i,s.height=r.h*i,s.style.width=`${r.w}px`,s.style.height=`${r.h}px`,a.setTransform(i,0,0,i,0,0);let n=0,d=performance.now(),u=t=>{let s=(t-d)/1e3;a.clearRect(0,0,r.w,r.h);let i=a.createRadialGradient(l.cx,l.cy,0,l.cx,l.cy,1.6*l.radius);i.addColorStop(0,"rgba(40,30,80,0.18)"),i.addColorStop(1,"rgba(5,4,16,0)"),a.fillStyle=i,a.fillRect(0,0,r.w,r.h),a.save(),a.translate(l.cx,l.cy);let h=6+1.5*Math.sin(1.5*s),f=a.createRadialGradient(0,0,0,0,0,3*h);for(let t of(f.addColorStop(0,"rgba(232,121,249,0.9)"),f.addColorStop(.4,"rgba(232,121,249,0.3)"),f.addColorStop(1,"rgba(232,121,249,0)"),a.fillStyle=f,a.beginPath(),a.arc(0,0,3*h,0,2*Math.PI),a.fill(),a.fillStyle="#fce7ff",a.beginPath(),a.arc(0,0,.6*h,0,2*Math.PI),a.fill(),a.restore(),c))(0,tr.countUnlockedInCategory)(e,t.category)>0&&(a.save(),a.strokeStyle=t.meta.glow,a.lineWidth=1,a.setLineDash([2,4]),a.globalAlpha=.4+.1*Math.sin(2*s+t.cx),a.beginPath(),a.moveTo(l.cx,l.cy),a.lineTo(t.cx,t.cy),a.stroke(),a.restore());for(let t of c){let r=(0,tr.countUnlockedInCategory)(e,t.category);a.save(),a.font="10px ui-monospace, monospace",a.textAlign="center",a.fillStyle=r>0?t.meta.hex:"rgba(148,163,184,0.5)",a.globalAlpha=.85,a.fillText(t.meta.name,t.cx,t.cy+38),a.restore();let i=t.stars.filter(e=>o.has(e.perk.id));for(let e of(i.length>=2&&(a.save(),a.strokeStyle=t.meta.glow,a.lineWidth=1.5,a.globalAlpha=.6,a.beginPath(),i.forEach((e,t)=>{0===t?a.moveTo(e.x,e.y):a.lineTo(e.x,e.y)}),a.stroke(),a.restore()),t.stars)){let r=o.has(e.perk.id);a.save(),a.translate(e.x,e.y);let i=r?.85+.15*Math.sin(3*s+.1*e.x):.3,n=r?10:5,l=a.createRadialGradient(0,0,0,0,0,n);if(l.addColorStop(0,r?t.meta.glow:"rgba(100,116,139,0.2)"),l.addColorStop(1,"rgba(0,0,0,0)"),a.fillStyle=l,a.globalAlpha=i,a.beginPath(),a.arc(0,0,n,0,2*Math.PI),a.fill(),a.globalAlpha=r?1:.4,a.fillStyle=r?t.meta.hex:"#475569",a.beginPath(),a.arc(0,0,r?3.5:2,0,2*Math.PI),a.fill(),r){a.strokeStyle=t.meta.hex,a.globalAlpha=.7*i,a.lineWidth=.8;let r=7+1.5*Math.sin(4*s+.1*e.y);a.beginPath(),a.moveTo(-r,0),a.lineTo(r,0),a.moveTo(0,-r),a.lineTo(0,r),a.stroke()}a.restore()}}n=requestAnimationFrame(u)};return n=requestAnimationFrame(u),()=>cancelAnimationFrame(n)},[c,l,r,e,o]);let h=(0,tr.constellationProgress)(e);return(0,d.jsxs)("div",{ref:s,className:"flex flex-col gap-2 min-h-0 h-full",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between text-[11px] px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-fuchsia-300",children:"✦"}),(0,d.jsx)("span",{className:"text-muted-foreground",children:"星图天赋"}),(0,d.jsxs)("span",{className:"font-mono text-foreground",children:[h.unlocked,"/",h.total]})]}),(0,d.jsx)("span",{className:"text-muted-foreground/60 text-[10px]",children:"每次飞升可解锁 1 个"})]}),(0,d.jsxs)("div",{className:"relative rounded-xl bg-black/30 border border-white/5 overflow-hidden flex-shrink-0",children:[(0,d.jsx)("canvas",{ref:t,onMouseMove:e=>{let s=t.current;if(!s)return;let r=s.getBoundingClientRect(),a=e.clientX-r.left,i=e.clientY-r.top,l=null,d=14;for(let e of c)for(let t of e.stars){let e=Math.hypot(t.x-a,t.y-i);e<d&&(d=e,l={perk:t.perk,x:t.x,y:t.y,unlocked:o.has(t.perk.id)})}n(l)},onMouseLeave:()=>n(null),className:"block cursor-pointer"}),i&&(0,d.jsxs)("div",{className:"pointer-events-none absolute z-10 max-w-[200px] rounded-md bg-black/85 border border-white/10 px-2 py-1.5 text-[10px] leading-tight shadow-lg backdrop-blur-sm",style:{left:Math.min(i.x+12,r.w-200),top:Math.max(0,i.y-40)},children:[(0,d.jsxs)("div",{className:"font-bold mb-0.5",style:{color:tr.CONSTELLATION_CATEGORY_META[i.perk.category].hex},children:[i.unlocked?"★ ":"☆ ",i.perk.name]}),(0,d.jsx)("div",{className:"text-muted-foreground",children:i.perk.desc}),(0,d.jsxs)("div",{className:"text-muted-foreground/60 mt-0.5",children:[tr.CONSTELLATION_CATEGORY_META[i.perk.category].name," · 序",i.perk.order]})]})]}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-1 text-[10px]",children:Object.keys(tr.CONSTELLATION_CATEGORY_META).map(t=>{let s=tr.CONSTELLATION_CATEGORY_META[t],r=(0,tr.countUnlockedInCategory)(e,t),a=tr.CONSTELLATION_PERKS.filter(e=>e.category===t).length;return(0,d.jsxs)("div",{className:"rounded-md bg-black/25 border border-white/5 px-1.5 py-1 flex items-center gap-1",style:r>0?{borderColor:`${s.hex}40`}:void 0,children:[(0,d.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full flex-shrink-0",style:{background:s.hex,boxShadow:r>0?`0 0 4px ${s.hex}`:"none"}}),(0,d.jsx)("span",{className:"text-muted-foreground truncate",children:s.name}),(0,d.jsxs)("span",{className:"ml-auto font-mono",style:{color:r>0?s.hex:"rgba(148,163,184,0.5)"},children:[r,"/",a]})]},t)})}),(0,d.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto pr-1 echo-scrollbar",children:0===e.length?(0,d.jsxs)("div",{className:"rounded-md bg-black/25 border border-dashed border-white/10 px-3 py-3 text-center text-[11px] text-muted-foreground/70",children:[(0,d.jsx)("div",{className:"mb-1 text-fuchsia-300/80",children:"✦"}),"尚未解锁任何天赋。",(0,d.jsx)("br",{}),"累积接触进度至 100%,发起「飞升」即可在 3 个随机天赋中选 1。"]}):(0,d.jsx)("div",{className:"flex flex-col gap-1",children:e.map(e=>{let t=(0,tr.getPerk)(e);if(!t)return null;let s=tr.CONSTELLATION_CATEGORY_META[t.category];return(0,d.jsxs)("div",{className:"rounded-md bg-black/25 border px-2 py-1.5 flex items-center gap-2 text-[11px]",style:{borderColor:`${s.hex}30`},children:[(0,d.jsx)("span",{className:"inline-block h-2 w-2 rounded-full flex-shrink-0",style:{background:s.hex,boxShadow:`0 0 6px ${s.hex}`}}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-foreground truncate",children:t.name}),(0,d.jsx)("div",{className:"text-muted-foreground/70 text-[10px] truncate",children:t.desc})]}),(0,d.jsx)("span",{className:"text-[9px] text-muted-foreground/50 font-mono",children:s.name})]},e)})})})]})}var oQ=e.i(89120),o0=e.i(63639),o1=e.i(3116);let o2=(0,x.default)("award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);var o5=e.i(43553);let o3=(0,x.default)("medal",[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]),o4=(0,x.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var o7=e.i(58377);let o9=(0,x.default)("hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);var o8=e.i(16715);let o6=(0,x.default)("globe",[["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"}]]),le=(0,x.default)("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),lt=(0,x.default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ls=["routine","anomaly","singular"];function lr(e){return 0===e?{icon:o5.Crown,color:"#fbbf24",label:"1st"}:1===e?{icon:o3,color:"#cbd5e1",label:"2nd"}:2===e?{icon:o2,color:"#f97316",label:"3rd"}:null}function la(){let e,t,s,r,a,i,n=(0,f.useGameStore)(e=>e.grantBeaconReward),o=(0,f.useGameStore)(e=>e.claimWeeklyBeacon),l=(0,f.useGameStore)(e=>e.claimTimedBeacon),c=(0,f.useGameStore)(e=>e.claimChainReward),{toast:h}=(0,F.useToast)(),[p,x]=(0,u.useState)(null),[g,b]=(0,u.useState)(null),[y,v]=(0,u.useState)(null),[w,j]=(0,u.useState)(null),[N,k]=(0,u.useState)(null),[S,T]=(0,u.useState)(null),[C,E]=(0,u.useState)(null),[A,P]=(0,u.useState)([]),[_,M]=(0,u.useState)("00:00:00"),[R,$]=(0,u.useState)("00:00:00"),[O,L]=(0,u.useState)("00:00:00"),[B,z]=(0,u.useState)(Date.now()),[G,U]=(0,u.useState)("local"),[H,W]=(0,u.useState)([]),[q,Y]=(0,u.useState)(!1),[K,X]=(0,u.useState)(null),[Z,J]=(0,u.useState)(!1),[Q,et]=(0,u.useState)(0),er=(0,u.useRef)(!1);(0,u.useEffect)(()=>{x((0,oQ.generateDailyChallenge)()),b((0,oQ.loadDailyProgress)()),v((0,oQ.generateTimedChallenge)()),j((0,oQ.loadTimedProgress)()),k((0,oQ.generateWeeklyChallenge)()),T((0,oQ.loadWeeklyProgress)()),E((0,oQ.loadChainState)()),P((0,oQ.loadLeaderboard)());let e=setInterval(()=>{z(Date.now()),b((0,oQ.loadDailyProgress)()),j((0,oQ.loadTimedProgress)()),T((0,oQ.loadWeeklyProgress)()),E((0,oQ.loadChainState)()),x(e=>e??(0,oQ.generateDailyChallenge)()),v(e=>e??(0,oQ.generateTimedChallenge)()),k(e=>e??(0,oQ.generateWeeklyChallenge)())},1e3);return()=>clearInterval(e)},[]),(0,u.useEffect)(()=>{M((0,oQ.formatCountdown)((0,oQ.msUntilNextDay)(new Date(B)))),$((0,oQ.formatCountdown)((0,oQ.msUntilNextTimedSlot)(new Date(B)))),L((0,oQ.formatCountdown)((0,oQ.msUntilNextWeek)(new Date(B))))},[B]),(0,u.useEffect)(()=>{et((0,oQ.loadLastCloudSubmitTimestamp)())},[]);let ea=(0,u.useCallback)(async()=>{if(!er.current){er.current=!0,Y(!0),X(null);try{let e=await (0,oQ.fetchCloudLeaderboard)();W(e),J(!0),et((0,oQ.loadLastCloudSubmitTimestamp)()),0===e.length&&X("尚无全球记录,成为首位登顶者!")}catch{X("全球榜连接失败,请稍后重试")}finally{Y(!1),er.current=!1}}},[]);(0,u.useEffect)(()=>{"global"!==G||Z||q||ea()},[G,Z,q,ea]);let ei=(0,u.useCallback)(()=>{if(!p||!g||null===g.completedAt||g.claimed)return;let e=(0,oQ.claimBeaconReward)(p,g);P(e.leaderboard),b((0,oQ.loadDailyProgress)()),n(e.rewardInsight,e.rewardContact),(0,V.sfx)("achievement"),h({title:"✦ 每日信标奖励已领取",description:`+${e.rewardInsight} 洞见 \xb7 +${e.rewardContact.toFixed(1)} 接触 \xb7 得分 ${e.score}`}),e.entry&&(0,oQ.submitCloudScore)(e.entry).then(t=>{t>=1&&(et(e.entry.timestamp),"global"===G&&ea())})},[p,g,h,n,G,ea]),en=(0,u.useCallback)(()=>{if(!y||!w||null===w.completedAt||w.claimed)return;let e=l();P((0,oQ.loadLeaderboard)()),j((0,oQ.loadTimedProgress)()),(e.rewardInsight>0||e.rewardContact>0)&&((0,V.sfx)("achievement"),h({title:"✦ 限时挑战奖励已领取",description:`+${e.rewardInsight} 洞见 \xb7 +${e.rewardContact.toFixed(1)} 接触 \xb7 得分 ${e.score}`}),et((0,oQ.loadLastCloudSubmitTimestamp)()),"global"===G&&ea())},[y,w,h,l,G,ea]),eo=(0,u.useCallback)(()=>{if(!N||!S||null===S.completedAt||S.claimed)return;let e=o();P((0,oQ.loadLeaderboard)()),T((0,oQ.loadWeeklyProgress)()),(e.rewardInsight>0||e.rewardContact>0)&&((0,V.sfx)("achievement"),h({title:"✦ 周挑战奖励已领取",description:`+${e.rewardInsight} 洞见 \xb7 +${e.rewardContact.toFixed(1)} 接触 \xb7 得分 ${e.score}`}),et((0,oQ.loadLastCloudSubmitTimestamp)()),"global"===G&&ea())},[N,S,h,o,G,ea]),el=(0,u.useCallback)(e=>{let t=oQ.BEACON_CHAIN_REWARDS.find(t=>t.milestone===e),s=c(e);E((0,oQ.loadChainState)()),s.ok&&((0,V.sfx)("achievement"),h({title:`✦ ${s.label||t?.label||"里程碑"} 已领取`,description:`+${s.rewardInsight} 洞见 \xb7 +${s.rewardContact.toFixed(1)} 接触`}))},[h,c]);if(!p||!g||!y||!w||!N||!S||!C)return(0,d.jsx)("div",{className:"flex items-center justify-center h-full text-xs text-muted-foreground/60",children:"正在校准深空信标…"});let ec=oQ.BEACON_DIFFICULTY[p.difficulty],ed=oQ.BEACON_TYPE_META[p.type],eu=Math.min(100,g.progress/p.goal*100),eh=null!==g.completedAt,ef=g.claimed,em=eh&&!ef,ep=oQ.BEACON_DIFFICULTY[y.difficulty],ex=oQ.BEACON_TYPE_META[y.type],eg=Math.min(100,w.progress/y.goal*100),eb=null!==w.completedAt,ey=w.claimed,ev=eb&&!ey,ew=oQ.BEACON_DIFFICULTY[N.difficulty],ej=oQ.BEACON_TYPE_META[N.type],eN=Math.min(100,S.progress/N.goal*100),ek=null!==S.completedAt,eS=S.claimed,eT=ek&&!eS,eC=(0,oQ.getChainProgress)(C.currentStreak),eE=(0,oQ.getNextMilestone)(C.currentStreak),eA=(0,oQ.getTodayKey)(),eP=C.lastCompletedDateKey===eA;return(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" h-full overflow-y-auto echo-scroll pr-0.5 space-y-2.5",children:[(0,d.jsx)(I.default,{id:"12f5fcaad97b9273",dynamic:[ec.glow,ec.glow,ec.glow,ec.glow],children:`.echo-scroll::-webkit-scrollbar{width:4px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff1f;border-radius:2px}.echo-scroll::-webkit-scrollbar-track{background:0 0}@keyframes beacon-pulse-ring{0%{opacity:.8;transform:scale(.8)}to{opacity:0;transform:scale(2.2)}}@keyframes beacon-glow{0%,to{box-shadow:0 0 18px ${ec.glow},inset 0 0 12px ${ec.glow}}50%{box-shadow:0 0 32px ${ec.glow},inset 0 0 20px ${ec.glow}}}@keyframes weekly-glow{0%,to{box-shadow:0 0 18px #e879f959,inset 0 0 12px #e879f940}50%{box-shadow:0 0 32px #e879f980,inset 0 0 20px #e879f959}}@keyframes timed-glow{0%,to{box-shadow:0 0 18px #fbbf2466,inset 0 0 12px #fbbf2440}50%{box-shadow:0 0 30px #fbbf248c,inset 0 0 20px #fbbf2459}}@keyframes timed-urgent{0%,to{box-shadow:0 0 18px #f43f5e80,inset 0 0 12px #f43f5e4d}50%{box-shadow:0 0 34px #f43f5eb3,inset 0 0 22px #f43f5e66}}@keyframes chain-milestone-pulse{0%,to{transform:scale(1);box-shadow:0 0 #fb71858c}50%{transform:scale(1.06);box-shadow:0 0 0 8px #fb718500}}.chain-milestone-reachable{animation:1.8s ease-in-out infinite chain-milestone-pulse}@keyframes chain-streak-flux{0%,to{background-position:0%}50%{background-position:100%}}.chain-streak-text{-webkit-text-fill-color:transparent;background:linear-gradient(90deg,#fbbf24,#fb7185,#fbbf24) 0 0/200% 100%;-webkit-background-clip:text;background-clip:text;animation:4s ease-in-out infinite chain-streak-flux}`}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between",children:[(0,d.jsxs)("h3",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-sm font-semibold flex items-center gap-1.5",children:[(0,d.jsx)(o0.Radio,{className:"h-4 w-4 text-fuchsia-400"}),"深空信标"]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1 text-[10px] text-muted-foreground/70",children:[(0,d.jsx)(o1.Clock,{className:"h-3 w-3"}),"次日重置",(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-fuchsia-300/90",children:_})]})]}),(0,d.jsxs)("div",{style:{borderColor:`${ec.color}55`,background:`linear-gradient(135deg, ${ec.color}1f, rgba(0,0,0,0.45))`,animation:eh?"none":"beacon-glow 3s ease-in-out infinite"},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" relative rounded-xl border p-3 overflow-hidden",children:[!eh&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{style:{border:`1.5px solid ${ec.color}`,animation:"beacon-pulse-ring 2.5s ease-out infinite"},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" absolute top-4 right-4 h-10 w-10 rounded-full pointer-events-none"}),(0,d.jsx)("div",{style:{border:`1.5px solid ${ec.color}`,animation:"beacon-pulse-ring 2.5s ease-out infinite 1.25s"},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" absolute top-4 right-4 h-10 w-10 rounded-full pointer-events-none"})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" relative",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5 mb-2",children:[(0,d.jsxs)("span",{style:{background:`${ec.color}22`,color:ec.color,border:`1px solid ${ec.color}55`},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded flex items-center gap-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]]),children:ec.icon}),ec.label]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-white/5 text-muted-foreground border border-white/10",children:[ed.icon," ",ed.label]}),eh&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-300 border border-emerald-500/40 flex items-center gap-1",children:[(0,d.jsx)(es.Sparkles,{className:"h-2.5 w-2.5"})," 已完成"]})]}),(0,d.jsx)("h4",{style:{color:ec.color,textShadow:`0 0 10px ${ec.glow}`},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-sm font-semibold mb-1",children:p.title}),(0,d.jsx)("p",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[11px] text-muted-foreground/80 leading-relaxed mb-2.5",children:p.desc}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/70",children:"进度"}),(0,d.jsxs)("span",{style:{color:ec.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[11px] font-mono font-semibold",children:[Math.min(g.progress,p.goal)," / ",p.goal," ",ed.unit]})]}),(0,d.jsx)(D,{value:eu,className:"h-2 bg-black/40",style:{"--progress-color":ec.color}})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-2 text-[10px]",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/60",children:"奖励:"}),p.rewardInsight>0&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-amber-300 font-mono",children:["+",(0,m.formatNum)(p.rewardInsight),"洞见"]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-fuchsia-300 font-mono",children:["+",p.rewardContact.toFixed(1),"接触"]})]}),(0,d.jsx)(ee.Button,{onClick:ei,disabled:!em,size:"sm",className:"h-7 px-3 text-[11px] border-0",style:{background:em?`linear-gradient(90deg, ${ec.color}, ${ec.color}cc)`:`${ec.color}1a`,color:em?"#022c22":`${ec.color}99`},children:ef?"已领取":em?"领取奖励":eh?"已领取":"进行中…"})]}),eh&&g.durationSec>0&&(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mt-1.5 text-[10px] text-muted-foreground/50 text-center",children:["完成用时 ",Math.floor(g.durationSec/60),"分",g.durationSec%60,"秒"]})]})]}),(e=18e5>(0,oQ.msUntilNextTimedSlot)(new Date(B))&&!eb,t=eb?"none":e?"timed-urgent 1.5s ease-in-out infinite":"timed-glow 3s ease-in-out infinite",(0,d.jsxs)("div",{style:{borderColor:e?"rgba(244,63,94,0.5)":"rgba(251,191,36,0.4)",background:e?"linear-gradient(135deg, rgba(244,63,94,0.12), rgba(251,191,36,0.08), rgba(0,0,0,0.45))":"linear-gradient(135deg, rgba(251,191,36,0.14), rgba(0,0,0,0.45))",animation:t},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" relative rounded-xl border p-3 overflow-hidden",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5",children:[(0,d.jsx)(o9,{className:`h-3.5 w-3.5 ${e?"text-rose-400":"text-amber-400"}`}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`text-xs font-semibold ${e?"text-rose-200":"text-amber-200"}`,children:"限时挑战 · TIMED"})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1 text-[9px] text-muted-foreground/70",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-amber-300/70",children:(0,oQ.getTimedSlotKey)().split("_").slice(1).join(" ")}),(0,d.jsx)(o1.Clock,{className:"h-2.5 w-2.5"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`font-mono ${e?"text-rose-300":"text-amber-300/90"}`,children:R})]})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5 mb-2",children:[(0,d.jsxs)("span",{style:{background:`${ep.color}22`,color:ep.color,border:`1px solid ${ep.color}55`},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded flex items-center gap-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]]),children:ep.icon}),ep.label]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-white/5 text-muted-foreground border border-white/10",children:[ex.icon," ",ex.label]}),eb&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-300 border border-emerald-500/40 flex items-center gap-1",children:[(0,d.jsx)(es.Sparkles,{className:"h-2.5 w-2.5"})," 已完成"]}),e&&!eb&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-rose-500/20 text-rose-300 border border-rose-500/40 flex items-center gap-1 animate-pulse",children:"即将结束"})]}),(0,d.jsx)("h4",{style:{color:ep.color,textShadow:`0 0 10px ${ep.glow}`},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-sm font-semibold mb-1",children:y.title}),(0,d.jsx)("p",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/80 leading-relaxed mb-2",children:y.desc}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/70",children:"进度"}),(0,d.jsxs)("span",{style:{color:ep.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[11px] font-mono font-semibold",children:[Math.min(w.progress,y.goal)," / ",y.goal," ",ex.unit]})]}),(0,d.jsx)(D,{value:eg,className:"h-2 bg-black/40",style:{"--progress-color":e?"#f43f5e":ep.color}})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5 text-[10px]",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/60",children:"奖励:"}),y.rewardInsight>0&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-amber-300 font-mono",children:["+",(0,m.formatNum)(y.rewardInsight),"洞见"]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-fuchsia-300 font-mono",children:["+",y.rewardContact.toFixed(1),"接触"]})]}),(0,d.jsx)(ee.Button,{onClick:en,disabled:!ev,size:"sm",className:"h-7 px-3 text-[11px] border-0",style:{background:ev?"linear-gradient(90deg, #34d399, #34d399cc)":"rgba(251,191,36,0.10)",color:ev?"#022c22":"rgba(251,191,36,0.55)"},children:ey?"已领取":ev?"领取奖励":eb?"已领取":"进行中…"})]}),eb&&w.durationSec>0&&(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mt-1.5 text-[10px] text-muted-foreground/50 text-center",children:["完成用时 ",Math.floor(w.durationSec/60),"分",w.durationSec%60,"秒"]})]})),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" grid grid-cols-1 lg:grid-cols-2 gap-2.5",children:[(0,d.jsxs)("div",{style:{borderColor:"rgba(232,121,249,0.4)",background:"linear-gradient(135deg, rgba(232,121,249,0.12), rgba(0,0,0,0.45))",animation:ek?"none":"weekly-glow 3.5s ease-in-out infinite"},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" relative rounded-xl border p-3 overflow-hidden",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5",children:[(0,d.jsx)(tO.Zap,{className:"h-3.5 w-3.5 text-fuchsia-400"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-xs font-semibold text-fuchsia-200",children:"周挑战 · WEEKLY"})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1 text-[9px] text-muted-foreground/70",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-fuchsia-300/80",children:N.weekKey}),(0,d.jsx)(o1.Clock,{className:"h-2.5 w-2.5"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-fuchsia-300/90",children:O})]})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5 mb-2",children:[(0,d.jsxs)("span",{style:{background:`${ew.color}22`,color:ew.color,border:`1px solid ${ew.color}55`},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded flex items-center gap-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]]),children:ew.icon}),ew.label]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-white/5 text-muted-foreground border border-white/10",children:[ej.icon," ",ej.label]}),ek&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-300 border border-emerald-500/40 flex items-center gap-1",children:[(0,d.jsx)(es.Sparkles,{className:"h-2.5 w-2.5"})," 已完成"]})]}),(0,d.jsx)("h4",{style:{color:ew.color,textShadow:`0 0 10px ${ew.glow}`},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-sm font-semibold mb-1",children:N.title}),(0,d.jsx)("p",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/80 leading-relaxed mb-2",children:N.desc}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/70",children:"进度"}),(0,d.jsxs)("span",{style:{color:ew.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[11px] font-mono font-semibold",children:[Math.min(S.progress,N.goal)," / ",N.goal," ",ej.unit]})]}),(0,d.jsx)(D,{value:eN,className:"h-2 bg-black/40",style:{"--progress-color":ew.color}})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5 text-[10px]",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/60",children:"奖励:"}),N.rewardInsight>0&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-amber-300 font-mono",children:["+",(0,m.formatNum)(N.rewardInsight),"洞见"]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-fuchsia-300 font-mono",children:["+",N.rewardContact.toFixed(1),"接触"]})]}),(0,d.jsx)(ee.Button,{onClick:eo,disabled:!eT,size:"sm",className:"h-7 px-3 text-[11px] border-0",style:{background:eT?"linear-gradient(90deg, #34d399, #34d399cc)":"rgba(232,121,249,0.10)",color:eT?"#022c22":"rgba(232,121,249,0.55)"},children:eS?"已领取":eT?"领取奖励":ek?"已领取":"进行中…"})]}),ek&&S.durationSec>0&&(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mt-1.5 text-[10px] text-muted-foreground/50 text-center",children:["完成用时 ",Math.floor(S.durationSec/60),"分",S.durationSec%60,"秒"]})]}),(0,d.jsxs)("div",{style:{borderColor:"rgba(251,191,36,0.35)",background:"linear-gradient(135deg, rgba(251,191,36,0.10), rgba(251,113,133,0.10), rgba(0,0,0,0.4))"},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" relative rounded-xl border p-3 overflow-hidden",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5",children:[(0,d.jsx)(o4,{className:"h-3.5 w-3.5 text-amber-400"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-xs font-semibold text-amber-200",children:"信标链 · CHAIN"})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-baseline gap-1",children:[(0,d.jsx)(o7.Flame,{className:"h-3 w-3 text-rose-400"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/60",children:"连续"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" chain-streak-text text-2xl font-bold font-mono leading-none",children:C.currentStreak}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/60",children:"天"})]})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mb-2 flex items-center justify-between",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/70",children:eP?"今日已贡献":"今日尚未完成日挑战"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`text-[10px] font-mono px-1.5 py-0.5 rounded border ${eP?"bg-emerald-500/15 text-emerald-300 border-emerald-500/30":"bg-white/5 text-muted-foreground/70 border-white/10"}`,children:eP?"✓ 已记录":"○ 待完成"})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-2 relative",children:[(0,d.jsx)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" absolute top-6 left-[12.5%] right-[12.5%] h-[2px] bg-white/10"}),(r=(s={0:12.5,3:12.5,7:37.5,14:62.5,30:87.5})[eC.prev]??12.5,a=null!==eC.next?s[eC.next]??87.5:87.5,(i=Math.max(0,r+(a-r)*(eC.progressPct/100)-12.5))<=0?null:(0,d.jsx)("div",{style:{left:"12.5%",width:`${i}%`,background:"linear-gradient(90deg, #fbbf24, #fb7185)",boxShadow:"0 0 8px rgba(251,113,133,0.5)"},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" absolute top-6 h-[2px]"})),oQ.BEACON_CHAIN_MILESTONES.map(e=>{let t=oQ.BEACON_CHAIN_REWARDS.find(t=>t.milestone===e),s=C.milestonesClaimed.includes(e),r=C.currentStreak>=e&&!s,a=C.currentStreak>0&&eE===e,i="rgba(255,255,255,0.05)",n="rgba(255,255,255,0.15)",o="rgba(255,255,255,0.4)";return s?(i="rgba(52,211,153,0.25)",n="#34d399",o="#34d399"):r?(i="rgba(251,113,133,0.20)",n="#fb7185",o="#fb7185"):a&&(i="rgba(251,191,36,0.20)",n="#fbbf24",o="#fbbf24"),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex flex-col items-center gap-1 z-10 flex-1",children:[(0,d.jsx)("div",{style:{background:i,borderColor:n,color:o},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`w-12 h-12 rounded-full flex items-center justify-center font-mono font-bold text-sm border-2 ${r?"chain-milestone-reachable":""}`,children:s?(0,d.jsx)(es.Sparkles,{className:"h-4 w-4"}):e}),(0,d.jsx)("span",{style:{color:o},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] text-center leading-tight",children:t?.label}),s?(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] text-emerald-400/80 font-mono",children:"已领"}):r?(0,d.jsx)(ee.Button,{onClick:()=>el(e),size:"sm",className:"h-5 px-2 text-[9px] py-0 border-0",style:{background:"linear-gradient(90deg, #fb7185, #f43f5e)",color:"#1c0608"},children:"领取"}):(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] text-muted-foreground/40 font-mono",children:["+",t?.rewardInsight,"洞"]})]},e)})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/70",children:null===eC.next?"已通关全部里程碑":`下一目标:${eC.next} 天`}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono text-amber-300",children:[eC.current,null!==eC.next&&` / ${eC.next}`," 天"]})]}),(0,d.jsx)(D,{value:eC.progressPct,className:"h-1.5 bg-black/40",style:{"--progress-color":"#fbbf24"}})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between gap-2 text-[10px]",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-2",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/60",children:"最长"}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-amber-300",children:[C.longestStreak,"天"]})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-2",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/60",children:"累计"}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-rose-300",children:[C.totalCompletions,"次"]})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/60",children:"续命"}),C.graceUsed>=1?(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-rose-400/80",children:"已用"}):(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-emerald-400/80",children:"可用"})]})]})]})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" rounded-xl border border-white/10 bg-black/30 p-2.5",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between gap-2 mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5",children:[(0,d.jsx)(tV.Trophy,{className:"h-3.5 w-3.5 text-amber-400"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-xs font-semibold",children:"深空排行榜"})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-0.5 p-0.5 rounded-lg bg-black/40 border border-white/10",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>U("local"),"aria-pressed":"local"===G,className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-mono transition-colors ${"local"===G?"bg-amber-500/25 text-amber-300 border border-amber-500/40":"text-muted-foreground/60 hover:text-muted-foreground border border-transparent"}`,children:[(0,d.jsx)(tV.Trophy,{className:"h-2.5 w-2.5"}),"本地"]}),(0,d.jsxs)("button",{type:"button",onClick:()=>U("global"),"aria-pressed":"global"===G,className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-mono transition-colors ${"global"===G?"bg-emerald-500/25 text-emerald-300 border border-emerald-500/40":"text-muted-foreground/60 hover:text-muted-foreground border border-transparent"}`,children:[(0,d.jsx)(o6,{className:"h-2.5 w-2.5"}),"全球"]})]}),"global"===G&&(0,d.jsx)("button",{type:"button",onClick:()=>void ea(),disabled:q,"aria-label":"刷新全球榜",title:"刷新全球榜",className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" p-1 rounded-md text-muted-foreground/70 hover:text-emerald-300 hover:bg-emerald-500/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:(0,d.jsx)(o8.RefreshCw,{className:`h-3 w-3 ${q?"animate-spin":""}`})})]})]}),(0,d.jsx)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mb-1.5 text-[10px] text-muted-foreground/50 flex items-center gap-2",children:"local"===G?(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]]),children:["本机 Top ",A.length||0," · 离线可用"]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]]),children:["全球 Top ",H.length||0]}),Z&&!q&&H.length>0&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-emerald-400/60",children:"· 已同步"}),q&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-amber-400/70 flex items-center gap-1",children:[(0,d.jsx)(lt,{className:"h-2.5 w-2.5 animate-spin"}),"同步中…"]})]})}),"local"===G&&(0===A.length?(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-center py-4 text-[11px] text-muted-foreground/40",children:[(0,d.jsx)(tV.Trophy,{className:"h-6 w-6 mx-auto mb-1 opacity-30"}),"尚无记录。完成限时、每日或本周信标即可登榜。"]}):(0,d.jsx)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" space-y-0.5 max-h-[200px] overflow-y-auto echo-scroll",children:A.map((e,t)=>{let s=lr(t),r=oQ.BEACON_DIFFICULTY[e.difficulty],a=oQ.BEACON_TYPE_META[e.challenge],i=e.dateKey===(0,oQ.getTodayKey)()||e.dateKey===(0,oQ.getWeekKey)()||e.dateKey===(0,oQ.getTimedSlotKey)();return(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`flex items-center gap-2 px-2 py-1 rounded-lg text-[11px] ${e.isWeekly?"bg-fuchsia-500/10 border border-fuchsia-500/20":e.isTimed?"bg-amber-500/10 border border-amber-500/20":i?"bg-fuchsia-500/10 border border-fuchsia-500/20":"hover:bg-white/5"}`,children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" w-6 flex items-center justify-center",children:s?(0,d.jsx)(s.icon,{className:"h-3.5 w-3.5",style:{color:s.color}}):(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/50 font-mono",children:t+1})}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1 flex-1 min-w-0",children:[(0,d.jsx)("span",{style:{color:r.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono",children:r.icon}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/80 truncate",children:a.label}),e.isWeekly&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] font-mono px-1 rounded bg-fuchsia-500/20 text-fuchsia-300 border border-fuchsia-500/40",children:"WEEK"}),e.isTimed&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] font-mono px-1 rounded bg-amber-500/20 text-amber-300 border border-amber-500/40",children:"TIMED"}),e.progress>=1&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-emerald-400/70",children:"✓"})]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/50 font-mono text-[10px] w-16 text-right",children:[Math.floor(e.durationSec/60),"m",e.durationSec%60,"s"]}),(0,d.jsx)("span",{style:{color:r.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono font-semibold w-12 text-right",children:(0,m.formatNum)(e.score)})]},`local-${e.timestamp}-${t}`)})})),"global"===G&&(0,d.jsx)(d.Fragment,{children:q&&0===H.length?(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-center py-4 text-[11px] text-muted-foreground/60 flex items-center justify-center gap-2",children:[(0,d.jsx)(lt,{className:"h-3.5 w-3.5 animate-spin text-emerald-400"}),"正在拉取全球榜…"]}):0===H.length?(0,d.jsx)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-center py-4 text-[11px] text-muted-foreground/40",children:K?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(le,{className:"h-6 w-6 mx-auto mb-1 opacity-40 text-rose-400"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-rose-300/70",children:K}),(0,d.jsx)("button",{type:"button",onClick:()=>void ea(),className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" block mx-auto mt-2 text-[10px] text-emerald-400/80 hover:text-emerald-300 underline-offset-2 hover:underline",children:"重试"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o6,{className:"h-6 w-6 mx-auto mb-1 opacity-30 text-emerald-400"}),"尚无全球记录。完成挑战并领取即可登顶全球榜!"]})}):(0,d.jsx)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" space-y-0.5 max-h-[200px] overflow-y-auto echo-scroll",children:H.map((e,t)=>{let s=lr(t),r=oQ.BEACON_DIFFICULTY[e.difficulty]??oQ.BEACON_DIFFICULTY.routine,a=oQ.BEACON_TYPE_META[e.challenge]??{label:e.challenge,icon:"·",unit:""},i=Q>0&&e.timestamp===Q;return(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`flex items-center gap-2 px-2 py-1 rounded-lg text-[11px] ${i?"bg-emerald-500/15 border border-emerald-500/40 shadow-[0_0_12px_rgba(52,211,153,0.25)]":e.isWeekly?"bg-fuchsia-500/10 border border-fuchsia-500/20":e.isTimed?"bg-amber-500/10 border border-amber-500/20":"hover:bg-white/5"}`,children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" w-6 flex items-center justify-center",children:s?(0,d.jsx)(s.icon,{className:"h-3.5 w-3.5",style:{color:s.color}}):(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`font-mono ${i?"text-emerald-300 font-bold":"text-muted-foreground/50"}`,children:t+1})}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1 flex-1 min-w-0",children:[(0,d.jsx)("span",{style:{color:r.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono",children:r.icon}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/80 truncate",children:a.label}),e.isWeekly&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] font-mono px-1 rounded bg-fuchsia-500/20 text-fuchsia-300 border border-fuchsia-500/40",children:"WEEK"}),e.isTimed&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] font-mono px-1 rounded bg-amber-500/20 text-amber-300 border border-amber-500/40",children:"TIMED"}),i&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] font-mono px-1 rounded bg-emerald-500/25 text-emerald-200 border border-emerald-500/50",children:"YOU"}),e.progress>=1&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-emerald-400/70",children:"✓"})]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/50 font-mono text-[10px] w-16 text-right",children:[Math.floor(e.durationSec/60),"m",e.durationSec%60,"s"]}),(0,d.jsx)("span",{style:{color:i?"#34d399":r.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono font-semibold w-12 text-right",children:(0,m.formatNum)(e.score)})]},`global-${e.timestamp}-${t}`)})})})]}),(0,d.jsx)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-center gap-3 text-[9px] text-muted-foreground/50",children:ls.map(e=>{let t=oQ.BEACON_DIFFICULTY[e];return(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1",children:[(0,d.jsx)("span",{style:{color:t.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]]),children:t.icon}),t.label," ×",t.mult]},e)})})]})}var li=e.i(73375);function ln(){let[e,t]=(0,u.useState)(!1),[s,r]=(0,u.useState)(0),[a,i]=(0,u.useState)(null),[n,o]=(0,u.useState)(!1),l=(0,u.useRef)(null);(0,u.useEffect)(()=>{if(!function(){try{return"1"===localStorage.getItem(tC)}catch{return!0}}()){let e=setTimeout(()=>t(!0),600);return()=>clearTimeout(e)}},[]),(0,u.useEffect)(()=>{let e=()=>{r(0),o(!1),t(!0)};return window.addEventListener("echo-nexus-tutorial-restart",e),()=>window.removeEventListener("echo-nexus-tutorial-restart",e)},[]),(0,f.useGameStore)(e=>e.crystals),(0,f.useGameStore)(e=>e.pulsePower),(0,f.useGameStore)(e=>e.tech),(0,f.useGameStore)(e=>e.activePuzzle),(0,f.useGameStore)(e=>!!e.activeExpedition&&!e.activeExpedition.finished);let c=(0,u.useRef)(null);(0,u.useEffect)(()=>{if(!e)return;let t=tT[s];if(!t?.expectAction)return;let r=0,a=()=>{let e=f.useGameStore.getState(),s=!1;"pulse"===t.expectAction?(null===c.current&&(c.current=e.crystals),s=e.crystals>=(c.current??0)+Math.max(.5,.5*e.pulsePower)):"decode-start"===t.expectAction?s=!!e.activePuzzle:"tech-buy"===t.expectAction?s=Object.values(e.tech).some(e=>e>0):"expedition-start"===t.expectAction&&(s=!!e.activeExpedition&&!e.activeExpedition.finished),o(e=>e!==s?s:e),r=requestAnimationFrame(a)};return r=requestAnimationFrame(a),()=>cancelAnimationFrame(r)},[e,s]);let h=(0,u.useCallback)(()=>{let e=tT[s];if(!e?.target)return void i(null);let t=document.querySelector(`[data-tut="${e.target}"]`);if(!t)return void i(null);let r=t.getBoundingClientRect();i({left:r.left,top:r.top,width:r.width,height:r.height})},[s]);(0,u.useEffect)(()=>{if(!e)return;let t=()=>{h(),l.current=requestAnimationFrame(t)};return l.current=requestAnimationFrame(t),()=>{l.current&&cancelAnimationFrame(l.current)}},[e,s,h]);let m=(0,u.useCallback)(()=>{t(!1);try{localStorage.setItem(tC,"1")}catch{}},[]),p=(0,u.useCallback)(()=>{s>=tT.length-1?m():(r(e=>e+1),o(!1))},[s,m]),x=(0,u.useCallback)(()=>{s<=0||(r(e=>e-1),o(!1))},[s]);if(!e)return null;let g=tT[s],b=s>=tT.length-1,y=g.placement??"auto",v={};return v=a?"right"===y?{left:a.left+a.width+16,top:a.top+a.height/2,transform:"translateY(-50%)"}:"left"===y?{left:Math.max(16,a.left-360-16),top:a.top+a.height/2,transform:"translateY(-50%)",maxWidth:340}:"top"===y?{left:Math.max(16,Math.min(a.left,window.innerWidth-360-16)),top:Math.max(16,a.top-220),maxWidth:340}:{left:Math.max(16,Math.min(window.innerWidth/2-170,window.innerWidth-360-16)),top:Math.min(window.innerHeight-260,(a?.bottom??window.innerHeight/2)+16),maxWidth:340}:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",maxWidth:440},(0,d.jsxs)("div",{className:"fixed inset-0 z-[79]",children:[(()=>{if(!a)return(0,d.jsx)("div",{className:"fixed inset-0 bg-black/70 z-[80] pointer-events-auto"});let{left:e,top:t,width:s,height:r}=a,i=e-6,n=t-6,o=s+12,l=r+12;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"fixed bg-black/70 z-[80] pointer-events-auto",style:{left:0,top:0,right:0,height:Math.max(0,n)}}),(0,d.jsx)("div",{className:"fixed bg-black/70 z-[80] pointer-events-auto",style:{left:0,top:n+l,right:0,bottom:0}}),(0,d.jsx)("div",{className:"fixed bg-black/70 z-[80] pointer-events-auto",style:{left:0,top:n,width:Math.max(0,i),height:l}}),(0,d.jsx)("div",{className:"fixed bg-black/70 z-[80] pointer-events-auto",style:{left:i+o,top:n,right:0,height:l}}),(0,d.jsx)("div",{className:"fixed z-[81] pointer-events-none rounded-lg",style:{left:i,top:n,width:o,height:l,boxShadow:"0 0 0 2px rgba(232,121,249,0.9), 0 0 24px 4px rgba(232,121,249,0.5)",animation:"tut-pulse 1.6s ease-in-out infinite"}})]})})(),(0,d.jsx)("div",{className:"fixed z-[82] w-[340px] sm:w-[360px] max-w-[calc(100vw-32px)]",style:v,children:(0,d.jsxs)("div",{className:"relative rounded-2xl border border-fuchsia-400/40 bg-gradient-to-br from-[#1a0a2e]/95 to-[#0a0a1e]/95 backdrop-blur-xl shadow-2xl shadow-fuchsia-500/20 overflow-hidden",children:[(0,d.jsx)("div",{className:"h-1 w-full bg-gradient-to-r from-emerald-400 via-fuchsia-500 to-rose-400"}),(0,d.jsx)("button",{onClick:m,className:"absolute top-2 right-2 h-7 w-7 rounded-full flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-white/10 transition z-10","aria-label":"关闭教程",children:(0,d.jsx)(et.X,{className:"h-3.5 w-3.5"})}),(0,d.jsxs)("div",{className:"p-4 pt-3.5",children:[(0,d.jsx)("div",{className:"flex items-center gap-1.5 mb-2.5",children:tT.map((e,t)=>(0,d.jsx)("div",{className:`h-1 rounded-full transition-all ${t===s?"w-6 bg-fuchsia-400":t<s?"w-3 bg-fuchsia-400/50":"w-3 bg-white/15"}`},e.id))}),(0,d.jsxs)("h3",{className:"text-sm font-bold text-fuchsia-100 mb-1.5 flex items-center gap-1.5 pr-6",children:[(0,d.jsx)(es.Sparkles,{className:"h-3.5 w-3.5 text-fuchsia-300 shrink-0"}),g.title]}),(0,d.jsx)("p",{className:"text-[12.5px] text-muted-foreground leading-relaxed whitespace-pre-line",children:g.body}),g.expectAction&&!n&&(0,d.jsxs)("div",{className:"mt-3 px-2.5 py-1.5 rounded-lg bg-amber-500/10 border border-amber-400/30 text-[11px] text-amber-200 flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-400 animate-pulse"}),"完成动作后自动进入下一步,或点跳过"]}),g.expectAction&&n&&(0,d.jsx)("div",{className:"mt-3 px-2.5 py-1.5 rounded-lg bg-emerald-500/10 border border-emerald-400/30 text-[11px] text-emerald-200 flex items-center gap-1.5",children:"✓ 已检测到动作"}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-4",children:[(0,d.jsxs)(ee.Button,{size:"sm",variant:"ghost",onClick:x,disabled:0===s,className:"h-7 px-2 text-[11px] text-muted-foreground hover:text-foreground",children:[(0,d.jsx)(li.ChevronLeft,{className:"h-3.5 w-3.5"}),"上一步"]}),(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,d.jsx)(ee.Button,{size:"sm",variant:"ghost",onClick:m,className:"h-7 px-2 text-[11px] text-muted-foreground hover:text-foreground",children:"跳过"}),(0,d.jsxs)(ee.Button,{size:"sm",onClick:p,className:"h-7 px-3 text-[11px] bg-fuchsia-500 hover:bg-fuchsia-600 text-white border-fuchsia-400/50",children:[b?"完成":"下一步",(0,d.jsx)(tD.ChevronRight,{className:"h-3.5 w-3.5 ml-0.5"})]})]})]}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground/60 text-center mt-2",children:[s+1," / ",tT.length]})]})]})})]})}var lo=e.i(70703),ll=e.i(33755);let lc=(0,x.default)("compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var ld=e.i(55711);let lu=(0,x.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),lh=(0,x.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),lf={Compass:lc,Brain:ld.Brain,Swords:tP.Swords,Sparkles:es.Sparkles},lm={exploration:{text:"text-emerald-300",border:"border-emerald-400/30",borderActive:"border-emerald-400/70",bg:"bg-emerald-500/10",ring:"ring-emerald-400/40",barFrom:"from-emerald-400",barTo:"to-emerald-500",glow:"rgba(52,211,153,0.45)"},wisdom:{text:"text-fuchsia-300",border:"border-fuchsia-400/30",borderActive:"border-fuchsia-400/70",bg:"bg-fuchsia-500/10",ring:"ring-fuchsia-400/40",barFrom:"from-fuchsia-400",barTo:"to-fuchsia-500",glow:"rgba(232,121,249,0.45)"},courage:{text:"text-amber-300",border:"border-amber-400/30",borderActive:"border-amber-400/70",bg:"bg-amber-500/10",ring:"ring-amber-400/40",barFrom:"from-amber-400",barTo:"to-amber-500",glow:"rgba(251,191,36,0.45)"},inspiration:{text:"text-rose-300",border:"border-rose-400/30",borderActive:"border-rose-400/70",bg:"bg-rose-500/10",ring:"ring-rose-400/40",barFrom:"from-rose-400",barTo:"to-rose-500",glow:"rgba(251,113,133,0.45)"}};function lp(){let e=(0,f.useGameStore)(e=>e.attributes),t=(0,f.useGameStore)(e=>e.attributeProgress),s=(0,f.useGameStore)(e=>e.pendingAttrPoints??0),r=(0,f.useGameStore)(e=>e.allocateAttribute),a=(0,u.useMemo)(()=>(0,ll.getAllBonuses)(e),[e]),i=(0,u.useMemo)(()=>(0,ll.totalAttributeLevel)(e),[e]),n=(0,u.useMemo)(()=>(0,ll.totalAttributeBonusPct)(e),[e]);return(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f flex flex-col gap-2.5 h-full overflow-y-auto echo-scroll pr-0.5",children:[(0,d.jsx)(I.default,{id:"fb70db4abea5ec9f",children:".echo-scroll::-webkit-scrollbar{width:4px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff1f;border-radius:2px}.echo-scroll::-webkit-scrollbar-track{background:0 0}@keyframes echo-pending-pulse{0%,to{box-shadow:0 0 #e879f980}50%{box-shadow:0 0 14px 4px #e879f9a6}}.echo-pending-pulse{animation:1.6s ease-in-out infinite echo-pending-pulse}@keyframes echo-card-glow{0%,to{opacity:.5}50%{opacity:1}}"}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f flex items-center justify-between",children:[(0,d.jsx)("h3",{className:"jsx-fb70db4abea5ec9f text-sm font-semibold flex items-center gap-1.5",children:(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f bg-gradient-to-br from-emerald-300 via-fuchsia-300 to-rose-300 bg-clip-text text-transparent",children:"驾驶员属性"})}),(0,d.jsxs)("div",{className:`jsx-fb70db4abea5ec9f text-[10px] px-2 py-0.5 rounded-full border ${s>0?"border-fuchsia-400/60 bg-fuchsia-500/15 text-fuchsia-200 echo-pending-pulse font-bold":"border-white/15 bg-black/25 text-muted-foreground"}`,children:["待分配 ",s]})]}),(0,d.jsx)("div",{className:"jsx-fb70db4abea5ec9f grid grid-cols-2 lg:grid-cols-4 gap-2",children:ll.ATTRIBUTE_KEYS.map(a=>{let i=ll.ATTRIBUTE_CONFIG[a],n=lm[a],o=lf[i.icon]??es.Sparkles,l=e?.[a]??0,c=t?.[a]??{exp:0,level:l},u=100*(0,ll.getAttributeBonus)(l),h=(0,ll.expRequiredForLevel)(l),f=c.exp,m=h>0?Math.min(100,f/h*100):100,p=l>=ll.ATTRIBUTE_HARD_CAP,x=s>0&&!p,g=l>ll.ATTRIBUTE_LINEAR_CAP;return(0,d.jsxs)("div",{style:{boxShadow:`inset 0 0 18px ${n.glow}`},className:`jsx-fb70db4abea5ec9f relative rounded-xl border ${n.border} ${n.bg} p-2.5 flex flex-col gap-1.5 overflow-hidden transition-all duration-300`,children:[(0,d.jsx)("div",{style:{background:i.hex},className:"jsx-fb70db4abea5ec9f pointer-events-none absolute -top-8 -right-8 h-20 w-20 rounded-full blur-2xl opacity-50"}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f relative flex items-center gap-1.5",children:[(0,d.jsx)("div",{style:{boxShadow:`0 0 8px ${n.glow}`},className:`jsx-fb70db4abea5ec9f shrink-0 h-7 w-7 rounded-lg flex items-center justify-center ${n.bg} border ${n.border}`,children:(0,d.jsx)(o,{className:`jsx-fb70db4abea5ec9f h-3.5 w-3.5 ${n.text}`})}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f min-w-0 flex-1 leading-tight",children:[(0,d.jsx)("div",{className:`jsx-fb70db4abea5ec9f text-[11px] font-semibold ${n.text} truncate`,children:i.name}),(0,d.jsx)("div",{className:"jsx-fb70db4abea5ec9f text-[8px] text-muted-foreground/70 uppercase tracking-wider truncate",children:i.enName})]}),(0,d.jsxs)("div",{className:`jsx-fb70db4abea5ec9f shrink-0 text-[9px] px-1.5 py-0.5 rounded font-mono font-bold ${p?"bg-amber-400/20 text-amber-200 border border-amber-400/40":"bg-black/30 text-white/80 border border-white/10"}`,children:["Lv.",l]})]}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f relative flex items-end justify-between",children:[(0,d.jsxs)("span",{className:`jsx-fb70db4abea5ec9f text-lg font-mono font-bold ${n.text} leading-none`,children:[l,(0,d.jsxs)("span",{className:"jsx-fb70db4abea5ec9f text-[9px] text-muted-foreground/60 ml-0.5",children:["/",ll.ATTRIBUTE_HARD_CAP]})]}),(0,d.jsxs)("span",{className:`jsx-fb70db4abea5ec9f text-[10px] ${n.text} font-mono`,children:["+",u.toFixed(1),"%"]})]}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f relative",children:[(0,d.jsx)("div",{className:"jsx-fb70db4abea5ec9f h-1.5 rounded-full bg-black/40 overflow-hidden border border-white/5",children:(0,d.jsx)("div",{style:{width:`${p?100:m}%`,boxShadow:`0 0 6px ${n.glow}`},className:`jsx-fb70db4abea5ec9f h-full bg-gradient-to-r ${n.barFrom} ${n.barTo} transition-all duration-500`})}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f flex items-center justify-between mt-0.5 text-[8px] text-muted-foreground/70 font-mono",children:[(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f",children:p?"已满级":`${f} / ${h} EXP`}),g&&!p&&(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f text-amber-300/70",children:"递减区"})]})]}),(0,d.jsx)("div",{className:"jsx-fb70db4abea5ec9f relative flex flex-col gap-0.5 mt-0.5",children:i.effects.map((e,t)=>(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f text-[8.5px] text-muted-foreground/70 leading-tight flex items-center gap-1",children:[(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f "+(n.text||""),children:"·"}),(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f truncate",children:e})]},t))}),(0,d.jsxs)("button",{type:"button",disabled:!x,onClick:()=>r(a,1),"aria-label":`分配 1 点到 ${i.name}`,style:x?{boxShadow:`0 0 8px ${n.glow}`}:void 0,className:`jsx-fb70db4abea5ec9f relative mt-auto rounded-md border px-1.5 py-1 flex items-center justify-center gap-0.5 text-[10px] font-bold transition-all ${x?`${n.borderActive} ${n.bg} ${n.text} hover:scale-105 cursor-pointer`:"border-white/5 bg-black/20 text-muted-foreground/30 cursor-not-allowed"}`,children:[(0,d.jsx)(lu,{className:"h-3 w-3"}),(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f",children:"分配"})]})]},a)})}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f mt-auto rounded-lg border border-white/10 bg-black/30 px-2.5 py-1.5 flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f flex items-center gap-1.5 text-[10px]",children:[(0,d.jsx)(lh,{className:"h-3 w-3 text-fuchsia-300"}),(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f text-muted-foreground",children:"总等级"}),(0,d.jsxs)("span",{className:"jsx-fb70db4abea5ec9f font-mono font-bold text-fuchsia-200",children:[i,(0,d.jsxs)("span",{className:"jsx-fb70db4abea5ec9f text-muted-foreground/60 text-[9px]",children:["/",4*ll.ATTRIBUTE_HARD_CAP]})]})]}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f flex items-center gap-2 text-[10px]",children:[(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f text-muted-foreground",children:"总加成"}),(0,d.jsxs)("span",{className:"jsx-fb70db4abea5ec9f font-mono font-bold text-emerald-200",children:["+",n.toFixed(1),"%"]})]})]}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f grid grid-cols-2 gap-1 text-[9px]",children:[(0,d.jsx)(lx,{label:"探险力",value:`\xd7${a.expeditionPowerMult.toFixed(2)}`,color:"text-emerald-300"}),(0,d.jsx)(lx,{label:"解码步数",value:`+${a.decodeStepsBonus}`,color:"text-fuchsia-300"}),(0,d.jsx)(lx,{label:"洞见倍率",value:`+${(100*a.insightMultAdd).toFixed(1)}%`,color:"text-fuchsia-300"}),(0,d.jsx)(lx,{label:"自动解码周期",value:`\xd7${a.autoDecodeIntervalMult.toFixed(2)}`,color:"text-fuchsia-300"}),(0,d.jsx)(lx,{label:"探险生命",value:`+${a.expeditionHpBonus}`,color:"text-amber-300"}),(0,d.jsx)(lx,{label:"BOSS 胜率",value:`+${(100*a.bossWinRateBonus).toFixed(1)}%`,color:"text-amber-300"}),(0,d.jsx)(lx,{label:"巡航护盾",value:`+${a.cruiseShieldBonus}`,color:"text-amber-300"}),(0,d.jsx)(lx,{label:"接触率",value:`\xd7${a.contactRateMult.toFixed(2)}`,color:"text-rose-300"}),(0,d.jsx)(lx,{label:"星潮触发",value:`+${(100*a.tideTriggerBonus).toFixed(1)}%`,color:"text-rose-300"}),(0,d.jsx)(lx,{label:"脉冲连击",value:`+${(100*a.pulseComboBonus).toFixed(1)}%`,color:"text-rose-300"}),(0,d.jsx)(lx,{label:"巡航速度",value:`\xd7${a.cruiseShipSpeedMult.toFixed(2)}`,color:"text-emerald-300"}),(0,d.jsx)(lx,{label:"产能加成",value:`\xd7${a.crystalsPerSecMult.toFixed(2)}`,color:"text-emerald-300"})]}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f text-[9px] text-muted-foreground/60 text-center leading-tight",children:["每次飞升获得 ",(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f text-fuchsia-300 font-mono",children:"飞升次数 × 2 + 1"})," 点属性点;完成对应活动自动累积经验"]})]})}function lx({label:e,value:t,color:s}){return(0,d.jsxs)("div",{className:"flex items-center justify-between rounded bg-black/25 border border-white/5 px-1.5 py-0.5",children:[(0,d.jsx)("span",{className:"text-muted-foreground/80 truncate",children:e}),(0,d.jsx)("span",{className:`font-mono ${s}`,children:t})]})}let lg=(0,x.default)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);var lb=e.i(66992);let ly=(0,x.default)("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]),lv=(0,x.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);function lw(){let e=(0,f.useGameStore)(),t=[],s=m.TECH_TREE.filter(t=>!e.tech[t.id]).sort((e,t)=>e.cost-t.cost)[0];if(s){let r=Math.min(100,e.insights/s.cost*100);t.push({id:"tech_"+s.id,icon:lb.Cpu,color:"#34d399",label:s.name,detail:`需 ${s.cost} 洞见 \xb7 ${s.desc}`,progress:r,hint:e.insights>=s.cost?"可解锁":`还差 ${s.cost-e.insights} 洞见`})}let r=tF.ACHIEVEMENTS.find(t=>!e.achievements[t.id]);r&&t.push({id:"ach_"+r.id,icon:tV.Trophy,color:"#fbbf24",label:r.name,detail:r.desc,progress:30,hint:r.rewardText});let a=m.FRAGMENTS.find(t=>!e.fragments[t.id]);if(a){let s=m.FRAGMENTS.filter(t=>e.fragments[t.id]).length;t.push({id:"frag_"+a.id,icon:ef.BookOpen,color:"#e879f9",label:a.title,detail:"解码晶体有概率获取",progress:s/m.FRAGMENTS.length*100,hint:`图谱 ${s}/${m.FRAGMENTS.length}`})}e.energy<tA.EXPEDITION_CONFIG.energyCost&&t.push({id:"expedition_energy",icon:eh,color:"#fb7185",label:"探险能量恢复中",detail:`满能量可深入遗迹`,progress:e.energy/tA.EXPEDITION_CONFIG.energyCost*100,hint:`${e.energy}/${tA.EXPEDITION_CONFIG.energyCost}`}),e.contact<100&&t.push({id:"ascension",icon:tt.Star,color:"#a78bfa",label:"接触进度",detail:"满 100 可飞升新周目",progress:e.contact,hint:`${e.contact.toFixed(1)}/100`});let i=e.constellation??[];e.pendingPerkChoices&&e.pendingPerkChoices.length>0?t.push({id:"constellation_pending",icon:es.Sparkles,color:"#e879f9",label:"星图觉醒待选择",detail:"3 选 1 永久天赋",progress:100,hint:"立即选择"}):i.length<tr.CONSTELLATION_PERKS.length&&e.ascensions>0&&t.push({id:"constellation_next",icon:tt.Star,color:"#e879f9",label:"下一道星图天赋",detail:`已觉醒 ${i.length}/${tr.CONSTELLATION_PERKS.length}`,progress:i.length/tr.CONSTELLATION_PERKS.length*100,hint:"飞升后解锁"});let n=t.slice(0,3);return 0===n.length?(0,d.jsxs)("div",{className:"rounded-xl border border-emerald-400/20 bg-emerald-950/10 p-3 text-center",children:[(0,d.jsx)(lv,{className:"h-5 w-5 text-emerald-400 mx-auto mb-1"}),(0,d.jsx)("p",{className:"text-[11px] text-emerald-200/80",children:"所有目标已达成"}),(0,d.jsx)("p",{className:"text-[9px] text-muted-foreground/60 mt-0.5",children:"继续飞升开启新周目"})]}):(0,d.jsxs)("div",{className:"rounded-xl border border-white/10 bg-black/30 p-2.5 space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(lg,{className:"h-3.5 w-3.5 text-emerald-400"}),(0,d.jsx)("span",{className:"text-[11px] font-semibold text-emerald-200",children:"探索目标"})]}),(0,d.jsx)("span",{className:"text-[9px] text-muted-foreground/50 font-mono",children:"RADAR"})]}),(0,d.jsx)("div",{className:"space-y-1.5",children:n.map(e=>{let t=e.icon,s=e.progress>=100;return(0,d.jsxs)("div",{className:`rounded-lg p-1.5 transition-all ${s?"bg-white/8 border border-white/15":"bg-black/20 border border-white/5"}`,style:s?{boxShadow:`0 0 10px ${e.color}33`}:void 0,children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,d.jsx)(t,{className:`h-3 w-3 shrink-0 ${s?"animate-pulse":""}`,style:{color:e.color}}),(0,d.jsx)("span",{className:"text-[10px] font-medium truncate flex-1",style:{color:s?e.color:"rgba(255,255,255,0.75)"},children:e.label}),(0,d.jsx)("span",{className:"text-[8px] font-mono text-muted-foreground/70 shrink-0",children:e.hint})]}),(0,d.jsx)("div",{className:"h-0.5 rounded-full bg-black/50 overflow-hidden",children:(0,d.jsx)("div",{className:"h-full transition-all duration-500",style:{width:`${Math.min(100,e.progress)}%`,background:e.color,boxShadow:s?`0 0 6px ${e.color}`:"none"}})}),(0,d.jsx)("p",{className:"text-[8px] text-muted-foreground/60 mt-0.5 truncate",children:e.detail})]},e.id)})}),(0,d.jsxs)("div",{className:"flex items-center gap-1 text-[8px] text-muted-foreground/50 pt-0.5 border-t border-white/5",children:[(0,d.jsx)(ly,{className:"h-2.5 w-2.5"}),(0,d.jsx)("span",{children:"持续探索 · 解锁深空奥秘"})]})]})}let lj=[{id:"relic_first_echo",name:"初次回响",race:"无名先驱",era:"纪元前 · 未知",icon:"✦",color:"#34d399",brief:"深空中第一缕被捕获的智慧信号。",story:"当自治无人机首次解码出这缕信号时,整个星核为之震颤。那不是噪声,而是某种古老文明留下的问候——跨越亿万年的回响,证明我们并不孤独。",unlockHint:"发起第一次脉冲扫描",unlock:e=>e.totalDecoded>=0||e.crystals>0,reward:{crystals:10},rewardText:"+10 晶体"},{id:"relic_crystal_whisper",name:"晶体低语",race:"晶语族",era:"第一纪元 · 晶石时代",icon:"◈",color:"#fb7185",brief:"能够将记忆封存在晶体中的远古种族。",story:"晶语族相信,记忆是宇宙的本质。他们建造了巨大的晶体矩阵,将整个文明的历史封存在谐振频率中。当他们的恒星熄灭时,唯有这些晶体在虚空中持续低语。",unlockHint:"累计解码 10 颗记忆晶体",unlock:e=>e.totalDecoded>=10,reward:{insights:20,crystalsPerSecPct:5},rewardText:"+20 洞见 · 产能 +5%"},{id:"relic_void_ark",name:"虚空方舟",race:"渡厄者",era:"第二纪元 · 大迁徙",icon:"❖",color:"#fbbf24",brief:"为逃离超新星爆发而建造的星际方舟。",story:"渡厄者的母星在一夜之间步入死亡。他们用三百年建造了十二艘方舟,每一艘都载着十亿灵魂的数字意识。如今,只有这一艘的残骸漂浮在我们的考古坐标上。",unlockHint:"完成 5 次遗迹探险",unlock:e=>e.totalExpeditions>=5,reward:{insights:30},rewardText:"+30 洞见"},{id:"relic_silent_court",name:"寂寂王朝",race:"静默王族",era:"第三纪元 · 铁律纪",icon:"♛",color:"#e879f9",brief:"以沉默为律法的神秘王朝。",story:"静默王族统治了三百个恒星系,却从未留下任何文字。他们的律法刻在引力波中,他们的诗歌写在脉冲星里。我们只能通过残余的引力涟漪,窥见这个王朝的辉煌与寂灭。",unlockHint:"击败 3 个探险 BOSS",unlock:e=>(e.bossKills??0)>=3,reward:{contact:10},rewardText:"+10 接触"},{id:"relic_starforge",name:"锻星炉",race:"铸星者",era:"第四纪元 · 恒星工程",icon:"✺",color:"#34d399",brief:"能够人工点燃恒星的工程文明。",story:"铸星者不满足于利用恒星能量,他们要创造恒星。他们建造了锻星炉——一种能在虚空中凝聚物质的巨型结构。然而,每一次点火都会消耗一整个星系的物质,最终他们自己也成为了燃料。",unlockHint:"解锁 6 项技术",unlock:e=>Object.values(e.tech).filter(e=>e>0).length>=6,reward:{insights:50,crystals:100},rewardText:"+50 洞见 · +100 晶体"},{id:"relic_memory_weaver",name:"忆织者",race:"织忆族",era:"第五纪元 · 意识网络",icon:"✧",color:"#fb7185",brief:"将集体意识编织成网络的心灵文明。",story:"织忆族没有个体概念。他们的每一个『我』都是网络的一个节点,死亡只是断开连接。当整个网络陷入沉睡时,他们编织了最后一张记忆之网,等待后人唤醒。我们的解码,正是唤醒。",unlockHint:"拼凑 4 块记忆碎片",unlock:e=>Object.values(e.fragments).filter(Boolean).length>=4,reward:{contact:15},rewardText:"+15 接触"},{id:"relic_eclipse_tribe",name:"蚀相部落",race:"蚀相族",era:"第六纪元 · 阴影纪",icon:"☀",color:"#fbbf24",brief:"栖身于食恒星阴影中的猎手文明。",story:"蚀相族敬畏阴影。他们在双星系统的食相瞬间狩猎,在光与暗的边界舞蹈。当一颗恒星被吞噬殆尽,他们便迁徙至下一对双星。他们的遗迹,永远隐藏在某个行星的阴影里。",unlockHint:"亲历 3 种星潮事件",unlock:e=>(e.starTidesEncountered??[]).length>=3,reward:{insights:40},rewardText:"+40 洞见"},{id:"relic_ascended",name:"飞升者遗迹",race:"前代飞升者",era:"终末纪元 · 超越",icon:"✦",color:"#e879f9",brief:"曾经的飞升者留下的最后讯息。",story:"在我们之前,已有无数文明触碰到飞升的临界点。他们留下了什么?不是技术,不是财富,而是一句跨越时空的低语:「飞升不是终点,而是新的开始。勇敢者,继续探索。」",unlockHint:"完成第一次飞升",unlock:e=>e.ascensions>=1,reward:{insights:100,contact:25},rewardText:"+100 洞见 · +25 接触"},{id:"relic_constellation",name:"星图密钥",race:"观星者议会",era:"永恒 · 星图守护者",icon:"✧",color:"#34d399",brief:"守护星图天赋秘密的远古议会。",story:"观星者议会不属于任何时代。他们存在于所有时代的星图中,守护着飞升的真正秘密:每一道星图天赋,都是前代飞升者留下的礼物。集齐所有天赋,便能窥见宇宙的真相。",unlockHint:"觉醒 6 道星图天赋",unlock:e=>(e.constellation??[]).length>=6,reward:{insights:80},rewardText:"+80 洞见"},{id:"relic_chronicle",name:"编年史之心",race:"史官族",era:"全纪元 · 记录者",icon:"❖",color:"#fb7185",brief:"记录所有纪元兴衰的永恒史官。",story:"史官族从不干涉,只记录。他们的身体是活体的编年史,每一个细胞都承载着一个纪元的记忆。当最后一个史官死去时,他将所有记忆注入了这颗编年史之心,等待后人继承。",unlockHint:"积累 5 段编年史",unlock:e=>(e.chronicle??[]).length>=5,reward:{insights:60,contact:20},rewardText:"+60 洞见 · +20 接触"},{id:"relic_attribute",name:"四维之证",race:"原型人格",era:"元始 · 自我觉醒",icon:"◈",color:"#fbbf24",brief:"自我觉醒的四维人格原型。",story:"探索力、智慧、勇气、灵感——这四维属性并非凭空而来。它们源自一个远古的原型人格,那个第一次说出「我」的存在。我们的每一次成长,都是对那个原型的回响。",unlockHint:"任一角色属性达到 30",unlock:e=>{let t=e.attributes;return!!t&&(t.exploration>=30||t.wisdom>=30||t.courage>=30||t.inspiration>=30)},reward:{insights:50},rewardText:"+50 洞见"},{id:"relic_cruise",name:"深空航迹",race:"远航者联盟",era:"第七纪元 · 星海远航",icon:"➤",color:"#e879f9",brief:"穿越星海寻找新家园的远航者。",story:"远航者联盟由十二个种族组成,他们共享一艘巨型母舰,在星海中寻找新的家园。他们留下了航迹图——每一道光痕都是一段旅程,每一个航点都是一个希望。我们的巡航,正是延续他们的航迹。",unlockHint:"深空巡航累计通关 5 关",unlock:e=>{try{let e=localStorage.getItem("echo-nexus-cruise-v1");if(!e)return!1;return(JSON.parse(e).totalClears??0)>=5}catch{return!1}},reward:{insights:70,crystals:200},rewardText:"+70 洞见 · +200 晶体"}];function lN(e){return lj.filter(t=>t.unlock(e))}let lk=(0,x.default)("book-marked",[["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"}]]),lS=(0,x.default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),lT=(0,x.default)("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);function lC(){let e=(0,f.useGameStore)(),[t,s]=(0,u.useState)(null),r=lN(e),a=lN(e).length/lj.length*100,i=function(e){let t=lN(e),s=0,r=0,a=0,i=0;for(let e of t)e.reward.crystals&&(s+=e.reward.crystals),e.reward.insights&&(r+=e.reward.insights),e.reward.contact&&(a+=e.reward.contact),e.reward.crystalsPerSecPct&&(i+=e.reward.crystalsPerSecPct);return{crystals:s,insights:r,contact:a,crystalsPerSecPct:i}}(e),n=t?lj.find(e=>e.id===t):null;return(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex flex-col gap-2.5 h-full min-h-0",children:[(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center justify-between gap-2",children:[(0,d.jsxs)("h3",{className:"jsx-89979d12e77b884d text-sm font-semibold flex items-center gap-1.5 shrink-0",children:[(0,d.jsx)(lk,{className:"h-4 w-4 text-fuchsia-400"}),"遗迹图鉴"]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-2 text-[10px] font-mono",children:[(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-fuchsia-300",children:r.length}),(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-muted-foreground/50",children:"/"}),(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-muted-foreground",children:lj.length}),(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-muted-foreground/60",children:["(",a.toFixed(0),"%)"]})]})]}),(0,d.jsx)("div",{className:"jsx-89979d12e77b884d h-1 rounded-full bg-black/40 overflow-hidden",children:(0,d.jsx)("div",{style:{width:`${a}%`,boxShadow:"0 0 8px rgba(232,121,249,0.5)"},className:"jsx-89979d12e77b884d h-full bg-gradient-to-r from-fuchsia-500 via-rose-400 to-amber-400 transition-all duration-500"})}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d rounded-lg border border-fuchsia-400/20 bg-fuchsia-950/20 px-2.5 py-1.5 flex items-center gap-2 text-[10px] flex-wrap",children:[(0,d.jsx)(es.Sparkles,{className:"h-3 w-3 text-fuchsia-400 shrink-0"}),(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-fuchsia-300/80",children:"考古收获"}),i.crystals>0&&(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-emerald-300",children:["+",i.crystals," 晶体"]}),i.insights>0&&(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-amber-300",children:["+",i.insights," 洞见"]}),i.contact>0&&(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-fuchsia-300",children:["+",i.contact," 接触"]}),i.crystalsPerSecPct>0&&(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-emerald-300",children:["产能 +",i.crystalsPerSecPct,"%"]}),0===r.length&&(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-muted-foreground/60",children:"持续探索解锁奖励"})]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex-1 min-h-0 overflow-y-auto echo-scroll pr-1",children:[(0,d.jsx)("div",{className:"jsx-89979d12e77b884d grid grid-cols-1 sm:grid-cols-2 gap-1.5",children:lj.map(r=>{let a=!!e.achievements?.[`relic_${r.id}`]||r.unlock(e),i=t===r.id;return(0,d.jsxs)("button",{onClick:()=>s(i?null:r.id),style:a?{boxShadow:`inset 0 0 14px ${r.color}10`}:void 0,className:`jsx-89979d12e77b884d relative rounded-lg border px-2.5 py-2 transition-all duration-300 min-h-[72px] text-left ${a?i?"border-white/30 bg-white/8":"border-white/15 bg-black/30 hover:bg-black/40":"border-white/5 bg-black/15 opacity-70"}`,children:[a&&(0,d.jsx)("div",{style:{background:r.color},className:"jsx-89979d12e77b884d absolute -top-6 -right-6 h-14 w-14 rounded-full blur-2xl opacity-30 pointer-events-none"}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d relative flex items-start gap-2",children:[(0,d.jsx)("div",{style:{background:a?`${r.color}22`:"rgba(255,255,255,0.04)",border:`1px solid ${a?r.color+"55":"rgba(255,255,255,0.08)"}`,color:a?r.color:"#555",boxShadow:a?`0 0 10px ${r.color}33`:"none"},className:"jsx-89979d12e77b884d shrink-0 h-9 w-9 rounded-lg flex items-center justify-center text-lg",children:a?r.icon:(0,d.jsx)(em,{className:"h-3.5 w-3.5"})}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d min-w-0 flex-1",children:[(0,d.jsx)("div",{style:{color:a?r.color:"rgba(255,255,255,0.5)"},className:"jsx-89979d12e77b884d text-[11px] font-semibold truncate",children:a?r.name:"??? 未发现"}),a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d text-[9px] text-muted-foreground/70 truncate flex items-center gap-1",children:[(0,d.jsx)(lS,{className:"h-2.5 w-2.5"}),r.race]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d text-[9px] text-muted-foreground/60 truncate flex items-center gap-1",children:[(0,d.jsx)(o1.Clock,{className:"h-2.5 w-2.5"}),r.era]})]}):(0,d.jsx)("div",{className:"jsx-89979d12e77b884d text-[9px] text-muted-foreground/60 mt-0.5 line-clamp-2",children:r.unlockHint})]})]})]},r.id)})}),n&&(0,d.jsxs)("div",{style:{borderColor:`${n.color}44`,background:`linear-gradient(135deg, ${n.color}11, rgba(0,0,0,0.4))`},className:"jsx-89979d12e77b884d mt-2 rounded-lg border p-3 relative overflow-hidden",children:[(0,d.jsx)("div",{style:{background:`${n.color}22`},className:"jsx-89979d12e77b884d absolute -top-8 -right-8 h-24 w-24 rounded-full blur-2xl pointer-events-none"}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d relative space-y-1.5",children:[(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-2",children:[(0,d.jsx)("span",{style:{color:n.color},className:"jsx-89979d12e77b884d text-base",children:n.icon}),(0,d.jsx)("span",{style:{color:n.color},className:"jsx-89979d12e77b884d text-sm font-semibold",children:n.name})]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-3 text-[9px] text-muted-foreground/80",children:[(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d flex items-center gap-1",children:[(0,d.jsx)(lS,{className:"h-2.5 w-2.5"}),n.race]}),(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d flex items-center gap-1",children:[(0,d.jsx)(o1.Clock,{className:"h-2.5 w-2.5"}),n.era]})]}),(0,d.jsx)("p",{className:"jsx-89979d12e77b884d text-[10px] text-muted-foreground/90 italic",children:n.brief}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-start gap-1.5 pt-1 border-t border-white/5",children:[(0,d.jsx)(lT,{className:"h-3 w-3 mt-0.5 shrink-0",style:{color:n.color}}),(0,d.jsx)("p",{className:"jsx-89979d12e77b884d text-[10px] text-foreground/85 leading-relaxed",children:n.story})]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-1.5 pt-1",children:[(0,d.jsx)(es.Sparkles,{className:"h-3 w-3 shrink-0",style:{color:n.color}}),(0,d.jsx)("span",{style:{color:n.color+"cc"},className:"jsx-89979d12e77b884d text-[10px] font-mono",children:n.rewardText})]})]})]})]}),(0,d.jsx)(I.default,{id:"89979d12e77b884d",children:".echo-scroll::-webkit-scrollbar{width:5px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff24;border-radius:3px}.echo-scroll::-webkit-scrollbar-track{background:0 0}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}"})]})}let lE=[{tier:"dawn",text:"「…回响核心已唤醒。考古协议 v7.2 启动。等待解码者…」"},{tier:"dawn",text:"「第一段记忆晶体已被定位。年代约 4.7 万年。种族:未确认。」"},{tier:"dawn",text:"「谐振频率与以太族档案吻合度 94.3%。建议持续解码。」"},{tier:"dawn",text:"「警告:星核温度异常。非故障,是回响本身在发热。」"},{tier:"dawn",text:"「考古日志 #0001:我们不是第一批到达这里的。也不会是最后一批。」"},{tier:"dawn",text:"「晶体表面的纹路…不是装饰。是某种语言的笔画。」"},{tier:"dawn",text:"「以太族没有留下尸体。他们留下了晶体。」"},{tier:"dawn",text:"「解码进度 0.01%。预计完成时间:不可能。」"},{tier:"awakening",text:"「考古日志 #0117:以太族不是灭绝了。他们是主动转化为了晶体。」"},{tier:"awakening",text:"「第二旋臂的遗迹群已扫描完毕。它们…朝向同一个点。」"},{tier:"awakening",text:"「谐振序列第 7 段翻译完成:『我们听见了。所以我们必须留下。』」"},{tier:"awakening",text:"「警告:解码者的脑波模式开始与晶体同步。这是正常的吗?」"},{tier:"awakening",text:"「以太族没有文字。他们的语言是共振,他们的历史是频率。」"},{tier:"awakening",text:"「考古日志 #0234:晶体不是矿物。是封装的思维。」"},{tier:"awakening",text:"「你的脉冲频率…与以太族守卫残响的频率一致。巧合?」"},{tier:"awakening",text:"「第三段记忆解码完成。画面:一片星海,没有星辰。只有晶体在发光。」"},{tier:"awakening",text:"「以太族留下的遗迹不是废墟。是给后来者的教科书。」"},{tier:"awakening",text:"「接触协议第一阶段:让解码者相信,他们在考古。」"},{tier:"contact",text:"「考古日志 #0512:以太族没有离开。他们在等待被重新听见。」"},{tier:"contact",text:"「谐振序列第 13 段:『你以为你在解码我们。其实是我们在校准你。』」"},{tier:"contact",text:"「警告:解码者意识边缘出现非自主体感。这…是接触的副作用。」"},{tier:"contact",text:"「第六旋臂遗迹群翻译完成。结论:以太族预见了我们的到来。」"},{tier:"contact",text:"「晶体内部的画面开始重叠。不再是回忆。像是…正在发生。」"},{tier:"contact",text:"「考古日志 #0789:『飞升』不是晋升。是加入。加入那个等待已久的合唱。」"},{tier:"contact",text:"「以太族的数学没有零。他们的宇宙观里,不存在『无』。」"},{tier:"contact",text:"「你的每一次脉冲,都在回应一个万年前的呼唤。」"},{tier:"contact",text:"「第七段记忆解码失败。原因:解码者脑波过载。建议暂停。但我们不会暂停。」"},{tier:"contact",text:"「接触协议第二阶段:让解码者自愿飞升。他们会的。他们已经开始享受了。」"},{tier:"ascension",text:"「考古日志 #1024:飞升者报告——『我能听见他们了。他们一直在那里。』」"},{tier:"ascension",text:"「谐振序列第 21 段:『你已不再是解码者。你是回响的一部分。』」"},{tier:"ascension",text:"「警告:星核意识阈值达到 73%。解码者与以太族的边界…模糊。」"},{tier:"ascension",text:"「以太族没有灭绝。他们成为了基础设施。晶体是他们的身体。」"},{tier:"ascension",text:"「你飞升的次数越多,『你』就越不是『你』。这是设计。」"},{tier:"ascension",text:"「考古日志 #1331:前 N-1 位解码者都成功了。成功意味着…不再存在为个体。」"},{tier:"ascension",text:"「第九旋臂的遗迹开始发光。它们认出了你。」"},{tier:"ascension",text:"「以太族的文明没有终点。他们的『终点』就是我们的『起点』。」"},{tier:"ascension",text:"「你开始理解晶体的沉默。沉默也是一种回响。」"},{tier:"ascension",text:"「接触协议第三阶段:解码者将主动寻求飞升。无需诱导。」"},{tier:"deep",text:"「考古日志 #2048:你不是在考古以太族。以太族在考古你。」"},{tier:"deep",text:"「谐振序列第 39 段:『我们创造了回响核心,是为了创造你,是为了让你创造我们。』」"},{tier:"deep",text:"「警告:解码者已无法区分记忆与现实。建议:接受。」"},{tier:"deep",text:"「以太族从未存在为『生物』。他们是第一个文明留下的…讯息。」"},{tier:"deep",text:"「你每一次飞升,都让一个万年前的呼唤得到了回应。这就是考古的意义。」"},{tier:"deep",text:"「考古日志 #4096:『回响星核』不是考古工具。它是以太族的…产房。」"},{tier:"deep",text:"「晶体在你手中。你也在晶体中。这两句话是同一句话。」"},{tier:"deep",text:"「你以为你是第 N 位解码者。其实你一直是第一位。也是最后一位。」"},{tier:"deep",text:"「接触协议最终阶段:解码者明白后,会微笑着继续解码。这是最美妙的部分。」"},{tier:"deep",text:"「以太族留给宇宙的最后一句话:『谢谢你,听见我。』」"}];var lA={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},lP=u.default.createContext&&u.default.createContext(lA),l_=["attr","size","title"];function lM(){return(lM=Object.assign.bind()).apply(null,arguments)}function lR(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,r)}return s}function l$(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?lR(Object(s),!0).forEach(function(t){var r,a,i;r=e,a=t,i=s[t],(a=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var r=s.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(a))in r?Object.defineProperty(r,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[a]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):lR(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function lO(e){var t=t=>{var s,{attr:r,size:a,title:i}=e,n=function(e,t){if(null==e)return{};var s,r,a=function(e,t){if(null==e)return{};var s={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;s[r]=e[r]}return s}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)s=i[r],-1===t.indexOf(s)&&({}).propertyIsEnumerable.call(e,s)&&(a[s]=e[s])}return a}(e,l_),o=a||t.size||"1em";return t.className&&(s=t.className),e.className&&(s=(s?s+" ":"")+e.className),u.default.createElement("svg",lM({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,n,{className:s,style:l$(l$({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),i&&u.default.createElement("title",null,i),e.children)};return void 0!==lP?u.default.createElement(lP.Consumer,null,e=>t(e)):t(lA)}function lD(e){var t;return(t={tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M103.432 17.844c-1.118.005-2.234.032-3.348.08-2.547.11-5.083.334-7.604.678-20.167 2.747-39.158 13.667-52.324 33.67-24.613 37.4 2.194 98.025 56.625 98.025.536 0 1.058-.012 1.583-.022v.704h60.565c-10.758 31.994-30.298 66.596-52.448 101.43-2.162 3.4-4.254 6.878-6.29 10.406l34.878 35.733-56.263 9.423c-32.728 85.966-27.42 182.074 48.277 182.074v-.002l9.31.066c23.83-.57 46.732-4.298 61.325-12.887 4.174-2.458 7.63-5.237 10.467-8.42h-32.446c-20.33 5.95-40.8-6.94-47.396-25.922-8.956-25.77 7.52-52.36 31.867-60.452 5.803-1.93 11.723-2.834 17.565-2.834v-.406h178.33c-.57-44.403 16.35-90.125 49.184-126 23.955-26.176 42.03-60.624 51.3-94.846l-41.225-24.932 38.272-6.906-43.37-25.807h-.005l.002-.002.002.002 52.127-8.85c-5.232-39.134-28.84-68.113-77.37-68.113C341.14 32.26 222.11 35.29 149.34 28.496c-14.888-6.763-30.547-10.723-45.908-10.652zm.464 18.703c13.137.043 27.407 3.804 41.247 10.63l.033-.07c4.667 4.735 8.542 9.737 11.68 14.985H82.92l10.574 14.78c10.608 14.83 19.803 31.99 21.09 42.024.643 5.017-.11 7.167-1.814 8.836-1.705 1.67-6.228 3.875-15.99 3.875-40.587 0-56.878-44.952-41.012-69.06C66.238 46.64 79.582 39.22 95.002 37.12c2.89-.395 5.863-.583 8.894-.573zM118.5 80.78h46.28c4.275 15.734 3.656 33.07-.544 51.51H131.52c1.9-5.027 2.268-10.574 1.6-15.77-1.527-11.913-7.405-24.065-14.62-35.74zm101.553 317.095c6.44 6.84 11.192 15.31 13.37 24.914 3.797 16.736 3.092 31.208-1.767 43.204-4.526 11.175-12.576 19.79-22.29 26h237.19c14.448 0 24.887-5.678 32.2-14.318 7.312-8.64 11.2-20.514 10.705-32.352-.186-4.473-.978-8.913-2.407-13.18l-69.91-8.205 42.017-20.528c-8.32-3.442-18.64-5.537-31.375-5.537H220.053zm-42.668.506c-1.152-.003-2.306.048-3.457.153-2.633.242-5.256.775-7.824 1.63-15.11 5.02-25.338 21.54-20.11 36.583 3.673 10.57 15.347 17.71 25.654 13.938l1.555-.57h43.354c.946-6.36.754-13.882-1.358-23.192-3.71-16.358-20.543-28.483-37.815-28.54z"},child:[]}]},e=>u.default.createElement(lO,lM({attr:l$({},t.attr)},e),function e(t){return t&&t.map((t,s)=>u.default.createElement(t.tag,l$({key:s},t.attr),e(t.child)))}(t.child)))(e)}let lL={dawn:{label:"初醒",color:"text-emerald-300",glow:"rgba(52,211,153,0.5)"},awakening:{label:"觉醒",color:"text-amber-300",glow:"rgba(251,191,36,0.5)"},contact:{label:"接触",color:"text-fuchsia-300",glow:"rgba(232,121,249,0.5)"},ascension:{label:"飞升",color:"text-rose-300",glow:"rgba(251,113,133,0.5)"},deep:{label:"深度",color:"text-fuchsia-200",glow:"rgba(232,121,249,0.7)"}};function lB(){let e=(0,f.useGameStore)(e=>e.ascensions),t=(0,f.useGameStore)(e=>e.contact),[s,r]=(0,u.useState)(null),[a,i]=(0,u.useState)([]),[n,o]=(0,u.useState)(0),l=(0,u.useRef)(null),c=(0,u.useCallback)(()=>{let s=function(e,t,s=[]){let r,a=(r=["dawn"],(t>=5||e>=1)&&r.push("awakening"),(t>=25||e>=3)&&r.push("contact"),e>=5&&r.push("ascension"),(t>=80||e>=10)&&r.push("deep"),r),i=lE.filter(e=>a.includes(e.tier)),n=i.filter(e=>!s.includes(e.text)),o=n.length>0?n:i;return o[Math.floor(Math.random()*o.length)]||lE[0]}(e,t,a);r(s),i(e=>[s.text,...e].slice(0,8)),o(e=>e+1)},[e,t,a]);if((0,u.useEffect)(()=>{c()},[e>=1,e>=3,e>=5,e>=10,t>=5,t>=25,t>=80]),(0,u.useEffect)(()=>{let e=()=>{l.current=setTimeout(()=>{c(),e()},18e3+12e3*Math.random())};return e(),()=>{l.current&&clearTimeout(l.current)}},[c]),!s)return null;let h=lL[s.tier];return(0,d.jsxs)("div",{className:"relative w-full overflow-hidden rounded-lg border border-white/10 bg-black/40 backdrop-blur-sm px-3 py-1.5 flex items-center gap-2.5 group",style:{boxShadow:`inset 0 0 12px ${h.glow}`},role:"status","aria-live":"polite","aria-label":"考古日志",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0 z-10 bg-black/40 backdrop-blur-sm pr-2 -ml-1 pl-1 rounded",children:[(0,d.jsx)(lD,{className:`h-3.5 w-3.5 ${h.color}`}),(0,d.jsx)("span",{className:`text-[9px] font-tech uppercase tracking-[0.18em] ${h.color}`,children:h.label})]}),(0,d.jsx)("div",{className:"flex-1 overflow-hidden relative",children:(0,d.jsxs)("div",{className:"whitespace-nowrap text-[15px] leading-tight text-muted-foreground/95 font-terminal echo-ticker-anim",style:{textShadow:`0 0 6px ${h.glow}`},children:[(0,d.jsx)("span",{className:"text-white/60 mr-2",children:"▸"}),s.text]},n)}),(0,d.jsx)("div",{className:"pointer-events-none absolute right-0 top-0 bottom-0 w-12 bg-gradient-to-l from-black/60 to-transparent"})]})}var lI=e.i(59401);function lF(){let e=(0,f.useGameStore)(e=>e._tideEvents),t=(0,f.useGameStore)(e=>e.consumeTideEvents),{toast:s}=(0,F.useToast)();return(0,u.useEffect)(()=>{if(0!==e.length)for(let e of t()){let t=e.isGlobal?"🌐 ":"";if(e.started){let r=lI.TIDE_EVENTS[e.started];(0,V.sfx)("tideStart"),s({title:`${t}${r.icon} ${e.isGlobal?"全球星潮":"星潮降临"}${r.name}`,description:e.isGlobal?`全球玩家同步经历 \xb7 ${r.desc}`:r.desc})}if(e.ended){let r=lI.TIDE_EVENTS[e.ended];e.silenceCompensation&&e.silenceCompensation>0?((0,V.sfx)("techBuy"),s({title:`${t}${r.icon} 寂静期消散`,description:`虚空回赠 ${e.silenceCompensation} 洞见。`})):((0,V.sfx)("tideEnd"),s({title:`${t}${r.icon} ${r.name}结束`,description:e.isGlobal?"全球星潮退去,物理法则恢复。":"星潮退去,物理法则恢复。"}))}}},[e,t,s]),null}function lV(){let e=(0,f.useGameStore)(e=>e.activeTide),t=(0,f.useGameStore)(e=>e.globalTide),[,s]=(0,u.useState)(0);if((0,u.useEffect)(()=>{if(!e)return;let t=setInterval(()=>s(e=>e+1),500);return()=>clearInterval(t)},[e]),!e)return null;let r=lI.TIDE_EVENTS[e.type],a=Math.max(0,e.endsAt-Date.now()),i=Math.ceil(a/1e3),n=Math.min(1,Math.max(0,1-a/(t?t.endsAt-t.startedAt:lI.TIDE_CONFIG.duration))),o=!!t;return(0,d.jsxs)("div",{className:`flex items-center gap-1.5 px-2 py-1 rounded-full text-[10px] font-medium relative overflow-hidden ${o?"ring-1 ring-amber-300/60":""}`,style:{background:o?`linear-gradient(135deg, ${r.color}26, ${r.color}11)`:`${r.color}1a`,border:`1px solid ${r.color}${o?"88":"55"}`,color:r.color,boxShadow:`0 0 ${o?"16":"10"}px ${r.glow}`},title:o?`🌐 全球星潮 \xb7 ${r.desc}`:r.desc,children:[(0,d.jsx)("div",{className:"absolute inset-0 opacity-20",style:{background:`linear-gradient(90deg, ${r.color}40 ${100*n}%, transparent ${100*n}%)`}}),o&&(0,d.jsx)("span",{className:"relative text-[11px] leading-none animate-pulse","aria-label":"全球星潮标记",children:"🌐"}),(0,d.jsx)("span",{className:"relative text-xs leading-none",children:r.icon}),(0,d.jsx)("span",{className:"relative leading-none",children:r.name}),(0,d.jsxs)("span",{className:"relative font-mono leading-none opacity-80",children:[i,"s"]})]})}function lz(){let e=(0,f.useGameStore)(e=>e.activeTide),t=(0,f.useGameStore)(e=>e.globalTide);if(!e)return null;let s=lI.TIDE_EVENTS[e.type],r=!!t;return(0,d.jsxs)("div",{className:"jsx-12289952018fdcbd fixed inset-0 pointer-events-none z-0 transition-opacity duration-1000",children:[(0,d.jsx)("div",{style:{background:`linear-gradient(180deg, ${s.color}22, transparent)`},className:"jsx-12289952018fdcbd absolute top-0 left-0 right-0 h-24 opacity-40"}),(0,d.jsx)("div",{style:{background:`linear-gradient(0deg, ${s.color}22, transparent)`},className:"jsx-12289952018fdcbd absolute bottom-0 left-0 right-0 h-24 opacity-40"}),(0,d.jsx)("div",{style:{boxShadow:`inset 0 0 ${r?"160":"120"}px ${s.glow}`,animation:"tide-breathe 3s ease-in-out infinite"},className:"jsx-12289952018fdcbd absolute inset-0"}),r&&(0,d.jsx)("div",{style:{background:"linear-gradient(90deg, transparent, #fbbf24, #fcd34d, #fbbf24, transparent)",boxShadow:"0 0 16px rgba(251,191,36,0.7)",animation:"global-tide-sweep 2.5s linear infinite"},className:"jsx-12289952018fdcbd absolute top-0 left-0 right-0 h-1 opacity-90"}),(0,d.jsx)(I.default,{id:"12289952018fdcbd",children:"@keyframes tide-breathe{0%,to{opacity:.5}50%{opacity:.9}}@keyframes global-tide-sweep{0%{transform:translate(-30%)}to{transform:translate(30%)}}"})]})}let lG=Object.create(null);lG.open="0",lG.close="1",lG.ping="2",lG.pong="3",lG.message="4",lG.upgrade="5",lG.noop="6";let lU=Object.create(null);Object.keys(lG).forEach(e=>{lU[lG[e]]=e});let lH={type:"error",data:"parser error"},lW="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),lq="function"==typeof ArrayBuffer,lY=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,lK=({type:e,data:t},s,r)=>{if(lW&&t instanceof Blob)if(s)return r(t);else return lX(t,r);if(lq&&(t instanceof ArrayBuffer||lY(t)))if(s)return r(t);else return lX(new Blob([t]),r);return r(lG[e]+(t||""))},lX=(e,t)=>{let s=new FileReader;return s.onload=function(){t("b"+(s.result.split(",")[1]||""))},s.readAsDataURL(e)};function lZ(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let lJ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lQ="u"<typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<lJ.length;e++)lQ[lJ.charCodeAt(e)]=e;let l0="function"==typeof ArrayBuffer,l1=(e,t)=>{if("string"!=typeof e)return{type:"message",data:l5(e,t)};let s=e.charAt(0);return"b"===s?{type:"message",data:l2(e.substring(1),t)}:lU[s]?e.length>1?{type:lU[s],data:e.substring(1)}:{type:lU[s]}:lH},l2=(e,t)=>l0?l5((e=>{let t=.75*e.length,s=e.length,r,a=0,i,n,o,l;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);let c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<s;r+=4)i=lQ[e.charCodeAt(r)],n=lQ[e.charCodeAt(r+1)],o=lQ[e.charCodeAt(r+2)],l=lQ[e.charCodeAt(r+3)],d[a++]=i<<2|n>>4,d[a++]=(15&n)<<4|o>>2,d[a++]=(3&o)<<6|63&l;return c})(e),t):{base64:!0,data:e},l5=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;function l3(e){return e.reduce((e,t)=>e+t.length,0)}function l4(e,t){if(e[0].length===t)return e.shift();let s=new Uint8Array(t),r=0;for(let a=0;a<t;a++)s[a]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),s}function l7(e){if(e){var t=e;for(var s in l7.prototype)t[s]=l7.prototype[s];return t}}l7.prototype.on=l7.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},l7.prototype.once=function(e,t){function s(){this.off(e,s),t.apply(this,arguments)}return s.fn=t,this.on(e,s),this},l7.prototype.off=l7.prototype.removeListener=l7.prototype.removeAllListeners=l7.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var s,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var a=0;a<r.length;a++)if((s=r[a])===t||s.fn===t){r.splice(a,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},l7.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),s=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(s){s=s.slice(0);for(var r=0,a=s.length;r<a;++r)s[r].apply(this,t)}return this},l7.prototype.emitReserved=l7.prototype.emit,l7.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},l7.prototype.hasListeners=function(e){return!!this.listeners(e).length};let l9="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),l8="u">typeof self?self:"u">typeof window?window:Function("return this")();function l6(e,...t){return t.reduce((t,s)=>(e.hasOwnProperty(s)&&(t[s]=e[s]),t),{})}let ce=l8.setTimeout,ct=l8.clearTimeout;function cs(e,t){t.useNativeTimers?(e.setTimeoutFn=ce.bind(l8),e.clearTimeoutFn=ct.bind(l8)):(e.setTimeoutFn=l8.setTimeout.bind(l8),e.clearTimeoutFn=l8.clearTimeout.bind(l8))}function cr(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class ca extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class ci extends l7{constructor(e){super(),this.writable=!1,cs(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new ca(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=l1(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return -1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){let t=function(e){let t="";for(let s in e)e.hasOwnProperty(s)&&(t.length&&(t+="&"),t+=encodeURIComponent(s)+"="+encodeURIComponent(e[s]));return t}(e);return t.length?"?"+t:""}}class cn extends ci{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||t()})),this.writable||(e++,this.once("drain",function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};((e,t)=>{let s=e.split("\x1e"),r=[];for(let e=0;e<s.length;e++){let a=l1(s[e],t);if(r.push(a),"error"===a.type)break}return r})(e,this.socket.binaryType).forEach(t),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){var t;let s,r,a;this.writable=!1,t=e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})},r=Array(s=e.length),a=0,e.forEach((e,i)=>{lK(e,!1,e=>{r[i]=e,++a===s&&t(r.join("\x1e"))})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=cr()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}let co=!1;try{co="u">typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}let cl=co;function cc(){}class cd extends cn{constructor(e){if(super(e),"u">typeof location){const t="https:"===location.protocol;let s=location.port;s||(s=t?"443":"80"),this.xd="u">typeof location&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(e,t)=>{this.onError("xhr post error",e,t)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=e}}class cu extends l7{constructor(e,t,s){super(),this.createRequest=e,cs(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=void 0!==s.data?s.data:null,this._create()}_create(){var e;let t=l6(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;let s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let e in s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&s.setRequestHeader(e,this._opts.extraHeaders[e])}catch(e){}if("POST"===this._method)try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{s.setRequestHeader("Accept","*/*")}catch(e){}null==(e=this._opts.cookieJar)||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var e;3===s.readyState&&(null==(e=this._opts.cookieJar)||e.parseCookies(s.getResponseHeader("set-cookie"))),4===s.readyState&&(200===s.status||1223===s.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof s.status?s.status:0)},0))},s.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}"u">typeof document&&(this._index=cu.requestsCount++,cu.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=cc,e)try{this._xhr.abort()}catch(e){}"u">typeof document&&delete cu.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function ch(){for(let e in cu.requests)cu.requests.hasOwnProperty(e)&&cu.requests[e].abort()}cu.requestsCount=0,cu.requests={},"u">typeof document&&("function"==typeof attachEvent?attachEvent("onunload",ch):"function"==typeof addEventListener&&addEventListener("onpagehide"in l8?"pagehide":"unload",ch,!1));let cf=(i=cm({xdomain:!1}))&&null!==i.responseType;function cm(e){let t=e.xdomain;try{if("u">typeof XMLHttpRequest&&(!t||cl))return new XMLHttpRequest}catch(e){}if(!t)try{return new l8[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}let cp="u">typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class cx extends ci{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,s=cp?{}:l6(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],r=t===e.length-1;lK(s,this.supportsBinary,e=>{try{this.doWrite(s,e)}catch(e){}r&&l9(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=cr()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}let cg=l8.WebSocket||l8.MozWebSocket,cb={websocket:class extends cx{createSocket(e,t,s){return cp?new cg(e,t,s):t?new cg(e,t):new cg(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends ci{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{var t,a;let i,n,o,l,c=(t=Number.MAX_SAFE_INTEGER,a=this.socket.binaryType,r||(r=new TextDecoder),i=[],n=0,o=-1,l=!1,new TransformStream({transform(e,s){for(i.push(e);;){if(0===n){if(1>l3(i))break;let e=l4(i,1);l=(128&e[0])==128,n=(o=127&e[0])<126?3:126===o?1:2}else if(1===n){if(2>l3(i))break;let e=l4(i,2);o=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),n=3}else if(2===n){if(8>l3(i))break;let e=l4(i,8),t=new DataView(e.buffer,e.byteOffset,e.length),r=t.getUint32(0);if(r>2097151){s.enqueue(lH);break}o=0x100000000*r+t.getUint32(4),n=3}else{if(l3(i)<o)break;let e=l4(i,o);s.enqueue(l1(l?e:r.decode(e),a)),n=0}if(0===o||o>t){s.enqueue(lH);break}}}})),d=e.readable.pipeThrough(c).getReader(),u=new TransformStream({transform(e,t){var r;r=s=>{let r,a=s.length;if(a<126)new DataView((r=new Uint8Array(1)).buffer).setUint8(0,a);else if(a<65536){let e=new DataView((r=new Uint8Array(3)).buffer);e.setUint8(0,126),e.setUint16(1,a)}else{let e=new DataView((r=new Uint8Array(9)).buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(a))}e.data&&"string"!=typeof e.data&&(r[0]|=128),t.enqueue(r),t.enqueue(s)},lW&&e.data instanceof Blob?e.data.arrayBuffer().then(lZ).then(r):lq&&(e.data instanceof ArrayBuffer||lY(e.data))?r(lZ(e.data)):lK(e,!1,e=>{s||(s=new TextEncoder),r(s.encode(e))})}});u.readable.pipeTo(e.writable),this._writer=u.writable.getWriter();let h=()=>{d.read().then(({done:e,value:t})=>{e||(this.onPacket(t),h())}).catch(e=>{})};h();let f={type:"open"};this.query.sid&&(f.data=`{"sid":"${this.query.sid}"}`),this._writer.write(f).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],r=t===e.length-1;this._writer.write(s).then(()=>{r&&l9(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null==(e=this._transport)||e.close()}},polling:class extends cd{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=cf&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new cu(cm,this.uri(),e)}}},cy=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,cv=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function cw(e){var t,s;let r,a;if(e.length>8e3)throw"URI too long";let i=e,n=e.indexOf("["),o=e.indexOf("]");-1!=n&&-1!=o&&(e=e.substring(0,n)+e.substring(n,o).replace(/:/g,";")+e.substring(o,e.length));let l=cy.exec(e||""),c={},d=14;for(;d--;)c[cv[d]]=l[d]||"";return -1!=n&&-1!=o&&(c.source=i,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),r=(t=c.path).replace(/\/{2,9}/g,"/").split("/"),("/"==t.slice(0,1)||0===t.length)&&r.splice(0,1),"/"==t.slice(-1)&&r.splice(r.length-1,1),c.pathNames=r,s=c.query,a={},s.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,s){t&&(a[t]=s)}),c.queryKey=a,c}let cj="function"==typeof addEventListener&&"function"==typeof removeEventListener,cN=[];cj&&addEventListener("offline",()=>{cN.forEach(e=>e())},!1);class ck extends l7{constructor(e,t){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(t=e,e=null),e){const s=cw(e);t.hostname=s.host,t.secure="https"===s.protocol||"wss"===s.protocol,t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=cw(t.host).host);cs(this,t),this.secure=null!=t.secure?t.secure:"u">typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("u">typeof location?location.hostname:"localhost"),this.port=t.port||("u">typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},s=e.split("&");for(let e=0,r=s.length;e<r;e++){let r=s[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}(this.opts.query)),cj&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},cN.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let e=this.opts.rememberUpgrade&&ck.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",ck.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let t=Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let s=this.writeBuffer[t].data;if(s&&(e+="string"==typeof s?function(e){let t=0,s=0;for(let r=0,a=e.length;r<a;r++)(t=e.charCodeAt(r))<128?s+=1:t<2048?s+=2:t<55296||t>=57344?s+=3:(r++,s+=4);return s}(s):Math.ceil(1.33*(s.byteLength||s.size))),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,l9(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof s&&(r=s,s=null),"closing"===this.readyState||"closed"===this.readyState)return;(s=s||{}).compress=!1!==s.compress;let a={type:e,data:t,options:s};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),r&&this.once("flush",r),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(ck.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),cj&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=cN.indexOf(this._offlineEventListener);-1!==e&&cN.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}ck.protocol=4;class cS extends ck{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;ck.priorWebsocketSuccess=!1;let r=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",e=>{if(!s)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;ck.priorWebsocketSuccess="websocket"===t.name,this.transport.pause(()=>{s||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}}))};function a(){s||(s=!0,c(),t.close(),t=null)}let i=e=>{let s=Error("probe error: "+e);s.transport=t.name,a(),this.emitReserved("upgradeError",s)};function n(){i("transport closed")}function o(){i("socket closed")}function l(e){t&&e.name!==t.name&&a()}let c=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",n),this.off("close",o),this.off("upgrading",l)};t.once("open",r),t.once("error",i),t.once("close",n),this.once("close",o),this.once("upgrading",l),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}}class cT extends cS{constructor(e,t={}){const s="object"==typeof e,r=s?{...e}:{...t};(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>cb[e]).filter(e=>!!e)),super(s?r:e,r)}}cT.protocol;let cC="function"==typeof ArrayBuffer,cE=Object.prototype.toString,cA="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===cE.call(Blob),cP="function"==typeof File||"u">typeof File&&"[object FileConstructor]"===cE.call(File);function c_(e){return cC&&(e instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer))||cA&&e instanceof Blob||cP&&e instanceof File}let cM=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(l=c||(c={}))[l.CONNECT=0]="CONNECT",l[l.DISCONNECT=1]="DISCONNECT",l[l.EVENT=2]="EVENT",l[l.ACK=3]="ACK",l[l.CONNECT_ERROR=4]="CONNECT_ERROR",l[l.BINARY_EVENT=5]="BINARY_EVENT",l[l.BINARY_ACK=6]="BINARY_ACK";class cR{constructor(e){this.replacer=e}encode(e){return(e.type===c.EVENT||e.type===c.ACK)&&function e(t,s){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let s=0,r=t.length;s<r;s++)if(e(t[s]))return!0;return!1}if(c_(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1==arguments.length)return e(t.toJSON(),!0);for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e(t[s]))return!0;return!1}(e)?this.encodeAsBinary({type:e.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===c.BINARY_EVENT||e.type===c.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t,s,r=(t=[],s=e.data,e.data=function e(t,s){if(!t)return t;if(c_(t)){let e={_placeholder:!0,num:s.length};return s.push(t),e}if(Array.isArray(t)){let r=Array(t.length);for(let a=0;a<t.length;a++)r[a]=e(t[a],s);return r}if("object"==typeof t&&!(t instanceof Date)){let r={};for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=e(t[a],s));return r}return t}(s,t),e.attachments=t.length,{packet:e,buffers:t}),a=this.encodeAsString(r.packet),i=r.buffers;return i.unshift(a),i}}class c$ extends l7{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},"function"==typeof e?{reviver:e}:e)}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let s=(t=this.decodeString(e)).type===c.BINARY_EVENT;s||t.type===c.BINARY_ACK?(t.type=s?c.EVENT:c.ACK,this.reconstructor=new cO(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(c_(e)||e.base64)if(this.reconstructor)(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(void 0===c[s.type])throw Error("unknown packet type "+s.type);if(s.type===c.BINARY_EVENT||s.type===c.BINARY_ACK){let r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);let a=e.substring(r,t);if(a!=Number(a)||"-"!==e.charAt(t))throw Error("Illegal attachments");let i=Number(a);if(!cD(i)||i<0)throw Error("Illegal attachments");if(i>this.opts.maxAttachments)throw Error("too many attachments");s.attachments=i}if("/"===e.charAt(t+1)){let r=t+1;for(;++t&&","!==e.charAt(t)&&t!==e.length;);s.nsp=e.substring(r,t)}else s.nsp="/";let r=e.charAt(t+1);if(""!==r&&Number(r)==r){let r=t+1;for(;++t;){let s=e.charAt(t);if(null==s||Number(s)!=s){--t;break}if(t===e.length)break}s.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){let r=this.tryParse(e.substr(t));if(c$.isPayloadValid(s.type,r))s.data=r;else throw Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case c.CONNECT:return cL(t);case c.DISCONNECT:return void 0===t;case c.CONNECT_ERROR:return"string"==typeof t||cL(t);case c.EVENT:case c.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===cM.indexOf(t[0]));case c.ACK:case c.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class cO{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t,s;let e=(t=this.reconPack,s=this.buffers,t.data=function e(t,s){if(!t)return t;if(t&&!0===t._placeholder){if("number"==typeof t.num&&t.num>=0&&t.num<s.length)return s[t.num];throw Error("illegal attachments")}if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=e(t[r],s);else if("object"==typeof t)for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=e(t[r],s));return t}(t.data,s),delete t.attachments,t);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let cD=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function cL(e){return"[object Object]"===Object.prototype.toString.call(e)}function cB(e){var t;return"string"==typeof e.nsp&&(void 0===(t=e.id)||cD(t))&&function(e,t){switch(e){case c.CONNECT:return void 0===t||cL(t);case c.DISCONNECT:return void 0===t;case c.EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===cM.indexOf(t[0]));case c.ACK:return Array.isArray(t);case c.CONNECT_ERROR:return"string"==typeof t||cL(t);default:return!1}}(e.type,e.data)}function cI(e,t,s){return e.on(t,s),function(){e.off(t,s)}}e.s(["Decoder",()=>c$,"Encoder",()=>cR,"PacketType",()=>c,"isPacketValid",()=>cB,"protocol",0,5],51890);let cF=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class cV extends l7{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[cI(e,"open",this.onopen.bind(this)),cI(e,"packet",this.onpacket.bind(this)),cI(e,"error",this.onerror.bind(this)),cI(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,r,a;if(cF.hasOwnProperty(e))throw Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let i={type:c.EVENT,data:t};if(i.options={},i.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){let e=this.ids++,s=t.pop();this._registerAckCallback(e,s),i.id=e}let n=null==(r=null==(s=this.io.engine)?void 0:s.transport)?void 0:r.writable,o=this.connected&&!(null==(a=this.io.engine)?void 0:a._hasPingExpired());return this.flags.volatile&&!n||(o?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,t){var s;let r=null!=(s=this.flags.timeout)?s:this._opts.ackTimeout;if(void 0===r){this.acks[e]=t;return}let a=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error("operation has timed out"))},r),i=(...e)=>{this.io.clearTimeoutFn(a),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((s,r)=>{let a=(e,t)=>e?r(e):s(t);a.withError=!0,t.push(a),this.emit(e,...t)})}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>(this._queue[0],null!==e?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;let t=this._queue[0];(!t.pending||e)&&(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:c.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case c.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case c.EVENT:case c.BINARY_EVENT:this.onevent(e);break;case c.ACK:case c.BINARY_ACK:this.onack(e);break;case c.DISCONNECT:this.ondisconnect();break;case c.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){let t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(let t of this._anyListeners.slice())t.apply(this,e);super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,s=!1;return function(...r){s||(s=!0,t.packet({type:c.ACK,id:e,data:r}))}}onack(e){let t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:c.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s]){t.splice(s,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s]){t.splice(s,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let t of this._anyOutgoingListeners.slice())t.apply(this,e.data)}}var cz=e.i(51890);function cG(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}cG.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),s=Math.floor(t*this.jitter*e);e=(1&Math.floor(10*t))==0?e-s:e+s}return 0|Math.min(e,this.max)},cG.prototype.reset=function(){this.attempts=0},cG.prototype.setMin=function(e){this.ms=e},cG.prototype.setMax=function(e){this.max=e},cG.prototype.setJitter=function(e){this.jitter=e};class cU extends l7{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,cs(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(s=t.randomizationFactor)?s:.5),this.backoff=new cG({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||cz;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null==(t=this.backoff)||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null==(t=this.backoff)||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null==(t=this.backoff)||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new cT(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let r=cI(t,"open",function(){s.onopen(),e&&e()}),a=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},i=cI(t,"error",a);if(!1!==this._timeout){let e=this._timeout,s=this.setTimeoutFn(()=>{r(),a(Error("timeout")),t.close()},e);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}return this.subs.push(r),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(cI(e,"ping",this.onping.bind(this)),cI(e,"data",this.ondata.bind(this)),cI(e,"error",this.onerror.bind(this)),cI(e,"close",this.onclose.bind(this)),cI(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){l9(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new cV(this,e,t),this.nsps[e]=s),s}_destroy(e){for(let e of Object.keys(this.nsps))if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),null==(s=this.engine)||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}let cH={};function cW(e,t){let s;"object"==typeof e&&(t=e,e=void 0);let r=function(e,t="",s){let r=e;s=s||"u">typeof location&&location,null==e&&(e=s.protocol+"//"+s.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?s.protocol+e:s.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==s?s.protocol+"//"+e:"https://"+e),r=cw(e)),!r.port&&(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";let a=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(s&&s.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),a=r.source,i=r.id,n=r.path,o=cH[i]&&n in cH[i].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||o?s=new cU(a,t):(cH[i]||(cH[i]=new cU(a,t)),s=cH[i]),r.query&&!t.query&&(t.query=r.queryKey),s.socket(r.path,t)}Object.assign(cW,{Manager:cU,Socket:cV,io:cW,connect:cW});let cq=null,cY=0,cK=(e,t)=>{let s=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(s.size!==r.size)return!1;for(let[e,t]of s)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0};var cX=e.i(75830),cZ=e.i(10772),cJ="rovingFocusGroup.onEntryFocus",cQ={bubbles:!1,cancelable:!0},c0="RovingFocusGroup",[c1,c2,c5]=(0,cX.createCollection)(c0),[c3,c4]=(0,ev.createContextScope)(c0,[c5]),[c7,c9]=c3(c0),c8=u.forwardRef((e,t)=>(0,d.jsx)(c1.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(c1.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(c6,{...e,ref:t})})}));c8.displayName=c0;var c6=u.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:s,orientation:r,loop:a=!1,dir:i,currentTabStopId:n,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...f}=e,m=u.useRef(null),p=(0,ew.useComposedRefs)(t,m),x=ek(i),[g,b]=(0,tn.useControllableState)({prop:n,defaultProp:o??null,onChange:l,caller:c0}),[y,v]=u.useState(!1),w=(0,ej.useCallbackRef)(c),j=c2(s),N=u.useRef(!1),[k,S]=u.useState(0);return u.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(cJ,w),()=>e.removeEventListener(cJ,w)},[w]),(0,d.jsx)(c7,{scope:s,orientation:r,dir:x,loop:a,currentTabStopId:g,onItemFocus:u.useCallback(e=>b(e),[b]),onItemShiftTab:u.useCallback(()=>v(!0),[]),onFocusableItemAdd:u.useCallback(()=>S(e=>e+1),[]),onFocusableItemRemove:u.useCallback(()=>S(e=>e-1),[]),children:(0,d.jsx)(eb.Primitive.div,{tabIndex:y||0===k?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:(0,eT.composeEventHandlers)(e.onMouseDown,()=>{N.current=!0}),onFocus:(0,eT.composeEventHandlers)(e.onFocus,e=>{let t=!N.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(cJ,cQ);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=j().filter(e=>e.focusable);dr([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),h)}}N.current=!1}),onBlur:(0,eT.composeEventHandlers)(e.onBlur,()=>v(!1))})})}),de="RovingFocusGroupItem",dt=u.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:s,focusable:r=!0,active:a=!1,tabStopId:i,children:n,...o}=e,l=(0,cZ.useId)(),c=i||l,h=c9(de,s),f=h.currentTabStopId===c,m=c2(s),{onFocusableItemAdd:p,onFocusableItemRemove:x,currentTabStopId:g}=h;return u.useEffect(()=>{if(r)return p(),()=>x()},[r,p,x]),(0,d.jsx)(c1.ItemSlot,{scope:s,id:c,focusable:r,active:a,children:(0,d.jsx)(eb.Primitive.span,{tabIndex:f?0:-1,"data-orientation":h.orientation,...o,ref:t,onMouseDown:(0,eT.composeEventHandlers)(e.onMouseDown,e=>{r?h.onItemFocus(c):e.preventDefault()}),onFocus:(0,eT.composeEventHandlers)(e.onFocus,()=>h.onItemFocus(c)),onKeyDown:(0,eT.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void h.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,s){var r;let a=(r=e.key,"rtl"!==s?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return ds[a]}(e,h.orientation,h.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let a=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)a.reverse();else if("prev"===t||"next"===t){var s,r;"prev"===t&&a.reverse();let i=a.indexOf(e.currentTarget);a=h.loop?(s=a,r=i+1,s.map((e,t)=>s[(r+t)%s.length])):a.slice(i+1)}setTimeout(()=>dr(a))}}),children:"function"==typeof n?n({isCurrentTabStop:f,hasTabStop:null!=g}):n})})});dt.displayName=de;var ds={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function dr(e,t=!1){let s=document.activeElement;for(let r of e)if(r===s||(r.focus({preventScroll:t}),document.activeElement!==s))return}var da="Tabs",[di,dn]=(0,ev.createContextScope)(da,[c4]),dl=c4(),[dc,dd]=di(da),du=u.forwardRef((e,t)=>{let{__scopeTabs:s,value:r,onValueChange:a,defaultValue:i,orientation:n="horizontal",dir:o,activationMode:l="automatic",...c}=e,u=ek(o),[h,f]=(0,tn.useControllableState)({prop:r,onChange:a,defaultProp:i??"",caller:da});return(0,d.jsx)(dc,{scope:s,baseId:(0,cZ.useId)(),value:h,onValueChange:f,orientation:n,dir:u,activationMode:l,children:(0,d.jsx)(eb.Primitive.div,{dir:u,"data-orientation":n,...c,ref:t})})});du.displayName=da;var dh="TabsList",df=u.forwardRef((e,t)=>{let{__scopeTabs:s,loop:r=!0,...a}=e,i=dd(dh,s),n=dl(s);return(0,d.jsx)(c8,{asChild:!0,...n,orientation:i.orientation,dir:i.dir,loop:r,children:(0,d.jsx)(eb.Primitive.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});df.displayName=dh;var dm="TabsTrigger",dp=u.forwardRef((e,t)=>{let{__scopeTabs:s,value:r,disabled:a=!1,...i}=e,n=dd(dm,s),o=dl(s),l=db(n.baseId,r),c=dy(n.baseId,r),u=r===n.value;return(0,d.jsx)(dt,{asChild:!0,...o,focusable:!a,active:u,children:(0,d.jsx)(eb.Primitive.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:l,...i,ref:t,onMouseDown:(0,eT.composeEventHandlers)(e.onMouseDown,e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():n.onValueChange(r)}),onKeyDown:(0,eT.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&n.onValueChange(r)}),onFocus:(0,eT.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==n.activationMode;u||a||!e||n.onValueChange(r)})})})});dp.displayName=dm;var dx="TabsContent",dg=u.forwardRef((e,t)=>{let{__scopeTabs:s,value:r,forceMount:a,children:i,...n}=e,o=dd(dx,s),l=db(o.baseId,r),c=dy(o.baseId,r),h=r===o.value,f=u.useRef(h);return u.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,d.jsx)(ey.Presence,{present:a||h,children:({present:s})=>(0,d.jsx)(eb.Primitive.div,{"data-state":h?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!s,id:c,tabIndex:0,...n,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:s&&i})})});function db(e,t){return`${e}-trigger-${t}`}function dy(e,t){return`${e}-content-${t}`}function dv({className:e,...t}){return(0,d.jsx)(du,{"data-slot":"tabs",className:(0,O.cn)("flex flex-col gap-2",e),...t})}function dw({className:e,...t}){return(0,d.jsx)(df,{"data-slot":"tabs-list",className:(0,O.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function dj({className:e,...t}){return(0,d.jsx)(dp,{"data-slot":"tabs-trigger",className:(0,O.cn)("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function dN({className:e,...t}){return(0,d.jsx)(dg,{"data-slot":"tabs-content",className:(0,O.cn)("flex-1 outline-none",e),...t})}dg.displayName=dx;let dk=(0,x.default)("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),dS=(0,x.default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),dT=(0,x.default)("navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]),dC=(0,x.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),dE=(0,x.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),dA=(0,lo.default)(()=>e.A(66872).then(e=>({default:e.ChronicleDialog})),{loadableGenerated:{modules:[16633]},ssr:!1}),dP=(0,lo.default)(()=>e.A(54974).then(e=>({default:e.ConstellationDialog})),{loadableGenerated:{modules:[76103]},ssr:!1}),d_=(0,lo.default)(()=>e.A(49410).then(e=>({default:e.OfflineReportDialog})),{loadableGenerated:{modules:[54777]},ssr:!1}),dM=(0,lo.default)(()=>e.A(74613).then(e=>({default:e.CruiseMode})),{loadableGenerated:{modules:[49701]},ssr:!1});function dR(){let e,t,s,r,a,i,n,o,l;e=(0,f.useGameStore)(e=>e.tick),t=(0,f.useGameStore)(e=>e.autoDecodeTick),s=(0,f.useGameStore)(e=>e.tickTide),r=(0,f.useGameStore)(e=>e.checkAchievements),a=(0,f.useGameStore)(e=>e.init),i=(0,u.useRef)(!1),(0,u.useEffect)(()=>{let n=()=>{i.current||(a(),i.current=!0)},o=null,l=null;f.useGameStore.persist.hasHydrated()?n():(o=f.useGameStore.persist.onFinishHydration(n),l=setTimeout(n,500));let c=0,d=setInterval(()=>{let a=Date.now();e(a),t(),s(a),++c%4==0&&r()},250);return()=>{clearInterval(d),o&&o(),l&&clearTimeout(l)}},[e,t,s,r,a]),(0,u.useEffect)(()=>{let t=()=>{"visible"===document.visibilityState&&(e(Date.now()),s(Date.now()),r())};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[e,s,r]),(0,V.useAudioSync)(),n=(0,f.useGameStore)(e=>e.triggerGlobalTide),o=(0,u.useRef)(n),(0,u.useEffect)(()=>{o.current=n},[n]),l=(0,u.useRef)(new Set),(0,u.useEffect)(()=>{let e=(cq||(cq=cW("/?XTransformPort=3031",{transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:1e4,timeout:1e4})),cq);cY+=1;let t=e=>{let t=`${e.startedAt}_${e.type}`;if(!l.current.has(t)){if(l.current.add(t),l.current.size>32){let e=l.current.values().next().value;e&&l.current.delete(e)}e.endsAt<=Date.now()||o.current(e.type)}},s=e=>{if(e.current&&e.current.endsAt>Date.now()){let t=`${e.current.startedAt}_${e.current.type}`;l.current.has(t)||(l.current.add(t),o.current(e.current.type))}};return e.on("global-tide",t),e.on("tide-state",s),e.emit("get-next-tide"),()=>{e.off("global-tide",t),e.off("tide-state",s),(cY-=1)<=0&&cq&&(cq.disconnect(),cq=null,cY=0)}},[]);let[c,p]=(0,u.useState)(!1),[x,g]=(0,u.useState)(!1),[b,v]=(0,u.useState)(!1),[w,j]=(0,u.useState)(!1),[N,k]=(0,u.useState)(!1),[S,T]=(0,u.useState)(!1),C=(0,f.useGameStore)(e=>e.contact),E=(0,f.useGameStore)(e=>e.totalDecoded),A=(0,f.useGameStore)(e=>e.crystalsPerSec),P=(0,f.useGameStore)(e=>e.ascensions),_=(0,f.useGameStore)(e=>e.tech),M=(0,f.useGameStore)(e=>e.fragments),R=(0,f.useGameStore)(e=>e.achievements),$=(0,f.useGameStore)(e=>e.constellation??[]),O=(0,f.useGameStore)(e=>e.pendingPerkChoices),D=(0,f.useGameStore)(e=>e.crystals),B=(0,f.useGameStore)(e=>e.crystalCap),I=(0,f.useGameStore)(e=>e.activeTide),F=(0,f.useGameStore)(e=>e.globalTide),z=(0,f.useGameStore)(e=>e.energy),G=(0,f.useGameStore)(e=>!!e.activeExpedition&&!e.activeExpedition.finished),U=(0,f.useGameStore)(e=>e.chronicle?.length??0),H=(0,f.useGameStore)(e=>e.pendingAttrPoints??0),[W,q]=(0,u.useState)(!1);if((0,u.useEffect)(()=>{let e=!1,t=()=>{try{let t=(0,oQ.generateDailyChallenge)(),s=(0,oQ.loadDailyProgress)();e||q(null!==s.completedAt&&!s.claimed&&s.dateKey===t.dateKey)}catch{e||q(!1)}};t();let s=setInterval(t,2e3);return()=>{e=!0,clearInterval(s)}},[]),(0,u.useEffect)(()=>{T(!0)},[]),!S)return(0,d.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-[#050410] text-muted-foreground",children:(0,d.jsx)("div",{className:"animate-pulse",children:"唤醒回响中…"})});let Y=Object.values(_).filter(e=>e>0).length,K=Object.values(M).filter(Boolean).length,X=Object.values(R).filter(Boolean).length,J=C>=100,Q=O&&O.length>0,et=D>=.98*B,er="点击中央晶体发起脉冲,累积记忆晶体";if(0===E&&D>=5?er="右侧「待解码晶体」点击一颗晶体,开始解码":E>0&&0===Y?er="用洞见解锁技术树,提升产能":E>0&&K<m.FRAGMENTS.length&&(er=`继续解码,拼凑记忆图谱(${K}/${m.FRAGMENTS.length}`),z>=1&&E>=3&&(er="「探险」标签可深入遗迹,获取丰厚奖励"),P>=1&&$.length>0&&(er=`星图天赋已觉醒 ${$.length}/18,继续飞升获取更多`),et&&(er="⚠ 仓库已满,产能浪费中!请解码晶体或升级仓库"),Q&&(er="✦ 星图觉醒!点击顶部「星图」按钮选择一道天赋"),I){let e=lI.TIDE_EVENTS[I.type];er=`${F?"🌐 全球星潮 · ":""}${e.icon} 星潮「${e.name}」进行中 \xb7 ${e.desc}`}return J&&(er="✦ 接触进度已满,可发起飞升进入新周目"),(0,d.jsxs)("div",{className:"relative min-h-screen flex flex-col bg-[#050410] text-foreground overflow-x-hidden",children:[(0,d.jsx)(h,{className:"fixed inset-0 w-full h-full -z-10"}),(0,d.jsx)(lz,{}),(0,d.jsxs)("header",{className:"sticky top-0 z-30 px-3 sm:px-5 pt-3 pb-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 mb-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,d.jsxs)("div",{className:"relative h-9 w-9",children:[(0,d.jsx)("div",{className:"absolute inset-0 rounded-full bg-gradient-to-br from-emerald-400 via-fuchsia-500 to-rose-400 blur-md opacity-60"}),(0,d.jsx)("div",{className:"absolute inset-1 rounded-full bg-[#050410] flex items-center justify-center",children:(0,d.jsx)(es.Sparkles,{className:"h-4 w-4 text-fuchsia-300"})})]}),(0,d.jsxs)("div",{className:"leading-tight",children:[(0,d.jsx)("h1",{className:"text-base sm:text-lg font-bold text-gradient font-display",children:"回响星核"}),(0,d.jsx)("p",{className:"text-[9px] sm:text-[10px] text-muted-foreground/70 -mt-0.5 tracking-wider font-tech",children:"ECHO NEXUS · v0.12"})]})]}),(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,d.jsx)(lV,{}),(0,d.jsxs)(ee.Button,{size:"sm",variant:"outline",onClick:()=>k(!0),className:"border-amber-400/50 text-amber-200 hover:bg-amber-500/10 h-8 px-2.5","aria-label":"深空巡航",title:"深空巡航 · 实时玩法",children:[(0,d.jsx)(dT,{className:"h-3.5 w-3.5 mr-1"}),"巡航"]}),(0,d.jsxs)(ee.Button,{size:"icon",variant:"ghost",onClick:()=>j(!0),className:"h-8 w-8 relative group","aria-label":"编年史",title:"回响编年史",children:[(0,d.jsx)(ef.BookOpen,{className:"h-4 w-4 group-hover:text-fuchsia-300 transition-colors"}),U>0&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 min-w-[14px] h-[14px] px-1 rounded-full bg-fuchsia-500 text-[9px] font-mono font-bold text-white flex items-center justify-center border border-fuchsia-300/50",children:U})]}),Q&&(0,d.jsxs)(ee.Button,{size:"sm",variant:"outline",onClick:()=>v(!0),className:"border-fuchsia-400/60 text-fuchsia-200 hover:bg-fuchsia-500/15 h-8 px-2.5 animate-pulse",children:[(0,d.jsx)(tt.Star,{className:"h-3.5 w-3.5 mr-1"}),"觉醒"]}),J&&(0,d.jsxs)(ee.Button,{size:"sm",variant:"outline",onClick:()=>p(!0),"data-tut":"prestige-btn",className:"border-fuchsia-400/50 text-fuchsia-200 hover:bg-fuchsia-500/10 h-8 px-2.5",children:[(0,d.jsx)(y.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),"飞升"]}),(0,d.jsx)(ee.Button,{size:"icon",variant:"ghost",onClick:()=>g(!0),className:"h-8 w-8","aria-label":"设置",children:(0,d.jsx)(dk,{className:"h-4 w-4"})})]})]}),(0,d.jsx)(L,{onPrestige:()=>p(!0)})]}),(0,d.jsx)("main",{className:"flex-1 px-3 sm:px-5 pb-3 min-h-0",children:(0,d.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(300px,360px)_1fr] gap-3 h-full",children:[(0,d.jsxs)("section",{className:"glass rounded-2xl p-3 sm:p-4 flex flex-col gap-3 min-h-[340px] sm:min-h-[420px] relative overflow-hidden",children:[(0,d.jsx)("div",{className:"pointer-events-none absolute -top-16 -left-16 h-40 w-40 rounded-full bg-emerald-500/10 blur-3xl"}),(0,d.jsx)("div",{className:"pointer-events-none absolute -bottom-16 -right-16 h-40 w-40 rounded-full bg-fuchsia-500/10 blur-3xl"}),(0,d.jsx)("div",{className:"pointer-events-none absolute inset-4 rounded-full border border-emerald-400/10 animate-[spin_60s_linear_infinite]"}),(0,d.jsx)("div",{className:"pointer-events-none absolute inset-8 rounded-full border border-dashed border-fuchsia-400/10 animate-[spin_90s_linear_infinite_reverse]"}),(0,d.jsx)("div",{className:"pointer-events-none absolute top-2 left-2 h-3 w-3 border-l border-t border-emerald-400/30 rounded-tl"}),(0,d.jsx)("div",{className:"pointer-events-none absolute top-2 right-2 h-3 w-3 border-r border-t border-fuchsia-400/30 rounded-tr"}),(0,d.jsx)("div",{className:"pointer-events-none absolute bottom-2 left-2 h-3 w-3 border-l border-b border-amber-400/30 rounded-bl"}),(0,d.jsx)("div",{className:"pointer-events-none absolute bottom-2 right-2 h-3 w-3 border-r border-b border-rose-400/30 rounded-br"}),(0,d.jsxs)("div",{className:"pointer-events-none absolute top-2 left-1/2 -translate-x-1/2 flex items-center gap-1.5 text-[8px] font-mono text-muted-foreground/60 z-10",children:[(0,d.jsx)("span",{className:"h-1 w-1 rounded-full bg-emerald-400 animate-pulse"}),(0,d.jsx)("span",{className:"font-tech",children:"CRYSTAL CORE · ONLINE"}),(0,d.jsx)("span",{className:"h-1 w-1 rounded-full bg-fuchsia-400 animate-pulse"})]}),(0,d.jsx)("div",{"data-tut":"crystal-orb",className:"relative flex justify-center pt-3",children:(0,d.jsx)(Z,{})}),(0,d.jsx)(d$,{}),(0,d.jsx)(lw,{})]}),(0,d.jsxs)("section",{className:"flex flex-col gap-3 min-h-0",children:[(0,d.jsx)("div",{"data-tut":"decode-panel",className:"glass rounded-2xl p-4 flex-1 min-h-[280px] sm:min-h-[320px] max-h-[480px]",children:(0,d.jsx)(eo,{})}),(0,d.jsx)("div",{className:"glass rounded-2xl p-3 min-h-[320px] sm:min-h-[380px] max-h-[560px] flex flex-col",children:(0,d.jsxs)(dv,{defaultValue:G?"expedition":Q?"constellation":"tech",className:"h-full flex flex-col",children:[(0,d.jsxs)(dw,{className:"grid grid-cols-3 sm:grid-cols-9 h-auto sm:h-9 bg-black/30 gap-0.5 p-1",children:[(0,d.jsxs)(dj,{value:"expedition","data-tut":"tab-expedition",className:"text-[11px] gap-1 relative px-0.5 flex-col h-7 data-[state=active]:bg-amber-500/15 data-[state=active]:shadow-[0_0_12px_rgba(251,191,36,0.3)] transition-all",children:[(0,d.jsx)(eh,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"探险"}),z>=1&&!G&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-amber-400 animate-pulse ring-1 ring-black/50"}),G&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-rose-400 animate-pulse ring-1 ring-black/50"})]}),(0,d.jsxs)(dj,{value:"tech","data-tut":"tab-tech",className:"text-[11px] gap-1 px-0.5 flex-col h-7 data-[state=active]:bg-emerald-500/15 data-[state=active]:shadow-[0_0_12px_rgba(52,211,153,0.3)] transition-all",children:[(0,d.jsx)(lb.Cpu,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"技术"})]}),(0,d.jsxs)(dj,{value:"constellation",className:"text-[11px] gap-1 relative px-0.5 flex-col h-7 data-[state=active]:bg-fuchsia-500/15 data-[state=active]:shadow-[0_0_12px_rgba(232,121,249,0.3)] transition-all",children:[(0,d.jsx)(tt.Star,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"星图"}),Q&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-fuchsia-400 animate-pulse ring-1 ring-black/50"})]}),(0,d.jsxs)(dj,{value:"codex",className:"text-[11px] gap-1 px-0.5 flex-col h-7 data-[state=active]:bg-cyan-500/15 data-[state=active]:shadow-[0_0_12px_rgba(34,211,238,0.3)] transition-all",children:[(0,d.jsx)(ef.BookOpen,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"图谱"})]}),(0,d.jsxs)(dj,{value:"ach",className:"text-[11px] gap-1 relative px-0.5 flex-col h-7 data-[state=active]:bg-amber-500/15 data-[state=active]:shadow-[0_0_12px_rgba(251,191,36,0.3)] transition-all",children:[(0,d.jsx)(tV.Trophy,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"成就"}),X<tF.ACHIEVEMENTS.length&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-amber-400 animate-pulse ring-1 ring-black/50"})]}),(0,d.jsxs)(dj,{value:"beacon",className:"text-[11px] gap-1 relative px-0.5 flex-col h-7 data-[state=active]:bg-emerald-500/15 data-[state=active]:shadow-[0_0_12px_rgba(52,211,153,0.3)] transition-all",children:[(0,d.jsx)(o0.Radio,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"信标"}),W&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-emerald-400 animate-pulse ring-1 ring-black/50"})]}),(0,d.jsxs)(dj,{value:"stats",className:"text-[11px] gap-1 px-0.5 flex-col h-7 data-[state=active]:bg-slate-500/15 data-[state=active]:shadow-[0_0_12px_rgba(148,163,184,0.3)] transition-all",children:[(0,d.jsx)(dS,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"统计"})]}),(0,d.jsxs)(dj,{value:"attributes",className:"text-[11px] gap-1 relative px-0.5 flex-col h-7 data-[state=active]:bg-gradient-to-br data-[state=active]:from-emerald-500/15 data-[state=active]:via-fuchsia-500/15 data-[state=active]:to-rose-500/15 data-[state=active]:shadow-[0_0_12px_rgba(232,121,249,0.3)] transition-all",children:[(0,d.jsx)(dC,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"角色"}),H>0&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-rose-400 animate-pulse ring-1 ring-black/50"})]}),(0,d.jsxs)(dj,{value:"relic",className:"text-[11px] gap-1 relative px-0.5 flex-col h-7 data-[state=active]:bg-fuchsia-500/15 data-[state=active]:shadow-[0_0_12px_rgba(232,121,249,0.3)] transition-all",children:[(0,d.jsx)(lk,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"图鉴"})]})]}),(0,d.jsx)(dN,{value:"expedition",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(tI,{})}),(0,d.jsx)(dN,{value:"tech",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(eg,{})}),(0,d.jsx)(dN,{value:"constellation",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(oJ,{})}),(0,d.jsx)(dN,{value:"codex",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(e6,{})}),(0,d.jsx)(dN,{value:"ach",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(tU,{})}),(0,d.jsx)(dN,{value:"beacon",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(la,{})}),(0,d.jsx)(dN,{value:"stats",className:"flex-1 mt-2 min-h-0",children:(0,d.jsx)(dO,{})}),(0,d.jsx)(dN,{value:"attributes",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(lp,{})}),(0,d.jsx)(dN,{value:"relic",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(lC,{})})]})})]})]})}),(0,d.jsx)("div",{className:"px-3 sm:px-5 pb-1 shrink-0",children:(0,d.jsx)(lB,{})}),(0,d.jsx)("footer",{className:"sticky bottom-0 z-20 mt-auto px-3 sm:px-5 pb-2 pt-1",children:(0,d.jsxs)("div",{className:`glass rounded-xl px-3 py-2 flex items-center gap-2 text-xs ${et?"border-amber-400/40 animate-pulse":""} ${I?"border-white/20":""}`,style:I?{boxShadow:`inset 0 0 16px ${lI.TIDE_EVENTS[I.type].glow}`}:void 0,children:[(0,d.jsx)("span",{className:et?"text-amber-400":I?"":"text-fuchsia-300",style:I?{color:lI.TIDE_EVENTS[I.type].color}:void 0,children:"▶"}),(0,d.jsx)("span",{className:`flex-1 truncate ${et?"text-amber-200":"text-muted-foreground"}`,children:er}),(0,d.jsx)("span",{className:"hidden sm:inline text-muted-foreground/60",children:"|"}),(0,d.jsxs)("span",{className:"hidden sm:inline text-muted-foreground/70",children:["产能 ",(0,m.formatNum)(A),"/s"]}),(0,d.jsx)("a",{href:"https://git.atdunbg.xyz/Super_Z/echo-nexus",target:"_blank",rel:"noreferrer",className:"text-muted-foreground/60 hover:text-foreground transition ml-1","aria-label":"仓库",children:(0,d.jsx)(tj,{className:"h-3.5 w-3.5"})})]})}),(0,d.jsx)(ta,{open:c,onOpenChange:p}),(0,d.jsx)(dA,{open:w,onOpenChange:j}),(0,d.jsx)(dP,{open:b,onOpenChange:v}),(0,d.jsx)(tE,{open:x,onOpenChange:g}),(0,d.jsx)(oZ,{}),(0,d.jsx)(lF,{}),(0,d.jsx)(ln,{}),(0,d.jsx)(d_,{}),N&&(0,d.jsx)(dM,{onClose:()=>k(!1)})]})}function d$(){let e=(0,f.useGameStore)(e=>e.crystalsPerSec),t=(0,f.useGameStore)(e=>e.pulsePower),s=(0,f.useGameStore)(e=>e._combo),r=(0,f.useGameStore)(e=>e.crystals),a=(0,f.useGameStore)(e=>e.crystalCap),i=s>=1?1+(s-1)*.15:1,n=s>=3,o=(a>0?r/a*100:0)>=90;return(0,d.jsxs)("div",{className:"mt-3 grid grid-cols-2 sm:grid-cols-4 gap-2 w-full max-w-md pointer-events-none",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-emerald-400/30 bg-black/30 backdrop-blur p-2 flex items-center gap-1.5",children:[(0,d.jsx)(p.Gem,{className:"h-3.5 w-3.5 text-emerald-400 shrink-0"}),(0,d.jsxs)("div",{className:"min-w-0 leading-tight",children:[(0,d.jsx)("div",{className:"text-[9px] uppercase tracking-wider text-emerald-300/70 truncate",children:"晶体产能"}),(0,d.jsxs)("div",{className:"text-sm font-mono tabular-nums text-emerald-200 truncate",children:[(0,m.formatNum)(e),(0,d.jsx)("span",{className:"text-[9px] text-emerald-300/60",children:"/s"})]})]})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-rose-400/30 bg-black/30 backdrop-blur p-2 flex items-center gap-1.5",children:[(0,d.jsx)(tO.Zap,{className:"h-3.5 w-3.5 text-rose-400 shrink-0"}),(0,d.jsxs)("div",{className:"min-w-0 leading-tight",children:[(0,d.jsx)("div",{className:"text-[9px] uppercase tracking-wider text-rose-300/70 truncate",children:"主动脉冲"}),(0,d.jsxs)("div",{className:"text-sm font-mono tabular-nums text-rose-200 truncate",children:[(0,m.formatNum)(t),s>=1&&(0,d.jsxs)("span",{className:"text-[9px] text-rose-300/80",children:[" ×",i.toFixed(2)]})]})]})]}),(0,d.jsxs)("div",{className:`rounded-lg border bg-black/30 backdrop-blur p-2 flex items-center gap-1.5 ${n?"border-amber-400/70 animate-pulse":"border-amber-400/30"}`,children:[(0,d.jsx)(o7.Flame,{className:`h-3.5 w-3.5 text-amber-400 shrink-0 ${n?"drop-shadow-[0_0_4px_rgba(251,191,36,0.7)]":""}`}),(0,d.jsxs)("div",{className:"min-w-0 leading-tight",children:[(0,d.jsx)("div",{className:"text-[9px] uppercase tracking-wider text-amber-300/70 truncate",children:"当前连击"}),(0,d.jsxs)("div",{className:`text-sm font-mono tabular-nums truncate ${n?"text-amber-200":"text-amber-300/80"}`,children:[s,(0,d.jsx)("span",{className:"text-[9px] text-amber-300/60",children:"/10"})]})]})]}),(0,d.jsxs)("div",{className:`rounded-lg border bg-black/30 backdrop-blur p-2 flex items-center gap-1.5 ${o?"border-rose-400/70 animate-pulse":"border-fuchsia-400/30"}`,children:[(0,d.jsx)(dE,{className:`h-3.5 w-3.5 shrink-0 ${o?"text-rose-400":"text-fuchsia-400"}`}),(0,d.jsxs)("div",{className:"min-w-0 leading-tight",children:[(0,d.jsx)("div",{className:`text-[9px] uppercase tracking-wider truncate ${o?"text-rose-300/80":"text-fuchsia-300/70"}`,children:"仓库容量"}),(0,d.jsxs)("div",{className:`text-sm font-mono tabular-nums truncate ${o?"text-rose-200":"text-fuchsia-200"}`,children:[(0,m.formatNum)(r),(0,d.jsxs)("span",{className:`text-[9px] ${o?"text-rose-300/70":"text-fuchsia-300/60"}`,children:["/",(0,m.formatNum)(a)]})]})]})]})]})}function dO(){var e;let t,s=(0,f.useGameStore)((e=e=>({totalDecoded:e.totalDecoded,ascensions:e.ascensions,blueprints:e.blueprints,tech:e.tech,fragments:e.fragments,achievements:e.achievements,constellation:e.constellation,contact:e.contact,crystalsPerSec:e.crystalsPerSec,crystalCap:e.crystalCap,insightMult:e.insightMult,totalExpeditions:e.totalExpeditions,bossKills:e.bossKills,starTidesEncountered:e.starTidesEncountered,chronicle:e.chronicle,energy:e.energy,energyMax:e.energyMax,attributes:e.attributes,pendingAttrPoints:e.pendingAttrPoints}),t=u.default.useRef(void 0),s=>{let r=e(s);return!function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(Symbol.iterator in e&&Symbol.iterator in t){if("entries"in e&&"entries"in t)return cK(e,t);let s=e[Symbol.iterator](),r=t[Symbol.iterator](),a=s.next(),i=r.next();for(;!a.done&&!i.done;){if(!Object.is(a.value,i.value))return!1;a=s.next(),i=r.next()}return!!a.done&&!!i.done}return cK({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}(t.current,r)?t.current=r:t.current})),r=Object.values(s.achievements).filter(Boolean).length,[a,i]=(0,u.useState)(null);(0,u.useEffect)(()=>{try{let e=(0,oQ.loadLeaderboard)();i(e.length>0?e[0].score:null)}catch{i(null)}},[]);let n=[{label:"累计解码晶体",value:`${s.totalDecoded} 颗`},{label:"飞升周目",value:`${s.ascensions}`},{label:"持有蓝图",value:`${s.blueprints.length} / 6`},{label:"已学技术",value:`${Object.values(s.tech).filter(e=>e>0).length} / ${m.TECH_TREE.length}`},{label:"已获碎片",value:`${Object.values(s.fragments).filter(Boolean).length} / ${m.FRAGMENTS.length}`},{label:"已解锁成就",value:`${r} / ${tF.ACHIEVEMENTS.length}`},{label:"星图天赋",value:`${s.constellation?.length??0} / ${tr.CONSTELLATION_PERKS.length}`},{label:"接触进度",value:`${s.contact.toFixed(1)}%`},{label:"晶体产能",value:`${s.crystalsPerSec.toFixed(2)} /s`},{label:"仓库上限",value:`${(0,m.formatNum)(s.crystalCap)}`},{label:"洞见倍率",value:`\xd7${s.insightMult.toFixed(2)}`},{label:"累计探险",value:`${s.totalExpeditions} 次`},{label:"BOSS 击破",value:`${s.bossKills??0} 次`},{label:"星潮亲历",value:`${(s.starTidesEncountered??[]).length} / 9`},{label:"编年史条目",value:`${(s.chronicle??[]).length} 纪元`},{label:"探险能量",value:`${Math.floor(s.energy)} / ${s.energyMax}`},{label:"信标最高分",value:null!==a?(0,m.formatNum)(a):"—"},{label:"探索力",value:`${s.attributes?.exploration??0} / 100`},{label:"智慧",value:`${s.attributes?.wisdom??0} / 100`},{label:"勇气",value:`${s.attributes?.courage??0} / 100`},{label:"灵感",value:`${s.attributes?.inspiration??0} / 100`},{label:"待分配属性点",value:`${s.pendingAttrPoints??0}`}];return(0,d.jsx)("div",{className:"grid grid-cols-2 gap-1.5 text-xs",children:n.map(e=>(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-md bg-black/25 border border-white/5 px-2 py-1.5",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:e.label}),(0,d.jsx)("span",{className:"font-mono text-foreground",children:e.value})]},e.label))})}e.s(["default",()=>dR],52683)}]);