From fef796e4d5033bb0443597697c2e873c00bbd677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=98=E9=A3=8E?= Date: Tue, 10 Feb 2026 15:07:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BC=80=E5=8F=91=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=B3=A8=E9=87=8A=E6=8E=89?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=20API=20=E5=9C=B0=E5=9D=80=E5=B9=B6=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83=20URL=E3=80=82?= =?UTF-8?q?=E5=90=8C=E6=97=B6=EF=BC=8C=E6=9B=B4=E6=96=B0=20TypeScript=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E4=BF=A1=E6=81=AF=E4=BB=A5=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E6=96=B0=E7=9A=84=20API=20=E8=B7=AF=E5=BE=84=EF=BC=8C=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E6=97=A7=E7=9A=84=20JavaScript=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=BC=95=E7=94=A8=EF=BC=8C=E6=8F=90=E5=8D=87=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=9A=84=E5=8F=AF=E7=BB=B4=E6=8A=A4=E6=80=A7=E5=92=8C=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soul-admin/.env.development | 4 +- .../{index-Bs5A6hv4.js => index-Y_ZBqQPE.js} | 182 +++++++++--------- soul-admin/dist/index.html | 2 +- soul-admin/tsconfig.tsbuildinfo | 2 +- soul-api/soul-api | Bin 19070732 -> 19070732 bytes 5 files changed, 95 insertions(+), 95 deletions(-) rename soul-admin/dist/assets/{index-Bs5A6hv4.js => index-Y_ZBqQPE.js} (57%) diff --git a/soul-admin/.env.development b/soul-admin/.env.development index d4531a6a..7cff8a7b 100644 --- a/soul-admin/.env.development +++ b/soul-admin/.env.development @@ -1,7 +1,7 @@ # 对接后端 base URL(不改 API 路径,仅改此处即可切换 Next → Gin) # 宝塔部署:若 API 站点开启了强制 HTTPS,这里必须用 https,否则预检请求会被重定向导致 CORS 报错 # VITE_API_BASE_URL=http://localhost:3006 -VITE_API_BASE_URL=http://localhost:8080 +# VITE_API_BASE_URL=http://localhost:8080 # VITE_API_BASE_URL=https://soulapi.quwanzhi.com -# VITE_API_BASE_URL=https://soul.quwanzhi.com +VITE_API_BASE_URL=https://soul.quwanzhi.com diff --git a/soul-admin/dist/assets/index-Bs5A6hv4.js b/soul-admin/dist/assets/index-Y_ZBqQPE.js similarity index 57% rename from soul-admin/dist/assets/index-Bs5A6hv4.js rename to soul-admin/dist/assets/index-Y_ZBqQPE.js index ffe6901a..d6d52c8e 100644 --- a/soul-admin/dist/assets/index-Bs5A6hv4.js +++ b/soul-admin/dist/assets/index-Y_ZBqQPE.js @@ -1,4 +1,4 @@ -function zv(r,a){for(var l=0;li[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function Wm(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Pc={exports:{}},Ca={},Rc={exports:{}},De={};/** +function $v(r,a){for(var l=0;li[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function Hm(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Pc={exports:{}},Ca={},Rc={exports:{}},De={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function zv(r,a){for(var l=0;l>>1,G=T[L];if(0>>1;Lc(be,q))jec(ne,be)?(T[L]=ne,T[je]=q,L=je):(T[L]=be,T[se]=q,L=se);else if(jec(ne,q))T[L]=ne,T[je]=q,L=je;else break e}}return J}function c(T,J){var q=T.sortIndex-J.sortIndex;return q!==0?q:T.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;r.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();r.unstable_now=function(){return f.now()-m}}var x=[],g=[],v=1,y=null,E=3,k=!1,C=!1,b=!1,j=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(T){for(var J=l(g);J!==null;){if(J.callback===null)i(g);else if(J.startTime<=T)i(g),J.sortIndex=J.expirationTime,a(x,J);else break;J=l(g)}}function A(T){if(b=!1,S(T),!C)if(l(x)!==null)C=!0,V(U);else{var J=l(g);J!==null&&B(A,J.startTime-T)}}function U(T,J){C=!1,b&&(b=!1,N(W),W=-1),k=!0;var q=E;try{for(S(J),y=l(x);y!==null&&(!(y.expirationTime>J)||T&&!oe());){var L=y.callback;if(typeof L=="function"){y.callback=null,E=y.priorityLevel;var G=L(y.expirationTime<=J);J=r.unstable_now(),typeof G=="function"?y.callback=G:y===l(x)&&i(x),S(J)}else i(x);y=l(x)}if(y!==null)var fe=!0;else{var se=l(g);se!==null&&B(A,se.startTime-J),fe=!1}return fe}finally{y=null,E=q,k=!1}}var Q=!1,Y=null,W=-1,le=5,de=-1;function oe(){return!(r.unstable_now()-deT||125L?(T.sortIndex=q,a(g,T),l(x)===null&&T===l(g)&&(b?(N(W),W=-1):b=!0,B(A,q-L))):(T.sortIndex=G,a(x,T),C||k||(C=!0,V(U))),T},r.unstable_shouldYield=oe,r.unstable_wrapCallback=function(T){var J=E;return function(){var q=E;E=J;try{return T.apply(this,arguments)}finally{E=q}}}})(Ic)),Ic}var Bh;function Wv(){return Bh||(Bh=1,Tc.exports=Vv()),Tc.exports}/** + */var Bh;function Wv(){return Bh||(Bh=1,(function(r){function a(T,J){var q=T.length;T.push(J);e:for(;0>>1,G=T[L];if(0>>1;Lc(be,q))jec(ne,be)?(T[L]=ne,T[je]=q,L=je):(T[L]=be,T[se]=q,L=se);else if(jec(ne,q))T[L]=ne,T[je]=q,L=je;else break e}}return J}function c(T,J){var q=T.sortIndex-J.sortIndex;return q!==0?q:T.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;r.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();r.unstable_now=function(){return f.now()-m}}var p=[],g=[],v=1,y=null,E=3,k=!1,C=!1,b=!1,j=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(T){for(var J=l(g);J!==null;){if(J.callback===null)i(g);else if(J.startTime<=T)i(g),J.sortIndex=J.expirationTime,a(p,J);else break;J=l(g)}}function A(T){if(b=!1,S(T),!C)if(l(p)!==null)C=!0,V(U);else{var J=l(g);J!==null&&B(A,J.startTime-T)}}function U(T,J){C=!1,b&&(b=!1,N(W),W=-1),k=!0;var q=E;try{for(S(J),y=l(p);y!==null&&(!(y.expirationTime>J)||T&&!oe());){var L=y.callback;if(typeof L=="function"){y.callback=null,E=y.priorityLevel;var G=L(y.expirationTime<=J);J=r.unstable_now(),typeof G=="function"?y.callback=G:y===l(p)&&i(p),S(J)}else i(p);y=l(p)}if(y!==null)var fe=!0;else{var se=l(g);se!==null&&B(A,se.startTime-J),fe=!1}return fe}finally{y=null,E=q,k=!1}}var Q=!1,Y=null,W=-1,le=5,de=-1;function oe(){return!(r.unstable_now()-deT||125L?(T.sortIndex=q,a(g,T),l(p)===null&&T===l(g)&&(b?(N(W),W=-1):b=!0,B(A,q-L))):(T.sortIndex=G,a(p,T),C||k||(C=!0,V(U))),T},r.unstable_shouldYield=oe,r.unstable_wrapCallback=function(T){var J=E;return function(){var q=E;E=J;try{return T.apply(this,arguments)}finally{E=q}}}})(Ic)),Ic}var Uh;function Hv(){return Uh||(Uh=1,Tc.exports=Wv()),Tc.exports}/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function zv(r,a){for(var l=0;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},y={};function E(e){return x.call(y,e)?!0:x.call(v,e)?!1:g.test(e)?y[e]=!0:(v[e]=!0,!1)}function k(e,t,s,o){if(s!==null&&s.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,t,s,o){if(t===null||typeof t>"u"||k(e,t,s,o))return!0;if(o)return!1;if(s!==null)switch(s.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function b(e,t,s,o,u,h,w){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=u,this.mustUseProperty=s,this.propertyName=e,this.type=t,this.sanitizeURL=h,this.removeEmptyString=w}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){j[e]=new b(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];j[t]=new b(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){j[e]=new b(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){j[e]=new b(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){j[e]=new b(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){j[e]=new b(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){j[e]=new b(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){j[e]=new b(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){j[e]=new b(e,5,!1,e.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function P(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(N,P);j[t]=new b(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(N,P);j[t]=new b(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(N,P);j[t]=new b(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){j[e]=new b(e,1,!1,e.toLowerCase(),null,!1,!1)}),j.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){j[e]=new b(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,s,o){var u=j.hasOwnProperty(t)?j[t]:null;(u!==null?u.type!==0:o||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},y={};function E(e){return p.call(y,e)?!0:p.call(v,e)?!1:g.test(e)?y[e]=!0:(v[e]=!0,!1)}function k(e,t,s,o){if(s!==null&&s.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,t,s,o){if(t===null||typeof t>"u"||k(e,t,s,o))return!0;if(o)return!1;if(s!==null)switch(s.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function b(e,t,s,o,u,h,w){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=u,this.mustUseProperty=s,this.propertyName=e,this.type=t,this.sanitizeURL=h,this.removeEmptyString=w}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){j[e]=new b(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];j[t]=new b(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){j[e]=new b(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){j[e]=new b(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){j[e]=new b(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){j[e]=new b(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){j[e]=new b(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){j[e]=new b(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){j[e]=new b(e,5,!1,e.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function P(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(N,P);j[t]=new b(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(N,P);j[t]=new b(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(N,P);j[t]=new b(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){j[e]=new b(e,1,!1,e.toLowerCase(),null,!1,!1)}),j.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){j[e]=new b(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,s,o){var u=j.hasOwnProperty(t)?j[t]:null;(u!==null?u.type!==0:o||!(2_||u[w]!==h[_]){var I=` -`+u[w].replace(" at new "," at ");return e.displayName&&I.includes("")&&(I=I.replace("",e.displayName)),I}while(1<=w&&0<=_);break}}}finally{fe=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?G(e):""}function be(e){switch(e.tag){case 5:return G(e.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return e=se(e.type,!1),e;case 11:return e=se(e.type.render,!1),e;case 1:return e=se(e.type,!0),e;default:return""}}function je(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Y:return"Fragment";case Q:return"Portal";case le:return"Profiler";case W:return"StrictMode";case R:return"Suspense";case H:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case oe:return(e.displayName||"Context")+".Consumer";case de:return(e._context.displayName||"Context")+".Provider";case K:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case X:return t=e.displayName||null,t!==null?t:je(e.type)||"Memo";case V:t=e._payload,e=e._init;try{return je(e(t))}catch{}}return null}function ne(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return je(t);case 8:return t===W?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function he(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Se(e){var t=Ee(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,h=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(w){o=""+w,h.call(this,w)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return o},setValue:function(w){o=""+w},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Te(e){e._valueTracker||(e._valueTracker=Se(e))}function z(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=Ee(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function Ie(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ze(e,t){var s=t.checked;return q({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function Nt(e,t){var s=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;s=he(t.value!=null?t.value:s),e._wrapperState={initialChecked:o,initialValue:s,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Vt(e,t){t=t.checked,t!=null&&S(e,"checked",t,!1)}function Jt(e,t){Vt(e,t);var s=he(t.value),o=t.type;if(s!=null)o==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?fn(e,t.type,s):t.hasOwnProperty("defaultValue")&&fn(e,t.type,he(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Yr(e,t,s){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,s||t===e.value||(e.value=t),e.defaultValue=t}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function fn(e,t,s){(t!=="number"||Ie(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var Cr=Array.isArray;function hn(e,t,s,o){if(e=e.options,t){t={};for(var u=0;u"+t.valueOf().toString()+"",t=Rn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function mn(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Us={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Vg=["Webkit","ms","Moz","O"];Object.keys(Us).forEach(function(e){Vg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Us[t]=Us[e]})});function Xu(e,t,s){return t==null||typeof t=="boolean"||t===""?"":s||typeof t!="number"||t===0||Us.hasOwnProperty(e)&&Us[e]?(""+t).trim():t+"px"}function qu(e,t){e=e.style;for(var s in t)if(t.hasOwnProperty(s)){var o=s.indexOf("--")===0,u=Xu(s,t[s],o);s==="float"&&(s="cssFloat"),o?e.setProperty(s,u):e[s]=u}}var Wg=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $o(e,t){if(t){if(Wg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(l(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(l(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(l(61))}if(t.style!=null&&typeof t.style!="object")throw Error(l(62))}}function Bo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Uo=null;function Vo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wo=null,qr=null,Jr=null;function Ju(e){if(e=ua(e)){if(typeof Wo!="function")throw Error(l(280));var t=e.stateNode;t&&(t=al(t),Wo(e.stateNode,e.type,t))}}function Zu(e){qr?Jr?Jr.push(e):Jr=[e]:qr=e}function ed(){if(qr){var e=qr,t=Jr;if(Jr=qr=null,Ju(e),t)for(e=0;e>>=0,e===0?32:31-(t0(e)/n0|0)|0}var Ba=64,Ua=4194304;function Ks(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Va(e,t){var s=e.pendingLanes;if(s===0)return 0;var o=0,u=e.suspendedLanes,h=e.pingedLanes,w=s&268435455;if(w!==0){var _=w&~u;_!==0?o=Ks(_):(h&=w,h!==0&&(o=Ks(h)))}else w=s&~u,w!==0?o=Ks(w):h!==0&&(o=Ks(h));if(o===0)return 0;if(t!==0&&t!==o&&(t&u)===0&&(u=o&-o,h=t&-t,u>=h||u===16&&(h&4194240)!==0))return t;if((o&4)!==0&&(o|=s&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0s;s++)t.push(e);return t}function Gs(e,t,s){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Zt(t),e[t]=s}function l0(e,t){var s=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0=ta),Pd=" ",Rd=!1;function _d(e,t){switch(e){case"keyup":return M0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Td(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ts=!1;function D0(e,t){switch(e){case"compositionend":return Td(t);case"keypress":return t.which!==32?null:(Rd=!0,Pd);case"textInput":return e=t.data,e===Pd&&Rd?null:e;default:return null}}function O0(e,t){if(ts)return e==="compositionend"||!ii&&_d(e,t)?(e=jd(),Qa=ni=Xn=null,ts=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:s,offset:t-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Fd(s)}}function $d(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$d(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bd(){for(var e=window,t=Ie();t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Ie(e.document)}return t}function di(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function K0(e){var t=Bd(),s=e.focusedElem,o=e.selectionRange;if(t!==s&&s&&s.ownerDocument&&$d(s.ownerDocument.documentElement,s)){if(o!==null&&di(s)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in s)s.selectionStart=t,s.selectionEnd=Math.min(e,s.value.length);else if(e=(t=s.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var u=s.textContent.length,h=Math.min(o.start,u);o=o.end===void 0?h:Math.min(o.end,u),!e.extend&&h>o&&(u=o,o=h,h=u),u=zd(s,h);var w=zd(s,o);u&&w&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(t=t.createRange(),t.setStart(u.node,u.offset),e.removeAllRanges(),h>o?(e.addRange(t),e.extend(w.node,w.offset)):(t.setEnd(w.node,w.offset),e.addRange(t)))}}for(t=[],e=s;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,ns=null,fi=null,aa=null,hi=!1;function Ud(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;hi||ns==null||ns!==Ie(o)||(o=ns,"selectionStart"in o&&di(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),aa&&sa(aa,o)||(aa=o,o=nl(fi,"onSelect"),0os||(e.current=Ci[os],Ci[os]=null,os--)}function Ge(e,t){os++,Ci[os]=e.current,e.current=t}var er={},jt=Zn(er),_t=Zn(!1),Pr=er;function is(e,t){var s=e.type.contextTypes;if(!s)return er;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var u={},h;for(h in s)u[h]=t[h];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=u),u}function Tt(e){return e=e.childContextTypes,e!=null}function ll(){qe(_t),qe(jt)}function rf(e,t,s){if(jt.current!==er)throw Error(l(168));Ge(jt,t),Ge(_t,s)}function sf(e,t,s){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return s;o=o.getChildContext();for(var u in o)if(!(u in t))throw Error(l(108,ne(e)||"Unknown",u));return q({},s,o)}function ol(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||er,Pr=jt.current,Ge(jt,e),Ge(_t,_t.current),!0}function af(e,t,s){var o=e.stateNode;if(!o)throw Error(l(169));s?(e=sf(e,t,Pr),o.__reactInternalMemoizedMergedChildContext=e,qe(_t),qe(jt),Ge(jt,e)):qe(_t),Ge(_t,s)}var Tn=null,il=!1,ki=!1;function lf(e){Tn===null?Tn=[e]:Tn.push(e)}function sv(e){il=!0,lf(e)}function tr(){if(!ki&&Tn!==null){ki=!0;var e=0,t=He;try{var s=Tn;for(He=1;e>=w,u-=w,In=1<<32-Zt(t)+u|s<Pe?(gt=ke,ke=null):gt=ke.sibling;var $e=Z(D,ke,O[Pe],re);if($e===null){ke===null&&(ke=gt);break}e&&ke&&$e.alternate===null&&t(D,ke),M=h($e,M,Pe),Ce===null?Ne=$e:Ce.sibling=$e,Ce=$e,ke=gt}if(Pe===O.length)return s(D,ke),Je&&_r(D,Pe),Ne;if(ke===null){for(;PePe?(gt=ke,ke=null):gt=ke.sibling;var ur=Z(D,ke,$e.value,re);if(ur===null){ke===null&&(ke=gt);break}e&&ke&&ur.alternate===null&&t(D,ke),M=h(ur,M,Pe),Ce===null?Ne=ur:Ce.sibling=ur,Ce=ur,ke=gt}if($e.done)return s(D,ke),Je&&_r(D,Pe),Ne;if(ke===null){for(;!$e.done;Pe++,$e=O.next())$e=te(D,$e.value,re),$e!==null&&(M=h($e,M,Pe),Ce===null?Ne=$e:Ce.sibling=$e,Ce=$e);return Je&&_r(D,Pe),Ne}for(ke=o(D,ke);!$e.done;Pe++,$e=O.next())$e=ie(ke,D,Pe,$e.value,re),$e!==null&&(e&&$e.alternate!==null&&ke.delete($e.key===null?Pe:$e.key),M=h($e,M,Pe),Ce===null?Ne=$e:Ce.sibling=$e,Ce=$e);return e&&ke.forEach(function(Fv){return t(D,Fv)}),Je&&_r(D,Pe),Ne}function lt(D,M,O,re){if(typeof O=="object"&&O!==null&&O.type===Y&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case U:e:{for(var Ne=O.key,Ce=M;Ce!==null;){if(Ce.key===Ne){if(Ne=O.type,Ne===Y){if(Ce.tag===7){s(D,Ce.sibling),M=u(Ce,O.props.children),M.return=D,D=M;break e}}else if(Ce.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===V&&hf(Ne)===Ce.type){s(D,Ce.sibling),M=u(Ce,O.props),M.ref=da(D,Ce,O),M.return=D,D=M;break e}s(D,Ce);break}else t(D,Ce);Ce=Ce.sibling}O.type===Y?(M=Fr(O.props.children,D.mode,re,O.key),M.return=D,D=M):(re=Dl(O.type,O.key,O.props,null,D.mode,re),re.ref=da(D,M,O),re.return=D,D=re)}return w(D);case Q:e:{for(Ce=O.key;M!==null;){if(M.key===Ce)if(M.tag===4&&M.stateNode.containerInfo===O.containerInfo&&M.stateNode.implementation===O.implementation){s(D,M.sibling),M=u(M,O.children||[]),M.return=D,D=M;break e}else{s(D,M);break}else t(D,M);M=M.sibling}M=bc(O,D.mode,re),M.return=D,D=M}return w(D);case V:return Ce=O._init,lt(D,M,Ce(O._payload),re)}if(Cr(O))return xe(D,M,O,re);if(J(O))return ye(D,M,O,re);fl(D,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,M!==null&&M.tag===6?(s(D,M.sibling),M=u(M,O),M.return=D,D=M):(s(D,M),M=jc(O,D.mode,re),M.return=D,D=M),w(D)):s(D,M)}return lt}var fs=mf(!0),pf=mf(!1),hl=Zn(null),ml=null,hs=null,Ii=null;function Ai(){Ii=hs=ml=null}function Mi(e){var t=hl.current;qe(hl),e._currentValue=t}function Li(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function ms(e,t){ml=e,Ii=hs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(It=!0),e.firstContext=null)}function Kt(e){var t=e._currentValue;if(Ii!==e)if(e={context:e,memoizedValue:t,next:null},hs===null){if(ml===null)throw Error(l(308));hs=e,ml.dependencies={lanes:0,firstContext:e}}else hs=hs.next=e;return t}var Tr=null;function Di(e){Tr===null?Tr=[e]:Tr.push(e)}function xf(e,t,s,o){var u=t.interleaved;return u===null?(s.next=s,Di(t)):(s.next=u.next,u.next=s),t.interleaved=s,Mn(e,o)}function Mn(e,t){e.lanes|=t;var s=e.alternate;for(s!==null&&(s.lanes|=t),s=e,e=e.return;e!==null;)e.childLanes|=t,s=e.alternate,s!==null&&(s.childLanes|=t),s=e,e=e.return;return s.tag===3?s.stateNode:null}var nr=!1;function Oi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ln(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function rr(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Fe&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,Mn(e,s)}return u=o.interleaved,u===null?(t.next=t,Di(o)):(t.next=u.next,u.next=t),o.interleaved=t,Mn(e,s)}function pl(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,qo(e,s)}}function vf(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var w={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};h===null?u=h=w:h=h.next=w,s=s.next}while(s!==null);h===null?u=h=t:h=h.next=t}else u=h=t;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,effects:o.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}function xl(e,t,s,o){var u=e.updateQueue;nr=!1;var h=u.firstBaseUpdate,w=u.lastBaseUpdate,_=u.shared.pending;if(_!==null){u.shared.pending=null;var I=_,F=I.next;I.next=null,w===null?h=F:w.next=F,w=I;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,_=ee.lastBaseUpdate,_!==w&&(_===null?ee.firstBaseUpdate=F:_.next=F,ee.lastBaseUpdate=I))}if(h!==null){var te=u.baseState;w=0,ee=F=I=null,_=h;do{var Z=_.lane,ie=_.eventTime;if((o&Z)===Z){ee!==null&&(ee=ee.next={eventTime:ie,lane:0,tag:_.tag,payload:_.payload,callback:_.callback,next:null});e:{var xe=e,ye=_;switch(Z=t,ie=s,ye.tag){case 1:if(xe=ye.payload,typeof xe=="function"){te=xe.call(ie,te,Z);break e}te=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=ye.payload,Z=typeof xe=="function"?xe.call(ie,te,Z):xe,Z==null)break e;te=q({},te,Z);break e;case 2:nr=!0}}_.callback!==null&&_.lane!==0&&(e.flags|=64,Z=u.effects,Z===null?u.effects=[_]:Z.push(_))}else ie={eventTime:ie,lane:Z,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ee===null?(F=ee=ie,I=te):ee=ee.next=ie,w|=Z;if(_=_.next,_===null){if(_=u.shared.pending,_===null)break;Z=_,_=Z.next,Z.next=null,u.lastBaseUpdate=Z,u.shared.pending=null}}while(!0);if(ee===null&&(I=te),u.baseState=I,u.firstBaseUpdate=F,u.lastBaseUpdate=ee,t=u.shared.interleaved,t!==null){u=t;do w|=u.lane,u=u.next;while(u!==t)}else h===null&&(u.shared.lanes=0);Mr|=w,e.lanes=w,e.memoizedState=te}}function yf(e,t,s){if(e=t.effects,t.effects=null,e!==null)for(t=0;ts?s:4,e(!0);var o=Ui.transition;Ui.transition={};try{e(!1),t()}finally{He=s,Ui.transition=o}}function Ff(){return Gt().memoizedState}function iv(e,t,s){var o=or(e);if(s={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null},zf(e))$f(t,s);else if(s=xf(e,t,s,o),s!==null){var u=Rt();an(s,e,o,u),Bf(s,t,o)}}function cv(e,t,s){var o=or(e),u={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null};if(zf(e))$f(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var w=t.lastRenderedState,_=h(w,s);if(u.hasEagerState=!0,u.eagerState=_,en(_,w)){var I=t.interleaved;I===null?(u.next=u,Di(t)):(u.next=I.next,I.next=u),t.interleaved=u;return}}catch{}finally{}s=xf(e,t,u,o),s!==null&&(u=Rt(),an(s,e,o,u),Bf(s,t,o))}}function zf(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function $f(e,t){pa=yl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Bf(e,t,s){if((s&4194240)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,qo(e,s)}}var jl={readContext:Kt,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useInsertionEffect:bt,useLayoutEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useMutableSource:bt,useSyncExternalStore:bt,useId:bt,unstable_isNewReconciler:!1},uv={readContext:Kt,useCallback:function(e,t){return vn().memoizedState=[e,t===void 0?null:t],e},useContext:Kt,useEffect:_f,useImperativeHandle:function(e,t,s){return s=s!=null?s.concat([e]):null,wl(4194308,4,Af.bind(null,t,e),s)},useLayoutEffect:function(e,t){return wl(4194308,4,e,t)},useInsertionEffect:function(e,t){return wl(4,2,e,t)},useMemo:function(e,t){var s=vn();return t=t===void 0?null:t,e=e(),s.memoizedState=[e,t],e},useReducer:function(e,t,s){var o=vn();return t=s!==void 0?s(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=iv.bind(null,nt,e),[o.memoizedState,e]},useRef:function(e){var t=vn();return e={current:e},t.memoizedState=e},useState:Pf,useDebugValue:Yi,useDeferredValue:function(e){return vn().memoizedState=e},useTransition:function(){var e=Pf(!1),t=e[0];return e=ov.bind(null,e[1]),vn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,s){var o=nt,u=vn();if(Je){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),xt===null)throw Error(l(349));(Ar&30)!==0||bf(o,t,s)}u.memoizedState=s;var h={value:s,getSnapshot:t};return u.queue=h,_f(Cf.bind(null,o,h,e),[e]),o.flags|=2048,va(9,Sf.bind(null,o,h,s,t),void 0,null),s},useId:function(){var e=vn(),t=xt.identifierPrefix;if(Je){var s=An,o=In;s=(o&~(1<<32-Zt(o)-1)).toString(32)+s,t=":"+t+"R"+s,s=xa++,0")&&(I=I.replace("",e.displayName)),I}while(1<=w&&0<=_);break}}}finally{fe=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?G(e):""}function be(e){switch(e.tag){case 5:return G(e.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return e=se(e.type,!1),e;case 11:return e=se(e.type.render,!1),e;case 1:return e=se(e.type,!0),e;default:return""}}function je(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Y:return"Fragment";case Q:return"Portal";case le:return"Profiler";case W:return"StrictMode";case R:return"Suspense";case H:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case oe:return(e.displayName||"Context")+".Consumer";case de:return(e._context.displayName||"Context")+".Provider";case K:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case X:return t=e.displayName||null,t!==null?t:je(e.type)||"Memo";case V:t=e._payload,e=e._init;try{return je(e(t))}catch{}}return null}function ne(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return je(t);case 8:return t===W?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function he(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Se(e){var t=Ee(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,h=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(w){o=""+w,h.call(this,w)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return o},setValue:function(w){o=""+w},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Te(e){e._valueTracker||(e._valueTracker=Se(e))}function z(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=Ee(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function Ie(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ze(e,t){var s=t.checked;return q({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function Nt(e,t){var s=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;s=he(t.value!=null?t.value:s),e._wrapperState={initialChecked:o,initialValue:s,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Vt(e,t){t=t.checked,t!=null&&S(e,"checked",t,!1)}function Jt(e,t){Vt(e,t);var s=he(t.value),o=t.type;if(s!=null)o==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?fn(e,t.type,s):t.hasOwnProperty("defaultValue")&&fn(e,t.type,he(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Yr(e,t,s){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,s||t===e.value||(e.value=t),e.defaultValue=t}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function fn(e,t,s){(t!=="number"||Ie(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var Cr=Array.isArray;function hn(e,t,s,o){if(e=e.options,t){t={};for(var u=0;u"+t.valueOf().toString()+"",t=Rn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function mn(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Us={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Wg=["Webkit","ms","Moz","O"];Object.keys(Us).forEach(function(e){Wg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Us[t]=Us[e]})});function qu(e,t,s){return t==null||typeof t=="boolean"||t===""?"":s||typeof t!="number"||t===0||Us.hasOwnProperty(e)&&Us[e]?(""+t).trim():t+"px"}function Ju(e,t){e=e.style;for(var s in t)if(t.hasOwnProperty(s)){var o=s.indexOf("--")===0,u=qu(s,t[s],o);s==="float"&&(s="cssFloat"),o?e.setProperty(s,u):e[s]=u}}var Hg=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $o(e,t){if(t){if(Hg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(l(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(l(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(l(61))}if(t.style!=null&&typeof t.style!="object")throw Error(l(62))}}function Bo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Uo=null;function Vo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wo=null,qr=null,Jr=null;function Zu(e){if(e=ua(e)){if(typeof Wo!="function")throw Error(l(280));var t=e.stateNode;t&&(t=al(t),Wo(e.stateNode,e.type,t))}}function ed(e){qr?Jr?Jr.push(e):Jr=[e]:qr=e}function td(){if(qr){var e=qr,t=Jr;if(Jr=qr=null,Zu(e),t)for(e=0;e>>=0,e===0?32:31-(n0(e)/r0|0)|0}var Ba=64,Ua=4194304;function Ks(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Va(e,t){var s=e.pendingLanes;if(s===0)return 0;var o=0,u=e.suspendedLanes,h=e.pingedLanes,w=s&268435455;if(w!==0){var _=w&~u;_!==0?o=Ks(_):(h&=w,h!==0&&(o=Ks(h)))}else w=s&~u,w!==0?o=Ks(w):h!==0&&(o=Ks(h));if(o===0)return 0;if(t!==0&&t!==o&&(t&u)===0&&(u=o&-o,h=t&-t,u>=h||u===16&&(h&4194240)!==0))return t;if((o&4)!==0&&(o|=s&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0s;s++)t.push(e);return t}function Gs(e,t,s){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Zt(t),e[t]=s}function o0(e,t){var s=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0=ta),Rd=" ",_d=!1;function Td(e,t){switch(e){case"keyup":return L0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Id(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ts=!1;function O0(e,t){switch(e){case"compositionend":return Id(t);case"keypress":return t.which!==32?null:(_d=!0,Rd);case"textInput":return e=t.data,e===Rd&&_d?null:e;default:return null}}function F0(e,t){if(ts)return e==="compositionend"||!ii&&Td(e,t)?(e=bd(),Qa=ni=Xn=null,ts=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:s,offset:t-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=zd(s)}}function Bd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ud(){for(var e=window,t=Ie();t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Ie(e.document)}return t}function di(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function G0(e){var t=Ud(),s=e.focusedElem,o=e.selectionRange;if(t!==s&&s&&s.ownerDocument&&Bd(s.ownerDocument.documentElement,s)){if(o!==null&&di(s)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in s)s.selectionStart=t,s.selectionEnd=Math.min(e,s.value.length);else if(e=(t=s.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var u=s.textContent.length,h=Math.min(o.start,u);o=o.end===void 0?h:Math.min(o.end,u),!e.extend&&h>o&&(u=o,o=h,h=u),u=$d(s,h);var w=$d(s,o);u&&w&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(t=t.createRange(),t.setStart(u.node,u.offset),e.removeAllRanges(),h>o?(e.addRange(t),e.extend(w.node,w.offset)):(t.setEnd(w.node,w.offset),e.addRange(t)))}}for(t=[],e=s;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,ns=null,fi=null,aa=null,hi=!1;function Vd(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;hi||ns==null||ns!==Ie(o)||(o=ns,"selectionStart"in o&&di(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),aa&&sa(aa,o)||(aa=o,o=nl(fi,"onSelect"),0os||(e.current=Ci[os],Ci[os]=null,os--)}function Ge(e,t){os++,Ci[os]=e.current,e.current=t}var er={},jt=Zn(er),_t=Zn(!1),Pr=er;function is(e,t){var s=e.type.contextTypes;if(!s)return er;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var u={},h;for(h in s)u[h]=t[h];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=u),u}function Tt(e){return e=e.childContextTypes,e!=null}function ll(){qe(_t),qe(jt)}function sf(e,t,s){if(jt.current!==er)throw Error(l(168));Ge(jt,t),Ge(_t,s)}function af(e,t,s){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return s;o=o.getChildContext();for(var u in o)if(!(u in t))throw Error(l(108,ne(e)||"Unknown",u));return q({},s,o)}function ol(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||er,Pr=jt.current,Ge(jt,e),Ge(_t,_t.current),!0}function lf(e,t,s){var o=e.stateNode;if(!o)throw Error(l(169));s?(e=af(e,t,Pr),o.__reactInternalMemoizedMergedChildContext=e,qe(_t),qe(jt),Ge(jt,e)):qe(_t),Ge(_t,s)}var Tn=null,il=!1,ki=!1;function of(e){Tn===null?Tn=[e]:Tn.push(e)}function av(e){il=!0,of(e)}function tr(){if(!ki&&Tn!==null){ki=!0;var e=0,t=He;try{var s=Tn;for(He=1;e>=w,u-=w,In=1<<32-Zt(t)+u|s<Pe?(gt=ke,ke=null):gt=ke.sibling;var $e=Z(D,ke,O[Pe],re);if($e===null){ke===null&&(ke=gt);break}e&&ke&&$e.alternate===null&&t(D,ke),M=h($e,M,Pe),Ce===null?Ne=$e:Ce.sibling=$e,Ce=$e,ke=gt}if(Pe===O.length)return s(D,ke),Je&&_r(D,Pe),Ne;if(ke===null){for(;PePe?(gt=ke,ke=null):gt=ke.sibling;var ur=Z(D,ke,$e.value,re);if(ur===null){ke===null&&(ke=gt);break}e&&ke&&ur.alternate===null&&t(D,ke),M=h(ur,M,Pe),Ce===null?Ne=ur:Ce.sibling=ur,Ce=ur,ke=gt}if($e.done)return s(D,ke),Je&&_r(D,Pe),Ne;if(ke===null){for(;!$e.done;Pe++,$e=O.next())$e=te(D,$e.value,re),$e!==null&&(M=h($e,M,Pe),Ce===null?Ne=$e:Ce.sibling=$e,Ce=$e);return Je&&_r(D,Pe),Ne}for(ke=o(D,ke);!$e.done;Pe++,$e=O.next())$e=ie(ke,D,Pe,$e.value,re),$e!==null&&(e&&$e.alternate!==null&&ke.delete($e.key===null?Pe:$e.key),M=h($e,M,Pe),Ce===null?Ne=$e:Ce.sibling=$e,Ce=$e);return e&&ke.forEach(function(zv){return t(D,zv)}),Je&&_r(D,Pe),Ne}function lt(D,M,O,re){if(typeof O=="object"&&O!==null&&O.type===Y&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case U:e:{for(var Ne=O.key,Ce=M;Ce!==null;){if(Ce.key===Ne){if(Ne=O.type,Ne===Y){if(Ce.tag===7){s(D,Ce.sibling),M=u(Ce,O.props.children),M.return=D,D=M;break e}}else if(Ce.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===V&&mf(Ne)===Ce.type){s(D,Ce.sibling),M=u(Ce,O.props),M.ref=da(D,Ce,O),M.return=D,D=M;break e}s(D,Ce);break}else t(D,Ce);Ce=Ce.sibling}O.type===Y?(M=Fr(O.props.children,D.mode,re,O.key),M.return=D,D=M):(re=Dl(O.type,O.key,O.props,null,D.mode,re),re.ref=da(D,M,O),re.return=D,D=re)}return w(D);case Q:e:{for(Ce=O.key;M!==null;){if(M.key===Ce)if(M.tag===4&&M.stateNode.containerInfo===O.containerInfo&&M.stateNode.implementation===O.implementation){s(D,M.sibling),M=u(M,O.children||[]),M.return=D,D=M;break e}else{s(D,M);break}else t(D,M);M=M.sibling}M=bc(O,D.mode,re),M.return=D,D=M}return w(D);case V:return Ce=O._init,lt(D,M,Ce(O._payload),re)}if(Cr(O))return xe(D,M,O,re);if(J(O))return ye(D,M,O,re);fl(D,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,M!==null&&M.tag===6?(s(D,M.sibling),M=u(M,O),M.return=D,D=M):(s(D,M),M=jc(O,D.mode,re),M.return=D,D=M),w(D)):s(D,M)}return lt}var fs=pf(!0),xf=pf(!1),hl=Zn(null),ml=null,hs=null,Ii=null;function Ai(){Ii=hs=ml=null}function Mi(e){var t=hl.current;qe(hl),e._currentValue=t}function Li(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function ms(e,t){ml=e,Ii=hs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(It=!0),e.firstContext=null)}function Kt(e){var t=e._currentValue;if(Ii!==e)if(e={context:e,memoizedValue:t,next:null},hs===null){if(ml===null)throw Error(l(308));hs=e,ml.dependencies={lanes:0,firstContext:e}}else hs=hs.next=e;return t}var Tr=null;function Di(e){Tr===null?Tr=[e]:Tr.push(e)}function gf(e,t,s,o){var u=t.interleaved;return u===null?(s.next=s,Di(t)):(s.next=u.next,u.next=s),t.interleaved=s,Mn(e,o)}function Mn(e,t){e.lanes|=t;var s=e.alternate;for(s!==null&&(s.lanes|=t),s=e,e=e.return;e!==null;)e.childLanes|=t,s=e.alternate,s!==null&&(s.childLanes|=t),s=e,e=e.return;return s.tag===3?s.stateNode:null}var nr=!1;function Oi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ln(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function rr(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Fe&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,Mn(e,s)}return u=o.interleaved,u===null?(t.next=t,Di(o)):(t.next=u.next,u.next=t),o.interleaved=t,Mn(e,s)}function pl(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,qo(e,s)}}function yf(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var w={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};h===null?u=h=w:h=h.next=w,s=s.next}while(s!==null);h===null?u=h=t:h=h.next=t}else u=h=t;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,effects:o.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}function xl(e,t,s,o){var u=e.updateQueue;nr=!1;var h=u.firstBaseUpdate,w=u.lastBaseUpdate,_=u.shared.pending;if(_!==null){u.shared.pending=null;var I=_,F=I.next;I.next=null,w===null?h=F:w.next=F,w=I;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,_=ee.lastBaseUpdate,_!==w&&(_===null?ee.firstBaseUpdate=F:_.next=F,ee.lastBaseUpdate=I))}if(h!==null){var te=u.baseState;w=0,ee=F=I=null,_=h;do{var Z=_.lane,ie=_.eventTime;if((o&Z)===Z){ee!==null&&(ee=ee.next={eventTime:ie,lane:0,tag:_.tag,payload:_.payload,callback:_.callback,next:null});e:{var xe=e,ye=_;switch(Z=t,ie=s,ye.tag){case 1:if(xe=ye.payload,typeof xe=="function"){te=xe.call(ie,te,Z);break e}te=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=ye.payload,Z=typeof xe=="function"?xe.call(ie,te,Z):xe,Z==null)break e;te=q({},te,Z);break e;case 2:nr=!0}}_.callback!==null&&_.lane!==0&&(e.flags|=64,Z=u.effects,Z===null?u.effects=[_]:Z.push(_))}else ie={eventTime:ie,lane:Z,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ee===null?(F=ee=ie,I=te):ee=ee.next=ie,w|=Z;if(_=_.next,_===null){if(_=u.shared.pending,_===null)break;Z=_,_=Z.next,Z.next=null,u.lastBaseUpdate=Z,u.shared.pending=null}}while(!0);if(ee===null&&(I=te),u.baseState=I,u.firstBaseUpdate=F,u.lastBaseUpdate=ee,t=u.shared.interleaved,t!==null){u=t;do w|=u.lane,u=u.next;while(u!==t)}else h===null&&(u.shared.lanes=0);Mr|=w,e.lanes=w,e.memoizedState=te}}function wf(e,t,s){if(e=t.effects,t.effects=null,e!==null)for(t=0;ts?s:4,e(!0);var o=Ui.transition;Ui.transition={};try{e(!1),t()}finally{He=s,Ui.transition=o}}function zf(){return Gt().memoizedState}function cv(e,t,s){var o=or(e);if(s={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null},$f(e))Bf(t,s);else if(s=gf(e,t,s,o),s!==null){var u=Rt();an(s,e,o,u),Uf(s,t,o)}}function uv(e,t,s){var o=or(e),u={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null};if($f(e))Bf(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var w=t.lastRenderedState,_=h(w,s);if(u.hasEagerState=!0,u.eagerState=_,en(_,w)){var I=t.interleaved;I===null?(u.next=u,Di(t)):(u.next=I.next,I.next=u),t.interleaved=u;return}}catch{}finally{}s=gf(e,t,u,o),s!==null&&(u=Rt(),an(s,e,o,u),Uf(s,t,o))}}function $f(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function Bf(e,t){pa=yl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Uf(e,t,s){if((s&4194240)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,qo(e,s)}}var jl={readContext:Kt,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useInsertionEffect:bt,useLayoutEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useMutableSource:bt,useSyncExternalStore:bt,useId:bt,unstable_isNewReconciler:!1},dv={readContext:Kt,useCallback:function(e,t){return vn().memoizedState=[e,t===void 0?null:t],e},useContext:Kt,useEffect:Tf,useImperativeHandle:function(e,t,s){return s=s!=null?s.concat([e]):null,wl(4194308,4,Mf.bind(null,t,e),s)},useLayoutEffect:function(e,t){return wl(4194308,4,e,t)},useInsertionEffect:function(e,t){return wl(4,2,e,t)},useMemo:function(e,t){var s=vn();return t=t===void 0?null:t,e=e(),s.memoizedState=[e,t],e},useReducer:function(e,t,s){var o=vn();return t=s!==void 0?s(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=cv.bind(null,nt,e),[o.memoizedState,e]},useRef:function(e){var t=vn();return e={current:e},t.memoizedState=e},useState:Rf,useDebugValue:Yi,useDeferredValue:function(e){return vn().memoizedState=e},useTransition:function(){var e=Rf(!1),t=e[0];return e=iv.bind(null,e[1]),vn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,s){var o=nt,u=vn();if(Je){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),xt===null)throw Error(l(349));(Ar&30)!==0||Sf(o,t,s)}u.memoizedState=s;var h={value:s,getSnapshot:t};return u.queue=h,Tf(kf.bind(null,o,h,e),[e]),o.flags|=2048,va(9,Cf.bind(null,o,h,s,t),void 0,null),s},useId:function(){var e=vn(),t=xt.identifierPrefix;if(Je){var s=An,o=In;s=(o&~(1<<32-Zt(o)-1)).toString(32)+s,t=":"+t+"R"+s,s=xa++,0<\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=w.createElement(s,{is:o.is}):(e=w.createElement(s),s==="select"&&(w=e,o.multiple?w.multiple=!0:o.size&&(w.size=o.size))):e=w.createElementNS(e,s),e[xn]=t,e[ca]=o,oh(e,t,!1,!1),t.stateNode=e;e:{switch(w=Bo(s,o),s){case"dialog":Xe("cancel",e),Xe("close",e),u=o;break;case"iframe":case"object":case"embed":Xe("load",e),u=o;break;case"video":case"audio":for(u=0;uys&&(t.flags|=128,o=!0,ya(h,!1),t.lanes=4194304)}else{if(!o)if(e=gl(w),e!==null){if(t.flags|=128,o=!0,s=e.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),ya(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!Je)return St(t),null}else 2*at()-h.renderingStartTime>ys&&s!==1073741824&&(t.flags|=128,o=!0,ya(h,!1),t.lanes=4194304);h.isBackwards?(w.sibling=t.child,t.child=w):(s=h.last,s!==null?s.sibling=w:t.child=w,h.last=w)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=at(),t.sibling=null,s=tt.current,Ge(tt,o?s&1|2:s&1),t):(St(t),null);case 22:case 23:return yc(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&(t.mode&1)!==0?($t&1073741824)!==0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),null;case 24:return null;case 25:return null}throw Error(l(156,t.tag))}function vv(e,t){switch(Pi(t),t.tag){case 1:return Tt(t.type)&&ll(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ps(),qe(_t),qe(jt),Bi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return zi(t),null;case 13:if(qe(tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));ds()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe(tt),null;case 4:return ps(),null;case 10:return Mi(t.type._context),null;case 22:case 23:return yc(),null;case 24:return null;default:return null}}var kl=!1,Ct=!1,yv=typeof WeakSet=="function"?WeakSet:Set,me=null;function gs(e,t){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(o){rt(e,t,o)}else s.current=null}function oc(e,t,s){try{s()}catch(o){rt(e,t,o)}}var uh=!1;function wv(e,t){if(yi=Ka,e=Bd(),di(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var u=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var w=0,_=-1,I=-1,F=0,ee=0,te=e,Z=null;t:for(;;){for(var ie;te!==s||u!==0&&te.nodeType!==3||(_=w+u),te!==h||o!==0&&te.nodeType!==3||(I=w+o),te.nodeType===3&&(w+=te.nodeValue.length),(ie=te.firstChild)!==null;)Z=te,te=ie;for(;;){if(te===e)break t;if(Z===s&&++F===u&&(_=w),Z===h&&++ee===o&&(I=w),(ie=te.nextSibling)!==null)break;te=Z,Z=te.parentNode}te=ie}s=_===-1||I===-1?null:{start:_,end:I}}else s=null}s=s||{start:0,end:0}}else s=null;for(wi={focusedElem:e,selectionRange:s},Ka=!1,me=t;me!==null;)if(t=me,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,me=e;else for(;me!==null;){t=me;try{var xe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var ye=xe.memoizedProps,lt=xe.memoizedState,D=t.stateNode,M=D.getSnapshotBeforeUpdate(t.elementType===t.type?ye:nn(t.type,ye),lt);D.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var O=t.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(re){rt(t,t.return,re)}if(e=t.sibling,e!==null){e.return=t.return,me=e;break}me=t.return}return xe=uh,uh=!1,xe}function wa(e,t,s){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var u=o=o.next;do{if((u.tag&e)===e){var h=u.destroy;u.destroy=void 0,h!==void 0&&oc(t,s,h)}u=u.next}while(u!==o)}}function El(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var s=t=t.next;do{if((s.tag&e)===e){var o=s.create;s.destroy=o()}s=s.next}while(s!==t)}}function ic(e){var t=e.ref;if(t!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof t=="function"?t(e):t.current=e}}function dh(e){var t=e.alternate;t!==null&&(e.alternate=null,dh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xn],delete t[ca],delete t[Si],delete t[nv],delete t[rv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function fh(e){return e.tag===5||e.tag===3||e.tag===4}function hh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cc(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.nodeType===8?s.parentNode.insertBefore(e,t):s.insertBefore(e,t):(s.nodeType===8?(t=s.parentNode,t.insertBefore(e,s)):(t=s,t.appendChild(e)),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=sl));else if(o!==4&&(e=e.child,e!==null))for(cc(e,t,s),e=e.sibling;e!==null;)cc(e,t,s),e=e.sibling}function uc(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(uc(e,t,s),e=e.sibling;e!==null;)uc(e,t,s),e=e.sibling}var yt=null,rn=!1;function sr(e,t,s){for(s=s.child;s!==null;)mh(e,t,s),s=s.sibling}function mh(e,t,s){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount($a,s)}catch{}switch(s.tag){case 5:Ct||gs(s,t);case 6:var o=yt,u=rn;yt=null,sr(e,t,s),yt=o,rn=u,yt!==null&&(rn?(e=yt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):yt.removeChild(s.stateNode));break;case 18:yt!==null&&(rn?(e=yt,s=s.stateNode,e.nodeType===8?bi(e.parentNode,s):e.nodeType===1&&bi(e,s),Js(e)):bi(yt,s.stateNode));break;case 4:o=yt,u=rn,yt=s.stateNode.containerInfo,rn=!0,sr(e,t,s),yt=o,rn=u;break;case 0:case 11:case 14:case 15:if(!Ct&&(o=s.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){u=o=o.next;do{var h=u,w=h.destroy;h=h.tag,w!==void 0&&((h&2)!==0||(h&4)!==0)&&oc(s,t,w),u=u.next}while(u!==o)}sr(e,t,s);break;case 1:if(!Ct&&(gs(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=s.memoizedProps,o.state=s.memoizedState,o.componentWillUnmount()}catch(_){rt(s,t,_)}sr(e,t,s);break;case 21:sr(e,t,s);break;case 22:s.mode&1?(Ct=(o=Ct)||s.memoizedState!==null,sr(e,t,s),Ct=o):sr(e,t,s);break;default:sr(e,t,s)}}function ph(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new yv),t.forEach(function(o){var u=Rv.bind(null,e,o);s.has(o)||(s.add(o),o.then(u,u))})}}function sn(e,t){var s=t.deletions;if(s!==null)for(var o=0;ou&&(u=w),o&=~h}if(o=u,o=at()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*jv(o/1960))-o,10e?16:e,lr===null)var o=!1;else{if(e=lr,lr=null,Il=0,(Fe&6)!==0)throw Error(l(331));var u=Fe;for(Fe|=4,me=e.current;me!==null;){var h=me,w=h.child;if((me.flags&16)!==0){var _=h.deletions;if(_!==null){for(var I=0;I<_.length;I++){var F=_[I];for(me=F;me!==null;){var ee=me;switch(ee.tag){case 0:case 11:case 15:wa(8,ee,h)}var te=ee.child;if(te!==null)te.return=ee,me=te;else for(;me!==null;){ee=me;var Z=ee.sibling,ie=ee.return;if(dh(ee),ee===F){me=null;break}if(Z!==null){Z.return=ie,me=Z;break}me=ie}}}var xe=h.alternate;if(xe!==null){var ye=xe.child;if(ye!==null){xe.child=null;do{var lt=ye.sibling;ye.sibling=null,ye=lt}while(ye!==null)}}me=h}}if((h.subtreeFlags&2064)!==0&&w!==null)w.return=h,me=w;else e:for(;me!==null;){if(h=me,(h.flags&2048)!==0)switch(h.tag){case 0:case 11:case 15:wa(9,h,h.return)}var D=h.sibling;if(D!==null){D.return=h.return,me=D;break e}me=h.return}}var M=e.current;for(me=M;me!==null;){w=me;var O=w.child;if((w.subtreeFlags&2064)!==0&&O!==null)O.return=w,me=O;else e:for(w=M;me!==null;){if(_=me,(_.flags&2048)!==0)try{switch(_.tag){case 0:case 11:case 15:El(9,_)}}catch(Ne){rt(_,_.return,Ne)}if(_===w){me=null;break e}var re=_.sibling;if(re!==null){re.return=_.return,me=re;break e}me=_.return}}if(Fe=u,tr(),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot($a,e)}catch{}o=!0}return o}finally{He=s,Qt.transition=t}}return!1}function Eh(e,t,s){t=xs(s,t),t=Hf(e,t,1),e=rr(e,t,1),t=Rt(),e!==null&&(Gs(e,1,t),Mt(e,t))}function rt(e,t,s){if(e.tag===3)Eh(e,e,s);else for(;t!==null;){if(t.tag===3){Eh(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(ar===null||!ar.has(o))){e=xs(s,e),e=Kf(t,e,1),t=rr(t,e,1),e=Rt(),t!==null&&(Gs(t,1,e),Mt(t,e));break}}t=t.return}}function Ev(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),t=Rt(),e.pingedLanes|=e.suspendedLanes&s,xt===e&&(wt&s)===s&&(dt===4||dt===3&&(wt&130023424)===wt&&500>at()-hc?Dr(e,0):fc|=s),Mt(e,t)}function Ph(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ua,Ua<<=1,(Ua&130023424)===0&&(Ua=4194304)));var s=Rt();e=Mn(e,t),e!==null&&(Gs(e,t,s),Mt(e,s))}function Pv(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Ph(e,s)}function Rv(e,t){var s=0;switch(e.tag){case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(l(314))}o!==null&&o.delete(t),Ph(e,s)}var Rh;Rh=function(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps||_t.current)It=!0;else{if((e.lanes&s)===0&&(t.flags&128)===0)return It=!1,xv(e,t,s);It=(e.flags&131072)!==0}else It=!1,Je&&(t.flags&1048576)!==0&&of(t,ul,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Cl(e,t),e=t.pendingProps;var u=is(t,jt.current);ms(t,s),u=Wi(null,t,o,e,u,s);var h=Hi();return t.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tt(o)?(h=!0,ol(t)):h=!1,t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Oi(t),u.updater=bl,t.stateNode=u,u._reactInternals=t,qi(t,o,e,s),t=tc(null,t,o,!0,h,s)):(t.tag=0,Je&&h&&Ei(t),Pt(null,t,u,s),t=t.child),t;case 16:o=t.elementType;e:{switch(Cl(e,t),e=t.pendingProps,u=o._init,o=u(o._payload),t.type=o,u=t.tag=Tv(o),e=nn(o,e),u){case 0:t=ec(null,t,o,e,s);break e;case 1:t=th(null,t,o,e,s);break e;case 11:t=Xf(null,t,o,e,s);break e;case 14:t=qf(null,t,o,nn(o.type,e),s);break e}throw Error(l(306,o,""))}return t;case 0:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:nn(o,u),ec(e,t,o,u,s);case 1:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:nn(o,u),th(e,t,o,u,s);case 3:e:{if(nh(t),e===null)throw Error(l(387));o=t.pendingProps,h=t.memoizedState,u=h.element,gf(e,t),xl(t,o,null,s);var w=t.memoizedState;if(o=w.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){u=xs(Error(l(423)),t),t=rh(e,t,o,s,u);break e}else if(o!==u){u=xs(Error(l(424)),t),t=rh(e,t,o,s,u);break e}else for(zt=Jn(t.stateNode.containerInfo.firstChild),Ft=t,Je=!0,tn=null,s=pf(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ds(),o===u){t=Dn(e,t,s);break e}Pt(e,t,o,s)}t=t.child}return t;case 5:return wf(t),e===null&&_i(t),o=t.type,u=t.pendingProps,h=e!==null?e.memoizedProps:null,w=u.children,Ni(o,u)?w=null:h!==null&&Ni(o,h)&&(t.flags|=32),eh(e,t),Pt(e,t,w,s),t.child;case 6:return e===null&&_i(t),null;case 13:return sh(e,t,s);case 4:return Fi(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=fs(t,null,o,s):Pt(e,t,o,s),t.child;case 11:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:nn(o,u),Xf(e,t,o,u,s);case 7:return Pt(e,t,t.pendingProps,s),t.child;case 8:return Pt(e,t,t.pendingProps.children,s),t.child;case 12:return Pt(e,t,t.pendingProps.children,s),t.child;case 10:e:{if(o=t.type._context,u=t.pendingProps,h=t.memoizedProps,w=u.value,Ge(hl,o._currentValue),o._currentValue=w,h!==null)if(en(h.value,w)){if(h.children===u.children&&!_t.current){t=Dn(e,t,s);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var _=h.dependencies;if(_!==null){w=h.child;for(var I=_.firstContext;I!==null;){if(I.context===o){if(h.tag===1){I=Ln(-1,s&-s),I.tag=2;var F=h.updateQueue;if(F!==null){F=F.shared;var ee=F.pending;ee===null?I.next=I:(I.next=ee.next,ee.next=I),F.pending=I}}h.lanes|=s,I=h.alternate,I!==null&&(I.lanes|=s),Li(h.return,s,t),_.lanes|=s;break}I=I.next}}else if(h.tag===10)w=h.type===t.type?null:h.child;else if(h.tag===18){if(w=h.return,w===null)throw Error(l(341));w.lanes|=s,_=w.alternate,_!==null&&(_.lanes|=s),Li(w,s,t),w=h.sibling}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===t){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}Pt(e,t,u.children,s),t=t.child}return t;case 9:return u=t.type,o=t.pendingProps.children,ms(t,s),u=Kt(u),o=o(u),t.flags|=1,Pt(e,t,o,s),t.child;case 14:return o=t.type,u=nn(o,t.pendingProps),u=nn(o.type,u),qf(e,t,o,u,s);case 15:return Jf(e,t,t.type,t.pendingProps,s);case 17:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:nn(o,u),Cl(e,t),t.tag=1,Tt(o)?(e=!0,ol(t)):e=!1,ms(t,s),Vf(t,o,u),qi(t,o,u,s),tc(null,t,o,!0,e,s);case 19:return lh(e,t,s);case 22:return Zf(e,t,s)}throw Error(l(156,t.tag))};function _h(e,t){return id(e,t)}function _v(e,t,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yt(e,t,s,o){return new _v(e,t,s,o)}function Nc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Tv(e){if(typeof e=="function")return Nc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===K)return 11;if(e===X)return 14}return 2}function cr(e,t){var s=e.alternate;return s===null?(s=Yt(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function Dl(e,t,s,o,u,h){var w=2;if(o=e,typeof e=="function")Nc(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case Y:return Fr(s.children,u,h,t);case W:w=8,u|=8;break;case le:return e=Yt(12,s,t,u|2),e.elementType=le,e.lanes=h,e;case R:return e=Yt(13,s,t,u),e.elementType=R,e.lanes=h,e;case H:return e=Yt(19,s,t,u),e.elementType=H,e.lanes=h,e;case B:return Ol(s,u,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case de:w=10;break e;case oe:w=9;break e;case K:w=11;break e;case X:w=14;break e;case V:w=16,o=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return t=Yt(w,s,t,u),t.elementType=e,t.type=o,t.lanes=h,t}function Fr(e,t,s,o){return e=Yt(7,e,o,t),e.lanes=s,e}function Ol(e,t,s,o){return e=Yt(22,e,o,t),e.elementType=B,e.lanes=s,e.stateNode={isHidden:!1},e}function jc(e,t,s){return e=Yt(6,e,null,t),e.lanes=s,e}function bc(e,t,s){return t=Yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Iv(e,t,s,o,u){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xo(0),this.expirationTimes=Xo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xo(0),this.identifierPrefix=o,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function Sc(e,t,s,o,u,h,w,_,I){return e=new Iv(e,t,s,_,I),t===1?(t=1,h===!0&&(t|=8)):t=0,h=Yt(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:o,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Oi(h),e}function Av(e,t,s){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),_c.exports=Hv(),_c.exports}var Wh;function Kv(){if(Wh)return Wl;Wh=1;var r=Hm();return Wl.createRoot=r.createRoot,Wl.hydrateRoot=r.hydrateRoot,Wl}var Gv=Kv(),Ia=Hm();const Qv=Wm(Ia);/** +`+h.stack}return{value:e,source:t,stack:u,digest:null}}function Ji(e,t,s){return{value:e,source:null,stack:s??null,digest:t??null}}function Zi(e,t){try{console.error(t.value)}catch(s){setTimeout(function(){throw s})}}var mv=typeof WeakMap=="function"?WeakMap:Map;function Kf(e,t,s){s=Ln(-1,s),s.tag=3,s.payload={element:null};var o=t.value;return s.callback=function(){_l||(_l=!0,mc=o),Zi(e,t)},s}function Gf(e,t,s){s=Ln(-1,s),s.tag=3;var o=e.type.getDerivedStateFromError;if(typeof o=="function"){var u=t.value;s.payload=function(){return o(u)},s.callback=function(){Zi(e,t)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(s.callback=function(){Zi(e,t),typeof o!="function"&&(ar===null?ar=new Set([this]):ar.add(this));var w=t.stack;this.componentDidCatch(t.value,{componentStack:w!==null?w:""})}),s}function Qf(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new mv;var u=new Set;o.set(t,u)}else u=o.get(t),u===void 0&&(u=new Set,o.set(t,u));u.has(s)||(u.add(s),e=Pv.bind(null,e,t,s),t.then(e,e))}function Yf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Xf(e,t,s,o,u){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(t=Ln(-1,1),t.tag=2,rr(s,t,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=u,e)}var pv=A.ReactCurrentOwner,It=!1;function Pt(e,t,s,o){t.child=e===null?xf(t,null,s,o):fs(t,e.child,s,o)}function qf(e,t,s,o,u){s=s.render;var h=t.ref;return ms(t,u),o=Wi(e,t,s,o,h,u),s=Hi(),e!==null&&!It?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~u,Dn(e,t,u)):(Je&&s&&Ei(t),t.flags|=1,Pt(e,t,o,u),t.child)}function Jf(e,t,s,o,u){if(e===null){var h=s.type;return typeof h=="function"&&!Nc(h)&&h.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(t.tag=15,t.type=h,Zf(e,t,h,o,u)):(e=Dl(s.type,null,o,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,(e.lanes&u)===0){var w=h.memoizedProps;if(s=s.compare,s=s!==null?s:sa,s(w,o)&&e.ref===t.ref)return Dn(e,t,u)}return t.flags|=1,e=cr(h,o),e.ref=t.ref,e.return=t,t.child=e}function Zf(e,t,s,o,u){if(e!==null){var h=e.memoizedProps;if(sa(h,o)&&e.ref===t.ref)if(It=!1,t.pendingProps=o=h,(e.lanes&u)!==0)(e.flags&131072)!==0&&(It=!0);else return t.lanes=e.lanes,Dn(e,t,u)}return ec(e,t,s,o,u)}function eh(e,t,s){var o=t.pendingProps,u=o.children,h=e!==null?e.memoizedState:null;if(o.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ge(vs,$t),$t|=s;else{if((s&1073741824)===0)return e=h!==null?h.baseLanes|s:s,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ge(vs,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=h!==null?h.baseLanes:s,Ge(vs,$t),$t|=o}else h!==null?(o=h.baseLanes|s,t.memoizedState=null):o=s,Ge(vs,$t),$t|=o;return Pt(e,t,u,s),t.child}function th(e,t){var s=t.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(t.flags|=512,t.flags|=2097152)}function ec(e,t,s,o,u){var h=Tt(s)?Pr:jt.current;return h=is(t,h),ms(t,u),s=Wi(e,t,s,o,h,u),o=Hi(),e!==null&&!It?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~u,Dn(e,t,u)):(Je&&o&&Ei(t),t.flags|=1,Pt(e,t,s,u),t.child)}function nh(e,t,s,o,u){if(Tt(s)){var h=!0;ol(t)}else h=!1;if(ms(t,u),t.stateNode===null)Cl(e,t),Wf(t,s,o),qi(t,s,o,u),o=!0;else if(e===null){var w=t.stateNode,_=t.memoizedProps;w.props=_;var I=w.context,F=s.contextType;typeof F=="object"&&F!==null?F=Kt(F):(F=Tt(s)?Pr:jt.current,F=is(t,F));var ee=s.getDerivedStateFromProps,te=typeof ee=="function"||typeof w.getSnapshotBeforeUpdate=="function";te||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(_!==o||I!==F)&&Hf(t,w,o,F),nr=!1;var Z=t.memoizedState;w.state=Z,xl(t,o,w,u),I=t.memoizedState,_!==o||Z!==I||_t.current||nr?(typeof ee=="function"&&(Xi(t,s,ee,o),I=t.memoizedState),(_=nr||Vf(t,s,_,o,Z,I,F))?(te||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(t.flags|=4194308)):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=I),w.props=o,w.state=I,w.context=F,o=_):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{w=t.stateNode,vf(e,t),_=t.memoizedProps,F=t.type===t.elementType?_:nn(t.type,_),w.props=F,te=t.pendingProps,Z=w.context,I=s.contextType,typeof I=="object"&&I!==null?I=Kt(I):(I=Tt(s)?Pr:jt.current,I=is(t,I));var ie=s.getDerivedStateFromProps;(ee=typeof ie=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(_!==te||Z!==I)&&Hf(t,w,o,I),nr=!1,Z=t.memoizedState,w.state=Z,xl(t,o,w,u);var xe=t.memoizedState;_!==te||Z!==xe||_t.current||nr?(typeof ie=="function"&&(Xi(t,s,ie,o),xe=t.memoizedState),(F=nr||Vf(t,s,F,o,Z,xe,I)||!1)?(ee||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(o,xe,I),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(o,xe,I)),typeof w.componentDidUpdate=="function"&&(t.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof w.componentDidUpdate!="function"||_===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=xe),w.props=o,w.state=xe,w.context=I,o=F):(typeof w.componentDidUpdate!="function"||_===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),o=!1)}return tc(e,t,s,o,h,u)}function tc(e,t,s,o,u,h){th(e,t);var w=(t.flags&128)!==0;if(!o&&!w)return u&&lf(t,s,!1),Dn(e,t,h);o=t.stateNode,pv.current=t;var _=w&&typeof s.getDerivedStateFromError!="function"?null:o.render();return t.flags|=1,e!==null&&w?(t.child=fs(t,e.child,null,h),t.child=fs(t,null,_,h)):Pt(e,t,_,h),t.memoizedState=o.state,u&&lf(t,s,!0),t.child}function rh(e){var t=e.stateNode;t.pendingContext?sf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&sf(e,t.context,!1),Fi(e,t.containerInfo)}function sh(e,t,s,o,u){return ds(),Ti(u),t.flags|=256,Pt(e,t,s,o),t.child}var nc={dehydrated:null,treeContext:null,retryLane:0};function rc(e){return{baseLanes:e,cachePool:null,transitions:null}}function ah(e,t,s){var o=t.pendingProps,u=tt.current,h=!1,w=(t.flags&128)!==0,_;if((_=w)||(_=e!==null&&e.memoizedState===null?!1:(u&2)!==0),_?(h=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(u|=1),Ge(tt,u&1),e===null)return _i(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(w=o.children,e=o.fallback,h?(o=t.mode,h=t.child,w={mode:"hidden",children:w},(o&1)===0&&h!==null?(h.childLanes=0,h.pendingProps=w):h=Ol(w,o,0,null),e=Fr(e,o,s,null),h.return=t,e.return=t,h.sibling=e,t.child=h,t.child.memoizedState=rc(s),t.memoizedState=nc,e):sc(t,w));if(u=e.memoizedState,u!==null&&(_=u.dehydrated,_!==null))return xv(e,t,w,o,_,u,s);if(h){h=o.fallback,w=t.mode,u=e.child,_=u.sibling;var I={mode:"hidden",children:o.children};return(w&1)===0&&t.child!==u?(o=t.child,o.childLanes=0,o.pendingProps=I,t.deletions=null):(o=cr(u,I),o.subtreeFlags=u.subtreeFlags&14680064),_!==null?h=cr(_,h):(h=Fr(h,w,s,null),h.flags|=2),h.return=t,o.return=t,o.sibling=h,t.child=o,o=h,h=t.child,w=e.child.memoizedState,w=w===null?rc(s):{baseLanes:w.baseLanes|s,cachePool:null,transitions:w.transitions},h.memoizedState=w,h.childLanes=e.childLanes&~s,t.memoizedState=nc,o}return h=e.child,e=h.sibling,o=cr(h,{mode:"visible",children:o.children}),(t.mode&1)===0&&(o.lanes=s),o.return=t,o.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=o,t.memoizedState=null,o}function sc(e,t){return t=Ol({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Sl(e,t,s,o){return o!==null&&Ti(o),fs(t,e.child,null,s),e=sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xv(e,t,s,o,u,h,w){if(s)return t.flags&256?(t.flags&=-257,o=Ji(Error(l(422))),Sl(e,t,w,o)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(h=o.fallback,u=t.mode,o=Ol({mode:"visible",children:o.children},u,0,null),h=Fr(h,u,w,null),h.flags|=2,o.return=t,h.return=t,o.sibling=h,t.child=o,(t.mode&1)!==0&&fs(t,e.child,null,w),t.child.memoizedState=rc(w),t.memoizedState=nc,h);if((t.mode&1)===0)return Sl(e,t,w,null);if(u.data==="$!"){if(o=u.nextSibling&&u.nextSibling.dataset,o)var _=o.dgst;return o=_,h=Error(l(419)),o=Ji(h,o,void 0),Sl(e,t,w,o)}if(_=(w&e.childLanes)!==0,It||_){if(o=xt,o!==null){switch(w&-w){case 4:u=2;break;case 16:u=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:u=32;break;case 536870912:u=268435456;break;default:u=0}u=(u&(o.suspendedLanes|w))!==0?0:u,u!==0&&u!==h.retryLane&&(h.retryLane=u,Mn(e,u),an(o,e,u,-1))}return wc(),o=Ji(Error(l(421))),Sl(e,t,w,o)}return u.data==="$?"?(t.flags|=128,t.child=e.child,t=Rv.bind(null,e),u._reactRetry=t,null):(e=h.treeContext,zt=Jn(u.nextSibling),Ft=t,Je=!0,tn=null,e!==null&&(Wt[Ht++]=In,Wt[Ht++]=An,Wt[Ht++]=Rr,In=e.id,An=e.overflow,Rr=t),t=sc(t,o.children),t.flags|=4096,t)}function lh(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),Li(e.return,t,s)}function ac(e,t,s,o,u){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=o,h.tail=s,h.tailMode=u)}function oh(e,t,s){var o=t.pendingProps,u=o.revealOrder,h=o.tail;if(Pt(e,t,o.children,s),o=tt.current,(o&2)!==0)o=o&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lh(e,s,t);else if(e.tag===19)lh(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}o&=1}if(Ge(tt,o),(t.mode&1)===0)t.memoizedState=null;else switch(u){case"forwards":for(s=t.child,u=null;s!==null;)e=s.alternate,e!==null&&gl(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),ac(t,!1,u,s,h);break;case"backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&gl(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}ac(t,!0,s,null,h);break;case"together":ac(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Cl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Dn(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Mr|=t.lanes,(s&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,s=cr(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=cr(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function gv(e,t,s){switch(t.tag){case 3:rh(t),ds();break;case 5:Nf(t);break;case 1:Tt(t.type)&&ol(t);break;case 4:Fi(t,t.stateNode.containerInfo);break;case 10:var o=t.type._context,u=t.memoizedProps.value;Ge(hl,o._currentValue),o._currentValue=u;break;case 13:if(o=t.memoizedState,o!==null)return o.dehydrated!==null?(Ge(tt,tt.current&1),t.flags|=128,null):(s&t.child.childLanes)!==0?ah(e,t,s):(Ge(tt,tt.current&1),e=Dn(e,t,s),e!==null?e.sibling:null);Ge(tt,tt.current&1);break;case 19:if(o=(s&t.childLanes)!==0,(e.flags&128)!==0){if(o)return oh(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Ge(tt,tt.current),o)break;return null;case 22:case 23:return t.lanes=0,eh(e,t,s)}return Dn(e,t,s)}var ih,lc,ch,uh;ih=function(e,t){for(var s=t.child;s!==null;){if(s.tag===5||s.tag===6)e.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},lc=function(){},ch=function(e,t,s,o){var u=e.memoizedProps;if(u!==o){e=t.stateNode,Ir(gn.current);var h=null;switch(s){case"input":u=ze(e,u),o=ze(e,o),h=[];break;case"select":u=q({},u,{value:void 0}),o=q({},o,{value:void 0}),h=[];break;case"textarea":u=Xr(e,u),o=Xr(e,o),h=[];break;default:typeof u.onClick!="function"&&typeof o.onClick=="function"&&(e.onclick=sl)}$o(s,o);var w;s=null;for(F in u)if(!o.hasOwnProperty(F)&&u.hasOwnProperty(F)&&u[F]!=null)if(F==="style"){var _=u[F];for(w in _)_.hasOwnProperty(w)&&(s||(s={}),s[w]="")}else F!=="dangerouslySetInnerHTML"&&F!=="children"&&F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&F!=="autoFocus"&&(c.hasOwnProperty(F)?h||(h=[]):(h=h||[]).push(F,null));for(F in o){var I=o[F];if(_=u!=null?u[F]:void 0,o.hasOwnProperty(F)&&I!==_&&(I!=null||_!=null))if(F==="style")if(_){for(w in _)!_.hasOwnProperty(w)||I&&I.hasOwnProperty(w)||(s||(s={}),s[w]="");for(w in I)I.hasOwnProperty(w)&&_[w]!==I[w]&&(s||(s={}),s[w]=I[w])}else s||(h||(h=[]),h.push(F,s)),s=I;else F==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,_=_?_.__html:void 0,I!=null&&_!==I&&(h=h||[]).push(F,I)):F==="children"?typeof I!="string"&&typeof I!="number"||(h=h||[]).push(F,""+I):F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&(c.hasOwnProperty(F)?(I!=null&&F==="onScroll"&&Xe("scroll",e),h||_===I||(h=[])):(h=h||[]).push(F,I))}s&&(h=h||[]).push("style",s);var F=h;(t.updateQueue=F)&&(t.flags|=4)}},uh=function(e,t,s,o){s!==o&&(t.flags|=4)};function ya(e,t){if(!Je)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags&14680064,o|=u.flags&14680064,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function vv(e,t,s){var o=t.pendingProps;switch(Pi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return Tt(t.type)&&ll(),St(t),null;case 3:return o=t.stateNode,ps(),qe(_t),qe(jt),Bi(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(dl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,tn!==null&&(gc(tn),tn=null))),lc(e,t),St(t),null;case 5:zi(t);var u=Ir(ma.current);if(s=t.type,e!==null&&t.stateNode!=null)ch(e,t,s,o,u),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(t.stateNode===null)throw Error(l(166));return St(t),null}if(e=Ir(gn.current),dl(t)){o=t.stateNode,s=t.type;var h=t.memoizedProps;switch(o[xn]=t,o[ca]=h,e=(t.mode&1)!==0,s){case"dialog":Xe("cancel",o),Xe("close",o);break;case"iframe":case"object":case"embed":Xe("load",o);break;case"video":case"audio":for(u=0;u<\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=w.createElement(s,{is:o.is}):(e=w.createElement(s),s==="select"&&(w=e,o.multiple?w.multiple=!0:o.size&&(w.size=o.size))):e=w.createElementNS(e,s),e[xn]=t,e[ca]=o,ih(e,t,!1,!1),t.stateNode=e;e:{switch(w=Bo(s,o),s){case"dialog":Xe("cancel",e),Xe("close",e),u=o;break;case"iframe":case"object":case"embed":Xe("load",e),u=o;break;case"video":case"audio":for(u=0;uys&&(t.flags|=128,o=!0,ya(h,!1),t.lanes=4194304)}else{if(!o)if(e=gl(w),e!==null){if(t.flags|=128,o=!0,s=e.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),ya(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!Je)return St(t),null}else 2*at()-h.renderingStartTime>ys&&s!==1073741824&&(t.flags|=128,o=!0,ya(h,!1),t.lanes=4194304);h.isBackwards?(w.sibling=t.child,t.child=w):(s=h.last,s!==null?s.sibling=w:t.child=w,h.last=w)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=at(),t.sibling=null,s=tt.current,Ge(tt,o?s&1|2:s&1),t):(St(t),null);case 22:case 23:return yc(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&(t.mode&1)!==0?($t&1073741824)!==0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),null;case 24:return null;case 25:return null}throw Error(l(156,t.tag))}function yv(e,t){switch(Pi(t),t.tag){case 1:return Tt(t.type)&&ll(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ps(),qe(_t),qe(jt),Bi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return zi(t),null;case 13:if(qe(tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));ds()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe(tt),null;case 4:return ps(),null;case 10:return Mi(t.type._context),null;case 22:case 23:return yc(),null;case 24:return null;default:return null}}var kl=!1,Ct=!1,wv=typeof WeakSet=="function"?WeakSet:Set,me=null;function gs(e,t){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(o){rt(e,t,o)}else s.current=null}function oc(e,t,s){try{s()}catch(o){rt(e,t,o)}}var dh=!1;function Nv(e,t){if(yi=Ka,e=Ud(),di(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var u=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var w=0,_=-1,I=-1,F=0,ee=0,te=e,Z=null;t:for(;;){for(var ie;te!==s||u!==0&&te.nodeType!==3||(_=w+u),te!==h||o!==0&&te.nodeType!==3||(I=w+o),te.nodeType===3&&(w+=te.nodeValue.length),(ie=te.firstChild)!==null;)Z=te,te=ie;for(;;){if(te===e)break t;if(Z===s&&++F===u&&(_=w),Z===h&&++ee===o&&(I=w),(ie=te.nextSibling)!==null)break;te=Z,Z=te.parentNode}te=ie}s=_===-1||I===-1?null:{start:_,end:I}}else s=null}s=s||{start:0,end:0}}else s=null;for(wi={focusedElem:e,selectionRange:s},Ka=!1,me=t;me!==null;)if(t=me,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,me=e;else for(;me!==null;){t=me;try{var xe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var ye=xe.memoizedProps,lt=xe.memoizedState,D=t.stateNode,M=D.getSnapshotBeforeUpdate(t.elementType===t.type?ye:nn(t.type,ye),lt);D.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var O=t.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(re){rt(t,t.return,re)}if(e=t.sibling,e!==null){e.return=t.return,me=e;break}me=t.return}return xe=dh,dh=!1,xe}function wa(e,t,s){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var u=o=o.next;do{if((u.tag&e)===e){var h=u.destroy;u.destroy=void 0,h!==void 0&&oc(t,s,h)}u=u.next}while(u!==o)}}function El(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var s=t=t.next;do{if((s.tag&e)===e){var o=s.create;s.destroy=o()}s=s.next}while(s!==t)}}function ic(e){var t=e.ref;if(t!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof t=="function"?t(e):t.current=e}}function fh(e){var t=e.alternate;t!==null&&(e.alternate=null,fh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xn],delete t[ca],delete t[Si],delete t[rv],delete t[sv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function hh(e){return e.tag===5||e.tag===3||e.tag===4}function mh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cc(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.nodeType===8?s.parentNode.insertBefore(e,t):s.insertBefore(e,t):(s.nodeType===8?(t=s.parentNode,t.insertBefore(e,s)):(t=s,t.appendChild(e)),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=sl));else if(o!==4&&(e=e.child,e!==null))for(cc(e,t,s),e=e.sibling;e!==null;)cc(e,t,s),e=e.sibling}function uc(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(uc(e,t,s),e=e.sibling;e!==null;)uc(e,t,s),e=e.sibling}var yt=null,rn=!1;function sr(e,t,s){for(s=s.child;s!==null;)ph(e,t,s),s=s.sibling}function ph(e,t,s){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount($a,s)}catch{}switch(s.tag){case 5:Ct||gs(s,t);case 6:var o=yt,u=rn;yt=null,sr(e,t,s),yt=o,rn=u,yt!==null&&(rn?(e=yt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):yt.removeChild(s.stateNode));break;case 18:yt!==null&&(rn?(e=yt,s=s.stateNode,e.nodeType===8?bi(e.parentNode,s):e.nodeType===1&&bi(e,s),Js(e)):bi(yt,s.stateNode));break;case 4:o=yt,u=rn,yt=s.stateNode.containerInfo,rn=!0,sr(e,t,s),yt=o,rn=u;break;case 0:case 11:case 14:case 15:if(!Ct&&(o=s.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){u=o=o.next;do{var h=u,w=h.destroy;h=h.tag,w!==void 0&&((h&2)!==0||(h&4)!==0)&&oc(s,t,w),u=u.next}while(u!==o)}sr(e,t,s);break;case 1:if(!Ct&&(gs(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=s.memoizedProps,o.state=s.memoizedState,o.componentWillUnmount()}catch(_){rt(s,t,_)}sr(e,t,s);break;case 21:sr(e,t,s);break;case 22:s.mode&1?(Ct=(o=Ct)||s.memoizedState!==null,sr(e,t,s),Ct=o):sr(e,t,s);break;default:sr(e,t,s)}}function xh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new wv),t.forEach(function(o){var u=_v.bind(null,e,o);s.has(o)||(s.add(o),o.then(u,u))})}}function sn(e,t){var s=t.deletions;if(s!==null)for(var o=0;ou&&(u=w),o&=~h}if(o=u,o=at()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*bv(o/1960))-o,10e?16:e,lr===null)var o=!1;else{if(e=lr,lr=null,Il=0,(Fe&6)!==0)throw Error(l(331));var u=Fe;for(Fe|=4,me=e.current;me!==null;){var h=me,w=h.child;if((me.flags&16)!==0){var _=h.deletions;if(_!==null){for(var I=0;I<_.length;I++){var F=_[I];for(me=F;me!==null;){var ee=me;switch(ee.tag){case 0:case 11:case 15:wa(8,ee,h)}var te=ee.child;if(te!==null)te.return=ee,me=te;else for(;me!==null;){ee=me;var Z=ee.sibling,ie=ee.return;if(fh(ee),ee===F){me=null;break}if(Z!==null){Z.return=ie,me=Z;break}me=ie}}}var xe=h.alternate;if(xe!==null){var ye=xe.child;if(ye!==null){xe.child=null;do{var lt=ye.sibling;ye.sibling=null,ye=lt}while(ye!==null)}}me=h}}if((h.subtreeFlags&2064)!==0&&w!==null)w.return=h,me=w;else e:for(;me!==null;){if(h=me,(h.flags&2048)!==0)switch(h.tag){case 0:case 11:case 15:wa(9,h,h.return)}var D=h.sibling;if(D!==null){D.return=h.return,me=D;break e}me=h.return}}var M=e.current;for(me=M;me!==null;){w=me;var O=w.child;if((w.subtreeFlags&2064)!==0&&O!==null)O.return=w,me=O;else e:for(w=M;me!==null;){if(_=me,(_.flags&2048)!==0)try{switch(_.tag){case 0:case 11:case 15:El(9,_)}}catch(Ne){rt(_,_.return,Ne)}if(_===w){me=null;break e}var re=_.sibling;if(re!==null){re.return=_.return,me=re;break e}me=_.return}}if(Fe=u,tr(),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot($a,e)}catch{}o=!0}return o}finally{He=s,Qt.transition=t}}return!1}function Ph(e,t,s){t=xs(s,t),t=Kf(e,t,1),e=rr(e,t,1),t=Rt(),e!==null&&(Gs(e,1,t),Mt(e,t))}function rt(e,t,s){if(e.tag===3)Ph(e,e,s);else for(;t!==null;){if(t.tag===3){Ph(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(ar===null||!ar.has(o))){e=xs(s,e),e=Gf(t,e,1),t=rr(t,e,1),e=Rt(),t!==null&&(Gs(t,1,e),Mt(t,e));break}}t=t.return}}function Pv(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),t=Rt(),e.pingedLanes|=e.suspendedLanes&s,xt===e&&(wt&s)===s&&(dt===4||dt===3&&(wt&130023424)===wt&&500>at()-hc?Dr(e,0):fc|=s),Mt(e,t)}function Rh(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ua,Ua<<=1,(Ua&130023424)===0&&(Ua=4194304)));var s=Rt();e=Mn(e,t),e!==null&&(Gs(e,t,s),Mt(e,s))}function Rv(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Rh(e,s)}function _v(e,t){var s=0;switch(e.tag){case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(l(314))}o!==null&&o.delete(t),Rh(e,s)}var _h;_h=function(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps||_t.current)It=!0;else{if((e.lanes&s)===0&&(t.flags&128)===0)return It=!1,gv(e,t,s);It=(e.flags&131072)!==0}else It=!1,Je&&(t.flags&1048576)!==0&&cf(t,ul,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Cl(e,t),e=t.pendingProps;var u=is(t,jt.current);ms(t,s),u=Wi(null,t,o,e,u,s);var h=Hi();return t.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tt(o)?(h=!0,ol(t)):h=!1,t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Oi(t),u.updater=bl,t.stateNode=u,u._reactInternals=t,qi(t,o,e,s),t=tc(null,t,o,!0,h,s)):(t.tag=0,Je&&h&&Ei(t),Pt(null,t,u,s),t=t.child),t;case 16:o=t.elementType;e:{switch(Cl(e,t),e=t.pendingProps,u=o._init,o=u(o._payload),t.type=o,u=t.tag=Iv(o),e=nn(o,e),u){case 0:t=ec(null,t,o,e,s);break e;case 1:t=nh(null,t,o,e,s);break e;case 11:t=qf(null,t,o,e,s);break e;case 14:t=Jf(null,t,o,nn(o.type,e),s);break e}throw Error(l(306,o,""))}return t;case 0:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:nn(o,u),ec(e,t,o,u,s);case 1:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:nn(o,u),nh(e,t,o,u,s);case 3:e:{if(rh(t),e===null)throw Error(l(387));o=t.pendingProps,h=t.memoizedState,u=h.element,vf(e,t),xl(t,o,null,s);var w=t.memoizedState;if(o=w.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){u=xs(Error(l(423)),t),t=sh(e,t,o,s,u);break e}else if(o!==u){u=xs(Error(l(424)),t),t=sh(e,t,o,s,u);break e}else for(zt=Jn(t.stateNode.containerInfo.firstChild),Ft=t,Je=!0,tn=null,s=xf(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ds(),o===u){t=Dn(e,t,s);break e}Pt(e,t,o,s)}t=t.child}return t;case 5:return Nf(t),e===null&&_i(t),o=t.type,u=t.pendingProps,h=e!==null?e.memoizedProps:null,w=u.children,Ni(o,u)?w=null:h!==null&&Ni(o,h)&&(t.flags|=32),th(e,t),Pt(e,t,w,s),t.child;case 6:return e===null&&_i(t),null;case 13:return ah(e,t,s);case 4:return Fi(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=fs(t,null,o,s):Pt(e,t,o,s),t.child;case 11:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:nn(o,u),qf(e,t,o,u,s);case 7:return Pt(e,t,t.pendingProps,s),t.child;case 8:return Pt(e,t,t.pendingProps.children,s),t.child;case 12:return Pt(e,t,t.pendingProps.children,s),t.child;case 10:e:{if(o=t.type._context,u=t.pendingProps,h=t.memoizedProps,w=u.value,Ge(hl,o._currentValue),o._currentValue=w,h!==null)if(en(h.value,w)){if(h.children===u.children&&!_t.current){t=Dn(e,t,s);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var _=h.dependencies;if(_!==null){w=h.child;for(var I=_.firstContext;I!==null;){if(I.context===o){if(h.tag===1){I=Ln(-1,s&-s),I.tag=2;var F=h.updateQueue;if(F!==null){F=F.shared;var ee=F.pending;ee===null?I.next=I:(I.next=ee.next,ee.next=I),F.pending=I}}h.lanes|=s,I=h.alternate,I!==null&&(I.lanes|=s),Li(h.return,s,t),_.lanes|=s;break}I=I.next}}else if(h.tag===10)w=h.type===t.type?null:h.child;else if(h.tag===18){if(w=h.return,w===null)throw Error(l(341));w.lanes|=s,_=w.alternate,_!==null&&(_.lanes|=s),Li(w,s,t),w=h.sibling}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===t){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}Pt(e,t,u.children,s),t=t.child}return t;case 9:return u=t.type,o=t.pendingProps.children,ms(t,s),u=Kt(u),o=o(u),t.flags|=1,Pt(e,t,o,s),t.child;case 14:return o=t.type,u=nn(o,t.pendingProps),u=nn(o.type,u),Jf(e,t,o,u,s);case 15:return Zf(e,t,t.type,t.pendingProps,s);case 17:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:nn(o,u),Cl(e,t),t.tag=1,Tt(o)?(e=!0,ol(t)):e=!1,ms(t,s),Wf(t,o,u),qi(t,o,u,s),tc(null,t,o,!0,e,s);case 19:return oh(e,t,s);case 22:return eh(e,t,s)}throw Error(l(156,t.tag))};function Th(e,t){return cd(e,t)}function Tv(e,t,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yt(e,t,s,o){return new Tv(e,t,s,o)}function Nc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Iv(e){if(typeof e=="function")return Nc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===K)return 11;if(e===X)return 14}return 2}function cr(e,t){var s=e.alternate;return s===null?(s=Yt(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function Dl(e,t,s,o,u,h){var w=2;if(o=e,typeof e=="function")Nc(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case Y:return Fr(s.children,u,h,t);case W:w=8,u|=8;break;case le:return e=Yt(12,s,t,u|2),e.elementType=le,e.lanes=h,e;case R:return e=Yt(13,s,t,u),e.elementType=R,e.lanes=h,e;case H:return e=Yt(19,s,t,u),e.elementType=H,e.lanes=h,e;case B:return Ol(s,u,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case de:w=10;break e;case oe:w=9;break e;case K:w=11;break e;case X:w=14;break e;case V:w=16,o=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return t=Yt(w,s,t,u),t.elementType=e,t.type=o,t.lanes=h,t}function Fr(e,t,s,o){return e=Yt(7,e,o,t),e.lanes=s,e}function Ol(e,t,s,o){return e=Yt(22,e,o,t),e.elementType=B,e.lanes=s,e.stateNode={isHidden:!1},e}function jc(e,t,s){return e=Yt(6,e,null,t),e.lanes=s,e}function bc(e,t,s){return t=Yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Av(e,t,s,o,u){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xo(0),this.expirationTimes=Xo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xo(0),this.identifierPrefix=o,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function Sc(e,t,s,o,u,h,w,_,I){return e=new Av(e,t,s,_,I),t===1?(t=1,h===!0&&(t|=8)):t=0,h=Yt(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:o,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Oi(h),e}function Mv(e,t,s){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),_c.exports=Kv(),_c.exports}var Hh;function Gv(){if(Hh)return Wl;Hh=1;var r=Km();return Wl.createRoot=r.createRoot,Wl.hydrateRoot=r.hydrateRoot,Wl}var Qv=Gv(),Ia=Km();const Yv=Hm(Ia);/** * @remix-run/router v1.23.2 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+h.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Pa(){return Pa=Object.assign?Object.assign.bind():function(r){for(var a=1;a"u")throw new Error(a)}function wu(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Xv(){return Math.random().toString(36).substr(2,8)}function Kh(r,a){return{usr:r.state,key:r.key,idx:a}}function Qc(r,a,l,i){return l===void 0&&(l=null),Pa({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?Ms(a):a,{state:l,key:a&&a.key||i||Xv()})}function ao(r){let{pathname:a="/",search:l="",hash:i=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),i&&i!=="#"&&(a+=i.charAt(0)==="#"?i:"#"+i),a}function Ms(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let i=r.indexOf("?");i>=0&&(a.search=r.substr(i),r=r.substr(0,i)),r&&(a.pathname=r)}return a}function qv(r,a,l,i){i===void 0&&(i={});let{window:c=document.defaultView,v5Compat:d=!1}=i,f=c.history,m=pr.Pop,x=null,g=v();g==null&&(g=0,f.replaceState(Pa({},f.state,{idx:g}),""));function v(){return(f.state||{idx:null}).idx}function y(){m=pr.Pop;let j=v(),N=j==null?null:j-g;g=j,x&&x({action:m,location:b.location,delta:N})}function E(j,N){m=pr.Push;let P=Qc(b.location,j,N);g=v()+1;let S=Kh(P,g),A=b.createHref(P);try{f.pushState(S,"",A)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;c.location.assign(A)}d&&x&&x({action:m,location:b.location,delta:1})}function k(j,N){m=pr.Replace;let P=Qc(b.location,j,N);g=v();let S=Kh(P,g),A=b.createHref(P);f.replaceState(S,"",A),d&&x&&x({action:m,location:b.location,delta:0})}function C(j){let N=c.location.origin!=="null"?c.location.origin:c.location.href,P=typeof j=="string"?j:ao(j);return P=P.replace(/ $/,"%20"),ot(N,"No window.location.(origin|href) available to create URL for href: "+P),new URL(P,N)}let b={get action(){return m},get location(){return r(c,f)},listen(j){if(x)throw new Error("A history only accepts one active listener");return c.addEventListener(Hh,y),x=j,()=>{c.removeEventListener(Hh,y),x=null}},createHref(j){return a(c,j)},createURL:C,encodeLocation(j){let N=C(j);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:E,replace:k,go(j){return f.go(j)}};return b}var Gh;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Gh||(Gh={}));function Jv(r,a,l){return l===void 0&&(l="/"),Zv(r,a,l)}function Zv(r,a,l,i){let c=typeof a=="string"?Ms(a):a,d=Nu(c.pathname||"/",l);if(d==null)return null;let f=Km(r);ey(f);let m=null;for(let x=0;m==null&&x{let x={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};x.relativePath.startsWith("/")&&(ot(x.relativePath.startsWith(i),'Absolute route path "'+x.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),x.relativePath=x.relativePath.slice(i.length));let g=xr([i,x.relativePath]),v=l.concat(x);d.children&&d.children.length>0&&(ot(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),Km(d.children,a,v,g)),!(d.path==null&&!d.index)&&a.push({path:g,score:oy(g,d.index),routesMeta:v})};return r.forEach((d,f)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))c(d,f);else for(let x of Gm(d.path))c(d,f,x)}),a}function Gm(r){let a=r.split("/");if(a.length===0)return[];let[l,...i]=a,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(i.length===0)return c?[d,""]:[d];let f=Gm(i.join("/")),m=[];return m.push(...f.map(x=>x===""?d:[d,x].join("/"))),c&&m.push(...f),m.map(x=>r.startsWith("/")&&x===""?"/":x)}function ey(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:iy(a.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}const ty=/^:[\w-]+$/,ny=3,ry=2,sy=1,ay=10,ly=-2,Qh=r=>r==="*";function oy(r,a){let l=r.split("/"),i=l.length;return l.some(Qh)&&(i+=ly),a&&(i+=ry),l.filter(c=>!Qh(c)).reduce((c,d)=>c+(ty.test(d)?ny:d===""?sy:ay),i)}function iy(r,a){return r.length===a.length&&r.slice(0,-1).every((i,c)=>i===a[c])?r[r.length-1]-a[a.length-1]:0}function cy(r,a,l){let{routesMeta:i}=r,c={},d="/",f=[];for(let m=0;m{let{paramName:E,isOptional:k}=v;if(E==="*"){let b=m[y]||"";f=d.slice(0,d.length-b.length).replace(/(.)\/+$/,"$1")}const C=m[y];return k&&!C?g[E]=void 0:g[E]=(C||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:f,pattern:r}}function dy(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),wu(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let i=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,x)=>(i.push({paramName:m,isOptional:x!=null}),x?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(i.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),i]}function fy(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return wu(!1,'The URL path "'+r+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),r}}function Nu(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,i=r.charAt(l);return i&&i!=="/"?null:r.slice(l)||"/"}const hy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,my=r=>hy.test(r);function py(r,a){a===void 0&&(a="/");let{pathname:l,search:i="",hash:c=""}=typeof r=="string"?Ms(r):r,d;if(l)if(my(l))d=l;else{if(l.includes("//")){let f=l;l=l.replace(/\/\/+/g,"/"),wu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(f+" -> "+l))}l.startsWith("/")?d=Yh(l.substring(1),"/"):d=Yh(l,a)}else d=a;return{pathname:d,search:vy(i),hash:yy(c)}}function Yh(r,a){let l=a.replace(/\/+$/,"").split("/");return r.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function Ac(r,a,l,i){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function xy(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function ju(r,a){let l=xy(r);return a?l.map((i,c)=>c===l.length-1?i.pathname:i.pathnameBase):l.map(i=>i.pathnameBase)}function bu(r,a,l,i){i===void 0&&(i=!1);let c;typeof r=="string"?c=Ms(r):(c=Pa({},r),ot(!c.pathname||!c.pathname.includes("?"),Ac("?","pathname","search",c)),ot(!c.pathname||!c.pathname.includes("#"),Ac("#","pathname","hash",c)),ot(!c.search||!c.search.includes("#"),Ac("#","search","hash",c)));let d=r===""||c.pathname==="",f=d?"/":c.pathname,m;if(f==null)m=l;else{let y=a.length-1;if(!i&&f.startsWith("..")){let E=f.split("/");for(;E[0]==="..";)E.shift(),y-=1;c.pathname=E.join("/")}m=y>=0?a[y]:"/"}let x=py(c,m),g=f&&f!=="/"&&f.endsWith("/"),v=(d||f===".")&&l.endsWith("/");return!x.pathname.endsWith("/")&&(g||v)&&(x.pathname+="/"),x}const xr=r=>r.join("/").replace(/\/\/+/g,"/"),gy=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),vy=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,yy=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function wy(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Qm=["post","put","patch","delete"];new Set(Qm);const Ny=["get",...Qm];new Set(Ny);/** + */function Pa(){return Pa=Object.assign?Object.assign.bind():function(r){for(var a=1;a"u")throw new Error(a)}function wu(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function qv(){return Math.random().toString(36).substr(2,8)}function Gh(r,a){return{usr:r.state,key:r.key,idx:a}}function Qc(r,a,l,i){return l===void 0&&(l=null),Pa({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?Ms(a):a,{state:l,key:a&&a.key||i||qv()})}function ao(r){let{pathname:a="/",search:l="",hash:i=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),i&&i!=="#"&&(a+=i.charAt(0)==="#"?i:"#"+i),a}function Ms(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let i=r.indexOf("?");i>=0&&(a.search=r.substr(i),r=r.substr(0,i)),r&&(a.pathname=r)}return a}function Jv(r,a,l,i){i===void 0&&(i={});let{window:c=document.defaultView,v5Compat:d=!1}=i,f=c.history,m=pr.Pop,p=null,g=v();g==null&&(g=0,f.replaceState(Pa({},f.state,{idx:g}),""));function v(){return(f.state||{idx:null}).idx}function y(){m=pr.Pop;let j=v(),N=j==null?null:j-g;g=j,p&&p({action:m,location:b.location,delta:N})}function E(j,N){m=pr.Push;let P=Qc(b.location,j,N);g=v()+1;let S=Gh(P,g),A=b.createHref(P);try{f.pushState(S,"",A)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;c.location.assign(A)}d&&p&&p({action:m,location:b.location,delta:1})}function k(j,N){m=pr.Replace;let P=Qc(b.location,j,N);g=v();let S=Gh(P,g),A=b.createHref(P);f.replaceState(S,"",A),d&&p&&p({action:m,location:b.location,delta:0})}function C(j){let N=c.location.origin!=="null"?c.location.origin:c.location.href,P=typeof j=="string"?j:ao(j);return P=P.replace(/ $/,"%20"),ot(N,"No window.location.(origin|href) available to create URL for href: "+P),new URL(P,N)}let b={get action(){return m},get location(){return r(c,f)},listen(j){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(Kh,y),p=j,()=>{c.removeEventListener(Kh,y),p=null}},createHref(j){return a(c,j)},createURL:C,encodeLocation(j){let N=C(j);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:E,replace:k,go(j){return f.go(j)}};return b}var Qh;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Qh||(Qh={}));function Zv(r,a,l){return l===void 0&&(l="/"),ey(r,a,l)}function ey(r,a,l,i){let c=typeof a=="string"?Ms(a):a,d=Nu(c.pathname||"/",l);if(d==null)return null;let f=Gm(r);ty(f);let m=null;for(let p=0;m==null&&p{let p={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};p.relativePath.startsWith("/")&&(ot(p.relativePath.startsWith(i),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(i.length));let g=xr([i,p.relativePath]),v=l.concat(p);d.children&&d.children.length>0&&(ot(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),Gm(d.children,a,v,g)),!(d.path==null&&!d.index)&&a.push({path:g,score:iy(g,d.index),routesMeta:v})};return r.forEach((d,f)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))c(d,f);else for(let p of Qm(d.path))c(d,f,p)}),a}function Qm(r){let a=r.split("/");if(a.length===0)return[];let[l,...i]=a,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(i.length===0)return c?[d,""]:[d];let f=Qm(i.join("/")),m=[];return m.push(...f.map(p=>p===""?d:[d,p].join("/"))),c&&m.push(...f),m.map(p=>r.startsWith("/")&&p===""?"/":p)}function ty(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:cy(a.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}const ny=/^:[\w-]+$/,ry=3,sy=2,ay=1,ly=10,oy=-2,Yh=r=>r==="*";function iy(r,a){let l=r.split("/"),i=l.length;return l.some(Yh)&&(i+=oy),a&&(i+=sy),l.filter(c=>!Yh(c)).reduce((c,d)=>c+(ny.test(d)?ry:d===""?ay:ly),i)}function cy(r,a){return r.length===a.length&&r.slice(0,-1).every((i,c)=>i===a[c])?r[r.length-1]-a[a.length-1]:0}function uy(r,a,l){let{routesMeta:i}=r,c={},d="/",f=[];for(let m=0;m{let{paramName:E,isOptional:k}=v;if(E==="*"){let b=m[y]||"";f=d.slice(0,d.length-b.length).replace(/(.)\/+$/,"$1")}const C=m[y];return k&&!C?g[E]=void 0:g[E]=(C||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:f,pattern:r}}function fy(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),wu(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let i=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,p)=>(i.push({paramName:m,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(i.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),i]}function hy(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return wu(!1,'The URL path "'+r+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),r}}function Nu(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,i=r.charAt(l);return i&&i!=="/"?null:r.slice(l)||"/"}const my=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,py=r=>my.test(r);function xy(r,a){a===void 0&&(a="/");let{pathname:l,search:i="",hash:c=""}=typeof r=="string"?Ms(r):r,d;if(l)if(py(l))d=l;else{if(l.includes("//")){let f=l;l=l.replace(/\/\/+/g,"/"),wu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(f+" -> "+l))}l.startsWith("/")?d=Xh(l.substring(1),"/"):d=Xh(l,a)}else d=a;return{pathname:d,search:yy(i),hash:wy(c)}}function Xh(r,a){let l=a.replace(/\/+$/,"").split("/");return r.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function Ac(r,a,l,i){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function gy(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function ju(r,a){let l=gy(r);return a?l.map((i,c)=>c===l.length-1?i.pathname:i.pathnameBase):l.map(i=>i.pathnameBase)}function bu(r,a,l,i){i===void 0&&(i=!1);let c;typeof r=="string"?c=Ms(r):(c=Pa({},r),ot(!c.pathname||!c.pathname.includes("?"),Ac("?","pathname","search",c)),ot(!c.pathname||!c.pathname.includes("#"),Ac("#","pathname","hash",c)),ot(!c.search||!c.search.includes("#"),Ac("#","search","hash",c)));let d=r===""||c.pathname==="",f=d?"/":c.pathname,m;if(f==null)m=l;else{let y=a.length-1;if(!i&&f.startsWith("..")){let E=f.split("/");for(;E[0]==="..";)E.shift(),y-=1;c.pathname=E.join("/")}m=y>=0?a[y]:"/"}let p=xy(c,m),g=f&&f!=="/"&&f.endsWith("/"),v=(d||f===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(g||v)&&(p.pathname+="/"),p}const xr=r=>r.join("/").replace(/\/\/+/g,"/"),vy=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),yy=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,wy=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function Ny(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Ym=["post","put","patch","delete"];new Set(Ym);const jy=["get",...Ym];new Set(jy);/** * React Router v6.30.3 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+h.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ra(){return Ra=Object.assign?Object.assign.bind():function(r){for(var a=1;a{m.current=!0}),p.useCallback(function(g,v){if(v===void 0&&(v={}),!m.current)return;if(typeof g=="number"){i.go(g);return}let y=bu(g,JSON.parse(f),d,v.relative==="path");r==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:xr([a,y.pathname])),(v.replace?i.replace:i.push)(y,v.state,v)},[a,i,f,d,r])}const Cy=p.createContext(null);function ky(r){let a=p.useContext(Hn).outlet;return a&&p.createElement(Cy.Provider,{value:r},a)}function qm(r,a){let{relative:l}=a===void 0?{}:a,{future:i}=p.useContext(Nr),{matches:c}=p.useContext(Hn),{pathname:d}=Qr(),f=JSON.stringify(ju(c,i.v7_relativeSplatPath));return p.useMemo(()=>bu(r,JSON.parse(f),d,l==="path"),[r,f,d,l])}function Ey(r,a){return Py(r,a)}function Py(r,a,l,i){Ls()||ot(!1);let{navigator:c}=p.useContext(Nr),{matches:d}=p.useContext(Hn),f=d[d.length-1],m=f?f.params:{};f&&f.pathname;let x=f?f.pathnameBase:"/";f&&f.route;let g=Qr(),v;if(a){var y;let j=typeof a=="string"?Ms(a):a;x==="/"||(y=j.pathname)!=null&&y.startsWith(x)||ot(!1),v=j}else v=g;let E=v.pathname||"/",k=E;if(x!=="/"){let j=x.replace(/^\//,"").split("/");k="/"+E.replace(/^\//,"").split("/").slice(j.length).join("/")}let C=Jv(r,{pathname:k}),b=Ay(C&&C.map(j=>Object.assign({},j,{params:Object.assign({},m,j.params),pathname:xr([x,c.encodeLocation?c.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?x:xr([x,c.encodeLocation?c.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),d,l,i);return a&&b?p.createElement(wo.Provider,{value:{location:Ra({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:pr.Pop}},b):b}function Ry(){let r=Oy(),a=wy(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),l=r instanceof Error?r.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},a),l?p.createElement("pre",{style:c},l):null,null)}const _y=p.createElement(Ry,null);class Ty extends p.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){console.error("React Router caught the following error during render",a,l)}render(){return this.state.error!==void 0?p.createElement(Hn.Provider,{value:this.props.routeContext},p.createElement(Ym.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Iy(r){let{routeContext:a,match:l,children:i}=r,c=p.useContext(Su);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),p.createElement(Hn.Provider,{value:a},i)}function Ay(r,a,l,i){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),i===void 0&&(i=null),r==null){var d;if(!l)return null;if(l.errors)r=l.matches;else if((d=i)!=null&&d.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)r=l.matches;else return null}let f=r,m=(c=l)==null?void 0:c.errors;if(m!=null){let v=f.findIndex(y=>y.route.id&&(m==null?void 0:m[y.route.id])!==void 0);v>=0||ot(!1),f=f.slice(0,Math.min(f.length,v+1))}let x=!1,g=-1;if(l&&i&&i.v7_partialHydration)for(let v=0;v=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((v,y,E)=>{let k,C=!1,b=null,j=null;l&&(k=m&&y.route.id?m[y.route.id]:void 0,b=y.route.errorElement||_y,x&&(g<0&&E===0?(zy("route-fallback"),C=!0,j=null):g===E&&(C=!0,j=y.route.hydrateFallbackElement||null)));let N=a.concat(f.slice(0,E+1)),P=()=>{let S;return k?S=b:C?S=j:y.route.Component?S=p.createElement(y.route.Component,null):y.route.element?S=y.route.element:S=v,p.createElement(Iy,{match:y,routeContext:{outlet:v,matches:N,isDataRoute:l!=null},children:S})};return l&&(y.route.ErrorBoundary||y.route.errorElement||E===0)?p.createElement(Ty,{location:l.location,revalidation:l.revalidation,component:b,error:k,children:P(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):P()},null)}var Jm=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(Jm||{}),Zm=(function(r){return r.UseBlocker="useBlocker",r.UseLoaderData="useLoaderData",r.UseActionData="useActionData",r.UseRouteError="useRouteError",r.UseNavigation="useNavigation",r.UseRouteLoaderData="useRouteLoaderData",r.UseMatches="useMatches",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r.UseRouteId="useRouteId",r})(Zm||{});function My(r){let a=p.useContext(Su);return a||ot(!1),a}function Ly(r){let a=p.useContext(jy);return a||ot(!1),a}function Dy(r){let a=p.useContext(Hn);return a||ot(!1),a}function ep(r){let a=Dy(),l=a.matches[a.matches.length-1];return l.route.id||ot(!1),l.route.id}function Oy(){var r;let a=p.useContext(Ym),l=Ly(),i=ep();return a!==void 0?a:(r=l.errors)==null?void 0:r[i]}function Fy(){let{router:r}=My(Jm.UseNavigateStable),a=ep(Zm.UseNavigateStable),l=p.useRef(!1);return Xm(()=>{l.current=!0}),p.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,Ra({fromRouteId:a},d)))},[r,a])}const Xh={};function zy(r,a,l){Xh[r]||(Xh[r]=!0)}function $y(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function By(r){let{to:a,replace:l,state:i,relative:c}=r;Ls()||ot(!1);let{future:d,static:f}=p.useContext(Nr),{matches:m}=p.useContext(Hn),{pathname:x}=Qr(),g=Aa(),v=bu(a,ju(m,d.v7_relativeSplatPath),x,c==="path"),y=JSON.stringify(v);return p.useEffect(()=>g(JSON.parse(y),{replace:l,state:i,relative:c}),[g,y,c,l,i]),null}function Uy(r){return ky(r.context)}function vt(r){ot(!1)}function Vy(r){let{basename:a="/",children:l=null,location:i,navigationType:c=pr.Pop,navigator:d,static:f=!1,future:m}=r;Ls()&&ot(!1);let x=a.replace(/^\/*/,"/"),g=p.useMemo(()=>({basename:x,navigator:d,static:f,future:Ra({v7_relativeSplatPath:!1},m)}),[x,m,d,f]);typeof i=="string"&&(i=Ms(i));let{pathname:v="/",search:y="",hash:E="",state:k=null,key:C="default"}=i,b=p.useMemo(()=>{let j=Nu(v,x);return j==null?null:{location:{pathname:j,search:y,hash:E,state:k,key:C},navigationType:c}},[x,v,y,E,k,C,c]);return b==null?null:p.createElement(Nr.Provider,{value:g},p.createElement(wo.Provider,{children:l,value:b}))}function Wy(r){let{children:a,location:l}=r;return Ey(Yc(a),l)}new Promise(()=>{});function Yc(r,a){a===void 0&&(a=[]);let l=[];return p.Children.forEach(r,(i,c)=>{if(!p.isValidElement(i))return;let d=[...a,c];if(i.type===p.Fragment){l.push.apply(l,Yc(i.props.children,d));return}i.type!==vt&&ot(!1),!i.props.index||!i.props.children||ot(!1);let f={id:i.props.id||d.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(f.children=Yc(i.props.children,d)),l.push(f)}),l}/** + */function Ra(){return Ra=Object.assign?Object.assign.bind():function(r){for(var a=1;a{m.current=!0}),x.useCallback(function(g,v){if(v===void 0&&(v={}),!m.current)return;if(typeof g=="number"){i.go(g);return}let y=bu(g,JSON.parse(f),d,v.relative==="path");r==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:xr([a,y.pathname])),(v.replace?i.replace:i.push)(y,v.state,v)},[a,i,f,d,r])}const ky=x.createContext(null);function Ey(r){let a=x.useContext(Hn).outlet;return a&&x.createElement(ky.Provider,{value:r},a)}function Jm(r,a){let{relative:l}=a===void 0?{}:a,{future:i}=x.useContext(Nr),{matches:c}=x.useContext(Hn),{pathname:d}=Qr(),f=JSON.stringify(ju(c,i.v7_relativeSplatPath));return x.useMemo(()=>bu(r,JSON.parse(f),d,l==="path"),[r,f,d,l])}function Py(r,a){return Ry(r,a)}function Ry(r,a,l,i){Ls()||ot(!1);let{navigator:c}=x.useContext(Nr),{matches:d}=x.useContext(Hn),f=d[d.length-1],m=f?f.params:{};f&&f.pathname;let p=f?f.pathnameBase:"/";f&&f.route;let g=Qr(),v;if(a){var y;let j=typeof a=="string"?Ms(a):a;p==="/"||(y=j.pathname)!=null&&y.startsWith(p)||ot(!1),v=j}else v=g;let E=v.pathname||"/",k=E;if(p!=="/"){let j=p.replace(/^\//,"").split("/");k="/"+E.replace(/^\//,"").split("/").slice(j.length).join("/")}let C=Zv(r,{pathname:k}),b=My(C&&C.map(j=>Object.assign({},j,{params:Object.assign({},m,j.params),pathname:xr([p,c.encodeLocation?c.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?p:xr([p,c.encodeLocation?c.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),d,l,i);return a&&b?x.createElement(wo.Provider,{value:{location:Ra({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:pr.Pop}},b):b}function _y(){let r=Fy(),a=Ny(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),l=r instanceof Error?r.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},a),l?x.createElement("pre",{style:c},l):null,null)}const Ty=x.createElement(_y,null);class Iy extends x.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){console.error("React Router caught the following error during render",a,l)}render(){return this.state.error!==void 0?x.createElement(Hn.Provider,{value:this.props.routeContext},x.createElement(Xm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ay(r){let{routeContext:a,match:l,children:i}=r,c=x.useContext(Su);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),x.createElement(Hn.Provider,{value:a},i)}function My(r,a,l,i){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),i===void 0&&(i=null),r==null){var d;if(!l)return null;if(l.errors)r=l.matches;else if((d=i)!=null&&d.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)r=l.matches;else return null}let f=r,m=(c=l)==null?void 0:c.errors;if(m!=null){let v=f.findIndex(y=>y.route.id&&(m==null?void 0:m[y.route.id])!==void 0);v>=0||ot(!1),f=f.slice(0,Math.min(f.length,v+1))}let p=!1,g=-1;if(l&&i&&i.v7_partialHydration)for(let v=0;v=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((v,y,E)=>{let k,C=!1,b=null,j=null;l&&(k=m&&y.route.id?m[y.route.id]:void 0,b=y.route.errorElement||Ty,p&&(g<0&&E===0?($y("route-fallback"),C=!0,j=null):g===E&&(C=!0,j=y.route.hydrateFallbackElement||null)));let N=a.concat(f.slice(0,E+1)),P=()=>{let S;return k?S=b:C?S=j:y.route.Component?S=x.createElement(y.route.Component,null):y.route.element?S=y.route.element:S=v,x.createElement(Ay,{match:y,routeContext:{outlet:v,matches:N,isDataRoute:l!=null},children:S})};return l&&(y.route.ErrorBoundary||y.route.errorElement||E===0)?x.createElement(Iy,{location:l.location,revalidation:l.revalidation,component:b,error:k,children:P(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):P()},null)}var Zm=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(Zm||{}),ep=(function(r){return r.UseBlocker="useBlocker",r.UseLoaderData="useLoaderData",r.UseActionData="useActionData",r.UseRouteError="useRouteError",r.UseNavigation="useNavigation",r.UseRouteLoaderData="useRouteLoaderData",r.UseMatches="useMatches",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r.UseRouteId="useRouteId",r})(ep||{});function Ly(r){let a=x.useContext(Su);return a||ot(!1),a}function Dy(r){let a=x.useContext(by);return a||ot(!1),a}function Oy(r){let a=x.useContext(Hn);return a||ot(!1),a}function tp(r){let a=Oy(),l=a.matches[a.matches.length-1];return l.route.id||ot(!1),l.route.id}function Fy(){var r;let a=x.useContext(Xm),l=Dy(),i=tp();return a!==void 0?a:(r=l.errors)==null?void 0:r[i]}function zy(){let{router:r}=Ly(Zm.UseNavigateStable),a=tp(ep.UseNavigateStable),l=x.useRef(!1);return qm(()=>{l.current=!0}),x.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,Ra({fromRouteId:a},d)))},[r,a])}const qh={};function $y(r,a,l){qh[r]||(qh[r]=!0)}function By(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function Uy(r){let{to:a,replace:l,state:i,relative:c}=r;Ls()||ot(!1);let{future:d,static:f}=x.useContext(Nr),{matches:m}=x.useContext(Hn),{pathname:p}=Qr(),g=Aa(),v=bu(a,ju(m,d.v7_relativeSplatPath),p,c==="path"),y=JSON.stringify(v);return x.useEffect(()=>g(JSON.parse(y),{replace:l,state:i,relative:c}),[g,y,c,l,i]),null}function Vy(r){return Ey(r.context)}function vt(r){ot(!1)}function Wy(r){let{basename:a="/",children:l=null,location:i,navigationType:c=pr.Pop,navigator:d,static:f=!1,future:m}=r;Ls()&&ot(!1);let p=a.replace(/^\/*/,"/"),g=x.useMemo(()=>({basename:p,navigator:d,static:f,future:Ra({v7_relativeSplatPath:!1},m)}),[p,m,d,f]);typeof i=="string"&&(i=Ms(i));let{pathname:v="/",search:y="",hash:E="",state:k=null,key:C="default"}=i,b=x.useMemo(()=>{let j=Nu(v,p);return j==null?null:{location:{pathname:j,search:y,hash:E,state:k,key:C},navigationType:c}},[p,v,y,E,k,C,c]);return b==null?null:x.createElement(Nr.Provider,{value:g},x.createElement(wo.Provider,{children:l,value:b}))}function Hy(r){let{children:a,location:l}=r;return Py(Yc(a),l)}new Promise(()=>{});function Yc(r,a){a===void 0&&(a=[]);let l=[];return x.Children.forEach(r,(i,c)=>{if(!x.isValidElement(i))return;let d=[...a,c];if(i.type===x.Fragment){l.push.apply(l,Yc(i.props.children,d));return}i.type!==vt&&ot(!1),!i.props.index||!i.props.children||ot(!1);let f={id:i.props.id||d.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(f.children=Yc(i.props.children,d)),l.push(f)}),l}/** * React Router DOM v6.30.3 * * Copyright (c) Remix Software Inc. @@ -64,333 +64,333 @@ Error generating stack: `+h.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Xc(){return Xc=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function Ky(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Gy(r,a){return r.button===0&&(!a||a==="_self")&&!Ky(r)}const Qy=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Yy="6";try{window.__reactRouterVersion=Yy}catch{}const Xy="startTransition",qh=yo[Xy];function qy(r){let{basename:a,children:l,future:i,window:c}=r,d=p.useRef();d.current==null&&(d.current=Yv({window:c,v5Compat:!0}));let f=d.current,[m,x]=p.useState({action:f.action,location:f.location}),{v7_startTransition:g}=i||{},v=p.useCallback(y=>{g&&qh?qh(()=>x(y)):x(y)},[x,g]);return p.useLayoutEffect(()=>f.listen(v),[f,v]),p.useEffect(()=>$y(i),[i]),p.createElement(Vy,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:f,future:i})}const Jy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tp=p.forwardRef(function(a,l){let{onClick:i,relative:c,reloadDocument:d,replace:f,state:m,target:x,to:g,preventScrollReset:v,viewTransition:y}=a,E=Hy(a,Qy),{basename:k}=p.useContext(Nr),C,b=!1;if(typeof g=="string"&&Zy.test(g)&&(C=g,Jy))try{let S=new URL(window.location.href),A=g.startsWith("//")?new URL(S.protocol+g):new URL(g),U=Nu(A.pathname,k);A.origin===S.origin&&U!=null?g=U+A.search+A.hash:b=!0}catch{}let j=by(g,{relative:c}),N=ew(g,{replace:f,state:m,target:x,preventScrollReset:v,relative:c,viewTransition:y});function P(S){i&&i(S),S.defaultPrevented||N(S)}return p.createElement("a",Xc({},E,{href:C||j,onClick:b||d?i:P,ref:l,target:x}))});var Jh;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(Jh||(Jh={}));var Zh;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(Zh||(Zh={}));function ew(r,a){let{target:l,replace:i,state:c,preventScrollReset:d,relative:f,viewTransition:m}=a===void 0?{}:a,x=Aa(),g=Qr(),v=qm(r,{relative:f});return p.useCallback(y=>{if(Gy(y,l)){y.preventDefault();let E=i!==void 0?i:ao(g)===ao(v);x(r,{replace:E,state:c,preventScrollReset:d,relative:f,viewTransition:m})}},[g,x,v,i,c,l,r,d,f,m])}/** + */function Xc(){return Xc=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function Gy(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Qy(r,a){return r.button===0&&(!a||a==="_self")&&!Gy(r)}const Yy=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Xy="6";try{window.__reactRouterVersion=Xy}catch{}const qy="startTransition",Jh=yo[qy];function Jy(r){let{basename:a,children:l,future:i,window:c}=r,d=x.useRef();d.current==null&&(d.current=Xv({window:c,v5Compat:!0}));let f=d.current,[m,p]=x.useState({action:f.action,location:f.location}),{v7_startTransition:g}=i||{},v=x.useCallback(y=>{g&&Jh?Jh(()=>p(y)):p(y)},[p,g]);return x.useLayoutEffect(()=>f.listen(v),[f,v]),x.useEffect(()=>By(i),[i]),x.createElement(Wy,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:f,future:i})}const Zy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ew=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,np=x.forwardRef(function(a,l){let{onClick:i,relative:c,reloadDocument:d,replace:f,state:m,target:p,to:g,preventScrollReset:v,viewTransition:y}=a,E=Ky(a,Yy),{basename:k}=x.useContext(Nr),C,b=!1;if(typeof g=="string"&&ew.test(g)&&(C=g,Zy))try{let S=new URL(window.location.href),A=g.startsWith("//")?new URL(S.protocol+g):new URL(g),U=Nu(A.pathname,k);A.origin===S.origin&&U!=null?g=U+A.search+A.hash:b=!0}catch{}let j=Sy(g,{relative:c}),N=tw(g,{replace:f,state:m,target:p,preventScrollReset:v,relative:c,viewTransition:y});function P(S){i&&i(S),S.defaultPrevented||N(S)}return x.createElement("a",Xc({},E,{href:C||j,onClick:b||d?i:P,ref:l,target:p}))});var Zh;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(Zh||(Zh={}));var em;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(em||(em={}));function tw(r,a){let{target:l,replace:i,state:c,preventScrollReset:d,relative:f,viewTransition:m}=a===void 0?{}:a,p=Aa(),g=Qr(),v=Jm(r,{relative:f});return x.useCallback(y=>{if(Qy(y,l)){y.preventDefault();let E=i!==void 0?i:ao(g)===ao(v);p(r,{replace:E,state:c,preventScrollReset:d,relative:f,viewTransition:m})}},[g,p,v,i,c,l,r,d,f,m])}/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tw=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nw=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,i)=>i?i.toUpperCase():l.toLowerCase()),em=r=>{const a=nw(r);return a.charAt(0).toUpperCase()+a.slice(1)},np=(...r)=>r.filter((a,l,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===l).join(" ").trim(),rw=r=>{for(const a in r)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/** + */const nw=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rw=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,i)=>i?i.toUpperCase():l.toLowerCase()),tm=r=>{const a=rw(r);return a.charAt(0).toUpperCase()+a.slice(1)},rp=(...r)=>r.filter((a,l,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===l).join(" ").trim(),sw=r=>{for(const a in r)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var sw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var aw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aw=p.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:f,...m},x)=>p.createElement("svg",{ref:x,...sw,width:a,height:a,stroke:r,strokeWidth:i?Number(l)*24/Number(a):l,className:np("lucide",c),...!d&&!rw(m)&&{"aria-hidden":"true"},...m},[...f.map(([g,v])=>p.createElement(g,v)),...Array.isArray(d)?d:[d]]));/** + */const lw=x.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:f,...m},p)=>x.createElement("svg",{ref:p,...aw,width:a,height:a,stroke:r,strokeWidth:i?Number(l)*24/Number(a):l,className:rp("lucide",c),...!d&&!sw(m)&&{"aria-hidden":"true"},...m},[...f.map(([g,v])=>x.createElement(g,v)),...Array.isArray(d)?d:[d]]));/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const we=(r,a)=>{const l=p.forwardRef(({className:i,...c},d)=>p.createElement(aw,{ref:d,iconNode:a,className:np(`lucide-${tw(em(r))}`,`lucide-${r}`,i),...c}));return l.displayName=em(r),l};/** + */const we=(r,a)=>{const l=x.forwardRef(({className:i,...c},d)=>x.createElement(lw,{ref:d,iconNode:a,className:rp(`lucide-${nw(tm(r))}`,`lucide-${r}`,i),...c}));return l.displayName=tm(r),l};/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lw=[["path",{d:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",key:"yr8idg"}]],tm=we("bitcoin",lw);/** + */const ow=[["path",{d:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",key:"yr8idg"}]],nm=we("bitcoin",ow);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ow=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],_s=we("book-open",ow);/** + */const iw=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],_s=we("book-open",iw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iw=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],qc=we("calendar",iw);/** + */const cw=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],qc=we("calendar",cw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cw=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],No=we("check",cw);/** + */const uw=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],No=we("check",uw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uw=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],rp=we("chevron-down",uw);/** + */const dw=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],sp=we("chevron-down",dw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dw=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],sp=we("chevron-right",dw);/** + */const fw=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ap=we("chevron-right",fw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fw=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],hw=we("chevron-up",fw);/** + */const hw=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],mw=we("chevron-up",hw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],pw=we("circle-alert",mw);/** + */const pw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],xw=we("circle-alert",pw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xw=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Jc=we("circle-check-big",xw);/** + */const gw=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Jc=we("circle-check-big",gw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gw=[["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"}]],ap=we("circle-question-mark",gw);/** + */const vw=[["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"}]],lp=we("circle-question-mark",vw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],nm=we("circle-user",vw);/** + */const yw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],rm=we("circle-user",yw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ww=we("circle-x",yw);/** + */const ww=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Nw=we("circle-x",ww);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Nw=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],lp=we("clock",Nw);/** + */const jw=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],op=we("clock",jw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jw=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],op=we("copy",jw);/** + */const bw=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ip=we("copy",bw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bw=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Zc=we("credit-card",bw);/** + */const Sw=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Zc=we("credit-card",Sw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Sw=[["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"}]],Cw=we("database",Sw);/** + */const Cw=[["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"}]],kw=we("database",Cw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kw=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],lo=we("dollar-sign",kw);/** + */const Ew=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],lo=we("dollar-sign",Ew);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ew=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],ip=we("download",Ew);/** + */const Pw=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],cp=we("download",Pw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pw=[["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"}]],oo=we("external-link",Pw);/** + */const Rw=[["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"}]],oo=we("external-link",Rw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Rw=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Cu=we("eye",Rw);/** + */const _w=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Cu=we("eye",_w);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _w=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],cp=we("file-text",_w);/** + */const Tw=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],up=we("file-text",Tw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tw=[["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"}]],Iw=we("funnel",Tw);/** + */const Iw=[["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"}]],Aw=we("funnel",Iw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Aw=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],rm=we("gift",Aw);/** + */const Mw=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],sm=we("gift",Mw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mw=[["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"}]],eu=we("globe",Mw);/** + */const Lw=[["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"}]],eu=we("globe",Lw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lw=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],sm=we("history",Lw);/** + */const Dw=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],am=we("history",Dw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dw=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Ow=we("house",Dw);/** + */const Ow=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Fw=we("house",Ow);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fw=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],zw=we("image",Fw);/** + */const zw=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],$w=we("image",zw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $w=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],am=we("info",$w);/** + */const Bw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],lm=we("info",Bw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bw=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],lm=we("key",Bw);/** + */const Uw=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],om=we("key",Uw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Uw=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Vw=we("layout-dashboard",Uw);/** + */const Vw=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Ww=we("layout-dashboard",Vw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ww=[["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"}]],ks=we("link-2",Ww);/** + */const Hw=[["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"}]],ks=we("link-2",Hw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Hw=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],om=we("link",Hw);/** + */const Kw=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],im=we("link",Kw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kw=[["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"}]],Gw=we("lock",Kw);/** + */const Gw=[["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"}]],Qw=we("lock",Gw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qw=[["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"}]],Yw=we("log-out",Qw);/** + */const Yw=[["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"}]],Xw=we("log-out",Yw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xw=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],qw=we("map-pin",Xw);/** + */const qw=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Jw=we("map-pin",qw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Jw=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Zw=we("menu",Jw);/** + */const Zw=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],e1=we("menu",Zw);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const e1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],t1=we("message-circle",e1);/** + */const t1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],n1=we("message-circle",t1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const n1=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],r1=we("palette",n1);/** + */const r1=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],s1=we("palette",r1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const s1=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Ts=we("pen-line",s1);/** + */const a1=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Ts=we("pen-line",a1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const a1=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],l1=we("percent",a1);/** + */const l1=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],o1=we("percent",l1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const o1=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],i1=we("phone",o1);/** + */const i1=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],c1=we("phone",i1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const c1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Es=we("plus",c1);/** + */const u1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Es=we("plus",u1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const u1=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],im=we("qr-code",u1);/** + */const d1=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],cm=we("qr-code",d1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const d1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ze=we("refresh-cw",d1);/** + */const f1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ze=we("refresh-cw",f1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const f1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Bn=we("save",f1);/** + */const h1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Bn=we("save",h1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const h1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Br=we("search",h1);/** + */const m1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Br=we("search",m1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const m1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],io=we("settings",m1);/** + */const p1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],io=we("settings",p1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const p1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],x1=we("settings-2",p1);/** + */const x1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],g1=we("settings-2",x1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const g1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],v1=we("shield-check",g1);/** + */const v1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],y1=we("shield-check",v1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const y1=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],tu=we("shopping-bag",y1);/** + */const w1=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],tu=we("shopping-bag",w1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const w1=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],cm=we("smartphone",w1);/** + */const N1=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],um=we("smartphone",N1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const N1=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],j1=we("tag",N1);/** + */const j1=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],b1=we("tag",j1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const b1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],up=we("trash-2",b1);/** + */const S1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],dp=we("trash-2",S1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const S1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],nu=we("trending-up",S1);/** + */const C1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],nu=we("trending-up",C1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const C1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Cs=we("upload",C1);/** + */const k1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Cs=we("upload",k1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const k1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],um=we("user-plus",k1);/** + */const E1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],dm=we("user-plus",E1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const E1=[["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"}]],Zl=we("user",E1);/** + */const P1=[["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"}]],Zl=we("user",P1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const P1=[["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"}]],kn=we("users",P1);/** + */const R1=[["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"}]],kn=we("users",R1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const R1=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],Is=we("wallet",R1);/** + */const _1=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],Is=we("wallet",_1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ur=we("x",_1);/** + */const T1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ur=we("x",T1);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const T1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],I1=we("zap",T1),A1="https://soulapi.quwanzhi.com",M1=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):A1};function ru(r){const a=M1(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function jo(r,a={}){const{data:l,...i}=a,c=ru(r),d=new Headers(i.headers);l!=null&&!d.has("Content-Type")&&d.set("Content-Type","application/json");const f=l!=null?JSON.stringify(l):i.body,m=await fetch(c,{...i,headers:d,body:f,credentials:"include"}),g=(m.headers.get("Content-Type")||"").includes("application/json")?await m.json():m;if(!m.ok){const v=new Error((g==null?void 0:g.error)||`HTTP ${m.status}`);throw v.status=m.status,v.data=g,v}return g}function Ye(r,a){return jo(r,{...a,method:"GET"})}function kt(r,a,l){return jo(r,{...l,method:"POST",data:a})}function Un(r,a,l){return jo(r,{...l,method:"PUT",data:a})}function L1(r,a){return jo(r,{...a,method:"DELETE"})}const D1=[{icon:Vw,label:"数据概览",href:"/dashboard"},{icon:_s,label:"内容管理",href:"/content"},{icon:kn,label:"用户管理",href:"/users"},{icon:Is,label:"交易中心",href:"/distribution"},{icon:Zc,label:"推广设置",href:"/referral-settings"},{icon:io,label:"系统设置",href:"/settings"}];function O1(){const r=Qr(),a=Aa(),[l,i]=p.useState(!1),[c,d]=p.useState(!1);p.useEffect(()=>{i(!0)},[]),p.useEffect(()=>{if(!l)return;d(!1);let m=!1;return Ye("/api/admin").then(x=>{m||(x&&x.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{m||a("/login",{replace:!0})}),()=>{m=!0}},[l,a]);const f=async()=>{await kt("/api/admin/logout",{}),a("/login",{replace:!0})};return!l||!c?n.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[n.jsx("div",{className:"w-64 bg-[#0f2137] border-r border-gray-700/50"}),n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx("div",{className:"text-[#38bdac]",children:"加载中..."})})]}):n.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[n.jsxs("div",{className:"w-64 bg-[#0f2137] flex flex-col border-r border-gray-700/50 shadow-xl",children:[n.jsxs("div",{className:"p-6 border-b border-gray-700/50",children:[n.jsx("h1",{className:"text-xl font-bold text-[#38bdac]",children:"管理后台"}),n.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Soul创业派对"})]}),n.jsx("nav",{className:"flex-1 p-4 space-y-1",children:D1.map(m=>{const x=r.pathname===m.href;return n.jsxs(tp,{to:m.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${x?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[n.jsx(m.icon,{className:"w-5 h-5"}),n.jsx("span",{className:"text-sm",children:m.label})]},m.href)})}),n.jsxs("div",{className:"p-4 border-t border-gray-700/50 space-y-1",children:[n.jsxs("button",{type:"button",onClick:f,className:"w-full flex items-center gap-3 px-4 py-3 text-gray-400 hover:text-white rounded-lg hover:bg-gray-700/50 transition-colors",children:[n.jsx(Yw,{className:"w-5 h-5"}),n.jsx("span",{className:"text-sm",children:"退出登录"})]}),n.jsx("a",{href:`${typeof window<"u"?window.location.origin:""}/view`,target:"_blank",rel:"noreferrer",className:"flex items-center gap-3 px-4 py-3 text-gray-400 hover:text-white rounded-lg hover:bg-gray-700/50 transition-colors",children:n.jsx("span",{className:"text-sm",children:"返回前台"})})]})]}),n.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628]",children:n.jsx(Uy,{})})]})}function dm(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function ku(...r){return a=>{let l=!1;const i=r.map(c=>{const d=dm(c,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let c=0;c{let{children:d,...f}=i;dp(d)&&typeof co=="function"&&(d=co(d._payload));const m=p.Children.toArray(d),x=m.find(U1);if(x){const g=x.props.children,v=m.map(y=>y===x?p.Children.count(g)>1?p.Children.only(null):p.isValidElement(g)?g.props.children:null:y);return n.jsx(a,{...f,ref:c,children:p.isValidElement(g)?p.cloneElement(g,void 0,v):null})}return n.jsx(a,{...f,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}var hp=fp("Slot");function $1(r){const a=p.forwardRef((l,i)=>{let{children:c,...d}=l;if(dp(c)&&typeof co=="function"&&(c=co(c._payload)),p.isValidElement(c)){const f=W1(c),m=V1(d,c.props);return c.type!==p.Fragment&&(m.ref=i?ku(i,f):f),p.cloneElement(c,m)}return p.Children.count(c)>1?p.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var B1=Symbol("radix.slottable");function U1(r){return p.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===B1}function V1(r,a){const l={...a};for(const i in a){const c=r[i],d=a[i];/^on[A-Z]/.test(i)?c&&d?l[i]=(...m)=>{const x=d(...m);return c(...m),x}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function W1(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}function mp(r){var a,l,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;atypeof r=="boolean"?`${r}`:r===0?"0":r,hm=pp,xp=(r,a)=>l=>{var i;if((a==null?void 0:a.variants)==null)return hm(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:d}=a,f=Object.keys(c).map(g=>{const v=l==null?void 0:l[g],y=d==null?void 0:d[g];if(v===null)return null;const E=fm(v)||fm(y);return c[g][E]}),m=l&&Object.entries(l).reduce((g,v)=>{let[y,E]=v;return E===void 0||(g[y]=E),g},{}),x=a==null||(i=a.compoundVariants)===null||i===void 0?void 0:i.reduce((g,v)=>{let{class:y,className:E,...k}=v;return Object.entries(k).every(C=>{let[b,j]=C;return Array.isArray(j)?j.includes({...d,...m}[b]):{...d,...m}[b]===j})?[...g,y,E]:g},[]);return hm(r,f,x,l==null?void 0:l.class,l==null?void 0:l.className)},H1=(r,a)=>{const l=new Array(r.length+a.length);for(let i=0;i({classGroupId:r,validator:a}),gp=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),uo="-",mm=[],G1="arbitrary..",Q1=r=>{const a=X1(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:i}=r;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return Y1(f);const m=f.split(uo),x=m[0]===""&&m.length>1?1:0;return vp(m,x,a)},getConflictingClassGroupIds:(f,m)=>{if(m){const x=i[f],g=l[f];return x?g?H1(g,x):x:g||mm}return l[f]||mm}}},vp=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],d=l.nextPart.get(c);if(d){const g=vp(r,a+1,d);if(g)return g}const f=l.validators;if(f===null)return;const m=a===0?r.join(uo):r.slice(a).join(uo),x=f.length;for(let g=0;gr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),i=a.slice(0,l);return i?G1+i:void 0})(),X1=r=>{const{theme:a,classGroups:l}=r;return q1(l,a)},q1=(r,a)=>{const l=gp();for(const i in r){const c=r[i];Eu(c,l,i,a)}return l},Eu=(r,a,l,i)=>{const c=r.length;for(let d=0;d{if(typeof r=="string"){Z1(r,a,l);return}if(typeof r=="function"){eN(r,a,l,i);return}tN(r,a,l,i)},Z1=(r,a,l)=>{const i=r===""?a:yp(a,r);i.classGroupId=l},eN=(r,a,l,i)=>{if(nN(r)){Eu(r(i),a,l,i);return}a.validators===null&&(a.validators=[]),a.validators.push(K1(l,r))},tN=(r,a,l,i)=>{const c=Object.entries(r),d=c.length;for(let f=0;f{let l=r;const i=a.split(uo),c=i.length;for(let d=0;d"isThemeGetter"in r&&r.isThemeGetter===!0,rN=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),i=Object.create(null);const c=(d,f)=>{l[d]=f,a++,a>r&&(a=0,i=l,l=Object.create(null))};return{get(d){let f=l[d];if(f!==void 0)return f;if((f=i[d])!==void 0)return c(d,f),f},set(d,f){d in l?l[d]=f:c(d,f)}}},su="!",pm=":",sN=[],xm=(r,a,l,i,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:i,isExternal:c}),aN=r=>{const{prefix:a,experimentalParseClassName:l}=r;let i=c=>{const d=[];let f=0,m=0,x=0,g;const v=c.length;for(let b=0;bx?g-x:void 0;return xm(d,k,E,C)};if(a){const c=a+pm,d=i;i=f=>f.startsWith(c)?d(f.slice(c.length)):xm(sN,!1,f,void 0,!0)}if(l){const c=i;i=d=>l({className:d,parseClassName:c})}return i},lN=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,i)=>{a.set(l,1e6+i)}),l=>{const i=[];let c=[];for(let d=0;d0&&(c.sort(),i.push(...c),c=[]),i.push(f)):c.push(f)}return c.length>0&&(c.sort(),i.push(...c)),i}},oN=r=>({cache:rN(r.cacheSize),parseClassName:aN(r),sortModifiers:lN(r),...Q1(r)}),iN=/\s+/,cN=(r,a)=>{const{parseClassName:l,getClassGroupId:i,getConflictingClassGroupIds:c,sortModifiers:d}=a,f=[],m=r.trim().split(iN);let x="";for(let g=m.length-1;g>=0;g-=1){const v=m[g],{isExternal:y,modifiers:E,hasImportantModifier:k,baseClassName:C,maybePostfixModifierPosition:b}=l(v);if(y){x=v+(x.length>0?" "+x:x);continue}let j=!!b,N=i(j?C.substring(0,b):C);if(!N){if(!j){x=v+(x.length>0?" "+x:x);continue}if(N=i(C),!N){x=v+(x.length>0?" "+x:x);continue}j=!1}const P=E.length===0?"":E.length===1?E[0]:d(E).join(":"),S=k?P+su:P,A=S+N;if(f.indexOf(A)>-1)continue;f.push(A);const U=c(N,j);for(let Q=0;Q0?" "+x:x)}return x},uN=(...r)=>{let a=0,l,i,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let i=0;i{let l,i,c,d;const f=x=>{const g=a.reduce((v,y)=>y(v),r());return l=oN(g),i=l.cache.get,c=l.cache.set,d=m,m(x)},m=x=>{const g=i(x);if(g)return g;const v=cN(x,l);return c(x,v),v};return d=f,(...x)=>d(uN(...x))},fN=[],ft=r=>{const a=l=>l[r]||fN;return a.isThemeGetter=!0,a},Np=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hN=/^\d+\/\d+$/,mN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pN=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ns=r=>hN.test(r),Me=r=>!!r&&!Number.isNaN(Number(r)),dr=r=>!!r&&Number.isInteger(Number(r)),Mc=r=>r.endsWith("%")&&Me(r.slice(0,-1)),Fn=r=>mN.test(r),yN=()=>!0,wN=r=>pN.test(r)&&!xN.test(r),bp=()=>!1,NN=r=>gN.test(r),jN=r=>vN.test(r),bN=r=>!ge(r)&&!ve(r),SN=r=>Ds(r,kp,bp),ge=r=>Np.test(r),zr=r=>Ds(r,Ep,wN),Lc=r=>Ds(r,RN,Me),gm=r=>Ds(r,Sp,bp),CN=r=>Ds(r,Cp,jN),Hl=r=>Ds(r,Pp,NN),ve=r=>jp.test(r),ka=r=>Os(r,Ep),kN=r=>Os(r,_N),vm=r=>Os(r,Sp),EN=r=>Os(r,kp),PN=r=>Os(r,Cp),Kl=r=>Os(r,Pp,!0),Ds=(r,a,l)=>{const i=Np.exec(r);return i?i[1]?a(i[1]):l(i[2]):!1},Os=(r,a,l=!1)=>{const i=jp.exec(r);return i?i[1]?a(i[1]):l:!1},Sp=r=>r==="position"||r==="percentage",Cp=r=>r==="image"||r==="url",kp=r=>r==="length"||r==="size"||r==="bg-size",Ep=r=>r==="length",RN=r=>r==="number",_N=r=>r==="family-name",Pp=r=>r==="shadow",TN=()=>{const r=ft("color"),a=ft("font"),l=ft("text"),i=ft("font-weight"),c=ft("tracking"),d=ft("leading"),f=ft("breakpoint"),m=ft("container"),x=ft("spacing"),g=ft("radius"),v=ft("shadow"),y=ft("inset-shadow"),E=ft("text-shadow"),k=ft("drop-shadow"),C=ft("blur"),b=ft("perspective"),j=ft("aspect"),N=ft("ease"),P=ft("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...A(),ve,ge],Q=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto","contain","none"],W=()=>[ve,ge,x],le=()=>[Ns,"full","auto",...W()],de=()=>[dr,"none","subgrid",ve,ge],oe=()=>["auto",{span:["full",dr,ve,ge]},dr,ve,ge],K=()=>[dr,"auto",ve,ge],R=()=>["auto","min","max","fr",ve,ge],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...W()],B=()=>[Ns,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...W()],T=()=>[r,ve,ge],J=()=>[...A(),vm,gm,{position:[ve,ge]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",EN,SN,{size:[ve,ge]}],G=()=>[Mc,ka,zr],fe=()=>["","none","full",g,ve,ge],se=()=>["",Me,ka,zr],be=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[Me,Mc,vm,gm],he=()=>["","none",C,ve,ge],Ee=()=>["none",Me,ve,ge],Se=()=>["none",Me,ve,ge],Te=()=>[Me,ve,ge],z=()=>[Ns,"full",...W()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fn],breakpoint:[Fn],color:[yN],container:[Fn],"drop-shadow":[Fn],ease:["in","out","in-out"],font:[bN],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fn],shadow:[Fn],spacing:["px",Me],text:[Fn],"text-shadow":[Fn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ns,ge,ve,j]}],container:["container"],columns:[{columns:[Me,ge,ve,m]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:U()}],overflow:[{overflow:Q()}],"overflow-x":[{"overflow-x":Q()}],"overflow-y":[{"overflow-y":Q()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:le()}],"inset-x":[{"inset-x":le()}],"inset-y":[{"inset-y":le()}],start:[{start:le()}],end:[{end:le()}],top:[{top:le()}],right:[{right:le()}],bottom:[{bottom:le()}],left:[{left:le()}],visibility:["visible","invisible","collapse"],z:[{z:[dr,"auto",ve,ge]}],basis:[{basis:[Ns,"full","auto",m,...W()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,Ns,"auto","initial","none",ge]}],grow:[{grow:["",Me,ve,ge]}],shrink:[{shrink:["",Me,ve,ge]}],order:[{order:[dr,"first","last","none",ve,ge]}],"grid-cols":[{"grid-cols":de()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":de()}],"row-start-end":[{row:oe()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:W()}],"gap-x":[{"gap-x":W()}],"gap-y":[{"gap-y":W()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:W()}],px:[{px:W()}],py:[{py:W()}],ps:[{ps:W()}],pe:[{pe:W()}],pt:[{pt:W()}],pr:[{pr:W()}],pb:[{pb:W()}],pl:[{pl:W()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":W()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":W()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[m,"screen",...B()]}],"min-w":[{"min-w":[m,"screen","none",...B()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[f]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",l,ka,zr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,ve,Lc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mc,ge]}],"font-family":[{font:[kN,ge,a]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,ve,ge]}],"line-clamp":[{"line-clamp":[Me,"none",ve,Lc]}],leading:[{leading:[d,...W()]}],"list-image":[{"list-image":["none",ve,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ve,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",ve,zr]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Me,"auto",ve,ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ve,ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ve,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:J()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},dr,ve,ge],radial:["",ve,ge],conic:[dr,ve,ge]},PN,CN]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,ve,ge]}],"outline-w":[{outline:["",Me,ka,zr]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",v,Kl,Hl]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",y,Kl,Hl]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Me,zr]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",E,Kl,Hl]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Me,ve,ge]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[ve,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:J()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ve,ge]}],filter:[{filter:["","none",ve,ge]}],blur:[{blur:he()}],brightness:[{brightness:[Me,ve,ge]}],contrast:[{contrast:[Me,ve,ge]}],"drop-shadow":[{"drop-shadow":["","none",k,Kl,Hl]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Me,ve,ge]}],"hue-rotate":[{"hue-rotate":[Me,ve,ge]}],invert:[{invert:["",Me,ve,ge]}],saturate:[{saturate:[Me,ve,ge]}],sepia:[{sepia:["",Me,ve,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",ve,ge]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[Me,ve,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Me,ve,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,ve,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,ve,ge]}],"backdrop-invert":[{"backdrop-invert":["",Me,ve,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Me,ve,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Me,ve,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,ve,ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":W()}],"border-spacing-x":[{"border-spacing-x":W()}],"border-spacing-y":[{"border-spacing-y":W()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ve,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",ve,ge]}],ease:[{ease:["linear","initial",N,ve,ge]}],delay:[{delay:[Me,ve,ge]}],animate:[{animate:["none",P,ve,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ve,ge]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Te()}],"skew-x":[{"skew-x":Te()}],"skew-y":[{"skew-y":Te()}],transform:[{transform:[ve,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:z()}],"translate-x":[{"translate-x":z()}],"translate-y":[{"translate-y":z()}],"translate-z":[{"translate-z":z()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ve,ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ve,ge]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Me,ka,zr,Lc]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},IN=dN(TN);function We(...r){return IN(pp(r))}const AN=xp("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function pe({className:r,variant:a,size:l,asChild:i=!1,...c}){const d=i?hp:"button";return n.jsx(d,{"data-slot":"button",className:We(AN({variant:a,size:l,className:r})),...c})}function ue({className:r,type:a,...l}){return n.jsx("input",{type:a,"data-slot":"input",className:We("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none placeholder:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 md:text-sm focus-visible:ring-2 focus-visible:ring-ring",r),...l})}function MN(){const r=Aa(),[a,l]=p.useState(""),[i,c]=p.useState(""),[d,f]=p.useState(""),[m,x]=p.useState(!1),g=async()=>{f(""),x(!0);try{const v=await kt("/api/admin",{username:a.trim(),password:i});if((v==null?void 0:v.success)!==!1){r("/dashboard",{replace:!0});return}f(v.error||"用户名或密码错误")}catch(v){const y=v;f(y.status===401?"用户名或密码错误":(y==null?void 0:y.message)||"网络错误,请重试")}finally{x(!1)}};return n.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[n.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[n.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),n.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),n.jsxs("div",{className:"w-full max-w-md relative z-10",children:[n.jsxs("div",{className:"text-center mb-8",children:[n.jsx("div",{className:"w-16 h-16 bg-[#38bdac]/20 rounded-2xl flex items-center justify-center mx-auto mb-4 border border-[#38bdac]/30",children:n.jsx(v1,{className:"w-8 h-8 text-[#38bdac]"})}),n.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),n.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),n.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[n.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),n.jsxs("div",{className:"relative",children:[n.jsx(Zl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),n.jsx(ue,{type:"text",value:a,onChange:v=>l(v.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),n.jsxs("div",{className:"relative",children:[n.jsx(Gw,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),n.jsx(ue,{type:"password",value:i,onChange:v=>c(v.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:v=>v.key==="Enter"&&g()})]})]}),d&&n.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:d}),n.jsx(pe,{onClick:g,disabled:m,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:m?"登录中...":"登录"})]})]}),n.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const Re=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:We("rounded-xl border bg-card text-card-foreground shadow",r),...a}));Re.displayName="Card";const Ue=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:We("flex flex-col space-y-1.5 p-6",r),...a}));Ue.displayName="CardHeader";const Ke=p.forwardRef(({className:r,...a},l)=>n.jsx("h3",{ref:l,className:We("font-semibold leading-none tracking-tight",r),...a}));Ke.displayName="CardTitle";const mt=p.forwardRef(({className:r,...a},l)=>n.jsx("p",{ref:l,className:We("text-sm text-muted-foreground",r),...a}));mt.displayName="CardDescription";const _e=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:We("p-6 pt-0",r),...a}));_e.displayName="CardContent";const LN=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:We("flex items-center p-6 pt-0",r),...a}));LN.displayName="CardFooter";function DN(){const r=Aa(),[a,l]=p.useState(!1),[i,c]=p.useState([]),[d,f]=p.useState([]);async function m(){try{const[k,C]=await Promise.all([Ye("/api/db/users"),Ye("/api/orders")]);k!=null&&k.success&&k.users&&c(k.users),C!=null&&C.success&&C.orders&&f(C.orders)}catch(k){console.error("加载数据失败",k)}}if(p.useEffect(()=>{l(!0),m()},[]),!a)return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:[1,2,3,4].map(k=>n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsx("div",{className:"h-4 w-20 bg-gray-700 rounded animate-pulse"}),n.jsx("div",{className:"w-8 h-8 bg-gray-700 rounded-lg animate-pulse"})]}),n.jsx(_e,{children:n.jsx("div",{className:"h-8 w-16 bg-gray-700 rounded animate-pulse"})})]},k))}),n.jsxs("div",{className:"flex items-center justify-center py-8",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]})]});const x=d.reduce((k,C)=>k+Number(C.amount||0),0),g=i.length,v=d.length,y=k=>{const C=k.productType||"",b=k.description||"";if(b){if(C==="section"&&b.includes("章节")){if(b.includes("-")){const j=b.split("-");if(j.length>=3)return{title:`第${j[1]}章 第${j[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:b,subtitle:"章节购买"}}return C==="fullbook"||b.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:C==="match"||b.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:b,subtitle:C==="section"?"单章":C==="fullbook"?"全书":"其他"}}return C==="section"?{title:`章节 ${k.productId||""}`,subtitle:"单章购买"}:C==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:C==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:C||"其他"}},E=[{title:"总用户数",value:g,icon:kn,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${Number(x).toFixed(2)}`,icon:nu,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:v,icon:tu,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${g>0?(v/g*100).toFixed(1):0}%`,icon:_s,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"}];return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:E.map((k,C)=>n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>k.link&&r(k.link),children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsx(Ke,{className:"text-sm font-medium text-gray-400",children:k.title}),n.jsx("div",{className:`p-2 rounded-lg ${k.bg}`,children:n.jsx(k.icon,{className:`w-4 h-4 ${k.color}`})})]}),n.jsx(_e,{children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-2xl font-bold text-white",children:k.value}),n.jsx(sp,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},C))}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Ue,{children:n.jsx(Ke,{className:"text-white",children:"最近订单"})}),n.jsx(_e,{children:n.jsxs("div",{className:"space-y-3",children:[d.slice(-5).reverse().map(k=>{var P;const C=k.referrerId?i.find(S=>S.id===k.referrerId):void 0,b=k.referralCode||(C==null?void 0:C.referralCode)||(C==null?void 0:C.nickname)||(k.referrerId?String(k.referrerId).slice(0,8):""),j=y(k),N=k.userNickname||((P=i.find(S=>S.id===k.userId))==null?void 0:P.nickname)||"匿名用户";return n.jsxs("div",{className:"flex items-start justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30 hover:border-[#38bdac]/30 transition-colors",children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[k.userAvatar?n.jsx("img",{src:k.userAvatar,alt:N,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:S=>{S.currentTarget.style.display="none";const A=S.currentTarget.nextElementSibling;A&&A.classList.remove("hidden")}}):null,n.jsx("div",{className:`w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 mt-0.5 ${k.userAvatar?"hidden":""}`,children:N.charAt(0)}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("span",{className:"text-sm text-gray-300",children:N}),n.jsx("span",{className:"text-gray-600",children:"·"}),n.jsx("span",{className:"text-sm font-medium text-white truncate",children:j.title})]}),n.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[n.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700/50 rounded",children:j.subtitle}),n.jsx("span",{children:new Date(k.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),b&&n.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",b]})]})]}),n.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[n.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(k.amount).toFixed(2)]}),n.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:k.paymentMethod||"微信"})]})]},k.id)}),d.length===0&&n.jsxs("div",{className:"text-center py-12",children:[n.jsx(tu,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Ue,{children:n.jsx(Ke,{className:"text-white",children:"新注册用户"})}),n.jsx(_e,{children:n.jsxs("div",{className:"space-y-3",children:[i.slice(-5).reverse().map(k=>{var C;return n.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((C=k.nickname)==null?void 0:C.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-white",children:k.nickname||"匿名用户"}),n.jsx("p",{className:"text-xs text-gray-500",children:k.phone||"-"})]})]}),n.jsx("p",{className:"text-xs text-gray-400",children:k.createdAt?new Date(k.createdAt).toLocaleDateString():"-"})]},k.id)}),i.length===0&&n.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const bo=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{className:"relative w-full overflow-auto",children:n.jsx("table",{ref:l,className:We("w-full caption-bottom text-sm",r),...a})}));bo.displayName="Table";const So=p.forwardRef(({className:r,...a},l)=>n.jsx("thead",{ref:l,className:We("[&_tr]:border-b",r),...a}));So.displayName="TableHeader";const Co=p.forwardRef(({className:r,...a},l)=>n.jsx("tbody",{ref:l,className:We("[&_tr:last-child]:border-0",r),...a}));Co.displayName="TableBody";const $n=p.forwardRef(({className:r,...a},l)=>n.jsx("tr",{ref:l,className:We("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));$n.displayName="TableRow";const et=p.forwardRef(({className:r,...a},l)=>n.jsx("th",{ref:l,className:We("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));et.displayName="TableHead";const Qe=p.forwardRef(({className:r,...a},l)=>n.jsx("td",{ref:l,className:We("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));Qe.displayName="TableCell";const ON=xp("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Oe({className:r,variant:a,asChild:l=!1,...i}){const c=l?hp:"span";return n.jsx(c,{className:We(ON({variant:a}),r),...i})}function FN(){const[r,a]=p.useState([]),[l,i]=p.useState([]),[c,d]=p.useState(""),[f,m]=p.useState("all"),[x,g]=p.useState(!0);async function v(){g(!0);try{const[N,P]=await Promise.all([Ye("/api/orders"),Ye("/api/db/users")]);N!=null&&N.success&&N.orders&&a(N.orders),P!=null&&P.success&&P.users&&i(P.users)}catch(N){console.error("加载订单失败",N)}finally{g(!1)}}p.useEffect(()=>{v()},[]);const y=N=>{var P;return N.userNickname||((P=l.find(S=>S.id===N.userId))==null?void 0:P.nickname)||"匿名用户"},E=N=>{var P;return((P=l.find(S=>S.id===N))==null?void 0:P.phone)||"-"},k=N=>{const P=N.productType||N.type||"",S=N.description||"";if(S){if(P==="section"&&S.includes("章节")){if(S.includes("-")){const A=S.split("-");if(A.length>=3)return{name:`第${A[1]}章 第${A[2]}节`,type:"《一场Soul的创业实验》"}}return{name:S,type:"章节购买"}}return P==="fullbook"||S.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:P==="match"||S.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:S,type:"其他"}}return P==="section"?{name:`章节 ${N.productId||N.sectionId||""}`,type:"单章"}:P==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:P==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:P||"其他"}},C=r.filter(N=>{const P=k(N),S=y(N).includes(c)||E(N.userId).includes(c)||P.name.includes(c)||N.orderSn&&N.orderSn.includes(c)||N.id&&N.id.includes(c),A=f==="all"||N.status===f||f==="completed"&&N.status==="paid";return S&&A}),b=r.filter(N=>N.status==="paid"||N.status==="completed").reduce((N,P)=>N+Number(P.amount||0),0),j=r.filter(N=>{const P=new Date().toDateString();return(N.status==="paid"||N.status==="completed")&&new Date(N.createdAt).toDateString()===P}).reduce((N,P)=>N+Number(P.amount||0),0);return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"订单管理"}),n.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",r.length," 笔订单"]})]}),n.jsx("div",{className:"flex items-center gap-4",children:n.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[n.jsx("span",{className:"text-gray-400",children:"总收入:"}),n.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",b.toFixed(2)]}),n.jsx("span",{className:"text-gray-600",children:"|"}),n.jsx("span",{className:"text-gray-400",children:"今日:"}),n.jsxs("span",{className:"text-[#FFD700] font-bold",children:["¥",j.toFixed(2)]})]})})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[n.jsxs("div",{className:"relative flex-1 max-w-md",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),n.jsx(ue,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:c,onChange:N=>d(N.target.value)})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Iw,{className:"w-4 h-4 text-gray-400"}),n.jsxs("select",{value:f,onChange:N=>m(N.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[n.jsx("option",{value:"all",children:"全部状态"}),n.jsx("option",{value:"completed",children:"已完成"}),n.jsx("option",{value:"pending",children:"待支付"}),n.jsx("option",{value:"created",children:"已创建"}),n.jsx("option",{value:"failed",children:"已失败"})]})]}),n.jsxs(pe,{variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(ip,{className:"w-4 h-4 mr-2"}),"导出"]})]}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(_e,{className:"p-0",children:x?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsxs(bo,{children:[n.jsx(So,{children:n.jsxs($n,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(et,{className:"text-gray-400",children:"订单号"}),n.jsx(et,{className:"text-gray-400",children:"用户"}),n.jsx(et,{className:"text-gray-400",children:"商品"}),n.jsx(et,{className:"text-gray-400",children:"金额"}),n.jsx(et,{className:"text-gray-400",children:"支付方式"}),n.jsx(et,{className:"text-gray-400",children:"状态"}),n.jsx(et,{className:"text-gray-400",children:"分销佣金"}),n.jsx(et,{className:"text-gray-400",children:"下单时间"})]})}),n.jsxs(Co,{children:[C.map(N=>{const P=k(N);return n.jsxs($n,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsxs(Qe,{className:"font-mono text-xs text-gray-400",children:[(N.orderSn||N.id||"").slice(0,12),"..."]}),n.jsx(Qe,{children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:y(N)}),n.jsx("p",{className:"text-gray-500 text-xs",children:E(N.userId)})]})}),n.jsx(Qe,{children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:P.name}),n.jsx("p",{className:"text-gray-500 text-xs",children:P.type})]})}),n.jsxs(Qe,{className:"text-[#38bdac] font-bold",children:["¥",Number(N.amount||0).toFixed(2)]}),n.jsx(Qe,{className:"text-gray-300",children:N.paymentMethod==="wechat"?"微信支付":N.paymentMethod==="alipay"?"支付宝":N.paymentMethod||"微信支付"}),n.jsx(Qe,{children:N.status==="paid"||N.status==="completed"?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):N.status==="pending"||N.status==="created"?n.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):n.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),n.jsx(Qe,{className:"text-[#FFD700]",children:N.referrerEarnings?`¥${Number(N.referrerEarnings).toFixed(2)}`:"-"}),n.jsx(Qe,{className:"text-gray-400 text-sm",children:new Date(N.createdAt).toLocaleString("zh-CN")})]},N.id)}),C.length===0&&n.jsx($n,{children:n.jsx(Qe,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]})})})]})}var zN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$N=zN.reduce((r,a)=>{const l=fp(`Primitive.${a}`),i=p.forwardRef((c,d)=>{const{asChild:f,...m}=c,x=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(x,{...m,ref:d})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{}),BN="Label",Rp=p.forwardRef((r,a)=>n.jsx($N.label,{...r,ref:a,onMouseDown:l=>{var c;l.target.closest("button, input, select, textarea")||((c=r.onMouseDown)==null||c.call(r,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));Rp.displayName=BN;var _p=Rp;const ae=p.forwardRef(({className:r,...a},l)=>n.jsx(_p,{ref:l,className:We("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));ae.displayName=_p.displayName;function Ae(r,a,{checkForDefaultPrevented:l=!0}={}){return function(c){if(r==null||r(c),l===!1||!c.defaultPrevented)return a==null?void 0:a(c)}}function UN(r,a){const l=p.createContext(a),i=d=>{const{children:f,...m}=d,x=p.useMemo(()=>m,Object.values(m));return n.jsx(l.Provider,{value:x,children:f})};i.displayName=r+"Provider";function c(d){const f=p.useContext(l);if(f)return f;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${r}\``)}return[i,c]}function jr(r,a=[]){let l=[];function i(d,f){const m=p.createContext(f),x=l.length;l=[...l,f];const g=y=>{var N;const{scope:E,children:k,...C}=y,b=((N=E==null?void 0:E[r])==null?void 0:N[x])||m,j=p.useMemo(()=>C,Object.values(C));return n.jsx(b.Provider,{value:j,children:k})};g.displayName=d+"Provider";function v(y,E){var b;const k=((b=E==null?void 0:E[r])==null?void 0:b[x])||m,C=p.useContext(k);if(C)return C;if(f!==void 0)return f;throw new Error(`\`${y}\` must be used within \`${d}\``)}return[g,v]}const c=()=>{const d=l.map(f=>p.createContext(f));return function(m){const x=(m==null?void 0:m[r])||d;return p.useMemo(()=>({[`__scope${r}`]:{...m,[r]:x}}),[m,x])}};return c.scopeName=r,[i,VN(c,...a)]}function VN(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const i=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const f=i.reduce((m,{useScope:x,scopeName:g})=>{const y=x(d)[`__scope${g}`];return{...m,...y}},{});return p.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])}};return l.scopeName=a.scopeName,l}var Et=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},WN=yo[" useId ".trim().toString()]||(()=>{}),HN=0;function gr(r){const[a,l]=p.useState(WN());return Et(()=>{l(i=>i??String(HN++))},[r]),a?`radix-${a}`:""}var KN=yo[" useInsertionEffect ".trim().toString()]||Et;function Vr({prop:r,defaultProp:a,onChange:l=()=>{},caller:i}){const[c,d,f]=GN({defaultProp:a,onChange:l}),m=r!==void 0,x=m?r:c;{const v=p.useRef(r!==void 0);p.useEffect(()=>{const y=v.current;y!==m&&console.warn(`${i} is changing from ${y?"controlled":"uncontrolled"} to ${m?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=m},[m,i])}const g=p.useCallback(v=>{var y;if(m){const E=QN(v)?v(r):v;E!==r&&((y=f.current)==null||y.call(f,E))}else d(v)},[m,r,d,f]);return[x,g]}function GN({defaultProp:r,onChange:a}){const[l,i]=p.useState(r),c=p.useRef(l),d=p.useRef(a);return KN(()=>{d.current=a},[a]),p.useEffect(()=>{var f;c.current!==l&&((f=d.current)==null||f.call(d,l),c.current=l)},[l,c]),[l,i,d]}function QN(r){return typeof r=="function"}function _a(r){const a=YN(r),l=p.forwardRef((i,c)=>{const{children:d,...f}=i,m=p.Children.toArray(d),x=m.find(qN);if(x){const g=x.props.children,v=m.map(y=>y===x?p.Children.count(g)>1?p.Children.only(null):p.isValidElement(g)?g.props.children:null:y);return n.jsx(a,{...f,ref:c,children:p.isValidElement(g)?p.cloneElement(g,void 0,v):null})}return n.jsx(a,{...f,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}function YN(r){const a=p.forwardRef((l,i)=>{const{children:c,...d}=l;if(p.isValidElement(c)){const f=ZN(c),m=JN(d,c.props);return c.type!==p.Fragment&&(m.ref=i?ku(i,f):f),p.cloneElement(c,m)}return p.Children.count(c)>1?p.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var XN=Symbol("radix.slottable");function qN(r){return p.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===XN}function JN(r,a){const l={...a};for(const i in a){const c=r[i],d=a[i];/^on[A-Z]/.test(i)?c&&d?l[i]=(...m)=>{const x=d(...m);return c(...m),x}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function ZN(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var ej=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Le=ej.reduce((r,a)=>{const l=_a(`Primitive.${a}`),i=p.forwardRef((c,d)=>{const{asChild:f,...m}=c,x=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(x,{...m,ref:d})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{});function tj(r,a){r&&Ia.flushSync(()=>r.dispatchEvent(a))}function vr(r){const a=p.useRef(r);return p.useEffect(()=>{a.current=r}),p.useMemo(()=>(...l)=>{var i;return(i=a.current)==null?void 0:i.call(a,...l)},[])}function nj(r,a=globalThis==null?void 0:globalThis.document){const l=vr(r);p.useEffect(()=>{const i=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",i,{capture:!0}),()=>a.removeEventListener("keydown",i,{capture:!0})},[l,a])}var rj="DismissableLayer",au="dismissableLayer.update",sj="dismissableLayer.pointerDownOutside",aj="dismissableLayer.focusOutside",ym,Tp=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pu=p.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:m,...x}=r,g=p.useContext(Tp),[v,y]=p.useState(null),E=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,k]=p.useState({}),C=Ve(a,Y=>y(Y)),b=Array.from(g.layers),[j]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),N=b.indexOf(j),P=v?b.indexOf(v):-1,S=g.layersWithOutsidePointerEventsDisabled.size>0,A=P>=N,U=ij(Y=>{const W=Y.target,le=[...g.branches].some(de=>de.contains(W));!A||le||(c==null||c(Y),f==null||f(Y),Y.defaultPrevented||m==null||m())},E),Q=cj(Y=>{const W=Y.target;[...g.branches].some(de=>de.contains(W))||(d==null||d(Y),f==null||f(Y),Y.defaultPrevented||m==null||m())},E);return nj(Y=>{P===g.layers.size-1&&(i==null||i(Y),!Y.defaultPrevented&&m&&(Y.preventDefault(),m()))},E),p.useEffect(()=>{if(v)return l&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(ym=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),wm(),()=>{l&&g.layersWithOutsidePointerEventsDisabled.size===1&&(E.body.style.pointerEvents=ym)}},[v,E,l,g]),p.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),wm())},[v,g]),p.useEffect(()=>{const Y=()=>k({});return document.addEventListener(au,Y),()=>document.removeEventListener(au,Y)},[]),n.jsx(Le.div,{...x,ref:C,style:{pointerEvents:S?A?"auto":"none":void 0,...r.style},onFocusCapture:Ae(r.onFocusCapture,Q.onFocusCapture),onBlurCapture:Ae(r.onBlurCapture,Q.onBlurCapture),onPointerDownCapture:Ae(r.onPointerDownCapture,U.onPointerDownCapture)})});Pu.displayName=rj;var lj="DismissableLayerBranch",oj=p.forwardRef((r,a)=>{const l=p.useContext(Tp),i=p.useRef(null),c=Ve(a,i);return p.useEffect(()=>{const d=i.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),n.jsx(Le.div,{...r,ref:c})});oj.displayName=lj;function ij(r,a=globalThis==null?void 0:globalThis.document){const l=vr(r),i=p.useRef(!1),c=p.useRef(()=>{});return p.useEffect(()=>{const d=m=>{if(m.target&&!i.current){let x=function(){Ip(sj,l,g,{discrete:!0})};const g={originalEvent:m};m.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=x,a.addEventListener("click",c.current,{once:!0})):x()}else a.removeEventListener("click",c.current);i.current=!1},f=window.setTimeout(()=>{a.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(f),a.removeEventListener("pointerdown",d),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>i.current=!0}}function cj(r,a=globalThis==null?void 0:globalThis.document){const l=vr(r),i=p.useRef(!1);return p.useEffect(()=>{const c=d=>{d.target&&!i.current&&Ip(aj,l,{originalEvent:d},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function wm(){const r=new CustomEvent(au);document.dispatchEvent(r)}function Ip(r,a,l,{discrete:i}){const c=l.originalEvent.target,d=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),i?tj(c,d):c.dispatchEvent(d)}var Dc="focusScope.autoFocusOnMount",Oc="focusScope.autoFocusOnUnmount",Nm={bubbles:!1,cancelable:!0},uj="FocusScope",Ru=p.forwardRef((r,a)=>{const{loop:l=!1,trapped:i=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...f}=r,[m,x]=p.useState(null),g=vr(c),v=vr(d),y=p.useRef(null),E=Ve(a,b=>x(b)),k=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(i){let b=function(S){if(k.paused||!m)return;const A=S.target;m.contains(A)?y.current=A:hr(y.current,{select:!0})},j=function(S){if(k.paused||!m)return;const A=S.relatedTarget;A!==null&&(m.contains(A)||hr(y.current,{select:!0}))},N=function(S){if(document.activeElement===document.body)for(const U of S)U.removedNodes.length>0&&hr(m)};document.addEventListener("focusin",b),document.addEventListener("focusout",j);const P=new MutationObserver(N);return m&&P.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",j),P.disconnect()}}},[i,m,k.paused]),p.useEffect(()=>{if(m){bm.add(k);const b=document.activeElement;if(!m.contains(b)){const N=new CustomEvent(Dc,Nm);m.addEventListener(Dc,g),m.dispatchEvent(N),N.defaultPrevented||(dj(xj(Ap(m)),{select:!0}),document.activeElement===b&&hr(m))}return()=>{m.removeEventListener(Dc,g),setTimeout(()=>{const N=new CustomEvent(Oc,Nm);m.addEventListener(Oc,v),m.dispatchEvent(N),N.defaultPrevented||hr(b??document.body,{select:!0}),m.removeEventListener(Oc,v),bm.remove(k)},0)}}},[m,g,v,k]);const C=p.useCallback(b=>{if(!l&&!i||k.paused)return;const j=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,N=document.activeElement;if(j&&N){const P=b.currentTarget,[S,A]=fj(P);S&&A?!b.shiftKey&&N===A?(b.preventDefault(),l&&hr(S,{select:!0})):b.shiftKey&&N===S&&(b.preventDefault(),l&&hr(A,{select:!0})):N===P&&b.preventDefault()}},[l,i,k.paused]);return n.jsx(Le.div,{tabIndex:-1,...f,ref:E,onKeyDown:C})});Ru.displayName=uj;function dj(r,{select:a=!1}={}){const l=document.activeElement;for(const i of r)if(hr(i,{select:a}),document.activeElement!==l)return}function fj(r){const a=Ap(r),l=jm(a,r),i=jm(a.reverse(),r);return[l,i]}function Ap(r){const a=[],l=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const c=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||c?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function jm(r,a){for(const l of r)if(!hj(l,{upTo:a}))return l}function hj(r,{upTo:a}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(a!==void 0&&r===a)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function mj(r){return r instanceof HTMLInputElement&&"select"in r}function hr(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&mj(r)&&a&&r.select()}}var bm=pj();function pj(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=Sm(r,a),r.unshift(a)},remove(a){var l;r=Sm(r,a),(l=r[0])==null||l.resume()}}}function Sm(r,a){const l=[...r],i=l.indexOf(a);return i!==-1&&l.splice(i,1),l}function xj(r){return r.filter(a=>a.tagName!=="A")}var gj="Portal",_u=p.forwardRef((r,a)=>{var m;const{container:l,...i}=r,[c,d]=p.useState(!1);Et(()=>d(!0),[]);const f=l||c&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return f?Qv.createPortal(n.jsx(Le.div,{...i,ref:a}),f):null});_u.displayName=gj;function vj(r,a){return p.useReducer((l,i)=>a[l][i]??l,r)}var Ma=r=>{const{present:a,children:l}=r,i=yj(a),c=typeof l=="function"?l({present:i.isPresent}):p.Children.only(l),d=Ve(i.ref,wj(c));return typeof l=="function"||i.isPresent?p.cloneElement(c,{ref:d}):null};Ma.displayName="Presence";function yj(r){const[a,l]=p.useState(),i=p.useRef(null),c=p.useRef(r),d=p.useRef("none"),f=r?"mounted":"unmounted",[m,x]=vj(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const g=Gl(i.current);d.current=m==="mounted"?g:"none"},[m]),Et(()=>{const g=i.current,v=c.current;if(v!==r){const E=d.current,k=Gl(g);r?x("MOUNT"):k==="none"||(g==null?void 0:g.display)==="none"?x("UNMOUNT"):x(v&&E!==k?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,x]),Et(()=>{if(a){let g;const v=a.ownerDocument.defaultView??window,y=k=>{const b=Gl(i.current).includes(CSS.escape(k.animationName));if(k.target===a&&b&&(x("ANIMATION_END"),!c.current)){const j=a.style.animationFillMode;a.style.animationFillMode="forwards",g=v.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=j)})}},E=k=>{k.target===a&&(d.current=Gl(i.current))};return a.addEventListener("animationstart",E),a.addEventListener("animationcancel",y),a.addEventListener("animationend",y),()=>{v.clearTimeout(g),a.removeEventListener("animationstart",E),a.removeEventListener("animationcancel",y),a.removeEventListener("animationend",y)}}else x("ANIMATION_END")},[a,x]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:p.useCallback(g=>{i.current=g?getComputedStyle(g):null,l(g)},[])}}function Gl(r){return(r==null?void 0:r.animationName)||"none"}function wj(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Fc=0;function Mp(){p.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??Cm()),document.body.insertAdjacentElement("beforeend",r[1]??Cm()),Fc++,()=>{Fc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Fc--}},[])}function Cm(){const r=document.createElement("span");return r.setAttribute("data-radix-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}var wn=function(){return wn=Object.assign||function(a){for(var l,i=1,c=arguments.length;i"u")return Oj;var a=Fj(r),l=document.documentElement.clientWidth,i=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,i-l+a[2]-a[0])}},$j=Fp(),Ps="data-scroll-locked",Bj=function(r,a,l,i){var c=r.left,d=r.top,f=r.right,m=r.gap;return l===void 0&&(l="margin"),` - .`.concat(jj,` { + */const I1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],A1=we("zap",I1),ku="admin_token";function M1(){try{return localStorage.getItem(ku)}catch{return null}}function L1(r){try{localStorage.setItem(ku,r)}catch{}}function D1(){try{localStorage.removeItem(ku)}catch{}}const O1="https://soulapi.quwanzhi.com",F1=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):O1};function ru(r){const a=F1(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function jo(r,a={}){const{data:l,...i}=a,c=ru(r),d=new Headers(i.headers),f=M1();f&&d.set("Authorization",`Bearer ${f}`),l!=null&&!d.has("Content-Type")&&d.set("Content-Type","application/json");const m=l!=null?JSON.stringify(l):i.body,p=await fetch(c,{...i,headers:d,body:m,credentials:"include"}),v=(p.headers.get("Content-Type")||"").includes("application/json")?await p.json():p;if(!p.ok){const y=new Error((v==null?void 0:v.error)||`HTTP ${p.status}`);throw y.status=p.status,y.data=v,y}return v}function Ye(r,a){return jo(r,{...a,method:"GET"})}function kt(r,a,l){return jo(r,{...l,method:"POST",data:a})}function Un(r,a,l){return jo(r,{...l,method:"PUT",data:a})}function z1(r,a){return jo(r,{...a,method:"DELETE"})}const $1=[{icon:Ww,label:"数据概览",href:"/dashboard"},{icon:_s,label:"内容管理",href:"/content"},{icon:kn,label:"用户管理",href:"/users"},{icon:Is,label:"交易中心",href:"/distribution"},{icon:Zc,label:"推广设置",href:"/referral-settings"},{icon:io,label:"系统设置",href:"/settings"}];function B1(){const r=Qr(),a=Aa(),[l,i]=x.useState(!1),[c,d]=x.useState(!1);x.useEffect(()=>{i(!0)},[]),x.useEffect(()=>{if(!l)return;d(!1);let m=!1;return Ye("/api/admin").then(p=>{m||(p&&p.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{m||a("/login",{replace:!0})}),()=>{m=!0}},[l,a]);const f=async()=>{D1();try{await kt("/api/admin/logout",{})}catch{}a("/login",{replace:!0})};return!l||!c?n.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[n.jsx("div",{className:"w-64 bg-[#0f2137] border-r border-gray-700/50"}),n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx("div",{className:"text-[#38bdac]",children:"加载中..."})})]}):n.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[n.jsxs("div",{className:"w-64 bg-[#0f2137] flex flex-col border-r border-gray-700/50 shadow-xl",children:[n.jsxs("div",{className:"p-6 border-b border-gray-700/50",children:[n.jsx("h1",{className:"text-xl font-bold text-[#38bdac]",children:"管理后台"}),n.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Soul创业派对"})]}),n.jsx("nav",{className:"flex-1 p-4 space-y-1",children:$1.map(m=>{const p=r.pathname===m.href;return n.jsxs(np,{to:m.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${p?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[n.jsx(m.icon,{className:"w-5 h-5"}),n.jsx("span",{className:"text-sm",children:m.label})]},m.href)})}),n.jsxs("div",{className:"p-4 border-t border-gray-700/50 space-y-1",children:[n.jsxs("button",{type:"button",onClick:f,className:"w-full flex items-center gap-3 px-4 py-3 text-gray-400 hover:text-white rounded-lg hover:bg-gray-700/50 transition-colors",children:[n.jsx(Xw,{className:"w-5 h-5"}),n.jsx("span",{className:"text-sm",children:"退出登录"})]}),n.jsx("a",{href:`${typeof window<"u"?window.location.origin:""}/view`,target:"_blank",rel:"noreferrer",className:"flex items-center gap-3 px-4 py-3 text-gray-400 hover:text-white rounded-lg hover:bg-gray-700/50 transition-colors",children:n.jsx("span",{className:"text-sm",children:"返回前台"})})]})]}),n.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628]",children:n.jsx(Vy,{})})]})}function fm(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function Eu(...r){return a=>{let l=!1;const i=r.map(c=>{const d=fm(c,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let c=0;c{let{children:d,...f}=i;fp(d)&&typeof co=="function"&&(d=co(d._payload));const m=x.Children.toArray(d),p=m.find(K1);if(p){const g=p.props.children,v=m.map(y=>y===p?x.Children.count(g)>1?x.Children.only(null):x.isValidElement(g)?g.props.children:null:y);return n.jsx(a,{...f,ref:c,children:x.isValidElement(g)?x.cloneElement(g,void 0,v):null})}return n.jsx(a,{...f,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}var mp=hp("Slot");function W1(r){const a=x.forwardRef((l,i)=>{let{children:c,...d}=l;if(fp(c)&&typeof co=="function"&&(c=co(c._payload)),x.isValidElement(c)){const f=Q1(c),m=G1(d,c.props);return c.type!==x.Fragment&&(m.ref=i?Eu(i,f):f),x.cloneElement(c,m)}return x.Children.count(c)>1?x.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var H1=Symbol("radix.slottable");function K1(r){return x.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===H1}function G1(r,a){const l={...a};for(const i in a){const c=r[i],d=a[i];/^on[A-Z]/.test(i)?c&&d?l[i]=(...m)=>{const p=d(...m);return c(...m),p}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function Q1(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}function pp(r){var a,l,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;atypeof r=="boolean"?`${r}`:r===0?"0":r,mm=xp,gp=(r,a)=>l=>{var i;if((a==null?void 0:a.variants)==null)return mm(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:d}=a,f=Object.keys(c).map(g=>{const v=l==null?void 0:l[g],y=d==null?void 0:d[g];if(v===null)return null;const E=hm(v)||hm(y);return c[g][E]}),m=l&&Object.entries(l).reduce((g,v)=>{let[y,E]=v;return E===void 0||(g[y]=E),g},{}),p=a==null||(i=a.compoundVariants)===null||i===void 0?void 0:i.reduce((g,v)=>{let{class:y,className:E,...k}=v;return Object.entries(k).every(C=>{let[b,j]=C;return Array.isArray(j)?j.includes({...d,...m}[b]):{...d,...m}[b]===j})?[...g,y,E]:g},[]);return mm(r,f,p,l==null?void 0:l.class,l==null?void 0:l.className)},Y1=(r,a)=>{const l=new Array(r.length+a.length);for(let i=0;i({classGroupId:r,validator:a}),vp=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),uo="-",pm=[],q1="arbitrary..",J1=r=>{const a=eN(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:i}=r;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return Z1(f);const m=f.split(uo),p=m[0]===""&&m.length>1?1:0;return yp(m,p,a)},getConflictingClassGroupIds:(f,m)=>{if(m){const p=i[f],g=l[f];return p?g?Y1(g,p):p:g||pm}return l[f]||pm}}},yp=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],d=l.nextPart.get(c);if(d){const g=yp(r,a+1,d);if(g)return g}const f=l.validators;if(f===null)return;const m=a===0?r.join(uo):r.slice(a).join(uo),p=f.length;for(let g=0;gr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),i=a.slice(0,l);return i?q1+i:void 0})(),eN=r=>{const{theme:a,classGroups:l}=r;return tN(l,a)},tN=(r,a)=>{const l=vp();for(const i in r){const c=r[i];Pu(c,l,i,a)}return l},Pu=(r,a,l,i)=>{const c=r.length;for(let d=0;d{if(typeof r=="string"){rN(r,a,l);return}if(typeof r=="function"){sN(r,a,l,i);return}aN(r,a,l,i)},rN=(r,a,l)=>{const i=r===""?a:wp(a,r);i.classGroupId=l},sN=(r,a,l,i)=>{if(lN(r)){Pu(r(i),a,l,i);return}a.validators===null&&(a.validators=[]),a.validators.push(X1(l,r))},aN=(r,a,l,i)=>{const c=Object.entries(r),d=c.length;for(let f=0;f{let l=r;const i=a.split(uo),c=i.length;for(let d=0;d"isThemeGetter"in r&&r.isThemeGetter===!0,oN=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),i=Object.create(null);const c=(d,f)=>{l[d]=f,a++,a>r&&(a=0,i=l,l=Object.create(null))};return{get(d){let f=l[d];if(f!==void 0)return f;if((f=i[d])!==void 0)return c(d,f),f},set(d,f){d in l?l[d]=f:c(d,f)}}},su="!",xm=":",iN=[],gm=(r,a,l,i,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:i,isExternal:c}),cN=r=>{const{prefix:a,experimentalParseClassName:l}=r;let i=c=>{const d=[];let f=0,m=0,p=0,g;const v=c.length;for(let b=0;bp?g-p:void 0;return gm(d,k,E,C)};if(a){const c=a+xm,d=i;i=f=>f.startsWith(c)?d(f.slice(c.length)):gm(iN,!1,f,void 0,!0)}if(l){const c=i;i=d=>l({className:d,parseClassName:c})}return i},uN=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,i)=>{a.set(l,1e6+i)}),l=>{const i=[];let c=[];for(let d=0;d0&&(c.sort(),i.push(...c),c=[]),i.push(f)):c.push(f)}return c.length>0&&(c.sort(),i.push(...c)),i}},dN=r=>({cache:oN(r.cacheSize),parseClassName:cN(r),sortModifiers:uN(r),...J1(r)}),fN=/\s+/,hN=(r,a)=>{const{parseClassName:l,getClassGroupId:i,getConflictingClassGroupIds:c,sortModifiers:d}=a,f=[],m=r.trim().split(fN);let p="";for(let g=m.length-1;g>=0;g-=1){const v=m[g],{isExternal:y,modifiers:E,hasImportantModifier:k,baseClassName:C,maybePostfixModifierPosition:b}=l(v);if(y){p=v+(p.length>0?" "+p:p);continue}let j=!!b,N=i(j?C.substring(0,b):C);if(!N){if(!j){p=v+(p.length>0?" "+p:p);continue}if(N=i(C),!N){p=v+(p.length>0?" "+p:p);continue}j=!1}const P=E.length===0?"":E.length===1?E[0]:d(E).join(":"),S=k?P+su:P,A=S+N;if(f.indexOf(A)>-1)continue;f.push(A);const U=c(N,j);for(let Q=0;Q0?" "+p:p)}return p},mN=(...r)=>{let a=0,l,i,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let i=0;i{let l,i,c,d;const f=p=>{const g=a.reduce((v,y)=>y(v),r());return l=dN(g),i=l.cache.get,c=l.cache.set,d=m,m(p)},m=p=>{const g=i(p);if(g)return g;const v=hN(p,l);return c(p,v),v};return d=f,(...p)=>d(mN(...p))},xN=[],ft=r=>{const a=l=>l[r]||xN;return a.isThemeGetter=!0,a},jp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,bp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,gN=/^\d+\/\d+$/,vN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yN=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,NN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ns=r=>gN.test(r),Me=r=>!!r&&!Number.isNaN(Number(r)),dr=r=>!!r&&Number.isInteger(Number(r)),Mc=r=>r.endsWith("%")&&Me(r.slice(0,-1)),Fn=r=>vN.test(r),bN=()=>!0,SN=r=>yN.test(r)&&!wN.test(r),Sp=()=>!1,CN=r=>NN.test(r),kN=r=>jN.test(r),EN=r=>!ge(r)&&!ve(r),PN=r=>Ds(r,Ep,Sp),ge=r=>jp.test(r),zr=r=>Ds(r,Pp,SN),Lc=r=>Ds(r,AN,Me),vm=r=>Ds(r,Cp,Sp),RN=r=>Ds(r,kp,kN),Hl=r=>Ds(r,Rp,CN),ve=r=>bp.test(r),ka=r=>Os(r,Pp),_N=r=>Os(r,MN),ym=r=>Os(r,Cp),TN=r=>Os(r,Ep),IN=r=>Os(r,kp),Kl=r=>Os(r,Rp,!0),Ds=(r,a,l)=>{const i=jp.exec(r);return i?i[1]?a(i[1]):l(i[2]):!1},Os=(r,a,l=!1)=>{const i=bp.exec(r);return i?i[1]?a(i[1]):l:!1},Cp=r=>r==="position"||r==="percentage",kp=r=>r==="image"||r==="url",Ep=r=>r==="length"||r==="size"||r==="bg-size",Pp=r=>r==="length",AN=r=>r==="number",MN=r=>r==="family-name",Rp=r=>r==="shadow",LN=()=>{const r=ft("color"),a=ft("font"),l=ft("text"),i=ft("font-weight"),c=ft("tracking"),d=ft("leading"),f=ft("breakpoint"),m=ft("container"),p=ft("spacing"),g=ft("radius"),v=ft("shadow"),y=ft("inset-shadow"),E=ft("text-shadow"),k=ft("drop-shadow"),C=ft("blur"),b=ft("perspective"),j=ft("aspect"),N=ft("ease"),P=ft("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...A(),ve,ge],Q=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto","contain","none"],W=()=>[ve,ge,p],le=()=>[Ns,"full","auto",...W()],de=()=>[dr,"none","subgrid",ve,ge],oe=()=>["auto",{span:["full",dr,ve,ge]},dr,ve,ge],K=()=>[dr,"auto",ve,ge],R=()=>["auto","min","max","fr",ve,ge],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...W()],B=()=>[Ns,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...W()],T=()=>[r,ve,ge],J=()=>[...A(),ym,vm,{position:[ve,ge]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",TN,PN,{size:[ve,ge]}],G=()=>[Mc,ka,zr],fe=()=>["","none","full",g,ve,ge],se=()=>["",Me,ka,zr],be=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[Me,Mc,ym,vm],he=()=>["","none",C,ve,ge],Ee=()=>["none",Me,ve,ge],Se=()=>["none",Me,ve,ge],Te=()=>[Me,ve,ge],z=()=>[Ns,"full",...W()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fn],breakpoint:[Fn],color:[bN],container:[Fn],"drop-shadow":[Fn],ease:["in","out","in-out"],font:[EN],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fn],shadow:[Fn],spacing:["px",Me],text:[Fn],"text-shadow":[Fn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ns,ge,ve,j]}],container:["container"],columns:[{columns:[Me,ge,ve,m]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:U()}],overflow:[{overflow:Q()}],"overflow-x":[{"overflow-x":Q()}],"overflow-y":[{"overflow-y":Q()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:le()}],"inset-x":[{"inset-x":le()}],"inset-y":[{"inset-y":le()}],start:[{start:le()}],end:[{end:le()}],top:[{top:le()}],right:[{right:le()}],bottom:[{bottom:le()}],left:[{left:le()}],visibility:["visible","invisible","collapse"],z:[{z:[dr,"auto",ve,ge]}],basis:[{basis:[Ns,"full","auto",m,...W()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,Ns,"auto","initial","none",ge]}],grow:[{grow:["",Me,ve,ge]}],shrink:[{shrink:["",Me,ve,ge]}],order:[{order:[dr,"first","last","none",ve,ge]}],"grid-cols":[{"grid-cols":de()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":de()}],"row-start-end":[{row:oe()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:W()}],"gap-x":[{"gap-x":W()}],"gap-y":[{"gap-y":W()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:W()}],px:[{px:W()}],py:[{py:W()}],ps:[{ps:W()}],pe:[{pe:W()}],pt:[{pt:W()}],pr:[{pr:W()}],pb:[{pb:W()}],pl:[{pl:W()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":W()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":W()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[m,"screen",...B()]}],"min-w":[{"min-w":[m,"screen","none",...B()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[f]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",l,ka,zr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,ve,Lc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mc,ge]}],"font-family":[{font:[_N,ge,a]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,ve,ge]}],"line-clamp":[{"line-clamp":[Me,"none",ve,Lc]}],leading:[{leading:[d,...W()]}],"list-image":[{"list-image":["none",ve,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ve,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",ve,zr]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Me,"auto",ve,ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ve,ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ve,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:J()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},dr,ve,ge],radial:["",ve,ge],conic:[dr,ve,ge]},IN,RN]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,ve,ge]}],"outline-w":[{outline:["",Me,ka,zr]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",v,Kl,Hl]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",y,Kl,Hl]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Me,zr]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",E,Kl,Hl]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Me,ve,ge]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[ve,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:J()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ve,ge]}],filter:[{filter:["","none",ve,ge]}],blur:[{blur:he()}],brightness:[{brightness:[Me,ve,ge]}],contrast:[{contrast:[Me,ve,ge]}],"drop-shadow":[{"drop-shadow":["","none",k,Kl,Hl]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Me,ve,ge]}],"hue-rotate":[{"hue-rotate":[Me,ve,ge]}],invert:[{invert:["",Me,ve,ge]}],saturate:[{saturate:[Me,ve,ge]}],sepia:[{sepia:["",Me,ve,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",ve,ge]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[Me,ve,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Me,ve,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,ve,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,ve,ge]}],"backdrop-invert":[{"backdrop-invert":["",Me,ve,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Me,ve,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Me,ve,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,ve,ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":W()}],"border-spacing-x":[{"border-spacing-x":W()}],"border-spacing-y":[{"border-spacing-y":W()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ve,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",ve,ge]}],ease:[{ease:["linear","initial",N,ve,ge]}],delay:[{delay:[Me,ve,ge]}],animate:[{animate:["none",P,ve,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ve,ge]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Te()}],"skew-x":[{"skew-x":Te()}],"skew-y":[{"skew-y":Te()}],transform:[{transform:[ve,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:z()}],"translate-x":[{"translate-x":z()}],"translate-y":[{"translate-y":z()}],"translate-z":[{"translate-z":z()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ve,ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ve,ge]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Me,ka,zr,Lc]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},DN=pN(LN);function We(...r){return DN(xp(r))}const ON=gp("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function pe({className:r,variant:a,size:l,asChild:i=!1,...c}){const d=i?mp:"button";return n.jsx(d,{"data-slot":"button",className:We(ON({variant:a,size:l,className:r})),...c})}function ue({className:r,type:a,...l}){return n.jsx("input",{type:a,"data-slot":"input",className:We("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none placeholder:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 md:text-sm focus-visible:ring-2 focus-visible:ring-ring",r),...l})}function FN(){const r=Aa(),[a,l]=x.useState(""),[i,c]=x.useState(""),[d,f]=x.useState(""),[m,p]=x.useState(!1),g=async()=>{f(""),p(!0);try{const v=await kt("/api/admin",{username:a.trim(),password:i});if((v==null?void 0:v.success)!==!1&&(v!=null&&v.token)){L1(v.token),r("/dashboard",{replace:!0});return}f(v.error||"用户名或密码错误")}catch(v){const y=v;f(y.status===401?"用户名或密码错误":(y==null?void 0:y.message)||"网络错误,请重试")}finally{p(!1)}};return n.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[n.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[n.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),n.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),n.jsxs("div",{className:"w-full max-w-md relative z-10",children:[n.jsxs("div",{className:"text-center mb-8",children:[n.jsx("div",{className:"w-16 h-16 bg-[#38bdac]/20 rounded-2xl flex items-center justify-center mx-auto mb-4 border border-[#38bdac]/30",children:n.jsx(y1,{className:"w-8 h-8 text-[#38bdac]"})}),n.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),n.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),n.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[n.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),n.jsxs("div",{className:"relative",children:[n.jsx(Zl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),n.jsx(ue,{type:"text",value:a,onChange:v=>l(v.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),n.jsxs("div",{className:"relative",children:[n.jsx(Qw,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),n.jsx(ue,{type:"password",value:i,onChange:v=>c(v.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:v=>v.key==="Enter"&&g()})]})]}),d&&n.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:d}),n.jsx(pe,{onClick:g,disabled:m,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:m?"登录中...":"登录"})]})]}),n.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const Re=x.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:We("rounded-xl border bg-card text-card-foreground shadow",r),...a}));Re.displayName="Card";const Ue=x.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:We("flex flex-col space-y-1.5 p-6",r),...a}));Ue.displayName="CardHeader";const Ke=x.forwardRef(({className:r,...a},l)=>n.jsx("h3",{ref:l,className:We("font-semibold leading-none tracking-tight",r),...a}));Ke.displayName="CardTitle";const mt=x.forwardRef(({className:r,...a},l)=>n.jsx("p",{ref:l,className:We("text-sm text-muted-foreground",r),...a}));mt.displayName="CardDescription";const _e=x.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:We("p-6 pt-0",r),...a}));_e.displayName="CardContent";const zN=x.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:We("flex items-center p-6 pt-0",r),...a}));zN.displayName="CardFooter";function $N(){const r=Aa(),[a,l]=x.useState(!1),[i,c]=x.useState([]),[d,f]=x.useState([]);async function m(){try{const[k,C]=await Promise.all([Ye("/api/db/users"),Ye("/api/orders")]);k!=null&&k.success&&k.users&&c(k.users),C!=null&&C.success&&C.orders&&f(C.orders)}catch(k){console.error("加载数据失败",k)}}if(x.useEffect(()=>{l(!0),m()},[]),!a)return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:[1,2,3,4].map(k=>n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsx("div",{className:"h-4 w-20 bg-gray-700 rounded animate-pulse"}),n.jsx("div",{className:"w-8 h-8 bg-gray-700 rounded-lg animate-pulse"})]}),n.jsx(_e,{children:n.jsx("div",{className:"h-8 w-16 bg-gray-700 rounded animate-pulse"})})]},k))}),n.jsxs("div",{className:"flex items-center justify-center py-8",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]})]});const p=d.reduce((k,C)=>k+Number(C.amount||0),0),g=i.length,v=d.length,y=k=>{const C=k.productType||"",b=k.description||"";if(b){if(C==="section"&&b.includes("章节")){if(b.includes("-")){const j=b.split("-");if(j.length>=3)return{title:`第${j[1]}章 第${j[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:b,subtitle:"章节购买"}}return C==="fullbook"||b.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:C==="match"||b.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:b,subtitle:C==="section"?"单章":C==="fullbook"?"全书":"其他"}}return C==="section"?{title:`章节 ${k.productId||""}`,subtitle:"单章购买"}:C==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:C==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:C||"其他"}},E=[{title:"总用户数",value:g,icon:kn,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${Number(p).toFixed(2)}`,icon:nu,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:v,icon:tu,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${g>0?(v/g*100).toFixed(1):0}%`,icon:_s,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"}];return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:E.map((k,C)=>n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>k.link&&r(k.link),children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsx(Ke,{className:"text-sm font-medium text-gray-400",children:k.title}),n.jsx("div",{className:`p-2 rounded-lg ${k.bg}`,children:n.jsx(k.icon,{className:`w-4 h-4 ${k.color}`})})]}),n.jsx(_e,{children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-2xl font-bold text-white",children:k.value}),n.jsx(ap,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},C))}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Ue,{children:n.jsx(Ke,{className:"text-white",children:"最近订单"})}),n.jsx(_e,{children:n.jsxs("div",{className:"space-y-3",children:[d.slice(-5).reverse().map(k=>{var P;const C=k.referrerId?i.find(S=>S.id===k.referrerId):void 0,b=k.referralCode||(C==null?void 0:C.referralCode)||(C==null?void 0:C.nickname)||(k.referrerId?String(k.referrerId).slice(0,8):""),j=y(k),N=k.userNickname||((P=i.find(S=>S.id===k.userId))==null?void 0:P.nickname)||"匿名用户";return n.jsxs("div",{className:"flex items-start justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30 hover:border-[#38bdac]/30 transition-colors",children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[k.userAvatar?n.jsx("img",{src:k.userAvatar,alt:N,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:S=>{S.currentTarget.style.display="none";const A=S.currentTarget.nextElementSibling;A&&A.classList.remove("hidden")}}):null,n.jsx("div",{className:`w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 mt-0.5 ${k.userAvatar?"hidden":""}`,children:N.charAt(0)}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("span",{className:"text-sm text-gray-300",children:N}),n.jsx("span",{className:"text-gray-600",children:"·"}),n.jsx("span",{className:"text-sm font-medium text-white truncate",children:j.title})]}),n.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[n.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700/50 rounded",children:j.subtitle}),n.jsx("span",{children:new Date(k.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),b&&n.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",b]})]})]}),n.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[n.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(k.amount).toFixed(2)]}),n.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:k.paymentMethod||"微信"})]})]},k.id)}),d.length===0&&n.jsxs("div",{className:"text-center py-12",children:[n.jsx(tu,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Ue,{children:n.jsx(Ke,{className:"text-white",children:"新注册用户"})}),n.jsx(_e,{children:n.jsxs("div",{className:"space-y-3",children:[i.slice(-5).reverse().map(k=>{var C;return n.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((C=k.nickname)==null?void 0:C.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-white",children:k.nickname||"匿名用户"}),n.jsx("p",{className:"text-xs text-gray-500",children:k.phone||"-"})]})]}),n.jsx("p",{className:"text-xs text-gray-400",children:k.createdAt?new Date(k.createdAt).toLocaleDateString():"-"})]},k.id)}),i.length===0&&n.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const bo=x.forwardRef(({className:r,...a},l)=>n.jsx("div",{className:"relative w-full overflow-auto",children:n.jsx("table",{ref:l,className:We("w-full caption-bottom text-sm",r),...a})}));bo.displayName="Table";const So=x.forwardRef(({className:r,...a},l)=>n.jsx("thead",{ref:l,className:We("[&_tr]:border-b",r),...a}));So.displayName="TableHeader";const Co=x.forwardRef(({className:r,...a},l)=>n.jsx("tbody",{ref:l,className:We("[&_tr:last-child]:border-0",r),...a}));Co.displayName="TableBody";const $n=x.forwardRef(({className:r,...a},l)=>n.jsx("tr",{ref:l,className:We("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));$n.displayName="TableRow";const et=x.forwardRef(({className:r,...a},l)=>n.jsx("th",{ref:l,className:We("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));et.displayName="TableHead";const Qe=x.forwardRef(({className:r,...a},l)=>n.jsx("td",{ref:l,className:We("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));Qe.displayName="TableCell";const BN=gp("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Oe({className:r,variant:a,asChild:l=!1,...i}){const c=l?mp:"span";return n.jsx(c,{className:We(BN({variant:a}),r),...i})}function UN(){const[r,a]=x.useState([]),[l,i]=x.useState([]),[c,d]=x.useState(""),[f,m]=x.useState("all"),[p,g]=x.useState(!0);async function v(){g(!0);try{const[N,P]=await Promise.all([Ye("/api/orders"),Ye("/api/db/users")]);N!=null&&N.success&&N.orders&&a(N.orders),P!=null&&P.success&&P.users&&i(P.users)}catch(N){console.error("加载订单失败",N)}finally{g(!1)}}x.useEffect(()=>{v()},[]);const y=N=>{var P;return N.userNickname||((P=l.find(S=>S.id===N.userId))==null?void 0:P.nickname)||"匿名用户"},E=N=>{var P;return((P=l.find(S=>S.id===N))==null?void 0:P.phone)||"-"},k=N=>{const P=N.productType||N.type||"",S=N.description||"";if(S){if(P==="section"&&S.includes("章节")){if(S.includes("-")){const A=S.split("-");if(A.length>=3)return{name:`第${A[1]}章 第${A[2]}节`,type:"《一场Soul的创业实验》"}}return{name:S,type:"章节购买"}}return P==="fullbook"||S.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:P==="match"||S.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:S,type:"其他"}}return P==="section"?{name:`章节 ${N.productId||N.sectionId||""}`,type:"单章"}:P==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:P==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:P||"其他"}},C=r.filter(N=>{const P=k(N),S=y(N).includes(c)||E(N.userId).includes(c)||P.name.includes(c)||N.orderSn&&N.orderSn.includes(c)||N.id&&N.id.includes(c),A=f==="all"||N.status===f||f==="completed"&&N.status==="paid";return S&&A}),b=r.filter(N=>N.status==="paid"||N.status==="completed").reduce((N,P)=>N+Number(P.amount||0),0),j=r.filter(N=>{const P=new Date().toDateString();return(N.status==="paid"||N.status==="completed")&&new Date(N.createdAt).toDateString()===P}).reduce((N,P)=>N+Number(P.amount||0),0);return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"订单管理"}),n.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",r.length," 笔订单"]})]}),n.jsx("div",{className:"flex items-center gap-4",children:n.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[n.jsx("span",{className:"text-gray-400",children:"总收入:"}),n.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",b.toFixed(2)]}),n.jsx("span",{className:"text-gray-600",children:"|"}),n.jsx("span",{className:"text-gray-400",children:"今日:"}),n.jsxs("span",{className:"text-[#FFD700] font-bold",children:["¥",j.toFixed(2)]})]})})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[n.jsxs("div",{className:"relative flex-1 max-w-md",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),n.jsx(ue,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:c,onChange:N=>d(N.target.value)})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Aw,{className:"w-4 h-4 text-gray-400"}),n.jsxs("select",{value:f,onChange:N=>m(N.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[n.jsx("option",{value:"all",children:"全部状态"}),n.jsx("option",{value:"completed",children:"已完成"}),n.jsx("option",{value:"pending",children:"待支付"}),n.jsx("option",{value:"created",children:"已创建"}),n.jsx("option",{value:"failed",children:"已失败"})]})]}),n.jsxs(pe,{variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(cp,{className:"w-4 h-4 mr-2"}),"导出"]})]}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(_e,{className:"p-0",children:p?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsxs(bo,{children:[n.jsx(So,{children:n.jsxs($n,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(et,{className:"text-gray-400",children:"订单号"}),n.jsx(et,{className:"text-gray-400",children:"用户"}),n.jsx(et,{className:"text-gray-400",children:"商品"}),n.jsx(et,{className:"text-gray-400",children:"金额"}),n.jsx(et,{className:"text-gray-400",children:"支付方式"}),n.jsx(et,{className:"text-gray-400",children:"状态"}),n.jsx(et,{className:"text-gray-400",children:"分销佣金"}),n.jsx(et,{className:"text-gray-400",children:"下单时间"})]})}),n.jsxs(Co,{children:[C.map(N=>{const P=k(N);return n.jsxs($n,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsxs(Qe,{className:"font-mono text-xs text-gray-400",children:[(N.orderSn||N.id||"").slice(0,12),"..."]}),n.jsx(Qe,{children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:y(N)}),n.jsx("p",{className:"text-gray-500 text-xs",children:E(N.userId)})]})}),n.jsx(Qe,{children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:P.name}),n.jsx("p",{className:"text-gray-500 text-xs",children:P.type})]})}),n.jsxs(Qe,{className:"text-[#38bdac] font-bold",children:["¥",Number(N.amount||0).toFixed(2)]}),n.jsx(Qe,{className:"text-gray-300",children:N.paymentMethod==="wechat"?"微信支付":N.paymentMethod==="alipay"?"支付宝":N.paymentMethod||"微信支付"}),n.jsx(Qe,{children:N.status==="paid"||N.status==="completed"?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):N.status==="pending"||N.status==="created"?n.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):n.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),n.jsx(Qe,{className:"text-[#FFD700]",children:N.referrerEarnings?`¥${Number(N.referrerEarnings).toFixed(2)}`:"-"}),n.jsx(Qe,{className:"text-gray-400 text-sm",children:new Date(N.createdAt).toLocaleString("zh-CN")})]},N.id)}),C.length===0&&n.jsx($n,{children:n.jsx(Qe,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]})})})]})}var VN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],WN=VN.reduce((r,a)=>{const l=hp(`Primitive.${a}`),i=x.forwardRef((c,d)=>{const{asChild:f,...m}=c,p=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(p,{...m,ref:d})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{}),HN="Label",_p=x.forwardRef((r,a)=>n.jsx(WN.label,{...r,ref:a,onMouseDown:l=>{var c;l.target.closest("button, input, select, textarea")||((c=r.onMouseDown)==null||c.call(r,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));_p.displayName=HN;var Tp=_p;const ae=x.forwardRef(({className:r,...a},l)=>n.jsx(Tp,{ref:l,className:We("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));ae.displayName=Tp.displayName;function Ae(r,a,{checkForDefaultPrevented:l=!0}={}){return function(c){if(r==null||r(c),l===!1||!c.defaultPrevented)return a==null?void 0:a(c)}}function KN(r,a){const l=x.createContext(a),i=d=>{const{children:f,...m}=d,p=x.useMemo(()=>m,Object.values(m));return n.jsx(l.Provider,{value:p,children:f})};i.displayName=r+"Provider";function c(d){const f=x.useContext(l);if(f)return f;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${r}\``)}return[i,c]}function jr(r,a=[]){let l=[];function i(d,f){const m=x.createContext(f),p=l.length;l=[...l,f];const g=y=>{var N;const{scope:E,children:k,...C}=y,b=((N=E==null?void 0:E[r])==null?void 0:N[p])||m,j=x.useMemo(()=>C,Object.values(C));return n.jsx(b.Provider,{value:j,children:k})};g.displayName=d+"Provider";function v(y,E){var b;const k=((b=E==null?void 0:E[r])==null?void 0:b[p])||m,C=x.useContext(k);if(C)return C;if(f!==void 0)return f;throw new Error(`\`${y}\` must be used within \`${d}\``)}return[g,v]}const c=()=>{const d=l.map(f=>x.createContext(f));return function(m){const p=(m==null?void 0:m[r])||d;return x.useMemo(()=>({[`__scope${r}`]:{...m,[r]:p}}),[m,p])}};return c.scopeName=r,[i,GN(c,...a)]}function GN(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const i=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const f=i.reduce((m,{useScope:p,scopeName:g})=>{const y=p(d)[`__scope${g}`];return{...m,...y}},{});return x.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])}};return l.scopeName=a.scopeName,l}var Et=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},QN=yo[" useId ".trim().toString()]||(()=>{}),YN=0;function gr(r){const[a,l]=x.useState(QN());return Et(()=>{l(i=>i??String(YN++))},[r]),a?`radix-${a}`:""}var XN=yo[" useInsertionEffect ".trim().toString()]||Et;function Vr({prop:r,defaultProp:a,onChange:l=()=>{},caller:i}){const[c,d,f]=qN({defaultProp:a,onChange:l}),m=r!==void 0,p=m?r:c;{const v=x.useRef(r!==void 0);x.useEffect(()=>{const y=v.current;y!==m&&console.warn(`${i} is changing from ${y?"controlled":"uncontrolled"} to ${m?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=m},[m,i])}const g=x.useCallback(v=>{var y;if(m){const E=JN(v)?v(r):v;E!==r&&((y=f.current)==null||y.call(f,E))}else d(v)},[m,r,d,f]);return[p,g]}function qN({defaultProp:r,onChange:a}){const[l,i]=x.useState(r),c=x.useRef(l),d=x.useRef(a);return XN(()=>{d.current=a},[a]),x.useEffect(()=>{var f;c.current!==l&&((f=d.current)==null||f.call(d,l),c.current=l)},[l,c]),[l,i,d]}function JN(r){return typeof r=="function"}function _a(r){const a=ZN(r),l=x.forwardRef((i,c)=>{const{children:d,...f}=i,m=x.Children.toArray(d),p=m.find(tj);if(p){const g=p.props.children,v=m.map(y=>y===p?x.Children.count(g)>1?x.Children.only(null):x.isValidElement(g)?g.props.children:null:y);return n.jsx(a,{...f,ref:c,children:x.isValidElement(g)?x.cloneElement(g,void 0,v):null})}return n.jsx(a,{...f,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}function ZN(r){const a=x.forwardRef((l,i)=>{const{children:c,...d}=l;if(x.isValidElement(c)){const f=rj(c),m=nj(d,c.props);return c.type!==x.Fragment&&(m.ref=i?Eu(i,f):f),x.cloneElement(c,m)}return x.Children.count(c)>1?x.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var ej=Symbol("radix.slottable");function tj(r){return x.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===ej}function nj(r,a){const l={...a};for(const i in a){const c=r[i],d=a[i];/^on[A-Z]/.test(i)?c&&d?l[i]=(...m)=>{const p=d(...m);return c(...m),p}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function rj(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var sj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Le=sj.reduce((r,a)=>{const l=_a(`Primitive.${a}`),i=x.forwardRef((c,d)=>{const{asChild:f,...m}=c,p=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(p,{...m,ref:d})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{});function aj(r,a){r&&Ia.flushSync(()=>r.dispatchEvent(a))}function vr(r){const a=x.useRef(r);return x.useEffect(()=>{a.current=r}),x.useMemo(()=>(...l)=>{var i;return(i=a.current)==null?void 0:i.call(a,...l)},[])}function lj(r,a=globalThis==null?void 0:globalThis.document){const l=vr(r);x.useEffect(()=>{const i=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",i,{capture:!0}),()=>a.removeEventListener("keydown",i,{capture:!0})},[l,a])}var oj="DismissableLayer",au="dismissableLayer.update",ij="dismissableLayer.pointerDownOutside",cj="dismissableLayer.focusOutside",wm,Ip=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ru=x.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:m,...p}=r,g=x.useContext(Ip),[v,y]=x.useState(null),E=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,k]=x.useState({}),C=Ve(a,Y=>y(Y)),b=Array.from(g.layers),[j]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),N=b.indexOf(j),P=v?b.indexOf(v):-1,S=g.layersWithOutsidePointerEventsDisabled.size>0,A=P>=N,U=fj(Y=>{const W=Y.target,le=[...g.branches].some(de=>de.contains(W));!A||le||(c==null||c(Y),f==null||f(Y),Y.defaultPrevented||m==null||m())},E),Q=hj(Y=>{const W=Y.target;[...g.branches].some(de=>de.contains(W))||(d==null||d(Y),f==null||f(Y),Y.defaultPrevented||m==null||m())},E);return lj(Y=>{P===g.layers.size-1&&(i==null||i(Y),!Y.defaultPrevented&&m&&(Y.preventDefault(),m()))},E),x.useEffect(()=>{if(v)return l&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(wm=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),Nm(),()=>{l&&g.layersWithOutsidePointerEventsDisabled.size===1&&(E.body.style.pointerEvents=wm)}},[v,E,l,g]),x.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),Nm())},[v,g]),x.useEffect(()=>{const Y=()=>k({});return document.addEventListener(au,Y),()=>document.removeEventListener(au,Y)},[]),n.jsx(Le.div,{...p,ref:C,style:{pointerEvents:S?A?"auto":"none":void 0,...r.style},onFocusCapture:Ae(r.onFocusCapture,Q.onFocusCapture),onBlurCapture:Ae(r.onBlurCapture,Q.onBlurCapture),onPointerDownCapture:Ae(r.onPointerDownCapture,U.onPointerDownCapture)})});Ru.displayName=oj;var uj="DismissableLayerBranch",dj=x.forwardRef((r,a)=>{const l=x.useContext(Ip),i=x.useRef(null),c=Ve(a,i);return x.useEffect(()=>{const d=i.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),n.jsx(Le.div,{...r,ref:c})});dj.displayName=uj;function fj(r,a=globalThis==null?void 0:globalThis.document){const l=vr(r),i=x.useRef(!1),c=x.useRef(()=>{});return x.useEffect(()=>{const d=m=>{if(m.target&&!i.current){let p=function(){Ap(ij,l,g,{discrete:!0})};const g={originalEvent:m};m.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=p,a.addEventListener("click",c.current,{once:!0})):p()}else a.removeEventListener("click",c.current);i.current=!1},f=window.setTimeout(()=>{a.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(f),a.removeEventListener("pointerdown",d),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>i.current=!0}}function hj(r,a=globalThis==null?void 0:globalThis.document){const l=vr(r),i=x.useRef(!1);return x.useEffect(()=>{const c=d=>{d.target&&!i.current&&Ap(cj,l,{originalEvent:d},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Nm(){const r=new CustomEvent(au);document.dispatchEvent(r)}function Ap(r,a,l,{discrete:i}){const c=l.originalEvent.target,d=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),i?aj(c,d):c.dispatchEvent(d)}var Dc="focusScope.autoFocusOnMount",Oc="focusScope.autoFocusOnUnmount",jm={bubbles:!1,cancelable:!0},mj="FocusScope",_u=x.forwardRef((r,a)=>{const{loop:l=!1,trapped:i=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...f}=r,[m,p]=x.useState(null),g=vr(c),v=vr(d),y=x.useRef(null),E=Ve(a,b=>p(b)),k=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(i){let b=function(S){if(k.paused||!m)return;const A=S.target;m.contains(A)?y.current=A:hr(y.current,{select:!0})},j=function(S){if(k.paused||!m)return;const A=S.relatedTarget;A!==null&&(m.contains(A)||hr(y.current,{select:!0}))},N=function(S){if(document.activeElement===document.body)for(const U of S)U.removedNodes.length>0&&hr(m)};document.addEventListener("focusin",b),document.addEventListener("focusout",j);const P=new MutationObserver(N);return m&&P.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",j),P.disconnect()}}},[i,m,k.paused]),x.useEffect(()=>{if(m){Sm.add(k);const b=document.activeElement;if(!m.contains(b)){const N=new CustomEvent(Dc,jm);m.addEventListener(Dc,g),m.dispatchEvent(N),N.defaultPrevented||(pj(wj(Mp(m)),{select:!0}),document.activeElement===b&&hr(m))}return()=>{m.removeEventListener(Dc,g),setTimeout(()=>{const N=new CustomEvent(Oc,jm);m.addEventListener(Oc,v),m.dispatchEvent(N),N.defaultPrevented||hr(b??document.body,{select:!0}),m.removeEventListener(Oc,v),Sm.remove(k)},0)}}},[m,g,v,k]);const C=x.useCallback(b=>{if(!l&&!i||k.paused)return;const j=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,N=document.activeElement;if(j&&N){const P=b.currentTarget,[S,A]=xj(P);S&&A?!b.shiftKey&&N===A?(b.preventDefault(),l&&hr(S,{select:!0})):b.shiftKey&&N===S&&(b.preventDefault(),l&&hr(A,{select:!0})):N===P&&b.preventDefault()}},[l,i,k.paused]);return n.jsx(Le.div,{tabIndex:-1,...f,ref:E,onKeyDown:C})});_u.displayName=mj;function pj(r,{select:a=!1}={}){const l=document.activeElement;for(const i of r)if(hr(i,{select:a}),document.activeElement!==l)return}function xj(r){const a=Mp(r),l=bm(a,r),i=bm(a.reverse(),r);return[l,i]}function Mp(r){const a=[],l=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const c=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||c?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function bm(r,a){for(const l of r)if(!gj(l,{upTo:a}))return l}function gj(r,{upTo:a}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(a!==void 0&&r===a)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function vj(r){return r instanceof HTMLInputElement&&"select"in r}function hr(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&vj(r)&&a&&r.select()}}var Sm=yj();function yj(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=Cm(r,a),r.unshift(a)},remove(a){var l;r=Cm(r,a),(l=r[0])==null||l.resume()}}}function Cm(r,a){const l=[...r],i=l.indexOf(a);return i!==-1&&l.splice(i,1),l}function wj(r){return r.filter(a=>a.tagName!=="A")}var Nj="Portal",Tu=x.forwardRef((r,a)=>{var m;const{container:l,...i}=r,[c,d]=x.useState(!1);Et(()=>d(!0),[]);const f=l||c&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return f?Yv.createPortal(n.jsx(Le.div,{...i,ref:a}),f):null});Tu.displayName=Nj;function jj(r,a){return x.useReducer((l,i)=>a[l][i]??l,r)}var Ma=r=>{const{present:a,children:l}=r,i=bj(a),c=typeof l=="function"?l({present:i.isPresent}):x.Children.only(l),d=Ve(i.ref,Sj(c));return typeof l=="function"||i.isPresent?x.cloneElement(c,{ref:d}):null};Ma.displayName="Presence";function bj(r){const[a,l]=x.useState(),i=x.useRef(null),c=x.useRef(r),d=x.useRef("none"),f=r?"mounted":"unmounted",[m,p]=jj(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const g=Gl(i.current);d.current=m==="mounted"?g:"none"},[m]),Et(()=>{const g=i.current,v=c.current;if(v!==r){const E=d.current,k=Gl(g);r?p("MOUNT"):k==="none"||(g==null?void 0:g.display)==="none"?p("UNMOUNT"):p(v&&E!==k?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,p]),Et(()=>{if(a){let g;const v=a.ownerDocument.defaultView??window,y=k=>{const b=Gl(i.current).includes(CSS.escape(k.animationName));if(k.target===a&&b&&(p("ANIMATION_END"),!c.current)){const j=a.style.animationFillMode;a.style.animationFillMode="forwards",g=v.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=j)})}},E=k=>{k.target===a&&(d.current=Gl(i.current))};return a.addEventListener("animationstart",E),a.addEventListener("animationcancel",y),a.addEventListener("animationend",y),()=>{v.clearTimeout(g),a.removeEventListener("animationstart",E),a.removeEventListener("animationcancel",y),a.removeEventListener("animationend",y)}}else p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:x.useCallback(g=>{i.current=g?getComputedStyle(g):null,l(g)},[])}}function Gl(r){return(r==null?void 0:r.animationName)||"none"}function Sj(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Fc=0;function Lp(){x.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??km()),document.body.insertAdjacentElement("beforeend",r[1]??km()),Fc++,()=>{Fc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Fc--}},[])}function km(){const r=document.createElement("span");return r.setAttribute("data-radix-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}var wn=function(){return wn=Object.assign||function(a){for(var l,i=1,c=arguments.length;i"u")return Bj;var a=Uj(r),l=document.documentElement.clientWidth,i=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,i-l+a[2]-a[0])}},Wj=zp(),Ps="data-scroll-locked",Hj=function(r,a,l,i){var c=r.left,d=r.top,f=r.right,m=r.gap;return l===void 0&&(l="margin"),` + .`.concat(kj,` { overflow: hidden `).concat(i,`; padding-right: `).concat(m,"px ").concat(i,`; } @@ -424,31 +424,31 @@ Error generating stack: `+h.message+` } body[`).concat(Ps,`] { - `).concat(bj,": ").concat(m,`px; + `).concat(Ej,": ").concat(m,`px; } -`)},Em=function(){var r=parseInt(document.body.getAttribute(Ps)||"0",10);return isFinite(r)?r:0},Uj=function(){p.useEffect(function(){return document.body.setAttribute(Ps,(Em()+1).toString()),function(){var r=Em()-1;r<=0?document.body.removeAttribute(Ps):document.body.setAttribute(Ps,r.toString())}},[])},Vj=function(r){var a=r.noRelative,l=r.noImportant,i=r.gapMode,c=i===void 0?"margin":i;Uj();var d=p.useMemo(function(){return zj(c)},[c]);return p.createElement($j,{styles:Bj(d,!a,c,l?"":"!important")})},lu=!1;if(typeof window<"u")try{var Ql=Object.defineProperty({},"passive",{get:function(){return lu=!0,!0}});window.addEventListener("test",Ql,Ql),window.removeEventListener("test",Ql,Ql)}catch{lu=!1}var js=lu?{passive:!1}:!1,Wj=function(r){return r.tagName==="TEXTAREA"},zp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!Wj(r)&&l[a]==="visible")},Hj=function(r){return zp(r,"overflowY")},Kj=function(r){return zp(r,"overflowX")},Pm=function(r,a){var l=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var c=$p(r,i);if(c){var d=Bp(r,i),f=d[1],m=d[2];if(f>m)return!0}i=i.parentNode}while(i&&i!==l.body);return!1},Gj=function(r){var a=r.scrollTop,l=r.scrollHeight,i=r.clientHeight;return[a,l,i]},Qj=function(r){var a=r.scrollLeft,l=r.scrollWidth,i=r.clientWidth;return[a,l,i]},$p=function(r,a){return r==="v"?Hj(a):Kj(a)},Bp=function(r,a){return r==="v"?Gj(a):Qj(a)},Yj=function(r,a){return r==="h"&&a==="rtl"?-1:1},Xj=function(r,a,l,i,c){var d=Yj(r,window.getComputedStyle(a).direction),f=d*i,m=l.target,x=a.contains(m),g=!1,v=f>0,y=0,E=0;do{if(!m)break;var k=Bp(r,m),C=k[0],b=k[1],j=k[2],N=b-j-d*C;(C||N)&&$p(r,m)&&(y+=N,E+=C);var P=m.parentNode;m=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!x&&m!==document.body||x&&(a.contains(m)||a===m));return(v&&Math.abs(y)<1||!v&&Math.abs(E)<1)&&(g=!0),g},Yl=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Rm=function(r){return[r.deltaX,r.deltaY]},_m=function(r){return r&&"current"in r?r.current:r},qj=function(r,a){return r[0]===a[0]&&r[1]===a[1]},Jj=function(r){return` +`)},Pm=function(){var r=parseInt(document.body.getAttribute(Ps)||"0",10);return isFinite(r)?r:0},Kj=function(){x.useEffect(function(){return document.body.setAttribute(Ps,(Pm()+1).toString()),function(){var r=Pm()-1;r<=0?document.body.removeAttribute(Ps):document.body.setAttribute(Ps,r.toString())}},[])},Gj=function(r){var a=r.noRelative,l=r.noImportant,i=r.gapMode,c=i===void 0?"margin":i;Kj();var d=x.useMemo(function(){return Vj(c)},[c]);return x.createElement(Wj,{styles:Hj(d,!a,c,l?"":"!important")})},lu=!1;if(typeof window<"u")try{var Ql=Object.defineProperty({},"passive",{get:function(){return lu=!0,!0}});window.addEventListener("test",Ql,Ql),window.removeEventListener("test",Ql,Ql)}catch{lu=!1}var js=lu?{passive:!1}:!1,Qj=function(r){return r.tagName==="TEXTAREA"},$p=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!Qj(r)&&l[a]==="visible")},Yj=function(r){return $p(r,"overflowY")},Xj=function(r){return $p(r,"overflowX")},Rm=function(r,a){var l=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var c=Bp(r,i);if(c){var d=Up(r,i),f=d[1],m=d[2];if(f>m)return!0}i=i.parentNode}while(i&&i!==l.body);return!1},qj=function(r){var a=r.scrollTop,l=r.scrollHeight,i=r.clientHeight;return[a,l,i]},Jj=function(r){var a=r.scrollLeft,l=r.scrollWidth,i=r.clientWidth;return[a,l,i]},Bp=function(r,a){return r==="v"?Yj(a):Xj(a)},Up=function(r,a){return r==="v"?qj(a):Jj(a)},Zj=function(r,a){return r==="h"&&a==="rtl"?-1:1},eb=function(r,a,l,i,c){var d=Zj(r,window.getComputedStyle(a).direction),f=d*i,m=l.target,p=a.contains(m),g=!1,v=f>0,y=0,E=0;do{if(!m)break;var k=Up(r,m),C=k[0],b=k[1],j=k[2],N=b-j-d*C;(C||N)&&Bp(r,m)&&(y+=N,E+=C);var P=m.parentNode;m=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!p&&m!==document.body||p&&(a.contains(m)||a===m));return(v&&Math.abs(y)<1||!v&&Math.abs(E)<1)&&(g=!0),g},Yl=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},_m=function(r){return[r.deltaX,r.deltaY]},Tm=function(r){return r&&"current"in r?r.current:r},tb=function(r,a){return r[0]===a[0]&&r[1]===a[1]},nb=function(r){return` .block-interactivity-`.concat(r,` {pointer-events: none;} .allow-interactivity-`).concat(r,` {pointer-events: all;} -`)},Zj=0,bs=[];function eb(r){var a=p.useRef([]),l=p.useRef([0,0]),i=p.useRef(),c=p.useState(Zj++)[0],d=p.useState(Fp)[0],f=p.useRef(r);p.useEffect(function(){f.current=r},[r]),p.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var b=Nj([r.lockRef.current],(r.shards||[]).map(_m),!0).filter(Boolean);return b.forEach(function(j){return j.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),b.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var m=p.useCallback(function(b,j){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!f.current.allowPinchZoom;var N=Yl(b),P=l.current,S="deltaX"in b?b.deltaX:P[0]-N[0],A="deltaY"in b?b.deltaY:P[1]-N[1],U,Q=b.target,Y=Math.abs(S)>Math.abs(A)?"h":"v";if("touches"in b&&Y==="h"&&Q.type==="range")return!1;var W=window.getSelection(),le=W&&W.anchorNode,de=le?le===Q||le.contains(Q):!1;if(de)return!1;var oe=Pm(Y,Q);if(!oe)return!0;if(oe?U=Y:(U=Y==="v"?"h":"v",oe=Pm(Y,Q)),!oe)return!1;if(!i.current&&"changedTouches"in b&&(S||A)&&(i.current=U),!U)return!0;var K=i.current||U;return Xj(K,j,b,K==="h"?S:A)},[]),x=p.useCallback(function(b){var j=b;if(!(!bs.length||bs[bs.length-1]!==d)){var N="deltaY"in j?Rm(j):Yl(j),P=a.current.filter(function(U){return U.name===j.type&&(U.target===j.target||j.target===U.shadowParent)&&qj(U.delta,N)})[0];if(P&&P.should){j.cancelable&&j.preventDefault();return}if(!P){var S=(f.current.shards||[]).map(_m).filter(Boolean).filter(function(U){return U.contains(j.target)}),A=S.length>0?m(j,S[0]):!f.current.noIsolation;A&&j.cancelable&&j.preventDefault()}}},[]),g=p.useCallback(function(b,j,N,P){var S={name:b,delta:j,target:N,should:P,shadowParent:tb(N)};a.current.push(S),setTimeout(function(){a.current=a.current.filter(function(A){return A!==S})},1)},[]),v=p.useCallback(function(b){l.current=Yl(b),i.current=void 0},[]),y=p.useCallback(function(b){g(b.type,Rm(b),b.target,m(b,r.lockRef.current))},[]),E=p.useCallback(function(b){g(b.type,Yl(b),b.target,m(b,r.lockRef.current))},[]);p.useEffect(function(){return bs.push(d),r.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:E}),document.addEventListener("wheel",x,js),document.addEventListener("touchmove",x,js),document.addEventListener("touchstart",v,js),function(){bs=bs.filter(function(b){return b!==d}),document.removeEventListener("wheel",x,js),document.removeEventListener("touchmove",x,js),document.removeEventListener("touchstart",v,js)}},[]);var k=r.removeScrollBar,C=r.inert;return p.createElement(p.Fragment,null,C?p.createElement(d,{styles:Jj(c)}):null,k?p.createElement(Vj,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function tb(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const nb=_j(Op,eb);var Tu=p.forwardRef(function(r,a){return p.createElement(ko,wn({},r,{ref:a,sideCar:nb}))});Tu.classNames=ko.classNames;var rb=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},Ss=new WeakMap,Xl=new WeakMap,ql={},Uc=0,Up=function(r){return r&&(r.host||Up(r.parentNode))},sb=function(r,a){return a.map(function(l){if(r.contains(l))return l;var i=Up(l);return i&&r.contains(i)?i:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},ab=function(r,a,l,i){var c=sb(a,Array.isArray(r)?r:[r]);ql[l]||(ql[l]=new WeakMap);var d=ql[l],f=[],m=new Set,x=new Set(c),g=function(y){!y||m.has(y)||(m.add(y),g(y.parentNode))};c.forEach(g);var v=function(y){!y||x.has(y)||Array.prototype.forEach.call(y.children,function(E){if(m.has(E))v(E);else try{var k=E.getAttribute(i),C=k!==null&&k!=="false",b=(Ss.get(E)||0)+1,j=(d.get(E)||0)+1;Ss.set(E,b),d.set(E,j),f.push(E),b===1&&C&&Xl.set(E,!0),j===1&&E.setAttribute(l,"true"),C||E.setAttribute(i,"true")}catch(N){console.error("aria-hidden: cannot operate on ",E,N)}})};return v(a),m.clear(),Uc++,function(){f.forEach(function(y){var E=Ss.get(y)-1,k=d.get(y)-1;Ss.set(y,E),d.set(y,k),E||(Xl.has(y)||y.removeAttribute(i),Xl.delete(y)),k||y.removeAttribute(l)}),Uc--,Uc||(Ss=new WeakMap,Ss=new WeakMap,Xl=new WeakMap,ql={})}},Vp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var i=Array.from(Array.isArray(r)?r:[r]),c=rb(r);return c?(i.push.apply(i,Array.from(c.querySelectorAll("[aria-live], script"))),ab(i,c,l,"aria-hidden")):function(){return null}},Eo="Dialog",[Wp]=jr(Eo),[lb,dn]=Wp(Eo),Hp=r=>{const{__scopeDialog:a,children:l,open:i,defaultOpen:c,onOpenChange:d,modal:f=!0}=r,m=p.useRef(null),x=p.useRef(null),[g,v]=Vr({prop:i,defaultProp:c??!1,onChange:d,caller:Eo});return n.jsx(lb,{scope:a,triggerRef:m,contentRef:x,contentId:gr(),titleId:gr(),descriptionId:gr(),open:g,onOpenChange:v,onOpenToggle:p.useCallback(()=>v(y=>!y),[v]),modal:f,children:l})};Hp.displayName=Eo;var Kp="DialogTrigger",ob=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(Kp,l),d=Ve(a,c.triggerRef);return n.jsx(Le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Mu(c.open),...i,ref:d,onClick:Ae(r.onClick,c.onOpenToggle)})});ob.displayName=Kp;var Iu="DialogPortal",[ib,Gp]=Wp(Iu,{forceMount:void 0}),Qp=r=>{const{__scopeDialog:a,forceMount:l,children:i,container:c}=r,d=dn(Iu,a);return n.jsx(ib,{scope:a,forceMount:l,children:p.Children.map(i,f=>n.jsx(Ma,{present:l||d.open,children:n.jsx(_u,{asChild:!0,container:c,children:f})}))})};Qp.displayName=Iu;var fo="DialogOverlay",Yp=p.forwardRef((r,a)=>{const l=Gp(fo,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=dn(fo,r.__scopeDialog);return d.modal?n.jsx(Ma,{present:i||d.open,children:n.jsx(ub,{...c,ref:a})}):null});Yp.displayName=fo;var cb=_a("DialogOverlay.RemoveScroll"),ub=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(fo,l);return n.jsx(Tu,{as:cb,allowPinchZoom:!0,shards:[c.contentRef],children:n.jsx(Le.div,{"data-state":Mu(c.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),Wr="DialogContent",Xp=p.forwardRef((r,a)=>{const l=Gp(Wr,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=dn(Wr,r.__scopeDialog);return n.jsx(Ma,{present:i||d.open,children:d.modal?n.jsx(db,{...c,ref:a}):n.jsx(fb,{...c,ref:a})})});Xp.displayName=Wr;var db=p.forwardRef((r,a)=>{const l=dn(Wr,r.__scopeDialog),i=p.useRef(null),c=Ve(a,l.contentRef,i);return p.useEffect(()=>{const d=i.current;if(d)return Vp(d)},[]),n.jsx(qp,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(r.onCloseAutoFocus,d=>{var f;d.preventDefault(),(f=l.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Ae(r.onPointerDownOutside,d=>{const f=d.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0;(f.button===2||m)&&d.preventDefault()}),onFocusOutside:Ae(r.onFocusOutside,d=>d.preventDefault())})}),fb=p.forwardRef((r,a)=>{const l=dn(Wr,r.__scopeDialog),i=p.useRef(!1),c=p.useRef(!1);return n.jsx(qp,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var f,m;(f=r.onCloseAutoFocus)==null||f.call(r,d),d.defaultPrevented||(i.current||(m=l.triggerRef.current)==null||m.focus(),d.preventDefault()),i.current=!1,c.current=!1},onInteractOutside:d=>{var x,g;(x=r.onInteractOutside)==null||x.call(r,d),d.defaultPrevented||(i.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=d.target;((g=l.triggerRef.current)==null?void 0:g.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),qp=p.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:i,onOpenAutoFocus:c,onCloseAutoFocus:d,...f}=r,m=dn(Wr,l),x=p.useRef(null),g=Ve(a,x);return Mp(),n.jsxs(n.Fragment,{children:[n.jsx(Ru,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:c,onUnmountAutoFocus:d,children:n.jsx(Pu,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Mu(m.open),...f,ref:g,onDismiss:()=>m.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(hb,{titleId:m.titleId}),n.jsx(pb,{contentRef:x,descriptionId:m.descriptionId})]})]})}),Au="DialogTitle",Jp=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(Au,l);return n.jsx(Le.h2,{id:c.titleId,...i,ref:a})});Jp.displayName=Au;var Zp="DialogDescription",ex=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(Zp,l);return n.jsx(Le.p,{id:c.descriptionId,...i,ref:a})});ex.displayName=Zp;var tx="DialogClose",nx=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(tx,l);return n.jsx(Le.button,{type:"button",...i,ref:a,onClick:Ae(r.onClick,()=>c.onOpenChange(!1))})});nx.displayName=tx;function Mu(r){return r?"open":"closed"}var rx="DialogTitleWarning",[zC,sx]=UN(rx,{contentName:Wr,titleName:Au,docsSlug:"dialog"}),hb=({titleId:r})=>{const a=sx(rx),l=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users. +`)},rb=0,bs=[];function sb(r){var a=x.useRef([]),l=x.useRef([0,0]),i=x.useRef(),c=x.useState(rb++)[0],d=x.useState(zp)[0],f=x.useRef(r);x.useEffect(function(){f.current=r},[r]),x.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var b=Cj([r.lockRef.current],(r.shards||[]).map(Tm),!0).filter(Boolean);return b.forEach(function(j){return j.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),b.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var m=x.useCallback(function(b,j){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!f.current.allowPinchZoom;var N=Yl(b),P=l.current,S="deltaX"in b?b.deltaX:P[0]-N[0],A="deltaY"in b?b.deltaY:P[1]-N[1],U,Q=b.target,Y=Math.abs(S)>Math.abs(A)?"h":"v";if("touches"in b&&Y==="h"&&Q.type==="range")return!1;var W=window.getSelection(),le=W&&W.anchorNode,de=le?le===Q||le.contains(Q):!1;if(de)return!1;var oe=Rm(Y,Q);if(!oe)return!0;if(oe?U=Y:(U=Y==="v"?"h":"v",oe=Rm(Y,Q)),!oe)return!1;if(!i.current&&"changedTouches"in b&&(S||A)&&(i.current=U),!U)return!0;var K=i.current||U;return eb(K,j,b,K==="h"?S:A)},[]),p=x.useCallback(function(b){var j=b;if(!(!bs.length||bs[bs.length-1]!==d)){var N="deltaY"in j?_m(j):Yl(j),P=a.current.filter(function(U){return U.name===j.type&&(U.target===j.target||j.target===U.shadowParent)&&tb(U.delta,N)})[0];if(P&&P.should){j.cancelable&&j.preventDefault();return}if(!P){var S=(f.current.shards||[]).map(Tm).filter(Boolean).filter(function(U){return U.contains(j.target)}),A=S.length>0?m(j,S[0]):!f.current.noIsolation;A&&j.cancelable&&j.preventDefault()}}},[]),g=x.useCallback(function(b,j,N,P){var S={name:b,delta:j,target:N,should:P,shadowParent:ab(N)};a.current.push(S),setTimeout(function(){a.current=a.current.filter(function(A){return A!==S})},1)},[]),v=x.useCallback(function(b){l.current=Yl(b),i.current=void 0},[]),y=x.useCallback(function(b){g(b.type,_m(b),b.target,m(b,r.lockRef.current))},[]),E=x.useCallback(function(b){g(b.type,Yl(b),b.target,m(b,r.lockRef.current))},[]);x.useEffect(function(){return bs.push(d),r.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:E}),document.addEventListener("wheel",p,js),document.addEventListener("touchmove",p,js),document.addEventListener("touchstart",v,js),function(){bs=bs.filter(function(b){return b!==d}),document.removeEventListener("wheel",p,js),document.removeEventListener("touchmove",p,js),document.removeEventListener("touchstart",v,js)}},[]);var k=r.removeScrollBar,C=r.inert;return x.createElement(x.Fragment,null,C?x.createElement(d,{styles:nb(c)}):null,k?x.createElement(Gj,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function ab(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const lb=Mj(Fp,sb);var Iu=x.forwardRef(function(r,a){return x.createElement(ko,wn({},r,{ref:a,sideCar:lb}))});Iu.classNames=ko.classNames;var ob=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},Ss=new WeakMap,Xl=new WeakMap,ql={},Uc=0,Vp=function(r){return r&&(r.host||Vp(r.parentNode))},ib=function(r,a){return a.map(function(l){if(r.contains(l))return l;var i=Vp(l);return i&&r.contains(i)?i:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},cb=function(r,a,l,i){var c=ib(a,Array.isArray(r)?r:[r]);ql[l]||(ql[l]=new WeakMap);var d=ql[l],f=[],m=new Set,p=new Set(c),g=function(y){!y||m.has(y)||(m.add(y),g(y.parentNode))};c.forEach(g);var v=function(y){!y||p.has(y)||Array.prototype.forEach.call(y.children,function(E){if(m.has(E))v(E);else try{var k=E.getAttribute(i),C=k!==null&&k!=="false",b=(Ss.get(E)||0)+1,j=(d.get(E)||0)+1;Ss.set(E,b),d.set(E,j),f.push(E),b===1&&C&&Xl.set(E,!0),j===1&&E.setAttribute(l,"true"),C||E.setAttribute(i,"true")}catch(N){console.error("aria-hidden: cannot operate on ",E,N)}})};return v(a),m.clear(),Uc++,function(){f.forEach(function(y){var E=Ss.get(y)-1,k=d.get(y)-1;Ss.set(y,E),d.set(y,k),E||(Xl.has(y)||y.removeAttribute(i),Xl.delete(y)),k||y.removeAttribute(l)}),Uc--,Uc||(Ss=new WeakMap,Ss=new WeakMap,Xl=new WeakMap,ql={})}},Wp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var i=Array.from(Array.isArray(r)?r:[r]),c=ob(r);return c?(i.push.apply(i,Array.from(c.querySelectorAll("[aria-live], script"))),cb(i,c,l,"aria-hidden")):function(){return null}},Eo="Dialog",[Hp]=jr(Eo),[ub,dn]=Hp(Eo),Kp=r=>{const{__scopeDialog:a,children:l,open:i,defaultOpen:c,onOpenChange:d,modal:f=!0}=r,m=x.useRef(null),p=x.useRef(null),[g,v]=Vr({prop:i,defaultProp:c??!1,onChange:d,caller:Eo});return n.jsx(ub,{scope:a,triggerRef:m,contentRef:p,contentId:gr(),titleId:gr(),descriptionId:gr(),open:g,onOpenChange:v,onOpenToggle:x.useCallback(()=>v(y=>!y),[v]),modal:f,children:l})};Kp.displayName=Eo;var Gp="DialogTrigger",db=x.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(Gp,l),d=Ve(a,c.triggerRef);return n.jsx(Le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Lu(c.open),...i,ref:d,onClick:Ae(r.onClick,c.onOpenToggle)})});db.displayName=Gp;var Au="DialogPortal",[fb,Qp]=Hp(Au,{forceMount:void 0}),Yp=r=>{const{__scopeDialog:a,forceMount:l,children:i,container:c}=r,d=dn(Au,a);return n.jsx(fb,{scope:a,forceMount:l,children:x.Children.map(i,f=>n.jsx(Ma,{present:l||d.open,children:n.jsx(Tu,{asChild:!0,container:c,children:f})}))})};Yp.displayName=Au;var fo="DialogOverlay",Xp=x.forwardRef((r,a)=>{const l=Qp(fo,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=dn(fo,r.__scopeDialog);return d.modal?n.jsx(Ma,{present:i||d.open,children:n.jsx(mb,{...c,ref:a})}):null});Xp.displayName=fo;var hb=_a("DialogOverlay.RemoveScroll"),mb=x.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(fo,l);return n.jsx(Iu,{as:hb,allowPinchZoom:!0,shards:[c.contentRef],children:n.jsx(Le.div,{"data-state":Lu(c.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),Wr="DialogContent",qp=x.forwardRef((r,a)=>{const l=Qp(Wr,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=dn(Wr,r.__scopeDialog);return n.jsx(Ma,{present:i||d.open,children:d.modal?n.jsx(pb,{...c,ref:a}):n.jsx(xb,{...c,ref:a})})});qp.displayName=Wr;var pb=x.forwardRef((r,a)=>{const l=dn(Wr,r.__scopeDialog),i=x.useRef(null),c=Ve(a,l.contentRef,i);return x.useEffect(()=>{const d=i.current;if(d)return Wp(d)},[]),n.jsx(Jp,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(r.onCloseAutoFocus,d=>{var f;d.preventDefault(),(f=l.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Ae(r.onPointerDownOutside,d=>{const f=d.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0;(f.button===2||m)&&d.preventDefault()}),onFocusOutside:Ae(r.onFocusOutside,d=>d.preventDefault())})}),xb=x.forwardRef((r,a)=>{const l=dn(Wr,r.__scopeDialog),i=x.useRef(!1),c=x.useRef(!1);return n.jsx(Jp,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var f,m;(f=r.onCloseAutoFocus)==null||f.call(r,d),d.defaultPrevented||(i.current||(m=l.triggerRef.current)==null||m.focus(),d.preventDefault()),i.current=!1,c.current=!1},onInteractOutside:d=>{var p,g;(p=r.onInteractOutside)==null||p.call(r,d),d.defaultPrevented||(i.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=d.target;((g=l.triggerRef.current)==null?void 0:g.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),Jp=x.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:i,onOpenAutoFocus:c,onCloseAutoFocus:d,...f}=r,m=dn(Wr,l),p=x.useRef(null),g=Ve(a,p);return Lp(),n.jsxs(n.Fragment,{children:[n.jsx(_u,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:c,onUnmountAutoFocus:d,children:n.jsx(Ru,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Lu(m.open),...f,ref:g,onDismiss:()=>m.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(gb,{titleId:m.titleId}),n.jsx(yb,{contentRef:p,descriptionId:m.descriptionId})]})]})}),Mu="DialogTitle",Zp=x.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(Mu,l);return n.jsx(Le.h2,{id:c.titleId,...i,ref:a})});Zp.displayName=Mu;var ex="DialogDescription",tx=x.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(ex,l);return n.jsx(Le.p,{id:c.descriptionId,...i,ref:a})});tx.displayName=ex;var nx="DialogClose",rx=x.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(nx,l);return n.jsx(Le.button,{type:"button",...i,ref:a,onClick:Ae(r.onClick,()=>c.onOpenChange(!1))})});rx.displayName=nx;function Lu(r){return r?"open":"closed"}var sx="DialogTitleWarning",[VC,ax]=KN(sx,{contentName:Wr,titleName:Mu,docsSlug:"dialog"}),gb=({titleId:r})=>{const a=ax(sx),l=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return p.useEffect(()=>{r&&(document.getElementById(r)||console.error(l))},[l,r]),null},mb="DialogDescriptionWarning",pb=({contentRef:r,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${sx(mb).contentName}}.`;return p.useEffect(()=>{var d;const c=(d=r.current)==null?void 0:d.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(i))},[i,r,a]),null},xb=Hp,gb=Qp,vb=Yp,yb=Xp,wb=Jp,Nb=ex,jb=nx;function Nn(r){return n.jsx(xb,{"data-slot":"dialog",...r})}function bb(r){return n.jsx(gb,{...r})}const ax=p.forwardRef(({className:r,...a},l)=>n.jsx(vb,{ref:l,className:We("fixed inset-0 z-50 bg-black/50",r),...a}));ax.displayName="DialogOverlay";const on=p.forwardRef(({className:r,children:a,showCloseButton:l=!0,...i},c)=>n.jsxs(bb,{children:[n.jsx(ax,{}),n.jsxs(yb,{ref:c,className:We("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border bg-background p-6 shadow-lg sm:max-w-lg",r),...i,children:[a,l&&n.jsxs(jb,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[n.jsx(Ur,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));on.displayName="DialogContent";function jn({className:r,...a}){return n.jsx("div",{className:We("flex flex-col gap-2 text-center sm:text-left",r),...a})}function zn({className:r,...a}){return n.jsx("div",{className:We("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function bn(r){return n.jsx(wb,{className:"text-lg font-semibold leading-none",...r})}function Sb(r){return n.jsx(Nb,{className:"text-sm text-muted-foreground",...r})}function Lu(r){const a=p.useRef({value:r,previous:r});return p.useMemo(()=>(a.current.value!==r&&(a.current.previous=a.current.value,a.current.value=r),a.current.previous),[r])}function Du(r){const[a,l]=p.useState(void 0);return Et(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const i=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let f,m;if("borderBoxSize"in d){const x=d.borderBoxSize,g=Array.isArray(x)?x[0]:x;f=g.inlineSize,m=g.blockSize}else f=r.offsetWidth,m=r.offsetHeight;l({width:f,height:m})});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else l(void 0)},[r]),a}var Po="Switch",[Cb]=jr(Po),[kb,Eb]=Cb(Po),lx=p.forwardRef((r,a)=>{const{__scopeSwitch:l,name:i,checked:c,defaultChecked:d,required:f,disabled:m,value:x="on",onCheckedChange:g,form:v,...y}=r,[E,k]=p.useState(null),C=Ve(a,S=>k(S)),b=p.useRef(!1),j=E?v||!!E.closest("form"):!0,[N,P]=Vr({prop:c,defaultProp:d??!1,onChange:g,caller:Po});return n.jsxs(kb,{scope:l,checked:N,disabled:m,children:[n.jsx(Le.button,{type:"button",role:"switch","aria-checked":N,"aria-required":f,"data-state":ux(N),"data-disabled":m?"":void 0,disabled:m,value:x,...y,ref:C,onClick:Ae(r.onClick,S=>{P(A=>!A),j&&(b.current=S.isPropagationStopped(),b.current||S.stopPropagation())})}),j&&n.jsx(cx,{control:E,bubbles:!b.current,name:i,value:x,checked:N,required:f,disabled:m,form:v,style:{transform:"translateX(-100%)"}})]})});lx.displayName=Po;var ox="SwitchThumb",ix=p.forwardRef((r,a)=>{const{__scopeSwitch:l,...i}=r,c=Eb(ox,l);return n.jsx(Le.span,{"data-state":ux(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a})});ix.displayName=ox;var Pb="SwitchBubbleInput",cx=p.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:i=!0,...c},d)=>{const f=p.useRef(null),m=Ve(f,d),x=Lu(l),g=Du(a);return p.useEffect(()=>{const v=f.current;if(!v)return;const y=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(y,"checked").set;if(x!==l&&k){const C=new Event("click",{bubbles:i});k.call(v,l),v.dispatchEvent(C)}},[x,l,i]),n.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:m,style:{...c.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});cx.displayName=Pb;function ux(r){return r?"checked":"unchecked"}var dx=lx,Rb=ix;const ht=p.forwardRef(({className:r,...a},l)=>n.jsx(dx,{className:We("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a1628] disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-gray-600 data-[state=checked]:bg-[#38bdac]",r),...a,ref:l,children:n.jsx(Rb,{className:We("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));ht.displayName=dx.displayName;function Ou(r){const a=r+"CollectionProvider",[l,i]=jr(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=b=>{const{scope:j,children:N}=b,P=fr.useRef(null),S=fr.useRef(new Map).current;return n.jsx(c,{scope:j,itemMap:S,collectionRef:P,children:N})};f.displayName=a;const m=r+"CollectionSlot",x=_a(m),g=fr.forwardRef((b,j)=>{const{scope:N,children:P}=b,S=d(m,N),A=Ve(j,S.collectionRef);return n.jsx(x,{ref:A,children:P})});g.displayName=m;const v=r+"CollectionItemSlot",y="data-radix-collection-item",E=_a(v),k=fr.forwardRef((b,j)=>{const{scope:N,children:P,...S}=b,A=fr.useRef(null),U=Ve(j,A),Q=d(v,N);return fr.useEffect(()=>(Q.itemMap.set(A,{ref:A,...S}),()=>void Q.itemMap.delete(A))),n.jsx(E,{[y]:"",ref:U,children:P})});k.displayName=v;function C(b){const j=d(r+"CollectionConsumer",b);return fr.useCallback(()=>{const P=j.collectionRef.current;if(!P)return[];const S=Array.from(P.querySelectorAll(`[${y}]`));return Array.from(j.itemMap.values()).sort((Q,Y)=>S.indexOf(Q.ref.current)-S.indexOf(Y.ref.current))},[j.collectionRef,j.itemMap])}return[{Provider:f,Slot:g,ItemSlot:k},C,i]}var _b=p.createContext(void 0);function Ro(r){const a=p.useContext(_b);return r||a||"ltr"}var Vc="rovingFocusGroup.onEntryFocus",Tb={bubbles:!1,cancelable:!0},La="RovingFocusGroup",[ou,fx,Ib]=Ou(La),[Ab,hx]=jr(La,[Ib]),[Mb,Lb]=Ab(La),mx=p.forwardRef((r,a)=>n.jsx(ou.Provider,{scope:r.__scopeRovingFocusGroup,children:n.jsx(ou.Slot,{scope:r.__scopeRovingFocusGroup,children:n.jsx(Db,{...r,ref:a})})}));mx.displayName=La;var Db=p.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:i,loop:c=!1,dir:d,currentTabStopId:f,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:x,onEntryFocus:g,preventScrollOnEntryFocus:v=!1,...y}=r,E=p.useRef(null),k=Ve(a,E),C=Ro(d),[b,j]=Vr({prop:f,defaultProp:m??null,onChange:x,caller:La}),[N,P]=p.useState(!1),S=vr(g),A=fx(l),U=p.useRef(!1),[Q,Y]=p.useState(0);return p.useEffect(()=>{const W=E.current;if(W)return W.addEventListener(Vc,S),()=>W.removeEventListener(Vc,S)},[S]),n.jsx(Mb,{scope:l,orientation:i,dir:C,loop:c,currentTabStopId:b,onItemFocus:p.useCallback(W=>j(W),[j]),onItemShiftTab:p.useCallback(()=>P(!0),[]),onFocusableItemAdd:p.useCallback(()=>Y(W=>W+1),[]),onFocusableItemRemove:p.useCallback(()=>Y(W=>W-1),[]),children:n.jsx(Le.div,{tabIndex:N||Q===0?-1:0,"data-orientation":i,...y,ref:k,style:{outline:"none",...r.style},onMouseDown:Ae(r.onMouseDown,()=>{U.current=!0}),onFocus:Ae(r.onFocus,W=>{const le=!U.current;if(W.target===W.currentTarget&&le&&!N){const de=new CustomEvent(Vc,Tb);if(W.currentTarget.dispatchEvent(de),!de.defaultPrevented){const oe=A().filter(V=>V.focusable),K=oe.find(V=>V.active),R=oe.find(V=>V.id===b),X=[K,R,...oe].filter(Boolean).map(V=>V.ref.current);gx(X,v)}}U.current=!1}),onBlur:Ae(r.onBlur,()=>P(!1))})})}),px="RovingFocusGroupItem",xx=p.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:i=!0,active:c=!1,tabStopId:d,children:f,...m}=r,x=gr(),g=d||x,v=Lb(px,l),y=v.currentTabStopId===g,E=fx(l),{onFocusableItemAdd:k,onFocusableItemRemove:C,currentTabStopId:b}=v;return p.useEffect(()=>{if(i)return k(),()=>C()},[i,k,C]),n.jsx(ou.ItemSlot,{scope:l,id:g,focusable:i,active:c,children:n.jsx(Le.span,{tabIndex:y?0:-1,"data-orientation":v.orientation,...m,ref:a,onMouseDown:Ae(r.onMouseDown,j=>{i?v.onItemFocus(g):j.preventDefault()}),onFocus:Ae(r.onFocus,()=>v.onItemFocus(g)),onKeyDown:Ae(r.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){v.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const N=zb(j,v.orientation,v.dir);if(N!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let S=E().filter(A=>A.focusable).map(A=>A.ref.current);if(N==="last")S.reverse();else if(N==="prev"||N==="next"){N==="prev"&&S.reverse();const A=S.indexOf(j.currentTarget);S=v.loop?$b(S,A+1):S.slice(A+1)}setTimeout(()=>gx(S))}}),children:typeof f=="function"?f({isCurrentTabStop:y,hasTabStop:b!=null}):f})})});xx.displayName=px;var Ob={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Fb(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function zb(r,a,l){const i=Fb(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return Ob[i]}function gx(r,a=!1){const l=document.activeElement;for(const i of r)if(i===l||(i.focus({preventScroll:a}),document.activeElement!==l))return}function $b(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var Bb=mx,Ub=xx,_o="Tabs",[Vb]=jr(_o,[hx]),vx=hx(),[Wb,Fu]=Vb(_o),yx=p.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,onValueChange:c,defaultValue:d,orientation:f="horizontal",dir:m,activationMode:x="automatic",...g}=r,v=Ro(m),[y,E]=Vr({prop:i,onChange:c,defaultProp:d??"",caller:_o});return n.jsx(Wb,{scope:l,baseId:gr(),value:y,onValueChange:E,orientation:f,dir:v,activationMode:x,children:n.jsx(Le.div,{dir:v,"data-orientation":f,...g,ref:a})})});yx.displayName=_o;var wx="TabsList",Nx=p.forwardRef((r,a)=>{const{__scopeTabs:l,loop:i=!0,...c}=r,d=Fu(wx,l),f=vx(l);return n.jsx(Bb,{asChild:!0,...f,orientation:d.orientation,dir:d.dir,loop:i,children:n.jsx(Le.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});Nx.displayName=wx;var jx="TabsTrigger",bx=p.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,disabled:c=!1,...d}=r,f=Fu(jx,l),m=vx(l),x=kx(f.baseId,i),g=Ex(f.baseId,i),v=i===f.value;return n.jsx(Ub,{asChild:!0,...m,focusable:!c,active:v,children:n.jsx(Le.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":g,"data-state":v?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:x,...d,ref:a,onMouseDown:Ae(r.onMouseDown,y=>{!c&&y.button===0&&y.ctrlKey===!1?f.onValueChange(i):y.preventDefault()}),onKeyDown:Ae(r.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&f.onValueChange(i)}),onFocus:Ae(r.onFocus,()=>{const y=f.activationMode!=="manual";!v&&!c&&y&&f.onValueChange(i)})})})});bx.displayName=jx;var Sx="TabsContent",Cx=p.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,forceMount:c,children:d,...f}=r,m=Fu(Sx,l),x=kx(m.baseId,i),g=Ex(m.baseId,i),v=i===m.value,y=p.useRef(v);return p.useEffect(()=>{const E=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(E)},[]),n.jsx(Ma,{present:c||v,children:({present:E})=>n.jsx(Le.div,{"data-state":v?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":x,hidden:!E,id:g,tabIndex:0,...f,ref:a,style:{...r.style,animationDuration:y.current?"0s":void 0},children:E&&d})})});Cx.displayName=Sx;function kx(r,a){return`${r}-trigger-${a}`}function Ex(r,a){return`${r}-content-${a}`}var Hb=yx,Px=Nx,Rx=bx,_x=Cx;const zu=Hb,To=p.forwardRef(({className:r,...a},l)=>n.jsx(Px,{ref:l,className:We("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));To.displayName=Px.displayName;const Xt=p.forwardRef(({className:r,...a},l)=>n.jsx(Rx,{ref:l,className:We("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",r),...a}));Xt.displayName=Rx.displayName;const qt=p.forwardRef(({className:r,...a},l)=>n.jsx(_x,{ref:l,className:We("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...a}));qt.displayName=_x.displayName;function Kb({open:r,onClose:a,userId:l,onUserUpdated:i}){var V;const[c,d]=p.useState(null),[f,m]=p.useState([]),[x,g]=p.useState([]),[v,y]=p.useState(!1),[E,k]=p.useState(!1),[C,b]=p.useState(!1),[j,N]=p.useState("info"),[P,S]=p.useState(""),[A,U]=p.useState(""),[Q,Y]=p.useState([]),[W,le]=p.useState("");p.useEffect(()=>{r&&l&&de()},[r,l]);async function de(){if(l){y(!0);try{const B=await Ye(`/api/db/users?id=${encodeURIComponent(l)}`);if(B!=null&&B.success&&B.user){const T=B.user;d(T),S(T.phone||""),U(T.nickname||""),Y(typeof T.tags=="string"?JSON.parse(T.tags||"[]"):[])}try{const T=await Ye(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);T!=null&&T.success&&T.tracks&&m(T.tracks)}catch{m([])}try{const T=await Ye(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);T!=null&&T.success&&T.referrals&&g(T.referrals)}catch{g([])}}catch(B){console.error("Load user detail error:",B)}finally{y(!1)}}}async function oe(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}k(!0);try{const B=await kt("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});B!=null&&B.success?(alert("同步成功"),de()):alert("同步失败: "+(B==null?void 0:B.error))}catch(B){console.error("Sync CKB error:",B),alert("同步失败")}finally{k(!1)}}async function K(){if(c){b(!0);try{const B=await Un("/api/db/users",{id:c.id,phone:P||void 0,nickname:A||void 0,tags:JSON.stringify(Q)});B!=null&&B.success?(alert("保存成功"),de(),i==null||i()):alert("保存失败: "+(B==null?void 0:B.error))}catch(B){console.error("Save user error:",B),alert("保存失败")}finally{b(!1)}}}const R=()=>{W&&!Q.includes(W)&&(Y([...Q,W]),le(""))},H=B=>{Y(Q.filter(T=>T!==B))},X=B=>{const J={view_chapter:_s,purchase:tu,match:kn,login:Zl,register:Zl,share:ks,bind_phone:i1,bind_wechat:t1}[B]||sm;return n.jsx(J,{className:"w-4 h-4"})};return r?n.jsx(Nn,{open:r,onOpenChange:()=>a(),children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(Zl,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"})]})}),v?n.jsxs("div",{className:"flex items-center justify-center py-20",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):c?n.jsxs("div",{className:"flex flex-col h-[70vh]",children:[n.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-4",children:[n.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac]",children:c.avatar?n.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((V=c.nickname)==null?void 0:V.charAt(0))||"?"}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h3",{className:"text-lg font-bold text-white",children:c.nickname}),c.isAdmin&&n.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"})]}),n.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechatId&&` · 💬 ${c.wechatId}`]}),n.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["ID: ",c.id," · 推广码: ",c.referralCode??"-"]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-[#38bdac] font-bold",children:["¥",(c.earnings||0).toFixed(2)]}),n.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"})]})]}),n.jsxs(zu,{value:j,onValueChange:N,className:"flex-1 flex flex-col overflow-hidden",children:[n.jsxs(To,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-4",children:[n.jsx(Xt,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"基础信息"}),n.jsx(Xt,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"标签体系"}),n.jsx(Xt,{value:"tracks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"行为轨迹"}),n.jsx(Xt,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"关系链路"})]}),n.jsxs(qt,{value:"info",className:"flex-1 overflow-auto space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"手机号"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:P,onChange:B=>S(B.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"昵称"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:A,onChange:B=>U(B.target.value)})]})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"推荐人数"}),n.jsx("p",{className:"text-2xl font-bold text-white",children:c.referralCount??0})]}),n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"待提现"}),n.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["¥",(c.pendingEarnings??0).toFixed(2)]})]}),n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"创建时间"}),n.jsx("p",{className:"text-sm text-white",children:c.createdAt?new Date(c.createdAt).toLocaleDateString():"-"})]})]}),n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ks,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),n.jsx(pe,{size:"sm",onClick:oe,disabled:E||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-1"})," 同步数据"]})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500",children:"同步状态:"}),c.ckbSyncedAt?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):n.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 ml-1",children:"未同步"})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500",children:"最后同步:"}),n.jsx("span",{className:"text-gray-300 ml-1",children:c.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),n.jsx(qt,{value:"tags",className:"flex-1 overflow-auto space-y-4",children:n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(j1,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-white font-medium",children:"系统标签"})]}),n.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[Q.map((B,T)=>n.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[B,n.jsx("button",{type:"button",onClick:()=>H(B),className:"ml-1 hover:text-red-400",children:n.jsx(Ur,{className:"w-3 h-3"})})]},T)),Q.length===0&&n.jsx("span",{className:"text-gray-500 text-sm",children:"暂无标签"})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ue,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"添加新标签",value:W,onChange:B=>le(B.target.value),onKeyDown:B=>B.key==="Enter"&&R()}),n.jsx(pe,{onClick:R,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})}),n.jsx(qt,{value:"tracks",className:"flex-1 overflow-auto",children:n.jsx("div",{className:"space-y-2",children:f.length>0?f.map(B=>n.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:X(B.action)}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-white font-medium",children:B.actionLabel}),B.chapterTitle&&n.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",B.chapterTitle]})]}),n.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[n.jsx(lp,{className:"w-3 h-3 inline mr-1"}),B.timeAgo," · ",new Date(B.createdAt).toLocaleString()]})]})]},B.id)):n.jsxs("div",{className:"text-center py-12",children:[n.jsx(sm,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),n.jsx("p",{className:"text-gray-400",children:"暂无行为轨迹"})]})})}),n.jsx(qt,{value:"relations",className:"flex-1 overflow-auto space-y-4",children:n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ks,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-white font-medium",children:"推荐的用户"})]}),n.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:["共 ",x.length," 人"]})]}),n.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:x.length>0?x.map((B,T)=>{var q;const J=B;return n.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#162840] rounded",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-6 h-6 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:((q=J.nickname)==null?void 0:q.charAt(0))||"?"}),n.jsx("span",{className:"text-white text-sm",children:J.nickname})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[J.status==="vip"&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),n.jsx("span",{className:"text-gray-500 text-xs",children:J.createdAt?new Date(J.createdAt).toLocaleDateString():""})]})]},J.id||T)}):n.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})})]}),n.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-700 mt-4",children:[n.jsxs(pe,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ur,{className:"w-4 h-4 mr-2"}),"关闭"]}),n.jsxs(pe,{onClick:K,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),C?"保存中...":"保存修改"]})]})]}):n.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}function Gb(){var ne,he,Ee,Se,Te;const[r,a]=p.useState([]),[l,i]=p.useState(""),[c,d]=p.useState(!0),[,f]=p.useState(null),[m,x]=p.useState(!1),[g,v]=p.useState(!1),[y,E]=p.useState(null),[k,C]=p.useState(""),[b,j]=p.useState(""),[N,P]=p.useState(!1),[S,A]=p.useState(!1),[U,Q]=p.useState({referrals:[],stats:{}}),[Y,W]=p.useState(!1),[le,de]=p.useState(null),[oe,K]=p.useState(!1),[R,H]=p.useState(null),[X,V]=p.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1});async function B(){d(!0),f(null);try{const z=await Ye("/api/db/users");z!=null&&z.success?a(z.users||[]):f((z==null?void 0:z.error)||"加载失败")}catch(z){console.error("Load users error:",z),f("网络错误,请检查连接")}finally{d(!1)}}p.useEffect(()=>{B()},[]);const T=r.filter(z=>(z.nickname||"").includes(l)||(z.phone||"").includes(l));async function J(z){if(confirm("确定要删除这个用户吗?"))try{const Ie=await L1(`/api/db/users?id=${encodeURIComponent(z)}`);Ie!=null&&Ie.success?B():alert("删除失败: "+((Ie==null?void 0:Ie.error)||"未知错误"))}catch(Ie){console.error("Delete user error:",Ie),alert("删除失败")}}const q=z=>{E(z),V({phone:z.phone||"",nickname:z.nickname||"",password:"",isAdmin:!!(z.isAdmin??!1),hasFullBook:!!(z.hasFullBook??!1)}),x(!0)},L=()=>{E(null),V({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),x(!0)};async function G(){if(!X.phone||!X.nickname){alert("请填写手机号和昵称");return}P(!0);try{if(y){const z=await Un("/api/db/users",{id:y.id,nickname:X.nickname,isAdmin:X.isAdmin,hasFullBook:X.hasFullBook,...X.password&&{password:X.password}});if(!(z!=null&&z.success)){alert("更新失败: "+((z==null?void 0:z.error)||"未知错误"));return}}else{const z=await kt("/api/db/users",{phone:X.phone,nickname:X.nickname,password:X.password,isAdmin:X.isAdmin});if(!(z!=null&&z.success)){alert("创建失败: "+((z==null?void 0:z.error)||"未知错误"));return}}x(!1),B()}catch(z){console.error("Save user error:",z),alert("保存失败")}finally{P(!1)}}const fe=z=>{E(z),C(""),j(""),v(!0)};async function se(z){de(z),A(!0),W(!0);try{const Ie=await Ye(`/api/db/users/referrals?userId=${encodeURIComponent(z.id)}`);Ie!=null&&Ie.success?Q({referrals:Ie.referrals||[],stats:Ie.stats||{}}):Q({referrals:[],stats:{}})}catch(Ie){console.error("Load referrals error:",Ie),Q({referrals:[],stats:{}})}finally{W(!1)}}const be=z=>{H(z.id),K(!0)};async function je(){if(!k){alert("请输入新密码");return}if(k!==b){alert("两次输入的密码不一致");return}if(k.length<6){alert("密码长度不能少于6位");return}P(!0);try{const z=await Un("/api/db/users",{id:y==null?void 0:y.id,password:k});z!=null&&z.success?(alert("密码修改成功"),v(!1)):alert("密码修改失败: "+((z==null?void 0:z.error)||"未知错误"))}catch(z){console.error("Change password error:",z),alert("密码修改失败")}finally{P(!1)}}return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"用户管理"}),n.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",r.length," 位注册用户"]})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs(pe,{variant:"outline",onClick:B,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]}),n.jsxs("div",{className:"relative",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),n.jsx(ue,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:l,onChange:z=>i(z.target.value)})]}),n.jsxs(pe,{onClick:L,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(um,{className:"w-4 h-4 mr-2"}),"添加用户"]})]})]}),n.jsx(Nn,{open:m,onOpenChange:x,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[y?n.jsx(Ts,{className:"w-5 h-5 text-[#38bdac]"}):n.jsx(um,{className:"w-5 h-5 text-[#38bdac]"}),y?"编辑用户":"添加用户"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"手机号"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:X.phone,onChange:z=>V({...X,phone:z.target.value}),disabled:!!y})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"昵称"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:X.nickname,onChange:z=>V({...X,nickname:z.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:y?"新密码 (留空则不修改)":"密码"}),n.jsx(ue,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:y?"留空则不修改":"请输入密码",value:X.password,onChange:z=>V({...X,password:z.target.value})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ae,{className:"text-gray-300",children:"管理员权限"}),n.jsx(ht,{checked:X.isAdmin,onCheckedChange:z=>V({...X,isAdmin:z})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ae,{className:"text-gray-300",children:"已购全书"}),n.jsx(ht,{checked:X.hasFullBook,onCheckedChange:z=>V({...X,hasFullBook:z})})]})]}),n.jsxs(zn,{children:[n.jsxs(pe,{variant:"outline",onClick:()=>x(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ur,{className:"w-4 h-4 mr-2"}),"取消"]}),n.jsxs(pe,{onClick:G,disabled:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),N?"保存中...":"保存"]})]})]})}),n.jsx(Nn,{open:g,onOpenChange:v,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(lm,{className:"w-5 h-5 text-[#38bdac]"}),"修改密码"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3",children:[n.jsxs("p",{className:"text-gray-400 text-sm",children:["用户:",y==null?void 0:y.nickname]}),n.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",y==null?void 0:y.phone]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"新密码"}),n.jsx(ue,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:k,onChange:z=>C(z.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"确认密码"}),n.jsx(ue,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:b,onChange:z=>j(z.target.value)})]})]}),n.jsxs(zn,{children:[n.jsx(pe,{variant:"outline",onClick:()=>v(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(pe,{onClick:je,disabled:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:N?"保存中...":"确认修改"})]})]})}),n.jsx(Kb,{open:oe,onClose:()=>K(!1),userId:R,onUserUpdated:B}),n.jsx(Nn,{open:S,onOpenChange:A,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(kn,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系详情 - ",le==null?void 0:le.nickname]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[n.jsx("div",{className:"text-2xl font-bold text-[#38bdac]",children:((ne=U.stats)==null?void 0:ne.total)||0}),n.jsx("div",{className:"text-xs text-gray-400",children:"绑定总数"})]}),n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[n.jsx("div",{className:"text-2xl font-bold text-green-400",children:((he=U.stats)==null?void 0:he.purchased)||0}),n.jsx("div",{className:"text-xs text-gray-400",children:"已付费"})]}),n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[n.jsxs("div",{className:"text-2xl font-bold text-yellow-400",children:["¥",(((Ee=U.stats)==null?void 0:Ee.earnings)||0).toFixed(2)]}),n.jsx("div",{className:"text-xs text-gray-400",children:"累计收益"})]}),n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[n.jsxs("div",{className:"text-2xl font-bold text-orange-400",children:["¥",(((Se=U.stats)==null?void 0:Se.pendingEarnings)||0).toFixed(2)]}),n.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),Y?n.jsxs("div",{className:"flex items-center justify-center py-8",children:[n.jsx(Ze,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((Te=U.referrals)==null?void 0:Te.length)??0)>0?n.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(U.referrals??[]).map((z,Ie)=>{var Nt;const ze=z;return n.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg p-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:((Nt=ze.nickname)==null?void 0:Nt.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-white text-sm",children:ze.nickname}),n.jsx("div",{className:"text-xs text-gray-500",children:ze.phone||(ze.hasOpenId?"微信用户":"未绑定")})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[ze.status==="vip"&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),ze.status==="paid"&&n.jsxs(Oe,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",ze.purchasedSections,"章"]}),ze.status==="free"&&n.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),n.jsx("span",{className:"text-xs text-gray-500",children:ze.createdAt?new Date(ze.createdAt).toLocaleDateString():""})]})]},ze.id||Ie)})}):n.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),n.jsx(zn,{children:n.jsx(pe,{variant:"outline",onClick:()=>A(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(_e,{className:"p-0",children:c?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsxs(bo,{children:[n.jsx(So,{children:n.jsxs($n,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(et,{className:"text-gray-400",children:"用户信息"}),n.jsx(et,{className:"text-gray-400",children:"绑定信息"}),n.jsx(et,{className:"text-gray-400",children:"购买状态"}),n.jsx(et,{className:"text-gray-400",children:"分销收益"}),n.jsx(et,{className:"text-gray-400",children:"推广码"}),n.jsx(et,{className:"text-gray-400",children:"注册时间"}),n.jsx(et,{className:"text-right text-gray-400",children:"操作"})]})}),n.jsxs(Co,{children:[T.map(z=>{var Ie,ze,Nt;return n.jsxs($n,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsx(Qe,{children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:z.avatar?n.jsx("img",{src:z.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Ie=z.nickname)==null?void 0:Ie.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("p",{className:"font-medium text-white",children:z.nickname}),z.isAdmin&&n.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),z.openId&&!((ze=z.id)!=null&&ze.startsWith("user_"))&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0 text-xs",children:"微信"})]}),n.jsx("p",{className:"text-xs text-gray-500 font-mono",children:z.openId?z.openId.slice(0,12)+"...":(Nt=z.id)==null?void 0:Nt.slice(0,12)})]})]})}),n.jsx(Qe,{children:n.jsxs("div",{className:"space-y-1",children:[z.phone&&n.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[n.jsx("span",{className:"text-gray-500",children:"📱"}),n.jsx("span",{className:"text-gray-300",children:z.phone})]}),z.wechatId&&n.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[n.jsx("span",{className:"text-gray-500",children:"💬"}),n.jsx("span",{className:"text-gray-300",children:z.wechatId})]}),z.openId&&n.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[n.jsx("span",{className:"text-gray-500",children:"🔗"}),n.jsxs("span",{className:"text-gray-500 truncate max-w-[100px]",title:z.openId,children:[z.openId.slice(0,12),"..."]})]}),!z.phone&&!z.wechatId&&!z.openId&&n.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),n.jsx(Qe,{children:z.hasFullBook?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"全书已购"}):n.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),n.jsx(Qe,{children:n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(z.earnings||0)).toFixed(2)]}),parseFloat(String(z.pendingEarnings||0))>0&&n.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(z.pendingEarnings||0)).toFixed(2)]}),n.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>se(z),onKeyDown:Vt=>Vt.key==="Enter"&&se(z),role:"button",tabIndex:0,children:[n.jsx(kn,{className:"w-3 h-3"}),"绑定",z.referralCount||0,"人"]})]})}),n.jsx(Qe,{children:n.jsx("code",{className:"text-[#38bdac] text-xs bg-[#38bdac]/10 px-2 py-0.5 rounded",children:z.referralCode||"-"})}),n.jsx(Qe,{className:"text-gray-400",children:z.createdAt?new Date(z.createdAt).toLocaleDateString():"-"}),n.jsx(Qe,{className:"text-right",children:n.jsxs("div",{className:"flex items-center justify-end gap-1",children:[n.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>be(z),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:n.jsx(Cu,{className:"w-4 h-4"})}),n.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>q(z),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:n.jsx(Ts,{className:"w-4 h-4"})}),n.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>fe(z),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:n.jsx(lm,{className:"w-4 h-4"})}),n.jsx(pe,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>J(z.id),title:"删除",children:n.jsx(up,{className:"w-4 h-4"})})]})})]},z.id)}),T.length===0&&n.jsx($n,{children:n.jsx(Qe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]})})})]})}function Qb(){const[r,a]=p.useState("overview"),[l,i]=p.useState([]),[c,d]=p.useState(null),[f,m]=p.useState([]),[x,g]=p.useState([]),[v,y]=p.useState([]),[E,k]=p.useState(!0),[C,b]=p.useState(""),[j,N]=p.useState("all"),[P,S]=p.useState(new Set);p.useEffect(()=>{A()},[]),p.useEffect(()=>{U(r)},[r]);async function A(){try{const R=await Ye("/api/admin/distribution/overview");R!=null&&R.success&&R.overview&&d(R.overview)}catch(R){console.error("[Admin] 概览接口异常:",R)}try{const R=await Ye("/api/db/users");y((R==null?void 0:R.users)||[])}catch(R){console.error("[Admin] 用户数据加载失败:",R)}}async function U(R,H=!1){if(!(!H&&P.has(R))){k(!0);try{const X=v;switch(R){case"overview":break;case"orders":{try{const V=await Ye("/api/orders");if(V!=null&&V.success&&V.orders){const B=V.orders.map(T=>{const J=X.find(L=>L.id===T.userId),q=T.referrerId?X.find(L=>L.id===T.referrerId):null;return{...T,amount:parseFloat(String(T.amount))||0,userNickname:(J==null?void 0:J.nickname)||T.userNickname||"未知用户",userPhone:(J==null?void 0:J.phone)||T.userPhone||"-",referrerNickname:(q==null?void 0:q.nickname)||null,referrerCode:(q==null?void 0:q.referralCode)??null,type:T.productType||T.type}});i(B)}else i([])}catch{i([])}break}case"bindings":{try{const V=await Ye("/api/db/distribution");m((V==null?void 0:V.bindings)||[])}catch{m([])}break}case"withdrawals":{try{const V=await Ye("/api/admin/withdrawals");if(V!=null&&V.success&&V.withdrawals){const B=V.withdrawals.map(T=>({...T,account:T.account??"未绑定微信号",status:T.status==="success"?"completed":T.status==="failed"?"rejected":T.status}));g(B)}else V!=null&&V.success||alert(`获取提现记录失败: ${(V==null?void 0:V.error)||"未知错误"}`),g([])}catch(V){console.error(V),alert("加载提现数据失败"),g([])}break}}S(V=>new Set(V).add(R))}catch(X){console.error(X)}finally{k(!1)}}}async function Q(){S(R=>{const H=new Set(R);return H.delete(r),H}),r==="overview"&&A(),await U(r,!0)}async function Y(R){if(confirm("确认审核通过并打款?"))try{const H=await Un("/api/admin/withdrawals",{id:R,action:"approve"});if(!(H!=null&&H.success)){alert((H==null?void 0:H.error)||"操作失败");return}await Q()}catch(H){console.error(H),alert("操作失败")}}async function W(R){const H=prompt("请输入拒绝原因:");if(H)try{const X=await Un("/api/admin/withdrawals",{id:R,action:"reject",errorMessage:H});if(!(X!=null&&X.success)){alert((X==null?void 0:X.error)||"操作失败");return}await Q()}catch(X){console.error(X),alert("操作失败")}}function le(R){const H={active:"bg-green-500/20 text-green-400",converted:"bg-blue-500/20 text-blue-400",expired:"bg-gray-500/20 text-gray-400",cancelled:"bg-red-500/20 text-red-400",pending:"bg-orange-500/20 text-orange-400",processing:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400"},X={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return n.jsx(Oe,{className:`${H[R]||"bg-gray-500/20 text-gray-400"} border-0`,children:X[R]||R})}const de=f.filter(R=>{var H,X,V,B;if(j!=="all"&&R.status!==j)return!1;if(C){const T=C.toLowerCase();return((H=R.refereeNickname)==null?void 0:H.toLowerCase().includes(T))||((X=R.refereePhone)==null?void 0:X.includes(T))||((V=R.referrerName)==null?void 0:V.toLowerCase().includes(T))||((B=R.referrerCode)==null?void 0:B.toLowerCase().includes(T))}return!0}),oe=x.filter(R=>{var H,X;if(j!=="all"&&R.status!==j)return!1;if(C){const V=C.toLowerCase();return((H=R.userName)==null?void 0:H.toLowerCase().includes(V))||((X=R.account)==null?void 0:X.toLowerCase().includes(V))}return!0}),K=l.filter(R=>{var H,X,V,B,T,J;if(j!=="all"&&R.status!==j)return!1;if(C){const q=C.toLowerCase();return((H=R.id)==null?void 0:H.toLowerCase().includes(q))||((X=R.userNickname)==null?void 0:X.toLowerCase().includes(q))||((V=R.userPhone)==null?void 0:V.includes(q))||((B=R.sectionTitle)==null?void 0:B.toLowerCase().includes(q))||((T=R.chapterTitle)==null?void 0:T.toLowerCase().includes(q))||((J=R.bookName)==null?void 0:J.toLowerCase().includes(q))||R.referrerCode&&R.referrerCode.toLowerCase().includes(q)||R.referrerNickname&&R.referrerNickname.toLowerCase().includes(q)}return!0});return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white",children:"交易中心"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),n.jsxs(pe,{onClick:Q,disabled:E,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${E?"animate-spin":""}`}),"刷新数据"]})]}),n.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4",children:[{key:"overview",label:"数据概览",icon:nu},{key:"orders",label:"订单管理",icon:lo},{key:"bindings",label:"绑定管理",icon:ks},{key:"withdrawals",label:"提现审核",icon:Is}].map(R=>n.jsxs("button",{type:"button",onClick:()=>{a(R.key),N("all"),b("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===R.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[n.jsx(R.icon,{className:"w-4 h-4"}),R.label]},R.key))}),E?n.jsxs("div",{className:"flex items-center justify-center py-20",children:[n.jsx(Ze,{className:"w-8 h-8 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsxs(n.Fragment,{children:[r==="overview"&&c&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),n.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks})]}),n.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:n.jsx(Cu,{className:"w-6 h-6 text-blue-400"})})]})})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),n.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),n.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:n.jsx(ks,{className:"w-6 h-6 text-green-400"})})]})})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),n.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),n.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:n.jsx(Jc,{className:"w-6 h-6 text-purple-400"})})]})})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),n.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),n.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:n.jsx(lo,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(Re,{className:"bg-orange-500/10 border-orange-500/30",children:n.jsx(_e,{className:"p-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:n.jsx(lp,{className:"w-6 h-6 text-orange-400"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),n.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),n.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期,需关注转化"})]})]})})}),n.jsx(Re,{className:"bg-blue-500/10 border-blue-500/30",children:n.jsx(_e,{className:"p-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:n.jsx(Is,{className:"w-6 h-6 text-blue-400"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),n.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),n.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),n.jsx(pe,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Ue,{children:n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(qc,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),n.jsx(_e,{children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),n.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Ue,{children:n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(nu,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),n.jsxs(_e,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),n.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),n.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[n.jsx("span",{className:"text-gray-300",children:"点击转化率"}),n.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Ue,{children:n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(kn,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),n.jsx(_e,{children:n.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[n.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),n.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[n.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),n.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[n.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),n.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[n.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),n.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),r==="orders"&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),n.jsx(ue,{value:C,onChange:R=>b(R.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:j,onChange:R=>N(R.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[n.jsx("option",{value:"all",children:"全部状态"}),n.jsx("option",{value:"completed",children:"已完成"}),n.jsx("option",{value:"pending",children:"待支付"}),n.jsx("option",{value:"failed",children:"已失败"})]})]}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-0",children:l.length===0?n.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[n.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:K.map(R=>{var H,X;return n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsxs("td",{className:"p-4 font-mono text-xs text-gray-400",children:[(H=R.id)==null?void 0:H.slice(0,12),"..."]}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:R.userNickname}),n.jsx("p",{className:"text-gray-500 text-xs",children:R.userPhone})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:(()=>{const V=R.productType||R.type;return V==="fullbook"?`${R.bookName||"《底层逻辑》"} - 全本`:V==="match"?"匹配次数购买":`${R.bookName||"《底层逻辑》"} - ${R.sectionTitle||R.chapterTitle||`章节${R.productId||R.sectionId||""}`}`})()}),n.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const V=R.productType||R.type;return V==="fullbook"?"全书解锁":V==="match"?"功能权益":R.chapterTitle||"单章购买"})()})]})}),n.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof R.amount=="number"?R.amount.toFixed(2):parseFloat(String(R.amount||"0")).toFixed(2)]}),n.jsx("td",{className:"p-4 text-gray-300",children:R.paymentMethod==="wechat"?"微信支付":R.paymentMethod==="alipay"?"支付宝":R.paymentMethod||"微信支付"}),n.jsx("td",{className:"p-4",children:R.status==="completed"||R.status==="paid"?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):R.status==="pending"||R.status==="created"?n.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):n.jsx(Oe,{className:"bg-red-500/20 text-red-400 border-0",children:"已失败"})}),n.jsx("td",{className:"p-4 text-gray-300 text-sm",children:R.referrerId||R.referralCode?n.jsxs("span",{title:R.referralCode||R.referrerCode||R.referrerId||"",children:[R.referrerNickname||R.referralCode||R.referrerCode||((X=R.referrerId)==null?void 0:X.slice(0,8)),(R.referralCode||R.referrerCode)&&` (${R.referralCode||R.referrerCode})`]}):"-"}),n.jsx("td",{className:"p-4 text-[#FFD700]",children:R.referrerEarnings?`¥${(typeof R.referrerEarnings=="number"?R.referrerEarnings:parseFloat(String(R.referrerEarnings))).toFixed(2)}`:"-"}),n.jsx("td",{className:"p-4 text-gray-400 text-sm",children:R.createdAt?new Date(R.createdAt).toLocaleString("zh-CN"):"-"})]},R.id)})})]})})})})]}),r==="bindings"&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),n.jsx(ue,{value:C,onChange:R=>b(R.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:j,onChange:R=>N(R.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[n.jsx("option",{value:"all",children:"全部状态"}),n.jsx("option",{value:"active",children:"有效"}),n.jsx("option",{value:"converted",children:"已转化"}),n.jsx("option",{value:"expired",children:"已过期"})]})]}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-0",children:de.length===0?n.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[n.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:de.map(R=>n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white font-medium",children:R.refereeNickname||"匿名用户"}),n.jsx("p",{className:"text-gray-500 text-xs",children:R.refereePhone})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white",children:R.referrerName||"-"}),n.jsx("p",{className:"text-gray-500 text-xs font-mono",children:R.referrerCode})]})}),n.jsx("td",{className:"p-4 text-gray-400",children:R.boundAt?new Date(R.boundAt).toLocaleDateString("zh-CN"):"-"}),n.jsx("td",{className:"p-4 text-gray-400",children:R.expiresAt?new Date(R.expiresAt).toLocaleDateString("zh-CN"):"-"}),n.jsx("td",{className:"p-4",children:le(R.status)}),n.jsx("td",{className:"p-4",children:R.commission?n.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",R.commission.toFixed(2)]}):n.jsx("span",{className:"text-gray-500",children:"-"})})]},R.id))})]})})})})]}),r==="withdrawals"&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),n.jsx(ue,{value:C,onChange:R=>b(R.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:j,onChange:R=>N(R.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[n.jsx("option",{value:"all",children:"全部状态"}),n.jsx("option",{value:"pending",children:"待审核"}),n.jsx("option",{value:"completed",children:"已完成"}),n.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-0",children:oe.length===0?n.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[n.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),n.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:oe.map(R=>n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsx("td",{className:"p-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[R.userAvatar?n.jsx("img",{src:R.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):n.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(R.userName||R.name||"?").slice(0,1)}),n.jsx("p",{className:"text-white font-medium",children:R.userName||R.name})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",R.amount.toFixed(2)]})}),n.jsx("td",{className:"p-4",children:n.jsx(Oe,{className:R.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:R.method==="wechat"?"微信":"支付宝"})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white font-mono text-xs",children:R.account}),n.jsx("p",{className:"text-gray-500 text-xs",children:R.name})]})}),n.jsx("td",{className:"p-4 text-gray-400",children:R.createdAt?new Date(R.createdAt).toLocaleString("zh-CN"):"-"}),n.jsx("td",{className:"p-4",children:le(R.status)}),n.jsx("td",{className:"p-4 text-right",children:R.status==="pending"&&n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsxs(pe,{size:"sm",onClick:()=>Y(R.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Jc,{className:"w-4 h-4 mr-1"}),"通过"]}),n.jsxs(pe,{size:"sm",variant:"outline",onClick:()=>W(R.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[n.jsx(ww,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},R.id))})]})})})})]})]})]})}function Yb(){const[r,a]=p.useState([]),[l,i]=p.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,d]=p.useState(!0),[f,m]=p.useState("all"),[x,g]=p.useState(null);async function v(){var C,b,j,N,P,S;d(!0);try{const A=await Ye(`/api/admin/withdrawals?status=${f}`);if(A!=null&&A.success){const U=A.withdrawals||[];a(U),i({total:((C=A.stats)==null?void 0:C.total)??U.length,pendingCount:((b=A.stats)==null?void 0:b.pendingCount)??0,pendingAmount:((j=A.stats)==null?void 0:j.pendingAmount)??0,successCount:((N=A.stats)==null?void 0:N.successCount)??0,successAmount:((P=A.stats)==null?void 0:P.successAmount)??0,failedCount:((S=A.stats)==null?void 0:S.failedCount)??0})}}catch(A){console.error("Load withdrawals error:",A)}finally{d(!1)}}p.useEffect(()=>{v()},[f]);async function y(C){const b=r.find(j=>j.id===C);if(b!=null&&b.userCommissionInfo&&b.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${b.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 +For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return x.useEffect(()=>{r&&(document.getElementById(r)||console.error(l))},[l,r]),null},vb="DialogDescriptionWarning",yb=({contentRef:r,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ax(vb).contentName}}.`;return x.useEffect(()=>{var d;const c=(d=r.current)==null?void 0:d.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(i))},[i,r,a]),null},wb=Kp,Nb=Yp,jb=Xp,bb=qp,Sb=Zp,Cb=tx,kb=rx;function Nn(r){return n.jsx(wb,{"data-slot":"dialog",...r})}function Eb(r){return n.jsx(Nb,{...r})}const lx=x.forwardRef(({className:r,...a},l)=>n.jsx(jb,{ref:l,className:We("fixed inset-0 z-50 bg-black/50",r),...a}));lx.displayName="DialogOverlay";const on=x.forwardRef(({className:r,children:a,showCloseButton:l=!0,...i},c)=>n.jsxs(Eb,{children:[n.jsx(lx,{}),n.jsxs(bb,{ref:c,className:We("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border bg-background p-6 shadow-lg sm:max-w-lg",r),...i,children:[a,l&&n.jsxs(kb,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[n.jsx(Ur,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));on.displayName="DialogContent";function jn({className:r,...a}){return n.jsx("div",{className:We("flex flex-col gap-2 text-center sm:text-left",r),...a})}function zn({className:r,...a}){return n.jsx("div",{className:We("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function bn(r){return n.jsx(Sb,{className:"text-lg font-semibold leading-none",...r})}function Pb(r){return n.jsx(Cb,{className:"text-sm text-muted-foreground",...r})}function Du(r){const a=x.useRef({value:r,previous:r});return x.useMemo(()=>(a.current.value!==r&&(a.current.previous=a.current.value,a.current.value=r),a.current.previous),[r])}function Ou(r){const[a,l]=x.useState(void 0);return Et(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const i=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let f,m;if("borderBoxSize"in d){const p=d.borderBoxSize,g=Array.isArray(p)?p[0]:p;f=g.inlineSize,m=g.blockSize}else f=r.offsetWidth,m=r.offsetHeight;l({width:f,height:m})});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else l(void 0)},[r]),a}var Po="Switch",[Rb]=jr(Po),[_b,Tb]=Rb(Po),ox=x.forwardRef((r,a)=>{const{__scopeSwitch:l,name:i,checked:c,defaultChecked:d,required:f,disabled:m,value:p="on",onCheckedChange:g,form:v,...y}=r,[E,k]=x.useState(null),C=Ve(a,S=>k(S)),b=x.useRef(!1),j=E?v||!!E.closest("form"):!0,[N,P]=Vr({prop:c,defaultProp:d??!1,onChange:g,caller:Po});return n.jsxs(_b,{scope:l,checked:N,disabled:m,children:[n.jsx(Le.button,{type:"button",role:"switch","aria-checked":N,"aria-required":f,"data-state":dx(N),"data-disabled":m?"":void 0,disabled:m,value:p,...y,ref:C,onClick:Ae(r.onClick,S=>{P(A=>!A),j&&(b.current=S.isPropagationStopped(),b.current||S.stopPropagation())})}),j&&n.jsx(ux,{control:E,bubbles:!b.current,name:i,value:p,checked:N,required:f,disabled:m,form:v,style:{transform:"translateX(-100%)"}})]})});ox.displayName=Po;var ix="SwitchThumb",cx=x.forwardRef((r,a)=>{const{__scopeSwitch:l,...i}=r,c=Tb(ix,l);return n.jsx(Le.span,{"data-state":dx(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a})});cx.displayName=ix;var Ib="SwitchBubbleInput",ux=x.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:i=!0,...c},d)=>{const f=x.useRef(null),m=Ve(f,d),p=Du(l),g=Ou(a);return x.useEffect(()=>{const v=f.current;if(!v)return;const y=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(y,"checked").set;if(p!==l&&k){const C=new Event("click",{bubbles:i});k.call(v,l),v.dispatchEvent(C)}},[p,l,i]),n.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:m,style:{...c.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ux.displayName=Ib;function dx(r){return r?"checked":"unchecked"}var fx=ox,Ab=cx;const ht=x.forwardRef(({className:r,...a},l)=>n.jsx(fx,{className:We("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a1628] disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-gray-600 data-[state=checked]:bg-[#38bdac]",r),...a,ref:l,children:n.jsx(Ab,{className:We("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));ht.displayName=fx.displayName;function Fu(r){const a=r+"CollectionProvider",[l,i]=jr(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=b=>{const{scope:j,children:N}=b,P=fr.useRef(null),S=fr.useRef(new Map).current;return n.jsx(c,{scope:j,itemMap:S,collectionRef:P,children:N})};f.displayName=a;const m=r+"CollectionSlot",p=_a(m),g=fr.forwardRef((b,j)=>{const{scope:N,children:P}=b,S=d(m,N),A=Ve(j,S.collectionRef);return n.jsx(p,{ref:A,children:P})});g.displayName=m;const v=r+"CollectionItemSlot",y="data-radix-collection-item",E=_a(v),k=fr.forwardRef((b,j)=>{const{scope:N,children:P,...S}=b,A=fr.useRef(null),U=Ve(j,A),Q=d(v,N);return fr.useEffect(()=>(Q.itemMap.set(A,{ref:A,...S}),()=>void Q.itemMap.delete(A))),n.jsx(E,{[y]:"",ref:U,children:P})});k.displayName=v;function C(b){const j=d(r+"CollectionConsumer",b);return fr.useCallback(()=>{const P=j.collectionRef.current;if(!P)return[];const S=Array.from(P.querySelectorAll(`[${y}]`));return Array.from(j.itemMap.values()).sort((Q,Y)=>S.indexOf(Q.ref.current)-S.indexOf(Y.ref.current))},[j.collectionRef,j.itemMap])}return[{Provider:f,Slot:g,ItemSlot:k},C,i]}var Mb=x.createContext(void 0);function Ro(r){const a=x.useContext(Mb);return r||a||"ltr"}var Vc="rovingFocusGroup.onEntryFocus",Lb={bubbles:!1,cancelable:!0},La="RovingFocusGroup",[ou,hx,Db]=Fu(La),[Ob,mx]=jr(La,[Db]),[Fb,zb]=Ob(La),px=x.forwardRef((r,a)=>n.jsx(ou.Provider,{scope:r.__scopeRovingFocusGroup,children:n.jsx(ou.Slot,{scope:r.__scopeRovingFocusGroup,children:n.jsx($b,{...r,ref:a})})}));px.displayName=La;var $b=x.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:i,loop:c=!1,dir:d,currentTabStopId:f,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:p,onEntryFocus:g,preventScrollOnEntryFocus:v=!1,...y}=r,E=x.useRef(null),k=Ve(a,E),C=Ro(d),[b,j]=Vr({prop:f,defaultProp:m??null,onChange:p,caller:La}),[N,P]=x.useState(!1),S=vr(g),A=hx(l),U=x.useRef(!1),[Q,Y]=x.useState(0);return x.useEffect(()=>{const W=E.current;if(W)return W.addEventListener(Vc,S),()=>W.removeEventListener(Vc,S)},[S]),n.jsx(Fb,{scope:l,orientation:i,dir:C,loop:c,currentTabStopId:b,onItemFocus:x.useCallback(W=>j(W),[j]),onItemShiftTab:x.useCallback(()=>P(!0),[]),onFocusableItemAdd:x.useCallback(()=>Y(W=>W+1),[]),onFocusableItemRemove:x.useCallback(()=>Y(W=>W-1),[]),children:n.jsx(Le.div,{tabIndex:N||Q===0?-1:0,"data-orientation":i,...y,ref:k,style:{outline:"none",...r.style},onMouseDown:Ae(r.onMouseDown,()=>{U.current=!0}),onFocus:Ae(r.onFocus,W=>{const le=!U.current;if(W.target===W.currentTarget&&le&&!N){const de=new CustomEvent(Vc,Lb);if(W.currentTarget.dispatchEvent(de),!de.defaultPrevented){const oe=A().filter(V=>V.focusable),K=oe.find(V=>V.active),R=oe.find(V=>V.id===b),X=[K,R,...oe].filter(Boolean).map(V=>V.ref.current);vx(X,v)}}U.current=!1}),onBlur:Ae(r.onBlur,()=>P(!1))})})}),xx="RovingFocusGroupItem",gx=x.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:i=!0,active:c=!1,tabStopId:d,children:f,...m}=r,p=gr(),g=d||p,v=zb(xx,l),y=v.currentTabStopId===g,E=hx(l),{onFocusableItemAdd:k,onFocusableItemRemove:C,currentTabStopId:b}=v;return x.useEffect(()=>{if(i)return k(),()=>C()},[i,k,C]),n.jsx(ou.ItemSlot,{scope:l,id:g,focusable:i,active:c,children:n.jsx(Le.span,{tabIndex:y?0:-1,"data-orientation":v.orientation,...m,ref:a,onMouseDown:Ae(r.onMouseDown,j=>{i?v.onItemFocus(g):j.preventDefault()}),onFocus:Ae(r.onFocus,()=>v.onItemFocus(g)),onKeyDown:Ae(r.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){v.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const N=Vb(j,v.orientation,v.dir);if(N!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let S=E().filter(A=>A.focusable).map(A=>A.ref.current);if(N==="last")S.reverse();else if(N==="prev"||N==="next"){N==="prev"&&S.reverse();const A=S.indexOf(j.currentTarget);S=v.loop?Wb(S,A+1):S.slice(A+1)}setTimeout(()=>vx(S))}}),children:typeof f=="function"?f({isCurrentTabStop:y,hasTabStop:b!=null}):f})})});gx.displayName=xx;var Bb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ub(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function Vb(r,a,l){const i=Ub(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return Bb[i]}function vx(r,a=!1){const l=document.activeElement;for(const i of r)if(i===l||(i.focus({preventScroll:a}),document.activeElement!==l))return}function Wb(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var Hb=px,Kb=gx,_o="Tabs",[Gb]=jr(_o,[mx]),yx=mx(),[Qb,zu]=Gb(_o),wx=x.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,onValueChange:c,defaultValue:d,orientation:f="horizontal",dir:m,activationMode:p="automatic",...g}=r,v=Ro(m),[y,E]=Vr({prop:i,onChange:c,defaultProp:d??"",caller:_o});return n.jsx(Qb,{scope:l,baseId:gr(),value:y,onValueChange:E,orientation:f,dir:v,activationMode:p,children:n.jsx(Le.div,{dir:v,"data-orientation":f,...g,ref:a})})});wx.displayName=_o;var Nx="TabsList",jx=x.forwardRef((r,a)=>{const{__scopeTabs:l,loop:i=!0,...c}=r,d=zu(Nx,l),f=yx(l);return n.jsx(Hb,{asChild:!0,...f,orientation:d.orientation,dir:d.dir,loop:i,children:n.jsx(Le.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});jx.displayName=Nx;var bx="TabsTrigger",Sx=x.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,disabled:c=!1,...d}=r,f=zu(bx,l),m=yx(l),p=Ex(f.baseId,i),g=Px(f.baseId,i),v=i===f.value;return n.jsx(Kb,{asChild:!0,...m,focusable:!c,active:v,children:n.jsx(Le.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":g,"data-state":v?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:p,...d,ref:a,onMouseDown:Ae(r.onMouseDown,y=>{!c&&y.button===0&&y.ctrlKey===!1?f.onValueChange(i):y.preventDefault()}),onKeyDown:Ae(r.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&f.onValueChange(i)}),onFocus:Ae(r.onFocus,()=>{const y=f.activationMode!=="manual";!v&&!c&&y&&f.onValueChange(i)})})})});Sx.displayName=bx;var Cx="TabsContent",kx=x.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,forceMount:c,children:d,...f}=r,m=zu(Cx,l),p=Ex(m.baseId,i),g=Px(m.baseId,i),v=i===m.value,y=x.useRef(v);return x.useEffect(()=>{const E=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(E)},[]),n.jsx(Ma,{present:c||v,children:({present:E})=>n.jsx(Le.div,{"data-state":v?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":p,hidden:!E,id:g,tabIndex:0,...f,ref:a,style:{...r.style,animationDuration:y.current?"0s":void 0},children:E&&d})})});kx.displayName=Cx;function Ex(r,a){return`${r}-trigger-${a}`}function Px(r,a){return`${r}-content-${a}`}var Yb=wx,Rx=jx,_x=Sx,Tx=kx;const $u=Yb,To=x.forwardRef(({className:r,...a},l)=>n.jsx(Rx,{ref:l,className:We("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));To.displayName=Rx.displayName;const Xt=x.forwardRef(({className:r,...a},l)=>n.jsx(_x,{ref:l,className:We("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",r),...a}));Xt.displayName=_x.displayName;const qt=x.forwardRef(({className:r,...a},l)=>n.jsx(Tx,{ref:l,className:We("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...a}));qt.displayName=Tx.displayName;function Xb({open:r,onClose:a,userId:l,onUserUpdated:i}){var V;const[c,d]=x.useState(null),[f,m]=x.useState([]),[p,g]=x.useState([]),[v,y]=x.useState(!1),[E,k]=x.useState(!1),[C,b]=x.useState(!1),[j,N]=x.useState("info"),[P,S]=x.useState(""),[A,U]=x.useState(""),[Q,Y]=x.useState([]),[W,le]=x.useState("");x.useEffect(()=>{r&&l&&de()},[r,l]);async function de(){if(l){y(!0);try{const B=await Ye(`/api/db/users?id=${encodeURIComponent(l)}`);if(B!=null&&B.success&&B.user){const T=B.user;d(T),S(T.phone||""),U(T.nickname||""),Y(typeof T.tags=="string"?JSON.parse(T.tags||"[]"):[])}try{const T=await Ye(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);T!=null&&T.success&&T.tracks&&m(T.tracks)}catch{m([])}try{const T=await Ye(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);T!=null&&T.success&&T.referrals&&g(T.referrals)}catch{g([])}}catch(B){console.error("Load user detail error:",B)}finally{y(!1)}}}async function oe(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}k(!0);try{const B=await kt("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});B!=null&&B.success?(alert("同步成功"),de()):alert("同步失败: "+(B==null?void 0:B.error))}catch(B){console.error("Sync CKB error:",B),alert("同步失败")}finally{k(!1)}}async function K(){if(c){b(!0);try{const B=await Un("/api/db/users",{id:c.id,phone:P||void 0,nickname:A||void 0,tags:JSON.stringify(Q)});B!=null&&B.success?(alert("保存成功"),de(),i==null||i()):alert("保存失败: "+(B==null?void 0:B.error))}catch(B){console.error("Save user error:",B),alert("保存失败")}finally{b(!1)}}}const R=()=>{W&&!Q.includes(W)&&(Y([...Q,W]),le(""))},H=B=>{Y(Q.filter(T=>T!==B))},X=B=>{const J={view_chapter:_s,purchase:tu,match:kn,login:Zl,register:Zl,share:ks,bind_phone:c1,bind_wechat:n1}[B]||am;return n.jsx(J,{className:"w-4 h-4"})};return r?n.jsx(Nn,{open:r,onOpenChange:()=>a(),children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(Zl,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"})]})}),v?n.jsxs("div",{className:"flex items-center justify-center py-20",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):c?n.jsxs("div",{className:"flex flex-col h-[70vh]",children:[n.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-4",children:[n.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac]",children:c.avatar?n.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((V=c.nickname)==null?void 0:V.charAt(0))||"?"}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h3",{className:"text-lg font-bold text-white",children:c.nickname}),c.isAdmin&&n.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"})]}),n.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechatId&&` · 💬 ${c.wechatId}`]}),n.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["ID: ",c.id," · 推广码: ",c.referralCode??"-"]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-[#38bdac] font-bold",children:["¥",(c.earnings||0).toFixed(2)]}),n.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"})]})]}),n.jsxs($u,{value:j,onValueChange:N,className:"flex-1 flex flex-col overflow-hidden",children:[n.jsxs(To,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-4",children:[n.jsx(Xt,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"基础信息"}),n.jsx(Xt,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"标签体系"}),n.jsx(Xt,{value:"tracks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"行为轨迹"}),n.jsx(Xt,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"关系链路"})]}),n.jsxs(qt,{value:"info",className:"flex-1 overflow-auto space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"手机号"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:P,onChange:B=>S(B.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"昵称"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:A,onChange:B=>U(B.target.value)})]})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"推荐人数"}),n.jsx("p",{className:"text-2xl font-bold text-white",children:c.referralCount??0})]}),n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"待提现"}),n.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["¥",(c.pendingEarnings??0).toFixed(2)]})]}),n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"创建时间"}),n.jsx("p",{className:"text-sm text-white",children:c.createdAt?new Date(c.createdAt).toLocaleDateString():"-"})]})]}),n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ks,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),n.jsx(pe,{size:"sm",onClick:oe,disabled:E||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-1"})," 同步数据"]})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500",children:"同步状态:"}),c.ckbSyncedAt?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):n.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 ml-1",children:"未同步"})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500",children:"最后同步:"}),n.jsx("span",{className:"text-gray-300 ml-1",children:c.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),n.jsx(qt,{value:"tags",className:"flex-1 overflow-auto space-y-4",children:n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(b1,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-white font-medium",children:"系统标签"})]}),n.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[Q.map((B,T)=>n.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[B,n.jsx("button",{type:"button",onClick:()=>H(B),className:"ml-1 hover:text-red-400",children:n.jsx(Ur,{className:"w-3 h-3"})})]},T)),Q.length===0&&n.jsx("span",{className:"text-gray-500 text-sm",children:"暂无标签"})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ue,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"添加新标签",value:W,onChange:B=>le(B.target.value),onKeyDown:B=>B.key==="Enter"&&R()}),n.jsx(pe,{onClick:R,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})}),n.jsx(qt,{value:"tracks",className:"flex-1 overflow-auto",children:n.jsx("div",{className:"space-y-2",children:f.length>0?f.map(B=>n.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:X(B.action)}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-white font-medium",children:B.actionLabel}),B.chapterTitle&&n.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",B.chapterTitle]})]}),n.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[n.jsx(op,{className:"w-3 h-3 inline mr-1"}),B.timeAgo," · ",new Date(B.createdAt).toLocaleString()]})]})]},B.id)):n.jsxs("div",{className:"text-center py-12",children:[n.jsx(am,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),n.jsx("p",{className:"text-gray-400",children:"暂无行为轨迹"})]})})}),n.jsx(qt,{value:"relations",className:"flex-1 overflow-auto space-y-4",children:n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ks,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-white font-medium",children:"推荐的用户"})]}),n.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:["共 ",p.length," 人"]})]}),n.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:p.length>0?p.map((B,T)=>{var q;const J=B;return n.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#162840] rounded",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-6 h-6 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:((q=J.nickname)==null?void 0:q.charAt(0))||"?"}),n.jsx("span",{className:"text-white text-sm",children:J.nickname})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[J.status==="vip"&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),n.jsx("span",{className:"text-gray-500 text-xs",children:J.createdAt?new Date(J.createdAt).toLocaleDateString():""})]})]},J.id||T)}):n.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})})]}),n.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-700 mt-4",children:[n.jsxs(pe,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ur,{className:"w-4 h-4 mr-2"}),"关闭"]}),n.jsxs(pe,{onClick:K,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),C?"保存中...":"保存修改"]})]})]}):n.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}function qb(){var ne,he,Ee,Se,Te;const[r,a]=x.useState([]),[l,i]=x.useState(""),[c,d]=x.useState(!0),[,f]=x.useState(null),[m,p]=x.useState(!1),[g,v]=x.useState(!1),[y,E]=x.useState(null),[k,C]=x.useState(""),[b,j]=x.useState(""),[N,P]=x.useState(!1),[S,A]=x.useState(!1),[U,Q]=x.useState({referrals:[],stats:{}}),[Y,W]=x.useState(!1),[le,de]=x.useState(null),[oe,K]=x.useState(!1),[R,H]=x.useState(null),[X,V]=x.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1});async function B(){d(!0),f(null);try{const z=await Ye("/api/db/users");z!=null&&z.success?a(z.users||[]):f((z==null?void 0:z.error)||"加载失败")}catch(z){console.error("Load users error:",z),f("网络错误,请检查连接")}finally{d(!1)}}x.useEffect(()=>{B()},[]);const T=r.filter(z=>(z.nickname||"").includes(l)||(z.phone||"").includes(l));async function J(z){if(confirm("确定要删除这个用户吗?"))try{const Ie=await z1(`/api/db/users?id=${encodeURIComponent(z)}`);Ie!=null&&Ie.success?B():alert("删除失败: "+((Ie==null?void 0:Ie.error)||"未知错误"))}catch(Ie){console.error("Delete user error:",Ie),alert("删除失败")}}const q=z=>{E(z),V({phone:z.phone||"",nickname:z.nickname||"",password:"",isAdmin:!!(z.isAdmin??!1),hasFullBook:!!(z.hasFullBook??!1)}),p(!0)},L=()=>{E(null),V({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),p(!0)};async function G(){if(!X.phone||!X.nickname){alert("请填写手机号和昵称");return}P(!0);try{if(y){const z=await Un("/api/db/users",{id:y.id,nickname:X.nickname,isAdmin:X.isAdmin,hasFullBook:X.hasFullBook,...X.password&&{password:X.password}});if(!(z!=null&&z.success)){alert("更新失败: "+((z==null?void 0:z.error)||"未知错误"));return}}else{const z=await kt("/api/db/users",{phone:X.phone,nickname:X.nickname,password:X.password,isAdmin:X.isAdmin});if(!(z!=null&&z.success)){alert("创建失败: "+((z==null?void 0:z.error)||"未知错误"));return}}p(!1),B()}catch(z){console.error("Save user error:",z),alert("保存失败")}finally{P(!1)}}const fe=z=>{E(z),C(""),j(""),v(!0)};async function se(z){de(z),A(!0),W(!0);try{const Ie=await Ye(`/api/db/users/referrals?userId=${encodeURIComponent(z.id)}`);Ie!=null&&Ie.success?Q({referrals:Ie.referrals||[],stats:Ie.stats||{}}):Q({referrals:[],stats:{}})}catch(Ie){console.error("Load referrals error:",Ie),Q({referrals:[],stats:{}})}finally{W(!1)}}const be=z=>{H(z.id),K(!0)};async function je(){if(!k){alert("请输入新密码");return}if(k!==b){alert("两次输入的密码不一致");return}if(k.length<6){alert("密码长度不能少于6位");return}P(!0);try{const z=await Un("/api/db/users",{id:y==null?void 0:y.id,password:k});z!=null&&z.success?(alert("密码修改成功"),v(!1)):alert("密码修改失败: "+((z==null?void 0:z.error)||"未知错误"))}catch(z){console.error("Change password error:",z),alert("密码修改失败")}finally{P(!1)}}return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"用户管理"}),n.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",r.length," 位注册用户"]})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs(pe,{variant:"outline",onClick:B,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]}),n.jsxs("div",{className:"relative",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),n.jsx(ue,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:l,onChange:z=>i(z.target.value)})]}),n.jsxs(pe,{onClick:L,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(dm,{className:"w-4 h-4 mr-2"}),"添加用户"]})]})]}),n.jsx(Nn,{open:m,onOpenChange:p,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[y?n.jsx(Ts,{className:"w-5 h-5 text-[#38bdac]"}):n.jsx(dm,{className:"w-5 h-5 text-[#38bdac]"}),y?"编辑用户":"添加用户"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"手机号"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:X.phone,onChange:z=>V({...X,phone:z.target.value}),disabled:!!y})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"昵称"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:X.nickname,onChange:z=>V({...X,nickname:z.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:y?"新密码 (留空则不修改)":"密码"}),n.jsx(ue,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:y?"留空则不修改":"请输入密码",value:X.password,onChange:z=>V({...X,password:z.target.value})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ae,{className:"text-gray-300",children:"管理员权限"}),n.jsx(ht,{checked:X.isAdmin,onCheckedChange:z=>V({...X,isAdmin:z})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ae,{className:"text-gray-300",children:"已购全书"}),n.jsx(ht,{checked:X.hasFullBook,onCheckedChange:z=>V({...X,hasFullBook:z})})]})]}),n.jsxs(zn,{children:[n.jsxs(pe,{variant:"outline",onClick:()=>p(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ur,{className:"w-4 h-4 mr-2"}),"取消"]}),n.jsxs(pe,{onClick:G,disabled:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),N?"保存中...":"保存"]})]})]})}),n.jsx(Nn,{open:g,onOpenChange:v,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(om,{className:"w-5 h-5 text-[#38bdac]"}),"修改密码"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3",children:[n.jsxs("p",{className:"text-gray-400 text-sm",children:["用户:",y==null?void 0:y.nickname]}),n.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",y==null?void 0:y.phone]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"新密码"}),n.jsx(ue,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:k,onChange:z=>C(z.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"确认密码"}),n.jsx(ue,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:b,onChange:z=>j(z.target.value)})]})]}),n.jsxs(zn,{children:[n.jsx(pe,{variant:"outline",onClick:()=>v(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(pe,{onClick:je,disabled:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:N?"保存中...":"确认修改"})]})]})}),n.jsx(Xb,{open:oe,onClose:()=>K(!1),userId:R,onUserUpdated:B}),n.jsx(Nn,{open:S,onOpenChange:A,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(kn,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系详情 - ",le==null?void 0:le.nickname]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[n.jsx("div",{className:"text-2xl font-bold text-[#38bdac]",children:((ne=U.stats)==null?void 0:ne.total)||0}),n.jsx("div",{className:"text-xs text-gray-400",children:"绑定总数"})]}),n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[n.jsx("div",{className:"text-2xl font-bold text-green-400",children:((he=U.stats)==null?void 0:he.purchased)||0}),n.jsx("div",{className:"text-xs text-gray-400",children:"已付费"})]}),n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[n.jsxs("div",{className:"text-2xl font-bold text-yellow-400",children:["¥",(((Ee=U.stats)==null?void 0:Ee.earnings)||0).toFixed(2)]}),n.jsx("div",{className:"text-xs text-gray-400",children:"累计收益"})]}),n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[n.jsxs("div",{className:"text-2xl font-bold text-orange-400",children:["¥",(((Se=U.stats)==null?void 0:Se.pendingEarnings)||0).toFixed(2)]}),n.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),Y?n.jsxs("div",{className:"flex items-center justify-center py-8",children:[n.jsx(Ze,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((Te=U.referrals)==null?void 0:Te.length)??0)>0?n.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(U.referrals??[]).map((z,Ie)=>{var Nt;const ze=z;return n.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg p-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:((Nt=ze.nickname)==null?void 0:Nt.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-white text-sm",children:ze.nickname}),n.jsx("div",{className:"text-xs text-gray-500",children:ze.phone||(ze.hasOpenId?"微信用户":"未绑定")})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[ze.status==="vip"&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),ze.status==="paid"&&n.jsxs(Oe,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",ze.purchasedSections,"章"]}),ze.status==="free"&&n.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),n.jsx("span",{className:"text-xs text-gray-500",children:ze.createdAt?new Date(ze.createdAt).toLocaleDateString():""})]})]},ze.id||Ie)})}):n.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),n.jsx(zn,{children:n.jsx(pe,{variant:"outline",onClick:()=>A(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(_e,{className:"p-0",children:c?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsxs(bo,{children:[n.jsx(So,{children:n.jsxs($n,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(et,{className:"text-gray-400",children:"用户信息"}),n.jsx(et,{className:"text-gray-400",children:"绑定信息"}),n.jsx(et,{className:"text-gray-400",children:"购买状态"}),n.jsx(et,{className:"text-gray-400",children:"分销收益"}),n.jsx(et,{className:"text-gray-400",children:"推广码"}),n.jsx(et,{className:"text-gray-400",children:"注册时间"}),n.jsx(et,{className:"text-right text-gray-400",children:"操作"})]})}),n.jsxs(Co,{children:[T.map(z=>{var Ie,ze,Nt;return n.jsxs($n,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsx(Qe,{children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:z.avatar?n.jsx("img",{src:z.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Ie=z.nickname)==null?void 0:Ie.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("p",{className:"font-medium text-white",children:z.nickname}),z.isAdmin&&n.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),z.openId&&!((ze=z.id)!=null&&ze.startsWith("user_"))&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0 text-xs",children:"微信"})]}),n.jsx("p",{className:"text-xs text-gray-500 font-mono",children:z.openId?z.openId.slice(0,12)+"...":(Nt=z.id)==null?void 0:Nt.slice(0,12)})]})]})}),n.jsx(Qe,{children:n.jsxs("div",{className:"space-y-1",children:[z.phone&&n.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[n.jsx("span",{className:"text-gray-500",children:"📱"}),n.jsx("span",{className:"text-gray-300",children:z.phone})]}),z.wechatId&&n.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[n.jsx("span",{className:"text-gray-500",children:"💬"}),n.jsx("span",{className:"text-gray-300",children:z.wechatId})]}),z.openId&&n.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[n.jsx("span",{className:"text-gray-500",children:"🔗"}),n.jsxs("span",{className:"text-gray-500 truncate max-w-[100px]",title:z.openId,children:[z.openId.slice(0,12),"..."]})]}),!z.phone&&!z.wechatId&&!z.openId&&n.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),n.jsx(Qe,{children:z.hasFullBook?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"全书已购"}):n.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),n.jsx(Qe,{children:n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(z.earnings||0)).toFixed(2)]}),parseFloat(String(z.pendingEarnings||0))>0&&n.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(z.pendingEarnings||0)).toFixed(2)]}),n.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>se(z),onKeyDown:Vt=>Vt.key==="Enter"&&se(z),role:"button",tabIndex:0,children:[n.jsx(kn,{className:"w-3 h-3"}),"绑定",z.referralCount||0,"人"]})]})}),n.jsx(Qe,{children:n.jsx("code",{className:"text-[#38bdac] text-xs bg-[#38bdac]/10 px-2 py-0.5 rounded",children:z.referralCode||"-"})}),n.jsx(Qe,{className:"text-gray-400",children:z.createdAt?new Date(z.createdAt).toLocaleDateString():"-"}),n.jsx(Qe,{className:"text-right",children:n.jsxs("div",{className:"flex items-center justify-end gap-1",children:[n.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>be(z),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:n.jsx(Cu,{className:"w-4 h-4"})}),n.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>q(z),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:n.jsx(Ts,{className:"w-4 h-4"})}),n.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>fe(z),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:n.jsx(om,{className:"w-4 h-4"})}),n.jsx(pe,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>J(z.id),title:"删除",children:n.jsx(dp,{className:"w-4 h-4"})})]})})]},z.id)}),T.length===0&&n.jsx($n,{children:n.jsx(Qe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]})})})]})}function Jb(){const[r,a]=x.useState("overview"),[l,i]=x.useState([]),[c,d]=x.useState(null),[f,m]=x.useState([]),[p,g]=x.useState([]),[v,y]=x.useState([]),[E,k]=x.useState(!0),[C,b]=x.useState(""),[j,N]=x.useState("all"),[P,S]=x.useState(new Set);x.useEffect(()=>{A()},[]),x.useEffect(()=>{U(r)},[r]);async function A(){try{const R=await Ye("/api/admin/distribution/overview");R!=null&&R.success&&R.overview&&d(R.overview)}catch(R){console.error("[Admin] 概览接口异常:",R)}try{const R=await Ye("/api/db/users");y((R==null?void 0:R.users)||[])}catch(R){console.error("[Admin] 用户数据加载失败:",R)}}async function U(R,H=!1){if(!(!H&&P.has(R))){k(!0);try{const X=v;switch(R){case"overview":break;case"orders":{try{const V=await Ye("/api/orders");if(V!=null&&V.success&&V.orders){const B=V.orders.map(T=>{const J=X.find(L=>L.id===T.userId),q=T.referrerId?X.find(L=>L.id===T.referrerId):null;return{...T,amount:parseFloat(String(T.amount))||0,userNickname:(J==null?void 0:J.nickname)||T.userNickname||"未知用户",userPhone:(J==null?void 0:J.phone)||T.userPhone||"-",referrerNickname:(q==null?void 0:q.nickname)||null,referrerCode:(q==null?void 0:q.referralCode)??null,type:T.productType||T.type}});i(B)}else i([])}catch{i([])}break}case"bindings":{try{const V=await Ye("/api/db/distribution");m((V==null?void 0:V.bindings)||[])}catch{m([])}break}case"withdrawals":{try{const V=await Ye("/api/admin/withdrawals");if(V!=null&&V.success&&V.withdrawals){const B=V.withdrawals.map(T=>({...T,account:T.account??"未绑定微信号",status:T.status==="success"?"completed":T.status==="failed"?"rejected":T.status}));g(B)}else V!=null&&V.success||alert(`获取提现记录失败: ${(V==null?void 0:V.error)||"未知错误"}`),g([])}catch(V){console.error(V),alert("加载提现数据失败"),g([])}break}}S(V=>new Set(V).add(R))}catch(X){console.error(X)}finally{k(!1)}}}async function Q(){S(R=>{const H=new Set(R);return H.delete(r),H}),r==="overview"&&A(),await U(r,!0)}async function Y(R){if(confirm("确认审核通过并打款?"))try{const H=await Un("/api/admin/withdrawals",{id:R,action:"approve"});if(!(H!=null&&H.success)){const X=(H==null?void 0:H.message)||(H==null?void 0:H.error)||"操作失败";alert(X);return}await Q()}catch(H){console.error(H),alert("操作失败")}}async function W(R){const H=prompt("请输入拒绝原因:");if(H)try{const X=await Un("/api/admin/withdrawals",{id:R,action:"reject",errorMessage:H});if(!(X!=null&&X.success)){alert((X==null?void 0:X.error)||"操作失败");return}await Q()}catch(X){console.error(X),alert("操作失败")}}function le(R){const H={active:"bg-green-500/20 text-green-400",converted:"bg-blue-500/20 text-blue-400",expired:"bg-gray-500/20 text-gray-400",cancelled:"bg-red-500/20 text-red-400",pending:"bg-orange-500/20 text-orange-400",processing:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400"},X={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return n.jsx(Oe,{className:`${H[R]||"bg-gray-500/20 text-gray-400"} border-0`,children:X[R]||R})}const de=f.filter(R=>{var H,X,V,B;if(j!=="all"&&R.status!==j)return!1;if(C){const T=C.toLowerCase();return((H=R.refereeNickname)==null?void 0:H.toLowerCase().includes(T))||((X=R.refereePhone)==null?void 0:X.includes(T))||((V=R.referrerName)==null?void 0:V.toLowerCase().includes(T))||((B=R.referrerCode)==null?void 0:B.toLowerCase().includes(T))}return!0}),oe=p.filter(R=>{var H,X;if(j!=="all"&&R.status!==j)return!1;if(C){const V=C.toLowerCase();return((H=R.userName)==null?void 0:H.toLowerCase().includes(V))||((X=R.account)==null?void 0:X.toLowerCase().includes(V))}return!0}),K=l.filter(R=>{var H,X,V,B,T,J;if(j!=="all"&&R.status!==j)return!1;if(C){const q=C.toLowerCase();return((H=R.id)==null?void 0:H.toLowerCase().includes(q))||((X=R.userNickname)==null?void 0:X.toLowerCase().includes(q))||((V=R.userPhone)==null?void 0:V.includes(q))||((B=R.sectionTitle)==null?void 0:B.toLowerCase().includes(q))||((T=R.chapterTitle)==null?void 0:T.toLowerCase().includes(q))||((J=R.bookName)==null?void 0:J.toLowerCase().includes(q))||R.referrerCode&&R.referrerCode.toLowerCase().includes(q)||R.referrerNickname&&R.referrerNickname.toLowerCase().includes(q)}return!0});return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white",children:"交易中心"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),n.jsxs(pe,{onClick:Q,disabled:E,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${E?"animate-spin":""}`}),"刷新数据"]})]}),n.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4",children:[{key:"overview",label:"数据概览",icon:nu},{key:"orders",label:"订单管理",icon:lo},{key:"bindings",label:"绑定管理",icon:ks},{key:"withdrawals",label:"提现审核",icon:Is}].map(R=>n.jsxs("button",{type:"button",onClick:()=>{a(R.key),N("all"),b("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===R.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[n.jsx(R.icon,{className:"w-4 h-4"}),R.label]},R.key))}),E?n.jsxs("div",{className:"flex items-center justify-center py-20",children:[n.jsx(Ze,{className:"w-8 h-8 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsxs(n.Fragment,{children:[r==="overview"&&c&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),n.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks})]}),n.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:n.jsx(Cu,{className:"w-6 h-6 text-blue-400"})})]})})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),n.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),n.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:n.jsx(ks,{className:"w-6 h-6 text-green-400"})})]})})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),n.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),n.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:n.jsx(Jc,{className:"w-6 h-6 text-purple-400"})})]})})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),n.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),n.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:n.jsx(lo,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(Re,{className:"bg-orange-500/10 border-orange-500/30",children:n.jsx(_e,{className:"p-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:n.jsx(op,{className:"w-6 h-6 text-orange-400"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),n.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),n.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期,需关注转化"})]})]})})}),n.jsx(Re,{className:"bg-blue-500/10 border-blue-500/30",children:n.jsx(_e,{className:"p-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:n.jsx(Is,{className:"w-6 h-6 text-blue-400"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),n.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),n.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),n.jsx(pe,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Ue,{children:n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(qc,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),n.jsx(_e,{children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),n.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Ue,{children:n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(nu,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),n.jsxs(_e,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),n.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),n.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[n.jsx("span",{className:"text-gray-300",children:"点击转化率"}),n.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Ue,{children:n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(kn,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),n.jsx(_e,{children:n.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[n.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),n.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[n.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),n.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[n.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),n.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[n.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),n.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),r==="orders"&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),n.jsx(ue,{value:C,onChange:R=>b(R.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:j,onChange:R=>N(R.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[n.jsx("option",{value:"all",children:"全部状态"}),n.jsx("option",{value:"completed",children:"已完成"}),n.jsx("option",{value:"pending",children:"待支付"}),n.jsx("option",{value:"failed",children:"已失败"})]})]}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-0",children:l.length===0?n.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[n.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:K.map(R=>{var H,X;return n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsxs("td",{className:"p-4 font-mono text-xs text-gray-400",children:[(H=R.id)==null?void 0:H.slice(0,12),"..."]}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:R.userNickname}),n.jsx("p",{className:"text-gray-500 text-xs",children:R.userPhone})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:(()=>{const V=R.productType||R.type;return V==="fullbook"?`${R.bookName||"《底层逻辑》"} - 全本`:V==="match"?"匹配次数购买":`${R.bookName||"《底层逻辑》"} - ${R.sectionTitle||R.chapterTitle||`章节${R.productId||R.sectionId||""}`}`})()}),n.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const V=R.productType||R.type;return V==="fullbook"?"全书解锁":V==="match"?"功能权益":R.chapterTitle||"单章购买"})()})]})}),n.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof R.amount=="number"?R.amount.toFixed(2):parseFloat(String(R.amount||"0")).toFixed(2)]}),n.jsx("td",{className:"p-4 text-gray-300",children:R.paymentMethod==="wechat"?"微信支付":R.paymentMethod==="alipay"?"支付宝":R.paymentMethod||"微信支付"}),n.jsx("td",{className:"p-4",children:R.status==="completed"||R.status==="paid"?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):R.status==="pending"||R.status==="created"?n.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):n.jsx(Oe,{className:"bg-red-500/20 text-red-400 border-0",children:"已失败"})}),n.jsx("td",{className:"p-4 text-gray-300 text-sm",children:R.referrerId||R.referralCode?n.jsxs("span",{title:R.referralCode||R.referrerCode||R.referrerId||"",children:[R.referrerNickname||R.referralCode||R.referrerCode||((X=R.referrerId)==null?void 0:X.slice(0,8)),(R.referralCode||R.referrerCode)&&` (${R.referralCode||R.referrerCode})`]}):"-"}),n.jsx("td",{className:"p-4 text-[#FFD700]",children:R.referrerEarnings?`¥${(typeof R.referrerEarnings=="number"?R.referrerEarnings:parseFloat(String(R.referrerEarnings))).toFixed(2)}`:"-"}),n.jsx("td",{className:"p-4 text-gray-400 text-sm",children:R.createdAt?new Date(R.createdAt).toLocaleString("zh-CN"):"-"})]},R.id)})})]})})})})]}),r==="bindings"&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),n.jsx(ue,{value:C,onChange:R=>b(R.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:j,onChange:R=>N(R.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[n.jsx("option",{value:"all",children:"全部状态"}),n.jsx("option",{value:"active",children:"有效"}),n.jsx("option",{value:"converted",children:"已转化"}),n.jsx("option",{value:"expired",children:"已过期"})]})]}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-0",children:de.length===0?n.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[n.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:de.map(R=>n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white font-medium",children:R.refereeNickname||"匿名用户"}),n.jsx("p",{className:"text-gray-500 text-xs",children:R.refereePhone})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white",children:R.referrerName||"-"}),n.jsx("p",{className:"text-gray-500 text-xs font-mono",children:R.referrerCode})]})}),n.jsx("td",{className:"p-4 text-gray-400",children:R.boundAt?new Date(R.boundAt).toLocaleDateString("zh-CN"):"-"}),n.jsx("td",{className:"p-4 text-gray-400",children:R.expiresAt?new Date(R.expiresAt).toLocaleDateString("zh-CN"):"-"}),n.jsx("td",{className:"p-4",children:le(R.status)}),n.jsx("td",{className:"p-4",children:R.commission?n.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",R.commission.toFixed(2)]}):n.jsx("span",{className:"text-gray-500",children:"-"})})]},R.id))})]})})})})]}),r==="withdrawals"&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),n.jsx(ue,{value:C,onChange:R=>b(R.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:j,onChange:R=>N(R.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[n.jsx("option",{value:"all",children:"全部状态"}),n.jsx("option",{value:"pending",children:"待审核"}),n.jsx("option",{value:"completed",children:"已完成"}),n.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{className:"p-0",children:oe.length===0?n.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[n.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),n.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:oe.map(R=>n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsx("td",{className:"p-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[R.userAvatar?n.jsx("img",{src:R.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):n.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(R.userName||R.name||"?").slice(0,1)}),n.jsx("p",{className:"text-white font-medium",children:R.userName||R.name})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",R.amount.toFixed(2)]})}),n.jsx("td",{className:"p-4",children:n.jsx(Oe,{className:R.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:R.method==="wechat"?"微信":"支付宝"})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white font-mono text-xs",children:R.account}),n.jsx("p",{className:"text-gray-500 text-xs",children:R.name})]})}),n.jsx("td",{className:"p-4 text-gray-400",children:R.createdAt?new Date(R.createdAt).toLocaleString("zh-CN"):"-"}),n.jsx("td",{className:"p-4",children:le(R.status)}),n.jsx("td",{className:"p-4 text-right",children:R.status==="pending"&&n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsxs(pe,{size:"sm",onClick:()=>Y(R.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Jc,{className:"w-4 h-4 mr-1"}),"通过"]}),n.jsxs(pe,{size:"sm",variant:"outline",onClick:()=>W(R.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[n.jsx(Nw,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},R.id))})]})})})})]})]})]})}function Zb(){const[r,a]=x.useState([]),[l,i]=x.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,d]=x.useState(!0),[f,m]=x.useState("all"),[p,g]=x.useState(null);async function v(){var C,b,j,N,P,S;d(!0);try{const A=await Ye(`/api/admin/withdrawals?status=${f}`);if(A!=null&&A.success){const U=A.withdrawals||[];a(U),i({total:((C=A.stats)==null?void 0:C.total)??U.length,pendingCount:((b=A.stats)==null?void 0:b.pendingCount)??0,pendingAmount:((j=A.stats)==null?void 0:j.pendingAmount)??0,successCount:((N=A.stats)==null?void 0:N.successCount)??0,successAmount:((P=A.stats)==null?void 0:P.successAmount)??0,failedCount:((S=A.stats)==null?void 0:S.failedCount)??0})}}catch(A){console.error("Load withdrawals error:",A)}finally{d(!1)}}x.useEffect(()=>{v()},[f]);async function y(C){const b=r.find(j=>j.id===C);if(b!=null&&b.userCommissionInfo&&b.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${b.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 -确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;g(C);try{const j=await Un("/api/admin/withdrawals",{id:C,action:"approve"});j!=null&&j.success?v():alert("操作失败: "+((j==null?void 0:j.error)??""))}catch{alert("操作失败")}finally{g(null)}}async function E(C){const b=prompt("请输入拒绝原因(将返还用户余额):");if(b){g(C);try{const j=await Un("/api/admin/withdrawals",{id:C,action:"reject",errorMessage:b});j!=null&&j.success?v():alert("操作失败: "+((j==null?void 0:j.error)??""))}catch{alert("操作失败")}finally{g(null)}}}function k(C){switch(C){case"pending":case"pending_confirm":return n.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"processing":return n.jsx(Oe,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"处理中"});case"success":case"completed":return n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return n.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return n.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:C})}}return n.jsxs("div",{className:"p-8 max-w-6xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-start mb-8",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),n.jsxs(pe,{variant:"outline",onClick:v,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),n.jsx(Re,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:n.jsx(_e,{className:"p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(lo,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),n.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[n.jsxs("p",{children:["• ",n.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",n.jsx("span",{className:"text-white font-medium",children:"90%"})]}),n.jsxs("p",{children:["• ",n.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),n.jsxs("p",{children:["• ",n.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),n.jsxs("p",{children:["• ",n.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),n.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{className:"p-4 text-center",children:[n.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),n.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{className:"p-4 text-center",children:[n.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),n.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),n.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{className:"p-4 text-center",children:[n.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),n.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),n.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{className:"p-4 text-center",children:[n.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),n.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),n.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(C=>n.jsx(pe,{variant:f===C?"default":"outline",size:"sm",onClick:()=>m(C),className:f===C?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:C==="all"?"全部":C==="pending"?"待处理":C==="success"?"已完成":"已拒绝"},C))}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(_e,{className:"p-0",children:c?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):r.length===0?n.jsxs("div",{className:"text-center py-12",children:[n.jsx(Is,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[n.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),n.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:r.map(C=>n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsx("td",{className:"p-4 text-gray-400",children:new Date(C.createdAt??"").toLocaleString()}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[C.userAvatar?n.jsx("img",{src:C.userAvatar,alt:C.userName??"",className:"w-8 h-8 rounded-full object-cover"}):n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:(C.userName??"?").charAt(0)}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium text-white",children:C.userName??"未知"}),n.jsx("p",{className:"text-xs text-gray-500",children:C.userPhone??C.referralCode??(C.userId??"").slice(0,10)})]})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(C.amount).toFixed(2)]})}),n.jsx("td",{className:"p-4",children:C.userCommissionInfo?n.jsxs("div",{className:"text-xs space-y-1",children:[n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),n.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",C.userCommissionInfo.totalCommission.toFixed(2)]})]}),n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{className:"text-gray-500",children:"已提现:"}),n.jsxs("span",{className:"text-gray-400",children:["¥",C.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{className:"text-gray-500",children:"待审核:"}),n.jsxs("span",{className:"text-orange-400",children:["¥",C.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),n.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[n.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),n.jsxs("span",{className:C.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",C.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):n.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),n.jsxs("td",{className:"p-4",children:[k(C.status),C.errorMessage&&n.jsx("p",{className:"text-xs text-red-400 mt-1",children:C.errorMessage})]}),n.jsx("td",{className:"p-4 text-gray-400",children:C.processedAt?new Date(C.processedAt).toLocaleString():"-"}),n.jsxs("td",{className:"p-4 text-right",children:[(C.status==="pending"||C.status==="pending_confirm")&&n.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n.jsxs(pe,{size:"sm",onClick:()=>y(C.id),disabled:x===C.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[n.jsx(No,{className:"w-4 h-4 mr-1"}),"批准"]}),n.jsxs(pe,{size:"sm",variant:"outline",onClick:()=>E(C.id),disabled:x===C.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[n.jsx(Ur,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(C.status==="success"||C.status==="completed")&&C.transactionId&&n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:C.transactionId})]})]},C.id))})]})})})})]})}const $r=p.forwardRef(({className:r,...a},l)=>n.jsx("textarea",{className:We("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:l,...a}));$r.displayName="Textarea";function ho(r,[a,l]){return Math.min(l,Math.max(a,r))}const Xb=["top","right","bottom","left"],yr=Math.min,Bt=Math.max,mo=Math.round,Jl=Math.floor,Cn=r=>({x:r,y:r}),qb={left:"right",right:"left",bottom:"top",top:"bottom"},Jb={start:"end",end:"start"};function iu(r,a,l){return Bt(r,yr(a,l))}function Vn(r,a){return typeof r=="function"?r(a):r}function Wn(r){return r.split("-")[0]}function Fs(r){return r.split("-")[1]}function $u(r){return r==="x"?"y":"x"}function Bu(r){return r==="y"?"height":"width"}const Zb=new Set(["top","bottom"]);function Sn(r){return Zb.has(Wn(r))?"y":"x"}function Uu(r){return $u(Sn(r))}function e2(r,a,l){l===void 0&&(l=!1);const i=Fs(r),c=Uu(r),d=Bu(c);let f=c==="x"?i===(l?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(f=po(f)),[f,po(f)]}function t2(r){const a=po(r);return[cu(r),a,cu(a)]}function cu(r){return r.replace(/start|end/g,a=>Jb[a])}const Tm=["left","right"],Im=["right","left"],n2=["top","bottom"],r2=["bottom","top"];function s2(r,a,l){switch(r){case"top":case"bottom":return l?a?Im:Tm:a?Tm:Im;case"left":case"right":return a?n2:r2;default:return[]}}function a2(r,a,l,i){const c=Fs(r);let d=s2(Wn(r),l==="start",i);return c&&(d=d.map(f=>f+"-"+c),a&&(d=d.concat(d.map(cu)))),d}function po(r){return r.replace(/left|right|bottom|top/g,a=>qb[a])}function l2(r){return{top:0,right:0,bottom:0,left:0,...r}}function Tx(r){return typeof r!="number"?l2(r):{top:r,right:r,bottom:r,left:r}}function xo(r){const{x:a,y:l,width:i,height:c}=r;return{width:i,height:c,top:l,left:a,right:a+i,bottom:l+c,x:a,y:l}}function Am(r,a,l){let{reference:i,floating:c}=r;const d=Sn(a),f=Uu(a),m=Bu(f),x=Wn(a),g=d==="y",v=i.x+i.width/2-c.width/2,y=i.y+i.height/2-c.height/2,E=i[m]/2-c[m]/2;let k;switch(x){case"top":k={x:v,y:i.y-c.height};break;case"bottom":k={x:v,y:i.y+i.height};break;case"right":k={x:i.x+i.width,y};break;case"left":k={x:i.x-c.width,y};break;default:k={x:i.x,y:i.y}}switch(Fs(a)){case"start":k[f]-=E*(l&&g?-1:1);break;case"end":k[f]+=E*(l&&g?-1:1);break}return k}async function o2(r,a){var l;a===void 0&&(a={});const{x:i,y:c,platform:d,rects:f,elements:m,strategy:x}=r,{boundary:g="clippingAncestors",rootBoundary:v="viewport",elementContext:y="floating",altBoundary:E=!1,padding:k=0}=Vn(a,r),C=Tx(k),j=m[E?y==="floating"?"reference":"floating":y],N=xo(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(j)))==null||l?j:j.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(m.floating)),boundary:g,rootBoundary:v,strategy:x})),P=y==="floating"?{x:i,y:c,width:f.floating.width,height:f.floating.height}:f.reference,S=await(d.getOffsetParent==null?void 0:d.getOffsetParent(m.floating)),A=await(d.isElement==null?void 0:d.isElement(S))?await(d.getScale==null?void 0:d.getScale(S))||{x:1,y:1}:{x:1,y:1},U=xo(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:P,offsetParent:S,strategy:x}):P);return{top:(N.top-U.top+C.top)/A.y,bottom:(U.bottom-N.bottom+C.bottom)/A.y,left:(N.left-U.left+C.left)/A.x,right:(U.right-N.right+C.right)/A.x}}const i2=async(r,a,l)=>{const{placement:i="bottom",strategy:c="absolute",middleware:d=[],platform:f}=l,m=d.filter(Boolean),x=await(f.isRTL==null?void 0:f.isRTL(a));let g=await f.getElementRects({reference:r,floating:a,strategy:c}),{x:v,y}=Am(g,i,x),E=i,k={},C=0;for(let j=0;j({name:"arrow",options:r,async fn(a){const{x:l,y:i,placement:c,rects:d,platform:f,elements:m,middlewareData:x}=a,{element:g,padding:v=0}=Vn(r,a)||{};if(g==null)return{};const y=Tx(v),E={x:l,y:i},k=Uu(c),C=Bu(k),b=await f.getDimensions(g),j=k==="y",N=j?"top":"left",P=j?"bottom":"right",S=j?"clientHeight":"clientWidth",A=d.reference[C]+d.reference[k]-E[k]-d.floating[C],U=E[k]-d.reference[k],Q=await(f.getOffsetParent==null?void 0:f.getOffsetParent(g));let Y=Q?Q[S]:0;(!Y||!await(f.isElement==null?void 0:f.isElement(Q)))&&(Y=m.floating[S]||d.floating[C]);const W=A/2-U/2,le=Y/2-b[C]/2-1,de=yr(y[N],le),oe=yr(y[P],le),K=de,R=Y-b[C]-oe,H=Y/2-b[C]/2+W,X=iu(K,H,R),V=!x.arrow&&Fs(c)!=null&&H!==X&&d.reference[C]/2-(HH<=0)){var oe,K;const H=(((oe=d.flip)==null?void 0:oe.index)||0)+1,X=Y[H];if(X&&(!(y==="alignment"?P!==Sn(X):!1)||de.every(T=>Sn(T.placement)===P?T.overflows[0]>0:!0)))return{data:{index:H,overflows:de},reset:{placement:X}};let V=(K=de.filter(B=>B.overflows[0]<=0).sort((B,T)=>B.overflows[1]-T.overflows[1])[0])==null?void 0:K.placement;if(!V)switch(k){case"bestFit":{var R;const B=(R=de.filter(T=>{if(Q){const J=Sn(T.placement);return J===P||J==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(J=>J>0).reduce((J,q)=>J+q,0)]).sort((T,J)=>T[1]-J[1])[0])==null?void 0:R[0];B&&(V=B);break}case"initialPlacement":V=m;break}if(c!==V)return{reset:{placement:V}}}return{}}}};function Mm(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function Lm(r){return Xb.some(a=>r[a]>=0)}const d2=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:i}=a,{strategy:c="referenceHidden",...d}=Vn(r,a);switch(c){case"referenceHidden":{const f=await i.detectOverflow(a,{...d,elementContext:"reference"}),m=Mm(f,l.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Lm(m)}}}case"escaped":{const f=await i.detectOverflow(a,{...d,altBoundary:!0}),m=Mm(f,l.floating);return{data:{escapedOffsets:m,escaped:Lm(m)}}}default:return{}}}}},Ix=new Set(["left","top"]);async function f2(r,a){const{placement:l,platform:i,elements:c}=r,d=await(i.isRTL==null?void 0:i.isRTL(c.floating)),f=Wn(l),m=Fs(l),x=Sn(l)==="y",g=Ix.has(f)?-1:1,v=d&&x?-1:1,y=Vn(a,r);let{mainAxis:E,crossAxis:k,alignmentAxis:C}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return m&&typeof C=="number"&&(k=m==="end"?C*-1:C),x?{x:k*v,y:E*g}:{x:E*g,y:k*v}}const h2=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,i;const{x:c,y:d,placement:f,middlewareData:m}=a,x=await f2(a,r);return f===((l=m.offset)==null?void 0:l.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:c+x.x,y:d+x.y,data:{...x,placement:f}}}}},m2=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:i,placement:c,platform:d}=a,{mainAxis:f=!0,crossAxis:m=!1,limiter:x={fn:N=>{let{x:P,y:S}=N;return{x:P,y:S}}},...g}=Vn(r,a),v={x:l,y:i},y=await d.detectOverflow(a,g),E=Sn(Wn(c)),k=$u(E);let C=v[k],b=v[E];if(f){const N=k==="y"?"top":"left",P=k==="y"?"bottom":"right",S=C+y[N],A=C-y[P];C=iu(S,C,A)}if(m){const N=E==="y"?"top":"left",P=E==="y"?"bottom":"right",S=b+y[N],A=b-y[P];b=iu(S,b,A)}const j=x.fn({...a,[k]:C,[E]:b});return{...j,data:{x:j.x-l,y:j.y-i,enabled:{[k]:f,[E]:m}}}}}},p2=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:i,placement:c,rects:d,middlewareData:f}=a,{offset:m=0,mainAxis:x=!0,crossAxis:g=!0}=Vn(r,a),v={x:l,y:i},y=Sn(c),E=$u(y);let k=v[E],C=v[y];const b=Vn(m,a),j=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(x){const S=E==="y"?"height":"width",A=d.reference[E]-d.floating[S]+j.mainAxis,U=d.reference[E]+d.reference[S]-j.mainAxis;kU&&(k=U)}if(g){var N,P;const S=E==="y"?"width":"height",A=Ix.has(Wn(c)),U=d.reference[y]-d.floating[S]+(A&&((N=f.offset)==null?void 0:N[y])||0)+(A?0:j.crossAxis),Q=d.reference[y]+d.reference[S]+(A?0:((P=f.offset)==null?void 0:P[y])||0)-(A?j.crossAxis:0);CQ&&(C=Q)}return{[E]:k,[y]:C}}}},x2=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,i;const{placement:c,rects:d,platform:f,elements:m}=a,{apply:x=()=>{},...g}=Vn(r,a),v=await f.detectOverflow(a,g),y=Wn(c),E=Fs(c),k=Sn(c)==="y",{width:C,height:b}=d.floating;let j,N;y==="top"||y==="bottom"?(j=y,N=E===(await(f.isRTL==null?void 0:f.isRTL(m.floating))?"start":"end")?"left":"right"):(N=y,j=E==="end"?"top":"bottom");const P=b-v.top-v.bottom,S=C-v.left-v.right,A=yr(b-v[j],P),U=yr(C-v[N],S),Q=!a.middlewareData.shift;let Y=A,W=U;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(W=S),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(Y=P),Q&&!E){const de=Bt(v.left,0),oe=Bt(v.right,0),K=Bt(v.top,0),R=Bt(v.bottom,0);k?W=C-2*(de!==0||oe!==0?de+oe:Bt(v.left,v.right)):Y=b-2*(K!==0||R!==0?K+R:Bt(v.top,v.bottom))}await x({...a,availableWidth:W,availableHeight:Y});const le=await f.getDimensions(m.floating);return C!==le.width||b!==le.height?{reset:{rects:!0}}:{}}}};function Io(){return typeof window<"u"}function zs(r){return Ax(r)?(r.nodeName||"").toLowerCase():"#document"}function Ut(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function Pn(r){var a;return(a=(Ax(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function Ax(r){return Io()?r instanceof Node||r instanceof Ut(r).Node:!1}function cn(r){return Io()?r instanceof Element||r instanceof Ut(r).Element:!1}function En(r){return Io()?r instanceof HTMLElement||r instanceof Ut(r).HTMLElement:!1}function Dm(r){return!Io()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Ut(r).ShadowRoot}const g2=new Set(["inline","contents"]);function Da(r){const{overflow:a,overflowX:l,overflowY:i,display:c}=un(r);return/auto|scroll|overlay|hidden|clip/.test(a+i+l)&&!g2.has(c)}const v2=new Set(["table","td","th"]);function y2(r){return v2.has(zs(r))}const w2=[":popover-open",":modal"];function Ao(r){return w2.some(a=>{try{return r.matches(a)}catch{return!1}})}const N2=["transform","translate","scale","rotate","perspective"],j2=["transform","translate","scale","rotate","perspective","filter"],b2=["paint","layout","strict","content"];function Vu(r){const a=Wu(),l=cn(r)?un(r):r;return N2.some(i=>l[i]?l[i]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||j2.some(i=>(l.willChange||"").includes(i))||b2.some(i=>(l.contain||"").includes(i))}function S2(r){let a=wr(r);for(;En(a)&&!As(a);){if(Vu(a))return a;if(Ao(a))return null;a=wr(a)}return null}function Wu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const C2=new Set(["html","body","#document"]);function As(r){return C2.has(zs(r))}function un(r){return Ut(r).getComputedStyle(r)}function Mo(r){return cn(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function wr(r){if(zs(r)==="html")return r;const a=r.assignedSlot||r.parentNode||Dm(r)&&r.host||Pn(r);return Dm(a)?a.host:a}function Mx(r){const a=wr(r);return As(a)?r.ownerDocument?r.ownerDocument.body:r.body:En(a)&&Da(a)?a:Mx(a)}function Ta(r,a,l){var i;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=Mx(r),d=c===((i=r.ownerDocument)==null?void 0:i.body),f=Ut(c);if(d){const m=uu(f);return a.concat(f,f.visualViewport||[],Da(c)?c:[],m&&l?Ta(m):[])}return a.concat(c,Ta(c,[],l))}function uu(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function Lx(r){const a=un(r);let l=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const c=En(r),d=c?r.offsetWidth:l,f=c?r.offsetHeight:i,m=mo(l)!==d||mo(i)!==f;return m&&(l=d,i=f),{width:l,height:i,$:m}}function Hu(r){return cn(r)?r:r.contextElement}function Rs(r){const a=Hu(r);if(!En(a))return Cn(1);const l=a.getBoundingClientRect(),{width:i,height:c,$:d}=Lx(a);let f=(d?mo(l.width):l.width)/i,m=(d?mo(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!m||!Number.isFinite(m))&&(m=1),{x:f,y:m}}const k2=Cn(0);function Dx(r){const a=Ut(r);return!Wu()||!a.visualViewport?k2:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function E2(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==Ut(r)?!1:a}function Hr(r,a,l,i){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),d=Hu(r);let f=Cn(1);a&&(i?cn(i)&&(f=Rs(i)):f=Rs(r));const m=E2(d,l,i)?Dx(d):Cn(0);let x=(c.left+m.x)/f.x,g=(c.top+m.y)/f.y,v=c.width/f.x,y=c.height/f.y;if(d){const E=Ut(d),k=i&&cn(i)?Ut(i):i;let C=E,b=uu(C);for(;b&&i&&k!==C;){const j=Rs(b),N=b.getBoundingClientRect(),P=un(b),S=N.left+(b.clientLeft+parseFloat(P.paddingLeft))*j.x,A=N.top+(b.clientTop+parseFloat(P.paddingTop))*j.y;x*=j.x,g*=j.y,v*=j.x,y*=j.y,x+=S,g+=A,C=Ut(b),b=uu(C)}}return xo({width:v,height:y,x,y:g})}function Lo(r,a){const l=Mo(r).scrollLeft;return a?a.left+l:Hr(Pn(r)).left+l}function Ox(r,a){const l=r.getBoundingClientRect(),i=l.left+a.scrollLeft-Lo(r,l),c=l.top+a.scrollTop;return{x:i,y:c}}function P2(r){let{elements:a,rect:l,offsetParent:i,strategy:c}=r;const d=c==="fixed",f=Pn(i),m=a?Ao(a.floating):!1;if(i===f||m&&d)return l;let x={scrollLeft:0,scrollTop:0},g=Cn(1);const v=Cn(0),y=En(i);if((y||!y&&!d)&&((zs(i)!=="body"||Da(f))&&(x=Mo(i)),En(i))){const k=Hr(i);g=Rs(i),v.x=k.x+i.clientLeft,v.y=k.y+i.clientTop}const E=f&&!y&&!d?Ox(f,x):Cn(0);return{width:l.width*g.x,height:l.height*g.y,x:l.x*g.x-x.scrollLeft*g.x+v.x+E.x,y:l.y*g.y-x.scrollTop*g.y+v.y+E.y}}function R2(r){return Array.from(r.getClientRects())}function _2(r){const a=Pn(r),l=Mo(r),i=r.ownerDocument.body,c=Bt(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),d=Bt(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let f=-l.scrollLeft+Lo(r);const m=-l.scrollTop;return un(i).direction==="rtl"&&(f+=Bt(a.clientWidth,i.clientWidth)-c),{width:c,height:d,x:f,y:m}}const Om=25;function T2(r,a){const l=Ut(r),i=Pn(r),c=l.visualViewport;let d=i.clientWidth,f=i.clientHeight,m=0,x=0;if(c){d=c.width,f=c.height;const v=Wu();(!v||v&&a==="fixed")&&(m=c.offsetLeft,x=c.offsetTop)}const g=Lo(i);if(g<=0){const v=i.ownerDocument,y=v.body,E=getComputedStyle(y),k=v.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,C=Math.abs(i.clientWidth-y.clientWidth-k);C<=Om&&(d-=C)}else g<=Om&&(d+=g);return{width:d,height:f,x:m,y:x}}const I2=new Set(["absolute","fixed"]);function A2(r,a){const l=Hr(r,!0,a==="fixed"),i=l.top+r.clientTop,c=l.left+r.clientLeft,d=En(r)?Rs(r):Cn(1),f=r.clientWidth*d.x,m=r.clientHeight*d.y,x=c*d.x,g=i*d.y;return{width:f,height:m,x,y:g}}function Fm(r,a,l){let i;if(a==="viewport")i=T2(r,l);else if(a==="document")i=_2(Pn(r));else if(cn(a))i=A2(a,l);else{const c=Dx(r);i={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return xo(i)}function Fx(r,a){const l=wr(r);return l===a||!cn(l)||As(l)?!1:un(l).position==="fixed"||Fx(l,a)}function M2(r,a){const l=a.get(r);if(l)return l;let i=Ta(r,[],!1).filter(m=>cn(m)&&zs(m)!=="body"),c=null;const d=un(r).position==="fixed";let f=d?wr(r):r;for(;cn(f)&&!As(f);){const m=un(f),x=Vu(f);!x&&m.position==="fixed"&&(c=null),(d?!x&&!c:!x&&m.position==="static"&&!!c&&I2.has(c.position)||Da(f)&&!x&&Fx(r,f))?i=i.filter(v=>v!==f):c=m,f=wr(f)}return a.set(r,i),i}function L2(r){let{element:a,boundary:l,rootBoundary:i,strategy:c}=r;const f=[...l==="clippingAncestors"?Ao(a)?[]:M2(a,this._c):[].concat(l),i],m=f[0],x=f.reduce((g,v)=>{const y=Fm(a,v,c);return g.top=Bt(y.top,g.top),g.right=yr(y.right,g.right),g.bottom=yr(y.bottom,g.bottom),g.left=Bt(y.left,g.left),g},Fm(a,m,c));return{width:x.right-x.left,height:x.bottom-x.top,x:x.left,y:x.top}}function D2(r){const{width:a,height:l}=Lx(r);return{width:a,height:l}}function O2(r,a,l){const i=En(a),c=Pn(a),d=l==="fixed",f=Hr(r,!0,d,a);let m={scrollLeft:0,scrollTop:0};const x=Cn(0);function g(){x.x=Lo(c)}if(i||!i&&!d)if((zs(a)!=="body"||Da(c))&&(m=Mo(a)),i){const k=Hr(a,!0,d,a);x.x=k.x+a.clientLeft,x.y=k.y+a.clientTop}else c&&g();d&&!i&&c&&g();const v=c&&!i&&!d?Ox(c,m):Cn(0),y=f.left+m.scrollLeft-x.x-v.x,E=f.top+m.scrollTop-x.y-v.y;return{x:y,y:E,width:f.width,height:f.height}}function Wc(r){return un(r).position==="static"}function zm(r,a){if(!En(r)||un(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return Pn(r)===l&&(l=l.ownerDocument.body),l}function zx(r,a){const l=Ut(r);if(Ao(r))return l;if(!En(r)){let c=wr(r);for(;c&&!As(c);){if(cn(c)&&!Wc(c))return c;c=wr(c)}return l}let i=zm(r,a);for(;i&&y2(i)&&Wc(i);)i=zm(i,a);return i&&As(i)&&Wc(i)&&!Vu(i)?l:i||S2(r)||l}const F2=async function(r){const a=this.getOffsetParent||zx,l=this.getDimensions,i=await l(r.floating);return{reference:O2(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function z2(r){return un(r).direction==="rtl"}const $2={convertOffsetParentRelativeRectToViewportRelativeRect:P2,getDocumentElement:Pn,getClippingRect:L2,getOffsetParent:zx,getElementRects:F2,getClientRects:R2,getDimensions:D2,getScale:Rs,isElement:cn,isRTL:z2};function $x(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function B2(r,a){let l=null,i;const c=Pn(r);function d(){var m;clearTimeout(i),(m=l)==null||m.disconnect(),l=null}function f(m,x){m===void 0&&(m=!1),x===void 0&&(x=1),d();const g=r.getBoundingClientRect(),{left:v,top:y,width:E,height:k}=g;if(m||a(),!E||!k)return;const C=Jl(y),b=Jl(c.clientWidth-(v+E)),j=Jl(c.clientHeight-(y+k)),N=Jl(v),S={rootMargin:-C+"px "+-b+"px "+-j+"px "+-N+"px",threshold:Bt(0,yr(1,x))||1};let A=!0;function U(Q){const Y=Q[0].intersectionRatio;if(Y!==x){if(!A)return f();Y?f(!1,Y):i=setTimeout(()=>{f(!1,1e-7)},1e3)}Y===1&&!$x(g,r.getBoundingClientRect())&&f(),A=!1}try{l=new IntersectionObserver(U,{...S,root:c.ownerDocument})}catch{l=new IntersectionObserver(U,S)}l.observe(r)}return f(!0),d}function U2(r,a,l,i){i===void 0&&(i={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:x=!1}=i,g=Hu(r),v=c||d?[...g?Ta(g):[],...Ta(a)]:[];v.forEach(N=>{c&&N.addEventListener("scroll",l,{passive:!0}),d&&N.addEventListener("resize",l)});const y=g&&m?B2(g,l):null;let E=-1,k=null;f&&(k=new ResizeObserver(N=>{let[P]=N;P&&P.target===g&&k&&(k.unobserve(a),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var S;(S=k)==null||S.observe(a)})),l()}),g&&!x&&k.observe(g),k.observe(a));let C,b=x?Hr(r):null;x&&j();function j(){const N=Hr(r);b&&!$x(b,N)&&l(),b=N,C=requestAnimationFrame(j)}return l(),()=>{var N;v.forEach(P=>{c&&P.removeEventListener("scroll",l),d&&P.removeEventListener("resize",l)}),y==null||y(),(N=k)==null||N.disconnect(),k=null,x&&cancelAnimationFrame(C)}}const V2=h2,W2=m2,H2=u2,K2=x2,G2=d2,$m=c2,Q2=p2,Y2=(r,a,l)=>{const i=new Map,c={platform:$2,...l},d={...c.platform,_c:i};return i2(r,a,{...c,platform:d})};var X2=typeof document<"u",q2=function(){},no=X2?p.useLayoutEffect:q2;function go(r,a){if(r===a)return!0;if(typeof r!=typeof a)return!1;if(typeof r=="function"&&r.toString()===a.toString())return!0;let l,i,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(i=l;i--!==0;)if(!go(r[i],a[i]))return!1;return!0}if(c=Object.keys(r),l=c.length,l!==Object.keys(a).length)return!1;for(i=l;i--!==0;)if(!{}.hasOwnProperty.call(a,c[i]))return!1;for(i=l;i--!==0;){const d=c[i];if(!(d==="_owner"&&r.$$typeof)&&!go(r[d],a[d]))return!1}return!0}return r!==r&&a!==a}function Bx(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function Bm(r,a){const l=Bx(r);return Math.round(a*l)/l}function Hc(r){const a=p.useRef(r);return no(()=>{a.current=r}),a}function J2(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:i=[],platform:c,elements:{reference:d,floating:f}={},transform:m=!0,whileElementsMounted:x,open:g}=r,[v,y]=p.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[E,k]=p.useState(i);go(E,i)||k(i);const[C,b]=p.useState(null),[j,N]=p.useState(null),P=p.useCallback(T=>{T!==Q.current&&(Q.current=T,b(T))},[]),S=p.useCallback(T=>{T!==Y.current&&(Y.current=T,N(T))},[]),A=d||C,U=f||j,Q=p.useRef(null),Y=p.useRef(null),W=p.useRef(v),le=x!=null,de=Hc(x),oe=Hc(c),K=Hc(g),R=p.useCallback(()=>{if(!Q.current||!Y.current)return;const T={placement:a,strategy:l,middleware:E};oe.current&&(T.platform=oe.current),Y2(Q.current,Y.current,T).then(J=>{const q={...J,isPositioned:K.current!==!1};H.current&&!go(W.current,q)&&(W.current=q,Ia.flushSync(()=>{y(q)}))})},[E,a,l,oe,K]);no(()=>{g===!1&&W.current.isPositioned&&(W.current.isPositioned=!1,y(T=>({...T,isPositioned:!1})))},[g]);const H=p.useRef(!1);no(()=>(H.current=!0,()=>{H.current=!1}),[]),no(()=>{if(A&&(Q.current=A),U&&(Y.current=U),A&&U){if(de.current)return de.current(A,U,R);R()}},[A,U,R,de,le]);const X=p.useMemo(()=>({reference:Q,floating:Y,setReference:P,setFloating:S}),[P,S]),V=p.useMemo(()=>({reference:A,floating:U}),[A,U]),B=p.useMemo(()=>{const T={position:l,left:0,top:0};if(!V.floating)return T;const J=Bm(V.floating,v.x),q=Bm(V.floating,v.y);return m?{...T,transform:"translate("+J+"px, "+q+"px)",...Bx(V.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:J,top:q}},[l,m,V.floating,v.x,v.y]);return p.useMemo(()=>({...v,update:R,refs:X,elements:V,floatingStyles:B}),[v,R,X,V,B])}const Z2=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:i,padding:c}=typeof r=="function"?r(l):r;return i&&a(i)?i.current!=null?$m({element:i.current,padding:c}).fn(l):{}:i?$m({element:i,padding:c}).fn(l):{}}}},eS=(r,a)=>({...V2(r),options:[r,a]}),tS=(r,a)=>({...W2(r),options:[r,a]}),nS=(r,a)=>({...Q2(r),options:[r,a]}),rS=(r,a)=>({...H2(r),options:[r,a]}),sS=(r,a)=>({...K2(r),options:[r,a]}),aS=(r,a)=>({...G2(r),options:[r,a]}),lS=(r,a)=>({...Z2(r),options:[r,a]});var oS="Arrow",Ux=p.forwardRef((r,a)=>{const{children:l,width:i=10,height:c=5,...d}=r;return n.jsx(Le.svg,{...d,ref:a,width:i,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ux.displayName=oS;var iS=Ux,Ku="Popper",[Vx,Wx]=jr(Ku),[cS,Hx]=Vx(Ku),Kx=r=>{const{__scopePopper:a,children:l}=r,[i,c]=p.useState(null);return n.jsx(cS,{scope:a,anchor:i,onAnchorChange:c,children:l})};Kx.displayName=Ku;var Gx="PopperAnchor",Qx=p.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:i,...c}=r,d=Hx(Gx,l),f=p.useRef(null),m=Ve(a,f),x=p.useRef(null);return p.useEffect(()=>{const g=x.current;x.current=(i==null?void 0:i.current)||f.current,g!==x.current&&d.onAnchorChange(x.current)}),i?null:n.jsx(Le.div,{...c,ref:m})});Qx.displayName=Gx;var Gu="PopperContent",[uS,dS]=Vx(Gu),Yx=p.forwardRef((r,a)=>{var ne,he,Ee,Se,Te,z;const{__scopePopper:l,side:i="bottom",sideOffset:c=0,align:d="center",alignOffset:f=0,arrowPadding:m=0,avoidCollisions:x=!0,collisionBoundary:g=[],collisionPadding:v=0,sticky:y="partial",hideWhenDetached:E=!1,updatePositionStrategy:k="optimized",onPlaced:C,...b}=r,j=Hx(Gu,l),[N,P]=p.useState(null),S=Ve(a,Ie=>P(Ie)),[A,U]=p.useState(null),Q=Du(A),Y=(Q==null?void 0:Q.width)??0,W=(Q==null?void 0:Q.height)??0,le=i+(d!=="center"?"-"+d:""),de=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},oe=Array.isArray(g)?g:[g],K=oe.length>0,R={padding:de,boundary:oe.filter(hS),altBoundary:K},{refs:H,floatingStyles:X,placement:V,isPositioned:B,middlewareData:T}=J2({strategy:"fixed",placement:le,whileElementsMounted:(...Ie)=>U2(...Ie,{animationFrame:k==="always"}),elements:{reference:j.anchor},middleware:[eS({mainAxis:c+W,alignmentAxis:f}),x&&tS({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?nS():void 0,...R}),x&&rS({...R}),sS({...R,apply:({elements:Ie,rects:ze,availableWidth:Nt,availableHeight:Vt})=>{const{width:Jt,height:Yr}=ze.reference,fn=Ie.floating.style;fn.setProperty("--radix-popper-available-width",`${Nt}px`),fn.setProperty("--radix-popper-available-height",`${Vt}px`),fn.setProperty("--radix-popper-anchor-width",`${Jt}px`),fn.setProperty("--radix-popper-anchor-height",`${Yr}px`)}}),A&&lS({element:A,padding:m}),mS({arrowWidth:Y,arrowHeight:W}),E&&aS({strategy:"referenceHidden",...R})]}),[J,q]=Jx(V),L=vr(C);Et(()=>{B&&(L==null||L())},[B,L]);const G=(ne=T.arrow)==null?void 0:ne.x,fe=(he=T.arrow)==null?void 0:he.y,se=((Ee=T.arrow)==null?void 0:Ee.centerOffset)!==0,[be,je]=p.useState();return Et(()=>{N&&je(window.getComputedStyle(N).zIndex)},[N]),n.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:B?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(Se=T.transformOrigin)==null?void 0:Se.x,(Te=T.transformOrigin)==null?void 0:Te.y].join(" "),...((z=T.hide)==null?void 0:z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:n.jsx(uS,{scope:l,placedSide:J,onArrowChange:U,arrowX:G,arrowY:fe,shouldHideArrow:se,children:n.jsx(Le.div,{"data-side":J,"data-align":q,...b,ref:S,style:{...b.style,animation:B?void 0:"none"}})})})});Yx.displayName=Gu;var Xx="PopperArrow",fS={top:"bottom",right:"left",bottom:"top",left:"right"},qx=p.forwardRef(function(a,l){const{__scopePopper:i,...c}=a,d=dS(Xx,i),f=fS[d.placedSide];return n.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:n.jsx(iS,{...c,ref:l,style:{...c.style,display:"block"}})})});qx.displayName=Xx;function hS(r){return r!==null}var mS=r=>({name:"transformOrigin",options:r,fn(a){var j,N,P;const{placement:l,rects:i,middlewareData:c}=a,f=((j=c.arrow)==null?void 0:j.centerOffset)!==0,m=f?0:r.arrowWidth,x=f?0:r.arrowHeight,[g,v]=Jx(l),y={start:"0%",center:"50%",end:"100%"}[v],E=(((N=c.arrow)==null?void 0:N.x)??0)+m/2,k=(((P=c.arrow)==null?void 0:P.y)??0)+x/2;let C="",b="";return g==="bottom"?(C=f?y:`${E}px`,b=`${-x}px`):g==="top"?(C=f?y:`${E}px`,b=`${i.floating.height+x}px`):g==="right"?(C=`${-x}px`,b=f?y:`${k}px`):g==="left"&&(C=`${i.floating.width+x}px`,b=f?y:`${k}px`),{data:{x:C,y:b}}}});function Jx(r){const[a,l="center"]=r.split("-");return[a,l]}var pS=Kx,xS=Qx,gS=Yx,vS=qx,Zx=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),yS="VisuallyHidden",wS=p.forwardRef((r,a)=>n.jsx(Le.span,{...r,ref:a,style:{...Zx,...r.style}}));wS.displayName=yS;var NS=[" ","Enter","ArrowUp","ArrowDown"],jS=[" ","Enter"],Kr="Select",[Do,Oo,bS]=Ou(Kr),[$s]=jr(Kr,[bS,Wx]),Fo=Wx(),[SS,br]=$s(Kr),[CS,kS]=$s(Kr),eg=r=>{const{__scopeSelect:a,children:l,open:i,defaultOpen:c,onOpenChange:d,value:f,defaultValue:m,onValueChange:x,dir:g,name:v,autoComplete:y,disabled:E,required:k,form:C}=r,b=Fo(a),[j,N]=p.useState(null),[P,S]=p.useState(null),[A,U]=p.useState(!1),Q=Ro(g),[Y,W]=Vr({prop:i,defaultProp:c??!1,onChange:d,caller:Kr}),[le,de]=Vr({prop:f,defaultProp:m,onChange:x,caller:Kr}),oe=p.useRef(null),K=j?C||!!j.closest("form"):!0,[R,H]=p.useState(new Set),X=Array.from(R).map(V=>V.props.value).join(";");return n.jsx(pS,{...b,children:n.jsxs(SS,{required:k,scope:a,trigger:j,onTriggerChange:N,valueNode:P,onValueNodeChange:S,valueNodeHasChildren:A,onValueNodeHasChildrenChange:U,contentId:gr(),value:le,onValueChange:de,open:Y,onOpenChange:W,dir:Q,triggerPointerDownPosRef:oe,disabled:E,children:[n.jsx(Do.Provider,{scope:a,children:n.jsx(CS,{scope:r.__scopeSelect,onNativeOptionAdd:p.useCallback(V=>{H(B=>new Set(B).add(V))},[]),onNativeOptionRemove:p.useCallback(V=>{H(B=>{const T=new Set(B);return T.delete(V),T})},[]),children:l})}),K?n.jsxs(jg,{"aria-hidden":!0,required:k,tabIndex:-1,name:v,autoComplete:y,value:le,onChange:V=>de(V.target.value),disabled:E,form:C,children:[le===void 0?n.jsx("option",{value:""}):null,Array.from(R)]},X):null]})})};eg.displayName=Kr;var tg="SelectTrigger",ng=p.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:i=!1,...c}=r,d=Fo(l),f=br(tg,l),m=f.disabled||i,x=Ve(a,f.onTriggerChange),g=Oo(l),v=p.useRef("touch"),[y,E,k]=Sg(b=>{const j=g().filter(S=>!S.disabled),N=j.find(S=>S.value===f.value),P=Cg(j,b,N);P!==void 0&&f.onValueChange(P.value)}),C=b=>{m||(f.onOpenChange(!0),k()),b&&(f.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return n.jsx(xS,{asChild:!0,...d,children:n.jsx(Le.button,{type:"button",role:"combobox","aria-controls":f.contentId,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":bg(f.value)?"":void 0,...c,ref:x,onClick:Ae(c.onClick,b=>{b.currentTarget.focus(),v.current!=="mouse"&&C(b)}),onPointerDown:Ae(c.onPointerDown,b=>{v.current=b.pointerType;const j=b.target;j.hasPointerCapture(b.pointerId)&&j.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(C(b),b.preventDefault())}),onKeyDown:Ae(c.onKeyDown,b=>{const j=y.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&E(b.key),!(j&&b.key===" ")&&NS.includes(b.key)&&(C(),b.preventDefault())})})})});ng.displayName=tg;var rg="SelectValue",sg=p.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,children:d,placeholder:f="",...m}=r,x=br(rg,l),{onValueNodeHasChildrenChange:g}=x,v=d!==void 0,y=Ve(a,x.onValueNodeChange);return Et(()=>{g(v)},[g,v]),n.jsx(Le.span,{...m,ref:y,style:{pointerEvents:"none"},children:bg(x.value)?n.jsx(n.Fragment,{children:f}):d})});sg.displayName=rg;var ES="SelectIcon",ag=p.forwardRef((r,a)=>{const{__scopeSelect:l,children:i,...c}=r;return n.jsx(Le.span,{"aria-hidden":!0,...c,ref:a,children:i||"▼"})});ag.displayName=ES;var PS="SelectPortal",lg=r=>n.jsx(_u,{asChild:!0,...r});lg.displayName=PS;var Gr="SelectContent",og=p.forwardRef((r,a)=>{const l=br(Gr,r.__scopeSelect),[i,c]=p.useState();if(Et(()=>{c(new DocumentFragment)},[]),!l.open){const d=i;return d?Ia.createPortal(n.jsx(ig,{scope:r.__scopeSelect,children:n.jsx(Do.Slot,{scope:r.__scopeSelect,children:n.jsx("div",{children:r.children})})}),d):null}return n.jsx(cg,{...r,ref:a})});og.displayName=Gr;var ln=10,[ig,Sr]=$s(Gr),RS="SelectContentImpl",_S=_a("SelectContent.RemoveScroll"),cg=p.forwardRef((r,a)=>{const{__scopeSelect:l,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,side:m,sideOffset:x,align:g,alignOffset:v,arrowPadding:y,collisionBoundary:E,collisionPadding:k,sticky:C,hideWhenDetached:b,avoidCollisions:j,...N}=r,P=br(Gr,l),[S,A]=p.useState(null),[U,Q]=p.useState(null),Y=Ve(a,ne=>A(ne)),[W,le]=p.useState(null),[de,oe]=p.useState(null),K=Oo(l),[R,H]=p.useState(!1),X=p.useRef(!1);p.useEffect(()=>{if(S)return Vp(S)},[S]),Mp();const V=p.useCallback(ne=>{const[he,...Ee]=K().map(z=>z.ref.current),[Se]=Ee.slice(-1),Te=document.activeElement;for(const z of ne)if(z===Te||(z==null||z.scrollIntoView({block:"nearest"}),z===he&&U&&(U.scrollTop=0),z===Se&&U&&(U.scrollTop=U.scrollHeight),z==null||z.focus(),document.activeElement!==Te))return},[K,U]),B=p.useCallback(()=>V([W,S]),[V,W,S]);p.useEffect(()=>{R&&B()},[R,B]);const{onOpenChange:T,triggerPointerDownPosRef:J}=P;p.useEffect(()=>{if(S){let ne={x:0,y:0};const he=Se=>{var Te,z;ne={x:Math.abs(Math.round(Se.pageX)-(((Te=J.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(Se.pageY)-(((z=J.current)==null?void 0:z.y)??0))}},Ee=Se=>{ne.x<=10&&ne.y<=10?Se.preventDefault():S.contains(Se.target)||T(!1),document.removeEventListener("pointermove",he),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",Ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",Ee,{capture:!0})}}},[S,T,J]),p.useEffect(()=>{const ne=()=>T(!1);return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[T]);const[q,L]=Sg(ne=>{const he=K().filter(Te=>!Te.disabled),Ee=he.find(Te=>Te.ref.current===document.activeElement),Se=Cg(he,ne,Ee);Se&&setTimeout(()=>Se.ref.current.focus())}),G=p.useCallback((ne,he,Ee)=>{const Se=!X.current&&!Ee;(P.value!==void 0&&P.value===he||Se)&&(le(ne),Se&&(X.current=!0))},[P.value]),fe=p.useCallback(()=>S==null?void 0:S.focus(),[S]),se=p.useCallback((ne,he,Ee)=>{const Se=!X.current&&!Ee;(P.value!==void 0&&P.value===he||Se)&&oe(ne)},[P.value]),be=i==="popper"?du:ug,je=be===du?{side:m,sideOffset:x,align:g,alignOffset:v,arrowPadding:y,collisionBoundary:E,collisionPadding:k,sticky:C,hideWhenDetached:b,avoidCollisions:j}:{};return n.jsx(ig,{scope:l,content:S,viewport:U,onViewportChange:Q,itemRefCallback:G,selectedItem:W,onItemLeave:fe,itemTextRefCallback:se,focusSelectedItem:B,selectedItemText:de,position:i,isPositioned:R,searchRef:q,children:n.jsx(Tu,{as:_S,allowPinchZoom:!0,children:n.jsx(Ru,{asChild:!0,trapped:P.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:Ae(c,ne=>{var he;(he=P.trigger)==null||he.focus({preventScroll:!0}),ne.preventDefault()}),children:n.jsx(Pu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>P.onOpenChange(!1),children:n.jsx(be,{role:"listbox",id:P.contentId,"data-state":P.open?"open":"closed",dir:P.dir,onContextMenu:ne=>ne.preventDefault(),...N,...je,onPlaced:()=>H(!0),ref:Y,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Ae(N.onKeyDown,ne=>{const he=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!he&&ne.key.length===1&&L(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let Se=K().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(Se=Se.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Te=ne.target,z=Se.indexOf(Te);Se=Se.slice(z+1)}setTimeout(()=>V(Se)),ne.preventDefault()}})})})})})})});cg.displayName=RS;var TS="SelectItemAlignedPosition",ug=p.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:i,...c}=r,d=br(Gr,l),f=Sr(Gr,l),[m,x]=p.useState(null),[g,v]=p.useState(null),y=Ve(a,Y=>v(Y)),E=Oo(l),k=p.useRef(!1),C=p.useRef(!0),{viewport:b,selectedItem:j,selectedItemText:N,focusSelectedItem:P}=f,S=p.useCallback(()=>{if(d.trigger&&d.valueNode&&m&&g&&b&&j&&N){const Y=d.trigger.getBoundingClientRect(),W=g.getBoundingClientRect(),le=d.valueNode.getBoundingClientRect(),de=N.getBoundingClientRect();if(d.dir!=="rtl"){const Te=de.left-W.left,z=le.left-Te,Ie=Y.left-z,ze=Y.width+Ie,Nt=Math.max(ze,W.width),Vt=window.innerWidth-ln,Jt=ho(z,[ln,Math.max(ln,Vt-Nt)]);m.style.minWidth=ze+"px",m.style.left=Jt+"px"}else{const Te=W.right-de.right,z=window.innerWidth-le.right-Te,Ie=window.innerWidth-Y.right-z,ze=Y.width+Ie,Nt=Math.max(ze,W.width),Vt=window.innerWidth-ln,Jt=ho(z,[ln,Math.max(ln,Vt-Nt)]);m.style.minWidth=ze+"px",m.style.right=Jt+"px"}const oe=E(),K=window.innerHeight-ln*2,R=b.scrollHeight,H=window.getComputedStyle(g),X=parseInt(H.borderTopWidth,10),V=parseInt(H.paddingTop,10),B=parseInt(H.borderBottomWidth,10),T=parseInt(H.paddingBottom,10),J=X+V+R+T+B,q=Math.min(j.offsetHeight*5,J),L=window.getComputedStyle(b),G=parseInt(L.paddingTop,10),fe=parseInt(L.paddingBottom,10),se=Y.top+Y.height/2-ln,be=K-se,je=j.offsetHeight/2,ne=j.offsetTop+je,he=X+V+ne,Ee=J-he;if(he<=se){const Te=oe.length>0&&j===oe[oe.length-1].ref.current;m.style.bottom="0px";const z=g.clientHeight-b.offsetTop-b.offsetHeight,Ie=Math.max(be,je+(Te?fe:0)+z+B),ze=he+Ie;m.style.height=ze+"px"}else{const Te=oe.length>0&&j===oe[0].ref.current;m.style.top="0px";const Ie=Math.max(se,X+b.offsetTop+(Te?G:0)+je)+Ee;m.style.height=Ie+"px",b.scrollTop=he-se+b.offsetTop}m.style.margin=`${ln}px 0`,m.style.minHeight=q+"px",m.style.maxHeight=K+"px",i==null||i(),requestAnimationFrame(()=>k.current=!0)}},[E,d.trigger,d.valueNode,m,g,b,j,N,d.dir,i]);Et(()=>S(),[S]);const[A,U]=p.useState();Et(()=>{g&&U(window.getComputedStyle(g).zIndex)},[g]);const Q=p.useCallback(Y=>{Y&&C.current===!0&&(S(),P==null||P(),C.current=!1)},[S,P]);return n.jsx(AS,{scope:l,contentWrapper:m,shouldExpandOnScrollRef:k,onScrollButtonChange:Q,children:n.jsx("div",{ref:x,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:n.jsx(Le.div,{...c,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});ug.displayName=TS;var IS="SelectPopperPosition",du=p.forwardRef((r,a)=>{const{__scopeSelect:l,align:i="start",collisionPadding:c=ln,...d}=r,f=Fo(l);return n.jsx(gS,{...f,...d,ref:a,align:i,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});du.displayName=IS;var[AS,Qu]=$s(Gr,{}),fu="SelectViewport",dg=p.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:i,...c}=r,d=Sr(fu,l),f=Qu(fu,l),m=Ve(a,d.onViewportChange),x=p.useRef(0);return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),n.jsx(Do.Slot,{scope:l,children:n.jsx(Le.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Ae(c.onScroll,g=>{const v=g.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:E}=f;if(E!=null&&E.current&&y){const k=Math.abs(x.current-v.scrollTop);if(k>0){const C=window.innerHeight-ln*2,b=parseFloat(y.style.minHeight),j=parseFloat(y.style.height),N=Math.max(b,j);if(N0?A:0,y.style.justifyContent="flex-end")}}}x.current=v.scrollTop})})})]})});dg.displayName=fu;var fg="SelectGroup",[MS,LS]=$s(fg),DS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=gr();return n.jsx(MS,{scope:l,id:c,children:n.jsx(Le.div,{role:"group","aria-labelledby":c,...i,ref:a})})});DS.displayName=fg;var hg="SelectLabel",OS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=LS(hg,l);return n.jsx(Le.div,{id:c.id,...i,ref:a})});OS.displayName=hg;var vo="SelectItem",[FS,mg]=$s(vo),pg=p.forwardRef((r,a)=>{const{__scopeSelect:l,value:i,disabled:c=!1,textValue:d,...f}=r,m=br(vo,l),x=Sr(vo,l),g=m.value===i,[v,y]=p.useState(d??""),[E,k]=p.useState(!1),C=Ve(a,P=>{var S;return(S=x.itemRefCallback)==null?void 0:S.call(x,P,i,c)}),b=gr(),j=p.useRef("touch"),N=()=>{c||(m.onValueChange(i),m.onOpenChange(!1))};if(i==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return n.jsx(FS,{scope:l,value:i,disabled:c,textId:b,isSelected:g,onItemTextChange:p.useCallback(P=>{y(S=>S||((P==null?void 0:P.textContent)??"").trim())},[]),children:n.jsx(Do.ItemSlot,{scope:l,value:i,disabled:c,textValue:v,children:n.jsx(Le.div,{role:"option","aria-labelledby":b,"data-highlighted":E?"":void 0,"aria-selected":g&&E,"data-state":g?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...f,ref:C,onFocus:Ae(f.onFocus,()=>k(!0)),onBlur:Ae(f.onBlur,()=>k(!1)),onClick:Ae(f.onClick,()=>{j.current!=="mouse"&&N()}),onPointerUp:Ae(f.onPointerUp,()=>{j.current==="mouse"&&N()}),onPointerDown:Ae(f.onPointerDown,P=>{j.current=P.pointerType}),onPointerMove:Ae(f.onPointerMove,P=>{var S;j.current=P.pointerType,c?(S=x.onItemLeave)==null||S.call(x):j.current==="mouse"&&P.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(f.onPointerLeave,P=>{var S;P.currentTarget===document.activeElement&&((S=x.onItemLeave)==null||S.call(x))}),onKeyDown:Ae(f.onKeyDown,P=>{var A;((A=x.searchRef)==null?void 0:A.current)!==""&&P.key===" "||(jS.includes(P.key)&&N(),P.key===" "&&P.preventDefault())})})})})});pg.displayName=vo;var Ea="SelectItemText",xg=p.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,...d}=r,f=br(Ea,l),m=Sr(Ea,l),x=mg(Ea,l),g=kS(Ea,l),[v,y]=p.useState(null),E=Ve(a,N=>y(N),x.onItemTextChange,N=>{var P;return(P=m.itemTextRefCallback)==null?void 0:P.call(m,N,x.value,x.disabled)}),k=v==null?void 0:v.textContent,C=p.useMemo(()=>n.jsx("option",{value:x.value,disabled:x.disabled,children:k},x.value),[x.disabled,x.value,k]),{onNativeOptionAdd:b,onNativeOptionRemove:j}=g;return Et(()=>(b(C),()=>j(C)),[b,j,C]),n.jsxs(n.Fragment,{children:[n.jsx(Le.span,{id:x.textId,...d,ref:E}),x.isSelected&&f.valueNode&&!f.valueNodeHasChildren?Ia.createPortal(d.children,f.valueNode):null]})});xg.displayName=Ea;var gg="SelectItemIndicator",vg=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return mg(gg,l).isSelected?n.jsx(Le.span,{"aria-hidden":!0,...i,ref:a}):null});vg.displayName=gg;var hu="SelectScrollUpButton",yg=p.forwardRef((r,a)=>{const l=Sr(hu,r.__scopeSelect),i=Qu(hu,r.__scopeSelect),[c,d]=p.useState(!1),f=Ve(a,i.onScrollButtonChange);return Et(()=>{if(l.viewport&&l.isPositioned){let m=function(){const g=x.scrollTop>0;d(g)};const x=l.viewport;return m(),x.addEventListener("scroll",m),()=>x.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?n.jsx(Ng,{...r,ref:f,onAutoScroll:()=>{const{viewport:m,selectedItem:x}=l;m&&x&&(m.scrollTop=m.scrollTop-x.offsetHeight)}}):null});yg.displayName=hu;var mu="SelectScrollDownButton",wg=p.forwardRef((r,a)=>{const l=Sr(mu,r.__scopeSelect),i=Qu(mu,r.__scopeSelect),[c,d]=p.useState(!1),f=Ve(a,i.onScrollButtonChange);return Et(()=>{if(l.viewport&&l.isPositioned){let m=function(){const g=x.scrollHeight-x.clientHeight,v=Math.ceil(x.scrollTop)x.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?n.jsx(Ng,{...r,ref:f,onAutoScroll:()=>{const{viewport:m,selectedItem:x}=l;m&&x&&(m.scrollTop=m.scrollTop+x.offsetHeight)}}):null});wg.displayName=mu;var Ng=p.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:i,...c}=r,d=Sr("SelectScrollButton",l),f=p.useRef(null),m=Oo(l),x=p.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return p.useEffect(()=>()=>x(),[x]),Et(()=>{var v;const g=m().find(y=>y.ref.current===document.activeElement);(v=g==null?void 0:g.ref.current)==null||v.scrollIntoView({block:"nearest"})},[m]),n.jsx(Le.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Ae(c.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(i,50))}),onPointerMove:Ae(c.onPointerMove,()=>{var g;(g=d.onItemLeave)==null||g.call(d),f.current===null&&(f.current=window.setInterval(i,50))}),onPointerLeave:Ae(c.onPointerLeave,()=>{x()})})}),zS="SelectSeparator",$S=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return n.jsx(Le.div,{"aria-hidden":!0,...i,ref:a})});$S.displayName=zS;var pu="SelectArrow",BS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=Fo(l),d=br(pu,l),f=Sr(pu,l);return d.open&&f.position==="popper"?n.jsx(vS,{...c,...i,ref:a}):null});BS.displayName=pu;var US="SelectBubbleInput",jg=p.forwardRef(({__scopeSelect:r,value:a,...l},i)=>{const c=p.useRef(null),d=Ve(i,c),f=Lu(a);return p.useEffect(()=>{const m=c.current;if(!m)return;const x=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(x,"value").set;if(f!==a&&v){const y=new Event("change",{bubbles:!0});v.call(m,a),m.dispatchEvent(y)}},[f,a]),n.jsx(Le.select,{...l,style:{...Zx,...l.style},ref:d,defaultValue:a})});jg.displayName=US;function bg(r){return r===""||r===void 0}function Sg(r){const a=vr(r),l=p.useRef(""),i=p.useRef(0),c=p.useCallback(f=>{const m=l.current+f;a(m),(function x(g){l.current=g,window.clearTimeout(i.current),g!==""&&(i.current=window.setTimeout(()=>x(""),1e3))})(m)},[a]),d=p.useCallback(()=>{l.current="",window.clearTimeout(i.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(i.current),[]),[l,c,d]}function Cg(r,a,l){const c=a.length>1&&Array.from(a).every(g=>g===a[0])?a[0]:a,d=l?r.indexOf(l):-1;let f=VS(r,Math.max(d,0));c.length===1&&(f=f.filter(g=>g!==l));const x=f.find(g=>g.textValue.toLowerCase().startsWith(c.toLowerCase()));return x!==l?x:void 0}function VS(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var WS=eg,kg=ng,HS=sg,KS=ag,GS=lg,Eg=og,QS=dg,Pg=pg,YS=xg,XS=vg,qS=yg,JS=wg;const Kc=WS,Gc=HS,ro=p.forwardRef(({className:r,children:a,...l},i)=>n.jsxs(kg,{ref:i,className:We("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",r),...l,children:[a,n.jsx(KS,{asChild:!0,children:n.jsx(rp,{className:"h-4 w-4 opacity-50"})})]}));ro.displayName=kg.displayName;const so=p.forwardRef(({className:r,children:a,position:l="popper",...i},c)=>n.jsx(GS,{children:n.jsxs(Eg,{ref:c,className:We("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",l==="popper"&&"data-[side=bottom]:translate-y-1",r),position:l,...i,children:[n.jsx(qS,{className:"flex cursor-default items-center justify-center py-1",children:n.jsx(hw,{className:"h-4 w-4"})}),n.jsx(QS,{className:"p-1",children:a}),n.jsx(JS,{className:"flex cursor-default items-center justify-center py-1",children:n.jsx(rp,{className:"h-4 w-4"})})]})}));so.displayName=Eg.displayName;const mr=p.forwardRef(({className:r,children:a,...l},i)=>n.jsxs(Pg,{ref:i,className:We("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...l,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(XS,{children:n.jsx(No,{className:"h-4 w-4"})})}),n.jsx(YS,{children:a})]}));mr.displayName=Pg.displayName;function ZS(r){const a=new Map;for(const l of r){const i=l.partId||"part-1",c=l.partTitle||"未分类",d=l.chapterId||"chapter-1",f=l.chapterTitle||"未分类";a.has(i)||a.set(i,{id:i,title:c,chapters:new Map});const m=a.get(i);m.chapters.has(d)||m.chapters.set(d,{id:d,title:f,sections:[]}),m.chapters.get(d).sections.push({id:l.id,title:l.title,price:l.price??1,filePath:l.filePath,isFree:l.isFree})}return Array.from(a.values()).map(l=>({...l,chapters:Array.from(l.chapters.values())}))}function eC(r,a){const l=r.split(` -`),i=[];let c=null,d=[],f=1;for(const m of l){const x=m.match(/^#+\s+(.+)$/)||m.match(/^(\d+[.\、]\s*.+)$/);x?(c&&(c.content=d.join(` -`).trim(),c.content&&i.push(c)),c={id:`import-${f}`,title:x[1].replace(/^#+\s*/,"").trim(),price:1,isFree:f<=3},d=[],f++):c?d.push(m):m.trim()&&(c={id:`import-${f}`,title:a.replace(/\.(txt|md|markdown)$/i,""),price:1,isFree:!0},d.push(m),f++)}return c&&(c.content=d.join(` -`).trim(),c.content&&i.push(c)),i}function tC(){const[r,a]=p.useState([]),[l,i]=p.useState(!0),[c,d]=p.useState([]),[f,m]=p.useState(null),[x,g]=p.useState(!1),[v,y]=p.useState(!1),[E,k]=p.useState(!1),[C,b]=p.useState(!1),[j,N]=p.useState(""),[P,S]=p.useState(!1),[A,U]=p.useState(!1),[Q,Y]=p.useState(!1),[W,le]=p.useState(""),[de,oe]=p.useState(!1),[K,R]=p.useState(!1),[H,X]=p.useState(""),[V,B]=p.useState([]),[T,J]=p.useState(!1),[q,L]=p.useState(!1),G=p.useRef(null),fe=p.useRef(null),[se,be]=p.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),je=ZS(r),ne=r.length,he=async()=>{i(!0);try{const $=await Ye("/api/db/book?action=list");a(Array.isArray($==null?void 0:$.sections)?$.sections:[]),c.length===0&&je.length>0&&d([je[0].id])}catch($){console.error($),a([])}finally{i(!1)}};p.useEffect(()=>{he()},[]),p.useEffect(()=>{!l&&je.length>0&&c.length===0&&d([je[0].id])},[l,je.length,c.length]);const Ee=$=>{d(ce=>ce.includes($)?ce.filter(st=>st!==$):[...ce,$])},Se=async $=>{oe(!0);try{const ce=await Ye(`/api/db/book?action=read&id=${encodeURIComponent($.id)}`);ce!=null&&ce.success&&ce.section?m({id:$.id,title:ce.section.title??$.title,price:ce.section.price??$.price,content:ce.section.content??"",filePath:$.filePath,isFree:$.isFree||$.price===0}):(m({id:$.id,title:$.title,price:$.price,content:"",filePath:$.filePath,isFree:$.isFree}),ce&&!ce.success&&alert("无法读取文件内容: "+(ce.error||"未知错误")))}catch(ce){console.error(ce),m({id:$.id,title:$.title,price:$.price,content:"",filePath:$.filePath,isFree:$.isFree})}finally{oe(!1)}},Te=async()=>{var $;if(f){R(!0);try{let ce=f.content||"";const st=[new RegExp(`^#+\\s*${f.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${f.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${($=f.title)==null?void 0:$.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const Dt of st)ce=ce.replace(Dt,"");ce=ce.replace(/^\s*\n+/,"").trim();const Be=await Un("/api/db/book",{id:f.id,title:f.title,price:f.isFree?0:f.price,content:ce,isFree:f.isFree||f.price===0,saveToFile:!0});Be&&Be.success!==!1?(alert(`已保存章节: ${f.title}`),m(null),he()):alert("保存失败: "+(Be&&typeof Be=="object"&&"error"in Be?Be.error:"未知错误"))}catch(ce){console.error(ce),alert("保存失败")}finally{R(!1)}}},z=async()=>{if(!se.id||!se.title){alert("请填写章节ID和标题");return}R(!0);try{const $=await Un("/api/db/book",{id:se.id,title:se.title,price:se.price,content:se.content,partId:se.partId,chapterId:se.chapterId,saveToFile:!1});$&&$.success!==!1?(alert(`章节创建成功: ${se.title}`),Y(!1),be({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),he()):alert("创建失败: "+($&&typeof $=="object"&&"error"in $?$.error:"未知错误"))}catch($){console.error($),alert("创建失败")}finally{R(!1)}},Ie=async $=>{var st,Be;const ce=(st=$.target.files)==null?void 0:st[0];if(ce){L(!0);try{const Dt=new FormData;Dt.append("file",ce),Dt.append("folder","book-images");const ct=await(await fetch(ru("/api/upload"),{method:"POST",body:Dt,credentials:"include"})).json();if(ct!=null&&ct.success&&((Be=ct==null?void 0:ct.data)!=null&&Be.url)){const mn=`![${ce.name}](${ct.data.url})`;f&&m({...f,content:(f.content||"")+` +确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;g(C);try{const j=await Un("/api/admin/withdrawals",{id:C,action:"approve"});j!=null&&j.success?v():alert("操作失败: "+((j==null?void 0:j.error)??""))}catch{alert("操作失败")}finally{g(null)}}async function E(C){const b=prompt("请输入拒绝原因(将返还用户余额):");if(b){g(C);try{const j=await Un("/api/admin/withdrawals",{id:C,action:"reject",errorMessage:b});j!=null&&j.success?v():alert("操作失败: "+((j==null?void 0:j.error)??""))}catch{alert("操作失败")}finally{g(null)}}}function k(C){switch(C){case"pending":case"pending_confirm":return n.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"processing":return n.jsx(Oe,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"处理中"});case"success":case"completed":return n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return n.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return n.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:C})}}return n.jsxs("div",{className:"p-8 max-w-6xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-start mb-8",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),n.jsxs(pe,{variant:"outline",onClick:v,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),n.jsx(Re,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:n.jsx(_e,{className:"p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(lo,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),n.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[n.jsxs("p",{children:["• ",n.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",n.jsx("span",{className:"text-white font-medium",children:"90%"})]}),n.jsxs("p",{children:["• ",n.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),n.jsxs("p",{children:["• ",n.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),n.jsxs("p",{children:["• ",n.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),n.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{className:"p-4 text-center",children:[n.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),n.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{className:"p-4 text-center",children:[n.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),n.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),n.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{className:"p-4 text-center",children:[n.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),n.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),n.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{className:"p-4 text-center",children:[n.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),n.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),n.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(C=>n.jsx(pe,{variant:f===C?"default":"outline",size:"sm",onClick:()=>m(C),className:f===C?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:C==="all"?"全部":C==="pending"?"待处理":C==="success"?"已完成":"已拒绝"},C))}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(_e,{className:"p-0",children:c?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):r.length===0?n.jsxs("div",{className:"text-center py-12",children:[n.jsx(Is,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[n.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),n.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:r.map(C=>n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsx("td",{className:"p-4 text-gray-400",children:new Date(C.createdAt??"").toLocaleString()}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[C.userAvatar?n.jsx("img",{src:C.userAvatar,alt:C.userName??"",className:"w-8 h-8 rounded-full object-cover"}):n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:(C.userName??"?").charAt(0)}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium text-white",children:C.userName??"未知"}),n.jsx("p",{className:"text-xs text-gray-500",children:C.userPhone??C.referralCode??(C.userId??"").slice(0,10)})]})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(C.amount).toFixed(2)]})}),n.jsx("td",{className:"p-4",children:C.userCommissionInfo?n.jsxs("div",{className:"text-xs space-y-1",children:[n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),n.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",C.userCommissionInfo.totalCommission.toFixed(2)]})]}),n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{className:"text-gray-500",children:"已提现:"}),n.jsxs("span",{className:"text-gray-400",children:["¥",C.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{className:"text-gray-500",children:"待审核:"}),n.jsxs("span",{className:"text-orange-400",children:["¥",C.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),n.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[n.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),n.jsxs("span",{className:C.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",C.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):n.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),n.jsxs("td",{className:"p-4",children:[k(C.status),C.errorMessage&&n.jsx("p",{className:"text-xs text-red-400 mt-1",children:C.errorMessage})]}),n.jsx("td",{className:"p-4 text-gray-400",children:C.processedAt?new Date(C.processedAt).toLocaleString():"-"}),n.jsxs("td",{className:"p-4 text-right",children:[(C.status==="pending"||C.status==="pending_confirm")&&n.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n.jsxs(pe,{size:"sm",onClick:()=>y(C.id),disabled:p===C.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[n.jsx(No,{className:"w-4 h-4 mr-1"}),"批准"]}),n.jsxs(pe,{size:"sm",variant:"outline",onClick:()=>E(C.id),disabled:p===C.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[n.jsx(Ur,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(C.status==="success"||C.status==="completed")&&C.transactionId&&n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:C.transactionId})]})]},C.id))})]})})})})]})}const $r=x.forwardRef(({className:r,...a},l)=>n.jsx("textarea",{className:We("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:l,...a}));$r.displayName="Textarea";function ho(r,[a,l]){return Math.min(l,Math.max(a,r))}const e2=["top","right","bottom","left"],yr=Math.min,Bt=Math.max,mo=Math.round,Jl=Math.floor,Cn=r=>({x:r,y:r}),t2={left:"right",right:"left",bottom:"top",top:"bottom"},n2={start:"end",end:"start"};function iu(r,a,l){return Bt(r,yr(a,l))}function Vn(r,a){return typeof r=="function"?r(a):r}function Wn(r){return r.split("-")[0]}function Fs(r){return r.split("-")[1]}function Bu(r){return r==="x"?"y":"x"}function Uu(r){return r==="y"?"height":"width"}const r2=new Set(["top","bottom"]);function Sn(r){return r2.has(Wn(r))?"y":"x"}function Vu(r){return Bu(Sn(r))}function s2(r,a,l){l===void 0&&(l=!1);const i=Fs(r),c=Vu(r),d=Uu(c);let f=c==="x"?i===(l?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(f=po(f)),[f,po(f)]}function a2(r){const a=po(r);return[cu(r),a,cu(a)]}function cu(r){return r.replace(/start|end/g,a=>n2[a])}const Im=["left","right"],Am=["right","left"],l2=["top","bottom"],o2=["bottom","top"];function i2(r,a,l){switch(r){case"top":case"bottom":return l?a?Am:Im:a?Im:Am;case"left":case"right":return a?l2:o2;default:return[]}}function c2(r,a,l,i){const c=Fs(r);let d=i2(Wn(r),l==="start",i);return c&&(d=d.map(f=>f+"-"+c),a&&(d=d.concat(d.map(cu)))),d}function po(r){return r.replace(/left|right|bottom|top/g,a=>t2[a])}function u2(r){return{top:0,right:0,bottom:0,left:0,...r}}function Ix(r){return typeof r!="number"?u2(r):{top:r,right:r,bottom:r,left:r}}function xo(r){const{x:a,y:l,width:i,height:c}=r;return{width:i,height:c,top:l,left:a,right:a+i,bottom:l+c,x:a,y:l}}function Mm(r,a,l){let{reference:i,floating:c}=r;const d=Sn(a),f=Vu(a),m=Uu(f),p=Wn(a),g=d==="y",v=i.x+i.width/2-c.width/2,y=i.y+i.height/2-c.height/2,E=i[m]/2-c[m]/2;let k;switch(p){case"top":k={x:v,y:i.y-c.height};break;case"bottom":k={x:v,y:i.y+i.height};break;case"right":k={x:i.x+i.width,y};break;case"left":k={x:i.x-c.width,y};break;default:k={x:i.x,y:i.y}}switch(Fs(a)){case"start":k[f]-=E*(l&&g?-1:1);break;case"end":k[f]+=E*(l&&g?-1:1);break}return k}async function d2(r,a){var l;a===void 0&&(a={});const{x:i,y:c,platform:d,rects:f,elements:m,strategy:p}=r,{boundary:g="clippingAncestors",rootBoundary:v="viewport",elementContext:y="floating",altBoundary:E=!1,padding:k=0}=Vn(a,r),C=Ix(k),j=m[E?y==="floating"?"reference":"floating":y],N=xo(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(j)))==null||l?j:j.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(m.floating)),boundary:g,rootBoundary:v,strategy:p})),P=y==="floating"?{x:i,y:c,width:f.floating.width,height:f.floating.height}:f.reference,S=await(d.getOffsetParent==null?void 0:d.getOffsetParent(m.floating)),A=await(d.isElement==null?void 0:d.isElement(S))?await(d.getScale==null?void 0:d.getScale(S))||{x:1,y:1}:{x:1,y:1},U=xo(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:P,offsetParent:S,strategy:p}):P);return{top:(N.top-U.top+C.top)/A.y,bottom:(U.bottom-N.bottom+C.bottom)/A.y,left:(N.left-U.left+C.left)/A.x,right:(U.right-N.right+C.right)/A.x}}const f2=async(r,a,l)=>{const{placement:i="bottom",strategy:c="absolute",middleware:d=[],platform:f}=l,m=d.filter(Boolean),p=await(f.isRTL==null?void 0:f.isRTL(a));let g=await f.getElementRects({reference:r,floating:a,strategy:c}),{x:v,y}=Mm(g,i,p),E=i,k={},C=0;for(let j=0;j({name:"arrow",options:r,async fn(a){const{x:l,y:i,placement:c,rects:d,platform:f,elements:m,middlewareData:p}=a,{element:g,padding:v=0}=Vn(r,a)||{};if(g==null)return{};const y=Ix(v),E={x:l,y:i},k=Vu(c),C=Uu(k),b=await f.getDimensions(g),j=k==="y",N=j?"top":"left",P=j?"bottom":"right",S=j?"clientHeight":"clientWidth",A=d.reference[C]+d.reference[k]-E[k]-d.floating[C],U=E[k]-d.reference[k],Q=await(f.getOffsetParent==null?void 0:f.getOffsetParent(g));let Y=Q?Q[S]:0;(!Y||!await(f.isElement==null?void 0:f.isElement(Q)))&&(Y=m.floating[S]||d.floating[C]);const W=A/2-U/2,le=Y/2-b[C]/2-1,de=yr(y[N],le),oe=yr(y[P],le),K=de,R=Y-b[C]-oe,H=Y/2-b[C]/2+W,X=iu(K,H,R),V=!p.arrow&&Fs(c)!=null&&H!==X&&d.reference[C]/2-(HH<=0)){var oe,K;const H=(((oe=d.flip)==null?void 0:oe.index)||0)+1,X=Y[H];if(X&&(!(y==="alignment"?P!==Sn(X):!1)||de.every(T=>Sn(T.placement)===P?T.overflows[0]>0:!0)))return{data:{index:H,overflows:de},reset:{placement:X}};let V=(K=de.filter(B=>B.overflows[0]<=0).sort((B,T)=>B.overflows[1]-T.overflows[1])[0])==null?void 0:K.placement;if(!V)switch(k){case"bestFit":{var R;const B=(R=de.filter(T=>{if(Q){const J=Sn(T.placement);return J===P||J==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(J=>J>0).reduce((J,q)=>J+q,0)]).sort((T,J)=>T[1]-J[1])[0])==null?void 0:R[0];B&&(V=B);break}case"initialPlacement":V=m;break}if(c!==V)return{reset:{placement:V}}}return{}}}};function Lm(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function Dm(r){return e2.some(a=>r[a]>=0)}const p2=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:i}=a,{strategy:c="referenceHidden",...d}=Vn(r,a);switch(c){case"referenceHidden":{const f=await i.detectOverflow(a,{...d,elementContext:"reference"}),m=Lm(f,l.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Dm(m)}}}case"escaped":{const f=await i.detectOverflow(a,{...d,altBoundary:!0}),m=Lm(f,l.floating);return{data:{escapedOffsets:m,escaped:Dm(m)}}}default:return{}}}}},Ax=new Set(["left","top"]);async function x2(r,a){const{placement:l,platform:i,elements:c}=r,d=await(i.isRTL==null?void 0:i.isRTL(c.floating)),f=Wn(l),m=Fs(l),p=Sn(l)==="y",g=Ax.has(f)?-1:1,v=d&&p?-1:1,y=Vn(a,r);let{mainAxis:E,crossAxis:k,alignmentAxis:C}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return m&&typeof C=="number"&&(k=m==="end"?C*-1:C),p?{x:k*v,y:E*g}:{x:E*g,y:k*v}}const g2=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,i;const{x:c,y:d,placement:f,middlewareData:m}=a,p=await x2(a,r);return f===((l=m.offset)==null?void 0:l.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:c+p.x,y:d+p.y,data:{...p,placement:f}}}}},v2=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:i,placement:c,platform:d}=a,{mainAxis:f=!0,crossAxis:m=!1,limiter:p={fn:N=>{let{x:P,y:S}=N;return{x:P,y:S}}},...g}=Vn(r,a),v={x:l,y:i},y=await d.detectOverflow(a,g),E=Sn(Wn(c)),k=Bu(E);let C=v[k],b=v[E];if(f){const N=k==="y"?"top":"left",P=k==="y"?"bottom":"right",S=C+y[N],A=C-y[P];C=iu(S,C,A)}if(m){const N=E==="y"?"top":"left",P=E==="y"?"bottom":"right",S=b+y[N],A=b-y[P];b=iu(S,b,A)}const j=p.fn({...a,[k]:C,[E]:b});return{...j,data:{x:j.x-l,y:j.y-i,enabled:{[k]:f,[E]:m}}}}}},y2=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:i,placement:c,rects:d,middlewareData:f}=a,{offset:m=0,mainAxis:p=!0,crossAxis:g=!0}=Vn(r,a),v={x:l,y:i},y=Sn(c),E=Bu(y);let k=v[E],C=v[y];const b=Vn(m,a),j=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(p){const S=E==="y"?"height":"width",A=d.reference[E]-d.floating[S]+j.mainAxis,U=d.reference[E]+d.reference[S]-j.mainAxis;kU&&(k=U)}if(g){var N,P;const S=E==="y"?"width":"height",A=Ax.has(Wn(c)),U=d.reference[y]-d.floating[S]+(A&&((N=f.offset)==null?void 0:N[y])||0)+(A?0:j.crossAxis),Q=d.reference[y]+d.reference[S]+(A?0:((P=f.offset)==null?void 0:P[y])||0)-(A?j.crossAxis:0);CQ&&(C=Q)}return{[E]:k,[y]:C}}}},w2=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,i;const{placement:c,rects:d,platform:f,elements:m}=a,{apply:p=()=>{},...g}=Vn(r,a),v=await f.detectOverflow(a,g),y=Wn(c),E=Fs(c),k=Sn(c)==="y",{width:C,height:b}=d.floating;let j,N;y==="top"||y==="bottom"?(j=y,N=E===(await(f.isRTL==null?void 0:f.isRTL(m.floating))?"start":"end")?"left":"right"):(N=y,j=E==="end"?"top":"bottom");const P=b-v.top-v.bottom,S=C-v.left-v.right,A=yr(b-v[j],P),U=yr(C-v[N],S),Q=!a.middlewareData.shift;let Y=A,W=U;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(W=S),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(Y=P),Q&&!E){const de=Bt(v.left,0),oe=Bt(v.right,0),K=Bt(v.top,0),R=Bt(v.bottom,0);k?W=C-2*(de!==0||oe!==0?de+oe:Bt(v.left,v.right)):Y=b-2*(K!==0||R!==0?K+R:Bt(v.top,v.bottom))}await p({...a,availableWidth:W,availableHeight:Y});const le=await f.getDimensions(m.floating);return C!==le.width||b!==le.height?{reset:{rects:!0}}:{}}}};function Io(){return typeof window<"u"}function zs(r){return Mx(r)?(r.nodeName||"").toLowerCase():"#document"}function Ut(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function Pn(r){var a;return(a=(Mx(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function Mx(r){return Io()?r instanceof Node||r instanceof Ut(r).Node:!1}function cn(r){return Io()?r instanceof Element||r instanceof Ut(r).Element:!1}function En(r){return Io()?r instanceof HTMLElement||r instanceof Ut(r).HTMLElement:!1}function Om(r){return!Io()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Ut(r).ShadowRoot}const N2=new Set(["inline","contents"]);function Da(r){const{overflow:a,overflowX:l,overflowY:i,display:c}=un(r);return/auto|scroll|overlay|hidden|clip/.test(a+i+l)&&!N2.has(c)}const j2=new Set(["table","td","th"]);function b2(r){return j2.has(zs(r))}const S2=[":popover-open",":modal"];function Ao(r){return S2.some(a=>{try{return r.matches(a)}catch{return!1}})}const C2=["transform","translate","scale","rotate","perspective"],k2=["transform","translate","scale","rotate","perspective","filter"],E2=["paint","layout","strict","content"];function Wu(r){const a=Hu(),l=cn(r)?un(r):r;return C2.some(i=>l[i]?l[i]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||k2.some(i=>(l.willChange||"").includes(i))||E2.some(i=>(l.contain||"").includes(i))}function P2(r){let a=wr(r);for(;En(a)&&!As(a);){if(Wu(a))return a;if(Ao(a))return null;a=wr(a)}return null}function Hu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const R2=new Set(["html","body","#document"]);function As(r){return R2.has(zs(r))}function un(r){return Ut(r).getComputedStyle(r)}function Mo(r){return cn(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function wr(r){if(zs(r)==="html")return r;const a=r.assignedSlot||r.parentNode||Om(r)&&r.host||Pn(r);return Om(a)?a.host:a}function Lx(r){const a=wr(r);return As(a)?r.ownerDocument?r.ownerDocument.body:r.body:En(a)&&Da(a)?a:Lx(a)}function Ta(r,a,l){var i;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=Lx(r),d=c===((i=r.ownerDocument)==null?void 0:i.body),f=Ut(c);if(d){const m=uu(f);return a.concat(f,f.visualViewport||[],Da(c)?c:[],m&&l?Ta(m):[])}return a.concat(c,Ta(c,[],l))}function uu(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function Dx(r){const a=un(r);let l=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const c=En(r),d=c?r.offsetWidth:l,f=c?r.offsetHeight:i,m=mo(l)!==d||mo(i)!==f;return m&&(l=d,i=f),{width:l,height:i,$:m}}function Ku(r){return cn(r)?r:r.contextElement}function Rs(r){const a=Ku(r);if(!En(a))return Cn(1);const l=a.getBoundingClientRect(),{width:i,height:c,$:d}=Dx(a);let f=(d?mo(l.width):l.width)/i,m=(d?mo(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!m||!Number.isFinite(m))&&(m=1),{x:f,y:m}}const _2=Cn(0);function Ox(r){const a=Ut(r);return!Hu()||!a.visualViewport?_2:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function T2(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==Ut(r)?!1:a}function Hr(r,a,l,i){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),d=Ku(r);let f=Cn(1);a&&(i?cn(i)&&(f=Rs(i)):f=Rs(r));const m=T2(d,l,i)?Ox(d):Cn(0);let p=(c.left+m.x)/f.x,g=(c.top+m.y)/f.y,v=c.width/f.x,y=c.height/f.y;if(d){const E=Ut(d),k=i&&cn(i)?Ut(i):i;let C=E,b=uu(C);for(;b&&i&&k!==C;){const j=Rs(b),N=b.getBoundingClientRect(),P=un(b),S=N.left+(b.clientLeft+parseFloat(P.paddingLeft))*j.x,A=N.top+(b.clientTop+parseFloat(P.paddingTop))*j.y;p*=j.x,g*=j.y,v*=j.x,y*=j.y,p+=S,g+=A,C=Ut(b),b=uu(C)}}return xo({width:v,height:y,x:p,y:g})}function Lo(r,a){const l=Mo(r).scrollLeft;return a?a.left+l:Hr(Pn(r)).left+l}function Fx(r,a){const l=r.getBoundingClientRect(),i=l.left+a.scrollLeft-Lo(r,l),c=l.top+a.scrollTop;return{x:i,y:c}}function I2(r){let{elements:a,rect:l,offsetParent:i,strategy:c}=r;const d=c==="fixed",f=Pn(i),m=a?Ao(a.floating):!1;if(i===f||m&&d)return l;let p={scrollLeft:0,scrollTop:0},g=Cn(1);const v=Cn(0),y=En(i);if((y||!y&&!d)&&((zs(i)!=="body"||Da(f))&&(p=Mo(i)),En(i))){const k=Hr(i);g=Rs(i),v.x=k.x+i.clientLeft,v.y=k.y+i.clientTop}const E=f&&!y&&!d?Fx(f,p):Cn(0);return{width:l.width*g.x,height:l.height*g.y,x:l.x*g.x-p.scrollLeft*g.x+v.x+E.x,y:l.y*g.y-p.scrollTop*g.y+v.y+E.y}}function A2(r){return Array.from(r.getClientRects())}function M2(r){const a=Pn(r),l=Mo(r),i=r.ownerDocument.body,c=Bt(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),d=Bt(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let f=-l.scrollLeft+Lo(r);const m=-l.scrollTop;return un(i).direction==="rtl"&&(f+=Bt(a.clientWidth,i.clientWidth)-c),{width:c,height:d,x:f,y:m}}const Fm=25;function L2(r,a){const l=Ut(r),i=Pn(r),c=l.visualViewport;let d=i.clientWidth,f=i.clientHeight,m=0,p=0;if(c){d=c.width,f=c.height;const v=Hu();(!v||v&&a==="fixed")&&(m=c.offsetLeft,p=c.offsetTop)}const g=Lo(i);if(g<=0){const v=i.ownerDocument,y=v.body,E=getComputedStyle(y),k=v.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,C=Math.abs(i.clientWidth-y.clientWidth-k);C<=Fm&&(d-=C)}else g<=Fm&&(d+=g);return{width:d,height:f,x:m,y:p}}const D2=new Set(["absolute","fixed"]);function O2(r,a){const l=Hr(r,!0,a==="fixed"),i=l.top+r.clientTop,c=l.left+r.clientLeft,d=En(r)?Rs(r):Cn(1),f=r.clientWidth*d.x,m=r.clientHeight*d.y,p=c*d.x,g=i*d.y;return{width:f,height:m,x:p,y:g}}function zm(r,a,l){let i;if(a==="viewport")i=L2(r,l);else if(a==="document")i=M2(Pn(r));else if(cn(a))i=O2(a,l);else{const c=Ox(r);i={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return xo(i)}function zx(r,a){const l=wr(r);return l===a||!cn(l)||As(l)?!1:un(l).position==="fixed"||zx(l,a)}function F2(r,a){const l=a.get(r);if(l)return l;let i=Ta(r,[],!1).filter(m=>cn(m)&&zs(m)!=="body"),c=null;const d=un(r).position==="fixed";let f=d?wr(r):r;for(;cn(f)&&!As(f);){const m=un(f),p=Wu(f);!p&&m.position==="fixed"&&(c=null),(d?!p&&!c:!p&&m.position==="static"&&!!c&&D2.has(c.position)||Da(f)&&!p&&zx(r,f))?i=i.filter(v=>v!==f):c=m,f=wr(f)}return a.set(r,i),i}function z2(r){let{element:a,boundary:l,rootBoundary:i,strategy:c}=r;const f=[...l==="clippingAncestors"?Ao(a)?[]:F2(a,this._c):[].concat(l),i],m=f[0],p=f.reduce((g,v)=>{const y=zm(a,v,c);return g.top=Bt(y.top,g.top),g.right=yr(y.right,g.right),g.bottom=yr(y.bottom,g.bottom),g.left=Bt(y.left,g.left),g},zm(a,m,c));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function $2(r){const{width:a,height:l}=Dx(r);return{width:a,height:l}}function B2(r,a,l){const i=En(a),c=Pn(a),d=l==="fixed",f=Hr(r,!0,d,a);let m={scrollLeft:0,scrollTop:0};const p=Cn(0);function g(){p.x=Lo(c)}if(i||!i&&!d)if((zs(a)!=="body"||Da(c))&&(m=Mo(a)),i){const k=Hr(a,!0,d,a);p.x=k.x+a.clientLeft,p.y=k.y+a.clientTop}else c&&g();d&&!i&&c&&g();const v=c&&!i&&!d?Fx(c,m):Cn(0),y=f.left+m.scrollLeft-p.x-v.x,E=f.top+m.scrollTop-p.y-v.y;return{x:y,y:E,width:f.width,height:f.height}}function Wc(r){return un(r).position==="static"}function $m(r,a){if(!En(r)||un(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return Pn(r)===l&&(l=l.ownerDocument.body),l}function $x(r,a){const l=Ut(r);if(Ao(r))return l;if(!En(r)){let c=wr(r);for(;c&&!As(c);){if(cn(c)&&!Wc(c))return c;c=wr(c)}return l}let i=$m(r,a);for(;i&&b2(i)&&Wc(i);)i=$m(i,a);return i&&As(i)&&Wc(i)&&!Wu(i)?l:i||P2(r)||l}const U2=async function(r){const a=this.getOffsetParent||$x,l=this.getDimensions,i=await l(r.floating);return{reference:B2(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function V2(r){return un(r).direction==="rtl"}const W2={convertOffsetParentRelativeRectToViewportRelativeRect:I2,getDocumentElement:Pn,getClippingRect:z2,getOffsetParent:$x,getElementRects:U2,getClientRects:A2,getDimensions:$2,getScale:Rs,isElement:cn,isRTL:V2};function Bx(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function H2(r,a){let l=null,i;const c=Pn(r);function d(){var m;clearTimeout(i),(m=l)==null||m.disconnect(),l=null}function f(m,p){m===void 0&&(m=!1),p===void 0&&(p=1),d();const g=r.getBoundingClientRect(),{left:v,top:y,width:E,height:k}=g;if(m||a(),!E||!k)return;const C=Jl(y),b=Jl(c.clientWidth-(v+E)),j=Jl(c.clientHeight-(y+k)),N=Jl(v),S={rootMargin:-C+"px "+-b+"px "+-j+"px "+-N+"px",threshold:Bt(0,yr(1,p))||1};let A=!0;function U(Q){const Y=Q[0].intersectionRatio;if(Y!==p){if(!A)return f();Y?f(!1,Y):i=setTimeout(()=>{f(!1,1e-7)},1e3)}Y===1&&!Bx(g,r.getBoundingClientRect())&&f(),A=!1}try{l=new IntersectionObserver(U,{...S,root:c.ownerDocument})}catch{l=new IntersectionObserver(U,S)}l.observe(r)}return f(!0),d}function K2(r,a,l,i){i===void 0&&(i={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:p=!1}=i,g=Ku(r),v=c||d?[...g?Ta(g):[],...Ta(a)]:[];v.forEach(N=>{c&&N.addEventListener("scroll",l,{passive:!0}),d&&N.addEventListener("resize",l)});const y=g&&m?H2(g,l):null;let E=-1,k=null;f&&(k=new ResizeObserver(N=>{let[P]=N;P&&P.target===g&&k&&(k.unobserve(a),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var S;(S=k)==null||S.observe(a)})),l()}),g&&!p&&k.observe(g),k.observe(a));let C,b=p?Hr(r):null;p&&j();function j(){const N=Hr(r);b&&!Bx(b,N)&&l(),b=N,C=requestAnimationFrame(j)}return l(),()=>{var N;v.forEach(P=>{c&&P.removeEventListener("scroll",l),d&&P.removeEventListener("resize",l)}),y==null||y(),(N=k)==null||N.disconnect(),k=null,p&&cancelAnimationFrame(C)}}const G2=g2,Q2=v2,Y2=m2,X2=w2,q2=p2,Bm=h2,J2=y2,Z2=(r,a,l)=>{const i=new Map,c={platform:W2,...l},d={...c.platform,_c:i};return f2(r,a,{...c,platform:d})};var eS=typeof document<"u",tS=function(){},no=eS?x.useLayoutEffect:tS;function go(r,a){if(r===a)return!0;if(typeof r!=typeof a)return!1;if(typeof r=="function"&&r.toString()===a.toString())return!0;let l,i,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(i=l;i--!==0;)if(!go(r[i],a[i]))return!1;return!0}if(c=Object.keys(r),l=c.length,l!==Object.keys(a).length)return!1;for(i=l;i--!==0;)if(!{}.hasOwnProperty.call(a,c[i]))return!1;for(i=l;i--!==0;){const d=c[i];if(!(d==="_owner"&&r.$$typeof)&&!go(r[d],a[d]))return!1}return!0}return r!==r&&a!==a}function Ux(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function Um(r,a){const l=Ux(r);return Math.round(a*l)/l}function Hc(r){const a=x.useRef(r);return no(()=>{a.current=r}),a}function nS(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:i=[],platform:c,elements:{reference:d,floating:f}={},transform:m=!0,whileElementsMounted:p,open:g}=r,[v,y]=x.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[E,k]=x.useState(i);go(E,i)||k(i);const[C,b]=x.useState(null),[j,N]=x.useState(null),P=x.useCallback(T=>{T!==Q.current&&(Q.current=T,b(T))},[]),S=x.useCallback(T=>{T!==Y.current&&(Y.current=T,N(T))},[]),A=d||C,U=f||j,Q=x.useRef(null),Y=x.useRef(null),W=x.useRef(v),le=p!=null,de=Hc(p),oe=Hc(c),K=Hc(g),R=x.useCallback(()=>{if(!Q.current||!Y.current)return;const T={placement:a,strategy:l,middleware:E};oe.current&&(T.platform=oe.current),Z2(Q.current,Y.current,T).then(J=>{const q={...J,isPositioned:K.current!==!1};H.current&&!go(W.current,q)&&(W.current=q,Ia.flushSync(()=>{y(q)}))})},[E,a,l,oe,K]);no(()=>{g===!1&&W.current.isPositioned&&(W.current.isPositioned=!1,y(T=>({...T,isPositioned:!1})))},[g]);const H=x.useRef(!1);no(()=>(H.current=!0,()=>{H.current=!1}),[]),no(()=>{if(A&&(Q.current=A),U&&(Y.current=U),A&&U){if(de.current)return de.current(A,U,R);R()}},[A,U,R,de,le]);const X=x.useMemo(()=>({reference:Q,floating:Y,setReference:P,setFloating:S}),[P,S]),V=x.useMemo(()=>({reference:A,floating:U}),[A,U]),B=x.useMemo(()=>{const T={position:l,left:0,top:0};if(!V.floating)return T;const J=Um(V.floating,v.x),q=Um(V.floating,v.y);return m?{...T,transform:"translate("+J+"px, "+q+"px)",...Ux(V.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:J,top:q}},[l,m,V.floating,v.x,v.y]);return x.useMemo(()=>({...v,update:R,refs:X,elements:V,floatingStyles:B}),[v,R,X,V,B])}const rS=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:i,padding:c}=typeof r=="function"?r(l):r;return i&&a(i)?i.current!=null?Bm({element:i.current,padding:c}).fn(l):{}:i?Bm({element:i,padding:c}).fn(l):{}}}},sS=(r,a)=>({...G2(r),options:[r,a]}),aS=(r,a)=>({...Q2(r),options:[r,a]}),lS=(r,a)=>({...J2(r),options:[r,a]}),oS=(r,a)=>({...Y2(r),options:[r,a]}),iS=(r,a)=>({...X2(r),options:[r,a]}),cS=(r,a)=>({...q2(r),options:[r,a]}),uS=(r,a)=>({...rS(r),options:[r,a]});var dS="Arrow",Vx=x.forwardRef((r,a)=>{const{children:l,width:i=10,height:c=5,...d}=r;return n.jsx(Le.svg,{...d,ref:a,width:i,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});Vx.displayName=dS;var fS=Vx,Gu="Popper",[Wx,Hx]=jr(Gu),[hS,Kx]=Wx(Gu),Gx=r=>{const{__scopePopper:a,children:l}=r,[i,c]=x.useState(null);return n.jsx(hS,{scope:a,anchor:i,onAnchorChange:c,children:l})};Gx.displayName=Gu;var Qx="PopperAnchor",Yx=x.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:i,...c}=r,d=Kx(Qx,l),f=x.useRef(null),m=Ve(a,f),p=x.useRef(null);return x.useEffect(()=>{const g=p.current;p.current=(i==null?void 0:i.current)||f.current,g!==p.current&&d.onAnchorChange(p.current)}),i?null:n.jsx(Le.div,{...c,ref:m})});Yx.displayName=Qx;var Qu="PopperContent",[mS,pS]=Wx(Qu),Xx=x.forwardRef((r,a)=>{var ne,he,Ee,Se,Te,z;const{__scopePopper:l,side:i="bottom",sideOffset:c=0,align:d="center",alignOffset:f=0,arrowPadding:m=0,avoidCollisions:p=!0,collisionBoundary:g=[],collisionPadding:v=0,sticky:y="partial",hideWhenDetached:E=!1,updatePositionStrategy:k="optimized",onPlaced:C,...b}=r,j=Kx(Qu,l),[N,P]=x.useState(null),S=Ve(a,Ie=>P(Ie)),[A,U]=x.useState(null),Q=Ou(A),Y=(Q==null?void 0:Q.width)??0,W=(Q==null?void 0:Q.height)??0,le=i+(d!=="center"?"-"+d:""),de=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},oe=Array.isArray(g)?g:[g],K=oe.length>0,R={padding:de,boundary:oe.filter(gS),altBoundary:K},{refs:H,floatingStyles:X,placement:V,isPositioned:B,middlewareData:T}=nS({strategy:"fixed",placement:le,whileElementsMounted:(...Ie)=>K2(...Ie,{animationFrame:k==="always"}),elements:{reference:j.anchor},middleware:[sS({mainAxis:c+W,alignmentAxis:f}),p&&aS({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?lS():void 0,...R}),p&&oS({...R}),iS({...R,apply:({elements:Ie,rects:ze,availableWidth:Nt,availableHeight:Vt})=>{const{width:Jt,height:Yr}=ze.reference,fn=Ie.floating.style;fn.setProperty("--radix-popper-available-width",`${Nt}px`),fn.setProperty("--radix-popper-available-height",`${Vt}px`),fn.setProperty("--radix-popper-anchor-width",`${Jt}px`),fn.setProperty("--radix-popper-anchor-height",`${Yr}px`)}}),A&&uS({element:A,padding:m}),vS({arrowWidth:Y,arrowHeight:W}),E&&cS({strategy:"referenceHidden",...R})]}),[J,q]=Zx(V),L=vr(C);Et(()=>{B&&(L==null||L())},[B,L]);const G=(ne=T.arrow)==null?void 0:ne.x,fe=(he=T.arrow)==null?void 0:he.y,se=((Ee=T.arrow)==null?void 0:Ee.centerOffset)!==0,[be,je]=x.useState();return Et(()=>{N&&je(window.getComputedStyle(N).zIndex)},[N]),n.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:B?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(Se=T.transformOrigin)==null?void 0:Se.x,(Te=T.transformOrigin)==null?void 0:Te.y].join(" "),...((z=T.hide)==null?void 0:z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:n.jsx(mS,{scope:l,placedSide:J,onArrowChange:U,arrowX:G,arrowY:fe,shouldHideArrow:se,children:n.jsx(Le.div,{"data-side":J,"data-align":q,...b,ref:S,style:{...b.style,animation:B?void 0:"none"}})})})});Xx.displayName=Qu;var qx="PopperArrow",xS={top:"bottom",right:"left",bottom:"top",left:"right"},Jx=x.forwardRef(function(a,l){const{__scopePopper:i,...c}=a,d=pS(qx,i),f=xS[d.placedSide];return n.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:n.jsx(fS,{...c,ref:l,style:{...c.style,display:"block"}})})});Jx.displayName=qx;function gS(r){return r!==null}var vS=r=>({name:"transformOrigin",options:r,fn(a){var j,N,P;const{placement:l,rects:i,middlewareData:c}=a,f=((j=c.arrow)==null?void 0:j.centerOffset)!==0,m=f?0:r.arrowWidth,p=f?0:r.arrowHeight,[g,v]=Zx(l),y={start:"0%",center:"50%",end:"100%"}[v],E=(((N=c.arrow)==null?void 0:N.x)??0)+m/2,k=(((P=c.arrow)==null?void 0:P.y)??0)+p/2;let C="",b="";return g==="bottom"?(C=f?y:`${E}px`,b=`${-p}px`):g==="top"?(C=f?y:`${E}px`,b=`${i.floating.height+p}px`):g==="right"?(C=`${-p}px`,b=f?y:`${k}px`):g==="left"&&(C=`${i.floating.width+p}px`,b=f?y:`${k}px`),{data:{x:C,y:b}}}});function Zx(r){const[a,l="center"]=r.split("-");return[a,l]}var yS=Gx,wS=Yx,NS=Xx,jS=Jx,eg=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),bS="VisuallyHidden",SS=x.forwardRef((r,a)=>n.jsx(Le.span,{...r,ref:a,style:{...eg,...r.style}}));SS.displayName=bS;var CS=[" ","Enter","ArrowUp","ArrowDown"],kS=[" ","Enter"],Kr="Select",[Do,Oo,ES]=Fu(Kr),[$s]=jr(Kr,[ES,Hx]),Fo=Hx(),[PS,br]=$s(Kr),[RS,_S]=$s(Kr),tg=r=>{const{__scopeSelect:a,children:l,open:i,defaultOpen:c,onOpenChange:d,value:f,defaultValue:m,onValueChange:p,dir:g,name:v,autoComplete:y,disabled:E,required:k,form:C}=r,b=Fo(a),[j,N]=x.useState(null),[P,S]=x.useState(null),[A,U]=x.useState(!1),Q=Ro(g),[Y,W]=Vr({prop:i,defaultProp:c??!1,onChange:d,caller:Kr}),[le,de]=Vr({prop:f,defaultProp:m,onChange:p,caller:Kr}),oe=x.useRef(null),K=j?C||!!j.closest("form"):!0,[R,H]=x.useState(new Set),X=Array.from(R).map(V=>V.props.value).join(";");return n.jsx(yS,{...b,children:n.jsxs(PS,{required:k,scope:a,trigger:j,onTriggerChange:N,valueNode:P,onValueNodeChange:S,valueNodeHasChildren:A,onValueNodeHasChildrenChange:U,contentId:gr(),value:le,onValueChange:de,open:Y,onOpenChange:W,dir:Q,triggerPointerDownPosRef:oe,disabled:E,children:[n.jsx(Do.Provider,{scope:a,children:n.jsx(RS,{scope:r.__scopeSelect,onNativeOptionAdd:x.useCallback(V=>{H(B=>new Set(B).add(V))},[]),onNativeOptionRemove:x.useCallback(V=>{H(B=>{const T=new Set(B);return T.delete(V),T})},[]),children:l})}),K?n.jsxs(bg,{"aria-hidden":!0,required:k,tabIndex:-1,name:v,autoComplete:y,value:le,onChange:V=>de(V.target.value),disabled:E,form:C,children:[le===void 0?n.jsx("option",{value:""}):null,Array.from(R)]},X):null]})})};tg.displayName=Kr;var ng="SelectTrigger",rg=x.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:i=!1,...c}=r,d=Fo(l),f=br(ng,l),m=f.disabled||i,p=Ve(a,f.onTriggerChange),g=Oo(l),v=x.useRef("touch"),[y,E,k]=Cg(b=>{const j=g().filter(S=>!S.disabled),N=j.find(S=>S.value===f.value),P=kg(j,b,N);P!==void 0&&f.onValueChange(P.value)}),C=b=>{m||(f.onOpenChange(!0),k()),b&&(f.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return n.jsx(wS,{asChild:!0,...d,children:n.jsx(Le.button,{type:"button",role:"combobox","aria-controls":f.contentId,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":Sg(f.value)?"":void 0,...c,ref:p,onClick:Ae(c.onClick,b=>{b.currentTarget.focus(),v.current!=="mouse"&&C(b)}),onPointerDown:Ae(c.onPointerDown,b=>{v.current=b.pointerType;const j=b.target;j.hasPointerCapture(b.pointerId)&&j.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(C(b),b.preventDefault())}),onKeyDown:Ae(c.onKeyDown,b=>{const j=y.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&E(b.key),!(j&&b.key===" ")&&CS.includes(b.key)&&(C(),b.preventDefault())})})})});rg.displayName=ng;var sg="SelectValue",ag=x.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,children:d,placeholder:f="",...m}=r,p=br(sg,l),{onValueNodeHasChildrenChange:g}=p,v=d!==void 0,y=Ve(a,p.onValueNodeChange);return Et(()=>{g(v)},[g,v]),n.jsx(Le.span,{...m,ref:y,style:{pointerEvents:"none"},children:Sg(p.value)?n.jsx(n.Fragment,{children:f}):d})});ag.displayName=sg;var TS="SelectIcon",lg=x.forwardRef((r,a)=>{const{__scopeSelect:l,children:i,...c}=r;return n.jsx(Le.span,{"aria-hidden":!0,...c,ref:a,children:i||"▼"})});lg.displayName=TS;var IS="SelectPortal",og=r=>n.jsx(Tu,{asChild:!0,...r});og.displayName=IS;var Gr="SelectContent",ig=x.forwardRef((r,a)=>{const l=br(Gr,r.__scopeSelect),[i,c]=x.useState();if(Et(()=>{c(new DocumentFragment)},[]),!l.open){const d=i;return d?Ia.createPortal(n.jsx(cg,{scope:r.__scopeSelect,children:n.jsx(Do.Slot,{scope:r.__scopeSelect,children:n.jsx("div",{children:r.children})})}),d):null}return n.jsx(ug,{...r,ref:a})});ig.displayName=Gr;var ln=10,[cg,Sr]=$s(Gr),AS="SelectContentImpl",MS=_a("SelectContent.RemoveScroll"),ug=x.forwardRef((r,a)=>{const{__scopeSelect:l,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,side:m,sideOffset:p,align:g,alignOffset:v,arrowPadding:y,collisionBoundary:E,collisionPadding:k,sticky:C,hideWhenDetached:b,avoidCollisions:j,...N}=r,P=br(Gr,l),[S,A]=x.useState(null),[U,Q]=x.useState(null),Y=Ve(a,ne=>A(ne)),[W,le]=x.useState(null),[de,oe]=x.useState(null),K=Oo(l),[R,H]=x.useState(!1),X=x.useRef(!1);x.useEffect(()=>{if(S)return Wp(S)},[S]),Lp();const V=x.useCallback(ne=>{const[he,...Ee]=K().map(z=>z.ref.current),[Se]=Ee.slice(-1),Te=document.activeElement;for(const z of ne)if(z===Te||(z==null||z.scrollIntoView({block:"nearest"}),z===he&&U&&(U.scrollTop=0),z===Se&&U&&(U.scrollTop=U.scrollHeight),z==null||z.focus(),document.activeElement!==Te))return},[K,U]),B=x.useCallback(()=>V([W,S]),[V,W,S]);x.useEffect(()=>{R&&B()},[R,B]);const{onOpenChange:T,triggerPointerDownPosRef:J}=P;x.useEffect(()=>{if(S){let ne={x:0,y:0};const he=Se=>{var Te,z;ne={x:Math.abs(Math.round(Se.pageX)-(((Te=J.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(Se.pageY)-(((z=J.current)==null?void 0:z.y)??0))}},Ee=Se=>{ne.x<=10&&ne.y<=10?Se.preventDefault():S.contains(Se.target)||T(!1),document.removeEventListener("pointermove",he),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",Ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",Ee,{capture:!0})}}},[S,T,J]),x.useEffect(()=>{const ne=()=>T(!1);return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[T]);const[q,L]=Cg(ne=>{const he=K().filter(Te=>!Te.disabled),Ee=he.find(Te=>Te.ref.current===document.activeElement),Se=kg(he,ne,Ee);Se&&setTimeout(()=>Se.ref.current.focus())}),G=x.useCallback((ne,he,Ee)=>{const Se=!X.current&&!Ee;(P.value!==void 0&&P.value===he||Se)&&(le(ne),Se&&(X.current=!0))},[P.value]),fe=x.useCallback(()=>S==null?void 0:S.focus(),[S]),se=x.useCallback((ne,he,Ee)=>{const Se=!X.current&&!Ee;(P.value!==void 0&&P.value===he||Se)&&oe(ne)},[P.value]),be=i==="popper"?du:dg,je=be===du?{side:m,sideOffset:p,align:g,alignOffset:v,arrowPadding:y,collisionBoundary:E,collisionPadding:k,sticky:C,hideWhenDetached:b,avoidCollisions:j}:{};return n.jsx(cg,{scope:l,content:S,viewport:U,onViewportChange:Q,itemRefCallback:G,selectedItem:W,onItemLeave:fe,itemTextRefCallback:se,focusSelectedItem:B,selectedItemText:de,position:i,isPositioned:R,searchRef:q,children:n.jsx(Iu,{as:MS,allowPinchZoom:!0,children:n.jsx(_u,{asChild:!0,trapped:P.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:Ae(c,ne=>{var he;(he=P.trigger)==null||he.focus({preventScroll:!0}),ne.preventDefault()}),children:n.jsx(Ru,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>P.onOpenChange(!1),children:n.jsx(be,{role:"listbox",id:P.contentId,"data-state":P.open?"open":"closed",dir:P.dir,onContextMenu:ne=>ne.preventDefault(),...N,...je,onPlaced:()=>H(!0),ref:Y,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Ae(N.onKeyDown,ne=>{const he=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!he&&ne.key.length===1&&L(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let Se=K().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(Se=Se.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Te=ne.target,z=Se.indexOf(Te);Se=Se.slice(z+1)}setTimeout(()=>V(Se)),ne.preventDefault()}})})})})})})});ug.displayName=AS;var LS="SelectItemAlignedPosition",dg=x.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:i,...c}=r,d=br(Gr,l),f=Sr(Gr,l),[m,p]=x.useState(null),[g,v]=x.useState(null),y=Ve(a,Y=>v(Y)),E=Oo(l),k=x.useRef(!1),C=x.useRef(!0),{viewport:b,selectedItem:j,selectedItemText:N,focusSelectedItem:P}=f,S=x.useCallback(()=>{if(d.trigger&&d.valueNode&&m&&g&&b&&j&&N){const Y=d.trigger.getBoundingClientRect(),W=g.getBoundingClientRect(),le=d.valueNode.getBoundingClientRect(),de=N.getBoundingClientRect();if(d.dir!=="rtl"){const Te=de.left-W.left,z=le.left-Te,Ie=Y.left-z,ze=Y.width+Ie,Nt=Math.max(ze,W.width),Vt=window.innerWidth-ln,Jt=ho(z,[ln,Math.max(ln,Vt-Nt)]);m.style.minWidth=ze+"px",m.style.left=Jt+"px"}else{const Te=W.right-de.right,z=window.innerWidth-le.right-Te,Ie=window.innerWidth-Y.right-z,ze=Y.width+Ie,Nt=Math.max(ze,W.width),Vt=window.innerWidth-ln,Jt=ho(z,[ln,Math.max(ln,Vt-Nt)]);m.style.minWidth=ze+"px",m.style.right=Jt+"px"}const oe=E(),K=window.innerHeight-ln*2,R=b.scrollHeight,H=window.getComputedStyle(g),X=parseInt(H.borderTopWidth,10),V=parseInt(H.paddingTop,10),B=parseInt(H.borderBottomWidth,10),T=parseInt(H.paddingBottom,10),J=X+V+R+T+B,q=Math.min(j.offsetHeight*5,J),L=window.getComputedStyle(b),G=parseInt(L.paddingTop,10),fe=parseInt(L.paddingBottom,10),se=Y.top+Y.height/2-ln,be=K-se,je=j.offsetHeight/2,ne=j.offsetTop+je,he=X+V+ne,Ee=J-he;if(he<=se){const Te=oe.length>0&&j===oe[oe.length-1].ref.current;m.style.bottom="0px";const z=g.clientHeight-b.offsetTop-b.offsetHeight,Ie=Math.max(be,je+(Te?fe:0)+z+B),ze=he+Ie;m.style.height=ze+"px"}else{const Te=oe.length>0&&j===oe[0].ref.current;m.style.top="0px";const Ie=Math.max(se,X+b.offsetTop+(Te?G:0)+je)+Ee;m.style.height=Ie+"px",b.scrollTop=he-se+b.offsetTop}m.style.margin=`${ln}px 0`,m.style.minHeight=q+"px",m.style.maxHeight=K+"px",i==null||i(),requestAnimationFrame(()=>k.current=!0)}},[E,d.trigger,d.valueNode,m,g,b,j,N,d.dir,i]);Et(()=>S(),[S]);const[A,U]=x.useState();Et(()=>{g&&U(window.getComputedStyle(g).zIndex)},[g]);const Q=x.useCallback(Y=>{Y&&C.current===!0&&(S(),P==null||P(),C.current=!1)},[S,P]);return n.jsx(OS,{scope:l,contentWrapper:m,shouldExpandOnScrollRef:k,onScrollButtonChange:Q,children:n.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:n.jsx(Le.div,{...c,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});dg.displayName=LS;var DS="SelectPopperPosition",du=x.forwardRef((r,a)=>{const{__scopeSelect:l,align:i="start",collisionPadding:c=ln,...d}=r,f=Fo(l);return n.jsx(NS,{...f,...d,ref:a,align:i,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});du.displayName=DS;var[OS,Yu]=$s(Gr,{}),fu="SelectViewport",fg=x.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:i,...c}=r,d=Sr(fu,l),f=Yu(fu,l),m=Ve(a,d.onViewportChange),p=x.useRef(0);return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),n.jsx(Do.Slot,{scope:l,children:n.jsx(Le.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Ae(c.onScroll,g=>{const v=g.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:E}=f;if(E!=null&&E.current&&y){const k=Math.abs(p.current-v.scrollTop);if(k>0){const C=window.innerHeight-ln*2,b=parseFloat(y.style.minHeight),j=parseFloat(y.style.height),N=Math.max(b,j);if(N0?A:0,y.style.justifyContent="flex-end")}}}p.current=v.scrollTop})})})]})});fg.displayName=fu;var hg="SelectGroup",[FS,zS]=$s(hg),$S=x.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=gr();return n.jsx(FS,{scope:l,id:c,children:n.jsx(Le.div,{role:"group","aria-labelledby":c,...i,ref:a})})});$S.displayName=hg;var mg="SelectLabel",BS=x.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=zS(mg,l);return n.jsx(Le.div,{id:c.id,...i,ref:a})});BS.displayName=mg;var vo="SelectItem",[US,pg]=$s(vo),xg=x.forwardRef((r,a)=>{const{__scopeSelect:l,value:i,disabled:c=!1,textValue:d,...f}=r,m=br(vo,l),p=Sr(vo,l),g=m.value===i,[v,y]=x.useState(d??""),[E,k]=x.useState(!1),C=Ve(a,P=>{var S;return(S=p.itemRefCallback)==null?void 0:S.call(p,P,i,c)}),b=gr(),j=x.useRef("touch"),N=()=>{c||(m.onValueChange(i),m.onOpenChange(!1))};if(i==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return n.jsx(US,{scope:l,value:i,disabled:c,textId:b,isSelected:g,onItemTextChange:x.useCallback(P=>{y(S=>S||((P==null?void 0:P.textContent)??"").trim())},[]),children:n.jsx(Do.ItemSlot,{scope:l,value:i,disabled:c,textValue:v,children:n.jsx(Le.div,{role:"option","aria-labelledby":b,"data-highlighted":E?"":void 0,"aria-selected":g&&E,"data-state":g?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...f,ref:C,onFocus:Ae(f.onFocus,()=>k(!0)),onBlur:Ae(f.onBlur,()=>k(!1)),onClick:Ae(f.onClick,()=>{j.current!=="mouse"&&N()}),onPointerUp:Ae(f.onPointerUp,()=>{j.current==="mouse"&&N()}),onPointerDown:Ae(f.onPointerDown,P=>{j.current=P.pointerType}),onPointerMove:Ae(f.onPointerMove,P=>{var S;j.current=P.pointerType,c?(S=p.onItemLeave)==null||S.call(p):j.current==="mouse"&&P.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(f.onPointerLeave,P=>{var S;P.currentTarget===document.activeElement&&((S=p.onItemLeave)==null||S.call(p))}),onKeyDown:Ae(f.onKeyDown,P=>{var A;((A=p.searchRef)==null?void 0:A.current)!==""&&P.key===" "||(kS.includes(P.key)&&N(),P.key===" "&&P.preventDefault())})})})})});xg.displayName=vo;var Ea="SelectItemText",gg=x.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,...d}=r,f=br(Ea,l),m=Sr(Ea,l),p=pg(Ea,l),g=_S(Ea,l),[v,y]=x.useState(null),E=Ve(a,N=>y(N),p.onItemTextChange,N=>{var P;return(P=m.itemTextRefCallback)==null?void 0:P.call(m,N,p.value,p.disabled)}),k=v==null?void 0:v.textContent,C=x.useMemo(()=>n.jsx("option",{value:p.value,disabled:p.disabled,children:k},p.value),[p.disabled,p.value,k]),{onNativeOptionAdd:b,onNativeOptionRemove:j}=g;return Et(()=>(b(C),()=>j(C)),[b,j,C]),n.jsxs(n.Fragment,{children:[n.jsx(Le.span,{id:p.textId,...d,ref:E}),p.isSelected&&f.valueNode&&!f.valueNodeHasChildren?Ia.createPortal(d.children,f.valueNode):null]})});gg.displayName=Ea;var vg="SelectItemIndicator",yg=x.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return pg(vg,l).isSelected?n.jsx(Le.span,{"aria-hidden":!0,...i,ref:a}):null});yg.displayName=vg;var hu="SelectScrollUpButton",wg=x.forwardRef((r,a)=>{const l=Sr(hu,r.__scopeSelect),i=Yu(hu,r.__scopeSelect),[c,d]=x.useState(!1),f=Ve(a,i.onScrollButtonChange);return Et(()=>{if(l.viewport&&l.isPositioned){let m=function(){const g=p.scrollTop>0;d(g)};const p=l.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?n.jsx(jg,{...r,ref:f,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=l;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null});wg.displayName=hu;var mu="SelectScrollDownButton",Ng=x.forwardRef((r,a)=>{const l=Sr(mu,r.__scopeSelect),i=Yu(mu,r.__scopeSelect),[c,d]=x.useState(!1),f=Ve(a,i.onScrollButtonChange);return Et(()=>{if(l.viewport&&l.isPositioned){let m=function(){const g=p.scrollHeight-p.clientHeight,v=Math.ceil(p.scrollTop)p.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?n.jsx(jg,{...r,ref:f,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=l;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null});Ng.displayName=mu;var jg=x.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:i,...c}=r,d=Sr("SelectScrollButton",l),f=x.useRef(null),m=Oo(l),p=x.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return x.useEffect(()=>()=>p(),[p]),Et(()=>{var v;const g=m().find(y=>y.ref.current===document.activeElement);(v=g==null?void 0:g.ref.current)==null||v.scrollIntoView({block:"nearest"})},[m]),n.jsx(Le.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Ae(c.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(i,50))}),onPointerMove:Ae(c.onPointerMove,()=>{var g;(g=d.onItemLeave)==null||g.call(d),f.current===null&&(f.current=window.setInterval(i,50))}),onPointerLeave:Ae(c.onPointerLeave,()=>{p()})})}),VS="SelectSeparator",WS=x.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return n.jsx(Le.div,{"aria-hidden":!0,...i,ref:a})});WS.displayName=VS;var pu="SelectArrow",HS=x.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=Fo(l),d=br(pu,l),f=Sr(pu,l);return d.open&&f.position==="popper"?n.jsx(jS,{...c,...i,ref:a}):null});HS.displayName=pu;var KS="SelectBubbleInput",bg=x.forwardRef(({__scopeSelect:r,value:a,...l},i)=>{const c=x.useRef(null),d=Ve(i,c),f=Du(a);return x.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(p,"value").set;if(f!==a&&v){const y=new Event("change",{bubbles:!0});v.call(m,a),m.dispatchEvent(y)}},[f,a]),n.jsx(Le.select,{...l,style:{...eg,...l.style},ref:d,defaultValue:a})});bg.displayName=KS;function Sg(r){return r===""||r===void 0}function Cg(r){const a=vr(r),l=x.useRef(""),i=x.useRef(0),c=x.useCallback(f=>{const m=l.current+f;a(m),(function p(g){l.current=g,window.clearTimeout(i.current),g!==""&&(i.current=window.setTimeout(()=>p(""),1e3))})(m)},[a]),d=x.useCallback(()=>{l.current="",window.clearTimeout(i.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(i.current),[]),[l,c,d]}function kg(r,a,l){const c=a.length>1&&Array.from(a).every(g=>g===a[0])?a[0]:a,d=l?r.indexOf(l):-1;let f=GS(r,Math.max(d,0));c.length===1&&(f=f.filter(g=>g!==l));const p=f.find(g=>g.textValue.toLowerCase().startsWith(c.toLowerCase()));return p!==l?p:void 0}function GS(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var QS=tg,Eg=rg,YS=ag,XS=lg,qS=og,Pg=ig,JS=fg,Rg=xg,ZS=gg,eC=yg,tC=wg,nC=Ng;const Kc=QS,Gc=YS,ro=x.forwardRef(({className:r,children:a,...l},i)=>n.jsxs(Eg,{ref:i,className:We("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",r),...l,children:[a,n.jsx(XS,{asChild:!0,children:n.jsx(sp,{className:"h-4 w-4 opacity-50"})})]}));ro.displayName=Eg.displayName;const so=x.forwardRef(({className:r,children:a,position:l="popper",...i},c)=>n.jsx(qS,{children:n.jsxs(Pg,{ref:c,className:We("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",l==="popper"&&"data-[side=bottom]:translate-y-1",r),position:l,...i,children:[n.jsx(tC,{className:"flex cursor-default items-center justify-center py-1",children:n.jsx(mw,{className:"h-4 w-4"})}),n.jsx(JS,{className:"p-1",children:a}),n.jsx(nC,{className:"flex cursor-default items-center justify-center py-1",children:n.jsx(sp,{className:"h-4 w-4"})})]})}));so.displayName=Pg.displayName;const mr=x.forwardRef(({className:r,children:a,...l},i)=>n.jsxs(Rg,{ref:i,className:We("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...l,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(eC,{children:n.jsx(No,{className:"h-4 w-4"})})}),n.jsx(ZS,{children:a})]}));mr.displayName=Rg.displayName;function rC(r){const a=new Map;for(const l of r){const i=l.partId||"part-1",c=l.partTitle||"未分类",d=l.chapterId||"chapter-1",f=l.chapterTitle||"未分类";a.has(i)||a.set(i,{id:i,title:c,chapters:new Map});const m=a.get(i);m.chapters.has(d)||m.chapters.set(d,{id:d,title:f,sections:[]}),m.chapters.get(d).sections.push({id:l.id,title:l.title,price:l.price??1,filePath:l.filePath,isFree:l.isFree})}return Array.from(a.values()).map(l=>({...l,chapters:Array.from(l.chapters.values())}))}function sC(r,a){const l=r.split(` +`),i=[];let c=null,d=[],f=1;for(const m of l){const p=m.match(/^#+\s+(.+)$/)||m.match(/^(\d+[.\、]\s*.+)$/);p?(c&&(c.content=d.join(` +`).trim(),c.content&&i.push(c)),c={id:`import-${f}`,title:p[1].replace(/^#+\s*/,"").trim(),price:1,isFree:f<=3},d=[],f++):c?d.push(m):m.trim()&&(c={id:`import-${f}`,title:a.replace(/\.(txt|md|markdown)$/i,""),price:1,isFree:!0},d.push(m),f++)}return c&&(c.content=d.join(` +`).trim(),c.content&&i.push(c)),i}function aC(){const[r,a]=x.useState([]),[l,i]=x.useState(!0),[c,d]=x.useState([]),[f,m]=x.useState(null),[p,g]=x.useState(!1),[v,y]=x.useState(!1),[E,k]=x.useState(!1),[C,b]=x.useState(!1),[j,N]=x.useState(""),[P,S]=x.useState(!1),[A,U]=x.useState(!1),[Q,Y]=x.useState(!1),[W,le]=x.useState(""),[de,oe]=x.useState(!1),[K,R]=x.useState(!1),[H,X]=x.useState(""),[V,B]=x.useState([]),[T,J]=x.useState(!1),[q,L]=x.useState(!1),G=x.useRef(null),fe=x.useRef(null),[se,be]=x.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),je=rC(r),ne=r.length,he=async()=>{i(!0);try{const $=await Ye("/api/db/book?action=list");a(Array.isArray($==null?void 0:$.sections)?$.sections:[]),c.length===0&&je.length>0&&d([je[0].id])}catch($){console.error($),a([])}finally{i(!1)}};x.useEffect(()=>{he()},[]),x.useEffect(()=>{!l&&je.length>0&&c.length===0&&d([je[0].id])},[l,je.length,c.length]);const Ee=$=>{d(ce=>ce.includes($)?ce.filter(st=>st!==$):[...ce,$])},Se=async $=>{oe(!0);try{const ce=await Ye(`/api/db/book?action=read&id=${encodeURIComponent($.id)}`);ce!=null&&ce.success&&ce.section?m({id:$.id,title:ce.section.title??$.title,price:ce.section.price??$.price,content:ce.section.content??"",filePath:$.filePath,isFree:$.isFree||$.price===0}):(m({id:$.id,title:$.title,price:$.price,content:"",filePath:$.filePath,isFree:$.isFree}),ce&&!ce.success&&alert("无法读取文件内容: "+(ce.error||"未知错误")))}catch(ce){console.error(ce),m({id:$.id,title:$.title,price:$.price,content:"",filePath:$.filePath,isFree:$.isFree})}finally{oe(!1)}},Te=async()=>{var $;if(f){R(!0);try{let ce=f.content||"";const st=[new RegExp(`^#+\\s*${f.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${f.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${($=f.title)==null?void 0:$.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const Dt of st)ce=ce.replace(Dt,"");ce=ce.replace(/^\s*\n+/,"").trim();const Be=await Un("/api/db/book",{id:f.id,title:f.title,price:f.isFree?0:f.price,content:ce,isFree:f.isFree||f.price===0,saveToFile:!0});Be&&Be.success!==!1?(alert(`已保存章节: ${f.title}`),m(null),he()):alert("保存失败: "+(Be&&typeof Be=="object"&&"error"in Be?Be.error:"未知错误"))}catch(ce){console.error(ce),alert("保存失败")}finally{R(!1)}}},z=async()=>{if(!se.id||!se.title){alert("请填写章节ID和标题");return}R(!0);try{const $=await Un("/api/db/book",{id:se.id,title:se.title,price:se.price,content:se.content,partId:se.partId,chapterId:se.chapterId,saveToFile:!1});$&&$.success!==!1?(alert(`章节创建成功: ${se.title}`),Y(!1),be({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),he()):alert("创建失败: "+($&&typeof $=="object"&&"error"in $?$.error:"未知错误"))}catch($){console.error($),alert("创建失败")}finally{R(!1)}},Ie=async $=>{var st,Be;const ce=(st=$.target.files)==null?void 0:st[0];if(ce){L(!0);try{const Dt=new FormData;Dt.append("file",ce),Dt.append("folder","book-images");const ct=await(await fetch(ru("/api/upload"),{method:"POST",body:Dt,credentials:"include"})).json();if(ct!=null&&ct.success&&((Be=ct==null?void 0:ct.data)!=null&&Be.url)){const mn=`![${ce.name}](${ct.data.url})`;f&&m({...f,content:(f.content||"")+` -`+mn}),alert(`图片上传成功: ${ct.data.url}`)}else alert("上传失败: "+((ct==null?void 0:ct.error)||"未知错误"))}catch(Dt){console.error(Dt),alert("上传失败")}finally{L(!1),fe.current&&(fe.current.value="")}}},ze=async()=>{var $;if(H.trim()){J(!0);try{const ce=await Ye(`/api/search?q=${encodeURIComponent(H)}`);ce!=null&&ce.success&&(($=ce.data)!=null&&$.results)?B(ce.data.results):(B([]),ce&&!ce.success&&alert("搜索失败: "+ce.error))}catch(ce){console.error(ce),B([]),alert("搜索失败")}finally{J(!1)}}},Nt=async()=>{g(!0);try{const $=await kt("/api/db/book",{action:"sync"});$&&$.success!==!1?(alert($.message||"同步成功"),he()):alert("同步失败: "+($&&typeof $=="object"&&"error"in $?$.error:"未知错误"))}catch($){console.error($),alert("同步失败")}finally{g(!1)}},Vt=async()=>{y(!0);try{const ce=await(await fetch(ru("/api/db/book?action=export"),{credentials:"include"})).blob(),st=window.URL.createObjectURL(ce),Be=document.createElement("a");Be.href=st,Be.download=`book_sections_${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(Be),Be.click(),window.URL.revokeObjectURL(st),document.body.removeChild(Be),alert("导出成功")}catch($){console.error($),alert("导出失败")}finally{y(!1)}},Jt=async()=>{if(!W.trim()){alert("请输入或上传JSON数据");return}k(!0);try{const $=JSON.parse(W),ce=await kt("/api/db/book",{action:"import",data:$});ce&&ce.success!==!1?(alert(ce.message||"导入成功"),U(!1),le(""),he()):alert("导入失败: "+(ce&&typeof ce=="object"&&"error"in ce?ce.error:"未知错误"))}catch($){console.error($),alert("导入失败: JSON格式错误")}finally{k(!1)}},Yr=$=>{var Be;const ce=(Be=$.target.files)==null?void 0:Be[0];if(!ce)return;const st=new FileReader;st.onload=Dt=>{var mn;const Rn=((mn=Dt.target)==null?void 0:mn.result)||"",ct=ce.name.toLowerCase();ct.endsWith(".json")?le(Rn):ct.endsWith(".txt")||ct.endsWith(".md")||ct.endsWith(".markdown")?le(JSON.stringify(eC(Rn,ce.name),null,2)):le(Rn)},st.readAsText(ce)},fn=async()=>{var $;if(confirm("确定要初始化数据库吗?这将创建所有必需的表结构。")){b(!0);try{const ce=await kt("/api/db/init",{adminToken:"init_db_2025"});ce&&ce.success!==!1?alert((($=ce.data)==null?void 0:$.message)||"初始化成功"):alert("初始化失败: "+(ce&&typeof ce=="object"&&"error"in ce?ce.error:"未知错误"))}catch(ce){console.error(ce),alert("初始化失败")}finally{b(!1)}}},Cr=async()=>{if(!j.trim()){alert("请输入飞书文档链接");return}g(!0),await new Promise($=>setTimeout($,2e3)),g(!1),S(!1),alert("飞书文档同步成功!")},hn=je.find($=>$.id===se.partId),Xr=(hn==null?void 0:hn.chapters)??[];return n.jsxs("div",{className:"p-8 max-w-6xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"内容管理"}),n.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",je.length," 篇 · ",ne," 节内容"]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(pe,{onClick:fn,disabled:C,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Cw,{className:"w-4 h-4 mr-2"}),C?"初始化中...":"初始化数据库"]}),n.jsxs(pe,{onClick:Nt,disabled:x,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${x?"animate-spin":""}`}),"同步到数据库"]}),n.jsxs(pe,{onClick:()=>U(!0),variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Cs,{className:"w-4 h-4 mr-2"}),"导入"]}),n.jsxs(pe,{onClick:Vt,disabled:v,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(ip,{className:"w-4 h-4 mr-2"}),v?"导出中...":"导出"]}),n.jsxs(pe,{onClick:()=>S(!0),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(cp,{className:"w-4 h-4 mr-2"}),"同步飞书"]})]})]}),n.jsx(Nn,{open:A,onOpenChange:U,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl",showCloseButton:!0,children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(Cs,{className:"w-5 h-5 text-[#38bdac]"}),"导入章节数据"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"上传文件 (支持 JSON / TXT / MD)"}),n.jsx("input",{ref:G,type:"file",accept:".json,.txt,.md,.markdown",onChange:Yr,className:"hidden"}),n.jsxs(pe,{variant:"outline",onClick:()=>{var $;return($=G.current)==null?void 0:$.click()},className:"w-full border-dashed border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Cs,{className:"w-4 h-4 mr-2"}),"选择文件 (JSON/TXT/MD)"]}),n.jsxs("p",{className:"text-xs text-gray-500",children:["• JSON格式: 直接导入章节数据",n.jsx("br",{}),"• TXT/MD格式: 自动解析为章节内容"]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"或粘贴数据"}),n.jsx($r,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[200px] font-mono text-sm placeholder:text-gray-500",placeholder:`JSON格式: [{"id": "1-1", "title": "章节标题", "content": "内容..."}] +`+mn}),alert(`图片上传成功: ${ct.data.url}`)}else alert("上传失败: "+((ct==null?void 0:ct.error)||"未知错误"))}catch(Dt){console.error(Dt),alert("上传失败")}finally{L(!1),fe.current&&(fe.current.value="")}}},ze=async()=>{var $;if(H.trim()){J(!0);try{const ce=await Ye(`/api/search?q=${encodeURIComponent(H)}`);ce!=null&&ce.success&&(($=ce.data)!=null&&$.results)?B(ce.data.results):(B([]),ce&&!ce.success&&alert("搜索失败: "+ce.error))}catch(ce){console.error(ce),B([]),alert("搜索失败")}finally{J(!1)}}},Nt=async()=>{g(!0);try{const $=await kt("/api/db/book",{action:"sync"});$&&$.success!==!1?(alert($.message||"同步成功"),he()):alert("同步失败: "+($&&typeof $=="object"&&"error"in $?$.error:"未知错误"))}catch($){console.error($),alert("同步失败")}finally{g(!1)}},Vt=async()=>{y(!0);try{const ce=await(await fetch(ru("/api/db/book?action=export"),{credentials:"include"})).blob(),st=window.URL.createObjectURL(ce),Be=document.createElement("a");Be.href=st,Be.download=`book_sections_${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(Be),Be.click(),window.URL.revokeObjectURL(st),document.body.removeChild(Be),alert("导出成功")}catch($){console.error($),alert("导出失败")}finally{y(!1)}},Jt=async()=>{if(!W.trim()){alert("请输入或上传JSON数据");return}k(!0);try{const $=JSON.parse(W),ce=await kt("/api/db/book",{action:"import",data:$});ce&&ce.success!==!1?(alert(ce.message||"导入成功"),U(!1),le(""),he()):alert("导入失败: "+(ce&&typeof ce=="object"&&"error"in ce?ce.error:"未知错误"))}catch($){console.error($),alert("导入失败: JSON格式错误")}finally{k(!1)}},Yr=$=>{var Be;const ce=(Be=$.target.files)==null?void 0:Be[0];if(!ce)return;const st=new FileReader;st.onload=Dt=>{var mn;const Rn=((mn=Dt.target)==null?void 0:mn.result)||"",ct=ce.name.toLowerCase();ct.endsWith(".json")?le(Rn):ct.endsWith(".txt")||ct.endsWith(".md")||ct.endsWith(".markdown")?le(JSON.stringify(sC(Rn,ce.name),null,2)):le(Rn)},st.readAsText(ce)},fn=async()=>{var $;if(confirm("确定要初始化数据库吗?这将创建所有必需的表结构。")){b(!0);try{const ce=await kt("/api/db/init",{adminToken:"init_db_2025"});ce&&ce.success!==!1?alert((($=ce.data)==null?void 0:$.message)||"初始化成功"):alert("初始化失败: "+(ce&&typeof ce=="object"&&"error"in ce?ce.error:"未知错误"))}catch(ce){console.error(ce),alert("初始化失败")}finally{b(!1)}}},Cr=async()=>{if(!j.trim()){alert("请输入飞书文档链接");return}g(!0),await new Promise($=>setTimeout($,2e3)),g(!1),S(!1),alert("飞书文档同步成功!")},hn=je.find($=>$.id===se.partId),Xr=(hn==null?void 0:hn.chapters)??[];return n.jsxs("div",{className:"p-8 max-w-6xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"内容管理"}),n.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",je.length," 篇 · ",ne," 节内容"]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(pe,{onClick:fn,disabled:C,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(kw,{className:"w-4 h-4 mr-2"}),C?"初始化中...":"初始化数据库"]}),n.jsxs(pe,{onClick:Nt,disabled:p,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${p?"animate-spin":""}`}),"同步到数据库"]}),n.jsxs(pe,{onClick:()=>U(!0),variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Cs,{className:"w-4 h-4 mr-2"}),"导入"]}),n.jsxs(pe,{onClick:Vt,disabled:v,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(cp,{className:"w-4 h-4 mr-2"}),v?"导出中...":"导出"]}),n.jsxs(pe,{onClick:()=>S(!0),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(up,{className:"w-4 h-4 mr-2"}),"同步飞书"]})]})]}),n.jsx(Nn,{open:A,onOpenChange:U,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl",showCloseButton:!0,children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(Cs,{className:"w-5 h-5 text-[#38bdac]"}),"导入章节数据"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"上传文件 (支持 JSON / TXT / MD)"}),n.jsx("input",{ref:G,type:"file",accept:".json,.txt,.md,.markdown",onChange:Yr,className:"hidden"}),n.jsxs(pe,{variant:"outline",onClick:()=>{var $;return($=G.current)==null?void 0:$.click()},className:"w-full border-dashed border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Cs,{className:"w-4 h-4 mr-2"}),"选择文件 (JSON/TXT/MD)"]}),n.jsxs("p",{className:"text-xs text-gray-500",children:["• JSON格式: 直接导入章节数据",n.jsx("br",{}),"• TXT/MD格式: 自动解析为章节内容"]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"或粘贴数据"}),n.jsx($r,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[200px] font-mono text-sm placeholder:text-gray-500",placeholder:`JSON格式: [{"id": "1-1", "title": "章节标题", "content": "内容..."}] -或直接粘贴TXT/MD内容,系统将自动解析`,value:W,onChange:$=>le($.target.value)})]})]}),n.jsxs(zn,{children:[n.jsx(pe,{variant:"outline",onClick:()=>{U(!1),le("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(pe,{onClick:Jt,disabled:E||!W.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"导入中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Cs,{className:"w-4 h-4 mr-2"}),"开始导入"]})})]})]})}),n.jsx(Nn,{open:P,onOpenChange:S,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(ks,{className:"w-5 h-5 text-[#38bdac]"}),"同步飞书文档"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"飞书文档链接"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://xxx.feishu.cn/docx/...",value:j,onChange:$=>N($.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"请确保文档已开启公开访问权限"})]}),n.jsx("div",{className:"bg-[#38bdac]/10 border border-[#38bdac]/30 rounded-lg p-3",children:n.jsx("p",{className:"text-[#38bdac] text-sm",children:"同步说明:系统将自动解析飞书文档结构,按照标题层级导入为章节内容。"})})]}),n.jsxs(zn,{children:[n.jsx(pe,{variant:"outline",onClick:()=>S(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(pe,{onClick:Cr,disabled:x,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:x?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"同步中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2"}),"开始同步"]})})]})]})}),n.jsx(Nn,{open:Q,onOpenChange:Y,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(Es,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"章节ID *"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:se.id,onChange:$=>be({...se,id:$.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"价格 (元)"}),n.jsx(ue,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:se.price,onChange:$=>be({...se,price:Number($.target.value)})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"章节标题 *"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:se.title,onChange:$=>be({...se,title:$.target.value})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"所属篇"}),n.jsxs(Kc,{value:se.partId,onValueChange:$=>be({...se,partId:$,chapterId:"chapter-1"}),children:[n.jsx(ro,{className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Gc,{})}),n.jsxs(so,{className:"bg-[#0f2137] border-gray-700",children:[je.map($=>n.jsx(mr,{value:$.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:$.title},$.id)),je.length===0&&n.jsx(mr,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"所属章"}),n.jsxs(Kc,{value:se.chapterId,onValueChange:$=>be({...se,chapterId:$}),children:[n.jsx(ro,{className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Gc,{})}),n.jsxs(so,{className:"bg-[#0f2137] border-gray-700",children:[Xr.map($=>n.jsx(mr,{value:$.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:$.title},$.id)),Xr.length===0&&n.jsx(mr,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"内容 (Markdown格式)"}),n.jsx($r,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:se.content,onChange:$=>be({...se,content:$.target.value})})]})]}),n.jsxs(zn,{children:[n.jsx(pe,{variant:"outline",onClick:()=>Y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(pe,{onClick:z,disabled:K||!se.id||!se.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:K?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Es,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),n.jsx(Nn,{open:!!f,onOpenChange:()=>m(null),children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(Ts,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),f&&n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"章节ID"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.id,disabled:!0})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"价格 (元)"}),n.jsx(ue,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:f.isFree?0:f.price,onChange:$=>m({...f,price:Number($.target.value),isFree:Number($.target.value)===0}),disabled:f.isFree})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"免费章节"}),n.jsx("div",{className:"flex items-center h-10",children:n.jsxs("label",{className:"flex items-center cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:f.isFree||f.price===0,onChange:$=>m({...f,isFree:$.target.checked,price:$.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),n.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"章节标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.title,onChange:$=>m({...f,title:$.target.value})})]}),f.filePath&&n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"文件路径"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:f.filePath,disabled:!0})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ae,{className:"text-gray-300",children:"内容 (Markdown格式)"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{ref:fe,type:"file",accept:"image/*",onChange:Ie,className:"hidden"}),n.jsxs(pe,{variant:"outline",size:"sm",onClick:()=>{var $;return($=fe.current)==null?void 0:$.click()},disabled:q,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[q?n.jsx(Ze,{className:"w-4 h-4 mr-1 animate-spin"}):n.jsx(zw,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),de?n.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsx($r,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[400px] font-mono text-sm placeholder:text-gray-500",placeholder:"此处输入章节内容,支持Markdown格式...",value:f.content,onChange:$=>m({...f,content:$.target.value})})]})]}),n.jsxs(zn,{children:[n.jsxs(pe,{variant:"outline",onClick:()=>m(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ur,{className:"w-4 h-4 mr-2"}),"取消"]}),n.jsx(pe,{onClick:Te,disabled:K,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:K?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),n.jsxs(zu,{defaultValue:"chapters",className:"space-y-6",children:[n.jsxs(To,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[n.jsxs(Xt,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(_s,{className:"w-4 h-4 mr-2"}),"章节管理"]}),n.jsxs(Xt,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(Br,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),n.jsxs(Xt,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(x1,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),n.jsxs(qt,{value:"chapters",className:"space-y-4",children:[n.jsxs(pe,{onClick:()=>Y(!0),className:"w-full bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[n.jsx(Es,{className:"w-4 h-4 mr-2"}),"新建章节"]}),l?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):je.map(($,ce)=>n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl overflow-hidden",children:[n.jsx(Ue,{className:"cursor-pointer hover:bg-[#162840] transition-colors",onClick:()=>Ee($.id),children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-[#38bdac] font-mono text-sm",children:["0",ce+1]}),n.jsx(Ke,{className:"text-white",children:$.title}),n.jsxs(Oe,{variant:"outline",className:"text-gray-400 border-gray-600",children:[$.chapters.reduce((st,Be)=>st+Be.sections.length,0)," 节"]})]}),n.jsx(sp,{className:`w-5 h-5 text-gray-400 transition-transform ${c.includes($.id)?"rotate-90":""}`})]})}),c.includes($.id)&&n.jsx(_e,{className:"pt-0 pb-4",children:n.jsx("div",{className:"space-y-3 pl-8 border-l-2 border-gray-700",children:$.chapters.map(st=>n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"font-medium text-gray-300",children:st.title}),n.jsx("div",{className:"space-y-1",children:st.sections.map(Be=>n.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg hover:bg-[#162840] text-sm group transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Jc,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-gray-400",children:Be.title})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[#38bdac] font-medium",children:Be.price===0?"免费":`¥${Be.price}`}),n.jsxs(pe,{variant:"ghost",size:"sm",onClick:()=>Se(Be),className:"text-gray-500 hover:text-[#38bdac] hover:bg-[#38bdac]/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx(Cu,{className:"w-4 h-4 mr-1"}),"读取"]}),n.jsxs(pe,{variant:"ghost",size:"sm",onClick:()=>Se(Be),className:"text-gray-500 hover:text-[#38bdac] hover:bg-[#38bdac]/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx(Ts,{className:"w-4 h-4 mr-1"}),"编辑"]})]})]},Be.id))})]},st.id))})})]},$.id))]}),n.jsx(qt,{value:"search",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Ue,{children:n.jsx(Ke,{className:"text-white",children:"内容搜索"})}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:H,onChange:$=>X($.target.value),onKeyDown:$=>$.key==="Enter"&&ze()}),n.jsx(pe,{onClick:ze,disabled:T||!H.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:T?n.jsx(Ze,{className:"w-4 h-4 animate-spin"}):n.jsx(Br,{className:"w-4 h-4"})})]}),V.length>0&&n.jsxs("div",{className:"space-y-2 mt-4",children:[n.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",V.length," 个结果"]}),V.map($=>n.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>Se({id:$.id,title:$.title,price:$.price??1,filePath:""}),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:$.id}),n.jsx("span",{className:"text-white",children:$.title})]}),n.jsx(Oe,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:$.matchType==="title"?"标题匹配":"内容匹配"})]}),$.snippet&&n.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:$.snippet}),($.partTitle||$.chapterTitle)&&n.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[$.partTitle," · ",$.chapterTitle]})]},$.id))]})]})]})}),n.jsx(qt,{value:"hooks",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Ue,{children:n.jsx(Ke,{className:"text-white",children:"引流钩子配置"})}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[n.jsx(ae,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),n.jsxs(Kc,{defaultValue:"3",children:[n.jsx(ro,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Gc,{placeholder:"选择章节"})}),n.jsxs(so,{className:"bg-[#0f2137] border-gray-700",children:[n.jsx(mr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),n.jsx(mr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),n.jsx(mr,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),n.jsxs("div",{className:"grid w-full gap-1.5",children:[n.jsx(ae,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),n.jsx($r,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),n.jsx(pe,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}function nC(){const[r,a]=p.useState([]),[l,i]=p.useState(null),[c,d]=p.useState(!0),[f,m]=p.useState([]),[x,g]=p.useState(null),[v,y]=p.useState(1);async function E(){d(!0);try{const j=await Ye("/api/admin/chapters");j!=null&&j.success&&j.data&&(a(j.data.structure??[]),i(j.data.stats??null))}catch(j){console.error("加载章节失败:",j)}finally{d(!1)}}p.useEffect(()=>{E()},[]);const k=j=>{m(N=>N.includes(j)?N.filter(P=>P!==j):[...N,j])},C=async j=>{try{const N=await kt("/api/admin/chapters",{action:"updatePrice",chapterId:j,data:{price:v}});N!=null&&N.success&&(alert("价格更新成功"),g(null),E())}catch(N){console.error("更新价格失败:",N)}},b=async(j,N)=>{try{const P=await kt("/api/admin/chapters",{action:"toggleFree",chapterId:j,data:{isFree:!N}});P!=null&&P.success&&(alert("状态更新成功"),E())}catch(P){console.error("更新状态失败:",P)}};return c?n.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:n.jsx("div",{className:"text-xl text-gray-400",children:"加载中..."})}):n.jsxs("div",{className:"min-h-screen bg-black text-white",children:[n.jsx("div",{className:"sticky top-0 bg-black/90 backdrop-blur border-b border-white/10 z-50",children:n.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-4 flex items-center justify-between",children:[n.jsx("h1",{className:"text-xl font-bold",children:"章节管理"}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("button",{type:"button",onClick:()=>m(r.map(j=>j.id)),className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white",children:"展开全部"}),n.jsx("button",{type:"button",onClick:()=>m([]),className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white",children:"收起全部"})]})]})}),n.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-8",children:[l&&n.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-8",children:[n.jsxs("div",{className:"bg-gradient-to-br from-cyan-500/20 to-cyan-500/5 border border-cyan-500/30 rounded-xl p-4",children:[n.jsx("div",{className:"text-3xl font-bold text-cyan-400",children:l.totalSections}),n.jsx("div",{className:"text-white/60 text-sm mt-1",children:"总章节数"})]}),n.jsxs("div",{className:"bg-gradient-to-br from-green-500/20 to-green-500/5 border border-green-500/30 rounded-xl p-4",children:[n.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.freeSections}),n.jsx("div",{className:"text-white/60 text-sm mt-1",children:"免费章节"})]}),n.jsxs("div",{className:"bg-gradient-to-br from-yellow-500/20 to-yellow-500/5 border border-yellow-500/30 rounded-xl p-4",children:[n.jsx("div",{className:"text-3xl font-bold text-yellow-400",children:l.paidSections}),n.jsx("div",{className:"text-white/60 text-sm mt-1",children:"付费章节"})]}),n.jsxs("div",{className:"bg-gradient-to-br from-purple-500/20 to-purple-500/5 border border-purple-500/30 rounded-xl p-4",children:[n.jsx("div",{className:"text-3xl font-bold text-purple-400",children:l.totalParts}),n.jsx("div",{className:"text-white/60 text-sm mt-1",children:"篇章数"})]})]}),n.jsx("div",{className:"space-y-4",children:r.map(j=>n.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-xl overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 cursor-pointer hover:bg-white/5",onClick:()=>k(j.id),onKeyDown:N=>N.key==="Enter"&&k(j.id),role:"button",tabIndex:0,children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-2xl",children:j.type==="preface"?"📖":j.type==="epilogue"?"🎬":j.type==="appendix"?"📎":"📚"}),n.jsx("span",{className:"font-semibold text-white",children:j.title}),n.jsxs("span",{className:"text-white/40 text-sm",children:["(",j.chapters.reduce((N,P)=>{var S;return N+(((S=P.sections)==null?void 0:S.length)||1)},0)," 节)"]})]}),n.jsx("span",{className:"text-white/40",children:f.includes(j.id)?"▲":"▼"})]}),f.includes(j.id)&&n.jsx("div",{className:"border-t border-white/10",children:j.chapters.map(N=>n.jsx("div",{className:"border-b border-white/5 last:border-b-0",children:N.sections?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-6 py-3 bg-white/5 text-white/70 font-medium",children:N.title}),n.jsx("div",{className:"divide-y divide-white/5",children:N.sections.map(P=>n.jsxs("div",{className:"flex items-center justify-between px-6 py-3 hover:bg-white/5",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:P.isFree?"text-green-400":"text-yellow-400",children:P.isFree?"🔓":"🔒"}),n.jsx("span",{className:"text-white/80",children:P.id}),n.jsx("span",{className:"text-white/60",children:P.title})]}),n.jsx("div",{className:"flex items-center gap-3",children:x===P.id?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",value:v,onChange:S=>y(Number(S.target.value)),className:"w-20 px-2 py-1 bg-white/10 border border-white/20 rounded text-white",min:0,step:.1}),n.jsx("button",{type:"button",onClick:()=>C(P.id),className:"px-3 py-1 bg-cyan-500 text-black rounded text-sm",children:"保存"}),n.jsx("button",{type:"button",onClick:()=>g(null),className:"px-3 py-1 bg-white/20 rounded text-sm text-white",children:"取消"})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:`px-2 py-1 rounded text-xs ${P.isFree?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:P.isFree?"免费":`¥${P.price}`}),n.jsx("button",{type:"button",onClick:()=>{g(P.id),y(P.price)},className:"px-2 py-1 text-xs bg-white/10 rounded hover:bg-white/20 text-white",children:"编辑价格"}),n.jsx("button",{type:"button",onClick:()=>b(P.id,P.isFree),className:"px-2 py-1 text-xs bg-white/10 rounded hover:bg-white/20 text-white",children:P.isFree?"设为付费":"设为免费"})]})})]},P.id))})]}):n.jsxs("div",{className:"flex items-center justify-between px-6 py-3 hover:bg-white/5",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:N.isFree?"text-green-400":"text-yellow-400",children:N.isFree?"🔓":"🔒"}),n.jsx("span",{className:"text-white/80",children:N.title})]}),n.jsx("span",{className:`px-2 py-1 rounded text-xs ${N.isFree?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:N.isFree?"免费":`¥${N.price??1}`})]})},N.id))})]},j.id))})]})]})}var Rg=["PageUp","PageDown"],_g=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Tg={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Bs="Slider",[xu,rC,sC]=Ou(Bs),[Ig]=jr(Bs,[sC]),[aC,zo]=Ig(Bs),Ag=p.forwardRef((r,a)=>{const{name:l,min:i=0,max:c=100,step:d=1,orientation:f="horizontal",disabled:m=!1,minStepsBetweenThumbs:x=0,defaultValue:g=[i],value:v,onValueChange:y=()=>{},onValueCommit:E=()=>{},inverted:k=!1,form:C,...b}=r,j=p.useRef(new Set),N=p.useRef(0),S=f==="horizontal"?lC:oC,[A=[],U]=Vr({prop:v,defaultProp:g,onChange:oe=>{var R;(R=[...j.current][N.current])==null||R.focus(),y(oe)}}),Q=p.useRef(A);function Y(oe){const K=fC(A,oe);de(oe,K)}function W(oe){de(oe,N.current)}function le(){const oe=Q.current[N.current];A[N.current]!==oe&&E(A)}function de(oe,K,{commit:R}={commit:!1}){const H=xC(d),X=gC(Math.round((oe-i)/d)*d+i,H),V=ho(X,[i,c]);U((B=[])=>{const T=uC(B,V,K);if(pC(T,x*d)){N.current=T.indexOf(V);const J=String(T)!==String(B);return J&&R&&E(T),J?T:B}else return B})}return n.jsx(aC,{scope:r.__scopeSlider,name:l,disabled:m,min:i,max:c,valueIndexToChangeRef:N,thumbs:j.current,values:A,orientation:f,form:C,children:n.jsx(xu.Provider,{scope:r.__scopeSlider,children:n.jsx(xu.Slot,{scope:r.__scopeSlider,children:n.jsx(S,{"aria-disabled":m,"data-disabled":m?"":void 0,...b,ref:a,onPointerDown:Ae(b.onPointerDown,()=>{m||(Q.current=A)}),min:i,max:c,inverted:k,onSlideStart:m?void 0:Y,onSlideMove:m?void 0:W,onSlideEnd:m?void 0:le,onHomeKeyDown:()=>!m&&de(i,0,{commit:!0}),onEndKeyDown:()=>!m&&de(c,A.length-1,{commit:!0}),onStepKeyDown:({event:oe,direction:K})=>{if(!m){const X=Rg.includes(oe.key)||oe.shiftKey&&_g.includes(oe.key)?10:1,V=N.current,B=A[V],T=d*X*K;de(B+T,V,{commit:!0})}}})})})})});Ag.displayName=Bs;var[Mg,Lg]=Ig(Bs,{startEdge:"left",endEdge:"right",size:"width",direction:1}),lC=p.forwardRef((r,a)=>{const{min:l,max:i,dir:c,inverted:d,onSlideStart:f,onSlideMove:m,onSlideEnd:x,onStepKeyDown:g,...v}=r,[y,E]=p.useState(null),k=Ve(a,S=>E(S)),C=p.useRef(void 0),b=Ro(c),j=b==="ltr",N=j&&!d||!j&&d;function P(S){const A=C.current||y.getBoundingClientRect(),U=[0,A.width],Y=Yu(U,N?[l,i]:[i,l]);return C.current=A,Y(S-A.left)}return n.jsx(Mg,{scope:r.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:n.jsx(Dg,{dir:b,"data-orientation":"horizontal",...v,ref:k,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:S=>{const A=P(S.clientX);f==null||f(A)},onSlideMove:S=>{const A=P(S.clientX);m==null||m(A)},onSlideEnd:()=>{C.current=void 0,x==null||x()},onStepKeyDown:S=>{const U=Tg[N?"from-left":"from-right"].includes(S.key);g==null||g({event:S,direction:U?-1:1})}})})}),oC=p.forwardRef((r,a)=>{const{min:l,max:i,inverted:c,onSlideStart:d,onSlideMove:f,onSlideEnd:m,onStepKeyDown:x,...g}=r,v=p.useRef(null),y=Ve(a,v),E=p.useRef(void 0),k=!c;function C(b){const j=E.current||v.current.getBoundingClientRect(),N=[0,j.height],S=Yu(N,k?[i,l]:[l,i]);return E.current=j,S(b-j.top)}return n.jsx(Mg,{scope:r.__scopeSlider,startEdge:k?"bottom":"top",endEdge:k?"top":"bottom",size:"height",direction:k?1:-1,children:n.jsx(Dg,{"data-orientation":"vertical",...g,ref:y,style:{...g.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const j=C(b.clientY);d==null||d(j)},onSlideMove:b=>{const j=C(b.clientY);f==null||f(j)},onSlideEnd:()=>{E.current=void 0,m==null||m()},onStepKeyDown:b=>{const N=Tg[k?"from-bottom":"from-top"].includes(b.key);x==null||x({event:b,direction:N?-1:1})}})})}),Dg=p.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:f,onEndKeyDown:m,onStepKeyDown:x,...g}=r,v=zo(Bs,l);return n.jsx(Le.span,{...g,ref:a,onKeyDown:Ae(r.onKeyDown,y=>{y.key==="Home"?(f(y),y.preventDefault()):y.key==="End"?(m(y),y.preventDefault()):Rg.concat(_g).includes(y.key)&&(x(y),y.preventDefault())}),onPointerDown:Ae(r.onPointerDown,y=>{const E=y.target;E.setPointerCapture(y.pointerId),y.preventDefault(),v.thumbs.has(E)?E.focus():i(y)}),onPointerMove:Ae(r.onPointerMove,y=>{y.target.hasPointerCapture(y.pointerId)&&c(y)}),onPointerUp:Ae(r.onPointerUp,y=>{const E=y.target;E.hasPointerCapture(y.pointerId)&&(E.releasePointerCapture(y.pointerId),d(y))})})}),Og="SliderTrack",Fg=p.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=zo(Og,l);return n.jsx(Le.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...i,ref:a})});Fg.displayName=Og;var gu="SliderRange",zg=p.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=zo(gu,l),d=Lg(gu,l),f=p.useRef(null),m=Ve(a,f),x=c.values.length,g=c.values.map(E=>Ug(E,c.min,c.max)),v=x>1?Math.min(...g):0,y=100-Math.max(...g);return n.jsx(Le.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...i,ref:m,style:{...r.style,[d.startEdge]:v+"%",[d.endEdge]:y+"%"}})});zg.displayName=gu;var vu="SliderThumb",$g=p.forwardRef((r,a)=>{const l=rC(r.__scopeSlider),[i,c]=p.useState(null),d=Ve(a,m=>c(m)),f=p.useMemo(()=>i?l().findIndex(m=>m.ref.current===i):-1,[l,i]);return n.jsx(iC,{...r,ref:d,index:f})}),iC=p.forwardRef((r,a)=>{const{__scopeSlider:l,index:i,name:c,...d}=r,f=zo(vu,l),m=Lg(vu,l),[x,g]=p.useState(null),v=Ve(a,P=>g(P)),y=x?f.form||!!x.closest("form"):!0,E=Du(x),k=f.values[i],C=k===void 0?0:Ug(k,f.min,f.max),b=dC(i,f.values.length),j=E==null?void 0:E[m.size],N=j?hC(j,C,m.direction):0;return p.useEffect(()=>{if(x)return f.thumbs.add(x),()=>{f.thumbs.delete(x)}},[x,f.thumbs]),n.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[m.startEdge]:`calc(${C}% + ${N}px)`},children:[n.jsx(xu.ItemSlot,{scope:r.__scopeSlider,children:n.jsx(Le.span,{role:"slider","aria-label":r["aria-label"]||b,"aria-valuemin":f.min,"aria-valuenow":k,"aria-valuemax":f.max,"aria-orientation":f.orientation,"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,tabIndex:f.disabled?void 0:0,...d,ref:v,style:k===void 0?{display:"none"}:r.style,onFocus:Ae(r.onFocus,()=>{f.valueIndexToChangeRef.current=i})})}),y&&n.jsx(Bg,{name:c??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:k},i)]})});$g.displayName=vu;var cC="RadioBubbleInput",Bg=p.forwardRef(({__scopeSlider:r,value:a,...l},i)=>{const c=p.useRef(null),d=Ve(c,i),f=Lu(a);return p.useEffect(()=>{const m=c.current;if(!m)return;const x=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(x,"value").set;if(f!==a&&v){const y=new Event("input",{bubbles:!0});v.call(m,a),m.dispatchEvent(y)}},[f,a]),n.jsx(Le.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});Bg.displayName=cC;function uC(r=[],a,l){const i=[...r];return i[l]=a,i.sort((c,d)=>c-d)}function Ug(r,a,l){const d=100/(l-a)*(r-a);return ho(d,[0,100])}function dC(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function fC(r,a){if(r.length===1)return 0;const l=r.map(c=>Math.abs(c-a)),i=Math.min(...l);return l.indexOf(i)}function hC(r,a,l){const i=r/2,d=Yu([0,50],[0,i]);return(i-d(a)*l)*l}function mC(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function pC(r,a){if(a>0){const l=mC(r);return Math.min(...l)>=a}return!0}function Yu(r,a){return l=>{if(r[0]===r[1]||a[0]===a[1])return a[0];const i=(a[1]-a[0])/(r[1]-r[0]);return a[0]+i*(l-r[0])}}function xC(r){return(String(r).split(".")[1]||"").length}function gC(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var vC=Ag,yC=Fg,wC=zg,NC=$g;function jC({className:r,defaultValue:a,value:l,min:i=0,max:c=100,...d}){const f=p.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[i,c],[l,a,i,c]);return n.jsxs(vC,{defaultValue:a,value:l,min:i,max:c,className:We("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...d,children:[n.jsx(yC,{className:"bg-muted relative grow overflow-hidden rounded-full h-1.5 w-full",children:n.jsx(wC,{className:"bg-primary absolute h-full"})}),Array.from({length:f.length},(m,x)=>n.jsx(NC,{className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},x))]})}const bC={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1};function SC(){const[r,a]=p.useState(bC),[l,i]=p.useState(!0),[c,d]=p.useState(!1);p.useEffect(()=>{Ye("/api/admin/referral-settings").then(x=>{const g=x==null?void 0:x.data;g&&typeof g=="object"&&a({distributorShare:g.distributorShare??90,minWithdrawAmount:g.minWithdrawAmount??10,bindingDays:g.bindingDays??30,userDiscount:g.userDiscount??5,enableAutoWithdraw:g.enableAutoWithdraw??!1})}).catch(console.error).finally(()=>i(!1))},[]);const f=async()=>{d(!0);try{const x={distributorShare:Number(r.distributorShare)||0,minWithdrawAmount:Number(r.minWithdrawAmount)||0,bindingDays:Number(r.bindingDays)||0,userDiscount:Number(r.userDiscount)||0,enableAutoWithdraw:!!r.enableAutoWithdraw},g=await kt("/api/admin/referral-settings",x);if(!g||g.success===!1){alert("保存失败: "+(g&&typeof g=="object"&&"error"in g?g.error:""));return}alert(`✅ 分销配置已保存成功! +或直接粘贴TXT/MD内容,系统将自动解析`,value:W,onChange:$=>le($.target.value)})]})]}),n.jsxs(zn,{children:[n.jsx(pe,{variant:"outline",onClick:()=>{U(!1),le("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(pe,{onClick:Jt,disabled:E||!W.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"导入中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Cs,{className:"w-4 h-4 mr-2"}),"开始导入"]})})]})]})}),n.jsx(Nn,{open:P,onOpenChange:S,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(ks,{className:"w-5 h-5 text-[#38bdac]"}),"同步飞书文档"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"飞书文档链接"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://xxx.feishu.cn/docx/...",value:j,onChange:$=>N($.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"请确保文档已开启公开访问权限"})]}),n.jsx("div",{className:"bg-[#38bdac]/10 border border-[#38bdac]/30 rounded-lg p-3",children:n.jsx("p",{className:"text-[#38bdac] text-sm",children:"同步说明:系统将自动解析飞书文档结构,按照标题层级导入为章节内容。"})})]}),n.jsxs(zn,{children:[n.jsx(pe,{variant:"outline",onClick:()=>S(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(pe,{onClick:Cr,disabled:p,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:p?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"同步中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2"}),"开始同步"]})})]})]})}),n.jsx(Nn,{open:Q,onOpenChange:Y,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(Es,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"章节ID *"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:se.id,onChange:$=>be({...se,id:$.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"价格 (元)"}),n.jsx(ue,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:se.price,onChange:$=>be({...se,price:Number($.target.value)})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"章节标题 *"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:se.title,onChange:$=>be({...se,title:$.target.value})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"所属篇"}),n.jsxs(Kc,{value:se.partId,onValueChange:$=>be({...se,partId:$,chapterId:"chapter-1"}),children:[n.jsx(ro,{className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Gc,{})}),n.jsxs(so,{className:"bg-[#0f2137] border-gray-700",children:[je.map($=>n.jsx(mr,{value:$.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:$.title},$.id)),je.length===0&&n.jsx(mr,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"所属章"}),n.jsxs(Kc,{value:se.chapterId,onValueChange:$=>be({...se,chapterId:$}),children:[n.jsx(ro,{className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Gc,{})}),n.jsxs(so,{className:"bg-[#0f2137] border-gray-700",children:[Xr.map($=>n.jsx(mr,{value:$.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:$.title},$.id)),Xr.length===0&&n.jsx(mr,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"内容 (Markdown格式)"}),n.jsx($r,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:se.content,onChange:$=>be({...se,content:$.target.value})})]})]}),n.jsxs(zn,{children:[n.jsx(pe,{variant:"outline",onClick:()=>Y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(pe,{onClick:z,disabled:K||!se.id||!se.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:K?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Es,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),n.jsx(Nn,{open:!!f,onOpenChange:()=>m(null),children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[n.jsx(Ts,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),f&&n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"章节ID"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.id,disabled:!0})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"价格 (元)"}),n.jsx(ue,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:f.isFree?0:f.price,onChange:$=>m({...f,price:Number($.target.value),isFree:Number($.target.value)===0}),disabled:f.isFree})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"免费章节"}),n.jsx("div",{className:"flex items-center h-10",children:n.jsxs("label",{className:"flex items-center cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:f.isFree||f.price===0,onChange:$=>m({...f,isFree:$.target.checked,price:$.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),n.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"章节标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.title,onChange:$=>m({...f,title:$.target.value})})]}),f.filePath&&n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"文件路径"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:f.filePath,disabled:!0})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ae,{className:"text-gray-300",children:"内容 (Markdown格式)"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{ref:fe,type:"file",accept:"image/*",onChange:Ie,className:"hidden"}),n.jsxs(pe,{variant:"outline",size:"sm",onClick:()=>{var $;return($=fe.current)==null?void 0:$.click()},disabled:q,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[q?n.jsx(Ze,{className:"w-4 h-4 mr-1 animate-spin"}):n.jsx($w,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),de?n.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsx($r,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[400px] font-mono text-sm placeholder:text-gray-500",placeholder:"此处输入章节内容,支持Markdown格式...",value:f.content,onChange:$=>m({...f,content:$.target.value})})]})]}),n.jsxs(zn,{children:[n.jsxs(pe,{variant:"outline",onClick:()=>m(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ur,{className:"w-4 h-4 mr-2"}),"取消"]}),n.jsx(pe,{onClick:Te,disabled:K,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:K?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),n.jsxs($u,{defaultValue:"chapters",className:"space-y-6",children:[n.jsxs(To,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[n.jsxs(Xt,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(_s,{className:"w-4 h-4 mr-2"}),"章节管理"]}),n.jsxs(Xt,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(Br,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),n.jsxs(Xt,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(g1,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),n.jsxs(qt,{value:"chapters",className:"space-y-4",children:[n.jsxs(pe,{onClick:()=>Y(!0),className:"w-full bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[n.jsx(Es,{className:"w-4 h-4 mr-2"}),"新建章节"]}),l?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):je.map(($,ce)=>n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl overflow-hidden",children:[n.jsx(Ue,{className:"cursor-pointer hover:bg-[#162840] transition-colors",onClick:()=>Ee($.id),children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-[#38bdac] font-mono text-sm",children:["0",ce+1]}),n.jsx(Ke,{className:"text-white",children:$.title}),n.jsxs(Oe,{variant:"outline",className:"text-gray-400 border-gray-600",children:[$.chapters.reduce((st,Be)=>st+Be.sections.length,0)," 节"]})]}),n.jsx(ap,{className:`w-5 h-5 text-gray-400 transition-transform ${c.includes($.id)?"rotate-90":""}`})]})}),c.includes($.id)&&n.jsx(_e,{className:"pt-0 pb-4",children:n.jsx("div",{className:"space-y-3 pl-8 border-l-2 border-gray-700",children:$.chapters.map(st=>n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"font-medium text-gray-300",children:st.title}),n.jsx("div",{className:"space-y-1",children:st.sections.map(Be=>n.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg hover:bg-[#162840] text-sm group transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Jc,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-gray-400",children:Be.title})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[#38bdac] font-medium",children:Be.price===0?"免费":`¥${Be.price}`}),n.jsxs(pe,{variant:"ghost",size:"sm",onClick:()=>Se(Be),className:"text-gray-500 hover:text-[#38bdac] hover:bg-[#38bdac]/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx(Cu,{className:"w-4 h-4 mr-1"}),"读取"]}),n.jsxs(pe,{variant:"ghost",size:"sm",onClick:()=>Se(Be),className:"text-gray-500 hover:text-[#38bdac] hover:bg-[#38bdac]/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx(Ts,{className:"w-4 h-4 mr-1"}),"编辑"]})]})]},Be.id))})]},st.id))})})]},$.id))]}),n.jsx(qt,{value:"search",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Ue,{children:n.jsx(Ke,{className:"text-white",children:"内容搜索"})}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:H,onChange:$=>X($.target.value),onKeyDown:$=>$.key==="Enter"&&ze()}),n.jsx(pe,{onClick:ze,disabled:T||!H.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:T?n.jsx(Ze,{className:"w-4 h-4 animate-spin"}):n.jsx(Br,{className:"w-4 h-4"})})]}),V.length>0&&n.jsxs("div",{className:"space-y-2 mt-4",children:[n.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",V.length," 个结果"]}),V.map($=>n.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>Se({id:$.id,title:$.title,price:$.price??1,filePath:""}),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:$.id}),n.jsx("span",{className:"text-white",children:$.title})]}),n.jsx(Oe,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:$.matchType==="title"?"标题匹配":"内容匹配"})]}),$.snippet&&n.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:$.snippet}),($.partTitle||$.chapterTitle)&&n.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[$.partTitle," · ",$.chapterTitle]})]},$.id))]})]})]})}),n.jsx(qt,{value:"hooks",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Ue,{children:n.jsx(Ke,{className:"text-white",children:"引流钩子配置"})}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[n.jsx(ae,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),n.jsxs(Kc,{defaultValue:"3",children:[n.jsx(ro,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Gc,{placeholder:"选择章节"})}),n.jsxs(so,{className:"bg-[#0f2137] border-gray-700",children:[n.jsx(mr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),n.jsx(mr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),n.jsx(mr,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),n.jsxs("div",{className:"grid w-full gap-1.5",children:[n.jsx(ae,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),n.jsx($r,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),n.jsx(pe,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}function lC(){const[r,a]=x.useState([]),[l,i]=x.useState(null),[c,d]=x.useState(!0),[f,m]=x.useState([]),[p,g]=x.useState(null),[v,y]=x.useState(1);async function E(){d(!0);try{const j=await Ye("/api/admin/chapters");j!=null&&j.success&&j.data&&(a(j.data.structure??[]),i(j.data.stats??null))}catch(j){console.error("加载章节失败:",j)}finally{d(!1)}}x.useEffect(()=>{E()},[]);const k=j=>{m(N=>N.includes(j)?N.filter(P=>P!==j):[...N,j])},C=async j=>{try{const N=await kt("/api/admin/chapters",{action:"updatePrice",chapterId:j,data:{price:v}});N!=null&&N.success&&(alert("价格更新成功"),g(null),E())}catch(N){console.error("更新价格失败:",N)}},b=async(j,N)=>{try{const P=await kt("/api/admin/chapters",{action:"toggleFree",chapterId:j,data:{isFree:!N}});P!=null&&P.success&&(alert("状态更新成功"),E())}catch(P){console.error("更新状态失败:",P)}};return c?n.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:n.jsx("div",{className:"text-xl text-gray-400",children:"加载中..."})}):n.jsxs("div",{className:"min-h-screen bg-black text-white",children:[n.jsx("div",{className:"sticky top-0 bg-black/90 backdrop-blur border-b border-white/10 z-50",children:n.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-4 flex items-center justify-between",children:[n.jsx("h1",{className:"text-xl font-bold",children:"章节管理"}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("button",{type:"button",onClick:()=>m(r.map(j=>j.id)),className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white",children:"展开全部"}),n.jsx("button",{type:"button",onClick:()=>m([]),className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white",children:"收起全部"})]})]})}),n.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-8",children:[l&&n.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-8",children:[n.jsxs("div",{className:"bg-gradient-to-br from-cyan-500/20 to-cyan-500/5 border border-cyan-500/30 rounded-xl p-4",children:[n.jsx("div",{className:"text-3xl font-bold text-cyan-400",children:l.totalSections}),n.jsx("div",{className:"text-white/60 text-sm mt-1",children:"总章节数"})]}),n.jsxs("div",{className:"bg-gradient-to-br from-green-500/20 to-green-500/5 border border-green-500/30 rounded-xl p-4",children:[n.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.freeSections}),n.jsx("div",{className:"text-white/60 text-sm mt-1",children:"免费章节"})]}),n.jsxs("div",{className:"bg-gradient-to-br from-yellow-500/20 to-yellow-500/5 border border-yellow-500/30 rounded-xl p-4",children:[n.jsx("div",{className:"text-3xl font-bold text-yellow-400",children:l.paidSections}),n.jsx("div",{className:"text-white/60 text-sm mt-1",children:"付费章节"})]}),n.jsxs("div",{className:"bg-gradient-to-br from-purple-500/20 to-purple-500/5 border border-purple-500/30 rounded-xl p-4",children:[n.jsx("div",{className:"text-3xl font-bold text-purple-400",children:l.totalParts}),n.jsx("div",{className:"text-white/60 text-sm mt-1",children:"篇章数"})]})]}),n.jsx("div",{className:"space-y-4",children:r.map(j=>n.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-xl overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 cursor-pointer hover:bg-white/5",onClick:()=>k(j.id),onKeyDown:N=>N.key==="Enter"&&k(j.id),role:"button",tabIndex:0,children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-2xl",children:j.type==="preface"?"📖":j.type==="epilogue"?"🎬":j.type==="appendix"?"📎":"📚"}),n.jsx("span",{className:"font-semibold text-white",children:j.title}),n.jsxs("span",{className:"text-white/40 text-sm",children:["(",j.chapters.reduce((N,P)=>{var S;return N+(((S=P.sections)==null?void 0:S.length)||1)},0)," 节)"]})]}),n.jsx("span",{className:"text-white/40",children:f.includes(j.id)?"▲":"▼"})]}),f.includes(j.id)&&n.jsx("div",{className:"border-t border-white/10",children:j.chapters.map(N=>n.jsx("div",{className:"border-b border-white/5 last:border-b-0",children:N.sections?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-6 py-3 bg-white/5 text-white/70 font-medium",children:N.title}),n.jsx("div",{className:"divide-y divide-white/5",children:N.sections.map(P=>n.jsxs("div",{className:"flex items-center justify-between px-6 py-3 hover:bg-white/5",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:P.isFree?"text-green-400":"text-yellow-400",children:P.isFree?"🔓":"🔒"}),n.jsx("span",{className:"text-white/80",children:P.id}),n.jsx("span",{className:"text-white/60",children:P.title})]}),n.jsx("div",{className:"flex items-center gap-3",children:p===P.id?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",value:v,onChange:S=>y(Number(S.target.value)),className:"w-20 px-2 py-1 bg-white/10 border border-white/20 rounded text-white",min:0,step:.1}),n.jsx("button",{type:"button",onClick:()=>C(P.id),className:"px-3 py-1 bg-cyan-500 text-black rounded text-sm",children:"保存"}),n.jsx("button",{type:"button",onClick:()=>g(null),className:"px-3 py-1 bg-white/20 rounded text-sm text-white",children:"取消"})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:`px-2 py-1 rounded text-xs ${P.isFree?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:P.isFree?"免费":`¥${P.price}`}),n.jsx("button",{type:"button",onClick:()=>{g(P.id),y(P.price)},className:"px-2 py-1 text-xs bg-white/10 rounded hover:bg-white/20 text-white",children:"编辑价格"}),n.jsx("button",{type:"button",onClick:()=>b(P.id,P.isFree),className:"px-2 py-1 text-xs bg-white/10 rounded hover:bg-white/20 text-white",children:P.isFree?"设为付费":"设为免费"})]})})]},P.id))})]}):n.jsxs("div",{className:"flex items-center justify-between px-6 py-3 hover:bg-white/5",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:N.isFree?"text-green-400":"text-yellow-400",children:N.isFree?"🔓":"🔒"}),n.jsx("span",{className:"text-white/80",children:N.title})]}),n.jsx("span",{className:`px-2 py-1 rounded text-xs ${N.isFree?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:N.isFree?"免费":`¥${N.price??1}`})]})},N.id))})]},j.id))})]})]})}var _g=["PageUp","PageDown"],Tg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ig={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Bs="Slider",[xu,oC,iC]=Fu(Bs),[Ag]=jr(Bs,[iC]),[cC,zo]=Ag(Bs),Mg=x.forwardRef((r,a)=>{const{name:l,min:i=0,max:c=100,step:d=1,orientation:f="horizontal",disabled:m=!1,minStepsBetweenThumbs:p=0,defaultValue:g=[i],value:v,onValueChange:y=()=>{},onValueCommit:E=()=>{},inverted:k=!1,form:C,...b}=r,j=x.useRef(new Set),N=x.useRef(0),S=f==="horizontal"?uC:dC,[A=[],U]=Vr({prop:v,defaultProp:g,onChange:oe=>{var R;(R=[...j.current][N.current])==null||R.focus(),y(oe)}}),Q=x.useRef(A);function Y(oe){const K=xC(A,oe);de(oe,K)}function W(oe){de(oe,N.current)}function le(){const oe=Q.current[N.current];A[N.current]!==oe&&E(A)}function de(oe,K,{commit:R}={commit:!1}){const H=wC(d),X=NC(Math.round((oe-i)/d)*d+i,H),V=ho(X,[i,c]);U((B=[])=>{const T=mC(B,V,K);if(yC(T,p*d)){N.current=T.indexOf(V);const J=String(T)!==String(B);return J&&R&&E(T),J?T:B}else return B})}return n.jsx(cC,{scope:r.__scopeSlider,name:l,disabled:m,min:i,max:c,valueIndexToChangeRef:N,thumbs:j.current,values:A,orientation:f,form:C,children:n.jsx(xu.Provider,{scope:r.__scopeSlider,children:n.jsx(xu.Slot,{scope:r.__scopeSlider,children:n.jsx(S,{"aria-disabled":m,"data-disabled":m?"":void 0,...b,ref:a,onPointerDown:Ae(b.onPointerDown,()=>{m||(Q.current=A)}),min:i,max:c,inverted:k,onSlideStart:m?void 0:Y,onSlideMove:m?void 0:W,onSlideEnd:m?void 0:le,onHomeKeyDown:()=>!m&&de(i,0,{commit:!0}),onEndKeyDown:()=>!m&&de(c,A.length-1,{commit:!0}),onStepKeyDown:({event:oe,direction:K})=>{if(!m){const X=_g.includes(oe.key)||oe.shiftKey&&Tg.includes(oe.key)?10:1,V=N.current,B=A[V],T=d*X*K;de(B+T,V,{commit:!0})}}})})})})});Mg.displayName=Bs;var[Lg,Dg]=Ag(Bs,{startEdge:"left",endEdge:"right",size:"width",direction:1}),uC=x.forwardRef((r,a)=>{const{min:l,max:i,dir:c,inverted:d,onSlideStart:f,onSlideMove:m,onSlideEnd:p,onStepKeyDown:g,...v}=r,[y,E]=x.useState(null),k=Ve(a,S=>E(S)),C=x.useRef(void 0),b=Ro(c),j=b==="ltr",N=j&&!d||!j&&d;function P(S){const A=C.current||y.getBoundingClientRect(),U=[0,A.width],Y=Xu(U,N?[l,i]:[i,l]);return C.current=A,Y(S-A.left)}return n.jsx(Lg,{scope:r.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:n.jsx(Og,{dir:b,"data-orientation":"horizontal",...v,ref:k,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:S=>{const A=P(S.clientX);f==null||f(A)},onSlideMove:S=>{const A=P(S.clientX);m==null||m(A)},onSlideEnd:()=>{C.current=void 0,p==null||p()},onStepKeyDown:S=>{const U=Ig[N?"from-left":"from-right"].includes(S.key);g==null||g({event:S,direction:U?-1:1})}})})}),dC=x.forwardRef((r,a)=>{const{min:l,max:i,inverted:c,onSlideStart:d,onSlideMove:f,onSlideEnd:m,onStepKeyDown:p,...g}=r,v=x.useRef(null),y=Ve(a,v),E=x.useRef(void 0),k=!c;function C(b){const j=E.current||v.current.getBoundingClientRect(),N=[0,j.height],S=Xu(N,k?[i,l]:[l,i]);return E.current=j,S(b-j.top)}return n.jsx(Lg,{scope:r.__scopeSlider,startEdge:k?"bottom":"top",endEdge:k?"top":"bottom",size:"height",direction:k?1:-1,children:n.jsx(Og,{"data-orientation":"vertical",...g,ref:y,style:{...g.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const j=C(b.clientY);d==null||d(j)},onSlideMove:b=>{const j=C(b.clientY);f==null||f(j)},onSlideEnd:()=>{E.current=void 0,m==null||m()},onStepKeyDown:b=>{const N=Ig[k?"from-bottom":"from-top"].includes(b.key);p==null||p({event:b,direction:N?-1:1})}})})}),Og=x.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:f,onEndKeyDown:m,onStepKeyDown:p,...g}=r,v=zo(Bs,l);return n.jsx(Le.span,{...g,ref:a,onKeyDown:Ae(r.onKeyDown,y=>{y.key==="Home"?(f(y),y.preventDefault()):y.key==="End"?(m(y),y.preventDefault()):_g.concat(Tg).includes(y.key)&&(p(y),y.preventDefault())}),onPointerDown:Ae(r.onPointerDown,y=>{const E=y.target;E.setPointerCapture(y.pointerId),y.preventDefault(),v.thumbs.has(E)?E.focus():i(y)}),onPointerMove:Ae(r.onPointerMove,y=>{y.target.hasPointerCapture(y.pointerId)&&c(y)}),onPointerUp:Ae(r.onPointerUp,y=>{const E=y.target;E.hasPointerCapture(y.pointerId)&&(E.releasePointerCapture(y.pointerId),d(y))})})}),Fg="SliderTrack",zg=x.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=zo(Fg,l);return n.jsx(Le.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...i,ref:a})});zg.displayName=Fg;var gu="SliderRange",$g=x.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=zo(gu,l),d=Dg(gu,l),f=x.useRef(null),m=Ve(a,f),p=c.values.length,g=c.values.map(E=>Vg(E,c.min,c.max)),v=p>1?Math.min(...g):0,y=100-Math.max(...g);return n.jsx(Le.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...i,ref:m,style:{...r.style,[d.startEdge]:v+"%",[d.endEdge]:y+"%"}})});$g.displayName=gu;var vu="SliderThumb",Bg=x.forwardRef((r,a)=>{const l=oC(r.__scopeSlider),[i,c]=x.useState(null),d=Ve(a,m=>c(m)),f=x.useMemo(()=>i?l().findIndex(m=>m.ref.current===i):-1,[l,i]);return n.jsx(fC,{...r,ref:d,index:f})}),fC=x.forwardRef((r,a)=>{const{__scopeSlider:l,index:i,name:c,...d}=r,f=zo(vu,l),m=Dg(vu,l),[p,g]=x.useState(null),v=Ve(a,P=>g(P)),y=p?f.form||!!p.closest("form"):!0,E=Ou(p),k=f.values[i],C=k===void 0?0:Vg(k,f.min,f.max),b=pC(i,f.values.length),j=E==null?void 0:E[m.size],N=j?gC(j,C,m.direction):0;return x.useEffect(()=>{if(p)return f.thumbs.add(p),()=>{f.thumbs.delete(p)}},[p,f.thumbs]),n.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[m.startEdge]:`calc(${C}% + ${N}px)`},children:[n.jsx(xu.ItemSlot,{scope:r.__scopeSlider,children:n.jsx(Le.span,{role:"slider","aria-label":r["aria-label"]||b,"aria-valuemin":f.min,"aria-valuenow":k,"aria-valuemax":f.max,"aria-orientation":f.orientation,"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,tabIndex:f.disabled?void 0:0,...d,ref:v,style:k===void 0?{display:"none"}:r.style,onFocus:Ae(r.onFocus,()=>{f.valueIndexToChangeRef.current=i})})}),y&&n.jsx(Ug,{name:c??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:k},i)]})});Bg.displayName=vu;var hC="RadioBubbleInput",Ug=x.forwardRef(({__scopeSlider:r,value:a,...l},i)=>{const c=x.useRef(null),d=Ve(c,i),f=Du(a);return x.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"value").set;if(f!==a&&v){const y=new Event("input",{bubbles:!0});v.call(m,a),m.dispatchEvent(y)}},[f,a]),n.jsx(Le.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});Ug.displayName=hC;function mC(r=[],a,l){const i=[...r];return i[l]=a,i.sort((c,d)=>c-d)}function Vg(r,a,l){const d=100/(l-a)*(r-a);return ho(d,[0,100])}function pC(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function xC(r,a){if(r.length===1)return 0;const l=r.map(c=>Math.abs(c-a)),i=Math.min(...l);return l.indexOf(i)}function gC(r,a,l){const i=r/2,d=Xu([0,50],[0,i]);return(i-d(a)*l)*l}function vC(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function yC(r,a){if(a>0){const l=vC(r);return Math.min(...l)>=a}return!0}function Xu(r,a){return l=>{if(r[0]===r[1]||a[0]===a[1])return a[0];const i=(a[1]-a[0])/(r[1]-r[0]);return a[0]+i*(l-r[0])}}function wC(r){return(String(r).split(".")[1]||"").length}function NC(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var jC=Mg,bC=zg,SC=$g,CC=Bg;function kC({className:r,defaultValue:a,value:l,min:i=0,max:c=100,...d}){const f=x.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[i,c],[l,a,i,c]);return n.jsxs(jC,{defaultValue:a,value:l,min:i,max:c,className:We("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...d,children:[n.jsx(bC,{className:"bg-muted relative grow overflow-hidden rounded-full h-1.5 w-full",children:n.jsx(SC,{className:"bg-primary absolute h-full"})}),Array.from({length:f.length},(m,p)=>n.jsx(CC,{className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},p))]})}const EC={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1};function PC(){const[r,a]=x.useState(EC),[l,i]=x.useState(!0),[c,d]=x.useState(!1);x.useEffect(()=>{Ye("/api/admin/referral-settings").then(p=>{const g=p==null?void 0:p.data;g&&typeof g=="object"&&a({distributorShare:g.distributorShare??90,minWithdrawAmount:g.minWithdrawAmount??10,bindingDays:g.bindingDays??30,userDiscount:g.userDiscount??5,enableAutoWithdraw:g.enableAutoWithdraw??!1})}).catch(console.error).finally(()=>i(!1))},[]);const f=async()=>{d(!0);try{const p={distributorShare:Number(r.distributorShare)||0,minWithdrawAmount:Number(r.minWithdrawAmount)||0,bindingDays:Number(r.bindingDays)||0,userDiscount:Number(r.userDiscount)||0,enableAutoWithdraw:!!r.enableAutoWithdraw},g=await kt("/api/admin/referral-settings",p);if(!g||g.success===!1){alert("保存失败: "+(g&&typeof g=="object"&&"error"in g?g.error:""));return}alert(`✅ 分销配置已保存成功! • 小程序与网站的推广规则会一起生效 • 绑定关系会使用新的天数配置 • 佣金比例会立即应用到新订单 -如有缓存,请刷新前台/小程序页面。`)}catch(x){console.error(x),alert("保存失败: "+(x instanceof Error?x.message:String(x)))}finally{d(!1)}},m=x=>g=>{const v=parseFloat(g.target.value||"0");a(y=>({...y,[x]:isNaN(v)?0:v}))};return l?n.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):n.jsxs("div",{className:"p-8 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[n.jsx(Is,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),n.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),n.jsxs(pe,{onClick:f,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"flex items-center gap-2 text-white",children:[n.jsx(l1,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),n.jsx(mt,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),n.jsx(_e,{className:"space-y-6",children:n.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(am,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),n.jsx(ue,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.userDiscount,onChange:m("userDiscount")}),n.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(kn,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx(jC,{className:"flex-1",min:10,max:100,step:1,value:[r.distributorShare],onValueChange:([x])=>a(g=>({...g,distributorShare:x}))}),n.jsx(ue,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:r.distributorShare,onChange:m("distributorShare")})]}),n.jsxs("p",{className:"text-xs text-gray-500",children:["实际佣金 = 订单金额 ×"," ",n.jsxs("span",{className:"text-[#38bdac] font-mono",children:[r.distributorShare,"%"]}),",支付回调和分销统计都会用这个值。"]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(kn,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),n.jsx(ue,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:r.bindingDays,onChange:m("bindingDays")}),n.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"flex items-center gap-2 text-white",children:[n.jsx(Is,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),n.jsx(mt,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),n.jsx(_e,{className:"space-y-6",children:n.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"最低提现金额(元)"}),n.jsx(ue,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:r.minWithdrawAmount,onChange:m("minWithdrawAmount")}),n.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",n.jsx(Oe,{variant:"outline",className:"border-[#38bdac]/40 text-[#38bdac] text-[10px]",children:"预留"})]}),n.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[n.jsx(ht,{checked:r.enableAutoWithdraw,onCheckedChange:x=>a(g=>({...g,enableAutoWithdraw:x}))}),n.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Ue,{children:n.jsxs(Ke,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[n.jsx(am,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),n.jsxs(_e,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[n.jsxs("p",{children:["1. 以上配置会写入"," ",n.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),",小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),n.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),n.jsx("p",{children:"3. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}const CC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},kC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...CC}},EC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0};function PC(){const[r,a]=p.useState(kC),[l,i]=p.useState(["preface","epilogue","1.1","appendix-1","appendix-2","appendix-3"]),[c,d]=p.useState(""),[f,m]=p.useState(EC),[x,g]=p.useState(!1),[v,y]=p.useState(!0),[E,k]=p.useState(!1),[C,b]=p.useState(""),[j,N]=p.useState(""),[P,S]=p.useState(!1),[A,U]=p.useState(!1),Q=(K,R,H=!1)=>{b(K),N(R),S(H),k(!0)};p.useEffect(()=>{(async()=>{try{const R=await Ye("/api/admin/settings");if(!R||R.success===!1)return;if(Array.isArray(R.freeChapters)&&R.freeChapters.length&&i(R.freeChapters),R.featureConfig&&Object.keys(R.featureConfig).length&&m(H=>({...H,...R.featureConfig})),R.siteSettings&&typeof R.siteSettings=="object"){const H=R.siteSettings;a(X=>({...X,...typeof H.sectionPrice=="number"&&{sectionPrice:H.sectionPrice},...typeof H.baseBookPrice=="number"&&{baseBookPrice:H.baseBookPrice},...typeof H.distributorShare=="number"&&{distributorShare:H.distributorShare},...H.authorInfo&&typeof H.authorInfo=="object"&&{authorInfo:{...X.authorInfo,...H.authorInfo}}}))}}catch(R){console.error("Load settings error:",R)}finally{y(!1)}})()},[]);const Y=async(K,R)=>{U(!0);try{const H=await kt("/api/admin/settings",{featureConfig:K});if(!H||H.success===!1){R(),Q("保存失败",(H==null?void 0:H.error)??"未知错误",!0);return}Q("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(H){console.error("Save feature config error:",H),R(),Q("保存失败",H instanceof Error?H.message:String(H),!0)}finally{U(!1)}},W=(K,R)=>{const H=f,X={...H,[K]:R};m(X),Y(X,()=>m(H))},le=async()=>{g(!0);try{const K=await kt("/api/admin/settings",{freeChapters:l,featureConfig:f,siteSettings:{sectionPrice:r.sectionPrice,baseBookPrice:r.baseBookPrice,distributorShare:r.distributorShare,authorInfo:r.authorInfo}});if(!K||K.success===!1){Q("保存失败",(K==null?void 0:K.error)??"未知错误",!0);return}Q("已保存","设置已保存成功。")}catch(K){console.error("Save settings error:",K),Q("保存失败",K instanceof Error?K.message:String(K),!0)}finally{g(!1)}},de=()=>{c&&!l.includes(c)&&(i([...l,c]),d(""))},oe=K=>{i(l.filter(R=>R!==K))};return v?n.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):n.jsxs("div",{className:"p-8 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),n.jsxs(pe,{onClick:le,disabled:x,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),x?"保存中...":"保存设置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(nm,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),n.jsx(mt,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(nm,{className:"w-3 h-3"}),"主理人名称"]}),n.jsx(ue,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.name??"",onChange:K=>a(R=>({...R,authorInfo:{...R.authorInfo,name:K.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(qc,{className:"w-3 h-3"}),"开播日期"]}),n.jsx(ue,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:r.authorInfo.startDate??"",onChange:K=>a(R=>({...R,authorInfo:{...R.authorInfo,startDate:K.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(qc,{className:"w-3 h-3"}),"直播时间"]}),n.jsx(ue,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:r.authorInfo.liveTime??"",onChange:K=>a(R=>({...R,authorInfo:{...R.authorInfo,liveTime:K.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(qw,{className:"w-3 h-3"}),"直播平台"]}),n.jsx(ue,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:r.authorInfo.platform??"",onChange:K=>a(R=>({...R,authorInfo:{...R.authorInfo,platform:K.target.value}}))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(_s,{className:"w-3 h-3"}),"简介描述"]}),n.jsx(ue,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.description??"",onChange:K=>a(R=>({...R,authorInfo:{...R.authorInfo,description:K.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),n.jsx($r,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:r.authorInfo.bio??"",onChange:K=>a(R=>({...R,authorInfo:{...R.authorInfo,bio:K.target.value}}))})]}),n.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[n.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-[#00CED1] to-[#20B2AA] flex items-center justify-center text-xl font-bold text-white",children:(r.authorInfo.name??"K").charAt(0)}),n.jsxs("div",{children:[n.jsx("p",{className:"text-white font-semibold",children:r.authorInfo.name}),n.jsx("p",{className:"text-gray-400 text-xs",children:r.authorInfo.description}),n.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",r.authorInfo.liveTime," · ",r.authorInfo.platform]})]})]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(lo,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),n.jsx(mt,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),n.jsx(_e,{className:"space-y-4",children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"单节价格 (元)"}),n.jsx(ue,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.sectionPrice,onChange:K=>a(R=>({...R,sectionPrice:Number.parseFloat(K.target.value)||1}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"整本价格 (元)"}),n.jsx(ue,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.baseBookPrice,onChange:K=>a(R=>({...R,baseBookPrice:Number.parseFloat(K.target.value)||9.9}))})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(rm,{className:"w-5 h-5 text-[#38bdac]"}),"免费章节"]}),n.jsx(mt,{className:"text-gray-400",children:"设置哪些章节对所有用户免费开放"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-wrap gap-2",children:l.map(K=>n.jsxs("span",{className:"inline-flex items-center gap-1 bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30 px-3 py-1 rounded-md text-sm",children:[K,n.jsx("button",{type:"button",onClick:()=>oe(K),className:"ml-1 hover:text-red-400",children:n.jsx(Ur,{className:"w-3 h-3"})})]},K))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",placeholder:"输入章节ID,如 1.2、2.1、preface",value:c,onChange:K=>d(K.target.value),onKeyDown:K=>K.key==="Enter"&&de()}),n.jsxs(pe,{onClick:de,className:"bg-[#38bdac] hover:bg-[#2da396]",children:[n.jsx(Es,{className:"w-4 h-4 mr-1"}),"添加"]})]}),n.jsx("p",{className:"text-xs text-gray-500",children:"常用ID: preface(序言), epilogue(尾声), appendix-1/2/3(附录), 1.1/1.2等(章节)"})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(io,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),n.jsx(mt,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(kn,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(ae,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),n.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),n.jsx(ht,{id:"match-enabled",checked:f.matchEnabled,disabled:A,onCheckedChange:K=>W("matchEnabled",K)})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(rm,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(ae,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),n.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),n.jsx(ht,{id:"referral-enabled",checked:f.referralEnabled,disabled:A,onCheckedChange:K=>W("referralEnabled",K)})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(_s,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(ae,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),n.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),n.jsx(ht,{id:"search-enabled",checked:f.searchEnabled,disabled:A,onCheckedChange:K=>W("searchEnabled",K)})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(io,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(ae,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),n.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),n.jsx(ht,{id:"about-enabled",checked:f.aboutEnabled,disabled:A,onCheckedChange:K=>W("aboutEnabled",K)})]})]}),n.jsx("div",{className:"p-3 rounded-lg bg-blue-500/10 border border-blue-500/30",children:n.jsx("p",{className:"text-xs text-blue-300",children:"💡 关闭功能后,相关入口会自动隐藏。建议在功能开发完成后再开启。"})})]})]})]}),n.jsx(Nn,{open:E,onOpenChange:k,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[n.jsxs(jn,{children:[n.jsx(bn,{className:P?"text-red-400":"text-[#38bdac]",children:C}),n.jsx(Sb,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:j})]}),n.jsx(zn,{className:"mt-4",children:n.jsx(pe,{onClick:()=>k(!1),className:P?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const Um={wechat:{enabled:!0,qrCode:"/images/wechat-pay.png",account:"卡若",websiteAppId:"",merchantId:"",groupQrCode:"/images/party-group-qr.png"},alipay:{enabled:!0,qrCode:"/images/alipay.png",account:"卡若",partnerId:"",securityKey:""},usdt:{enabled:!1,network:"TRC20",address:"",exchangeRate:7.2},paypal:{enabled:!1,email:"",exchangeRate:7.2}};function RC(){const[r,a]=p.useState(!1),[l,i]=p.useState(Um),[c,d]=p.useState(""),f=async()=>{a(!0);try{const N=await Ye("/api/config");N!=null&&N.paymentMethods&&i({...Um,...N.paymentMethods})}catch(N){console.error(N)}finally{a(!1)}};p.useEffect(()=>{f()},[]);const m=async()=>{a(!0);try{await kt("/api/config",{paymentMethods:l}),alert("配置已保存!")}catch(N){console.error("保存失败:",N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{a(!1)}},x=(N,P)=>{navigator.clipboard.writeText(N),d(P),setTimeout(()=>d(""),2e3)},g=(N,P)=>{i(S=>({...S,wechat:{...S.wechat,[N]:P}}))},v=(N,P)=>{i(S=>({...S,alipay:{...S.alipay,[N]:P}}))},y=(N,P)=>{i(S=>({...S,usdt:{...S.usdt,[N]:P}}))},E=(N,P)=>{i(S=>({...S,paypal:{...S.paypal,[N]:P}}))},k=l.wechat,C=l.alipay,b=l.usdt,j=l.paypal;return n.jsxs("div",{className:"p-8 max-w-5xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),n.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs(pe,{variant:"outline",onClick:f,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${r?"animate-spin":""}`}),"同步配置"]}),n.jsxs(pe,{onClick:m,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),"保存配置"]})]})]}),n.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(ap,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"text-sm",children:[n.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"如何获取微信群跳转链接?"}),n.jsxs("ol",{className:"text-[#07C160]/80 space-y-1 list-decimal list-inside",children:[n.jsx("li",{children:"打开微信,进入目标微信群"}),n.jsx("li",{children:'点击右上角"..." → "群二维码"'}),n.jsx("li",{children:'点击右上角"..." → "发送到电脑"'}),n.jsx("li",{children:"在电脑上保存二维码图片,上传到图床获取URL"}),n.jsx("li",{children:"或使用草料二维码等工具解析二维码获取链接"})]}),n.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"提示:微信群二维码7天后失效,建议使用活码工具"})]})]})}),n.jsxs(zu,{defaultValue:"wechat",className:"space-y-6",children:[n.jsxs(To,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[n.jsxs(Xt,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[n.jsx(cm,{className:"w-4 h-4 mr-2"}),"微信"]}),n.jsxs(Xt,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[n.jsx(Zc,{className:"w-4 h-4 mr-2"}),"支付宝"]}),n.jsxs(Xt,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[n.jsx(tm,{className:"w-4 h-4 mr-2"}),"USDT"]}),n.jsxs(Xt,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[n.jsx(eu,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),n.jsx(qt,{value:"wechat",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ke,{className:"text-[#07C160] flex items-center gap-2",children:[n.jsx(cm,{className:"w-5 h-5"}),"微信支付配置"]}),n.jsx(mt,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),n.jsx(ht,{checked:!!k.enabled,onCheckedChange:N=>g("enabled",N)})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"网站AppID"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(k.websiteAppId??""),onChange:N=>g("websiteAppId",N.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"商户号"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(k.merchantId??""),onChange:N=>g("merchantId",N.target.value)})]})]}),n.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[n.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[n.jsx(oo,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"微信收款码/支付链接"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(k.qrCode??""),onChange:N=>g("qrCode",N.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),n.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[n.jsx(ae,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),n.jsx(ue,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(k.groupQrCode??""),onChange:N=>g("groupQrCode",N.target.value)}),n.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),n.jsx(qt,{value:"alipay",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ke,{className:"text-[#1677FF] flex items-center gap-2",children:[n.jsx(Zc,{className:"w-5 h-5"}),"支付宝配置"]}),n.jsx(mt,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),n.jsx(ht,{checked:!!C.enabled,onCheckedChange:N=>v("enabled",N)})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"合作者身份 (PID)"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(C.partnerId??""),onChange:N=>v("partnerId",N.target.value)}),n.jsx(pe,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>x(String(C.partnerId??""),"pid"),children:c==="pid"?n.jsx(No,{className:"w-4 h-4 text-green-500"}):n.jsx(op,{className:"w-4 h-4 text-gray-400"})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"安全校验码 (Key)"}),n.jsx(ue,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(C.securityKey??""),onChange:N=>v("securityKey",N.target.value)})]})]}),n.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[n.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[n.jsx(oo,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(C.qrCode??""),onChange:N=>v("qrCode",N.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),n.jsx(qt,{value:"usdt",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ke,{className:"text-[#26A17B] flex items-center gap-2",children:[n.jsx(tm,{className:"w-5 h-5"}),"USDT配置"]}),n.jsx(mt,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),n.jsx(ht,{checked:!!b.enabled,onCheckedChange:N=>y("enabled",N)})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"网络类型"}),n.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(b.network??"TRC20"),onChange:N=>y("network",N.target.value),children:[n.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),n.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),n.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"收款地址"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(b.address??""),onChange:N=>y("address",N.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),n.jsx(ue,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:N=>y("exchangeRate",Number.parseFloat(N.target.value)||7.2)})]})]})]})}),n.jsx(qt,{value:"paypal",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ke,{className:"text-[#169BD7] flex items-center gap-2",children:[n.jsx(eu,{className:"w-5 h-5"}),"PayPal配置"]}),n.jsx(mt,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),n.jsx(ht,{checked:!!j.enabled,onCheckedChange:N=>E("enabled",N)})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"PayPal邮箱"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(j.email??""),onChange:N=>E("email",N.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),n.jsx(ue,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(j.exchangeRate)??7.2,onChange:N=>E("exchangeRate",Number(N.target.value)||7.2)})]})]})]})})]})]})}const _C={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},TC={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},IC={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function AC(){const[r,a]=p.useState({siteConfig:{..._C},menuConfig:{...TC},pageConfig:{...IC}}),[l,i]=p.useState(!1);p.useEffect(()=>{Ye("/api/config").then(x=>{x!=null&&x.siteConfig&&a(g=>({...g,siteConfig:{...g.siteConfig,...x.siteConfig}})),x!=null&&x.menuConfig&&a(g=>({...g,menuConfig:{...g.menuConfig,...x.menuConfig}})),x!=null&&x.pageConfig&&a(g=>({...g,pageConfig:{...g.pageConfig,...x.pageConfig}}))}).catch(console.error)},[]);const c=()=>{i(!0),setTimeout(()=>i(!1),2e3),alert("配置已保存(当前为前端状态,后端可对接 /api/db/config 持久化)")},d=r.siteConfig,f=r.menuConfig,m=r.pageConfig;return n.jsxs("div",{className:"p-8 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"网站配置"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"配置网站名称、图标、菜单和页面标题"})]}),n.jsxs(pe,{onClick:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),l?"已保存":"保存设置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(eu,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),n.jsx(mt,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),n.jsx(ue,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:d.siteName??"",onChange:x=>a(g=>({...g,siteConfig:{...g.siteConfig,siteName:x.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),n.jsx(ue,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:d.siteTitle??"",onChange:x=>a(g=>({...g,siteConfig:{...g.siteConfig,siteTitle:x.target.value}}))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),n.jsx(ue,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:d.siteDescription??"",onChange:x=>a(g=>({...g,siteConfig:{...g.siteConfig,siteDescription:x.target.value}}))})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),n.jsx(ue,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:d.logo??"",onChange:x=>a(g=>({...g,siteConfig:{...g.siteConfig,logo:x.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),n.jsx(ue,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:d.favicon??"",onChange:x=>a(g=>({...g,siteConfig:{...g.siteConfig,favicon:x.target.value}}))})]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(r1,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),n.jsx(mt,{className:"text-gray-400",children:"配置网站主题色"})]}),n.jsx(_e,{children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"space-y-2 flex-1",children:[n.jsx(ae,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ue,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:d.primaryColor??"#00CED1",onChange:x=>a(g=>({...g,siteConfig:{...g.siteConfig,primaryColor:x.target.value}}))}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:d.primaryColor??"#00CED1",onChange:x=>a(g=>({...g,siteConfig:{...g.siteConfig,primaryColor:x.target.value}}))})]})]}),n.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:d.primaryColor??"#00CED1"},children:"预览"})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(Zw,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),n.jsx(mt,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),n.jsx(_e,{className:"space-y-4",children:Object.entries(f).map(([x,g])=>n.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[n.jsx(ht,{checked:(g==null?void 0:g.enabled)??!0,onCheckedChange:v=>a(y=>({...y,menuConfig:{...y.menuConfig,[x]:{...g,enabled:v}}}))}),n.jsx("span",{className:"text-gray-300 w-16 capitalize",children:x}),n.jsx(ue,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(g==null?void 0:g.label)??"",onChange:v=>a(y=>({...y,menuConfig:{...y.menuConfig,[x]:{...g,label:v.target.value}}}))})]}),n.jsx("span",{className:`text-sm ${g!=null&&g.enabled?"text-green-400":"text-gray-500"}`,children:g!=null&&g.enabled?"显示":"隐藏"})]},x))})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(cp,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),n.jsx(mt,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"首页标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.homeTitle??"",onChange:x=>a(g=>({...g,pageConfig:{...g.pageConfig,homeTitle:x.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"首页副标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.homeSubtitle??"",onChange:x=>a(g=>({...g,pageConfig:{...g.pageConfig,homeSubtitle:x.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"目录页标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.chaptersTitle??"",onChange:x=>a(g=>({...g,pageConfig:{...g.pageConfig,chaptersTitle:x.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"匹配页标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.matchTitle??"",onChange:x=>a(g=>({...g,pageConfig:{...g.pageConfig,matchTitle:x.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"我的页标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.myTitle??"",onChange:x=>a(g=>({...g,pageConfig:{...g.pageConfig,myTitle:x.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"关于作者标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.aboutTitle??"",onChange:x=>a(g=>({...g,pageConfig:{...g.pageConfig,aboutTitle:x.target.value}}))})]})]})]})]})]})]})}function MC(){const[r,a]=p.useState(""),[l,i]=p.useState(""),[c,d]=p.useState(""),[f,m]=p.useState({}),x=async()=>{var k,C,b,j;try{const N=await Ye("/api/config"),P=(C=(k=N==null?void 0:N.liveQRCodes)==null?void 0:k[0])==null?void 0:C.urls;Array.isArray(P)&&a(P.join(` -`));const S=(j=(b=N==null?void 0:N.paymentMethods)==null?void 0:b.wechat)==null?void 0:j.groupQrCode;S&&i(S),m({paymentMethods:N==null?void 0:N.paymentMethods,liveQRCodes:N==null?void 0:N.liveQRCodes})}catch(N){console.error(N)}};p.useEffect(()=>{x()},[]);const g=(k,C)=>{navigator.clipboard.writeText(k),d(C),setTimeout(()=>d(""),2e3)},v=async()=>{try{const k=r.split(` -`).map(b=>b.trim()).filter(Boolean),C=[...f.liveQRCodes||[]];C[0]?C[0].urls=k:C.push({id:"live-1",name:"微信群活码",urls:k,clickCount:0}),await kt("/api/config",{liveQRCodes:C}),alert("群活码配置已保存!"),await x()}catch(k){console.error(k),alert("保存失败: "+(k instanceof Error?k.message:String(k)))}},y=async()=>{var k;try{await kt("/api/config",{paymentMethods:{...f.paymentMethods||{},wechat:{...((k=f.paymentMethods)==null?void 0:k.wechat)||{},groupQrCode:l}}}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await x()}catch(C){console.error(C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}},E=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return n.jsxs("div",{className:"p-8 max-w-5xl mx-auto",children:[n.jsxs("div",{className:"mb-8",children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),n.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(ap,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"text-sm",children:[n.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),n.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[n.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),n.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[n.jsx("li",{children:"访问草料二维码创建活码"}),n.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),n.jsx("li",{children:"复制生成的短链接填入下方配置"}),n.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),n.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),n.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[n.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),n.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),n.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意:微信原生群二维码7天后失效,建议使用草料活码"})]})]})]})}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-[#07C160] flex items-center gap-2",children:[n.jsx(im,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),n.jsx(mt,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(om,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ue,{placeholder:"https://cli.im/xxxxx 或 https://weixin.qq.com/g/...",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",value:l,onChange:k=>i(k.target.value)}),n.jsx(pe,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>g(l,"group"),children:c==="group"?n.jsx(No,{className:"w-4 h-4 text-green-500"}):n.jsx(op,{className:"w-4 h-4 text-gray-400"})})]}),n.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[n.jsx(oo,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs(pe,{onClick:y,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[n.jsx(Cs,{className:"w-4 h-4 mr-2"}),"保存配置"]}),n.jsxs(pe,{onClick:E,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[n.jsx(oo,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(im,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),n.jsx(mt,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(om,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),n.jsx($r,{placeholder:"https://cli.im/group1\\nhttps://cli.im/group2",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 min-h-[120px] font-mono text-sm",value:r,onChange:k=>a(k.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"每行填写一个群链接,系统将按顺序或随机分配"})]}),n.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[n.jsx("span",{className:"text-sm text-gray-400",children:"已配置群数量"}),n.jsxs("span",{className:"font-bold text-[#38bdac]",children:[r.split(` -`).filter(Boolean).length," 个"]})]}),n.jsxs(pe,{onClick:v,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Cs,{className:"w-4 h-4 mr-2"}),"保存多群配置"]})]})]})]}),n.jsxs("div",{className:"mt-6 bg-[#0f2137] rounded-xl p-4 border border-gray-700/50",children:[n.jsx("h4",{className:"text-white font-medium mb-3",children:"常见问题"}),n.jsxs("div",{className:"space-y-3 text-sm",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[#38bdac]",children:"Q: 为什么推荐使用草料活码?"}),n.jsx("p",{className:"text-gray-400",children:"A: 草料活码是永久链接,群满后可直接在后台更换新群码,无需修改网站配置。微信原生群码7天失效。"})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[#38bdac]",children:"Q: 支付后没有跳转怎么办?"}),n.jsx("p",{className:"text-gray-400",children:"A: 1) 检查链接是否正确填写 2) 部分浏览器可能拦截弹窗,用户需手动允许 3) 建议使用https开头的链接"})]})]})]})]})}const Vm={matchTypes:[{id:"partner",label:"创业合伙",matchLabel:"创业伙伴",icon:"⭐",matchFromDB:!0,showJoinAfterMatch:!1,price:1,enabled:!0},{id:"investor",label:"资源对接",matchLabel:"资源对接",icon:"👥",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"mentor",label:"导师顾问",matchLabel:"商业顾问",icon:"❤️",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"team",label:"团队招募",matchLabel:"加入项目",icon:"🎮",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}],freeMatchLimit:3,matchPrice:1,settings:{enableFreeMatches:!0,enablePaidMatches:!0,maxMatchesPerDay:10}},LC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function DC(){const[r,a]=p.useState(Vm),[l,i]=p.useState(!0),[c,d]=p.useState(!1),[f,m]=p.useState(!1),[x,g]=p.useState(null),[v,y]=p.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),E=async()=>{i(!0);try{const S=await Ye("/api/db/config/full?key=match_config"),A=(S==null?void 0:S.data)??(S==null?void 0:S.config);A&&a({...Vm,...A})}catch(S){console.error("加载匹配配置失败:",S)}finally{i(!1)}};p.useEffect(()=>{E()},[]);const k=async()=>{d(!0);try{const S=await kt("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});S&&S.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(S&&typeof S=="object"&&"error"in S?S.error:"未知错误"))}catch(S){console.error("保存配置失败:",S),alert("保存失败")}finally{d(!1)}},C=S=>{g(S),y({id:S.id,label:S.label,matchLabel:S.matchLabel,icon:S.icon,matchFromDB:S.matchFromDB,showJoinAfterMatch:S.showJoinAfterMatch,price:S.price,enabled:S.enabled}),m(!0)},b=()=>{g(null),y({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),m(!0)},j=()=>{if(!v.id||!v.label){alert("请填写类型ID和名称");return}const S=[...r.matchTypes];if(x){const A=S.findIndex(U=>U.id===x.id);A!==-1&&(S[A]={...v})}else{if(S.some(A=>A.id===v.id)){alert("类型ID已存在");return}S.push({...v})}a({...r,matchTypes:S}),m(!1)},N=S=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(A=>A.id!==S)})},P=S=>{a({...r,matchTypes:r.matchTypes.map(A=>A.id===S?{...A,enabled:!A.enabled}:A)})};return n.jsxs("div",{className:"p-8 max-w-6xl mx-auto space-y-6",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[n.jsx(io,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),n.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs(pe,{variant:"outline",onClick:E,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),n.jsxs(pe,{onClick:k,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(I1,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),n.jsx(mt,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),n.jsxs(_e,{className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"每日免费匹配次数"}),n.jsx(ue,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:S=>a({...r,freeMatchLimit:parseInt(S.target.value,10)||0})}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"付费匹配价格(元)"}),n.jsx(ue,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:S=>a({...r,matchPrice:parseFloat(S.target.value)||1})}),n.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"每日最大匹配次数"}),n.jsx(ue,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:S=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(S.target.value,10)||10}})}),n.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),n.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ht,{checked:r.settings.enableFreeMatches,onCheckedChange:S=>a({...r,settings:{...r.settings,enableFreeMatches:S}})}),n.jsx(ae,{className:"text-gray-300",children:"启用免费匹配"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ht,{checked:r.settings.enablePaidMatches,onCheckedChange:S=>a({...r,settings:{...r.settings,enablePaidMatches:S}})}),n.jsx(ae,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[n.jsxs("div",{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(kn,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),n.jsx(mt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),n.jsxs(pe,{onClick:b,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Es,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),n.jsx(_e,{children:n.jsxs(bo,{children:[n.jsx(So,{children:n.jsxs($n,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(et,{className:"text-gray-400",children:"图标"}),n.jsx(et,{className:"text-gray-400",children:"类型ID"}),n.jsx(et,{className:"text-gray-400",children:"显示名称"}),n.jsx(et,{className:"text-gray-400",children:"匹配标签"}),n.jsx(et,{className:"text-gray-400",children:"价格"}),n.jsx(et,{className:"text-gray-400",children:"数据库匹配"}),n.jsx(et,{className:"text-gray-400",children:"状态"}),n.jsx(et,{className:"text-right text-gray-400",children:"操作"})]})}),n.jsx(Co,{children:r.matchTypes.map(S=>n.jsxs($n,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsx(Qe,{children:n.jsx("span",{className:"text-2xl",children:S.icon})}),n.jsx(Qe,{className:"font-mono text-gray-300",children:S.id}),n.jsx(Qe,{className:"text-white font-medium",children:S.label}),n.jsx(Qe,{className:"text-gray-300",children:S.matchLabel}),n.jsx(Qe,{children:n.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",S.price]})}),n.jsx(Qe,{children:S.matchFromDB?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):n.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),n.jsx(Qe,{children:n.jsx(ht,{checked:S.enabled,onCheckedChange:()=>P(S.id)})}),n.jsx(Qe,{className:"text-right",children:n.jsxs("div",{className:"flex items-center justify-end gap-1",children:[n.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>C(S),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:n.jsx(Ts,{className:"w-4 h-4"})}),n.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>N(S.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:n.jsx(up,{className:"w-4 h-4"})})]})})]},S.id))})]})})]}),n.jsx(Nn,{open:f,onOpenChange:m,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[x?n.jsx(Ts,{className:"w-5 h-5 text-[#38bdac]"}):n.jsx(Es,{className:"w-5 h-5 text-[#38bdac]"}),x?"编辑匹配类型":"添加匹配类型"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"类型ID(英文)"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:v.id,onChange:S=>y({...v,id:S.target.value}),disabled:!!x})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"图标"}),n.jsx("div",{className:"flex gap-1 flex-wrap",children:LC.map(S=>n.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${v.icon===S?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>y({...v,icon:S}),children:S},S))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"显示名称"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:v.label,onChange:S=>y({...v,label:S.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"匹配标签"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:v.matchLabel,onChange:S=>y({...v,matchLabel:S.target.value})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"单次匹配价格(元)"}),n.jsx(ue,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:v.price,onChange:S=>y({...v,price:parseFloat(S.target.value)||1})})]}),n.jsxs("div",{className:"flex gap-6 pt-2",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ht,{checked:v.matchFromDB,onCheckedChange:S=>y({...v,matchFromDB:S})}),n.jsx(ae,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ht,{checked:v.showJoinAfterMatch,onCheckedChange:S=>y({...v,showJoinAfterMatch:S})}),n.jsx(ae,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ht,{checked:v.enabled,onCheckedChange:S=>y({...v,enabled:S})}),n.jsx(ae,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),n.jsxs(zn,{children:[n.jsx(pe,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsxs(pe,{onClick:j,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}function OC(){const r=Qr();return n.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:n.jsxs("div",{className:"text-center max-w-md",children:[n.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-red-500/20 text-red-400 mb-6",children:n.jsx(pw,{className:"w-10 h-10"})}),n.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),n.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),n.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:r.pathname}),n.jsx(pe,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:n.jsxs(tp,{to:"/",children:[n.jsx(Ow,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function FC(){return n.jsxs(Wy,{children:[n.jsx(vt,{path:"/login",element:n.jsx(MN,{})}),n.jsxs(vt,{path:"/",element:n.jsx(O1,{}),children:[n.jsx(vt,{index:!0,element:n.jsx(By,{to:"/dashboard",replace:!0})}),n.jsx(vt,{path:"dashboard",element:n.jsx(DN,{})}),n.jsx(vt,{path:"orders",element:n.jsx(FN,{})}),n.jsx(vt,{path:"users",element:n.jsx(Gb,{})}),n.jsx(vt,{path:"distribution",element:n.jsx(Qb,{})}),n.jsx(vt,{path:"withdrawals",element:n.jsx(Yb,{})}),n.jsx(vt,{path:"content",element:n.jsx(tC,{})}),n.jsx(vt,{path:"chapters",element:n.jsx(nC,{})}),n.jsx(vt,{path:"referral-settings",element:n.jsx(SC,{})}),n.jsx(vt,{path:"settings",element:n.jsx(PC,{})}),n.jsx(vt,{path:"payment",element:n.jsx(RC,{})}),n.jsx(vt,{path:"site",element:n.jsx(AC,{})}),n.jsx(vt,{path:"qrcodes",element:n.jsx(MC,{})}),n.jsx(vt,{path:"match",element:n.jsx(DC,{})})]}),n.jsx(vt,{path:"*",element:n.jsx(OC,{})})]})}Gv.createRoot(document.getElementById("root")).render(n.jsx(p.StrictMode,{children:n.jsx(qy,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:n.jsx(FC,{})})})); +如有缓存,请刷新前台/小程序页面。`)}catch(p){console.error(p),alert("保存失败: "+(p instanceof Error?p.message:String(p)))}finally{d(!1)}},m=p=>g=>{const v=parseFloat(g.target.value||"0");a(y=>({...y,[p]:isNaN(v)?0:v}))};return l?n.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):n.jsxs("div",{className:"p-8 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[n.jsx(Is,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),n.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),n.jsxs(pe,{onClick:f,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"flex items-center gap-2 text-white",children:[n.jsx(o1,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),n.jsx(mt,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),n.jsx(_e,{className:"space-y-6",children:n.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(lm,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),n.jsx(ue,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.userDiscount,onChange:m("userDiscount")}),n.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(kn,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx(kC,{className:"flex-1",min:10,max:100,step:1,value:[r.distributorShare],onValueChange:([p])=>a(g=>({...g,distributorShare:p}))}),n.jsx(ue,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:r.distributorShare,onChange:m("distributorShare")})]}),n.jsxs("p",{className:"text-xs text-gray-500",children:["实际佣金 = 订单金额 ×"," ",n.jsxs("span",{className:"text-[#38bdac] font-mono",children:[r.distributorShare,"%"]}),",支付回调和分销统计都会用这个值。"]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(kn,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),n.jsx(ue,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:r.bindingDays,onChange:m("bindingDays")}),n.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"flex items-center gap-2 text-white",children:[n.jsx(Is,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),n.jsx(mt,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),n.jsx(_e,{className:"space-y-6",children:n.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"最低提现金额(元)"}),n.jsx(ue,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:r.minWithdrawAmount,onChange:m("minWithdrawAmount")}),n.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",n.jsx(Oe,{variant:"outline",className:"border-[#38bdac]/40 text-[#38bdac] text-[10px]",children:"预留"})]}),n.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[n.jsx(ht,{checked:r.enableAutoWithdraw,onCheckedChange:p=>a(g=>({...g,enableAutoWithdraw:p}))}),n.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Ue,{children:n.jsxs(Ke,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[n.jsx(lm,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),n.jsxs(_e,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[n.jsxs("p",{children:["1. 以上配置会写入"," ",n.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),",小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),n.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),n.jsx("p",{children:"3. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}const RC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},_C={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...RC}},TC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0};function IC(){const[r,a]=x.useState(_C),[l,i]=x.useState(["preface","epilogue","1.1","appendix-1","appendix-2","appendix-3"]),[c,d]=x.useState(""),[f,m]=x.useState(TC),[p,g]=x.useState(!1),[v,y]=x.useState(!0),[E,k]=x.useState(!1),[C,b]=x.useState(""),[j,N]=x.useState(""),[P,S]=x.useState(!1),[A,U]=x.useState(!1),Q=(K,R,H=!1)=>{b(K),N(R),S(H),k(!0)};x.useEffect(()=>{(async()=>{try{const R=await Ye("/api/admin/settings");if(!R||R.success===!1)return;if(Array.isArray(R.freeChapters)&&R.freeChapters.length&&i(R.freeChapters),R.featureConfig&&Object.keys(R.featureConfig).length&&m(H=>({...H,...R.featureConfig})),R.siteSettings&&typeof R.siteSettings=="object"){const H=R.siteSettings;a(X=>({...X,...typeof H.sectionPrice=="number"&&{sectionPrice:H.sectionPrice},...typeof H.baseBookPrice=="number"&&{baseBookPrice:H.baseBookPrice},...typeof H.distributorShare=="number"&&{distributorShare:H.distributorShare},...H.authorInfo&&typeof H.authorInfo=="object"&&{authorInfo:{...X.authorInfo,...H.authorInfo}}}))}}catch(R){console.error("Load settings error:",R)}finally{y(!1)}})()},[]);const Y=async(K,R)=>{U(!0);try{const H=await kt("/api/admin/settings",{featureConfig:K});if(!H||H.success===!1){R(),Q("保存失败",(H==null?void 0:H.error)??"未知错误",!0);return}Q("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(H){console.error("Save feature config error:",H),R(),Q("保存失败",H instanceof Error?H.message:String(H),!0)}finally{U(!1)}},W=(K,R)=>{const H=f,X={...H,[K]:R};m(X),Y(X,()=>m(H))},le=async()=>{g(!0);try{const K=await kt("/api/admin/settings",{freeChapters:l,featureConfig:f,siteSettings:{sectionPrice:r.sectionPrice,baseBookPrice:r.baseBookPrice,distributorShare:r.distributorShare,authorInfo:r.authorInfo}});if(!K||K.success===!1){Q("保存失败",(K==null?void 0:K.error)??"未知错误",!0);return}Q("已保存","设置已保存成功。")}catch(K){console.error("Save settings error:",K),Q("保存失败",K instanceof Error?K.message:String(K),!0)}finally{g(!1)}},de=()=>{c&&!l.includes(c)&&(i([...l,c]),d(""))},oe=K=>{i(l.filter(R=>R!==K))};return v?n.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):n.jsxs("div",{className:"p-8 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),n.jsxs(pe,{onClick:le,disabled:p,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),p?"保存中...":"保存设置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(rm,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),n.jsx(mt,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(rm,{className:"w-3 h-3"}),"主理人名称"]}),n.jsx(ue,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.name??"",onChange:K=>a(R=>({...R,authorInfo:{...R.authorInfo,name:K.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(qc,{className:"w-3 h-3"}),"开播日期"]}),n.jsx(ue,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:r.authorInfo.startDate??"",onChange:K=>a(R=>({...R,authorInfo:{...R.authorInfo,startDate:K.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(qc,{className:"w-3 h-3"}),"直播时间"]}),n.jsx(ue,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:r.authorInfo.liveTime??"",onChange:K=>a(R=>({...R,authorInfo:{...R.authorInfo,liveTime:K.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(Jw,{className:"w-3 h-3"}),"直播平台"]}),n.jsx(ue,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:r.authorInfo.platform??"",onChange:K=>a(R=>({...R,authorInfo:{...R.authorInfo,platform:K.target.value}}))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(_s,{className:"w-3 h-3"}),"简介描述"]}),n.jsx(ue,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.description??"",onChange:K=>a(R=>({...R,authorInfo:{...R.authorInfo,description:K.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),n.jsx($r,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:r.authorInfo.bio??"",onChange:K=>a(R=>({...R,authorInfo:{...R.authorInfo,bio:K.target.value}}))})]}),n.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[n.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-[#00CED1] to-[#20B2AA] flex items-center justify-center text-xl font-bold text-white",children:(r.authorInfo.name??"K").charAt(0)}),n.jsxs("div",{children:[n.jsx("p",{className:"text-white font-semibold",children:r.authorInfo.name}),n.jsx("p",{className:"text-gray-400 text-xs",children:r.authorInfo.description}),n.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",r.authorInfo.liveTime," · ",r.authorInfo.platform]})]})]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(lo,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),n.jsx(mt,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),n.jsx(_e,{className:"space-y-4",children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"单节价格 (元)"}),n.jsx(ue,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.sectionPrice,onChange:K=>a(R=>({...R,sectionPrice:Number.parseFloat(K.target.value)||1}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"整本价格 (元)"}),n.jsx(ue,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.baseBookPrice,onChange:K=>a(R=>({...R,baseBookPrice:Number.parseFloat(K.target.value)||9.9}))})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(sm,{className:"w-5 h-5 text-[#38bdac]"}),"免费章节"]}),n.jsx(mt,{className:"text-gray-400",children:"设置哪些章节对所有用户免费开放"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-wrap gap-2",children:l.map(K=>n.jsxs("span",{className:"inline-flex items-center gap-1 bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30 px-3 py-1 rounded-md text-sm",children:[K,n.jsx("button",{type:"button",onClick:()=>oe(K),className:"ml-1 hover:text-red-400",children:n.jsx(Ur,{className:"w-3 h-3"})})]},K))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",placeholder:"输入章节ID,如 1.2、2.1、preface",value:c,onChange:K=>d(K.target.value),onKeyDown:K=>K.key==="Enter"&&de()}),n.jsxs(pe,{onClick:de,className:"bg-[#38bdac] hover:bg-[#2da396]",children:[n.jsx(Es,{className:"w-4 h-4 mr-1"}),"添加"]})]}),n.jsx("p",{className:"text-xs text-gray-500",children:"常用ID: preface(序言), epilogue(尾声), appendix-1/2/3(附录), 1.1/1.2等(章节)"})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(io,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),n.jsx(mt,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(kn,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(ae,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),n.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),n.jsx(ht,{id:"match-enabled",checked:f.matchEnabled,disabled:A,onCheckedChange:K=>W("matchEnabled",K)})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(sm,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(ae,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),n.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),n.jsx(ht,{id:"referral-enabled",checked:f.referralEnabled,disabled:A,onCheckedChange:K=>W("referralEnabled",K)})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(_s,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(ae,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),n.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),n.jsx(ht,{id:"search-enabled",checked:f.searchEnabled,disabled:A,onCheckedChange:K=>W("searchEnabled",K)})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(io,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(ae,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),n.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),n.jsx(ht,{id:"about-enabled",checked:f.aboutEnabled,disabled:A,onCheckedChange:K=>W("aboutEnabled",K)})]})]}),n.jsx("div",{className:"p-3 rounded-lg bg-blue-500/10 border border-blue-500/30",children:n.jsx("p",{className:"text-xs text-blue-300",children:"💡 关闭功能后,相关入口会自动隐藏。建议在功能开发完成后再开启。"})})]})]})]}),n.jsx(Nn,{open:E,onOpenChange:k,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[n.jsxs(jn,{children:[n.jsx(bn,{className:P?"text-red-400":"text-[#38bdac]",children:C}),n.jsx(Pb,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:j})]}),n.jsx(zn,{className:"mt-4",children:n.jsx(pe,{onClick:()=>k(!1),className:P?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const Vm={wechat:{enabled:!0,qrCode:"/images/wechat-pay.png",account:"卡若",websiteAppId:"",merchantId:"",groupQrCode:"/images/party-group-qr.png"},alipay:{enabled:!0,qrCode:"/images/alipay.png",account:"卡若",partnerId:"",securityKey:""},usdt:{enabled:!1,network:"TRC20",address:"",exchangeRate:7.2},paypal:{enabled:!1,email:"",exchangeRate:7.2}};function AC(){const[r,a]=x.useState(!1),[l,i]=x.useState(Vm),[c,d]=x.useState(""),f=async()=>{a(!0);try{const N=await Ye("/api/config");N!=null&&N.paymentMethods&&i({...Vm,...N.paymentMethods})}catch(N){console.error(N)}finally{a(!1)}};x.useEffect(()=>{f()},[]);const m=async()=>{a(!0);try{await kt("/api/config",{paymentMethods:l}),alert("配置已保存!")}catch(N){console.error("保存失败:",N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{a(!1)}},p=(N,P)=>{navigator.clipboard.writeText(N),d(P),setTimeout(()=>d(""),2e3)},g=(N,P)=>{i(S=>({...S,wechat:{...S.wechat,[N]:P}}))},v=(N,P)=>{i(S=>({...S,alipay:{...S.alipay,[N]:P}}))},y=(N,P)=>{i(S=>({...S,usdt:{...S.usdt,[N]:P}}))},E=(N,P)=>{i(S=>({...S,paypal:{...S.paypal,[N]:P}}))},k=l.wechat,C=l.alipay,b=l.usdt,j=l.paypal;return n.jsxs("div",{className:"p-8 max-w-5xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),n.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs(pe,{variant:"outline",onClick:f,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${r?"animate-spin":""}`}),"同步配置"]}),n.jsxs(pe,{onClick:m,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),"保存配置"]})]})]}),n.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(lp,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"text-sm",children:[n.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"如何获取微信群跳转链接?"}),n.jsxs("ol",{className:"text-[#07C160]/80 space-y-1 list-decimal list-inside",children:[n.jsx("li",{children:"打开微信,进入目标微信群"}),n.jsx("li",{children:'点击右上角"..." → "群二维码"'}),n.jsx("li",{children:'点击右上角"..." → "发送到电脑"'}),n.jsx("li",{children:"在电脑上保存二维码图片,上传到图床获取URL"}),n.jsx("li",{children:"或使用草料二维码等工具解析二维码获取链接"})]}),n.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"提示:微信群二维码7天后失效,建议使用活码工具"})]})]})}),n.jsxs($u,{defaultValue:"wechat",className:"space-y-6",children:[n.jsxs(To,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[n.jsxs(Xt,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[n.jsx(um,{className:"w-4 h-4 mr-2"}),"微信"]}),n.jsxs(Xt,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[n.jsx(Zc,{className:"w-4 h-4 mr-2"}),"支付宝"]}),n.jsxs(Xt,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[n.jsx(nm,{className:"w-4 h-4 mr-2"}),"USDT"]}),n.jsxs(Xt,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[n.jsx(eu,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),n.jsx(qt,{value:"wechat",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ke,{className:"text-[#07C160] flex items-center gap-2",children:[n.jsx(um,{className:"w-5 h-5"}),"微信支付配置"]}),n.jsx(mt,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),n.jsx(ht,{checked:!!k.enabled,onCheckedChange:N=>g("enabled",N)})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"网站AppID"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(k.websiteAppId??""),onChange:N=>g("websiteAppId",N.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"商户号"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(k.merchantId??""),onChange:N=>g("merchantId",N.target.value)})]})]}),n.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[n.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[n.jsx(oo,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"微信收款码/支付链接"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(k.qrCode??""),onChange:N=>g("qrCode",N.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),n.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[n.jsx(ae,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),n.jsx(ue,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(k.groupQrCode??""),onChange:N=>g("groupQrCode",N.target.value)}),n.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),n.jsx(qt,{value:"alipay",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ke,{className:"text-[#1677FF] flex items-center gap-2",children:[n.jsx(Zc,{className:"w-5 h-5"}),"支付宝配置"]}),n.jsx(mt,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),n.jsx(ht,{checked:!!C.enabled,onCheckedChange:N=>v("enabled",N)})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"合作者身份 (PID)"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(C.partnerId??""),onChange:N=>v("partnerId",N.target.value)}),n.jsx(pe,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>p(String(C.partnerId??""),"pid"),children:c==="pid"?n.jsx(No,{className:"w-4 h-4 text-green-500"}):n.jsx(ip,{className:"w-4 h-4 text-gray-400"})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"安全校验码 (Key)"}),n.jsx(ue,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(C.securityKey??""),onChange:N=>v("securityKey",N.target.value)})]})]}),n.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[n.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[n.jsx(oo,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(C.qrCode??""),onChange:N=>v("qrCode",N.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),n.jsx(qt,{value:"usdt",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ke,{className:"text-[#26A17B] flex items-center gap-2",children:[n.jsx(nm,{className:"w-5 h-5"}),"USDT配置"]}),n.jsx(mt,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),n.jsx(ht,{checked:!!b.enabled,onCheckedChange:N=>y("enabled",N)})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"网络类型"}),n.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(b.network??"TRC20"),onChange:N=>y("network",N.target.value),children:[n.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),n.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),n.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"收款地址"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(b.address??""),onChange:N=>y("address",N.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),n.jsx(ue,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:N=>y("exchangeRate",Number.parseFloat(N.target.value)||7.2)})]})]})]})}),n.jsx(qt,{value:"paypal",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ke,{className:"text-[#169BD7] flex items-center gap-2",children:[n.jsx(eu,{className:"w-5 h-5"}),"PayPal配置"]}),n.jsx(mt,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),n.jsx(ht,{checked:!!j.enabled,onCheckedChange:N=>E("enabled",N)})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"PayPal邮箱"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(j.email??""),onChange:N=>E("email",N.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),n.jsx(ue,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(j.exchangeRate)??7.2,onChange:N=>E("exchangeRate",Number(N.target.value)||7.2)})]})]})]})})]})]})}const MC={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},LC={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},DC={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function OC(){const[r,a]=x.useState({siteConfig:{...MC},menuConfig:{...LC},pageConfig:{...DC}}),[l,i]=x.useState(!1);x.useEffect(()=>{Ye("/api/config").then(p=>{p!=null&&p.siteConfig&&a(g=>({...g,siteConfig:{...g.siteConfig,...p.siteConfig}})),p!=null&&p.menuConfig&&a(g=>({...g,menuConfig:{...g.menuConfig,...p.menuConfig}})),p!=null&&p.pageConfig&&a(g=>({...g,pageConfig:{...g.pageConfig,...p.pageConfig}}))}).catch(console.error)},[]);const c=()=>{i(!0),setTimeout(()=>i(!1),2e3),alert("配置已保存(当前为前端状态,后端可对接 /api/db/config 持久化)")},d=r.siteConfig,f=r.menuConfig,m=r.pageConfig;return n.jsxs("div",{className:"p-8 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"网站配置"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"配置网站名称、图标、菜单和页面标题"})]}),n.jsxs(pe,{onClick:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),l?"已保存":"保存设置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(eu,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),n.jsx(mt,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),n.jsx(ue,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:d.siteName??"",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,siteName:p.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),n.jsx(ue,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:d.siteTitle??"",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,siteTitle:p.target.value}}))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),n.jsx(ue,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:d.siteDescription??"",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,siteDescription:p.target.value}}))})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),n.jsx(ue,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:d.logo??"",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,logo:p.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),n.jsx(ue,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:d.favicon??"",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,favicon:p.target.value}}))})]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(s1,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),n.jsx(mt,{className:"text-gray-400",children:"配置网站主题色"})]}),n.jsx(_e,{children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"space-y-2 flex-1",children:[n.jsx(ae,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ue,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:d.primaryColor??"#00CED1",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,primaryColor:p.target.value}}))}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:d.primaryColor??"#00CED1",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,primaryColor:p.target.value}}))})]})]}),n.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:d.primaryColor??"#00CED1"},children:"预览"})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(e1,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),n.jsx(mt,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),n.jsx(_e,{className:"space-y-4",children:Object.entries(f).map(([p,g])=>n.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[n.jsx(ht,{checked:(g==null?void 0:g.enabled)??!0,onCheckedChange:v=>a(y=>({...y,menuConfig:{...y.menuConfig,[p]:{...g,enabled:v}}}))}),n.jsx("span",{className:"text-gray-300 w-16 capitalize",children:p}),n.jsx(ue,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(g==null?void 0:g.label)??"",onChange:v=>a(y=>({...y,menuConfig:{...y.menuConfig,[p]:{...g,label:v.target.value}}}))})]}),n.jsx("span",{className:`text-sm ${g!=null&&g.enabled?"text-green-400":"text-gray-500"}`,children:g!=null&&g.enabled?"显示":"隐藏"})]},p))})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(up,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),n.jsx(mt,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"首页标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.homeTitle??"",onChange:p=>a(g=>({...g,pageConfig:{...g.pageConfig,homeTitle:p.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"首页副标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.homeSubtitle??"",onChange:p=>a(g=>({...g,pageConfig:{...g.pageConfig,homeSubtitle:p.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"目录页标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.chaptersTitle??"",onChange:p=>a(g=>({...g,pageConfig:{...g.pageConfig,chaptersTitle:p.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"匹配页标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.matchTitle??"",onChange:p=>a(g=>({...g,pageConfig:{...g.pageConfig,matchTitle:p.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"我的页标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.myTitle??"",onChange:p=>a(g=>({...g,pageConfig:{...g.pageConfig,myTitle:p.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"关于作者标题"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.aboutTitle??"",onChange:p=>a(g=>({...g,pageConfig:{...g.pageConfig,aboutTitle:p.target.value}}))})]})]})]})]})]})]})}function FC(){const[r,a]=x.useState(""),[l,i]=x.useState(""),[c,d]=x.useState(""),[f,m]=x.useState({}),p=async()=>{var k,C,b,j;try{const N=await Ye("/api/config"),P=(C=(k=N==null?void 0:N.liveQRCodes)==null?void 0:k[0])==null?void 0:C.urls;Array.isArray(P)&&a(P.join(` +`));const S=(j=(b=N==null?void 0:N.paymentMethods)==null?void 0:b.wechat)==null?void 0:j.groupQrCode;S&&i(S),m({paymentMethods:N==null?void 0:N.paymentMethods,liveQRCodes:N==null?void 0:N.liveQRCodes})}catch(N){console.error(N)}};x.useEffect(()=>{p()},[]);const g=(k,C)=>{navigator.clipboard.writeText(k),d(C),setTimeout(()=>d(""),2e3)},v=async()=>{try{const k=r.split(` +`).map(b=>b.trim()).filter(Boolean),C=[...f.liveQRCodes||[]];C[0]?C[0].urls=k:C.push({id:"live-1",name:"微信群活码",urls:k,clickCount:0}),await kt("/api/config",{liveQRCodes:C}),alert("群活码配置已保存!"),await p()}catch(k){console.error(k),alert("保存失败: "+(k instanceof Error?k.message:String(k)))}},y=async()=>{var k;try{await kt("/api/config",{paymentMethods:{...f.paymentMethods||{},wechat:{...((k=f.paymentMethods)==null?void 0:k.wechat)||{},groupQrCode:l}}}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await p()}catch(C){console.error(C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}},E=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return n.jsxs("div",{className:"p-8 max-w-5xl mx-auto",children:[n.jsxs("div",{className:"mb-8",children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),n.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(lp,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"text-sm",children:[n.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),n.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[n.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),n.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[n.jsx("li",{children:"访问草料二维码创建活码"}),n.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),n.jsx("li",{children:"复制生成的短链接填入下方配置"}),n.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),n.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),n.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[n.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),n.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),n.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意:微信原生群二维码7天后失效,建议使用草料活码"})]})]})]})}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-[#07C160] flex items-center gap-2",children:[n.jsx(cm,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),n.jsx(mt,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(im,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ue,{placeholder:"https://cli.im/xxxxx 或 https://weixin.qq.com/g/...",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",value:l,onChange:k=>i(k.target.value)}),n.jsx(pe,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>g(l,"group"),children:c==="group"?n.jsx(No,{className:"w-4 h-4 text-green-500"}):n.jsx(ip,{className:"w-4 h-4 text-gray-400"})})]}),n.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[n.jsx(oo,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs(pe,{onClick:y,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[n.jsx(Cs,{className:"w-4 h-4 mr-2"}),"保存配置"]}),n.jsxs(pe,{onClick:E,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[n.jsx(oo,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(cm,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),n.jsx(mt,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(ae,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(im,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),n.jsx($r,{placeholder:"https://cli.im/group1\\nhttps://cli.im/group2",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 min-h-[120px] font-mono text-sm",value:r,onChange:k=>a(k.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"每行填写一个群链接,系统将按顺序或随机分配"})]}),n.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[n.jsx("span",{className:"text-sm text-gray-400",children:"已配置群数量"}),n.jsxs("span",{className:"font-bold text-[#38bdac]",children:[r.split(` +`).filter(Boolean).length," 个"]})]}),n.jsxs(pe,{onClick:v,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Cs,{className:"w-4 h-4 mr-2"}),"保存多群配置"]})]})]})]}),n.jsxs("div",{className:"mt-6 bg-[#0f2137] rounded-xl p-4 border border-gray-700/50",children:[n.jsx("h4",{className:"text-white font-medium mb-3",children:"常见问题"}),n.jsxs("div",{className:"space-y-3 text-sm",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[#38bdac]",children:"Q: 为什么推荐使用草料活码?"}),n.jsx("p",{className:"text-gray-400",children:"A: 草料活码是永久链接,群满后可直接在后台更换新群码,无需修改网站配置。微信原生群码7天失效。"})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[#38bdac]",children:"Q: 支付后没有跳转怎么办?"}),n.jsx("p",{className:"text-gray-400",children:"A: 1) 检查链接是否正确填写 2) 部分浏览器可能拦截弹窗,用户需手动允许 3) 建议使用https开头的链接"})]})]})]})]})}const Wm={matchTypes:[{id:"partner",label:"创业合伙",matchLabel:"创业伙伴",icon:"⭐",matchFromDB:!0,showJoinAfterMatch:!1,price:1,enabled:!0},{id:"investor",label:"资源对接",matchLabel:"资源对接",icon:"👥",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"mentor",label:"导师顾问",matchLabel:"商业顾问",icon:"❤️",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"team",label:"团队招募",matchLabel:"加入项目",icon:"🎮",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}],freeMatchLimit:3,matchPrice:1,settings:{enableFreeMatches:!0,enablePaidMatches:!0,maxMatchesPerDay:10}},zC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function $C(){const[r,a]=x.useState(Wm),[l,i]=x.useState(!0),[c,d]=x.useState(!1),[f,m]=x.useState(!1),[p,g]=x.useState(null),[v,y]=x.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),E=async()=>{i(!0);try{const S=await Ye("/api/db/config/full?key=match_config"),A=(S==null?void 0:S.data)??(S==null?void 0:S.config);A&&a({...Wm,...A})}catch(S){console.error("加载匹配配置失败:",S)}finally{i(!1)}};x.useEffect(()=>{E()},[]);const k=async()=>{d(!0);try{const S=await kt("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});S&&S.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(S&&typeof S=="object"&&"error"in S?S.error:"未知错误"))}catch(S){console.error("保存配置失败:",S),alert("保存失败")}finally{d(!1)}},C=S=>{g(S),y({id:S.id,label:S.label,matchLabel:S.matchLabel,icon:S.icon,matchFromDB:S.matchFromDB,showJoinAfterMatch:S.showJoinAfterMatch,price:S.price,enabled:S.enabled}),m(!0)},b=()=>{g(null),y({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),m(!0)},j=()=>{if(!v.id||!v.label){alert("请填写类型ID和名称");return}const S=[...r.matchTypes];if(p){const A=S.findIndex(U=>U.id===p.id);A!==-1&&(S[A]={...v})}else{if(S.some(A=>A.id===v.id)){alert("类型ID已存在");return}S.push({...v})}a({...r,matchTypes:S}),m(!1)},N=S=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(A=>A.id!==S)})},P=S=>{a({...r,matchTypes:r.matchTypes.map(A=>A.id===S?{...A,enabled:!A.enabled}:A)})};return n.jsxs("div",{className:"p-8 max-w-6xl mx-auto space-y-6",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[n.jsx(io,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),n.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs(pe,{variant:"outline",onClick:E,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),n.jsxs(pe,{onClick:k,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsxs(Ue,{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(A1,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),n.jsx(mt,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),n.jsxs(_e,{className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"每日免费匹配次数"}),n.jsx(ue,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:S=>a({...r,freeMatchLimit:parseInt(S.target.value,10)||0})}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"付费匹配价格(元)"}),n.jsx(ue,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:S=>a({...r,matchPrice:parseFloat(S.target.value)||1})}),n.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"每日最大匹配次数"}),n.jsx(ue,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:S=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(S.target.value,10)||10}})}),n.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),n.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ht,{checked:r.settings.enableFreeMatches,onCheckedChange:S=>a({...r,settings:{...r.settings,enableFreeMatches:S}})}),n.jsx(ae,{className:"text-gray-300",children:"启用免费匹配"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ht,{checked:r.settings.enablePaidMatches,onCheckedChange:S=>a({...r,settings:{...r.settings,enablePaidMatches:S}})}),n.jsx(ae,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[n.jsxs("div",{children:[n.jsxs(Ke,{className:"text-white flex items-center gap-2",children:[n.jsx(kn,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),n.jsx(mt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),n.jsxs(pe,{onClick:b,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Es,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),n.jsx(_e,{children:n.jsxs(bo,{children:[n.jsx(So,{children:n.jsxs($n,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(et,{className:"text-gray-400",children:"图标"}),n.jsx(et,{className:"text-gray-400",children:"类型ID"}),n.jsx(et,{className:"text-gray-400",children:"显示名称"}),n.jsx(et,{className:"text-gray-400",children:"匹配标签"}),n.jsx(et,{className:"text-gray-400",children:"价格"}),n.jsx(et,{className:"text-gray-400",children:"数据库匹配"}),n.jsx(et,{className:"text-gray-400",children:"状态"}),n.jsx(et,{className:"text-right text-gray-400",children:"操作"})]})}),n.jsx(Co,{children:r.matchTypes.map(S=>n.jsxs($n,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsx(Qe,{children:n.jsx("span",{className:"text-2xl",children:S.icon})}),n.jsx(Qe,{className:"font-mono text-gray-300",children:S.id}),n.jsx(Qe,{className:"text-white font-medium",children:S.label}),n.jsx(Qe,{className:"text-gray-300",children:S.matchLabel}),n.jsx(Qe,{children:n.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",S.price]})}),n.jsx(Qe,{children:S.matchFromDB?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):n.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),n.jsx(Qe,{children:n.jsx(ht,{checked:S.enabled,onCheckedChange:()=>P(S.id)})}),n.jsx(Qe,{className:"text-right",children:n.jsxs("div",{className:"flex items-center justify-end gap-1",children:[n.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>C(S),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:n.jsx(Ts,{className:"w-4 h-4"})}),n.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>N(S.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:n.jsx(dp,{className:"w-4 h-4"})})]})})]},S.id))})]})})]}),n.jsx(Nn,{open:f,onOpenChange:m,children:n.jsxs(on,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[n.jsx(jn,{children:n.jsxs(bn,{className:"text-white flex items-center gap-2",children:[p?n.jsx(Ts,{className:"w-5 h-5 text-[#38bdac]"}):n.jsx(Es,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"类型ID(英文)"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:v.id,onChange:S=>y({...v,id:S.target.value}),disabled:!!p})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"图标"}),n.jsx("div",{className:"flex gap-1 flex-wrap",children:zC.map(S=>n.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${v.icon===S?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>y({...v,icon:S}),children:S},S))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"显示名称"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:v.label,onChange:S=>y({...v,label:S.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"匹配标签"}),n.jsx(ue,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:v.matchLabel,onChange:S=>y({...v,matchLabel:S.target.value})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ae,{className:"text-gray-300",children:"单次匹配价格(元)"}),n.jsx(ue,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:v.price,onChange:S=>y({...v,price:parseFloat(S.target.value)||1})})]}),n.jsxs("div",{className:"flex gap-6 pt-2",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ht,{checked:v.matchFromDB,onCheckedChange:S=>y({...v,matchFromDB:S})}),n.jsx(ae,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ht,{checked:v.showJoinAfterMatch,onCheckedChange:S=>y({...v,showJoinAfterMatch:S})}),n.jsx(ae,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ht,{checked:v.enabled,onCheckedChange:S=>y({...v,enabled:S})}),n.jsx(ae,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),n.jsxs(zn,{children:[n.jsx(pe,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsxs(pe,{onClick:j,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Bn,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}function BC(){const r=Qr();return n.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:n.jsxs("div",{className:"text-center max-w-md",children:[n.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-red-500/20 text-red-400 mb-6",children:n.jsx(xw,{className:"w-10 h-10"})}),n.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),n.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),n.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:r.pathname}),n.jsx(pe,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:n.jsxs(np,{to:"/",children:[n.jsx(Fw,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function UC(){return n.jsxs(Hy,{children:[n.jsx(vt,{path:"/login",element:n.jsx(FN,{})}),n.jsxs(vt,{path:"/",element:n.jsx(B1,{}),children:[n.jsx(vt,{index:!0,element:n.jsx(Uy,{to:"/dashboard",replace:!0})}),n.jsx(vt,{path:"dashboard",element:n.jsx($N,{})}),n.jsx(vt,{path:"orders",element:n.jsx(UN,{})}),n.jsx(vt,{path:"users",element:n.jsx(qb,{})}),n.jsx(vt,{path:"distribution",element:n.jsx(Jb,{})}),n.jsx(vt,{path:"withdrawals",element:n.jsx(Zb,{})}),n.jsx(vt,{path:"content",element:n.jsx(aC,{})}),n.jsx(vt,{path:"chapters",element:n.jsx(lC,{})}),n.jsx(vt,{path:"referral-settings",element:n.jsx(PC,{})}),n.jsx(vt,{path:"settings",element:n.jsx(IC,{})}),n.jsx(vt,{path:"payment",element:n.jsx(AC,{})}),n.jsx(vt,{path:"site",element:n.jsx(OC,{})}),n.jsx(vt,{path:"qrcodes",element:n.jsx(FC,{})}),n.jsx(vt,{path:"match",element:n.jsx($C,{})})]}),n.jsx(vt,{path:"*",element:n.jsx(BC,{})})]})}Qv.createRoot(document.getElementById("root")).render(n.jsx(x.StrictMode,{children:n.jsx(Jy,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:n.jsx(UC,{})})})); diff --git a/soul-admin/dist/index.html b/soul-admin/dist/index.html index 8925c2ef..8629b3b5 100644 --- a/soul-admin/dist/index.html +++ b/soul-admin/dist/index.html @@ -4,7 +4,7 @@ 管理后台 - Soul创业派对 - + diff --git a/soul-admin/tsconfig.tsbuildinfo b/soul-admin/tsconfig.tsbuildinfo index e9ca3789..0ad98baf 100644 --- a/soul-admin/tsconfig.tsbuildinfo +++ b/soul-admin/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/client.ts","./src/components/modules/user/userdetailmodal.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/dialog.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/select.tsx","./src/components/ui/slider.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/layouts/adminlayout.tsx","./src/lib/utils.ts","./src/pages/chapters/chapterspage.tsx","./src/pages/content/contentpage.tsx","./src/pages/dashboard/dashboardpage.tsx","./src/pages/distribution/distributionpage.tsx","./src/pages/login/loginpage.tsx","./src/pages/match/matchpage.tsx","./src/pages/not-found/notfoundpage.tsx","./src/pages/orders/orderspage.tsx","./src/pages/payment/paymentpage.tsx","./src/pages/qrcodes/qrcodespage.tsx","./src/pages/referral-settings/referralsettingspage.tsx","./src/pages/settings/settingspage.tsx","./src/pages/site/sitepage.tsx","./src/pages/users/userspage.tsx","./src/pages/withdrawals/withdrawalspage.tsx"],"version":"5.6.3"} \ No newline at end of file +{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/auth.ts","./src/api/client.ts","./src/components/modules/user/userdetailmodal.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/dialog.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/select.tsx","./src/components/ui/slider.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/layouts/adminlayout.tsx","./src/lib/utils.ts","./src/pages/chapters/chapterspage.tsx","./src/pages/content/contentpage.tsx","./src/pages/dashboard/dashboardpage.tsx","./src/pages/distribution/distributionpage.tsx","./src/pages/login/loginpage.tsx","./src/pages/match/matchpage.tsx","./src/pages/not-found/notfoundpage.tsx","./src/pages/orders/orderspage.tsx","./src/pages/payment/paymentpage.tsx","./src/pages/qrcodes/qrcodespage.tsx","./src/pages/referral-settings/referralsettingspage.tsx","./src/pages/settings/settingspage.tsx","./src/pages/site/sitepage.tsx","./src/pages/users/userspage.tsx","./src/pages/withdrawals/withdrawalspage.tsx"],"version":"5.6.3"} \ No newline at end of file diff --git a/soul-api/soul-api b/soul-api/soul-api index 4e8bb4e6b59322938aaa3fe7364b9d13a30e1ffe..5c5936ebf7b3bd76b6a1a5fe47beb1cdd12e6f6f 100644 GIT binary patch delta 1495 zcmcK0=|jwU0LSt9Rdk>RHA0!(N9dSp=9eQ=p~aM>gDj?L#*tiETW&dKmVI5084w8Bp%k4R0(n-H%XR?unED6JtsIxksH zRd^^A3V*nxcXGPo=6!os)&qT?ubJV=n;jWjj|rHF0!+e3 zn2e86h$2kER7}Hk%)m^{!fX^{4(4JW=EGX4R@$Ccw3EY)T5YZ|GS?Vo(#W|MO{Cdm z&N1m?V$9JRizZ4Jt~JS~98+00mo3Os8yl{P)kKsHci93|7UP%#v(JmjgoycpArlqF z@k+hw!egu5Wy1n2gdGl)U=bE$2|mH6D8*-3ie)Ina;(5gtU@_fV-40~9oAz5KF1f> zh%fOKzQ#BB7T;kLHe(C6VjC*39XqfSyWm76c4H6rVjuS70KUgT9KvC^D($W#Yu>oo zgPl8V0lx3yOJ~(ltF!6{{D`0MGmcd{tBw~tB)e74{skxSE2?l3r|=to$7!6wS)9Xp zT)-dr6Bls_mvIGGaShk;7yiZ#+{7*1#vN4SF7Dwz{=ox0#3THR$9RJO@IRj78J^<> zUg8yA;|*%?)-GpDiy`7B;x6JLQcI+^h^L5`h_{H3NF9;7BK1UkMf^mRBK1WYh%^-O r7YPtiNeAWZM$*=elB1+LP%5czj3#J`AOxcs)CfUy=|FW0sb$SOsxmB7 delta 1495 zcmcK0*I$!&7>4n@fFeVP3K0I z)nrQVla`d0)joN`j#ba7A1~qUz$Fgk7OYCzpE-n7U%e!-@;%-Aa0wM(ecmv}&tXEx`q@a6>KB zhCAxO1D^1LH|oL%z7YF*sE-ElgFiHAhyXM~AQ~eG!Ds?4LJ*2DG(|HsM+>w>E40Q3 zXoC;Y7VXd;;m|>b9tK3f2ooZqAPODO5uMN(UCOKFcB6^ zLLTxl8B;J7(=Z($V+Lko7G`4(=Ar=eFdqxB5Y|eq+V-Nnl|DVyl%bE*>mnn}M#U&A zW`iutI=x;en~af0#lS6_GL*7TPFs+>F-jK^rI*V_Ic@%$JWKv)&zEwHZec)(MODyE z9j&?YL}j%*ZCHdt*inRHEJg{IU@4ZN6w9#!D^Z43SdBGUi*;C!4cLfH*o-aMif!1A z9oUIo*o{5di+$LSPjCPSQI116j0$`T2P$y{M{x|t@fl9wBu?Qp&cIn|cYeO%txI9B zqr&Fz^B#WbsQSX{s5*;tIFAeXveHrYRY8$dXjM`!;%j_^DtwFYa0!?3J$}HC_z6Gb z3Vy+__zl0~4_w7HT*nRE#4X&$pZE)Ra2M6Mhx>Sdhj@g)@edy337+B^p5q1n#eaB- zS9py#c#9hRZ&y;J5{S5nxQe)m)Do#J;x1B0#6!eW#7o3mq^^jMh_8rRq@GB9kp?1u rBK{&8>6DVvP&%+(vKLneNX6BS5QxSILNJ;@ix7lLC#u7wrZw*X@|q}p