471 lines
560 KiB
JavaScript
471 lines
560 KiB
JavaScript
function ty(n,a){for(var l=0;l<a.length;l++){const o=a[l];if(typeof o!="string"&&!Array.isArray(o)){for(const c in o)if(c!=="default"&&!(c in n)){const u=Object.getOwnPropertyDescriptor(o,c);u&&Object.defineProperty(n,c,u.get?u:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(n,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"]'))o(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(c){if(c.ep)return;c.ep=!0;const u=l(c);fetch(c.href,u)}})();function cp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bc={exports:{}},Da={},Uc={exports:{}},Ve={};/**
|
||
* @license React
|
||
* react.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Zh;function ry(){if(Zh)return Ve;Zh=1;var n=Symbol.for("react.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.iterator;function P(A){return A===null||typeof A!="object"?null:(A=y&&A[y]||A["@@iterator"],typeof A=="function"?A:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,j={};function b(A,F,G){this.props=A,this.context=F,this.refs=j,this.updater=G||R}b.prototype.isReactComponent={},b.prototype.setState=function(A,F){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,F,"setState")},b.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function S(){}S.prototype=b.prototype;function E(A,F,G){this.props=A,this.context=F,this.refs=j,this.updater=G||R}var w=E.prototype=new S;w.constructor=E,C(w,b.prototype),w.isPureReactComponent=!0;var M=Array.isArray,D=Object.prototype.hasOwnProperty,V={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function T(A,F,G){var J,xe={},me=null,re=null;if(F!=null)for(J in F.ref!==void 0&&(re=F.ref),F.key!==void 0&&(me=""+F.key),F)D.call(F,J)&&!k.hasOwnProperty(J)&&(xe[J]=F[J]);var ye=arguments.length-2;if(ye===1)xe.children=G;else if(1<ye){for(var L=Array(ye),de=0;de<ye;de++)L[de]=arguments[de+2];xe.children=L}if(A&&A.defaultProps)for(J in ye=A.defaultProps,ye)xe[J]===void 0&&(xe[J]=ye[J]);return{$$typeof:n,type:A,key:me,ref:re,props:xe,_owner:V.current}}function U(A,F){return{$$typeof:n,type:A.type,key:F,ref:A.ref,props:A.props,_owner:A._owner}}function Q(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function te(A){var F={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(G){return F[G]})}var oe=/\/+/g;function he(A,F){return typeof A=="object"&&A!==null&&A.key!=null?te(""+A.key):F.toString(36)}function ne(A,F,G,J,xe){var me=typeof A;(me==="undefined"||me==="boolean")&&(A=null);var re=!1;if(A===null)re=!0;else switch(me){case"string":case"number":re=!0;break;case"object":switch(A.$$typeof){case n:case a:re=!0}}if(re)return re=A,xe=xe(re),A=J===""?"."+he(re,0):J,M(xe)?(G="",A!=null&&(G=A.replace(oe,"$&/")+"/"),ne(xe,F,G,"",function(de){return de})):xe!=null&&(Q(xe)&&(xe=U(xe,G+(!xe.key||re&&re.key===xe.key?"":(""+xe.key).replace(oe,"$&/")+"/")+A)),F.push(xe)),1;if(re=0,J=J===""?".":J+":",M(A))for(var ye=0;ye<A.length;ye++){me=A[ye];var L=J+he(me,ye);re+=ne(me,F,G,L,xe)}else if(L=P(A),typeof L=="function")for(A=L.call(A),ye=0;!(me=A.next()).done;)me=me.value,L=J+he(me,ye++),re+=ne(me,F,G,L,xe);else if(me==="object")throw F=String(A),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.");return re}function le(A,F,G){if(A==null)return A;var J=[],xe=0;return ne(A,J,"","",function(me){return F.call(G,me,xe++)}),J}function Z(A){if(A._status===-1){var F=A._result;F=F(),F.then(function(G){(A._status===0||A._status===-1)&&(A._status=1,A._result=G)},function(G){(A._status===0||A._status===-1)&&(A._status=2,A._result=G)}),A._status===-1&&(A._status=0,A._result=F)}if(A._status===1)return A._result.default;throw A._result}var $={current:null},_={transition:null},q={ReactCurrentDispatcher:$,ReactCurrentBatchConfig:_,ReactCurrentOwner:V};function z(){throw Error("act(...) is not supported in production builds of React.")}return Ve.Children={map:le,forEach:function(A,F,G){le(A,function(){F.apply(this,arguments)},G)},count:function(A){var F=0;return le(A,function(){F++}),F},toArray:function(A){return le(A,function(F){return F})||[]},only:function(A){if(!Q(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},Ve.Component=b,Ve.Fragment=l,Ve.Profiler=c,Ve.PureComponent=E,Ve.StrictMode=o,Ve.Suspense=x,Ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,Ve.act=z,Ve.cloneElement=function(A,F,G){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var J=C({},A.props),xe=A.key,me=A.ref,re=A._owner;if(F!=null){if(F.ref!==void 0&&(me=F.ref,re=V.current),F.key!==void 0&&(xe=""+F.key),A.type&&A.type.defaultProps)var ye=A.type.defaultProps;for(L in F)D.call(F,L)&&!k.hasOwnProperty(L)&&(J[L]=F[L]===void 0&&ye!==void 0?ye[L]:F[L])}var L=arguments.length-2;if(L===1)J.children=G;else if(1<L){ye=Array(L);for(var de=0;de<L;de++)ye[de]=arguments[de+2];J.children=ye}return{$$typeof:n,type:A.type,key:xe,ref:me,props:J,_owner:re}},Ve.createContext=function(A){return A={$$typeof:f,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:u,_context:A},A.Consumer=A},Ve.createElement=T,Ve.createFactory=function(A){var F=T.bind(null,A);return F.type=A,F},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(A){return{$$typeof:p,render:A}},Ve.isValidElement=Q,Ve.lazy=function(A){return{$$typeof:v,_payload:{_status:-1,_result:A},_init:Z}},Ve.memo=function(A,F){return{$$typeof:g,type:A,compare:F===void 0?null:F}},Ve.startTransition=function(A){var F=_.transition;_.transition={};try{A()}finally{_.transition=F}},Ve.unstable_act=z,Ve.useCallback=function(A,F){return $.current.useCallback(A,F)},Ve.useContext=function(A){return $.current.useContext(A)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(A){return $.current.useDeferredValue(A)},Ve.useEffect=function(A,F){return $.current.useEffect(A,F)},Ve.useId=function(){return $.current.useId()},Ve.useImperativeHandle=function(A,F,G){return $.current.useImperativeHandle(A,F,G)},Ve.useInsertionEffect=function(A,F){return $.current.useInsertionEffect(A,F)},Ve.useLayoutEffect=function(A,F){return $.current.useLayoutEffect(A,F)},Ve.useMemo=function(A,F){return $.current.useMemo(A,F)},Ve.useReducer=function(A,F,G){return $.current.useReducer(A,F,G)},Ve.useRef=function(A){return $.current.useRef(A)},Ve.useState=function(A){return $.current.useState(A)},Ve.useSyncExternalStore=function(A,F,G){return $.current.useSyncExternalStore(A,F,G)},Ve.useTransition=function(){return $.current.useTransition()},Ve.version="18.3.1",Ve}var em;function Ad(){return em||(em=1,Uc.exports=ry()),Uc.exports}/**
|
||
* @license React
|
||
* react-jsx-runtime.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var tm;function ny(){if(tm)return Da;tm=1;var n=Ad(),a=Symbol.for("react.element"),l=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(p,x,g){var v,y={},P=null,R=null;g!==void 0&&(P=""+g),x.key!==void 0&&(P=""+x.key),x.ref!==void 0&&(R=x.ref);for(v in x)o.call(x,v)&&!u.hasOwnProperty(v)&&(y[v]=x[v]);if(p&&p.defaultProps)for(v in x=p.defaultProps,x)y[v]===void 0&&(y[v]=x[v]);return{$$typeof:a,type:p,key:P,ref:R,props:y,_owner:c.current}}return Da.Fragment=l,Da.jsx=f,Da.jsxs=f,Da}var rm;function sy(){return rm||(rm=1,Bc.exports=ny()),Bc.exports}var t=sy(),h=Ad();const Sn=cp(h),Ai=ty({__proto__:null,default:Sn},[h]);var ri={},Vc={exports:{}},Zt={},Wc={exports:{}},Hc={};/**
|
||
* @license React
|
||
* scheduler.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var nm;function ay(){return nm||(nm=1,(function(n){function a(_,q){var z=_.length;_.push(q);e:for(;0<z;){var A=z-1>>>1,F=_[A];if(0<c(F,q))_[A]=q,_[z]=F,z=A;else break e}}function l(_){return _.length===0?null:_[0]}function o(_){if(_.length===0)return null;var q=_[0],z=_.pop();if(z!==q){_[0]=z;e:for(var A=0,F=_.length,G=F>>>1;A<G;){var J=2*(A+1)-1,xe=_[J],me=J+1,re=_[me];if(0>c(xe,z))me<F&&0>c(re,xe)?(_[A]=re,_[me]=z,A=me):(_[A]=xe,_[J]=z,A=J);else if(me<F&&0>c(re,z))_[A]=re,_[me]=z,A=me;else break e}}return q}function c(_,q){var z=_.sortIndex-q.sortIndex;return z!==0?z:_.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var x=[],g=[],v=1,y=null,P=3,R=!1,C=!1,j=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(_){for(var q=l(g);q!==null;){if(q.callback===null)o(g);else if(q.startTime<=_)o(g),q.sortIndex=q.expirationTime,a(x,q);else break;q=l(g)}}function M(_){if(j=!1,w(_),!C)if(l(x)!==null)C=!0,Z(D);else{var q=l(g);q!==null&&$(M,q.startTime-_)}}function D(_,q){C=!1,j&&(j=!1,S(T),T=-1),R=!0;var z=P;try{for(w(q),y=l(x);y!==null&&(!(y.expirationTime>q)||_&&!te());){var A=y.callback;if(typeof A=="function"){y.callback=null,P=y.priorityLevel;var F=A(y.expirationTime<=q);q=n.unstable_now(),typeof F=="function"?y.callback=F:y===l(x)&&o(x),w(q)}else o(x);y=l(x)}if(y!==null)var G=!0;else{var J=l(g);J!==null&&$(M,J.startTime-q),G=!1}return G}finally{y=null,P=z,R=!1}}var V=!1,k=null,T=-1,U=5,Q=-1;function te(){return!(n.unstable_now()-Q<U)}function oe(){if(k!==null){var _=n.unstable_now();Q=_;var q=!0;try{q=k(!0,_)}finally{q?he():(V=!1,k=null)}}else V=!1}var he;if(typeof E=="function")he=function(){E(oe)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,le=ne.port2;ne.port1.onmessage=oe,he=function(){le.postMessage(null)}}else he=function(){b(oe,0)};function Z(_){k=_,V||(V=!0,he())}function $(_,q){T=b(function(){_(n.unstable_now())},q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(_){_.callback=null},n.unstable_continueExecution=function(){C||R||(C=!0,Z(D))},n.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<_?Math.floor(1e3/_):5},n.unstable_getCurrentPriorityLevel=function(){return P},n.unstable_getFirstCallbackNode=function(){return l(x)},n.unstable_next=function(_){switch(P){case 1:case 2:case 3:var q=3;break;default:q=P}var z=P;P=q;try{return _()}finally{P=z}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(_,q){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var z=P;P=_;try{return q()}finally{P=z}},n.unstable_scheduleCallback=function(_,q,z){var A=n.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?A+z:A):z=A,_){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=z+F,_={id:v++,callback:q,priorityLevel:_,startTime:z,expirationTime:F,sortIndex:-1},z>A?(_.sortIndex=z,a(g,_),l(x)===null&&_===l(g)&&(j?(S(T),T=-1):j=!0,$(M,z-A))):(_.sortIndex=F,a(x,_),C||R||(C=!0,Z(D))),_},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(_){var q=P;return function(){var z=P;P=q;try{return _.apply(this,arguments)}finally{P=z}}}})(Hc)),Hc}var sm;function ly(){return sm||(sm=1,Wc.exports=ay()),Wc.exports}/**
|
||
* @license React
|
||
* react-dom.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var am;function iy(){if(am)return Zt;am=1;var n=Ad(),a=ly();function l(e){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)r+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,c={};function u(e,r){f(e,r),f(e+"Capture",r)}function f(e,r){for(c[e]=r,e=0;e<r.length;e++)o.add(r[e])}var p=!(typeof window>"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 P(e){return x.call(y,e)?!0:x.call(v,e)?!1:g.test(e)?y[e]=!0:(v[e]=!0,!1)}function R(e,r,s,i){if(s!==null&&s.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return i?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,r,s,i){if(r===null||typeof r>"u"||R(e,r,s,i))return!0;if(i)return!1;if(s!==null)switch(s.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function j(e,r,s,i,d,m,N){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=s,this.propertyName=e,this.type=r,this.sanitizeURL=m,this.removeEmptyString=N}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new j(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var r=e[0];b[r]=new j(r,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new j(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new j(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){b[e]=new j(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new j(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new j(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new j(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new j(e,5,!1,e.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function E(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 r=e.replace(S,E);b[r]=new j(r,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var r=e.replace(S,E);b[r]=new j(r,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var r=e.replace(S,E);b[r]=new j(r,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new j(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new j(e,1,!1,e.toLowerCase(),null,!0,!0)});function w(e,r,s,i){var d=b.hasOwnProperty(r)?b[r]:null;(d!==null?d.type!==0:i||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(C(r,s,d,i)&&(s=null),i||d===null?P(r)&&(s===null?e.removeAttribute(r):e.setAttribute(r,""+s)):d.mustUseProperty?e[d.propertyName]=s===null?d.type===3?!1:"":s:(r=d.attributeName,i=d.attributeNamespace,s===null?e.removeAttribute(r):(d=d.type,s=d===3||d===4&&s===!0?"":""+s,i?e.setAttributeNS(i,r,s):e.setAttribute(r,s))))}var M=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),V=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),Q=Symbol.for("react.provider"),te=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),$=Symbol.for("react.offscreen"),_=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=_&&e[_]||e["@@iterator"],typeof e=="function"?e:null)}var z=Object.assign,A;function F(e){if(A===void 0)try{throw Error()}catch(s){var r=s.stack.trim().match(/\n( *(at )?)/);A=r&&r[1]||""}return`
|
||
`+A+e}var G=!1;function J(e,r){if(!e||G)return"";G=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(Y){var i=Y}Reflect.construct(e,[],r)}else{try{r.call()}catch(Y){i=Y}e.call(r.prototype)}else{try{throw Error()}catch(Y){i=Y}e()}}catch(Y){if(Y&&i&&typeof Y.stack=="string"){for(var d=Y.stack.split(`
|
||
`),m=i.stack.split(`
|
||
`),N=d.length-1,I=m.length-1;1<=N&&0<=I&&d[N]!==m[I];)I--;for(;1<=N&&0<=I;N--,I--)if(d[N]!==m[I]){if(N!==1||I!==1)do if(N--,I--,0>I||d[N]!==m[I]){var O=`
|
||
`+d[N].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),O}while(1<=N&&0<=I);break}}}finally{G=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?F(e):""}function xe(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=J(e.type,!1),e;case 11:return e=J(e.type.render,!1),e;case 1:return e=J(e.type,!0),e;default:return""}}function me(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 k:return"Fragment";case V:return"Portal";case U:return"Profiler";case T:return"StrictMode";case he:return"Suspense";case ne:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case te:return(e.displayName||"Context")+".Consumer";case Q:return(e._context.displayName||"Context")+".Provider";case oe:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case le:return r=e.displayName||null,r!==null?r:me(e.type)||"Memo";case Z:r=e._payload,e=e._init;try{return me(e(r))}catch{}}return null}function re(e){var r=e.type;switch(e.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=r.render,e=e.displayName||e.name||"",r.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return me(r);case 8:return r===T?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function ye(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function L(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function de(e){var r=L(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),i=""+e[r];if(!e.hasOwnProperty(r)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var d=s.get,m=s.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return d.call(this)},set:function(N){i=""+N,m.call(this,N)}}),Object.defineProperty(e,r,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(N){i=""+N},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function ge(e){e._valueTracker||(e._valueTracker=de(e))}function _e(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var s=r.getValue(),i="";return e&&(i=L(e)?e.checked?"true":"false":e.value),e=i,e!==s?(r.setValue(e),!0):!1}function Oe(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,r){var s=r.checked;return z({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function qe(e,r){var s=r.defaultValue==null?"":r.defaultValue,i=r.checked!=null?r.checked:r.defaultChecked;s=ye(r.value!=null?r.value:s),e._wrapperState={initialChecked:i,initialValue:s,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function rt(e,r){r=r.checked,r!=null&&w(e,"checked",r,!1)}function et(e,r){rt(e,r);var s=ye(r.value),i=r.type;if(s!=null)i==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}r.hasOwnProperty("value")?Et(e,r.type,s):r.hasOwnProperty("defaultValue")&&Et(e,r.type,ye(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}function kt(e,r,s){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var i=r.type;if(!(i!=="submit"&&i!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+e._wrapperState.initialValue,s||r===e.value||(e.value=r),e.defaultValue=r}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function Et(e,r,s){(r!=="number"||Oe(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var K=Array.isArray;function pe(e,r,s,i){if(e=e.options,r){r={};for(var d=0;d<s.length;d++)r["$"+s[d]]=!0;for(s=0;s<e.length;s++)d=r.hasOwnProperty("$"+e[s].value),e[s].selected!==d&&(e[s].selected=d),d&&i&&(e[s].defaultSelected=!0)}else{for(s=""+ye(s),r=null,d=0;d<e.length;d++){if(e[d].value===s){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}r!==null||e[d].disabled||(r=e[d])}r!==null&&(r.selected=!0)}}function Le(e,r){if(r.dangerouslySetInnerHTML!=null)throw Error(l(91));return z({},r,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ie(e,r){var s=r.value;if(s==null){if(s=r.children,r=r.defaultValue,s!=null){if(r!=null)throw Error(l(92));if(K(s)){if(1<s.length)throw Error(l(93));s=s[0]}r=s}r==null&&(r=""),s=r}e._wrapperState={initialValue:ye(s)}}function At(e,r){var s=ye(r.value),i=ye(r.defaultValue);s!=null&&(s=""+s,s!==e.value&&(e.value=s),r.defaultValue==null&&e.defaultValue!==s&&(e.defaultValue=s)),i!=null&&(e.defaultValue=""+i)}function rn(e){var r=e.textContent;r===e._wrapperState.initialValue&&r!==""&&r!==null&&(e.value=r)}function Pt(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function se(e,r){return e==null||e==="http://www.w3.org/1999/xhtml"?Pt(r):e==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ke,Rt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,s,i,d){MSApp.execUnsafeLocalFunction(function(){return e(r,s,i,d)})}:e})(function(e,r){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=r;else{for(Ke=Ke||document.createElement("div"),Ke.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=Ke.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;r.firstChild;)e.appendChild(r.firstChild)}});function xr(e,r){if(r){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=r;return}}e.textContent=r}var $n={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},a0=["Webkit","ms","Moz","O"];Object.keys($n).forEach(function(e){a0.forEach(function(r){r=r+e.charAt(0).toUpperCase()+e.substring(1),$n[r]=$n[e]})});function hu(e,r,s){return r==null||typeof r=="boolean"||r===""?"":s||typeof r!="number"||r===0||$n.hasOwnProperty(e)&&$n[e]?(""+r).trim():r+"px"}function mu(e,r){e=e.style;for(var s in r)if(r.hasOwnProperty(s)){var i=s.indexOf("--")===0,d=hu(s,r[s],i);s==="float"&&(s="cssFloat"),i?e.setProperty(s,d):e[s]=d}}var l0=z({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 Ji(e,r){if(r){if(l0[e]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(l(137,e));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(l(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(l(61))}if(r.style!=null&&typeof r.style!="object")throw Error(l(62))}}function Zi(e,r){if(e.indexOf("-")===-1)return typeof r.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 eo=null;function to(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ro=null,fs=null,hs=null;function pu(e){if(e=ja(e)){if(typeof ro!="function")throw Error(l(280));var r=e.stateNode;r&&(r=gl(r),ro(e.stateNode,e.type,r))}}function xu(e){fs?hs?hs.push(e):hs=[e]:fs=e}function gu(){if(fs){var e=fs,r=hs;if(hs=fs=null,pu(e),r)for(e=0;e<r.length;e++)pu(r[e])}}function vu(e,r){return e(r)}function yu(){}var no=!1;function ju(e,r,s){if(no)return e(r,s);no=!0;try{return vu(e,r,s)}finally{no=!1,(fs!==null||hs!==null)&&(yu(),gu())}}function Zs(e,r){var s=e.stateNode;if(s===null)return null;var i=gl(s);if(i===null)return null;s=i[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,r,typeof s));return s}var so=!1;if(p)try{var ea={};Object.defineProperty(ea,"passive",{get:function(){so=!0}}),window.addEventListener("test",ea,ea),window.removeEventListener("test",ea,ea)}catch{so=!1}function i0(e,r,s,i,d,m,N,I,O){var Y=Array.prototype.slice.call(arguments,3);try{r.apply(s,Y)}catch(ce){this.onError(ce)}}var ta=!1,Qa=null,qa=!1,ao=null,o0={onError:function(e){ta=!0,Qa=e}};function c0(e,r,s,i,d,m,N,I,O){ta=!1,Qa=null,i0.apply(o0,arguments)}function d0(e,r,s,i,d,m,N,I,O){if(c0.apply(this,arguments),ta){if(ta){var Y=Qa;ta=!1,Qa=null}else throw Error(l(198));qa||(qa=!0,ao=Y)}}function Bn(e){var r=e,s=e;if(e.alternate)for(;r.return;)r=r.return;else{e=r;do r=e,(r.flags&4098)!==0&&(s=r.return),e=r.return;while(e)}return r.tag===3?s:null}function Nu(e){if(e.tag===13){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function bu(e){if(Bn(e)!==e)throw Error(l(188))}function u0(e){var r=e.alternate;if(!r){if(r=Bn(e),r===null)throw Error(l(188));return r!==e?null:e}for(var s=e,i=r;;){var d=s.return;if(d===null)break;var m=d.alternate;if(m===null){if(i=d.return,i!==null){s=i;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===s)return bu(d),e;if(m===i)return bu(d),r;m=m.sibling}throw Error(l(188))}if(s.return!==i.return)s=d,i=m;else{for(var N=!1,I=d.child;I;){if(I===s){N=!0,s=d,i=m;break}if(I===i){N=!0,i=d,s=m;break}I=I.sibling}if(!N){for(I=m.child;I;){if(I===s){N=!0,s=m,i=d;break}if(I===i){N=!0,i=m,s=d;break}I=I.sibling}if(!N)throw Error(l(189))}}if(s.alternate!==i)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?e:r}function wu(e){return e=u0(e),e!==null?Su(e):null}function Su(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var r=Su(e);if(r!==null)return r;e=e.sibling}return null}var Cu=a.unstable_scheduleCallback,ku=a.unstable_cancelCallback,f0=a.unstable_shouldYield,h0=a.unstable_requestPaint,ht=a.unstable_now,m0=a.unstable_getCurrentPriorityLevel,lo=a.unstable_ImmediatePriority,Eu=a.unstable_UserBlockingPriority,Xa=a.unstable_NormalPriority,p0=a.unstable_LowPriority,Pu=a.unstable_IdlePriority,Ja=null,Rr=null;function x0(e){if(Rr&&typeof Rr.onCommitFiberRoot=="function")try{Rr.onCommitFiberRoot(Ja,e,void 0,(e.current.flags&128)===128)}catch{}}var gr=Math.clz32?Math.clz32:y0,g0=Math.log,v0=Math.LN2;function y0(e){return e>>>=0,e===0?32:31-(g0(e)/v0|0)|0}var Za=64,el=4194304;function ra(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 tl(e,r){var s=e.pendingLanes;if(s===0)return 0;var i=0,d=e.suspendedLanes,m=e.pingedLanes,N=s&268435455;if(N!==0){var I=N&~d;I!==0?i=ra(I):(m&=N,m!==0&&(i=ra(m)))}else N=s&~d,N!==0?i=ra(N):m!==0&&(i=ra(m));if(i===0)return 0;if(r!==0&&r!==i&&(r&d)===0&&(d=i&-i,m=r&-r,d>=m||d===16&&(m&4194240)!==0))return r;if((i&4)!==0&&(i|=s&16),r=e.entangledLanes,r!==0)for(e=e.entanglements,r&=i;0<r;)s=31-gr(r),d=1<<s,i|=e[s],r&=~d;return i}function j0(e,r){switch(e){case 1:case 2:case 4:return r+250;case 8:case 16:case 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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function N0(e,r){for(var s=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,m=e.pendingLanes;0<m;){var N=31-gr(m),I=1<<N,O=d[N];O===-1?((I&s)===0||(I&i)!==0)&&(d[N]=j0(I,r)):O<=r&&(e.expiredLanes|=I),m&=~I}}function io(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ru(){var e=Za;return Za<<=1,(Za&4194240)===0&&(Za=64),e}function oo(e){for(var r=[],s=0;31>s;s++)r.push(e);return r}function na(e,r,s){e.pendingLanes|=r,r!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,r=31-gr(r),e[r]=s}function b0(e,r){var s=e.pendingLanes&~r;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=r,e.mutableReadLanes&=r,e.entangledLanes&=r,r=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<s;){var d=31-gr(s),m=1<<d;r[d]=0,i[d]=-1,e[d]=-1,s&=~m}}function co(e,r){var s=e.entangledLanes|=r;for(e=e.entanglements;s;){var i=31-gr(s),d=1<<i;d&r|e[i]&r&&(e[i]|=r),s&=~d}}var Ze=0;function Tu(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var _u,uo,Iu,Au,Mu,fo=!1,rl=[],nn=null,sn=null,an=null,sa=new Map,aa=new Map,ln=[],w0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Du(e,r){switch(e){case"focusin":case"focusout":nn=null;break;case"dragenter":case"dragleave":sn=null;break;case"mouseover":case"mouseout":an=null;break;case"pointerover":case"pointerout":sa.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":aa.delete(r.pointerId)}}function la(e,r,s,i,d,m){return e===null||e.nativeEvent!==m?(e={blockedOn:r,domEventName:s,eventSystemFlags:i,nativeEvent:m,targetContainers:[d]},r!==null&&(r=ja(r),r!==null&&uo(r)),e):(e.eventSystemFlags|=i,r=e.targetContainers,d!==null&&r.indexOf(d)===-1&&r.push(d),e)}function S0(e,r,s,i,d){switch(r){case"focusin":return nn=la(nn,e,r,s,i,d),!0;case"dragenter":return sn=la(sn,e,r,s,i,d),!0;case"mouseover":return an=la(an,e,r,s,i,d),!0;case"pointerover":var m=d.pointerId;return sa.set(m,la(sa.get(m)||null,e,r,s,i,d)),!0;case"gotpointercapture":return m=d.pointerId,aa.set(m,la(aa.get(m)||null,e,r,s,i,d)),!0}return!1}function Lu(e){var r=Un(e.target);if(r!==null){var s=Bn(r);if(s!==null){if(r=s.tag,r===13){if(r=Nu(s),r!==null){e.blockedOn=r,Mu(e.priority,function(){Iu(s)});return}}else if(r===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function nl(e){if(e.blockedOn!==null)return!1;for(var r=e.targetContainers;0<r.length;){var s=mo(e.domEventName,e.eventSystemFlags,r[0],e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);eo=i,s.target.dispatchEvent(i),eo=null}else return r=ja(s),r!==null&&uo(r),e.blockedOn=s,!1;r.shift()}return!0}function Ou(e,r,s){nl(e)&&s.delete(r)}function C0(){fo=!1,nn!==null&&nl(nn)&&(nn=null),sn!==null&&nl(sn)&&(sn=null),an!==null&&nl(an)&&(an=null),sa.forEach(Ou),aa.forEach(Ou)}function ia(e,r){e.blockedOn===r&&(e.blockedOn=null,fo||(fo=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,C0)))}function oa(e){function r(d){return ia(d,e)}if(0<rl.length){ia(rl[0],e);for(var s=1;s<rl.length;s++){var i=rl[s];i.blockedOn===e&&(i.blockedOn=null)}}for(nn!==null&&ia(nn,e),sn!==null&&ia(sn,e),an!==null&&ia(an,e),sa.forEach(r),aa.forEach(r),s=0;s<ln.length;s++)i=ln[s],i.blockedOn===e&&(i.blockedOn=null);for(;0<ln.length&&(s=ln[0],s.blockedOn===null);)Lu(s),s.blockedOn===null&&ln.shift()}var ms=M.ReactCurrentBatchConfig,sl=!0;function k0(e,r,s,i){var d=Ze,m=ms.transition;ms.transition=null;try{Ze=1,ho(e,r,s,i)}finally{Ze=d,ms.transition=m}}function E0(e,r,s,i){var d=Ze,m=ms.transition;ms.transition=null;try{Ze=4,ho(e,r,s,i)}finally{Ze=d,ms.transition=m}}function ho(e,r,s,i){if(sl){var d=mo(e,r,s,i);if(d===null)_o(e,r,i,al,s),Du(e,i);else if(S0(d,e,r,s,i))i.stopPropagation();else if(Du(e,i),r&4&&-1<w0.indexOf(e)){for(;d!==null;){var m=ja(d);if(m!==null&&_u(m),m=mo(e,r,s,i),m===null&&_o(e,r,i,al,s),m===d)break;d=m}d!==null&&i.stopPropagation()}else _o(e,r,i,null,s)}}var al=null;function mo(e,r,s,i){if(al=null,e=to(i),e=Un(e),e!==null)if(r=Bn(e),r===null)e=null;else if(s=r.tag,s===13){if(e=Nu(r),e!==null)return e;e=null}else if(s===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;e=null}else r!==e&&(e=null);return al=e,null}function Fu(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(m0()){case lo:return 1;case Eu:return 4;case Xa:case p0:return 16;case Pu:return 536870912;default:return 16}default:return 16}}var on=null,po=null,ll=null;function zu(){if(ll)return ll;var e,r=po,s=r.length,i,d="value"in on?on.value:on.textContent,m=d.length;for(e=0;e<s&&r[e]===d[e];e++);var N=s-e;for(i=1;i<=N&&r[s-i]===d[m-i];i++);return ll=d.slice(e,1<i?1-i:void 0)}function il(e){var r=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&r===13&&(e=13)):e=r,e===10&&(e=13),32<=e||e===13?e:0}function ol(){return!0}function $u(){return!1}function er(e){function r(s,i,d,m,N){this._reactName=s,this._targetInst=d,this.type=i,this.nativeEvent=m,this.target=N,this.currentTarget=null;for(var I in e)e.hasOwnProperty(I)&&(s=e[I],this[I]=s?s(m):m[I]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?ol:$u,this.isPropagationStopped=$u,this}return z(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ol)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ol)},persist:function(){},isPersistent:ol}),r}var ps={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xo=er(ps),ca=z({},ps,{view:0,detail:0}),P0=er(ca),go,vo,da,cl=z({},ca,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==da&&(da&&e.type==="mousemove"?(go=e.screenX-da.screenX,vo=e.screenY-da.screenY):vo=go=0,da=e),go)},movementY:function(e){return"movementY"in e?e.movementY:vo}}),Bu=er(cl),R0=z({},cl,{dataTransfer:0}),T0=er(R0),_0=z({},ca,{relatedTarget:0}),yo=er(_0),I0=z({},ps,{animationName:0,elapsedTime:0,pseudoElement:0}),A0=er(I0),M0=z({},ps,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),D0=er(M0),L0=z({},ps,{data:0}),Uu=er(L0),O0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},F0={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},z0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $0(e){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(e):(e=z0[e])?!!r[e]:!1}function jo(){return $0}var B0=z({},ca,{key:function(e){if(e.key){var r=O0[e.key]||e.key;if(r!=="Unidentified")return r}return e.type==="keypress"?(e=il(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?F0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jo,charCode:function(e){return e.type==="keypress"?il(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?il(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),U0=er(B0),V0=z({},cl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vu=er(V0),W0=z({},ca,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jo}),H0=er(W0),K0=z({},ps,{propertyName:0,elapsedTime:0,pseudoElement:0}),Y0=er(K0),G0=z({},cl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Q0=er(G0),q0=[9,13,27,32],No=p&&"CompositionEvent"in window,ua=null;p&&"documentMode"in document&&(ua=document.documentMode);var X0=p&&"TextEvent"in window&&!ua,Wu=p&&(!No||ua&&8<ua&&11>=ua),Hu=" ",Ku=!1;function Yu(e,r){switch(e){case"keyup":return q0.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xs=!1;function J0(e,r){switch(e){case"compositionend":return Gu(r);case"keypress":return r.which!==32?null:(Ku=!0,Hu);case"textInput":return e=r.data,e===Hu&&Ku?null:e;default:return null}}function Z0(e,r){if(xs)return e==="compositionend"||!No&&Yu(e,r)?(e=zu(),ll=po=on=null,xs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Wu&&r.locale!=="ko"?null:r.data;default:return null}}var ev={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Qu(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r==="input"?!!ev[e.type]:r==="textarea"}function qu(e,r,s,i){xu(i),r=ml(r,"onChange"),0<r.length&&(s=new xo("onChange","change",null,s,i),e.push({event:s,listeners:r}))}var fa=null,ha=null;function tv(e){pf(e,0)}function dl(e){var r=Ns(e);if(_e(r))return e}function rv(e,r){if(e==="change")return r}var Xu=!1;if(p){var bo;if(p){var wo="oninput"in document;if(!wo){var Ju=document.createElement("div");Ju.setAttribute("oninput","return;"),wo=typeof Ju.oninput=="function"}bo=wo}else bo=!1;Xu=bo&&(!document.documentMode||9<document.documentMode)}function Zu(){fa&&(fa.detachEvent("onpropertychange",ef),ha=fa=null)}function ef(e){if(e.propertyName==="value"&&dl(ha)){var r=[];qu(r,ha,e,to(e)),ju(tv,r)}}function nv(e,r,s){e==="focusin"?(Zu(),fa=r,ha=s,fa.attachEvent("onpropertychange",ef)):e==="focusout"&&Zu()}function sv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return dl(ha)}function av(e,r){if(e==="click")return dl(r)}function lv(e,r){if(e==="input"||e==="change")return dl(r)}function iv(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var vr=typeof Object.is=="function"?Object.is:iv;function ma(e,r){if(vr(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;var s=Object.keys(e),i=Object.keys(r);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var d=s[i];if(!x.call(r,d)||!vr(e[d],r[d]))return!1}return!0}function tf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rf(e,r){var s=tf(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=r&&i>=r)return{node:s,offset:r-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=tf(s)}}function nf(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?nf(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function sf(){for(var e=window,r=Oe();r instanceof e.HTMLIFrameElement;){try{var s=typeof r.contentWindow.location.href=="string"}catch{s=!1}if(s)e=r.contentWindow;else break;r=Oe(e.document)}return r}function So(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}function ov(e){var r=sf(),s=e.focusedElem,i=e.selectionRange;if(r!==s&&s&&s.ownerDocument&&nf(s.ownerDocument.documentElement,s)){if(i!==null&&So(s)){if(r=i.start,e=i.end,e===void 0&&(e=r),"selectionStart"in s)s.selectionStart=r,s.selectionEnd=Math.min(e,s.value.length);else if(e=(r=s.ownerDocument||document)&&r.defaultView||window,e.getSelection){e=e.getSelection();var d=s.textContent.length,m=Math.min(i.start,d);i=i.end===void 0?m:Math.min(i.end,d),!e.extend&&m>i&&(d=i,i=m,m=d),d=rf(s,m);var N=rf(s,i);d&&N&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==N.node||e.focusOffset!==N.offset)&&(r=r.createRange(),r.setStart(d.node,d.offset),e.removeAllRanges(),m>i?(e.addRange(r),e.extend(N.node,N.offset)):(r.setEnd(N.node,N.offset),e.addRange(r)))}}for(r=[],e=s;e=e.parentNode;)e.nodeType===1&&r.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<r.length;s++)e=r[s],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var cv=p&&"documentMode"in document&&11>=document.documentMode,gs=null,Co=null,pa=null,ko=!1;function af(e,r,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;ko||gs==null||gs!==Oe(i)||(i=gs,"selectionStart"in i&&So(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),pa&&ma(pa,i)||(pa=i,i=ml(Co,"onSelect"),0<i.length&&(r=new xo("onSelect","select",null,r,s),e.push({event:r,listeners:i}),r.target=gs)))}function ul(e,r){var s={};return s[e.toLowerCase()]=r.toLowerCase(),s["Webkit"+e]="webkit"+r,s["Moz"+e]="moz"+r,s}var vs={animationend:ul("Animation","AnimationEnd"),animationiteration:ul("Animation","AnimationIteration"),animationstart:ul("Animation","AnimationStart"),transitionend:ul("Transition","TransitionEnd")},Eo={},lf={};p&&(lf=document.createElement("div").style,"AnimationEvent"in window||(delete vs.animationend.animation,delete vs.animationiteration.animation,delete vs.animationstart.animation),"TransitionEvent"in window||delete vs.transitionend.transition);function fl(e){if(Eo[e])return Eo[e];if(!vs[e])return e;var r=vs[e],s;for(s in r)if(r.hasOwnProperty(s)&&s in lf)return Eo[e]=r[s];return e}var of=fl("animationend"),cf=fl("animationiteration"),df=fl("animationstart"),uf=fl("transitionend"),ff=new Map,hf="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function cn(e,r){ff.set(e,r),u(r,[e])}for(var Po=0;Po<hf.length;Po++){var Ro=hf[Po],dv=Ro.toLowerCase(),uv=Ro[0].toUpperCase()+Ro.slice(1);cn(dv,"on"+uv)}cn(of,"onAnimationEnd"),cn(cf,"onAnimationIteration"),cn(df,"onAnimationStart"),cn("dblclick","onDoubleClick"),cn("focusin","onFocus"),cn("focusout","onBlur"),cn(uf,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),fv=new Set("cancel close invalid load scroll toggle".split(" ").concat(xa));function mf(e,r,s){var i=e.type||"unknown-event";e.currentTarget=s,d0(i,r,void 0,e),e.currentTarget=null}function pf(e,r){r=(r&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],d=i.event;i=i.listeners;e:{var m=void 0;if(r)for(var N=i.length-1;0<=N;N--){var I=i[N],O=I.instance,Y=I.currentTarget;if(I=I.listener,O!==m&&d.isPropagationStopped())break e;mf(d,I,Y),m=O}else for(N=0;N<i.length;N++){if(I=i[N],O=I.instance,Y=I.currentTarget,I=I.listener,O!==m&&d.isPropagationStopped())break e;mf(d,I,Y),m=O}}}if(qa)throw e=ao,qa=!1,ao=null,e}function st(e,r){var s=r[Oo];s===void 0&&(s=r[Oo]=new Set);var i=e+"__bubble";s.has(i)||(xf(r,e,2,!1),s.add(i))}function To(e,r,s){var i=0;r&&(i|=4),xf(s,e,i,r)}var hl="_reactListening"+Math.random().toString(36).slice(2);function ga(e){if(!e[hl]){e[hl]=!0,o.forEach(function(s){s!=="selectionchange"&&(fv.has(s)||To(s,!1,e),To(s,!0,e))});var r=e.nodeType===9?e:e.ownerDocument;r===null||r[hl]||(r[hl]=!0,To("selectionchange",!1,r))}}function xf(e,r,s,i){switch(Fu(r)){case 1:var d=k0;break;case 4:d=E0;break;default:d=ho}s=d.bind(null,r,s,e),d=void 0,!so||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(d=!0),i?d!==void 0?e.addEventListener(r,s,{capture:!0,passive:d}):e.addEventListener(r,s,!0):d!==void 0?e.addEventListener(r,s,{passive:d}):e.addEventListener(r,s,!1)}function _o(e,r,s,i,d){var m=i;if((r&1)===0&&(r&2)===0&&i!==null)e:for(;;){if(i===null)return;var N=i.tag;if(N===3||N===4){var I=i.stateNode.containerInfo;if(I===d||I.nodeType===8&&I.parentNode===d)break;if(N===4)for(N=i.return;N!==null;){var O=N.tag;if((O===3||O===4)&&(O=N.stateNode.containerInfo,O===d||O.nodeType===8&&O.parentNode===d))return;N=N.return}for(;I!==null;){if(N=Un(I),N===null)return;if(O=N.tag,O===5||O===6){i=m=N;continue e}I=I.parentNode}}i=i.return}ju(function(){var Y=m,ce=to(s),ue=[];e:{var ie=ff.get(e);if(ie!==void 0){var ve=xo,be=e;switch(e){case"keypress":if(il(s)===0)break e;case"keydown":case"keyup":ve=U0;break;case"focusin":be="focus",ve=yo;break;case"focusout":be="blur",ve=yo;break;case"beforeblur":case"afterblur":ve=yo;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ve=Bu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ve=T0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ve=H0;break;case of:case cf:case df:ve=A0;break;case uf:ve=Y0;break;case"scroll":ve=P0;break;case"wheel":ve=Q0;break;case"copy":case"cut":case"paste":ve=D0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ve=Vu}var ke=(r&4)!==0,mt=!ke&&e==="scroll",W=ke?ie!==null?ie+"Capture":null:ie;ke=[];for(var B=Y,H;B!==null;){H=B;var fe=H.stateNode;if(H.tag===5&&fe!==null&&(H=fe,W!==null&&(fe=Zs(B,W),fe!=null&&ke.push(va(B,fe,H)))),mt)break;B=B.return}0<ke.length&&(ie=new ve(ie,be,null,s,ce),ue.push({event:ie,listeners:ke}))}}if((r&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",ve=e==="mouseout"||e==="pointerout",ie&&s!==eo&&(be=s.relatedTarget||s.fromElement)&&(Un(be)||be[zr]))break e;if((ve||ie)&&(ie=ce.window===ce?ce:(ie=ce.ownerDocument)?ie.defaultView||ie.parentWindow:window,ve?(be=s.relatedTarget||s.toElement,ve=Y,be=be?Un(be):null,be!==null&&(mt=Bn(be),be!==mt||be.tag!==5&&be.tag!==6)&&(be=null)):(ve=null,be=Y),ve!==be)){if(ke=Bu,fe="onMouseLeave",W="onMouseEnter",B="mouse",(e==="pointerout"||e==="pointerover")&&(ke=Vu,fe="onPointerLeave",W="onPointerEnter",B="pointer"),mt=ve==null?ie:Ns(ve),H=be==null?ie:Ns(be),ie=new ke(fe,B+"leave",ve,s,ce),ie.target=mt,ie.relatedTarget=H,fe=null,Un(ce)===Y&&(ke=new ke(W,B+"enter",be,s,ce),ke.target=H,ke.relatedTarget=mt,fe=ke),mt=fe,ve&&be)t:{for(ke=ve,W=be,B=0,H=ke;H;H=ys(H))B++;for(H=0,fe=W;fe;fe=ys(fe))H++;for(;0<B-H;)ke=ys(ke),B--;for(;0<H-B;)W=ys(W),H--;for(;B--;){if(ke===W||W!==null&&ke===W.alternate)break t;ke=ys(ke),W=ys(W)}ke=null}else ke=null;ve!==null&&gf(ue,ie,ve,ke,!1),be!==null&&mt!==null&&gf(ue,mt,be,ke,!0)}}e:{if(ie=Y?Ns(Y):window,ve=ie.nodeName&&ie.nodeName.toLowerCase(),ve==="select"||ve==="input"&&ie.type==="file")var Ee=rv;else if(Qu(ie))if(Xu)Ee=lv;else{Ee=sv;var Ae=nv}else(ve=ie.nodeName)&&ve.toLowerCase()==="input"&&(ie.type==="checkbox"||ie.type==="radio")&&(Ee=av);if(Ee&&(Ee=Ee(e,Y))){qu(ue,Ee,s,ce);break e}Ae&&Ae(e,ie,Y),e==="focusout"&&(Ae=ie._wrapperState)&&Ae.controlled&&ie.type==="number"&&Et(ie,"number",ie.value)}switch(Ae=Y?Ns(Y):window,e){case"focusin":(Qu(Ae)||Ae.contentEditable==="true")&&(gs=Ae,Co=Y,pa=null);break;case"focusout":pa=Co=gs=null;break;case"mousedown":ko=!0;break;case"contextmenu":case"mouseup":case"dragend":ko=!1,af(ue,s,ce);break;case"selectionchange":if(cv)break;case"keydown":case"keyup":af(ue,s,ce)}var Me;if(No)e:{switch(e){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else xs?Yu(e,s)&&(De="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(De="onCompositionStart");De&&(Wu&&s.locale!=="ko"&&(xs||De!=="onCompositionStart"?De==="onCompositionEnd"&&xs&&(Me=zu()):(on=ce,po="value"in on?on.value:on.textContent,xs=!0)),Ae=ml(Y,De),0<Ae.length&&(De=new Uu(De,e,null,s,ce),ue.push({event:De,listeners:Ae}),Me?De.data=Me:(Me=Gu(s),Me!==null&&(De.data=Me)))),(Me=X0?J0(e,s):Z0(e,s))&&(Y=ml(Y,"onBeforeInput"),0<Y.length&&(ce=new Uu("onBeforeInput","beforeinput",null,s,ce),ue.push({event:ce,listeners:Y}),ce.data=Me))}pf(ue,r)})}function va(e,r,s){return{instance:e,listener:r,currentTarget:s}}function ml(e,r){for(var s=r+"Capture",i=[];e!==null;){var d=e,m=d.stateNode;d.tag===5&&m!==null&&(d=m,m=Zs(e,s),m!=null&&i.unshift(va(e,m,d)),m=Zs(e,r),m!=null&&i.push(va(e,m,d))),e=e.return}return i}function ys(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function gf(e,r,s,i,d){for(var m=r._reactName,N=[];s!==null&&s!==i;){var I=s,O=I.alternate,Y=I.stateNode;if(O!==null&&O===i)break;I.tag===5&&Y!==null&&(I=Y,d?(O=Zs(s,m),O!=null&&N.unshift(va(s,O,I))):d||(O=Zs(s,m),O!=null&&N.push(va(s,O,I)))),s=s.return}N.length!==0&&e.push({event:r,listeners:N})}var hv=/\r\n?/g,mv=/\u0000|\uFFFD/g;function vf(e){return(typeof e=="string"?e:""+e).replace(hv,`
|
||
`).replace(mv,"")}function pl(e,r,s){if(r=vf(r),vf(e)!==r&&s)throw Error(l(425))}function xl(){}var Io=null,Ao=null;function Mo(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Do=typeof setTimeout=="function"?setTimeout:void 0,pv=typeof clearTimeout=="function"?clearTimeout:void 0,yf=typeof Promise=="function"?Promise:void 0,xv=typeof queueMicrotask=="function"?queueMicrotask:typeof yf<"u"?function(e){return yf.resolve(null).then(e).catch(gv)}:Do;function gv(e){setTimeout(function(){throw e})}function Lo(e,r){var s=r,i=0;do{var d=s.nextSibling;if(e.removeChild(s),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(i===0){e.removeChild(d),oa(r);return}i--}else s!=="$"&&s!=="$?"&&s!=="$!"||i++;s=d}while(s);oa(r)}function dn(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return e}function jf(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(r===0)return e;r--}else s==="/$"&&r++}e=e.previousSibling}return null}var js=Math.random().toString(36).slice(2),Tr="__reactFiber$"+js,ya="__reactProps$"+js,zr="__reactContainer$"+js,Oo="__reactEvents$"+js,vv="__reactListeners$"+js,yv="__reactHandles$"+js;function Un(e){var r=e[Tr];if(r)return r;for(var s=e.parentNode;s;){if(r=s[zr]||s[Tr]){if(s=r.alternate,r.child!==null||s!==null&&s.child!==null)for(e=jf(e);e!==null;){if(s=e[Tr])return s;e=jf(e)}return r}e=s,s=e.parentNode}return null}function ja(e){return e=e[Tr]||e[zr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ns(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(l(33))}function gl(e){return e[ya]||null}var Fo=[],bs=-1;function un(e){return{current:e}}function at(e){0>bs||(e.current=Fo[bs],Fo[bs]=null,bs--)}function nt(e,r){bs++,Fo[bs]=e.current,e.current=r}var fn={},Mt=un(fn),Gt=un(!1),Vn=fn;function ws(e,r){var s=e.type.contextTypes;if(!s)return fn;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===r)return i.__reactInternalMemoizedMaskedChildContext;var d={},m;for(m in s)d[m]=r[m];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=d),d}function Qt(e){return e=e.childContextTypes,e!=null}function vl(){at(Gt),at(Mt)}function Nf(e,r,s){if(Mt.current!==fn)throw Error(l(168));nt(Mt,r),nt(Gt,s)}function bf(e,r,s){var i=e.stateNode;if(r=r.childContextTypes,typeof i.getChildContext!="function")return s;i=i.getChildContext();for(var d in i)if(!(d in r))throw Error(l(108,re(e)||"Unknown",d));return z({},s,i)}function yl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fn,Vn=Mt.current,nt(Mt,e),nt(Gt,Gt.current),!0}function wf(e,r,s){var i=e.stateNode;if(!i)throw Error(l(169));s?(e=bf(e,r,Vn),i.__reactInternalMemoizedMergedChildContext=e,at(Gt),at(Mt),nt(Mt,e)):at(Gt),nt(Gt,s)}var $r=null,jl=!1,zo=!1;function Sf(e){$r===null?$r=[e]:$r.push(e)}function jv(e){jl=!0,Sf(e)}function hn(){if(!zo&&$r!==null){zo=!0;var e=0,r=Ze;try{var s=$r;for(Ze=1;e<s.length;e++){var i=s[e];do i=i(!0);while(i!==null)}$r=null,jl=!1}catch(d){throw $r!==null&&($r=$r.slice(e+1)),Cu(lo,hn),d}finally{Ze=r,zo=!1}}return null}var Ss=[],Cs=0,Nl=null,bl=0,ir=[],or=0,Wn=null,Br=1,Ur="";function Hn(e,r){Ss[Cs++]=bl,Ss[Cs++]=Nl,Nl=e,bl=r}function Cf(e,r,s){ir[or++]=Br,ir[or++]=Ur,ir[or++]=Wn,Wn=e;var i=Br;e=Ur;var d=32-gr(i)-1;i&=~(1<<d),s+=1;var m=32-gr(r)+d;if(30<m){var N=d-d%5;m=(i&(1<<N)-1).toString(32),i>>=N,d-=N,Br=1<<32-gr(r)+d|s<<d|i,Ur=m+e}else Br=1<<m|s<<d|i,Ur=e}function $o(e){e.return!==null&&(Hn(e,1),Cf(e,1,0))}function Bo(e){for(;e===Nl;)Nl=Ss[--Cs],Ss[Cs]=null,bl=Ss[--Cs],Ss[Cs]=null;for(;e===Wn;)Wn=ir[--or],ir[or]=null,Ur=ir[--or],ir[or]=null,Br=ir[--or],ir[or]=null}var tr=null,rr=null,lt=!1,yr=null;function kf(e,r){var s=fr(5,null,null,0);s.elementType="DELETED",s.stateNode=r,s.return=e,r=e.deletions,r===null?(e.deletions=[s],e.flags|=16):r.push(s)}function Ef(e,r){switch(e.tag){case 5:var s=e.type;return r=r.nodeType!==1||s.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(e.stateNode=r,tr=e,rr=dn(r.firstChild),!0):!1;case 6:return r=e.pendingProps===""||r.nodeType!==3?null:r,r!==null?(e.stateNode=r,tr=e,rr=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(s=Wn!==null?{id:Br,overflow:Ur}:null,e.memoizedState={dehydrated:r,treeContext:s,retryLane:1073741824},s=fr(18,null,null,0),s.stateNode=r,s.return=e,e.child=s,tr=e,rr=null,!0):!1;default:return!1}}function Uo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vo(e){if(lt){var r=rr;if(r){var s=r;if(!Ef(e,r)){if(Uo(e))throw Error(l(418));r=dn(s.nextSibling);var i=tr;r&&Ef(e,r)?kf(i,s):(e.flags=e.flags&-4097|2,lt=!1,tr=e)}}else{if(Uo(e))throw Error(l(418));e.flags=e.flags&-4097|2,lt=!1,tr=e}}}function Pf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;tr=e}function wl(e){if(e!==tr)return!1;if(!lt)return Pf(e),lt=!0,!1;var r;if((r=e.tag!==3)&&!(r=e.tag!==5)&&(r=e.type,r=r!=="head"&&r!=="body"&&!Mo(e.type,e.memoizedProps)),r&&(r=rr)){if(Uo(e))throw Rf(),Error(l(418));for(;r;)kf(e,r),r=dn(r.nextSibling)}if(Pf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));e:{for(e=e.nextSibling,r=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"){if(r===0){rr=dn(e.nextSibling);break e}r--}else s!=="$"&&s!=="$!"&&s!=="$?"||r++}e=e.nextSibling}rr=null}}else rr=tr?dn(e.stateNode.nextSibling):null;return!0}function Rf(){for(var e=rr;e;)e=dn(e.nextSibling)}function ks(){rr=tr=null,lt=!1}function Wo(e){yr===null?yr=[e]:yr.push(e)}var Nv=M.ReactCurrentBatchConfig;function Na(e,r,s){if(e=s.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(l(309));var i=s.stateNode}if(!i)throw Error(l(147,e));var d=i,m=""+e;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===m?r.ref:(r=function(N){var I=d.refs;N===null?delete I[m]:I[m]=N},r._stringRef=m,r)}if(typeof e!="string")throw Error(l(284));if(!s._owner)throw Error(l(290,e))}return e}function Sl(e,r){throw e=Object.prototype.toString.call(r),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e))}function Tf(e){var r=e._init;return r(e._payload)}function _f(e){function r(W,B){if(e){var H=W.deletions;H===null?(W.deletions=[B],W.flags|=16):H.push(B)}}function s(W,B){if(!e)return null;for(;B!==null;)r(W,B),B=B.sibling;return null}function i(W,B){for(W=new Map;B!==null;)B.key!==null?W.set(B.key,B):W.set(B.index,B),B=B.sibling;return W}function d(W,B){return W=Nn(W,B),W.index=0,W.sibling=null,W}function m(W,B,H){return W.index=H,e?(H=W.alternate,H!==null?(H=H.index,H<B?(W.flags|=2,B):H):(W.flags|=2,B)):(W.flags|=1048576,B)}function N(W){return e&&W.alternate===null&&(W.flags|=2),W}function I(W,B,H,fe){return B===null||B.tag!==6?(B=Dc(H,W.mode,fe),B.return=W,B):(B=d(B,H),B.return=W,B)}function O(W,B,H,fe){var Ee=H.type;return Ee===k?ce(W,B,H.props.children,fe,H.key):B!==null&&(B.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===Z&&Tf(Ee)===B.type)?(fe=d(B,H.props),fe.ref=Na(W,B,H),fe.return=W,fe):(fe=Gl(H.type,H.key,H.props,null,W.mode,fe),fe.ref=Na(W,B,H),fe.return=W,fe)}function Y(W,B,H,fe){return B===null||B.tag!==4||B.stateNode.containerInfo!==H.containerInfo||B.stateNode.implementation!==H.implementation?(B=Lc(H,W.mode,fe),B.return=W,B):(B=d(B,H.children||[]),B.return=W,B)}function ce(W,B,H,fe,Ee){return B===null||B.tag!==7?(B=Zn(H,W.mode,fe,Ee),B.return=W,B):(B=d(B,H),B.return=W,B)}function ue(W,B,H){if(typeof B=="string"&&B!==""||typeof B=="number")return B=Dc(""+B,W.mode,H),B.return=W,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case D:return H=Gl(B.type,B.key,B.props,null,W.mode,H),H.ref=Na(W,null,B),H.return=W,H;case V:return B=Lc(B,W.mode,H),B.return=W,B;case Z:var fe=B._init;return ue(W,fe(B._payload),H)}if(K(B)||q(B))return B=Zn(B,W.mode,H,null),B.return=W,B;Sl(W,B)}return null}function ie(W,B,H,fe){var Ee=B!==null?B.key:null;if(typeof H=="string"&&H!==""||typeof H=="number")return Ee!==null?null:I(W,B,""+H,fe);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case D:return H.key===Ee?O(W,B,H,fe):null;case V:return H.key===Ee?Y(W,B,H,fe):null;case Z:return Ee=H._init,ie(W,B,Ee(H._payload),fe)}if(K(H)||q(H))return Ee!==null?null:ce(W,B,H,fe,null);Sl(W,H)}return null}function ve(W,B,H,fe,Ee){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return W=W.get(H)||null,I(B,W,""+fe,Ee);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case D:return W=W.get(fe.key===null?H:fe.key)||null,O(B,W,fe,Ee);case V:return W=W.get(fe.key===null?H:fe.key)||null,Y(B,W,fe,Ee);case Z:var Ae=fe._init;return ve(W,B,H,Ae(fe._payload),Ee)}if(K(fe)||q(fe))return W=W.get(H)||null,ce(B,W,fe,Ee,null);Sl(B,fe)}return null}function be(W,B,H,fe){for(var Ee=null,Ae=null,Me=B,De=B=0,wt=null;Me!==null&&De<H.length;De++){Me.index>De?(wt=Me,Me=null):wt=Me.sibling;var Qe=ie(W,Me,H[De],fe);if(Qe===null){Me===null&&(Me=wt);break}e&&Me&&Qe.alternate===null&&r(W,Me),B=m(Qe,B,De),Ae===null?Ee=Qe:Ae.sibling=Qe,Ae=Qe,Me=wt}if(De===H.length)return s(W,Me),lt&&Hn(W,De),Ee;if(Me===null){for(;De<H.length;De++)Me=ue(W,H[De],fe),Me!==null&&(B=m(Me,B,De),Ae===null?Ee=Me:Ae.sibling=Me,Ae=Me);return lt&&Hn(W,De),Ee}for(Me=i(W,Me);De<H.length;De++)wt=ve(Me,W,De,H[De],fe),wt!==null&&(e&&wt.alternate!==null&&Me.delete(wt.key===null?De:wt.key),B=m(wt,B,De),Ae===null?Ee=wt:Ae.sibling=wt,Ae=wt);return e&&Me.forEach(function(bn){return r(W,bn)}),lt&&Hn(W,De),Ee}function ke(W,B,H,fe){var Ee=q(H);if(typeof Ee!="function")throw Error(l(150));if(H=Ee.call(H),H==null)throw Error(l(151));for(var Ae=Ee=null,Me=B,De=B=0,wt=null,Qe=H.next();Me!==null&&!Qe.done;De++,Qe=H.next()){Me.index>De?(wt=Me,Me=null):wt=Me.sibling;var bn=ie(W,Me,Qe.value,fe);if(bn===null){Me===null&&(Me=wt);break}e&&Me&&bn.alternate===null&&r(W,Me),B=m(bn,B,De),Ae===null?Ee=bn:Ae.sibling=bn,Ae=bn,Me=wt}if(Qe.done)return s(W,Me),lt&&Hn(W,De),Ee;if(Me===null){for(;!Qe.done;De++,Qe=H.next())Qe=ue(W,Qe.value,fe),Qe!==null&&(B=m(Qe,B,De),Ae===null?Ee=Qe:Ae.sibling=Qe,Ae=Qe);return lt&&Hn(W,De),Ee}for(Me=i(W,Me);!Qe.done;De++,Qe=H.next())Qe=ve(Me,W,De,Qe.value,fe),Qe!==null&&(e&&Qe.alternate!==null&&Me.delete(Qe.key===null?De:Qe.key),B=m(Qe,B,De),Ae===null?Ee=Qe:Ae.sibling=Qe,Ae=Qe);return e&&Me.forEach(function(ey){return r(W,ey)}),lt&&Hn(W,De),Ee}function mt(W,B,H,fe){if(typeof H=="object"&&H!==null&&H.type===k&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case D:e:{for(var Ee=H.key,Ae=B;Ae!==null;){if(Ae.key===Ee){if(Ee=H.type,Ee===k){if(Ae.tag===7){s(W,Ae.sibling),B=d(Ae,H.props.children),B.return=W,W=B;break e}}else if(Ae.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===Z&&Tf(Ee)===Ae.type){s(W,Ae.sibling),B=d(Ae,H.props),B.ref=Na(W,Ae,H),B.return=W,W=B;break e}s(W,Ae);break}else r(W,Ae);Ae=Ae.sibling}H.type===k?(B=Zn(H.props.children,W.mode,fe,H.key),B.return=W,W=B):(fe=Gl(H.type,H.key,H.props,null,W.mode,fe),fe.ref=Na(W,B,H),fe.return=W,W=fe)}return N(W);case V:e:{for(Ae=H.key;B!==null;){if(B.key===Ae)if(B.tag===4&&B.stateNode.containerInfo===H.containerInfo&&B.stateNode.implementation===H.implementation){s(W,B.sibling),B=d(B,H.children||[]),B.return=W,W=B;break e}else{s(W,B);break}else r(W,B);B=B.sibling}B=Lc(H,W.mode,fe),B.return=W,W=B}return N(W);case Z:return Ae=H._init,mt(W,B,Ae(H._payload),fe)}if(K(H))return be(W,B,H,fe);if(q(H))return ke(W,B,H,fe);Sl(W,H)}return typeof H=="string"&&H!==""||typeof H=="number"?(H=""+H,B!==null&&B.tag===6?(s(W,B.sibling),B=d(B,H),B.return=W,W=B):(s(W,B),B=Dc(H,W.mode,fe),B.return=W,W=B),N(W)):s(W,B)}return mt}var Es=_f(!0),If=_f(!1),Cl=un(null),kl=null,Ps=null,Ho=null;function Ko(){Ho=Ps=kl=null}function Yo(e){var r=Cl.current;at(Cl),e._currentValue=r}function Go(e,r,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,i!==null&&(i.childLanes|=r)):i!==null&&(i.childLanes&r)!==r&&(i.childLanes|=r),e===s)break;e=e.return}}function Rs(e,r){kl=e,Ho=Ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&r)!==0&&(qt=!0),e.firstContext=null)}function cr(e){var r=e._currentValue;if(Ho!==e)if(e={context:e,memoizedValue:r,next:null},Ps===null){if(kl===null)throw Error(l(308));Ps=e,kl.dependencies={lanes:0,firstContext:e}}else Ps=Ps.next=e;return r}var Kn=null;function Qo(e){Kn===null?Kn=[e]:Kn.push(e)}function Af(e,r,s,i){var d=r.interleaved;return d===null?(s.next=s,Qo(r)):(s.next=d.next,d.next=s),r.interleaved=s,Vr(e,i)}function Vr(e,r){e.lanes|=r;var s=e.alternate;for(s!==null&&(s.lanes|=r),s=e,e=e.return;e!==null;)e.childLanes|=r,s=e.alternate,s!==null&&(s.childLanes|=r),s=e,e=e.return;return s.tag===3?s.stateNode:null}var mn=!1;function qo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mf(e,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Wr(e,r){return{eventTime:e,lane:r,tag:0,payload:null,callback:null,next:null}}function pn(e,r,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ye&2)!==0){var d=i.pending;return d===null?r.next=r:(r.next=d.next,d.next=r),i.pending=r,Vr(e,s)}return d=i.interleaved,d===null?(r.next=r,Qo(i)):(r.next=d.next,d.next=r),i.interleaved=r,Vr(e,s)}function El(e,r,s){if(r=r.updateQueue,r!==null&&(r=r.shared,(s&4194240)!==0)){var i=r.lanes;i&=e.pendingLanes,s|=i,r.lanes=s,co(e,s)}}function Df(e,r){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var d=null,m=null;if(s=s.firstBaseUpdate,s!==null){do{var N={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};m===null?d=m=N:m=m.next=N,s=s.next}while(s!==null);m===null?d=m=r:m=m.next=r}else d=m=r;s={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:i.shared,effects:i.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=r:e.next=r,s.lastBaseUpdate=r}function Pl(e,r,s,i){var d=e.updateQueue;mn=!1;var m=d.firstBaseUpdate,N=d.lastBaseUpdate,I=d.shared.pending;if(I!==null){d.shared.pending=null;var O=I,Y=O.next;O.next=null,N===null?m=Y:N.next=Y,N=O;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,I=ce.lastBaseUpdate,I!==N&&(I===null?ce.firstBaseUpdate=Y:I.next=Y,ce.lastBaseUpdate=O))}if(m!==null){var ue=d.baseState;N=0,ce=Y=O=null,I=m;do{var ie=I.lane,ve=I.eventTime;if((i&ie)===ie){ce!==null&&(ce=ce.next={eventTime:ve,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var be=e,ke=I;switch(ie=r,ve=s,ke.tag){case 1:if(be=ke.payload,typeof be=="function"){ue=be.call(ve,ue,ie);break e}ue=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=ke.payload,ie=typeof be=="function"?be.call(ve,ue,ie):be,ie==null)break e;ue=z({},ue,ie);break e;case 2:mn=!0}}I.callback!==null&&I.lane!==0&&(e.flags|=64,ie=d.effects,ie===null?d.effects=[I]:ie.push(I))}else ve={eventTime:ve,lane:ie,tag:I.tag,payload:I.payload,callback:I.callback,next:null},ce===null?(Y=ce=ve,O=ue):ce=ce.next=ve,N|=ie;if(I=I.next,I===null){if(I=d.shared.pending,I===null)break;ie=I,I=ie.next,ie.next=null,d.lastBaseUpdate=ie,d.shared.pending=null}}while(!0);if(ce===null&&(O=ue),d.baseState=O,d.firstBaseUpdate=Y,d.lastBaseUpdate=ce,r=d.shared.interleaved,r!==null){d=r;do N|=d.lane,d=d.next;while(d!==r)}else m===null&&(d.shared.lanes=0);Qn|=N,e.lanes=N,e.memoizedState=ue}}function Lf(e,r,s){if(e=r.effects,r.effects=null,e!==null)for(r=0;r<e.length;r++){var i=e[r],d=i.callback;if(d!==null){if(i.callback=null,i=s,typeof d!="function")throw Error(l(191,d));d.call(i)}}}var ba={},_r=un(ba),wa=un(ba),Sa=un(ba);function Yn(e){if(e===ba)throw Error(l(174));return e}function Xo(e,r){switch(nt(Sa,r),nt(wa,e),nt(_r,ba),e=r.nodeType,e){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:se(null,"");break;default:e=e===8?r.parentNode:r,r=e.namespaceURI||null,e=e.tagName,r=se(r,e)}at(_r),nt(_r,r)}function Ts(){at(_r),at(wa),at(Sa)}function Of(e){Yn(Sa.current);var r=Yn(_r.current),s=se(r,e.type);r!==s&&(nt(wa,e),nt(_r,s))}function Jo(e){wa.current===e&&(at(_r),at(wa))}var ct=un(0);function Rl(e){for(var r=e;r!==null;){if(r.tag===13){var s=r.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Zo=[];function ec(){for(var e=0;e<Zo.length;e++)Zo[e]._workInProgressVersionPrimary=null;Zo.length=0}var Tl=M.ReactCurrentDispatcher,tc=M.ReactCurrentBatchConfig,Gn=0,dt=null,vt=null,Nt=null,_l=!1,Ca=!1,ka=0,bv=0;function Dt(){throw Error(l(321))}function rc(e,r){if(r===null)return!1;for(var s=0;s<r.length&&s<e.length;s++)if(!vr(e[s],r[s]))return!1;return!0}function nc(e,r,s,i,d,m){if(Gn=m,dt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Tl.current=e===null||e.memoizedState===null?kv:Ev,e=s(i,d),Ca){m=0;do{if(Ca=!1,ka=0,25<=m)throw Error(l(301));m+=1,Nt=vt=null,r.updateQueue=null,Tl.current=Pv,e=s(i,d)}while(Ca)}if(Tl.current=Ml,r=vt!==null&&vt.next!==null,Gn=0,Nt=vt=dt=null,_l=!1,r)throw Error(l(300));return e}function sc(){var e=ka!==0;return ka=0,e}function Ir(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?dt.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function dr(){if(vt===null){var e=dt.alternate;e=e!==null?e.memoizedState:null}else e=vt.next;var r=Nt===null?dt.memoizedState:Nt.next;if(r!==null)Nt=r,vt=e;else{if(e===null)throw Error(l(310));vt=e,e={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Nt===null?dt.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function Ea(e,r){return typeof r=="function"?r(e):r}function ac(e){var r=dr(),s=r.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var i=vt,d=i.baseQueue,m=s.pending;if(m!==null){if(d!==null){var N=d.next;d.next=m.next,m.next=N}i.baseQueue=d=m,s.pending=null}if(d!==null){m=d.next,i=i.baseState;var I=N=null,O=null,Y=m;do{var ce=Y.lane;if((Gn&ce)===ce)O!==null&&(O=O.next={lane:0,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),i=Y.hasEagerState?Y.eagerState:e(i,Y.action);else{var ue={lane:ce,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null};O===null?(I=O=ue,N=i):O=O.next=ue,dt.lanes|=ce,Qn|=ce}Y=Y.next}while(Y!==null&&Y!==m);O===null?N=i:O.next=I,vr(i,r.memoizedState)||(qt=!0),r.memoizedState=i,r.baseState=N,r.baseQueue=O,s.lastRenderedState=i}if(e=s.interleaved,e!==null){d=e;do m=d.lane,dt.lanes|=m,Qn|=m,d=d.next;while(d!==e)}else d===null&&(s.lanes=0);return[r.memoizedState,s.dispatch]}function lc(e){var r=dr(),s=r.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var i=s.dispatch,d=s.pending,m=r.memoizedState;if(d!==null){s.pending=null;var N=d=d.next;do m=e(m,N.action),N=N.next;while(N!==d);vr(m,r.memoizedState)||(qt=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),s.lastRenderedState=m}return[m,i]}function Ff(){}function zf(e,r){var s=dt,i=dr(),d=r(),m=!vr(i.memoizedState,d);if(m&&(i.memoizedState=d,qt=!0),i=i.queue,ic(Uf.bind(null,s,i,e),[e]),i.getSnapshot!==r||m||Nt!==null&&Nt.memoizedState.tag&1){if(s.flags|=2048,Pa(9,Bf.bind(null,s,i,d,r),void 0,null),bt===null)throw Error(l(349));(Gn&30)!==0||$f(s,r,d)}return d}function $f(e,r,s){e.flags|=16384,e={getSnapshot:r,value:s},r=dt.updateQueue,r===null?(r={lastEffect:null,stores:null},dt.updateQueue=r,r.stores=[e]):(s=r.stores,s===null?r.stores=[e]:s.push(e))}function Bf(e,r,s,i){r.value=s,r.getSnapshot=i,Vf(r)&&Wf(e)}function Uf(e,r,s){return s(function(){Vf(r)&&Wf(e)})}function Vf(e){var r=e.getSnapshot;e=e.value;try{var s=r();return!vr(e,s)}catch{return!0}}function Wf(e){var r=Vr(e,1);r!==null&&wr(r,e,1,-1)}function Hf(e){var r=Ir();return typeof e=="function"&&(e=e()),r.memoizedState=r.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:e},r.queue=e,e=e.dispatch=Cv.bind(null,dt,e),[r.memoizedState,e]}function Pa(e,r,s,i){return e={tag:e,create:r,destroy:s,deps:i,next:null},r=dt.updateQueue,r===null?(r={lastEffect:null,stores:null},dt.updateQueue=r,r.lastEffect=e.next=e):(s=r.lastEffect,s===null?r.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,r.lastEffect=e)),e}function Kf(){return dr().memoizedState}function Il(e,r,s,i){var d=Ir();dt.flags|=e,d.memoizedState=Pa(1|r,s,void 0,i===void 0?null:i)}function Al(e,r,s,i){var d=dr();i=i===void 0?null:i;var m=void 0;if(vt!==null){var N=vt.memoizedState;if(m=N.destroy,i!==null&&rc(i,N.deps)){d.memoizedState=Pa(r,s,m,i);return}}dt.flags|=e,d.memoizedState=Pa(1|r,s,m,i)}function Yf(e,r){return Il(8390656,8,e,r)}function ic(e,r){return Al(2048,8,e,r)}function Gf(e,r){return Al(4,2,e,r)}function Qf(e,r){return Al(4,4,e,r)}function qf(e,r){if(typeof r=="function")return e=e(),r(e),function(){r(null)};if(r!=null)return e=e(),r.current=e,function(){r.current=null}}function Xf(e,r,s){return s=s!=null?s.concat([e]):null,Al(4,4,qf.bind(null,r,e),s)}function oc(){}function Jf(e,r){var s=dr();r=r===void 0?null:r;var i=s.memoizedState;return i!==null&&r!==null&&rc(r,i[1])?i[0]:(s.memoizedState=[e,r],e)}function Zf(e,r){var s=dr();r=r===void 0?null:r;var i=s.memoizedState;return i!==null&&r!==null&&rc(r,i[1])?i[0]:(e=e(),s.memoizedState=[e,r],e)}function eh(e,r,s){return(Gn&21)===0?(e.baseState&&(e.baseState=!1,qt=!0),e.memoizedState=s):(vr(s,r)||(s=Ru(),dt.lanes|=s,Qn|=s,e.baseState=!0),r)}function wv(e,r){var s=Ze;Ze=s!==0&&4>s?s:4,e(!0);var i=tc.transition;tc.transition={};try{e(!1),r()}finally{Ze=s,tc.transition=i}}function th(){return dr().memoizedState}function Sv(e,r,s){var i=yn(e);if(s={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null},rh(e))nh(r,s);else if(s=Af(e,r,s,i),s!==null){var d=Ht();wr(s,e,i,d),sh(s,r,i)}}function Cv(e,r,s){var i=yn(e),d={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null};if(rh(e))nh(r,d);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var N=r.lastRenderedState,I=m(N,s);if(d.hasEagerState=!0,d.eagerState=I,vr(I,N)){var O=r.interleaved;O===null?(d.next=d,Qo(r)):(d.next=O.next,O.next=d),r.interleaved=d;return}}catch{}finally{}s=Af(e,r,d,i),s!==null&&(d=Ht(),wr(s,e,i,d),sh(s,r,i))}}function rh(e){var r=e.alternate;return e===dt||r!==null&&r===dt}function nh(e,r){Ca=_l=!0;var s=e.pending;s===null?r.next=r:(r.next=s.next,s.next=r),e.pending=r}function sh(e,r,s){if((s&4194240)!==0){var i=r.lanes;i&=e.pendingLanes,s|=i,r.lanes=s,co(e,s)}}var Ml={readContext:cr,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useInsertionEffect:Dt,useLayoutEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useMutableSource:Dt,useSyncExternalStore:Dt,useId:Dt,unstable_isNewReconciler:!1},kv={readContext:cr,useCallback:function(e,r){return Ir().memoizedState=[e,r===void 0?null:r],e},useContext:cr,useEffect:Yf,useImperativeHandle:function(e,r,s){return s=s!=null?s.concat([e]):null,Il(4194308,4,qf.bind(null,r,e),s)},useLayoutEffect:function(e,r){return Il(4194308,4,e,r)},useInsertionEffect:function(e,r){return Il(4,2,e,r)},useMemo:function(e,r){var s=Ir();return r=r===void 0?null:r,e=e(),s.memoizedState=[e,r],e},useReducer:function(e,r,s){var i=Ir();return r=s!==void 0?s(r):r,i.memoizedState=i.baseState=r,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=Sv.bind(null,dt,e),[i.memoizedState,e]},useRef:function(e){var r=Ir();return e={current:e},r.memoizedState=e},useState:Hf,useDebugValue:oc,useDeferredValue:function(e){return Ir().memoizedState=e},useTransition:function(){var e=Hf(!1),r=e[0];return e=wv.bind(null,e[1]),Ir().memoizedState=e,[r,e]},useMutableSource:function(){},useSyncExternalStore:function(e,r,s){var i=dt,d=Ir();if(lt){if(s===void 0)throw Error(l(407));s=s()}else{if(s=r(),bt===null)throw Error(l(349));(Gn&30)!==0||$f(i,r,s)}d.memoizedState=s;var m={value:s,getSnapshot:r};return d.queue=m,Yf(Uf.bind(null,i,m,e),[e]),i.flags|=2048,Pa(9,Bf.bind(null,i,m,s,r),void 0,null),s},useId:function(){var e=Ir(),r=bt.identifierPrefix;if(lt){var s=Ur,i=Br;s=(i&~(1<<32-gr(i)-1)).toString(32)+s,r=":"+r+"R"+s,s=ka++,0<s&&(r+="H"+s.toString(32)),r+=":"}else s=bv++,r=":"+r+"r"+s.toString(32)+":";return e.memoizedState=r},unstable_isNewReconciler:!1},Ev={readContext:cr,useCallback:Jf,useContext:cr,useEffect:ic,useImperativeHandle:Xf,useInsertionEffect:Gf,useLayoutEffect:Qf,useMemo:Zf,useReducer:ac,useRef:Kf,useState:function(){return ac(Ea)},useDebugValue:oc,useDeferredValue:function(e){var r=dr();return eh(r,vt.memoizedState,e)},useTransition:function(){var e=ac(Ea)[0],r=dr().memoizedState;return[e,r]},useMutableSource:Ff,useSyncExternalStore:zf,useId:th,unstable_isNewReconciler:!1},Pv={readContext:cr,useCallback:Jf,useContext:cr,useEffect:ic,useImperativeHandle:Xf,useInsertionEffect:Gf,useLayoutEffect:Qf,useMemo:Zf,useReducer:lc,useRef:Kf,useState:function(){return lc(Ea)},useDebugValue:oc,useDeferredValue:function(e){var r=dr();return vt===null?r.memoizedState=e:eh(r,vt.memoizedState,e)},useTransition:function(){var e=lc(Ea)[0],r=dr().memoizedState;return[e,r]},useMutableSource:Ff,useSyncExternalStore:zf,useId:th,unstable_isNewReconciler:!1};function jr(e,r){if(e&&e.defaultProps){r=z({},r),e=e.defaultProps;for(var s in e)r[s]===void 0&&(r[s]=e[s]);return r}return r}function cc(e,r,s,i){r=e.memoizedState,s=s(i,r),s=s==null?r:z({},r,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Dl={isMounted:function(e){return(e=e._reactInternals)?Bn(e)===e:!1},enqueueSetState:function(e,r,s){e=e._reactInternals;var i=Ht(),d=yn(e),m=Wr(i,d);m.payload=r,s!=null&&(m.callback=s),r=pn(e,m,d),r!==null&&(wr(r,e,d,i),El(r,e,d))},enqueueReplaceState:function(e,r,s){e=e._reactInternals;var i=Ht(),d=yn(e),m=Wr(i,d);m.tag=1,m.payload=r,s!=null&&(m.callback=s),r=pn(e,m,d),r!==null&&(wr(r,e,d,i),El(r,e,d))},enqueueForceUpdate:function(e,r){e=e._reactInternals;var s=Ht(),i=yn(e),d=Wr(s,i);d.tag=2,r!=null&&(d.callback=r),r=pn(e,d,i),r!==null&&(wr(r,e,i,s),El(r,e,i))}};function ah(e,r,s,i,d,m,N){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,m,N):r.prototype&&r.prototype.isPureReactComponent?!ma(s,i)||!ma(d,m):!0}function lh(e,r,s){var i=!1,d=fn,m=r.contextType;return typeof m=="object"&&m!==null?m=cr(m):(d=Qt(r)?Vn:Mt.current,i=r.contextTypes,m=(i=i!=null)?ws(e,d):fn),r=new r(s,m),e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Dl,e.stateNode=r,r._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=m),r}function ih(e,r,s,i){e=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(s,i),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(s,i),r.state!==e&&Dl.enqueueReplaceState(r,r.state,null)}function dc(e,r,s,i){var d=e.stateNode;d.props=s,d.state=e.memoizedState,d.refs={},qo(e);var m=r.contextType;typeof m=="object"&&m!==null?d.context=cr(m):(m=Qt(r)?Vn:Mt.current,d.context=ws(e,m)),d.state=e.memoizedState,m=r.getDerivedStateFromProps,typeof m=="function"&&(cc(e,r,m,s),d.state=e.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(r=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),r!==d.state&&Dl.enqueueReplaceState(d,d.state,null),Pl(e,s,d,i),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function _s(e,r){try{var s="",i=r;do s+=xe(i),i=i.return;while(i);var d=s}catch(m){d=`
|
||
Error generating stack: `+m.message+`
|
||
`+m.stack}return{value:e,source:r,stack:d,digest:null}}function uc(e,r,s){return{value:e,source:null,stack:s??null,digest:r??null}}function fc(e,r){try{console.error(r.value)}catch(s){setTimeout(function(){throw s})}}var Rv=typeof WeakMap=="function"?WeakMap:Map;function oh(e,r,s){s=Wr(-1,s),s.tag=3,s.payload={element:null};var i=r.value;return s.callback=function(){Ul||(Ul=!0,Ec=i),fc(e,r)},s}function ch(e,r,s){s=Wr(-1,s),s.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var d=r.value;s.payload=function(){return i(d)},s.callback=function(){fc(e,r)}}var m=e.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(s.callback=function(){fc(e,r),typeof i!="function"&&(gn===null?gn=new Set([this]):gn.add(this));var N=r.stack;this.componentDidCatch(r.value,{componentStack:N!==null?N:""})}),s}function dh(e,r,s){var i=e.pingCache;if(i===null){i=e.pingCache=new Rv;var d=new Set;i.set(r,d)}else d=i.get(r),d===void 0&&(d=new Set,i.set(r,d));d.has(s)||(d.add(s),e=Vv.bind(null,e,r,s),r.then(e,e))}function uh(e){do{var r;if((r=e.tag===13)&&(r=e.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return e;e=e.return}while(e!==null);return null}function fh(e,r,s,i,d){return(e.mode&1)===0?(e===r?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(r=Wr(-1,1),r.tag=2,pn(s,r,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Tv=M.ReactCurrentOwner,qt=!1;function Wt(e,r,s,i){r.child=e===null?If(r,null,s,i):Es(r,e.child,s,i)}function hh(e,r,s,i,d){s=s.render;var m=r.ref;return Rs(r,d),i=nc(e,r,s,i,m,d),s=sc(),e!==null&&!qt?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~d,Hr(e,r,d)):(lt&&s&&$o(r),r.flags|=1,Wt(e,r,i,d),r.child)}function mh(e,r,s,i,d){if(e===null){var m=s.type;return typeof m=="function"&&!Mc(m)&&m.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(r.tag=15,r.type=m,ph(e,r,m,i,d)):(e=Gl(s.type,null,i,r,r.mode,d),e.ref=r.ref,e.return=r,r.child=e)}if(m=e.child,(e.lanes&d)===0){var N=m.memoizedProps;if(s=s.compare,s=s!==null?s:ma,s(N,i)&&e.ref===r.ref)return Hr(e,r,d)}return r.flags|=1,e=Nn(m,i),e.ref=r.ref,e.return=r,r.child=e}function ph(e,r,s,i,d){if(e!==null){var m=e.memoizedProps;if(ma(m,i)&&e.ref===r.ref)if(qt=!1,r.pendingProps=i=m,(e.lanes&d)!==0)(e.flags&131072)!==0&&(qt=!0);else return r.lanes=e.lanes,Hr(e,r,d)}return hc(e,r,s,i,d)}function xh(e,r,s){var i=r.pendingProps,d=i.children,m=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},nt(As,nr),nr|=s;else{if((s&1073741824)===0)return e=m!==null?m.baseLanes|s:s,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:e,cachePool:null,transitions:null},r.updateQueue=null,nt(As,nr),nr|=e,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=m!==null?m.baseLanes:s,nt(As,nr),nr|=i}else m!==null?(i=m.baseLanes|s,r.memoizedState=null):i=s,nt(As,nr),nr|=i;return Wt(e,r,d,s),r.child}function gh(e,r){var s=r.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(r.flags|=512,r.flags|=2097152)}function hc(e,r,s,i,d){var m=Qt(s)?Vn:Mt.current;return m=ws(r,m),Rs(r,d),s=nc(e,r,s,i,m,d),i=sc(),e!==null&&!qt?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~d,Hr(e,r,d)):(lt&&i&&$o(r),r.flags|=1,Wt(e,r,s,d),r.child)}function vh(e,r,s,i,d){if(Qt(s)){var m=!0;yl(r)}else m=!1;if(Rs(r,d),r.stateNode===null)Ol(e,r),lh(r,s,i),dc(r,s,i,d),i=!0;else if(e===null){var N=r.stateNode,I=r.memoizedProps;N.props=I;var O=N.context,Y=s.contextType;typeof Y=="object"&&Y!==null?Y=cr(Y):(Y=Qt(s)?Vn:Mt.current,Y=ws(r,Y));var ce=s.getDerivedStateFromProps,ue=typeof ce=="function"||typeof N.getSnapshotBeforeUpdate=="function";ue||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(I!==i||O!==Y)&&ih(r,N,i,Y),mn=!1;var ie=r.memoizedState;N.state=ie,Pl(r,i,N,d),O=r.memoizedState,I!==i||ie!==O||Gt.current||mn?(typeof ce=="function"&&(cc(r,s,ce,i),O=r.memoizedState),(I=mn||ah(r,s,I,i,ie,O,Y))?(ue||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(r.flags|=4194308)):(typeof N.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=i,r.memoizedState=O),N.props=i,N.state=O,N.context=Y,i=I):(typeof N.componentDidMount=="function"&&(r.flags|=4194308),i=!1)}else{N=r.stateNode,Mf(e,r),I=r.memoizedProps,Y=r.type===r.elementType?I:jr(r.type,I),N.props=Y,ue=r.pendingProps,ie=N.context,O=s.contextType,typeof O=="object"&&O!==null?O=cr(O):(O=Qt(s)?Vn:Mt.current,O=ws(r,O));var ve=s.getDerivedStateFromProps;(ce=typeof ve=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(I!==ue||ie!==O)&&ih(r,N,i,O),mn=!1,ie=r.memoizedState,N.state=ie,Pl(r,i,N,d);var be=r.memoizedState;I!==ue||ie!==be||Gt.current||mn?(typeof ve=="function"&&(cc(r,s,ve,i),be=r.memoizedState),(Y=mn||ah(r,s,Y,i,ie,be,O)||!1)?(ce||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(i,be,O),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(i,be,O)),typeof N.componentDidUpdate=="function"&&(r.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof N.componentDidUpdate!="function"||I===e.memoizedProps&&ie===e.memoizedState||(r.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||I===e.memoizedProps&&ie===e.memoizedState||(r.flags|=1024),r.memoizedProps=i,r.memoizedState=be),N.props=i,N.state=be,N.context=O,i=Y):(typeof N.componentDidUpdate!="function"||I===e.memoizedProps&&ie===e.memoizedState||(r.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||I===e.memoizedProps&&ie===e.memoizedState||(r.flags|=1024),i=!1)}return mc(e,r,s,i,m,d)}function mc(e,r,s,i,d,m){gh(e,r);var N=(r.flags&128)!==0;if(!i&&!N)return d&&wf(r,s,!1),Hr(e,r,m);i=r.stateNode,Tv.current=r;var I=N&&typeof s.getDerivedStateFromError!="function"?null:i.render();return r.flags|=1,e!==null&&N?(r.child=Es(r,e.child,null,m),r.child=Es(r,null,I,m)):Wt(e,r,I,m),r.memoizedState=i.state,d&&wf(r,s,!0),r.child}function yh(e){var r=e.stateNode;r.pendingContext?Nf(e,r.pendingContext,r.pendingContext!==r.context):r.context&&Nf(e,r.context,!1),Xo(e,r.containerInfo)}function jh(e,r,s,i,d){return ks(),Wo(d),r.flags|=256,Wt(e,r,s,i),r.child}var pc={dehydrated:null,treeContext:null,retryLane:0};function xc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Nh(e,r,s){var i=r.pendingProps,d=ct.current,m=!1,N=(r.flags&128)!==0,I;if((I=N)||(I=e!==null&&e.memoizedState===null?!1:(d&2)!==0),I?(m=!0,r.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),nt(ct,d&1),e===null)return Vo(r),e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((r.mode&1)===0?r.lanes=1:e.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(N=i.children,e=i.fallback,m?(i=r.mode,m=r.child,N={mode:"hidden",children:N},(i&1)===0&&m!==null?(m.childLanes=0,m.pendingProps=N):m=Ql(N,i,0,null),e=Zn(e,i,s,null),m.return=r,e.return=r,m.sibling=e,r.child=m,r.child.memoizedState=xc(s),r.memoizedState=pc,e):gc(r,N));if(d=e.memoizedState,d!==null&&(I=d.dehydrated,I!==null))return _v(e,r,N,i,I,d,s);if(m){m=i.fallback,N=r.mode,d=e.child,I=d.sibling;var O={mode:"hidden",children:i.children};return(N&1)===0&&r.child!==d?(i=r.child,i.childLanes=0,i.pendingProps=O,r.deletions=null):(i=Nn(d,O),i.subtreeFlags=d.subtreeFlags&14680064),I!==null?m=Nn(I,m):(m=Zn(m,N,s,null),m.flags|=2),m.return=r,i.return=r,i.sibling=m,r.child=i,i=m,m=r.child,N=e.child.memoizedState,N=N===null?xc(s):{baseLanes:N.baseLanes|s,cachePool:null,transitions:N.transitions},m.memoizedState=N,m.childLanes=e.childLanes&~s,r.memoizedState=pc,i}return m=e.child,e=m.sibling,i=Nn(m,{mode:"visible",children:i.children}),(r.mode&1)===0&&(i.lanes=s),i.return=r,i.sibling=null,e!==null&&(s=r.deletions,s===null?(r.deletions=[e],r.flags|=16):s.push(e)),r.child=i,r.memoizedState=null,i}function gc(e,r){return r=Ql({mode:"visible",children:r},e.mode,0,null),r.return=e,e.child=r}function Ll(e,r,s,i){return i!==null&&Wo(i),Es(r,e.child,null,s),e=gc(r,r.pendingProps.children),e.flags|=2,r.memoizedState=null,e}function _v(e,r,s,i,d,m,N){if(s)return r.flags&256?(r.flags&=-257,i=uc(Error(l(422))),Ll(e,r,N,i)):r.memoizedState!==null?(r.child=e.child,r.flags|=128,null):(m=i.fallback,d=r.mode,i=Ql({mode:"visible",children:i.children},d,0,null),m=Zn(m,d,N,null),m.flags|=2,i.return=r,m.return=r,i.sibling=m,r.child=i,(r.mode&1)!==0&&Es(r,e.child,null,N),r.child.memoizedState=xc(N),r.memoizedState=pc,m);if((r.mode&1)===0)return Ll(e,r,N,null);if(d.data==="$!"){if(i=d.nextSibling&&d.nextSibling.dataset,i)var I=i.dgst;return i=I,m=Error(l(419)),i=uc(m,i,void 0),Ll(e,r,N,i)}if(I=(N&e.childLanes)!==0,qt||I){if(i=bt,i!==null){switch(N&-N){case 4:d=2;break;case 16:d=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:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(i.suspendedLanes|N))!==0?0:d,d!==0&&d!==m.retryLane&&(m.retryLane=d,Vr(e,d),wr(i,e,d,-1))}return Ac(),i=uc(Error(l(421))),Ll(e,r,N,i)}return d.data==="$?"?(r.flags|=128,r.child=e.child,r=Wv.bind(null,e),d._reactRetry=r,null):(e=m.treeContext,rr=dn(d.nextSibling),tr=r,lt=!0,yr=null,e!==null&&(ir[or++]=Br,ir[or++]=Ur,ir[or++]=Wn,Br=e.id,Ur=e.overflow,Wn=r),r=gc(r,i.children),r.flags|=4096,r)}function bh(e,r,s){e.lanes|=r;var i=e.alternate;i!==null&&(i.lanes|=r),Go(e.return,r,s)}function vc(e,r,s,i,d){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:d}:(m.isBackwards=r,m.rendering=null,m.renderingStartTime=0,m.last=i,m.tail=s,m.tailMode=d)}function wh(e,r,s){var i=r.pendingProps,d=i.revealOrder,m=i.tail;if(Wt(e,r,i.children,s),i=ct.current,(i&2)!==0)i=i&1|2,r.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=r.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bh(e,s,r);else if(e.tag===19)bh(e,s,r);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break e;for(;e.sibling===null;){if(e.return===null||e.return===r)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(nt(ct,i),(r.mode&1)===0)r.memoizedState=null;else switch(d){case"forwards":for(s=r.child,d=null;s!==null;)e=s.alternate,e!==null&&Rl(e)===null&&(d=s),s=s.sibling;s=d,s===null?(d=r.child,r.child=null):(d=s.sibling,s.sibling=null),vc(r,!1,d,s,m);break;case"backwards":for(s=null,d=r.child,r.child=null;d!==null;){if(e=d.alternate,e!==null&&Rl(e)===null){r.child=d;break}e=d.sibling,d.sibling=s,s=d,d=e}vc(r,!0,s,null,m);break;case"together":vc(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Ol(e,r){(r.mode&1)===0&&e!==null&&(e.alternate=null,r.alternate=null,r.flags|=2)}function Hr(e,r,s){if(e!==null&&(r.dependencies=e.dependencies),Qn|=r.lanes,(s&r.childLanes)===0)return null;if(e!==null&&r.child!==e.child)throw Error(l(153));if(r.child!==null){for(e=r.child,s=Nn(e,e.pendingProps),r.child=s,s.return=r;e.sibling!==null;)e=e.sibling,s=s.sibling=Nn(e,e.pendingProps),s.return=r;s.sibling=null}return r.child}function Iv(e,r,s){switch(r.tag){case 3:yh(r),ks();break;case 5:Of(r);break;case 1:Qt(r.type)&&yl(r);break;case 4:Xo(r,r.stateNode.containerInfo);break;case 10:var i=r.type._context,d=r.memoizedProps.value;nt(Cl,i._currentValue),i._currentValue=d;break;case 13:if(i=r.memoizedState,i!==null)return i.dehydrated!==null?(nt(ct,ct.current&1),r.flags|=128,null):(s&r.child.childLanes)!==0?Nh(e,r,s):(nt(ct,ct.current&1),e=Hr(e,r,s),e!==null?e.sibling:null);nt(ct,ct.current&1);break;case 19:if(i=(s&r.childLanes)!==0,(e.flags&128)!==0){if(i)return wh(e,r,s);r.flags|=128}if(d=r.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),nt(ct,ct.current),i)break;return null;case 22:case 23:return r.lanes=0,xh(e,r,s)}return Hr(e,r,s)}var Sh,yc,Ch,kh;Sh=function(e,r){for(var s=r.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===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},yc=function(){},Ch=function(e,r,s,i){var d=e.memoizedProps;if(d!==i){e=r.stateNode,Yn(_r.current);var m=null;switch(s){case"input":d=ze(e,d),i=ze(e,i),m=[];break;case"select":d=z({},d,{value:void 0}),i=z({},i,{value:void 0}),m=[];break;case"textarea":d=Le(e,d),i=Le(e,i),m=[];break;default:typeof d.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=xl)}Ji(s,i);var N;s=null;for(Y in d)if(!i.hasOwnProperty(Y)&&d.hasOwnProperty(Y)&&d[Y]!=null)if(Y==="style"){var I=d[Y];for(N in I)I.hasOwnProperty(N)&&(s||(s={}),s[N]="")}else Y!=="dangerouslySetInnerHTML"&&Y!=="children"&&Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&Y!=="autoFocus"&&(c.hasOwnProperty(Y)?m||(m=[]):(m=m||[]).push(Y,null));for(Y in i){var O=i[Y];if(I=d!=null?d[Y]:void 0,i.hasOwnProperty(Y)&&O!==I&&(O!=null||I!=null))if(Y==="style")if(I){for(N in I)!I.hasOwnProperty(N)||O&&O.hasOwnProperty(N)||(s||(s={}),s[N]="");for(N in O)O.hasOwnProperty(N)&&I[N]!==O[N]&&(s||(s={}),s[N]=O[N])}else s||(m||(m=[]),m.push(Y,s)),s=O;else Y==="dangerouslySetInnerHTML"?(O=O?O.__html:void 0,I=I?I.__html:void 0,O!=null&&I!==O&&(m=m||[]).push(Y,O)):Y==="children"?typeof O!="string"&&typeof O!="number"||(m=m||[]).push(Y,""+O):Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&(c.hasOwnProperty(Y)?(O!=null&&Y==="onScroll"&&st("scroll",e),m||I===O||(m=[])):(m=m||[]).push(Y,O))}s&&(m=m||[]).push("style",s);var Y=m;(r.updateQueue=Y)&&(r.flags|=4)}},kh=function(e,r,s,i){s!==i&&(r.flags|=4)};function Ra(e,r){if(!lt)switch(e.tailMode){case"hidden":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?r||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Lt(e){var r=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(r)for(var d=e.child;d!==null;)s|=d.lanes|d.childLanes,i|=d.subtreeFlags&14680064,i|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)s|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=i,e.childLanes=s,r}function Av(e,r,s){var i=r.pendingProps;switch(Bo(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(r),null;case 1:return Qt(r.type)&&vl(),Lt(r),null;case 3:return i=r.stateNode,Ts(),at(Gt),at(Mt),ec(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(wl(r)?r.flags|=4:e===null||e.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,yr!==null&&(Tc(yr),yr=null))),yc(e,r),Lt(r),null;case 5:Jo(r);var d=Yn(Sa.current);if(s=r.type,e!==null&&r.stateNode!=null)Ch(e,r,s,i,d),e.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!i){if(r.stateNode===null)throw Error(l(166));return Lt(r),null}if(e=Yn(_r.current),wl(r)){i=r.stateNode,s=r.type;var m=r.memoizedProps;switch(i[Tr]=r,i[ya]=m,e=(r.mode&1)!==0,s){case"dialog":st("cancel",i),st("close",i);break;case"iframe":case"object":case"embed":st("load",i);break;case"video":case"audio":for(d=0;d<xa.length;d++)st(xa[d],i);break;case"source":st("error",i);break;case"img":case"image":case"link":st("error",i),st("load",i);break;case"details":st("toggle",i);break;case"input":qe(i,m),st("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!m.multiple},st("invalid",i);break;case"textarea":Ie(i,m),st("invalid",i)}Ji(s,m),d=null;for(var N in m)if(m.hasOwnProperty(N)){var I=m[N];N==="children"?typeof I=="string"?i.textContent!==I&&(m.suppressHydrationWarning!==!0&&pl(i.textContent,I,e),d=["children",I]):typeof I=="number"&&i.textContent!==""+I&&(m.suppressHydrationWarning!==!0&&pl(i.textContent,I,e),d=["children",""+I]):c.hasOwnProperty(N)&&I!=null&&N==="onScroll"&&st("scroll",i)}switch(s){case"input":ge(i),kt(i,m,!0);break;case"textarea":ge(i),rn(i);break;case"select":case"option":break;default:typeof m.onClick=="function"&&(i.onclick=xl)}i=d,r.updateQueue=i,i!==null&&(r.flags|=4)}else{N=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Pt(s)),e==="http://www.w3.org/1999/xhtml"?s==="script"?(e=N.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=N.createElement(s,{is:i.is}):(e=N.createElement(s),s==="select"&&(N=e,i.multiple?N.multiple=!0:i.size&&(N.size=i.size))):e=N.createElementNS(e,s),e[Tr]=r,e[ya]=i,Sh(e,r,!1,!1),r.stateNode=e;e:{switch(N=Zi(s,i),s){case"dialog":st("cancel",e),st("close",e),d=i;break;case"iframe":case"object":case"embed":st("load",e),d=i;break;case"video":case"audio":for(d=0;d<xa.length;d++)st(xa[d],e);d=i;break;case"source":st("error",e),d=i;break;case"img":case"image":case"link":st("error",e),st("load",e),d=i;break;case"details":st("toggle",e),d=i;break;case"input":qe(e,i),d=ze(e,i),st("invalid",e);break;case"option":d=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},d=z({},i,{value:void 0}),st("invalid",e);break;case"textarea":Ie(e,i),d=Le(e,i),st("invalid",e);break;default:d=i}Ji(s,d),I=d;for(m in I)if(I.hasOwnProperty(m)){var O=I[m];m==="style"?mu(e,O):m==="dangerouslySetInnerHTML"?(O=O?O.__html:void 0,O!=null&&Rt(e,O)):m==="children"?typeof O=="string"?(s!=="textarea"||O!=="")&&xr(e,O):typeof O=="number"&&xr(e,""+O):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(c.hasOwnProperty(m)?O!=null&&m==="onScroll"&&st("scroll",e):O!=null&&w(e,m,O,N))}switch(s){case"input":ge(e),kt(e,i,!1);break;case"textarea":ge(e),rn(e);break;case"option":i.value!=null&&e.setAttribute("value",""+ye(i.value));break;case"select":e.multiple=!!i.multiple,m=i.value,m!=null?pe(e,!!i.multiple,m,!1):i.defaultValue!=null&&pe(e,!!i.multiple,i.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=xl)}switch(s){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return Lt(r),null;case 6:if(e&&r.stateNode!=null)kh(e,r,e.memoizedProps,i);else{if(typeof i!="string"&&r.stateNode===null)throw Error(l(166));if(s=Yn(Sa.current),Yn(_r.current),wl(r)){if(i=r.stateNode,s=r.memoizedProps,i[Tr]=r,(m=i.nodeValue!==s)&&(e=tr,e!==null))switch(e.tag){case 3:pl(i.nodeValue,s,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&pl(i.nodeValue,s,(e.mode&1)!==0)}m&&(r.flags|=4)}else i=(s.nodeType===9?s:s.ownerDocument).createTextNode(i),i[Tr]=r,r.stateNode=i}return Lt(r),null;case 13:if(at(ct),i=r.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(lt&&rr!==null&&(r.mode&1)!==0&&(r.flags&128)===0)Rf(),ks(),r.flags|=98560,m=!1;else if(m=wl(r),i!==null&&i.dehydrated!==null){if(e===null){if(!m)throw Error(l(318));if(m=r.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(l(317));m[Tr]=r}else ks(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Lt(r),m=!1}else yr!==null&&(Tc(yr),yr=null),m=!0;if(!m)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=s,r):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(r.child.flags|=8192,(r.mode&1)!==0&&(e===null||(ct.current&1)!==0?yt===0&&(yt=3):Ac())),r.updateQueue!==null&&(r.flags|=4),Lt(r),null);case 4:return Ts(),yc(e,r),e===null&&ga(r.stateNode.containerInfo),Lt(r),null;case 10:return Yo(r.type._context),Lt(r),null;case 17:return Qt(r.type)&&vl(),Lt(r),null;case 19:if(at(ct),m=r.memoizedState,m===null)return Lt(r),null;if(i=(r.flags&128)!==0,N=m.rendering,N===null)if(i)Ra(m,!1);else{if(yt!==0||e!==null&&(e.flags&128)!==0)for(e=r.child;e!==null;){if(N=Rl(e),N!==null){for(r.flags|=128,Ra(m,!1),i=N.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),r.subtreeFlags=0,i=s,s=r.child;s!==null;)m=s,e=i,m.flags&=14680066,N=m.alternate,N===null?(m.childLanes=0,m.lanes=e,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=N.childLanes,m.lanes=N.lanes,m.child=N.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=N.memoizedProps,m.memoizedState=N.memoizedState,m.updateQueue=N.updateQueue,m.type=N.type,e=N.dependencies,m.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),s=s.sibling;return nt(ct,ct.current&1|2),r.child}e=e.sibling}m.tail!==null&&ht()>Ms&&(r.flags|=128,i=!0,Ra(m,!1),r.lanes=4194304)}else{if(!i)if(e=Rl(N),e!==null){if(r.flags|=128,i=!0,s=e.updateQueue,s!==null&&(r.updateQueue=s,r.flags|=4),Ra(m,!0),m.tail===null&&m.tailMode==="hidden"&&!N.alternate&&!lt)return Lt(r),null}else 2*ht()-m.renderingStartTime>Ms&&s!==1073741824&&(r.flags|=128,i=!0,Ra(m,!1),r.lanes=4194304);m.isBackwards?(N.sibling=r.child,r.child=N):(s=m.last,s!==null?s.sibling=N:r.child=N,m.last=N)}return m.tail!==null?(r=m.tail,m.rendering=r,m.tail=r.sibling,m.renderingStartTime=ht(),r.sibling=null,s=ct.current,nt(ct,i?s&1|2:s&1),r):(Lt(r),null);case 22:case 23:return Ic(),i=r.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(r.flags|=8192),i&&(r.mode&1)!==0?(nr&1073741824)!==0&&(Lt(r),r.subtreeFlags&6&&(r.flags|=8192)):Lt(r),null;case 24:return null;case 25:return null}throw Error(l(156,r.tag))}function Mv(e,r){switch(Bo(r),r.tag){case 1:return Qt(r.type)&&vl(),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 3:return Ts(),at(Gt),at(Mt),ec(),e=r.flags,(e&65536)!==0&&(e&128)===0?(r.flags=e&-65537|128,r):null;case 5:return Jo(r),null;case 13:if(at(ct),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(l(340));ks()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return at(ct),null;case 4:return Ts(),null;case 10:return Yo(r.type._context),null;case 22:case 23:return Ic(),null;case 24:return null;default:return null}}var Fl=!1,Ot=!1,Dv=typeof WeakSet=="function"?WeakSet:Set,je=null;function Is(e,r){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(i){ut(e,r,i)}else s.current=null}function jc(e,r,s){try{s()}catch(i){ut(e,r,i)}}var Eh=!1;function Lv(e,r){if(Io=sl,e=sf(),So(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var d=i.anchorOffset,m=i.focusNode;i=i.focusOffset;try{s.nodeType,m.nodeType}catch{s=null;break e}var N=0,I=-1,O=-1,Y=0,ce=0,ue=e,ie=null;t:for(;;){for(var ve;ue!==s||d!==0&&ue.nodeType!==3||(I=N+d),ue!==m||i!==0&&ue.nodeType!==3||(O=N+i),ue.nodeType===3&&(N+=ue.nodeValue.length),(ve=ue.firstChild)!==null;)ie=ue,ue=ve;for(;;){if(ue===e)break t;if(ie===s&&++Y===d&&(I=N),ie===m&&++ce===i&&(O=N),(ve=ue.nextSibling)!==null)break;ue=ie,ie=ue.parentNode}ue=ve}s=I===-1||O===-1?null:{start:I,end:O}}else s=null}s=s||{start:0,end:0}}else s=null;for(Ao={focusedElem:e,selectionRange:s},sl=!1,je=r;je!==null;)if(r=je,e=r.child,(r.subtreeFlags&1028)!==0&&e!==null)e.return=r,je=e;else for(;je!==null;){r=je;try{var be=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(be!==null){var ke=be.memoizedProps,mt=be.memoizedState,W=r.stateNode,B=W.getSnapshotBeforeUpdate(r.elementType===r.type?ke:jr(r.type,ke),mt);W.__reactInternalSnapshotBeforeUpdate=B}break;case 3:var H=r.stateNode.containerInfo;H.nodeType===1?H.textContent="":H.nodeType===9&&H.documentElement&&H.removeChild(H.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(fe){ut(r,r.return,fe)}if(e=r.sibling,e!==null){e.return=r.return,je=e;break}je=r.return}return be=Eh,Eh=!1,be}function Ta(e,r,s){var i=r.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var d=i=i.next;do{if((d.tag&e)===e){var m=d.destroy;d.destroy=void 0,m!==void 0&&jc(r,s,m)}d=d.next}while(d!==i)}}function zl(e,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.create;s.destroy=i()}s=s.next}while(s!==r)}}function Nc(e){var r=e.ref;if(r!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof r=="function"?r(e):r.current=e}}function Ph(e){var r=e.alternate;r!==null&&(e.alternate=null,Ph(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&(delete r[Tr],delete r[ya],delete r[Oo],delete r[vv],delete r[yv])),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 Rh(e){return e.tag===5||e.tag===3||e.tag===4}function Th(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rh(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 bc(e,r,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,r?s.nodeType===8?s.parentNode.insertBefore(e,r):s.insertBefore(e,r):(s.nodeType===8?(r=s.parentNode,r.insertBefore(e,s)):(r=s,r.appendChild(e)),s=s._reactRootContainer,s!=null||r.onclick!==null||(r.onclick=xl));else if(i!==4&&(e=e.child,e!==null))for(bc(e,r,s),e=e.sibling;e!==null;)bc(e,r,s),e=e.sibling}function wc(e,r,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,r?s.insertBefore(e,r):s.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(wc(e,r,s),e=e.sibling;e!==null;)wc(e,r,s),e=e.sibling}var Tt=null,Nr=!1;function xn(e,r,s){for(s=s.child;s!==null;)_h(e,r,s),s=s.sibling}function _h(e,r,s){if(Rr&&typeof Rr.onCommitFiberUnmount=="function")try{Rr.onCommitFiberUnmount(Ja,s)}catch{}switch(s.tag){case 5:Ot||Is(s,r);case 6:var i=Tt,d=Nr;Tt=null,xn(e,r,s),Tt=i,Nr=d,Tt!==null&&(Nr?(e=Tt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):Tt.removeChild(s.stateNode));break;case 18:Tt!==null&&(Nr?(e=Tt,s=s.stateNode,e.nodeType===8?Lo(e.parentNode,s):e.nodeType===1&&Lo(e,s),oa(e)):Lo(Tt,s.stateNode));break;case 4:i=Tt,d=Nr,Tt=s.stateNode.containerInfo,Nr=!0,xn(e,r,s),Tt=i,Nr=d;break;case 0:case 11:case 14:case 15:if(!Ot&&(i=s.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){d=i=i.next;do{var m=d,N=m.destroy;m=m.tag,N!==void 0&&((m&2)!==0||(m&4)!==0)&&jc(s,r,N),d=d.next}while(d!==i)}xn(e,r,s);break;case 1:if(!Ot&&(Is(s,r),i=s.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=s.memoizedProps,i.state=s.memoizedState,i.componentWillUnmount()}catch(I){ut(s,r,I)}xn(e,r,s);break;case 21:xn(e,r,s);break;case 22:s.mode&1?(Ot=(i=Ot)||s.memoizedState!==null,xn(e,r,s),Ot=i):xn(e,r,s);break;default:xn(e,r,s)}}function Ih(e){var r=e.updateQueue;if(r!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new Dv),r.forEach(function(i){var d=Hv.bind(null,e,i);s.has(i)||(s.add(i),i.then(d,d))})}}function br(e,r){var s=r.deletions;if(s!==null)for(var i=0;i<s.length;i++){var d=s[i];try{var m=e,N=r,I=N;e:for(;I!==null;){switch(I.tag){case 5:Tt=I.stateNode,Nr=!1;break e;case 3:Tt=I.stateNode.containerInfo,Nr=!0;break e;case 4:Tt=I.stateNode.containerInfo,Nr=!0;break e}I=I.return}if(Tt===null)throw Error(l(160));_h(m,N,d),Tt=null,Nr=!1;var O=d.alternate;O!==null&&(O.return=null),d.return=null}catch(Y){ut(d,r,Y)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)Ah(r,e),r=r.sibling}function Ah(e,r){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(br(r,e),Ar(e),i&4){try{Ta(3,e,e.return),zl(3,e)}catch(ke){ut(e,e.return,ke)}try{Ta(5,e,e.return)}catch(ke){ut(e,e.return,ke)}}break;case 1:br(r,e),Ar(e),i&512&&s!==null&&Is(s,s.return);break;case 5:if(br(r,e),Ar(e),i&512&&s!==null&&Is(s,s.return),e.flags&32){var d=e.stateNode;try{xr(d,"")}catch(ke){ut(e,e.return,ke)}}if(i&4&&(d=e.stateNode,d!=null)){var m=e.memoizedProps,N=s!==null?s.memoizedProps:m,I=e.type,O=e.updateQueue;if(e.updateQueue=null,O!==null)try{I==="input"&&m.type==="radio"&&m.name!=null&&rt(d,m),Zi(I,N);var Y=Zi(I,m);for(N=0;N<O.length;N+=2){var ce=O[N],ue=O[N+1];ce==="style"?mu(d,ue):ce==="dangerouslySetInnerHTML"?Rt(d,ue):ce==="children"?xr(d,ue):w(d,ce,ue,Y)}switch(I){case"input":et(d,m);break;case"textarea":At(d,m);break;case"select":var ie=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!m.multiple;var ve=m.value;ve!=null?pe(d,!!m.multiple,ve,!1):ie!==!!m.multiple&&(m.defaultValue!=null?pe(d,!!m.multiple,m.defaultValue,!0):pe(d,!!m.multiple,m.multiple?[]:"",!1))}d[ya]=m}catch(ke){ut(e,e.return,ke)}}break;case 6:if(br(r,e),Ar(e),i&4){if(e.stateNode===null)throw Error(l(162));d=e.stateNode,m=e.memoizedProps;try{d.nodeValue=m}catch(ke){ut(e,e.return,ke)}}break;case 3:if(br(r,e),Ar(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{oa(r.containerInfo)}catch(ke){ut(e,e.return,ke)}break;case 4:br(r,e),Ar(e);break;case 13:br(r,e),Ar(e),d=e.child,d.flags&8192&&(m=d.memoizedState!==null,d.stateNode.isHidden=m,!m||d.alternate!==null&&d.alternate.memoizedState!==null||(kc=ht())),i&4&&Ih(e);break;case 22:if(ce=s!==null&&s.memoizedState!==null,e.mode&1?(Ot=(Y=Ot)||ce,br(r,e),Ot=Y):br(r,e),Ar(e),i&8192){if(Y=e.memoizedState!==null,(e.stateNode.isHidden=Y)&&!ce&&(e.mode&1)!==0)for(je=e,ce=e.child;ce!==null;){for(ue=je=ce;je!==null;){switch(ie=je,ve=ie.child,ie.tag){case 0:case 11:case 14:case 15:Ta(4,ie,ie.return);break;case 1:Is(ie,ie.return);var be=ie.stateNode;if(typeof be.componentWillUnmount=="function"){i=ie,s=ie.return;try{r=i,be.props=r.memoizedProps,be.state=r.memoizedState,be.componentWillUnmount()}catch(ke){ut(i,s,ke)}}break;case 5:Is(ie,ie.return);break;case 22:if(ie.memoizedState!==null){Lh(ue);continue}}ve!==null?(ve.return=ie,je=ve):Lh(ue)}ce=ce.sibling}e:for(ce=null,ue=e;;){if(ue.tag===5){if(ce===null){ce=ue;try{d=ue.stateNode,Y?(m=d.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none"):(I=ue.stateNode,O=ue.memoizedProps.style,N=O!=null&&O.hasOwnProperty("display")?O.display:null,I.style.display=hu("display",N))}catch(ke){ut(e,e.return,ke)}}}else if(ue.tag===6){if(ce===null)try{ue.stateNode.nodeValue=Y?"":ue.memoizedProps}catch(ke){ut(e,e.return,ke)}}else if((ue.tag!==22&&ue.tag!==23||ue.memoizedState===null||ue===e)&&ue.child!==null){ue.child.return=ue,ue=ue.child;continue}if(ue===e)break e;for(;ue.sibling===null;){if(ue.return===null||ue.return===e)break e;ce===ue&&(ce=null),ue=ue.return}ce===ue&&(ce=null),ue.sibling.return=ue.return,ue=ue.sibling}}break;case 19:br(r,e),Ar(e),i&4&&Ih(e);break;case 21:break;default:br(r,e),Ar(e)}}function Ar(e){var r=e.flags;if(r&2){try{e:{for(var s=e.return;s!==null;){if(Rh(s)){var i=s;break e}s=s.return}throw Error(l(160))}switch(i.tag){case 5:var d=i.stateNode;i.flags&32&&(xr(d,""),i.flags&=-33);var m=Th(e);wc(e,m,d);break;case 3:case 4:var N=i.stateNode.containerInfo,I=Th(e);bc(e,I,N);break;default:throw Error(l(161))}}catch(O){ut(e,e.return,O)}e.flags&=-3}r&4096&&(e.flags&=-4097)}function Ov(e,r,s){je=e,Mh(e)}function Mh(e,r,s){for(var i=(e.mode&1)!==0;je!==null;){var d=je,m=d.child;if(d.tag===22&&i){var N=d.memoizedState!==null||Fl;if(!N){var I=d.alternate,O=I!==null&&I.memoizedState!==null||Ot;I=Fl;var Y=Ot;if(Fl=N,(Ot=O)&&!Y)for(je=d;je!==null;)N=je,O=N.child,N.tag===22&&N.memoizedState!==null?Oh(d):O!==null?(O.return=N,je=O):Oh(d);for(;m!==null;)je=m,Mh(m),m=m.sibling;je=d,Fl=I,Ot=Y}Dh(e)}else(d.subtreeFlags&8772)!==0&&m!==null?(m.return=d,je=m):Dh(e)}}function Dh(e){for(;je!==null;){var r=je;if((r.flags&8772)!==0){var s=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:Ot||zl(5,r);break;case 1:var i=r.stateNode;if(r.flags&4&&!Ot)if(s===null)i.componentDidMount();else{var d=r.elementType===r.type?s.memoizedProps:jr(r.type,s.memoizedProps);i.componentDidUpdate(d,s.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var m=r.updateQueue;m!==null&&Lf(r,m,i);break;case 3:var N=r.updateQueue;if(N!==null){if(s=null,r.child!==null)switch(r.child.tag){case 5:s=r.child.stateNode;break;case 1:s=r.child.stateNode}Lf(r,N,s)}break;case 5:var I=r.stateNode;if(s===null&&r.flags&4){s=I;var O=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":O.autoFocus&&s.focus();break;case"img":O.src&&(s.src=O.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var Y=r.alternate;if(Y!==null){var ce=Y.memoizedState;if(ce!==null){var ue=ce.dehydrated;ue!==null&&oa(ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}Ot||r.flags&512&&Nc(r)}catch(ie){ut(r,r.return,ie)}}if(r===e){je=null;break}if(s=r.sibling,s!==null){s.return=r.return,je=s;break}je=r.return}}function Lh(e){for(;je!==null;){var r=je;if(r===e){je=null;break}var s=r.sibling;if(s!==null){s.return=r.return,je=s;break}je=r.return}}function Oh(e){for(;je!==null;){var r=je;try{switch(r.tag){case 0:case 11:case 15:var s=r.return;try{zl(4,r)}catch(O){ut(r,s,O)}break;case 1:var i=r.stateNode;if(typeof i.componentDidMount=="function"){var d=r.return;try{i.componentDidMount()}catch(O){ut(r,d,O)}}var m=r.return;try{Nc(r)}catch(O){ut(r,m,O)}break;case 5:var N=r.return;try{Nc(r)}catch(O){ut(r,N,O)}}}catch(O){ut(r,r.return,O)}if(r===e){je=null;break}var I=r.sibling;if(I!==null){I.return=r.return,je=I;break}je=r.return}}var Fv=Math.ceil,$l=M.ReactCurrentDispatcher,Sc=M.ReactCurrentOwner,ur=M.ReactCurrentBatchConfig,Ye=0,bt=null,xt=null,_t=0,nr=0,As=un(0),yt=0,_a=null,Qn=0,Bl=0,Cc=0,Ia=null,Xt=null,kc=0,Ms=1/0,Kr=null,Ul=!1,Ec=null,gn=null,Vl=!1,vn=null,Wl=0,Aa=0,Pc=null,Hl=-1,Kl=0;function Ht(){return(Ye&6)!==0?ht():Hl!==-1?Hl:Hl=ht()}function yn(e){return(e.mode&1)===0?1:(Ye&2)!==0&&_t!==0?_t&-_t:Nv.transition!==null?(Kl===0&&(Kl=Ru()),Kl):(e=Ze,e!==0||(e=window.event,e=e===void 0?16:Fu(e.type)),e)}function wr(e,r,s,i){if(50<Aa)throw Aa=0,Pc=null,Error(l(185));na(e,s,i),((Ye&2)===0||e!==bt)&&(e===bt&&((Ye&2)===0&&(Bl|=s),yt===4&&jn(e,_t)),Jt(e,i),s===1&&Ye===0&&(r.mode&1)===0&&(Ms=ht()+500,jl&&hn()))}function Jt(e,r){var s=e.callbackNode;N0(e,r);var i=tl(e,e===bt?_t:0);if(i===0)s!==null&&ku(s),e.callbackNode=null,e.callbackPriority=0;else if(r=i&-i,e.callbackPriority!==r){if(s!=null&&ku(s),r===1)e.tag===0?jv(zh.bind(null,e)):Sf(zh.bind(null,e)),xv(function(){(Ye&6)===0&&hn()}),s=null;else{switch(Tu(i)){case 1:s=lo;break;case 4:s=Eu;break;case 16:s=Xa;break;case 536870912:s=Pu;break;default:s=Xa}s=Yh(s,Fh.bind(null,e))}e.callbackPriority=r,e.callbackNode=s}}function Fh(e,r){if(Hl=-1,Kl=0,(Ye&6)!==0)throw Error(l(327));var s=e.callbackNode;if(Ds()&&e.callbackNode!==s)return null;var i=tl(e,e===bt?_t:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||r)r=Yl(e,i);else{r=i;var d=Ye;Ye|=2;var m=Bh();(bt!==e||_t!==r)&&(Kr=null,Ms=ht()+500,Xn(e,r));do try{Bv();break}catch(I){$h(e,I)}while(!0);Ko(),$l.current=m,Ye=d,xt!==null?r=0:(bt=null,_t=0,r=yt)}if(r!==0){if(r===2&&(d=io(e),d!==0&&(i=d,r=Rc(e,d))),r===1)throw s=_a,Xn(e,0),jn(e,i),Jt(e,ht()),s;if(r===6)jn(e,i);else{if(d=e.current.alternate,(i&30)===0&&!zv(d)&&(r=Yl(e,i),r===2&&(m=io(e),m!==0&&(i=m,r=Rc(e,m))),r===1))throw s=_a,Xn(e,0),jn(e,i),Jt(e,ht()),s;switch(e.finishedWork=d,e.finishedLanes=i,r){case 0:case 1:throw Error(l(345));case 2:Jn(e,Xt,Kr);break;case 3:if(jn(e,i),(i&130023424)===i&&(r=kc+500-ht(),10<r)){if(tl(e,0)!==0)break;if(d=e.suspendedLanes,(d&i)!==i){Ht(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Do(Jn.bind(null,e,Xt,Kr),r);break}Jn(e,Xt,Kr);break;case 4:if(jn(e,i),(i&4194240)===i)break;for(r=e.eventTimes,d=-1;0<i;){var N=31-gr(i);m=1<<N,N=r[N],N>d&&(d=N),i&=~m}if(i=d,i=ht()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Fv(i/1960))-i,10<i){e.timeoutHandle=Do(Jn.bind(null,e,Xt,Kr),i);break}Jn(e,Xt,Kr);break;case 5:Jn(e,Xt,Kr);break;default:throw Error(l(329))}}}return Jt(e,ht()),e.callbackNode===s?Fh.bind(null,e):null}function Rc(e,r){var s=Ia;return e.current.memoizedState.isDehydrated&&(Xn(e,r).flags|=256),e=Yl(e,r),e!==2&&(r=Xt,Xt=s,r!==null&&Tc(r)),e}function Tc(e){Xt===null?Xt=e:Xt.push.apply(Xt,e)}function zv(e){for(var r=e;;){if(r.flags&16384){var s=r.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var i=0;i<s.length;i++){var d=s[i],m=d.getSnapshot;d=d.value;try{if(!vr(m(),d))return!1}catch{return!1}}}if(s=r.child,r.subtreeFlags&16384&&s!==null)s.return=r,r=s;else{if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function jn(e,r){for(r&=~Cc,r&=~Bl,e.suspendedLanes|=r,e.pingedLanes&=~r,e=e.expirationTimes;0<r;){var s=31-gr(r),i=1<<s;e[s]=-1,r&=~i}}function zh(e){if((Ye&6)!==0)throw Error(l(327));Ds();var r=tl(e,0);if((r&1)===0)return Jt(e,ht()),null;var s=Yl(e,r);if(e.tag!==0&&s===2){var i=io(e);i!==0&&(r=i,s=Rc(e,i))}if(s===1)throw s=_a,Xn(e,0),jn(e,r),Jt(e,ht()),s;if(s===6)throw Error(l(345));return e.finishedWork=e.current.alternate,e.finishedLanes=r,Jn(e,Xt,Kr),Jt(e,ht()),null}function _c(e,r){var s=Ye;Ye|=1;try{return e(r)}finally{Ye=s,Ye===0&&(Ms=ht()+500,jl&&hn())}}function qn(e){vn!==null&&vn.tag===0&&(Ye&6)===0&&Ds();var r=Ye;Ye|=1;var s=ur.transition,i=Ze;try{if(ur.transition=null,Ze=1,e)return e()}finally{Ze=i,ur.transition=s,Ye=r,(Ye&6)===0&&hn()}}function Ic(){nr=As.current,at(As)}function Xn(e,r){e.finishedWork=null,e.finishedLanes=0;var s=e.timeoutHandle;if(s!==-1&&(e.timeoutHandle=-1,pv(s)),xt!==null)for(s=xt.return;s!==null;){var i=s;switch(Bo(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&vl();break;case 3:Ts(),at(Gt),at(Mt),ec();break;case 5:Jo(i);break;case 4:Ts();break;case 13:at(ct);break;case 19:at(ct);break;case 10:Yo(i.type._context);break;case 22:case 23:Ic()}s=s.return}if(bt=e,xt=e=Nn(e.current,null),_t=nr=r,yt=0,_a=null,Cc=Bl=Qn=0,Xt=Ia=null,Kn!==null){for(r=0;r<Kn.length;r++)if(s=Kn[r],i=s.interleaved,i!==null){s.interleaved=null;var d=i.next,m=s.pending;if(m!==null){var N=m.next;m.next=d,i.next=N}s.pending=i}Kn=null}return e}function $h(e,r){do{var s=xt;try{if(Ko(),Tl.current=Ml,_l){for(var i=dt.memoizedState;i!==null;){var d=i.queue;d!==null&&(d.pending=null),i=i.next}_l=!1}if(Gn=0,Nt=vt=dt=null,Ca=!1,ka=0,Sc.current=null,s===null||s.return===null){yt=1,_a=r,xt=null;break}e:{var m=e,N=s.return,I=s,O=r;if(r=_t,I.flags|=32768,O!==null&&typeof O=="object"&&typeof O.then=="function"){var Y=O,ce=I,ue=ce.tag;if((ce.mode&1)===0&&(ue===0||ue===11||ue===15)){var ie=ce.alternate;ie?(ce.updateQueue=ie.updateQueue,ce.memoizedState=ie.memoizedState,ce.lanes=ie.lanes):(ce.updateQueue=null,ce.memoizedState=null)}var ve=uh(N);if(ve!==null){ve.flags&=-257,fh(ve,N,I,m,r),ve.mode&1&&dh(m,Y,r),r=ve,O=Y;var be=r.updateQueue;if(be===null){var ke=new Set;ke.add(O),r.updateQueue=ke}else be.add(O);break e}else{if((r&1)===0){dh(m,Y,r),Ac();break e}O=Error(l(426))}}else if(lt&&I.mode&1){var mt=uh(N);if(mt!==null){(mt.flags&65536)===0&&(mt.flags|=256),fh(mt,N,I,m,r),Wo(_s(O,I));break e}}m=O=_s(O,I),yt!==4&&(yt=2),Ia===null?Ia=[m]:Ia.push(m),m=N;do{switch(m.tag){case 3:m.flags|=65536,r&=-r,m.lanes|=r;var W=oh(m,O,r);Df(m,W);break e;case 1:I=O;var B=m.type,H=m.stateNode;if((m.flags&128)===0&&(typeof B.getDerivedStateFromError=="function"||H!==null&&typeof H.componentDidCatch=="function"&&(gn===null||!gn.has(H)))){m.flags|=65536,r&=-r,m.lanes|=r;var fe=ch(m,I,r);Df(m,fe);break e}}m=m.return}while(m!==null)}Vh(s)}catch(Ee){r=Ee,xt===s&&s!==null&&(xt=s=s.return);continue}break}while(!0)}function Bh(){var e=$l.current;return $l.current=Ml,e===null?Ml:e}function Ac(){(yt===0||yt===3||yt===2)&&(yt=4),bt===null||(Qn&268435455)===0&&(Bl&268435455)===0||jn(bt,_t)}function Yl(e,r){var s=Ye;Ye|=2;var i=Bh();(bt!==e||_t!==r)&&(Kr=null,Xn(e,r));do try{$v();break}catch(d){$h(e,d)}while(!0);if(Ko(),Ye=s,$l.current=i,xt!==null)throw Error(l(261));return bt=null,_t=0,yt}function $v(){for(;xt!==null;)Uh(xt)}function Bv(){for(;xt!==null&&!f0();)Uh(xt)}function Uh(e){var r=Kh(e.alternate,e,nr);e.memoizedProps=e.pendingProps,r===null?Vh(e):xt=r,Sc.current=null}function Vh(e){var r=e;do{var s=r.alternate;if(e=r.return,(r.flags&32768)===0){if(s=Av(s,r,nr),s!==null){xt=s;return}}else{if(s=Mv(s,r),s!==null){s.flags&=32767,xt=s;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{yt=6,xt=null;return}}if(r=r.sibling,r!==null){xt=r;return}xt=r=e}while(r!==null);yt===0&&(yt=5)}function Jn(e,r,s){var i=Ze,d=ur.transition;try{ur.transition=null,Ze=1,Uv(e,r,s,i)}finally{ur.transition=d,Ze=i}return null}function Uv(e,r,s,i){do Ds();while(vn!==null);if((Ye&6)!==0)throw Error(l(327));s=e.finishedWork;var d=e.finishedLanes;if(s===null)return null;if(e.finishedWork=null,e.finishedLanes=0,s===e.current)throw Error(l(177));e.callbackNode=null,e.callbackPriority=0;var m=s.lanes|s.childLanes;if(b0(e,m),e===bt&&(xt=bt=null,_t=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||Vl||(Vl=!0,Yh(Xa,function(){return Ds(),null})),m=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||m){m=ur.transition,ur.transition=null;var N=Ze;Ze=1;var I=Ye;Ye|=4,Sc.current=null,Lv(e,s),Ah(s,e),ov(Ao),sl=!!Io,Ao=Io=null,e.current=s,Ov(s),h0(),Ye=I,Ze=N,ur.transition=m}else e.current=s;if(Vl&&(Vl=!1,vn=e,Wl=d),m=e.pendingLanes,m===0&&(gn=null),x0(s.stateNode),Jt(e,ht()),r!==null)for(i=e.onRecoverableError,s=0;s<r.length;s++)d=r[s],i(d.value,{componentStack:d.stack,digest:d.digest});if(Ul)throw Ul=!1,e=Ec,Ec=null,e;return(Wl&1)!==0&&e.tag!==0&&Ds(),m=e.pendingLanes,(m&1)!==0?e===Pc?Aa++:(Aa=0,Pc=e):Aa=0,hn(),null}function Ds(){if(vn!==null){var e=Tu(Wl),r=ur.transition,s=Ze;try{if(ur.transition=null,Ze=16>e?16:e,vn===null)var i=!1;else{if(e=vn,vn=null,Wl=0,(Ye&6)!==0)throw Error(l(331));var d=Ye;for(Ye|=4,je=e.current;je!==null;){var m=je,N=m.child;if((je.flags&16)!==0){var I=m.deletions;if(I!==null){for(var O=0;O<I.length;O++){var Y=I[O];for(je=Y;je!==null;){var ce=je;switch(ce.tag){case 0:case 11:case 15:Ta(8,ce,m)}var ue=ce.child;if(ue!==null)ue.return=ce,je=ue;else for(;je!==null;){ce=je;var ie=ce.sibling,ve=ce.return;if(Ph(ce),ce===Y){je=null;break}if(ie!==null){ie.return=ve,je=ie;break}je=ve}}}var be=m.alternate;if(be!==null){var ke=be.child;if(ke!==null){be.child=null;do{var mt=ke.sibling;ke.sibling=null,ke=mt}while(ke!==null)}}je=m}}if((m.subtreeFlags&2064)!==0&&N!==null)N.return=m,je=N;else e:for(;je!==null;){if(m=je,(m.flags&2048)!==0)switch(m.tag){case 0:case 11:case 15:Ta(9,m,m.return)}var W=m.sibling;if(W!==null){W.return=m.return,je=W;break e}je=m.return}}var B=e.current;for(je=B;je!==null;){N=je;var H=N.child;if((N.subtreeFlags&2064)!==0&&H!==null)H.return=N,je=H;else e:for(N=B;je!==null;){if(I=je,(I.flags&2048)!==0)try{switch(I.tag){case 0:case 11:case 15:zl(9,I)}}catch(Ee){ut(I,I.return,Ee)}if(I===N){je=null;break e}var fe=I.sibling;if(fe!==null){fe.return=I.return,je=fe;break e}je=I.return}}if(Ye=d,hn(),Rr&&typeof Rr.onPostCommitFiberRoot=="function")try{Rr.onPostCommitFiberRoot(Ja,e)}catch{}i=!0}return i}finally{Ze=s,ur.transition=r}}return!1}function Wh(e,r,s){r=_s(s,r),r=oh(e,r,1),e=pn(e,r,1),r=Ht(),e!==null&&(na(e,1,r),Jt(e,r))}function ut(e,r,s){if(e.tag===3)Wh(e,e,s);else for(;r!==null;){if(r.tag===3){Wh(r,e,s);break}else if(r.tag===1){var i=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(gn===null||!gn.has(i))){e=_s(s,e),e=ch(r,e,1),r=pn(r,e,1),e=Ht(),r!==null&&(na(r,1,e),Jt(r,e));break}}r=r.return}}function Vv(e,r,s){var i=e.pingCache;i!==null&&i.delete(r),r=Ht(),e.pingedLanes|=e.suspendedLanes&s,bt===e&&(_t&s)===s&&(yt===4||yt===3&&(_t&130023424)===_t&&500>ht()-kc?Xn(e,0):Cc|=s),Jt(e,r)}function Hh(e,r){r===0&&((e.mode&1)===0?r=1:(r=el,el<<=1,(el&130023424)===0&&(el=4194304)));var s=Ht();e=Vr(e,r),e!==null&&(na(e,r,s),Jt(e,s))}function Wv(e){var r=e.memoizedState,s=0;r!==null&&(s=r.retryLane),Hh(e,s)}function Hv(e,r){var s=0;switch(e.tag){case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(l(314))}i!==null&&i.delete(r),Hh(e,s)}var Kh;Kh=function(e,r,s){if(e!==null)if(e.memoizedProps!==r.pendingProps||Gt.current)qt=!0;else{if((e.lanes&s)===0&&(r.flags&128)===0)return qt=!1,Iv(e,r,s);qt=(e.flags&131072)!==0}else qt=!1,lt&&(r.flags&1048576)!==0&&Cf(r,bl,r.index);switch(r.lanes=0,r.tag){case 2:var i=r.type;Ol(e,r),e=r.pendingProps;var d=ws(r,Mt.current);Rs(r,s),d=nc(null,r,i,e,d,s);var m=sc();return r.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Qt(i)?(m=!0,yl(r)):m=!1,r.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,qo(r),d.updater=Dl,r.stateNode=d,d._reactInternals=r,dc(r,i,e,s),r=mc(null,r,i,!0,m,s)):(r.tag=0,lt&&m&&$o(r),Wt(null,r,d,s),r=r.child),r;case 16:i=r.elementType;e:{switch(Ol(e,r),e=r.pendingProps,d=i._init,i=d(i._payload),r.type=i,d=r.tag=Yv(i),e=jr(i,e),d){case 0:r=hc(null,r,i,e,s);break e;case 1:r=vh(null,r,i,e,s);break e;case 11:r=hh(null,r,i,e,s);break e;case 14:r=mh(null,r,i,jr(i.type,e),s);break e}throw Error(l(306,i,""))}return r;case 0:return i=r.type,d=r.pendingProps,d=r.elementType===i?d:jr(i,d),hc(e,r,i,d,s);case 1:return i=r.type,d=r.pendingProps,d=r.elementType===i?d:jr(i,d),vh(e,r,i,d,s);case 3:e:{if(yh(r),e===null)throw Error(l(387));i=r.pendingProps,m=r.memoizedState,d=m.element,Mf(e,r),Pl(r,i,null,s);var N=r.memoizedState;if(i=N.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){d=_s(Error(l(423)),r),r=jh(e,r,i,s,d);break e}else if(i!==d){d=_s(Error(l(424)),r),r=jh(e,r,i,s,d);break e}else for(rr=dn(r.stateNode.containerInfo.firstChild),tr=r,lt=!0,yr=null,s=If(r,null,i,s),r.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ks(),i===d){r=Hr(e,r,s);break e}Wt(e,r,i,s)}r=r.child}return r;case 5:return Of(r),e===null&&Vo(r),i=r.type,d=r.pendingProps,m=e!==null?e.memoizedProps:null,N=d.children,Mo(i,d)?N=null:m!==null&&Mo(i,m)&&(r.flags|=32),gh(e,r),Wt(e,r,N,s),r.child;case 6:return e===null&&Vo(r),null;case 13:return Nh(e,r,s);case 4:return Xo(r,r.stateNode.containerInfo),i=r.pendingProps,e===null?r.child=Es(r,null,i,s):Wt(e,r,i,s),r.child;case 11:return i=r.type,d=r.pendingProps,d=r.elementType===i?d:jr(i,d),hh(e,r,i,d,s);case 7:return Wt(e,r,r.pendingProps,s),r.child;case 8:return Wt(e,r,r.pendingProps.children,s),r.child;case 12:return Wt(e,r,r.pendingProps.children,s),r.child;case 10:e:{if(i=r.type._context,d=r.pendingProps,m=r.memoizedProps,N=d.value,nt(Cl,i._currentValue),i._currentValue=N,m!==null)if(vr(m.value,N)){if(m.children===d.children&&!Gt.current){r=Hr(e,r,s);break e}}else for(m=r.child,m!==null&&(m.return=r);m!==null;){var I=m.dependencies;if(I!==null){N=m.child;for(var O=I.firstContext;O!==null;){if(O.context===i){if(m.tag===1){O=Wr(-1,s&-s),O.tag=2;var Y=m.updateQueue;if(Y!==null){Y=Y.shared;var ce=Y.pending;ce===null?O.next=O:(O.next=ce.next,ce.next=O),Y.pending=O}}m.lanes|=s,O=m.alternate,O!==null&&(O.lanes|=s),Go(m.return,s,r),I.lanes|=s;break}O=O.next}}else if(m.tag===10)N=m.type===r.type?null:m.child;else if(m.tag===18){if(N=m.return,N===null)throw Error(l(341));N.lanes|=s,I=N.alternate,I!==null&&(I.lanes|=s),Go(N,s,r),N=m.sibling}else N=m.child;if(N!==null)N.return=m;else for(N=m;N!==null;){if(N===r){N=null;break}if(m=N.sibling,m!==null){m.return=N.return,N=m;break}N=N.return}m=N}Wt(e,r,d.children,s),r=r.child}return r;case 9:return d=r.type,i=r.pendingProps.children,Rs(r,s),d=cr(d),i=i(d),r.flags|=1,Wt(e,r,i,s),r.child;case 14:return i=r.type,d=jr(i,r.pendingProps),d=jr(i.type,d),mh(e,r,i,d,s);case 15:return ph(e,r,r.type,r.pendingProps,s);case 17:return i=r.type,d=r.pendingProps,d=r.elementType===i?d:jr(i,d),Ol(e,r),r.tag=1,Qt(i)?(e=!0,yl(r)):e=!1,Rs(r,s),lh(r,i,d),dc(r,i,d,s),mc(null,r,i,!0,e,s);case 19:return wh(e,r,s);case 22:return xh(e,r,s)}throw Error(l(156,r.tag))};function Yh(e,r){return Cu(e,r)}function Kv(e,r,s,i){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=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fr(e,r,s,i){return new Kv(e,r,s,i)}function Mc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yv(e){if(typeof e=="function")return Mc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===oe)return 11;if(e===le)return 14}return 2}function Nn(e,r){var s=e.alternate;return s===null?(s=fr(e.tag,r,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=r,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,r=e.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function Gl(e,r,s,i,d,m){var N=2;if(i=e,typeof e=="function")Mc(e)&&(N=1);else if(typeof e=="string")N=5;else e:switch(e){case k:return Zn(s.children,d,m,r);case T:N=8,d|=8;break;case U:return e=fr(12,s,r,d|2),e.elementType=U,e.lanes=m,e;case he:return e=fr(13,s,r,d),e.elementType=he,e.lanes=m,e;case ne:return e=fr(19,s,r,d),e.elementType=ne,e.lanes=m,e;case $:return Ql(s,d,m,r);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q:N=10;break e;case te:N=9;break e;case oe:N=11;break e;case le:N=14;break e;case Z:N=16,i=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return r=fr(N,s,r,d),r.elementType=e,r.type=i,r.lanes=m,r}function Zn(e,r,s,i){return e=fr(7,e,i,r),e.lanes=s,e}function Ql(e,r,s,i){return e=fr(22,e,i,r),e.elementType=$,e.lanes=s,e.stateNode={isHidden:!1},e}function Dc(e,r,s){return e=fr(6,e,null,r),e.lanes=s,e}function Lc(e,r,s){return r=fr(4,e.children!==null?e.children:[],e.key,r),r.lanes=s,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}function Gv(e,r,s,i,d){this.tag=r,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=oo(0),this.expirationTimes=oo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oo(0),this.identifierPrefix=i,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Oc(e,r,s,i,d,m,N,I,O){return e=new Gv(e,r,s,I,O),r===1?(r=1,m===!0&&(r|=8)):r=0,m=fr(3,null,null,r),e.current=m,m.stateNode=e,m.memoizedState={element:i,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},qo(m),e}function Qv(e,r,s){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:V,key:i==null?null:""+i,children:e,containerInfo:r,implementation:s}}function Gh(e){if(!e)return fn;e=e._reactInternals;e:{if(Bn(e)!==e||e.tag!==1)throw Error(l(170));var r=e;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(Qt(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(l(171))}if(e.tag===1){var s=e.type;if(Qt(s))return bf(e,s,r)}return r}function Qh(e,r,s,i,d,m,N,I,O){return e=Oc(s,i,!0,e,d,m,N,I,O),e.context=Gh(null),s=e.current,i=Ht(),d=yn(s),m=Wr(i,d),m.callback=r??null,pn(s,m,d),e.current.lanes=d,na(e,d,i),Jt(e,i),e}function ql(e,r,s,i){var d=r.current,m=Ht(),N=yn(d);return s=Gh(s),r.context===null?r.context=s:r.pendingContext=s,r=Wr(m,N),r.payload={element:e},i=i===void 0?null:i,i!==null&&(r.callback=i),e=pn(d,r,N),e!==null&&(wr(e,d,N,m),El(e,d,N)),N}function Xl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function qh(e,r){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<r?s:r}}function Fc(e,r){qh(e,r),(e=e.alternate)&&qh(e,r)}function qv(){return null}var Xh=typeof reportError=="function"?reportError:function(e){console.error(e)};function zc(e){this._internalRoot=e}Jl.prototype.render=zc.prototype.render=function(e){var r=this._internalRoot;if(r===null)throw Error(l(409));ql(e,r,null,null)},Jl.prototype.unmount=zc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var r=e.containerInfo;qn(function(){ql(null,e,null,null)}),r[zr]=null}};function Jl(e){this._internalRoot=e}Jl.prototype.unstable_scheduleHydration=function(e){if(e){var r=Au();e={blockedOn:null,target:e,priority:r};for(var s=0;s<ln.length&&r!==0&&r<ln[s].priority;s++);ln.splice(s,0,e),s===0&&Lu(e)}};function $c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Zl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Jh(){}function Xv(e,r,s,i,d){if(d){if(typeof i=="function"){var m=i;i=function(){var Y=Xl(N);m.call(Y)}}var N=Qh(r,i,e,0,null,!1,!1,"",Jh);return e._reactRootContainer=N,e[zr]=N.current,ga(e.nodeType===8?e.parentNode:e),qn(),N}for(;d=e.lastChild;)e.removeChild(d);if(typeof i=="function"){var I=i;i=function(){var Y=Xl(O);I.call(Y)}}var O=Oc(e,0,!1,null,null,!1,!1,"",Jh);return e._reactRootContainer=O,e[zr]=O.current,ga(e.nodeType===8?e.parentNode:e),qn(function(){ql(r,O,s,i)}),O}function ei(e,r,s,i,d){var m=s._reactRootContainer;if(m){var N=m;if(typeof d=="function"){var I=d;d=function(){var O=Xl(N);I.call(O)}}ql(r,N,e,d)}else N=Xv(s,r,e,d,i);return Xl(N)}_u=function(e){switch(e.tag){case 3:var r=e.stateNode;if(r.current.memoizedState.isDehydrated){var s=ra(r.pendingLanes);s!==0&&(co(r,s|1),Jt(r,ht()),(Ye&6)===0&&(Ms=ht()+500,hn()))}break;case 13:qn(function(){var i=Vr(e,1);if(i!==null){var d=Ht();wr(i,e,1,d)}}),Fc(e,1)}},uo=function(e){if(e.tag===13){var r=Vr(e,134217728);if(r!==null){var s=Ht();wr(r,e,134217728,s)}Fc(e,134217728)}},Iu=function(e){if(e.tag===13){var r=yn(e),s=Vr(e,r);if(s!==null){var i=Ht();wr(s,e,r,i)}Fc(e,r)}},Au=function(){return Ze},Mu=function(e,r){var s=Ze;try{return Ze=e,r()}finally{Ze=s}},ro=function(e,r,s){switch(r){case"input":if(et(e,s),r=s.name,s.type==="radio"&&r!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<s.length;r++){var i=s[r];if(i!==e&&i.form===e.form){var d=gl(i);if(!d)throw Error(l(90));_e(i),et(i,d)}}}break;case"textarea":At(e,s);break;case"select":r=s.value,r!=null&&pe(e,!!s.multiple,r,!1)}},vu=_c,yu=qn;var Jv={usingClientEntryPoint:!1,Events:[ja,Ns,gl,xu,gu,_c]},Ma={findFiberByHostInstance:Un,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Zv={bundleType:Ma.bundleType,version:Ma.version,rendererPackageName:Ma.rendererPackageName,rendererConfig:Ma.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:M.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=wu(e),e===null?null:e.stateNode},findFiberByHostInstance:Ma.findFiberByHostInstance||qv,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ti=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ti.isDisabled&&ti.supportsFiber)try{Ja=ti.inject(Zv),Rr=ti}catch{}}return Zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jv,Zt.createPortal=function(e,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$c(r))throw Error(l(200));return Qv(e,r,null,s)},Zt.createRoot=function(e,r){if(!$c(e))throw Error(l(299));var s=!1,i="",d=Xh;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(d=r.onRecoverableError)),r=Oc(e,1,!1,null,null,s,!1,i,d),e[zr]=r.current,ga(e.nodeType===8?e.parentNode:e),new zc(r)},Zt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var r=e._reactInternals;if(r===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=wu(r),e=e===null?null:e.stateNode,e},Zt.flushSync=function(e){return qn(e)},Zt.hydrate=function(e,r,s){if(!Zl(r))throw Error(l(200));return ei(null,e,r,!0,s)},Zt.hydrateRoot=function(e,r,s){if(!$c(e))throw Error(l(405));var i=s!=null&&s.hydratedSources||null,d=!1,m="",N=Xh;if(s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onRecoverableError!==void 0&&(N=s.onRecoverableError)),r=Qh(r,null,e,1,s??null,d,!1,m,N),e[zr]=r.current,ga(e),i)for(e=0;e<i.length;e++)s=i[e],d=s._getVersion,d=d(s._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[s,d]:r.mutableSourceEagerHydrationData.push(s,d);return new Jl(r)},Zt.render=function(e,r,s){if(!Zl(r))throw Error(l(200));return ei(null,e,r,!1,s)},Zt.unmountComponentAtNode=function(e){if(!Zl(e))throw Error(l(40));return e._reactRootContainer?(qn(function(){ei(null,null,e,!1,function(){e._reactRootContainer=null,e[zr]=null})}),!0):!1},Zt.unstable_batchedUpdates=_c,Zt.unstable_renderSubtreeIntoContainer=function(e,r,s,i){if(!Zl(s))throw Error(l(200));if(e==null||e._reactInternals===void 0)throw Error(l(38));return ei(e,r,s,!1,i)},Zt.version="18.3.1-next-f1338f8080-20240426",Zt}var lm;function dp(){if(lm)return Vc.exports;lm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Vc.exports=iy(),Vc.exports}var im;function oy(){if(im)return ri;im=1;var n=dp();return ri.createRoot=n.createRoot,ri.hydrateRoot=n.hydrateRoot,ri}var cy=oy(),Wa=dp();const dy=cp(Wa);/**
|
||
* @remix-run/router v1.23.2
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function Fa(){return Fa=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(n[o]=l[o])}return n},Fa.apply(this,arguments)}var Rn;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(Rn||(Rn={}));const om="popstate";function uy(n){n===void 0&&(n={});function a(o,c){let{pathname:u,search:f,hash:p}=o.location;return dd("",{pathname:u,search:f,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function l(o,c){return typeof c=="string"?c:yi(c)}return hy(a,l,null,n)}function pt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Md(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function fy(){return Math.random().toString(36).substr(2,8)}function cm(n,a){return{usr:n.state,key:n.key,idx:a}}function dd(n,a,l,o){return l===void 0&&(l=null),Fa({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof a=="string"?Hs(a):a,{state:l,key:a&&a.key||o||fy()})}function yi(n){let{pathname:a="/",search:l="",hash:o=""}=n;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function Hs(n){let a={};if(n){let l=n.indexOf("#");l>=0&&(a.hash=n.substr(l),n=n.substr(0,l));let o=n.indexOf("?");o>=0&&(a.search=n.substr(o),n=n.substr(0,o)),n&&(a.pathname=n)}return a}function hy(n,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:u=!1}=o,f=c.history,p=Rn.Pop,x=null,g=v();g==null&&(g=0,f.replaceState(Fa({},f.state,{idx:g}),""));function v(){return(f.state||{idx:null}).idx}function y(){p=Rn.Pop;let b=v(),S=b==null?null:b-g;g=b,x&&x({action:p,location:j.location,delta:S})}function P(b,S){p=Rn.Push;let E=dd(j.location,b,S);g=v()+1;let w=cm(E,g),M=j.createHref(E);try{f.pushState(w,"",M)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;c.location.assign(M)}u&&x&&x({action:p,location:j.location,delta:1})}function R(b,S){p=Rn.Replace;let E=dd(j.location,b,S);g=v();let w=cm(E,g),M=j.createHref(E);f.replaceState(w,"",M),u&&x&&x({action:p,location:j.location,delta:0})}function C(b){let S=c.location.origin!=="null"?c.location.origin:c.location.href,E=typeof b=="string"?b:yi(b);return E=E.replace(/ $/,"%20"),pt(S,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,S)}let j={get action(){return p},get location(){return n(c,f)},listen(b){if(x)throw new Error("A history only accepts one active listener");return c.addEventListener(om,y),x=b,()=>{c.removeEventListener(om,y),x=null}},createHref(b){return a(c,b)},createURL:C,encodeLocation(b){let S=C(b);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:P,replace:R,go(b){return f.go(b)}};return j}var dm;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(dm||(dm={}));function my(n,a,l){return l===void 0&&(l="/"),py(n,a,l)}function py(n,a,l,o){let c=typeof a=="string"?Hs(a):a,u=Dd(c.pathname||"/",l);if(u==null)return null;let f=up(n);xy(f);let p=null;for(let x=0;p==null&&x<f.length;++x){let g=Py(u);p=Cy(f[x],g)}return p}function up(n,a,l,o){a===void 0&&(a=[]),l===void 0&&(l=[]),o===void 0&&(o="");let c=(u,f,p)=>{let x={relativePath:p===void 0?u.path||"":p,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};x.relativePath.startsWith("/")&&(pt(x.relativePath.startsWith(o),'Absolute route path "'+x.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),x.relativePath=x.relativePath.slice(o.length));let g=Tn([o,x.relativePath]),v=l.concat(x);u.children&&u.children.length>0&&(pt(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),up(u.children,a,v,g)),!(u.path==null&&!u.index)&&a.push({path:g,score:wy(g,u.index),routesMeta:v})};return n.forEach((u,f)=>{var p;if(u.path===""||!((p=u.path)!=null&&p.includes("?")))c(u,f);else for(let x of fp(u.path))c(u,f,x)}),a}function fp(n){let a=n.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let f=fp(o.join("/")),p=[];return p.push(...f.map(x=>x===""?u:[u,x].join("/"))),c&&p.push(...f),p.map(x=>n.startsWith("/")&&x===""?"/":x)}function xy(n){n.sort((a,l)=>a.score!==l.score?l.score-a.score:Sy(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const gy=/^:[\w-]+$/,vy=3,yy=2,jy=1,Ny=10,by=-2,um=n=>n==="*";function wy(n,a){let l=n.split("/"),o=l.length;return l.some(um)&&(o+=by),a&&(o+=yy),l.filter(c=>!um(c)).reduce((c,u)=>c+(gy.test(u)?vy:u===""?jy:Ny),o)}function Sy(n,a){return n.length===a.length&&n.slice(0,-1).every((o,c)=>o===a[c])?n[n.length-1]-a[a.length-1]:0}function Cy(n,a,l){let{routesMeta:o}=n,c={},u="/",f=[];for(let p=0;p<o.length;++p){let x=o[p],g=p===o.length-1,v=u==="/"?a:a.slice(u.length)||"/",y=ky({path:x.relativePath,caseSensitive:x.caseSensitive,end:g},v),P=x.route;if(!y)return null;Object.assign(c,y.params),f.push({params:c,pathname:Tn([u,y.pathname]),pathnameBase:Ay(Tn([u,y.pathnameBase])),route:P}),y.pathnameBase!=="/"&&(u=Tn([u,y.pathnameBase]))}return f}function ky(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[l,o]=Ey(n.path,n.caseSensitive,n.end),c=a.match(l);if(!c)return null;let u=c[0],f=u.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:o.reduce((g,v,y)=>{let{paramName:P,isOptional:R}=v;if(P==="*"){let j=p[y]||"";f=u.slice(0,u.length-j.length).replace(/(.)\/+$/,"$1")}const C=p[y];return R&&!C?g[P]=void 0:g[P]=(C||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:n}}function Ey(n,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),Md(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let o=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,x)=>(o.push({paramName:p,isOptional:x!=null}),x?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(o.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function Py(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Md(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),n}}function Dd(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=n.charAt(l);return o&&o!=="/"?null:n.slice(l)||"/"}const Ry=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ty=n=>Ry.test(n);function _y(n,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof n=="string"?Hs(n):n,u;if(l)if(Ty(l))u=l;else{if(l.includes("//")){let f=l;l=l.replace(/\/\/+/g,"/"),Md(!1,"Pathnames cannot have embedded double slashes - normalizing "+(f+" -> "+l))}l.startsWith("/")?u=fm(l.substring(1),"/"):u=fm(l,a)}else u=a;return{pathname:u,search:My(o),hash:Dy(c)}}function fm(n,a){let l=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function Kc(n,a,l,o){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Iy(n){return n.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Ld(n,a){let l=Iy(n);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function Od(n,a,l,o){o===void 0&&(o=!1);let c;typeof n=="string"?c=Hs(n):(c=Fa({},n),pt(!c.pathname||!c.pathname.includes("?"),Kc("?","pathname","search",c)),pt(!c.pathname||!c.pathname.includes("#"),Kc("#","pathname","hash",c)),pt(!c.search||!c.search.includes("#"),Kc("#","search","hash",c)));let u=n===""||c.pathname==="",f=u?"/":c.pathname,p;if(f==null)p=l;else{let y=a.length-1;if(!o&&f.startsWith("..")){let P=f.split("/");for(;P[0]==="..";)P.shift(),y-=1;c.pathname=P.join("/")}p=y>=0?a[y]:"/"}let x=_y(c,p),g=f&&f!=="/"&&f.endsWith("/"),v=(u||f===".")&&l.endsWith("/");return!x.pathname.endsWith("/")&&(g||v)&&(x.pathname+="/"),x}const Tn=n=>n.join("/").replace(/\/\/+/g,"/"),Ay=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),My=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Dy=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function Ly(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const hp=["post","put","patch","delete"];new Set(hp);const Oy=["get",...hp];new Set(Oy);/**
|
||
* React Router v6.30.3
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function za(){return za=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(n[o]=l[o])}return n},za.apply(this,arguments)}const Fd=h.createContext(null),Fy=h.createContext(null),Ln=h.createContext(null),Mi=h.createContext(null),Jr=h.createContext({outlet:null,matches:[],isDataRoute:!1}),mp=h.createContext(null);function zy(n,a){let{relative:l}=a===void 0?{}:a;Ks()||pt(!1);let{basename:o,navigator:c}=h.useContext(Ln),{hash:u,pathname:f,search:p}=xp(n,{relative:l}),x=f;return o!=="/"&&(x=f==="/"?o:Tn([o,f])),c.createHref({pathname:x,search:p,hash:u})}function Ks(){return h.useContext(Mi)!=null}function us(){return Ks()||pt(!1),h.useContext(Mi).location}function pp(n){h.useContext(Ln).static||h.useLayoutEffect(n)}function Ha(){let{isDataRoute:n}=h.useContext(Jr);return n?ej():$y()}function $y(){Ks()||pt(!1);let n=h.useContext(Fd),{basename:a,future:l,navigator:o}=h.useContext(Ln),{matches:c}=h.useContext(Jr),{pathname:u}=us(),f=JSON.stringify(Ld(c,l.v7_relativeSplatPath)),p=h.useRef(!1);return pp(()=>{p.current=!0}),h.useCallback(function(g,v){if(v===void 0&&(v={}),!p.current)return;if(typeof g=="number"){o.go(g);return}let y=Od(g,JSON.parse(f),u,v.relative==="path");n==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:Tn([a,y.pathname])),(v.replace?o.replace:o.push)(y,v.state,v)},[a,o,f,u,n])}const By=h.createContext(null);function Uy(n){let a=h.useContext(Jr).outlet;return a&&h.createElement(By.Provider,{value:n},a)}function xp(n,a){let{relative:l}=a===void 0?{}:a,{future:o}=h.useContext(Ln),{matches:c}=h.useContext(Jr),{pathname:u}=us(),f=JSON.stringify(Ld(c,o.v7_relativeSplatPath));return h.useMemo(()=>Od(n,JSON.parse(f),u,l==="path"),[n,f,u,l])}function Vy(n,a){return Wy(n,a)}function Wy(n,a,l,o){Ks()||pt(!1);let{navigator:c}=h.useContext(Ln),{matches:u}=h.useContext(Jr),f=u[u.length-1],p=f?f.params:{};f&&f.pathname;let x=f?f.pathnameBase:"/";f&&f.route;let g=us(),v;if(a){var y;let b=typeof a=="string"?Hs(a):a;x==="/"||(y=b.pathname)!=null&&y.startsWith(x)||pt(!1),v=b}else v=g;let P=v.pathname||"/",R=P;if(x!=="/"){let b=x.replace(/^\//,"").split("/");R="/"+P.replace(/^\//,"").split("/").slice(b.length).join("/")}let C=my(n,{pathname:R}),j=Qy(C&&C.map(b=>Object.assign({},b,{params:Object.assign({},p,b.params),pathname:Tn([x,c.encodeLocation?c.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?x:Tn([x,c.encodeLocation?c.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),u,l,o);return a&&j?h.createElement(Mi.Provider,{value:{location:za({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:Rn.Pop}},j):j}function Hy(){let n=Zy(),a=Ly(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),l=n instanceof Error?n.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},a),l?h.createElement("pre",{style:c},l):null,null)}const Ky=h.createElement(Hy,null);class Yy extends h.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?h.createElement(Jr.Provider,{value:this.props.routeContext},h.createElement(mp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Gy(n){let{routeContext:a,match:l,children:o}=n,c=h.useContext(Fd);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),h.createElement(Jr.Provider,{value:a},o)}function Qy(n,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),n==null){var u;if(!l)return null;if(l.errors)n=l.matches;else if((u=o)!=null&&u.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)n=l.matches;else return null}let f=n,p=(c=l)==null?void 0:c.errors;if(p!=null){let v=f.findIndex(y=>y.route.id&&(p==null?void 0:p[y.route.id])!==void 0);v>=0||pt(!1),f=f.slice(0,Math.min(f.length,v+1))}let x=!1,g=-1;if(l&&o&&o.v7_partialHydration)for(let v=0;v<f.length;v++){let y=f[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(g=v),y.route.id){let{loaderData:P,errors:R}=l,C=y.route.loader&&P[y.route.id]===void 0&&(!R||R[y.route.id]===void 0);if(y.route.lazy||C){x=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((v,y,P)=>{let R,C=!1,j=null,b=null;l&&(R=p&&y.route.id?p[y.route.id]:void 0,j=y.route.errorElement||Ky,x&&(g<0&&P===0?(tj("route-fallback"),C=!0,b=null):g===P&&(C=!0,b=y.route.hydrateFallbackElement||null)));let S=a.concat(f.slice(0,P+1)),E=()=>{let w;return R?w=j:C?w=b:y.route.Component?w=h.createElement(y.route.Component,null):y.route.element?w=y.route.element:w=v,h.createElement(Gy,{match:y,routeContext:{outlet:v,matches:S,isDataRoute:l!=null},children:w})};return l&&(y.route.ErrorBoundary||y.route.errorElement||P===0)?h.createElement(Yy,{location:l.location,revalidation:l.revalidation,component:j,error:R,children:E(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):E()},null)}var gp=(function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n})(gp||{}),vp=(function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n})(vp||{});function qy(n){let a=h.useContext(Fd);return a||pt(!1),a}function Xy(n){let a=h.useContext(Fy);return a||pt(!1),a}function Jy(n){let a=h.useContext(Jr);return a||pt(!1),a}function yp(n){let a=Jy(),l=a.matches[a.matches.length-1];return l.route.id||pt(!1),l.route.id}function Zy(){var n;let a=h.useContext(mp),l=Xy(),o=yp();return a!==void 0?a:(n=l.errors)==null?void 0:n[o]}function ej(){let{router:n}=qy(gp.UseNavigateStable),a=yp(vp.UseNavigateStable),l=h.useRef(!1);return pp(()=>{l.current=!0}),h.useCallback(function(c,u){u===void 0&&(u={}),l.current&&(typeof c=="number"?n.navigate(c):n.navigate(c,za({fromRouteId:a},u)))},[n,a])}const hm={};function tj(n,a,l){hm[n]||(hm[n]=!0)}function rj(n,a){n==null||n.v7_startTransition,n==null||n.v7_relativeSplatPath}function nj(n){let{to:a,replace:l,state:o,relative:c}=n;Ks()||pt(!1);let{future:u,static:f}=h.useContext(Ln),{matches:p}=h.useContext(Jr),{pathname:x}=us(),g=Ha(),v=Od(a,Ld(p,u.v7_relativeSplatPath),x,c==="path"),y=JSON.stringify(v);return h.useEffect(()=>g(JSON.parse(y),{replace:l,state:o,relative:c}),[g,y,c,l,o]),null}function sj(n){return Uy(n.context)}function it(n){pt(!1)}function aj(n){let{basename:a="/",children:l=null,location:o,navigationType:c=Rn.Pop,navigator:u,static:f=!1,future:p}=n;Ks()&&pt(!1);let x=a.replace(/^\/*/,"/"),g=h.useMemo(()=>({basename:x,navigator:u,static:f,future:za({v7_relativeSplatPath:!1},p)}),[x,p,u,f]);typeof o=="string"&&(o=Hs(o));let{pathname:v="/",search:y="",hash:P="",state:R=null,key:C="default"}=o,j=h.useMemo(()=>{let b=Dd(v,x);return b==null?null:{location:{pathname:b,search:y,hash:P,state:R,key:C},navigationType:c}},[x,v,y,P,R,C,c]);return j==null?null:h.createElement(Ln.Provider,{value:g},h.createElement(Mi.Provider,{children:l,value:j}))}function lj(n){let{children:a,location:l}=n;return Vy(ud(a),l)}new Promise(()=>{});function ud(n,a){a===void 0&&(a=[]);let l=[];return h.Children.forEach(n,(o,c)=>{if(!h.isValidElement(o))return;let u=[...a,c];if(o.type===h.Fragment){l.push.apply(l,ud(o.props.children,u));return}o.type!==it&&pt(!1),!o.props.index||!o.props.children||pt(!1);let f={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(f.children=ud(o.props.children,u)),l.push(f)}),l}/**
|
||
* React Router DOM v6.30.3
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function fd(){return fd=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(n[o]=l[o])}return n},fd.apply(this,arguments)}function ij(n,a){if(n==null)return{};var l={},o=Object.keys(n),c,u;for(u=0;u<o.length;u++)c=o[u],!(a.indexOf(c)>=0)&&(l[c]=n[c]);return l}function oj(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function cj(n,a){return n.button===0&&(!a||a==="_self")&&!oj(n)}const dj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],uj="6";try{window.__reactRouterVersion=uj}catch{}const fj="startTransition",mm=Ai[fj];function hj(n){let{basename:a,children:l,future:o,window:c}=n,u=h.useRef();u.current==null&&(u.current=uy({window:c,v5Compat:!0}));let f=u.current,[p,x]=h.useState({action:f.action,location:f.location}),{v7_startTransition:g}=o||{},v=h.useCallback(y=>{g&&mm?mm(()=>x(y)):x(y)},[x,g]);return h.useLayoutEffect(()=>f.listen(v),[f,v]),h.useEffect(()=>rj(o),[o]),h.createElement(aj,{basename:a,children:l,location:p.location,navigationType:p.action,navigator:f,future:o})}const mj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",pj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hi=h.forwardRef(function(a,l){let{onClick:o,relative:c,reloadDocument:u,replace:f,state:p,target:x,to:g,preventScrollReset:v,viewTransition:y}=a,P=ij(a,dj),{basename:R}=h.useContext(Ln),C,j=!1;if(typeof g=="string"&&pj.test(g)&&(C=g,mj))try{let w=new URL(window.location.href),M=g.startsWith("//")?new URL(w.protocol+g):new URL(g),D=Dd(M.pathname,R);M.origin===w.origin&&D!=null?g=D+M.search+M.hash:j=!0}catch{}let b=zy(g,{relative:c}),S=xj(g,{replace:f,state:p,target:x,preventScrollReset:v,relative:c,viewTransition:y});function E(w){o&&o(w),w.defaultPrevented||S(w)}return h.createElement("a",fd({},P,{href:C||b,onClick:j||u?o:E,ref:l,target:x}))});var pm;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(pm||(pm={}));var xm;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(xm||(xm={}));function xj(n,a){let{target:l,replace:o,state:c,preventScrollReset:u,relative:f,viewTransition:p}=a===void 0?{}:a,x=Ha(),g=us(),v=xp(n,{relative:f});return h.useCallback(y=>{if(cj(y,l)){y.preventDefault();let P=o!==void 0?o:yi(g)===yi(v);x(n,{replace:P,state:c,preventScrollReset:u,relative:f,viewTransition:p})}},[g,x,v,o,c,l,n,u,f,p])}/**
|
||
* @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 gj=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vj=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,o)=>o?o.toUpperCase():l.toLowerCase()),gm=n=>{const a=vj(n);return a.charAt(0).toUpperCase()+a.slice(1)},jp=(...n)=>n.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).join(" ").trim(),yj=n=>{for(const a in n)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 jj={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 Nj=h.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:u,iconNode:f,...p},x)=>h.createElement("svg",{ref:x,...jj,width:a,height:a,stroke:n,strokeWidth:o?Number(l)*24/Number(a):l,className:jp("lucide",c),...!u&&!yj(p)&&{"aria-hidden":"true"},...p},[...f.map(([g,v])=>h.createElement(g,v)),...Array.isArray(u)?u:[u]]));/**
|
||
* @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 Ne=(n,a)=>{const l=h.forwardRef(({className:o,...c},u)=>h.createElement(Nj,{ref:u,iconNode:a,className:jp(`lucide-${gj(gm(n))}`,`lucide-${n}`,o),...c}));return l.displayName=gm(n),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 bj=[["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"}]],vm=Ne("bitcoin",bj);/**
|
||
* @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 wj=[["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"}]],Qr=Ne("book-open",wj);/**
|
||
* @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 Sj=[["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"}]],$a=Ne("calendar",Sj);/**
|
||
* @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 Cj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Di=Ne("check",Cj);/**
|
||
* @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 kj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ba=Ne("chevron-down",kj);/**
|
||
* @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 Ej=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Cn=Ne("chevron-right",Ej);/**
|
||
* @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 Pj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Np=Ne("chevron-up",Pj);/**
|
||
* @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 Rj=[["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"}]],Tj=Ne("circle-alert",Rj);/**
|
||
* @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 _j=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ym=Ne("circle-check-big",_j);/**
|
||
* @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 Ij=[["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"}]],bp=Ne("circle-question-mark",Ij);/**
|
||
* @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 Aj=[["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"}]],jm=Ne("circle-user",Aj);/**
|
||
* @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 Mj=[["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"}]],Dj=Ne("circle-x",Mj);/**
|
||
* @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 Lj=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],wp=Ne("clock",Lj);/**
|
||
* @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 Oj=[["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"}]],Sp=Ne("copy",Oj);/**
|
||
* @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 Fj=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],hd=Ne("credit-card",Fj);/**
|
||
* @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 zj=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Li=Ne("crown",zj);/**
|
||
* @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 $j=[["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"}]],ji=Ne("dollar-sign",$j);/**
|
||
* @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 Bj=[["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"}]],Uj=Ne("download",Bj);/**
|
||
* @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 Vj=[["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"}]],Ni=Ne("external-link",Vj);/**
|
||
* @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 Wj=[["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"}]],Pn=Ne("eye",Wj);/**
|
||
* @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 Hj=[["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"}]],Kj=Ne("file-text",Hj);/**
|
||
* @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 Yj=[["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"}]],Gj=Ne("funnel",Yj);/**
|
||
* @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 Qj=[["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"}]],qj=Ne("gift",Qj);/**
|
||
* @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 Xj=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],Jj=Ne("git-merge",Xj);/**
|
||
* @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 Zj=[["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"}]],md=Ne("globe",Zj);/**
|
||
* @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 eN=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],tN=Ne("graduation-cap",eN);/**
|
||
* @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 rN=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Yc=Ne("grip-vertical",rN);/**
|
||
* @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 nN=[["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"}]],Nm=Ne("history",nN);/**
|
||
* @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 sN=[["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"}]],aN=Ne("house",sN);/**
|
||
* @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 lN=[["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"}]],Cp=Ne("image",lN);/**
|
||
* @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 iN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ni=Ne("info",iN);/**
|
||
* @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 oN=[["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"}]],bm=Ne("key",oN);/**
|
||
* @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 cN=[["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"}]],dN=Ne("layout-dashboard",cN);/**
|
||
* @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 uN=[["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"}]],ts=Ne("link-2",uN);/**
|
||
* @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 fN=[["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"}]],wm=Ne("link",fN);/**
|
||
* @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 hN=[["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"}]],mN=Ne("lock",hN);/**
|
||
* @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 pN=[["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"}]],xN=Ne("log-out",pN);/**
|
||
* @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 gN=[["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"}]],vN=Ne("map-pin",gN);/**
|
||
* @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 yN=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],jN=Ne("menu",yN);/**
|
||
* @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 NN=[["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"}]],bN=Ne("message-circle",NN);/**
|
||
* @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 wN=[["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"}]],SN=Ne("palette",wN);/**
|
||
* @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 CN=[["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"}]],Ft=Ne("pen-line",CN);/**
|
||
* @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 kN=[["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"}]],EN=Ne("percent",kN);/**
|
||
* @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 PN=[["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"}]],RN=Ne("phone",PN);/**
|
||
* @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 TN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],zt=Ne("plus",TN);/**
|
||
* @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 _N=[["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"}]],Sm=Ne("qr-code",_N);/**
|
||
* @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 IN=[["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"}]],tt=Ne("refresh-cw",IN);/**
|
||
* @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 AN=[["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"}]],Yt=Ne("save",AN);/**
|
||
* @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 MN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],rs=Ne("search",MN);/**
|
||
* @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 DN=[["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"}]],bi=Ne("settings",DN);/**
|
||
* @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 LN=[["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"}]],ON=Ne("settings-2",LN);/**
|
||
* @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 FN=[["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"}]],zd=Ne("shield-check",FN);/**
|
||
* @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 zN=[["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"}]],pd=Ne("shopping-bag",zN);/**
|
||
* @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 $N=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],xd=Ne("smartphone",$N);/**
|
||
* @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 BN=[["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"}]],UN=Ne("tag",BN);/**
|
||
* @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 VN=[["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"}]],sr=Ne("trash-2",VN);/**
|
||
* @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 WN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],gd=Ne("trending-up",WN);/**
|
||
* @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 HN=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],kp=Ne("undo-2",HN);/**
|
||
* @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 KN=[["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"}]],wi=Ne("upload",KN);/**
|
||
* @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 YN=[["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"}]],Cm=Ne("user-plus",YN);/**
|
||
* @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 GN=[["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"}]],ns=Ne("user",GN);/**
|
||
* @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 QN=[["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"}]],Cr=Ne("users",QN);/**
|
||
* @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 qN=[["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"}]],Us=Ne("wallet",qN);/**
|
||
* @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 XN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pr=Ne("x",XN);/**
|
||
* @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 JN=[["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"}]],ZN=Ne("zap",JN),$d="admin_token";function Bd(){try{return localStorage.getItem($d)}catch{return null}}function eb(n){try{localStorage.setItem($d,n)}catch{}}function tb(){try{localStorage.removeItem($d)}catch{}}const rb="https://soulapi.quwanzhi.com",nb=()=>{const n="https://soulapi.quwanzhi.com";return n.length>0?n.replace(/\/$/,""):rb};function Vs(n){const a=nb(),l=n.startsWith("/")?n:`/${n}`;return a?`${a}${l}`:l}async function Oi(n,a={}){const{data:l,...o}=a,c=Vs(n),u=new Headers(o.headers),f=Bd();f&&u.set("Authorization",`Bearer ${f}`),l!=null&&!u.has("Content-Type")&&u.set("Content-Type","application/json");const p=l!=null?JSON.stringify(l):o.body,x=await fetch(c,{...o,headers:u,body:p,credentials:"include"}),v=(x.headers.get("Content-Type")||"").includes("application/json")?await x.json():x;if(!x.ok){const y=new Error((v==null?void 0:v.error)||`HTTP ${x.status}`);throw y.status=x.status,y.data=v,y}return v}function Ge(n,a){return Oi(n,{...a,method:"GET"})}function Ct(n,a,l){return Oi(n,{...l,method:"POST",data:a})}function St(n,a,l){return Oi(n,{...l,method:"PUT",data:a})}function ss(n,a){return Oi(n,{...a,method:"DELETE"})}const sb=[{icon:dN,label:"数据概览",href:"/dashboard"},{icon:Qr,label:"内容管理",href:"/content"},{icon:Cr,label:"用户管理",href:"/users"}],km=[{icon:Li,label:"VIP 角色",href:"/vip-roles"},{icon:ns,label:"作者详情",href:"/author-settings"},{icon:zd,label:"管理员",href:"/admin-users"},{icon:tN,label:"导师管理",href:"/mentors"},{icon:$a,label:"导师预约",href:"/mentor-consultations"},{icon:Us,label:"推广中心",href:"/distribution"},{icon:Jj,label:"匹配记录",href:"/match-records"},{icon:hd,label:"推广设置",href:"/referral-settings"}];function ab(){const n=us(),a=Ha(),[l,o]=h.useState(!1),[c,u]=h.useState(!1),[f,p]=h.useState(!1);h.useEffect(()=>{o(!0)},[]),h.useEffect(()=>{km.some(v=>n.pathname===v.href)&&p(!0)},[n.pathname]),h.useEffect(()=>{if(!l)return;u(!1);let g=!1;return Ge("/api/admin").then(v=>{g||(v&&v.success!==!1?u(!0):a("/login",{replace:!0}))}).catch(()=>{g||a("/login",{replace:!0})}),()=>{g=!0}},[l,a]);const x=async()=>{tb();try{await Ct("/api/admin/logout",{})}catch{}a("/login",{replace:!0})};return!l||!c?t.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[t.jsx("div",{className:"w-64 bg-[#0f2137] border-r border-gray-700/50"}),t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("div",{className:"text-[#38bdac]",children:"加载中..."})})]}):t.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[t.jsxs("div",{className:"w-64 bg-[#0f2137] flex flex-col border-r border-gray-700/50 shadow-xl",children:[t.jsxs("div",{className:"p-6 border-b border-gray-700/50",children:[t.jsx("h1",{className:"text-xl font-bold text-[#38bdac]",children:"管理后台"}),t.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Soul创业派对"})]}),t.jsxs("nav",{className:"flex-1 p-4 space-y-1 overflow-y-auto",children:[sb.map(g=>{const v=n.pathname===g.href;return t.jsxs(hi,{to:g.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${v?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[t.jsx(g.icon,{className:"w-5 h-5 shrink-0"}),t.jsx("span",{className:"text-sm",children:g.label})]},g.href)}),t.jsx("button",{type:"button",onClick:()=>p(!f),className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-gray-400 hover:bg-gray-700/50 hover:text-white rounded-lg transition-colors",children:t.jsxs("span",{className:"flex items-center gap-3",children:[f?t.jsx(Np,{className:"w-5 h-5"}):t.jsx(Ba,{className:"w-5 h-5"}),t.jsx("span",{className:"text-sm",children:"更多"})]})}),f&&t.jsx("div",{className:"space-y-1 pl-4",children:km.map(g=>{const v=n.pathname===g.href;return t.jsxs(hi,{to:g.href,className:`flex items-center gap-3 px-4 py-2 rounded-lg transition-colors ${v?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[t.jsx(g.icon,{className:"w-5 h-5 shrink-0"}),t.jsx("span",{className:"text-sm",children:g.label})]},g.href)})}),t.jsx("div",{className:"pt-4 mt-4 border-t border-gray-700/50",children:t.jsxs(hi,{to:"/settings",className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${n.pathname==="/settings"?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[t.jsx(bi,{className:"w-5 h-5 shrink-0"}),t.jsx("span",{className:"text-sm",children:"系统设置"})]})})]}),t.jsx("div",{className:"p-4 border-t border-gray-700/50 space-y-1",children:t.jsxs("button",{type:"button",onClick:x,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:[t.jsx(xN,{className:"w-5 h-5"}),t.jsx("span",{className:"text-sm",children:"退出登录"})]})})]}),t.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628] min-w-0",children:t.jsx("div",{className:"w-full min-w-[1024px] min-h-full",children:t.jsx(sj,{})})})]})}function Em(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}function Ud(...n){return a=>{let l=!1;const o=n.map(c=>{const u=Em(c,a);return!l&&typeof u=="function"&&(l=!0),u});if(l)return()=>{for(let c=0;c<o.length;c++){const u=o[c];typeof u=="function"?u():Em(n[c],null)}}}}function Xe(...n){return h.useCallback(Ud(...n),n)}var lb=Symbol.for("react.lazy"),Si=Ai[" use ".trim().toString()];function ib(n){return typeof n=="object"&&n!==null&&"then"in n}function Ep(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===lb&&"_payload"in n&&ib(n._payload)}function Pp(n){const a=ob(n),l=h.forwardRef((o,c)=>{let{children:u,...f}=o;Ep(u)&&typeof Si=="function"&&(u=Si(u._payload));const p=h.Children.toArray(u),x=p.find(db);if(x){const g=x.props.children,v=p.map(y=>y===x?h.Children.count(g)>1?h.Children.only(null):h.isValidElement(g)?g.props.children:null:y);return t.jsx(a,{...f,ref:c,children:h.isValidElement(g)?h.cloneElement(g,void 0,v):null})}return t.jsx(a,{...f,ref:c,children:u})});return l.displayName=`${n}.Slot`,l}var Rp=Pp("Slot");function ob(n){const a=h.forwardRef((l,o)=>{let{children:c,...u}=l;if(Ep(c)&&typeof Si=="function"&&(c=Si(c._payload)),h.isValidElement(c)){const f=fb(c),p=ub(u,c.props);return c.type!==h.Fragment&&(p.ref=o?Ud(o,f):f),h.cloneElement(c,p)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${n}.SlotClone`,a}var cb=Symbol("radix.slottable");function db(n){return h.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===cb}function ub(n,a){const l={...a};for(const o in a){const c=n[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...p)=>{const x=u(...p);return c(...p),x}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...n,...l}}function fb(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}function Tp(n){var a,l,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(a=0;a<c;a++)n[a]&&(l=Tp(n[a]))&&(o&&(o+=" "),o+=l)}else for(l in n)n[l]&&(o&&(o+=" "),o+=l);return o}function _p(){for(var n,a,l=0,o="",c=arguments.length;l<c;l++)(n=arguments[l])&&(a=Tp(n))&&(o&&(o+=" "),o+=a);return o}const Pm=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,Rm=_p,Ip=(n,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return Rm(n,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:u}=a,f=Object.keys(c).map(g=>{const v=l==null?void 0:l[g],y=u==null?void 0:u[g];if(v===null)return null;const P=Pm(v)||Pm(y);return c[g][P]}),p=l&&Object.entries(l).reduce((g,v)=>{let[y,P]=v;return P===void 0||(g[y]=P),g},{}),x=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((g,v)=>{let{class:y,className:P,...R}=v;return Object.entries(R).every(C=>{let[j,b]=C;return Array.isArray(b)?b.includes({...u,...p}[j]):{...u,...p}[j]===b})?[...g,y,P]:g},[]);return Rm(n,f,x,l==null?void 0:l.class,l==null?void 0:l.className)},hb=(n,a)=>{const l=new Array(n.length+a.length);for(let o=0;o<n.length;o++)l[o]=n[o];for(let o=0;o<a.length;o++)l[n.length+o]=a[o];return l},mb=(n,a)=>({classGroupId:n,validator:a}),Ap=(n=new Map,a=null,l)=>({nextPart:n,validators:a,classGroupId:l}),Ci="-",Tm=[],pb="arbitrary..",xb=n=>{const a=vb(n),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return gb(f);const p=f.split(Ci),x=p[0]===""&&p.length>1?1:0;return Mp(p,x,a)},getConflictingClassGroupIds:(f,p)=>{if(p){const x=o[f],g=l[f];return x?g?hb(g,x):x:g||Tm}return l[f]||Tm}}},Mp=(n,a,l)=>{if(n.length-a===0)return l.classGroupId;const c=n[a],u=l.nextPart.get(c);if(u){const g=Mp(n,a+1,u);if(g)return g}const f=l.validators;if(f===null)return;const p=a===0?n.join(Ci):n.slice(a).join(Ci),x=f.length;for(let g=0;g<x;g++){const v=f[g];if(v.validator(p))return v.classGroupId}},gb=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=n.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?pb+o:void 0})(),vb=n=>{const{theme:a,classGroups:l}=n;return yb(l,a)},yb=(n,a)=>{const l=Ap();for(const o in n){const c=n[o];Vd(c,l,o,a)}return l},Vd=(n,a,l,o)=>{const c=n.length;for(let u=0;u<c;u++){const f=n[u];jb(f,a,l,o)}},jb=(n,a,l,o)=>{if(typeof n=="string"){Nb(n,a,l);return}if(typeof n=="function"){bb(n,a,l,o);return}wb(n,a,l,o)},Nb=(n,a,l)=>{const o=n===""?a:Dp(a,n);o.classGroupId=l},bb=(n,a,l,o)=>{if(Sb(n)){Vd(n(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(mb(l,n))},wb=(n,a,l,o)=>{const c=Object.entries(n),u=c.length;for(let f=0;f<u;f++){const[p,x]=c[f];Vd(x,Dp(a,p),l,o)}},Dp=(n,a)=>{let l=n;const o=a.split(Ci),c=o.length;for(let u=0;u<c;u++){const f=o[u];let p=l.nextPart.get(f);p||(p=Ap(),l.nextPart.set(f,p)),l=p}return l},Sb=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,Cb=n=>{if(n<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(u,f)=>{l[u]=f,a++,a>n&&(a=0,o=l,l=Object.create(null))};return{get(u){let f=l[u];if(f!==void 0)return f;if((f=o[u])!==void 0)return c(u,f),f},set(u,f){u in l?l[u]=f:c(u,f)}}},vd="!",_m=":",kb=[],Im=(n,a,l,o,c)=>({modifiers:n,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),Eb=n=>{const{prefix:a,experimentalParseClassName:l}=n;let o=c=>{const u=[];let f=0,p=0,x=0,g;const v=c.length;for(let j=0;j<v;j++){const b=c[j];if(f===0&&p===0){if(b===_m){u.push(c.slice(x,j)),x=j+1;continue}if(b==="/"){g=j;continue}}b==="["?f++:b==="]"?f--:b==="("?p++:b===")"&&p--}const y=u.length===0?c:c.slice(x);let P=y,R=!1;y.endsWith(vd)?(P=y.slice(0,-1),R=!0):y.startsWith(vd)&&(P=y.slice(1),R=!0);const C=g&&g>x?g-x:void 0;return Im(u,R,P,C)};if(a){const c=a+_m,u=o;o=f=>f.startsWith(c)?u(f.slice(c.length)):Im(kb,!1,f,void 0,!0)}if(l){const c=o;o=u=>l({className:u,parseClassName:c})}return o},Pb=n=>{const a=new Map;return n.orderSensitiveModifiers.forEach((l,o)=>{a.set(l,1e6+o)}),l=>{const o=[];let c=[];for(let u=0;u<l.length;u++){const f=l[u],p=f[0]==="[",x=a.has(f);p||x?(c.length>0&&(c.sort(),o.push(...c),c=[]),o.push(f)):c.push(f)}return c.length>0&&(c.sort(),o.push(...c)),o}},Rb=n=>({cache:Cb(n.cacheSize),parseClassName:Eb(n),sortModifiers:Pb(n),...xb(n)}),Tb=/\s+/,_b=(n,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:u}=a,f=[],p=n.trim().split(Tb);let x="";for(let g=p.length-1;g>=0;g-=1){const v=p[g],{isExternal:y,modifiers:P,hasImportantModifier:R,baseClassName:C,maybePostfixModifierPosition:j}=l(v);if(y){x=v+(x.length>0?" "+x:x);continue}let b=!!j,S=o(b?C.substring(0,j):C);if(!S){if(!b){x=v+(x.length>0?" "+x:x);continue}if(S=o(C),!S){x=v+(x.length>0?" "+x:x);continue}b=!1}const E=P.length===0?"":P.length===1?P[0]:u(P).join(":"),w=R?E+vd:E,M=w+S;if(f.indexOf(M)>-1)continue;f.push(M);const D=c(S,b);for(let V=0;V<D.length;++V){const k=D[V];f.push(w+k)}x=v+(x.length>0?" "+x:x)}return x},Ib=(...n)=>{let a=0,l,o,c="";for(;a<n.length;)(l=n[a++])&&(o=Lp(l))&&(c&&(c+=" "),c+=o);return c},Lp=n=>{if(typeof n=="string")return n;let a,l="";for(let o=0;o<n.length;o++)n[o]&&(a=Lp(n[o]))&&(l&&(l+=" "),l+=a);return l},Ab=(n,...a)=>{let l,o,c,u;const f=x=>{const g=a.reduce((v,y)=>y(v),n());return l=Rb(g),o=l.cache.get,c=l.cache.set,u=p,p(x)},p=x=>{const g=o(x);if(g)return g;const v=_b(x,l);return c(x,v),v};return u=f,(...x)=>u(Ib(...x))},Mb=[],jt=n=>{const a=l=>l[n]||Mb;return a.isThemeGetter=!0,a},Op=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Db=/^\d+\/\d+$/,Lb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ob=/\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$/,Fb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$b=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ls=n=>Db.test(n),Be=n=>!!n&&!Number.isNaN(Number(n)),wn=n=>!!n&&Number.isInteger(Number(n)),Gc=n=>n.endsWith("%")&&Be(n.slice(0,-1)),Yr=n=>Lb.test(n),Bb=()=>!0,Ub=n=>Ob.test(n)&&!Fb.test(n),zp=()=>!1,Vb=n=>zb.test(n),Wb=n=>$b.test(n),Hb=n=>!we(n)&&!Se(n),Kb=n=>Ys(n,Up,zp),we=n=>Op.test(n),es=n=>Ys(n,Vp,Ub),Qc=n=>Ys(n,Xb,Be),Am=n=>Ys(n,$p,zp),Yb=n=>Ys(n,Bp,Wb),si=n=>Ys(n,Wp,Vb),Se=n=>Fp.test(n),La=n=>Gs(n,Vp),Gb=n=>Gs(n,Jb),Mm=n=>Gs(n,$p),Qb=n=>Gs(n,Up),qb=n=>Gs(n,Bp),ai=n=>Gs(n,Wp,!0),Ys=(n,a,l)=>{const o=Op.exec(n);return o?o[1]?a(o[1]):l(o[2]):!1},Gs=(n,a,l=!1)=>{const o=Fp.exec(n);return o?o[1]?a(o[1]):l:!1},$p=n=>n==="position"||n==="percentage",Bp=n=>n==="image"||n==="url",Up=n=>n==="length"||n==="size"||n==="bg-size",Vp=n=>n==="length",Xb=n=>n==="number",Jb=n=>n==="family-name",Wp=n=>n==="shadow",Zb=()=>{const n=jt("color"),a=jt("font"),l=jt("text"),o=jt("font-weight"),c=jt("tracking"),u=jt("leading"),f=jt("breakpoint"),p=jt("container"),x=jt("spacing"),g=jt("radius"),v=jt("shadow"),y=jt("inset-shadow"),P=jt("text-shadow"),R=jt("drop-shadow"),C=jt("blur"),j=jt("perspective"),b=jt("aspect"),S=jt("ease"),E=jt("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),Se,we],V=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],T=()=>[Se,we,x],U=()=>[Ls,"full","auto",...T()],Q=()=>[wn,"none","subgrid",Se,we],te=()=>["auto",{span:["full",wn,Se,we]},wn,Se,we],oe=()=>[wn,"auto",Se,we],he=()=>["auto","min","max","fr",Se,we],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],le=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...T()],$=()=>[Ls,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],_=()=>[n,Se,we],q=()=>[...M(),Mm,Am,{position:[Se,we]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",Qb,Kb,{size:[Se,we]}],F=()=>[Gc,La,es],G=()=>["","none","full",g,Se,we],J=()=>["",Be,La,es],xe=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Be,Gc,Mm,Am],ye=()=>["","none",C,Se,we],L=()=>["none",Be,Se,we],de=()=>["none",Be,Se,we],ge=()=>[Be,Se,we],_e=()=>[Ls,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Yr],breakpoint:[Yr],color:[Bb],container:[Yr],"drop-shadow":[Yr],ease:["in","out","in-out"],font:[Hb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Yr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Yr],shadow:[Yr],spacing:["px",Be],text:[Yr],"text-shadow":[Yr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ls,we,Se,b]}],container:["container"],columns:[{columns:[Be,we,Se,p]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:D()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[wn,"auto",Se,we]}],basis:[{basis:[Ls,"full","auto",p,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,Ls,"auto","initial","none",we]}],grow:[{grow:["",Be,Se,we]}],shrink:[{shrink:["",Be,Se,we]}],order:[{order:[wn,"first","last","none",Se,we]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":he()}],"auto-rows":[{"auto-rows":he()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...le(),"normal"]}],"justify-self":[{"justify-self":["auto",...le()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...le(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...le(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...le(),"baseline"]}],"place-self":[{"place-self":["auto",...le()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[p,"screen",...$()]}],"min-w":[{"min-w":[p,"screen","none",...$()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[f]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",l,La,es]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Se,Qc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gc,we]}],"font-family":[{font:[Gb,we,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,Se,we]}],"line-clamp":[{"line-clamp":[Be,"none",Se,Qc]}],leading:[{leading:[u,...T()]}],"list-image":[{"list-image":["none",Se,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",Se,es]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Be,"auto",Se,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se,we]}],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",Se,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},wn,Se,we],radial:["",Se,we],conic:[wn,Se,we]},qb,Yb]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,Se,we]}],"outline-w":[{outline:["",Be,La,es]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",v,ai,si]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",y,ai,si]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Be,es]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",P,ai,si]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Be,Se,we]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"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":[Be]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[Se,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[Be]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,we]}],filter:[{filter:["","none",Se,we]}],blur:[{blur:ye()}],brightness:[{brightness:[Be,Se,we]}],contrast:[{contrast:[Be,Se,we]}],"drop-shadow":[{"drop-shadow":["","none",R,ai,si]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Be,Se,we]}],"hue-rotate":[{"hue-rotate":[Be,Se,we]}],invert:[{invert:["",Be,Se,we]}],saturate:[{saturate:[Be,Se,we]}],sepia:[{sepia:["",Be,Se,we]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,we]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[Be,Se,we]}],"backdrop-contrast":[{"backdrop-contrast":[Be,Se,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,Se,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,Se,we]}],"backdrop-invert":[{"backdrop-invert":["",Be,Se,we]}],"backdrop-opacity":[{"backdrop-opacity":[Be,Se,we]}],"backdrop-saturate":[{"backdrop-saturate":[Be,Se,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,Se,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Se,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",Se,we]}],ease:[{ease:["linear","initial",S,Se,we]}],delay:[{delay:[Be,Se,we]}],animate:[{animate:["none",E,Se,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Se,we]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[Se,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"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",Se,we]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Se,we]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Be,La,es,Qc]}],stroke:[{stroke:["none",..._()]}],"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"]}},ew=Ab(Zb);function Je(...n){return ew(_p(n))}const tw=Ip("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 ee({className:n,variant:a,size:l,asChild:o=!1,...c}){const u=o?Rp:"button";return t.jsx(u,{"data-slot":"button",className:Je(tw({variant:a,size:l,className:n})),...c})}function ae({className:n,type:a,...l}){return t.jsx("input",{type:a,"data-slot":"input",className:Je("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",n),...l})}function rw(){const n=Ha(),[a,l]=h.useState(""),[o,c]=h.useState(""),[u,f]=h.useState(""),[p,x]=h.useState(!1),g=async()=>{f(""),x(!0);try{const v=await Ct("/api/admin",{username:a.trim(),password:o});if((v==null?void 0:v.success)!==!1&&(v!=null&&v.token)){eb(v.token),n("/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 t.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[t.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[t.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),t.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),t.jsxs("div",{className:"w-full max-w-md relative z-10",children:[t.jsxs("div",{className:"text-center mb-8",children:[t.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:t.jsx(zd,{className:"w-8 h-8 text-[#38bdac]"})}),t.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),t.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),t.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[t.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),t.jsxs("div",{className:"relative",children:[t.jsx(ns,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),t.jsx(ae,{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]"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),t.jsxs("div",{className:"relative",children:[t.jsx(mN,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),t.jsx(ae,{type:"password",value:o,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()})]})]}),u&&t.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:u}),t.jsx(ee,{onClick:g,disabled:p,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:p?"登录中...":"登录"})]})]}),t.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const Pe=h.forwardRef(({className:n,...a},l)=>t.jsx("div",{ref:l,className:Je("rounded-xl border bg-card text-card-foreground shadow",n),...a}));Pe.displayName="Card";const We=h.forwardRef(({className:n,...a},l)=>t.jsx("div",{ref:l,className:Je("flex flex-col space-y-1.5 p-6",n),...a}));We.displayName="CardHeader";const He=h.forwardRef(({className:n,...a},l)=>t.jsx("h3",{ref:l,className:Je("font-semibold leading-none tracking-tight",n),...a}));He.displayName="CardTitle";const ft=h.forwardRef(({className:n,...a},l)=>t.jsx("p",{ref:l,className:Je("text-sm text-muted-foreground",n),...a}));ft.displayName="CardDescription";const Re=h.forwardRef(({className:n,...a},l)=>t.jsx("div",{ref:l,className:Je("p-6 pt-0",n),...a}));Re.displayName="CardContent";const nw=h.forwardRef(({className:n,...a},l)=>t.jsx("div",{ref:l,className:Je("flex items-center p-6 pt-0",n),...a}));nw.displayName="CardFooter";function sw(){const n=Ha(),[a,l]=h.useState(!0),[o,c]=h.useState([]),[u,f]=h.useState([]);async function p(){l(!0);try{const[C,j]=await Promise.all([Ge("/api/db/users"),Ge("/api/orders")]);C!=null&&C.success&&C.users&&c(C.users),j!=null&&j.success&&j.orders&&f(j.orders)}catch(C){console.error("加载数据失败",C)}finally{l(!1)}}if(h.useEffect(()=>{p()},[]),a)return t.jsxs("div",{className:"p-8 w-full",children:[t.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),t.jsxs("div",{className:"flex flex-col items-center justify-center py-24",children:[t.jsx(tt,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),t.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const g=u.filter(C=>C.status==="paid"||C.status==="completed"||C.status==="success").reduce((C,j)=>C+Number(j.amount||0),0),v=o.length,y=u.length,P=C=>{const j=C.productType||"",b=C.description||"";if(b){if(j==="section"&&b.includes("章节")){if(b.includes("-")){const S=b.split("-");if(S.length>=3)return{title:`第${S[1]}章 第${S[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:b,subtitle:"章节购买"}}return j==="fullbook"||b.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:j==="match"||b.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:b,subtitle:j==="section"?"单章":j==="fullbook"?"全书":"其他"}}return j==="section"?{title:`章节 ${C.productId||""}`,subtitle:"单章购买"}:j==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:j==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:j||"其他"}},R=[{title:"总用户数",value:v,icon:Cr,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${Number(g).toFixed(2)}`,icon:gd,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:pd,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${v>0?(y/v*100).toFixed(1):0}%`,icon:Qr,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"}];return t.jsxs("div",{className:"p-8 w-full",children:[t.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:R.map((C,j)=>t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>C.link&&n(C.link),children:[t.jsxs(We,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsx(He,{className:"text-sm font-medium text-gray-400",children:C.title}),t.jsx("div",{className:`p-2 rounded-lg ${C.bg}`,children:t.jsx(C.icon,{className:`w-4 h-4 ${C.color}`})})]}),t.jsx(Re,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-2xl font-bold text-white",children:C.value}),t.jsx(Cn,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},j))}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"最近订单"})}),t.jsx(Re,{children:t.jsxs("div",{className:"space-y-3",children:[u.slice(-5).reverse().map(C=>{var w;const j=C.referrerId?o.find(M=>M.id===C.referrerId):void 0,b=C.referralCode||(j==null?void 0:j.referralCode)||(j==null?void 0:j.nickname)||(C.referrerId?String(C.referrerId).slice(0,8):""),S=P(C),E=C.userNickname||((w=o.find(M=>M.id===C.userId))==null?void 0:w.nickname)||"匿名用户";return t.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:[t.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[C.userAvatar?t.jsx("img",{src:C.userAvatar,alt:E,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:M=>{M.currentTarget.style.display="none";const D=M.currentTarget.nextElementSibling;D&&D.classList.remove("hidden")}}):null,t.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 ${C.userAvatar?"hidden":""}`,children:E.charAt(0)}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx("span",{className:"text-sm text-gray-300",children:E}),t.jsx("span",{className:"text-gray-600",children:"·"}),t.jsx("span",{className:"text-sm font-medium text-white truncate",children:S.title})]}),t.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[t.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700/50 rounded",children:S.subtitle}),t.jsx("span",{children:new Date(C.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),b&&t.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",b]})]})]}),t.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[t.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(C.amount).toFixed(2)]}),t.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:C.paymentMethod||"微信"})]})]},C.id)}),u.length===0&&t.jsxs("div",{className:"text-center py-12",children:[t.jsx(pd,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),t.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"新注册用户"})}),t.jsx(Re,{children:t.jsxs("div",{className:"space-y-3",children:[o.slice(-5).reverse().map(C=>{var j;return t.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((j=C.nickname)==null?void 0:j.charAt(0))||"?"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-white",children:C.nickname||"匿名用户"}),t.jsx("p",{className:"text-xs text-gray-500",children:C.phone||"-"})]})]}),t.jsx("p",{className:"text-xs text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleDateString():"-"})]},C.id)}),o.length===0&&t.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const Zr=h.forwardRef(({className:n,...a},l)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:l,className:Je("w-full caption-bottom text-sm",n),...a})}));Zr.displayName="Table";const en=h.forwardRef(({className:n,...a},l)=>t.jsx("thead",{ref:l,className:Je("[&_tr]:border-b",n),...a}));en.displayName="TableHeader";const tn=h.forwardRef(({className:n,...a},l)=>t.jsx("tbody",{ref:l,className:Je("[&_tr:last-child]:border-0",n),...a}));tn.displayName="TableBody";const ot=h.forwardRef(({className:n,...a},l)=>t.jsx("tr",{ref:l,className:Je("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...a}));ot.displayName="TableRow";const Te=h.forwardRef(({className:n,...a},l)=>t.jsx("th",{ref:l,className:Je("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",n),...a}));Te.displayName="TableHead";const Ce=h.forwardRef(({className:n,...a},l)=>t.jsx("td",{ref:l,className:Je("p-4 align-middle [&:has([role=checkbox])]:pr-0",n),...a}));Ce.displayName="TableCell";const aw=Ip("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 $e({className:n,variant:a,asChild:l=!1,...o}){const c=l?Rp:"span";return t.jsx(c,{className:Je(aw({variant:a}),n),...o})}function Fe(n,a,{checkForDefaultPrevented:l=!0}={}){return function(c){if(n==null||n(c),l===!1||!c.defaultPrevented)return a==null?void 0:a(c)}}function lw(n,a){const l=h.createContext(a),o=u=>{const{children:f,...p}=u,x=h.useMemo(()=>p,Object.values(p));return t.jsx(l.Provider,{value:x,children:f})};o.displayName=n+"Provider";function c(u){const f=h.useContext(l);if(f)return f;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${n}\``)}return[o,c]}function On(n,a=[]){let l=[];function o(u,f){const p=h.createContext(f),x=l.length;l=[...l,f];const g=y=>{var S;const{scope:P,children:R,...C}=y,j=((S=P==null?void 0:P[n])==null?void 0:S[x])||p,b=h.useMemo(()=>C,Object.values(C));return t.jsx(j.Provider,{value:b,children:R})};g.displayName=u+"Provider";function v(y,P){var j;const R=((j=P==null?void 0:P[n])==null?void 0:j[x])||p,C=h.useContext(R);if(C)return C;if(f!==void 0)return f;throw new Error(`\`${y}\` must be used within \`${u}\``)}return[g,v]}const c=()=>{const u=l.map(f=>h.createContext(f));return function(p){const x=(p==null?void 0:p[n])||u;return h.useMemo(()=>({[`__scope${n}`]:{...p,[n]:x}}),[p,x])}};return c.scopeName=n,[o,iw(c,...a)]}function iw(...n){const a=n[0];if(n.length===1)return a;const l=()=>{const o=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(u){const f=o.reduce((p,{useScope:x,scopeName:g})=>{const y=x(u)[`__scope${g}`];return{...p,...y}},{});return h.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])}};return l.scopeName=a.scopeName,l}var Vt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},ow=Ai[" useId ".trim().toString()]||(()=>{}),cw=0;function _n(n){const[a,l]=h.useState(ow());return Vt(()=>{l(o=>o??String(cw++))},[n]),a?`radix-${a}`:""}var dw=Ai[" useInsertionEffect ".trim().toString()]||Vt;function ls({prop:n,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,u,f]=uw({defaultProp:a,onChange:l}),p=n!==void 0,x=p?n:c;{const v=h.useRef(n!==void 0);h.useEffect(()=>{const y=v.current;y!==p&&console.warn(`${o} is changing from ${y?"controlled":"uncontrolled"} to ${p?"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=p},[p,o])}const g=h.useCallback(v=>{var y;if(p){const P=fw(v)?v(n):v;P!==n&&((y=f.current)==null||y.call(f,P))}else u(v)},[p,n,u,f]);return[x,g]}function uw({defaultProp:n,onChange:a}){const[l,o]=h.useState(n),c=h.useRef(l),u=h.useRef(a);return dw(()=>{u.current=a},[a]),h.useEffect(()=>{var f;c.current!==l&&((f=u.current)==null||f.call(u,l),c.current=l)},[l,c]),[l,o,u]}function fw(n){return typeof n=="function"}function Ua(n){const a=hw(n),l=h.forwardRef((o,c)=>{const{children:u,...f}=o,p=h.Children.toArray(u),x=p.find(pw);if(x){const g=x.props.children,v=p.map(y=>y===x?h.Children.count(g)>1?h.Children.only(null):h.isValidElement(g)?g.props.children:null:y);return t.jsx(a,{...f,ref:c,children:h.isValidElement(g)?h.cloneElement(g,void 0,v):null})}return t.jsx(a,{...f,ref:c,children:u})});return l.displayName=`${n}.Slot`,l}function hw(n){const a=h.forwardRef((l,o)=>{const{children:c,...u}=l;if(h.isValidElement(c)){const f=gw(c),p=xw(u,c.props);return c.type!==h.Fragment&&(p.ref=o?Ud(o,f):f),h.cloneElement(c,p)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${n}.SlotClone`,a}var mw=Symbol("radix.slottable");function pw(n){return h.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===mw}function xw(n,a){const l={...a};for(const o in a){const c=n[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...p)=>{const x=u(...p);return c(...p),x}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...n,...l}}function gw(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}var vw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=vw.reduce((n,a)=>{const l=Ua(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:f,...p}=c,x=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(x,{...p,ref:u})});return o.displayName=`Primitive.${a}`,{...n,[a]:o}},{});function yw(n,a){n&&Wa.flushSync(()=>n.dispatchEvent(a))}function An(n){const a=h.useRef(n);return h.useEffect(()=>{a.current=n}),h.useMemo(()=>(...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function jw(n,a=globalThis==null?void 0:globalThis.document){const l=An(n);h.useEffect(()=>{const o=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",o,{capture:!0}),()=>a.removeEventListener("keydown",o,{capture:!0})},[l,a])}var Nw="DismissableLayer",yd="dismissableLayer.update",bw="dismissableLayer.pointerDownOutside",ww="dismissableLayer.focusOutside",Dm,Hp=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wd=h.forwardRef((n,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,onDismiss:p,...x}=n,g=h.useContext(Hp),[v,y]=h.useState(null),P=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,R]=h.useState({}),C=Xe(a,k=>y(k)),j=Array.from(g.layers),[b]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),S=j.indexOf(b),E=v?j.indexOf(v):-1,w=g.layersWithOutsidePointerEventsDisabled.size>0,M=E>=S,D=kw(k=>{const T=k.target,U=[...g.branches].some(Q=>Q.contains(T));!M||U||(c==null||c(k),f==null||f(k),k.defaultPrevented||p==null||p())},P),V=Ew(k=>{const T=k.target;[...g.branches].some(Q=>Q.contains(T))||(u==null||u(k),f==null||f(k),k.defaultPrevented||p==null||p())},P);return jw(k=>{E===g.layers.size-1&&(o==null||o(k),!k.defaultPrevented&&p&&(k.preventDefault(),p()))},P),h.useEffect(()=>{if(v)return l&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Dm=P.body.style.pointerEvents,P.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),Lm(),()=>{l&&g.layersWithOutsidePointerEventsDisabled.size===1&&(P.body.style.pointerEvents=Dm)}},[v,P,l,g]),h.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),Lm())},[v,g]),h.useEffect(()=>{const k=()=>R({});return document.addEventListener(yd,k),()=>document.removeEventListener(yd,k)},[]),t.jsx(Ue.div,{...x,ref:C,style:{pointerEvents:w?M?"auto":"none":void 0,...n.style},onFocusCapture:Fe(n.onFocusCapture,V.onFocusCapture),onBlurCapture:Fe(n.onBlurCapture,V.onBlurCapture),onPointerDownCapture:Fe(n.onPointerDownCapture,D.onPointerDownCapture)})});Wd.displayName=Nw;var Sw="DismissableLayerBranch",Cw=h.forwardRef((n,a)=>{const l=h.useContext(Hp),o=h.useRef(null),c=Xe(a,o);return h.useEffect(()=>{const u=o.current;if(u)return l.branches.add(u),()=>{l.branches.delete(u)}},[l.branches]),t.jsx(Ue.div,{...n,ref:c})});Cw.displayName=Sw;function kw(n,a=globalThis==null?void 0:globalThis.document){const l=An(n),o=h.useRef(!1),c=h.useRef(()=>{});return h.useEffect(()=>{const u=p=>{if(p.target&&!o.current){let x=function(){Kp(bw,l,g,{discrete:!0})};const g={originalEvent:p};p.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=x,a.addEventListener("click",c.current,{once:!0})):x()}else a.removeEventListener("click",c.current);o.current=!1},f=window.setTimeout(()=>{a.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(f),a.removeEventListener("pointerdown",u),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>o.current=!0}}function Ew(n,a=globalThis==null?void 0:globalThis.document){const l=An(n),o=h.useRef(!1);return h.useEffect(()=>{const c=u=>{u.target&&!o.current&&Kp(ww,l,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Lm(){const n=new CustomEvent(yd);document.dispatchEvent(n)}function Kp(n,a,l,{discrete:o}){const c=l.originalEvent.target,u=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(n,a,{once:!0}),o?yw(c,u):c.dispatchEvent(u)}var qc="focusScope.autoFocusOnMount",Xc="focusScope.autoFocusOnUnmount",Om={bubbles:!1,cancelable:!0},Pw="FocusScope",Hd=h.forwardRef((n,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:u,...f}=n,[p,x]=h.useState(null),g=An(c),v=An(u),y=h.useRef(null),P=Xe(a,j=>x(j)),R=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let j=function(w){if(R.paused||!p)return;const M=w.target;p.contains(M)?y.current=M:kn(y.current,{select:!0})},b=function(w){if(R.paused||!p)return;const M=w.relatedTarget;M!==null&&(p.contains(M)||kn(y.current,{select:!0}))},S=function(w){if(document.activeElement===document.body)for(const D of w)D.removedNodes.length>0&&kn(p)};document.addEventListener("focusin",j),document.addEventListener("focusout",b);const E=new MutationObserver(S);return p&&E.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",b),E.disconnect()}}},[o,p,R.paused]),h.useEffect(()=>{if(p){zm.add(R);const j=document.activeElement;if(!p.contains(j)){const S=new CustomEvent(qc,Om);p.addEventListener(qc,g),p.dispatchEvent(S),S.defaultPrevented||(Rw(Mw(Yp(p)),{select:!0}),document.activeElement===j&&kn(p))}return()=>{p.removeEventListener(qc,g),setTimeout(()=>{const S=new CustomEvent(Xc,Om);p.addEventListener(Xc,v),p.dispatchEvent(S),S.defaultPrevented||kn(j??document.body,{select:!0}),p.removeEventListener(Xc,v),zm.remove(R)},0)}}},[p,g,v,R]);const C=h.useCallback(j=>{if(!l&&!o||R.paused)return;const b=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,S=document.activeElement;if(b&&S){const E=j.currentTarget,[w,M]=Tw(E);w&&M?!j.shiftKey&&S===M?(j.preventDefault(),l&&kn(w,{select:!0})):j.shiftKey&&S===w&&(j.preventDefault(),l&&kn(M,{select:!0})):S===E&&j.preventDefault()}},[l,o,R.paused]);return t.jsx(Ue.div,{tabIndex:-1,...f,ref:P,onKeyDown:C})});Hd.displayName=Pw;function Rw(n,{select:a=!1}={}){const l=document.activeElement;for(const o of n)if(kn(o,{select:a}),document.activeElement!==l)return}function Tw(n){const a=Yp(n),l=Fm(a,n),o=Fm(a.reverse(),n);return[l,o]}function Yp(n){const a=[],l=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function Fm(n,a){for(const l of n)if(!_w(l,{upTo:a}))return l}function _w(n,{upTo:a}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(a!==void 0&&n===a)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function Iw(n){return n instanceof HTMLInputElement&&"select"in n}function kn(n,{select:a=!1}={}){if(n&&n.focus){const l=document.activeElement;n.focus({preventScroll:!0}),n!==l&&Iw(n)&&a&&n.select()}}var zm=Aw();function Aw(){let n=[];return{add(a){const l=n[0];a!==l&&(l==null||l.pause()),n=$m(n,a),n.unshift(a)},remove(a){var l;n=$m(n,a),(l=n[0])==null||l.resume()}}}function $m(n,a){const l=[...n],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function Mw(n){return n.filter(a=>a.tagName!=="A")}var Dw="Portal",Kd=h.forwardRef((n,a)=>{var p;const{container:l,...o}=n,[c,u]=h.useState(!1);Vt(()=>u(!0),[]);const f=l||c&&((p=globalThis==null?void 0:globalThis.document)==null?void 0:p.body);return f?dy.createPortal(t.jsx(Ue.div,{...o,ref:a}),f):null});Kd.displayName=Dw;function Lw(n,a){return h.useReducer((l,o)=>a[l][o]??l,n)}var Ka=n=>{const{present:a,children:l}=n,o=Ow(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),u=Xe(o.ref,Fw(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:u}):null};Ka.displayName="Presence";function Ow(n){const[a,l]=h.useState(),o=h.useRef(null),c=h.useRef(n),u=h.useRef("none"),f=n?"mounted":"unmounted",[p,x]=Lw(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const g=li(o.current);u.current=p==="mounted"?g:"none"},[p]),Vt(()=>{const g=o.current,v=c.current;if(v!==n){const P=u.current,R=li(g);n?x("MOUNT"):R==="none"||(g==null?void 0:g.display)==="none"?x("UNMOUNT"):x(v&&P!==R?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,x]),Vt(()=>{if(a){let g;const v=a.ownerDocument.defaultView??window,y=R=>{const j=li(o.current).includes(CSS.escape(R.animationName));if(R.target===a&&j&&(x("ANIMATION_END"),!c.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",g=v.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},P=R=>{R.target===a&&(u.current=li(o.current))};return a.addEventListener("animationstart",P),a.addEventListener("animationcancel",y),a.addEventListener("animationend",y),()=>{v.clearTimeout(g),a.removeEventListener("animationstart",P),a.removeEventListener("animationcancel",y),a.removeEventListener("animationend",y)}}else x("ANIMATION_END")},[a,x]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:h.useCallback(g=>{o.current=g?getComputedStyle(g):null,l(g)},[])}}function li(n){return(n==null?void 0:n.animationName)||"none"}function Fw(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}var Jc=0;function Gp(){h.useEffect(()=>{const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",n[0]??Bm()),document.body.insertAdjacentElement("beforeend",n[1]??Bm()),Jc++,()=>{Jc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Jc--}},[])}function Bm(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var Mr=function(){return Mr=Object.assign||function(a){for(var l,o=1,c=arguments.length;o<c;o++){l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},Mr.apply(this,arguments)};function Qp(n,a){var l={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&a.indexOf(o)<0&&(l[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(n);c<o.length;c++)a.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(n,o[c])&&(l[o[c]]=n[o[c]]);return l}function zw(n,a,l){if(l||arguments.length===2)for(var o=0,c=a.length,u;o<c;o++)(u||!(o in a))&&(u||(u=Array.prototype.slice.call(a,0,o)),u[o]=a[o]);return n.concat(u||Array.prototype.slice.call(a))}var mi="right-scroll-bar-position",pi="width-before-scroll-bar",$w="with-scroll-bars-hidden",Bw="--removed-body-scroll-bar-size";function Zc(n,a){return typeof n=="function"?n(a):n&&(n.current=a),n}function Uw(n,a){var l=h.useState(function(){return{value:n,callback:a,facade:{get current(){return l.value},set current(o){var c=l.value;c!==o&&(l.value=o,l.callback(o,c))}}}})[0];return l.callback=a,l.facade}var Vw=typeof window<"u"?h.useLayoutEffect:h.useEffect,Um=new WeakMap;function Ww(n,a){var l=Uw(null,function(o){return n.forEach(function(c){return Zc(c,o)})});return Vw(function(){var o=Um.get(l);if(o){var c=new Set(o),u=new Set(n),f=l.current;c.forEach(function(p){u.has(p)||Zc(p,null)}),u.forEach(function(p){c.has(p)||Zc(p,f)})}Um.set(l,n)},[n]),l}function Hw(n){return n}function Kw(n,a){a===void 0&&(a=Hw);var l=[],o=!1,c={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return l.length?l[l.length-1]:n},useMedium:function(u){var f=a(u,o);return l.push(f),function(){l=l.filter(function(p){return p!==f})}},assignSyncMedium:function(u){for(o=!0;l.length;){var f=l;l=[],f.forEach(u)}l={push:function(p){return u(p)},filter:function(){return l}}},assignMedium:function(u){o=!0;var f=[];if(l.length){var p=l;l=[],p.forEach(u),f=l}var x=function(){var v=f;f=[],v.forEach(u)},g=function(){return Promise.resolve().then(x)};g(),l={push:function(v){f.push(v),g()},filter:function(v){return f=f.filter(v),l}}}};return c}function Yw(n){n===void 0&&(n={});var a=Kw(null);return a.options=Mr({async:!0,ssr:!1},n),a}var qp=function(n){var a=n.sideCar,l=Qp(n,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=a.read();if(!o)throw new Error("Sidecar medium not found");return h.createElement(o,Mr({},l))};qp.isSideCarExport=!0;function Gw(n,a){return n.useMedium(a),qp}var Xp=Yw(),ed=function(){},Fi=h.forwardRef(function(n,a){var l=h.useRef(null),o=h.useState({onScrollCapture:ed,onWheelCapture:ed,onTouchMoveCapture:ed}),c=o[0],u=o[1],f=n.forwardProps,p=n.children,x=n.className,g=n.removeScrollBar,v=n.enabled,y=n.shards,P=n.sideCar,R=n.noRelative,C=n.noIsolation,j=n.inert,b=n.allowPinchZoom,S=n.as,E=S===void 0?"div":S,w=n.gapMode,M=Qp(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=P,V=Ww([l,a]),k=Mr(Mr({},M),c);return h.createElement(h.Fragment,null,v&&h.createElement(D,{sideCar:Xp,removeScrollBar:g,shards:y,noRelative:R,noIsolation:C,inert:j,setCallbacks:u,allowPinchZoom:!!b,lockRef:l,gapMode:w}),f?h.cloneElement(h.Children.only(p),Mr(Mr({},k),{ref:V})):h.createElement(E,Mr({},k,{className:x,ref:V}),p))});Fi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Fi.classNames={fullWidth:pi,zeroRight:mi};var Qw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qw(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var a=Qw();return a&&n.setAttribute("nonce",a),n}function Xw(n,a){n.styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a))}function Jw(n){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(n)}var Zw=function(){var n=0,a=null;return{add:function(l){n==0&&(a=qw())&&(Xw(a,l),Jw(a)),n++},remove:function(){n--,!n&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},e1=function(){var n=Zw();return function(a,l){h.useEffect(function(){return n.add(a),function(){n.remove()}},[a&&l])}},Jp=function(){var n=e1(),a=function(l){var o=l.styles,c=l.dynamic;return n(o,c),null};return a},t1={left:0,top:0,right:0,gap:0},td=function(n){return parseInt(n||"",10)||0},r1=function(n){var a=window.getComputedStyle(document.body),l=a[n==="padding"?"paddingLeft":"marginLeft"],o=a[n==="padding"?"paddingTop":"marginTop"],c=a[n==="padding"?"paddingRight":"marginRight"];return[td(l),td(o),td(c)]},n1=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return t1;var a=r1(n),l=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-l+a[2]-a[0])}},s1=Jp(),$s="data-scroll-locked",a1=function(n,a,l,o){var c=n.left,u=n.top,f=n.right,p=n.gap;return l===void 0&&(l="margin"),`
|
||
.`.concat($w,` {
|
||
overflow: hidden `).concat(o,`;
|
||
padding-right: `).concat(p,"px ").concat(o,`;
|
||
}
|
||
body[`).concat($s,`] {
|
||
overflow: hidden `).concat(o,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&`
|
||
padding-left: `.concat(c,`px;
|
||
padding-top: `).concat(u,`px;
|
||
padding-right: `).concat(f,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(p,"px ").concat(o,`;
|
||
`),l==="padding"&&"padding-right: ".concat(p,"px ").concat(o,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(mi,` {
|
||
right: `).concat(p,"px ").concat(o,`;
|
||
}
|
||
|
||
.`).concat(pi,` {
|
||
margin-right: `).concat(p,"px ").concat(o,`;
|
||
}
|
||
|
||
.`).concat(mi," .").concat(mi,` {
|
||
right: 0 `).concat(o,`;
|
||
}
|
||
|
||
.`).concat(pi," .").concat(pi,` {
|
||
margin-right: 0 `).concat(o,`;
|
||
}
|
||
|
||
body[`).concat($s,`] {
|
||
`).concat(Bw,": ").concat(p,`px;
|
||
}
|
||
`)},Vm=function(){var n=parseInt(document.body.getAttribute($s)||"0",10);return isFinite(n)?n:0},l1=function(){h.useEffect(function(){return document.body.setAttribute($s,(Vm()+1).toString()),function(){var n=Vm()-1;n<=0?document.body.removeAttribute($s):document.body.setAttribute($s,n.toString())}},[])},i1=function(n){var a=n.noRelative,l=n.noImportant,o=n.gapMode,c=o===void 0?"margin":o;l1();var u=h.useMemo(function(){return n1(c)},[c]);return h.createElement(s1,{styles:a1(u,!a,c,l?"":"!important")})},jd=!1;if(typeof window<"u")try{var ii=Object.defineProperty({},"passive",{get:function(){return jd=!0,!0}});window.addEventListener("test",ii,ii),window.removeEventListener("test",ii,ii)}catch{jd=!1}var Os=jd?{passive:!1}:!1,o1=function(n){return n.tagName==="TEXTAREA"},Zp=function(n,a){if(!(n instanceof Element))return!1;var l=window.getComputedStyle(n);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!o1(n)&&l[a]==="visible")},c1=function(n){return Zp(n,"overflowY")},d1=function(n){return Zp(n,"overflowX")},Wm=function(n,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=ex(n,o);if(c){var u=tx(n,o),f=u[1],p=u[2];if(f>p)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},u1=function(n){var a=n.scrollTop,l=n.scrollHeight,o=n.clientHeight;return[a,l,o]},f1=function(n){var a=n.scrollLeft,l=n.scrollWidth,o=n.clientWidth;return[a,l,o]},ex=function(n,a){return n==="v"?c1(a):d1(a)},tx=function(n,a){return n==="v"?u1(a):f1(a)},h1=function(n,a){return n==="h"&&a==="rtl"?-1:1},m1=function(n,a,l,o,c){var u=h1(n,window.getComputedStyle(a).direction),f=u*o,p=l.target,x=a.contains(p),g=!1,v=f>0,y=0,P=0;do{if(!p)break;var R=tx(n,p),C=R[0],j=R[1],b=R[2],S=j-b-u*C;(C||S)&&ex(n,p)&&(y+=S,P+=C);var E=p.parentNode;p=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!x&&p!==document.body||x&&(a.contains(p)||a===p));return(v&&Math.abs(y)<1||!v&&Math.abs(P)<1)&&(g=!0),g},oi=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Hm=function(n){return[n.deltaX,n.deltaY]},Km=function(n){return n&&"current"in n?n.current:n},p1=function(n,a){return n[0]===a[0]&&n[1]===a[1]},x1=function(n){return`
|
||
.block-interactivity-`.concat(n,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(n,` {pointer-events: all;}
|
||
`)},g1=0,Fs=[];function v1(n){var a=h.useRef([]),l=h.useRef([0,0]),o=h.useRef(),c=h.useState(g1++)[0],u=h.useState(Jp)[0],f=h.useRef(n);h.useEffect(function(){f.current=n},[n]),h.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var j=zw([n.lockRef.current],(n.shards||[]).map(Km),!0).filter(Boolean);return j.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),j.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var p=h.useCallback(function(j,b){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!f.current.allowPinchZoom;var S=oi(j),E=l.current,w="deltaX"in j?j.deltaX:E[0]-S[0],M="deltaY"in j?j.deltaY:E[1]-S[1],D,V=j.target,k=Math.abs(w)>Math.abs(M)?"h":"v";if("touches"in j&&k==="h"&&V.type==="range")return!1;var T=window.getSelection(),U=T&&T.anchorNode,Q=U?U===V||U.contains(V):!1;if(Q)return!1;var te=Wm(k,V);if(!te)return!0;if(te?D=k:(D=k==="v"?"h":"v",te=Wm(k,V)),!te)return!1;if(!o.current&&"changedTouches"in j&&(w||M)&&(o.current=D),!D)return!0;var oe=o.current||D;return m1(oe,b,j,oe==="h"?w:M)},[]),x=h.useCallback(function(j){var b=j;if(!(!Fs.length||Fs[Fs.length-1]!==u)){var S="deltaY"in b?Hm(b):oi(b),E=a.current.filter(function(D){return D.name===b.type&&(D.target===b.target||b.target===D.shadowParent)&&p1(D.delta,S)})[0];if(E&&E.should){b.cancelable&&b.preventDefault();return}if(!E){var w=(f.current.shards||[]).map(Km).filter(Boolean).filter(function(D){return D.contains(b.target)}),M=w.length>0?p(b,w[0]):!f.current.noIsolation;M&&b.cancelable&&b.preventDefault()}}},[]),g=h.useCallback(function(j,b,S,E){var w={name:j,delta:b,target:S,should:E,shadowParent:y1(S)};a.current.push(w),setTimeout(function(){a.current=a.current.filter(function(M){return M!==w})},1)},[]),v=h.useCallback(function(j){l.current=oi(j),o.current=void 0},[]),y=h.useCallback(function(j){g(j.type,Hm(j),j.target,p(j,n.lockRef.current))},[]),P=h.useCallback(function(j){g(j.type,oi(j),j.target,p(j,n.lockRef.current))},[]);h.useEffect(function(){return Fs.push(u),n.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:P}),document.addEventListener("wheel",x,Os),document.addEventListener("touchmove",x,Os),document.addEventListener("touchstart",v,Os),function(){Fs=Fs.filter(function(j){return j!==u}),document.removeEventListener("wheel",x,Os),document.removeEventListener("touchmove",x,Os),document.removeEventListener("touchstart",v,Os)}},[]);var R=n.removeScrollBar,C=n.inert;return h.createElement(h.Fragment,null,C?h.createElement(u,{styles:x1(c)}):null,R?h.createElement(i1,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function y1(n){for(var a=null;n!==null;)n instanceof ShadowRoot&&(a=n.host,n=n.host),n=n.parentNode;return a}const j1=Gw(Xp,v1);var Yd=h.forwardRef(function(n,a){return h.createElement(Fi,Mr({},n,{ref:a,sideCar:j1}))});Yd.classNames=Fi.classNames;var N1=function(n){if(typeof document>"u")return null;var a=Array.isArray(n)?n[0]:n;return a.ownerDocument.body},zs=new WeakMap,ci=new WeakMap,di={},rd=0,rx=function(n){return n&&(n.host||rx(n.parentNode))},b1=function(n,a){return a.map(function(l){if(n.contains(l))return l;var o=rx(l);return o&&n.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",n,". Doing nothing"),null)}).filter(function(l){return!!l})},w1=function(n,a,l,o){var c=b1(a,Array.isArray(n)?n:[n]);di[l]||(di[l]=new WeakMap);var u=di[l],f=[],p=new Set,x=new Set(c),g=function(y){!y||p.has(y)||(p.add(y),g(y.parentNode))};c.forEach(g);var v=function(y){!y||x.has(y)||Array.prototype.forEach.call(y.children,function(P){if(p.has(P))v(P);else try{var R=P.getAttribute(o),C=R!==null&&R!=="false",j=(zs.get(P)||0)+1,b=(u.get(P)||0)+1;zs.set(P,j),u.set(P,b),f.push(P),j===1&&C&&ci.set(P,!0),b===1&&P.setAttribute(l,"true"),C||P.setAttribute(o,"true")}catch(S){console.error("aria-hidden: cannot operate on ",P,S)}})};return v(a),p.clear(),rd++,function(){f.forEach(function(y){var P=zs.get(y)-1,R=u.get(y)-1;zs.set(y,P),u.set(y,R),P||(ci.has(y)||y.removeAttribute(o),ci.delete(y)),R||y.removeAttribute(l)}),rd--,rd||(zs=new WeakMap,zs=new WeakMap,ci=new WeakMap,di={})}},nx=function(n,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(n)?n:[n]),c=N1(n);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),w1(o,c,l,"aria-hidden")):function(){return null}},zi="Dialog",[sx]=On(zi),[S1,Pr]=sx(zi),ax=n=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:u,modal:f=!0}=n,p=h.useRef(null),x=h.useRef(null),[g,v]=ls({prop:o,defaultProp:c??!1,onChange:u,caller:zi});return t.jsx(S1,{scope:a,triggerRef:p,contentRef:x,contentId:_n(),titleId:_n(),descriptionId:_n(),open:g,onOpenChange:v,onOpenToggle:h.useCallback(()=>v(y=>!y),[v]),modal:f,children:l})};ax.displayName=zi;var lx="DialogTrigger",C1=h.forwardRef((n,a)=>{const{__scopeDialog:l,...o}=n,c=Pr(lx,l),u=Xe(a,c.triggerRef);return t.jsx(Ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":qd(c.open),...o,ref:u,onClick:Fe(n.onClick,c.onOpenToggle)})});C1.displayName=lx;var Gd="DialogPortal",[k1,ix]=sx(Gd,{forceMount:void 0}),ox=n=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=n,u=Pr(Gd,a);return t.jsx(k1,{scope:a,forceMount:l,children:h.Children.map(o,f=>t.jsx(Ka,{present:l||u.open,children:t.jsx(Kd,{asChild:!0,container:c,children:f})}))})};ox.displayName=Gd;var ki="DialogOverlay",cx=h.forwardRef((n,a)=>{const l=ix(ki,n.__scopeDialog),{forceMount:o=l.forceMount,...c}=n,u=Pr(ki,n.__scopeDialog);return u.modal?t.jsx(Ka,{present:o||u.open,children:t.jsx(P1,{...c,ref:a})}):null});cx.displayName=ki;var E1=Ua("DialogOverlay.RemoveScroll"),P1=h.forwardRef((n,a)=>{const{__scopeDialog:l,...o}=n,c=Pr(ki,l);return t.jsx(Yd,{as:E1,allowPinchZoom:!0,shards:[c.contentRef],children:t.jsx(Ue.div,{"data-state":qd(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),is="DialogContent",dx=h.forwardRef((n,a)=>{const l=ix(is,n.__scopeDialog),{forceMount:o=l.forceMount,...c}=n,u=Pr(is,n.__scopeDialog);return t.jsx(Ka,{present:o||u.open,children:u.modal?t.jsx(R1,{...c,ref:a}):t.jsx(T1,{...c,ref:a})})});dx.displayName=is;var R1=h.forwardRef((n,a)=>{const l=Pr(is,n.__scopeDialog),o=h.useRef(null),c=Xe(a,l.contentRef,o);return h.useEffect(()=>{const u=o.current;if(u)return nx(u)},[]),t.jsx(ux,{...n,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Fe(n.onCloseAutoFocus,u=>{var f;u.preventDefault(),(f=l.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Fe(n.onPointerDownOutside,u=>{const f=u.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0;(f.button===2||p)&&u.preventDefault()}),onFocusOutside:Fe(n.onFocusOutside,u=>u.preventDefault())})}),T1=h.forwardRef((n,a)=>{const l=Pr(is,n.__scopeDialog),o=h.useRef(!1),c=h.useRef(!1);return t.jsx(ux,{...n,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,p;(f=n.onCloseAutoFocus)==null||f.call(n,u),u.defaultPrevented||(o.current||(p=l.triggerRef.current)==null||p.focus(),u.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:u=>{var x,g;(x=n.onInteractOutside)==null||x.call(n,u),u.defaultPrevented||(o.current=!0,u.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=u.target;((g=l.triggerRef.current)==null?void 0:g.contains(f))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&c.current&&u.preventDefault()}})}),ux=h.forwardRef((n,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:u,...f}=n,p=Pr(is,l),x=h.useRef(null),g=Xe(a,x);return Gp(),t.jsxs(t.Fragment,{children:[t.jsx(Hd,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:u,children:t.jsx(Wd,{role:"dialog",id:p.contentId,"aria-describedby":p.descriptionId,"aria-labelledby":p.titleId,"data-state":qd(p.open),...f,ref:g,onDismiss:()=>p.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(_1,{titleId:p.titleId}),t.jsx(A1,{contentRef:x,descriptionId:p.descriptionId})]})]})}),Qd="DialogTitle",fx=h.forwardRef((n,a)=>{const{__scopeDialog:l,...o}=n,c=Pr(Qd,l);return t.jsx(Ue.h2,{id:c.titleId,...o,ref:a})});fx.displayName=Qd;var hx="DialogDescription",mx=h.forwardRef((n,a)=>{const{__scopeDialog:l,...o}=n,c=Pr(hx,l);return t.jsx(Ue.p,{id:c.descriptionId,...o,ref:a})});mx.displayName=hx;var px="DialogClose",xx=h.forwardRef((n,a)=>{const{__scopeDialog:l,...o}=n,c=Pr(px,l);return t.jsx(Ue.button,{type:"button",...o,ref:a,onClick:Fe(n.onClick,()=>c.onOpenChange(!1))})});xx.displayName=px;function qd(n){return n?"open":"closed"}var gx="DialogTitleWarning",[g4,vx]=lw(gx,{contentName:is,titleName:Qd,docsSlug:"dialog"}),_1=({titleId:n})=>{const a=vx(gx),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 h.useEffect(()=>{n&&(document.getElementById(n)||console.error(l))},[l,n]),null},I1="DialogDescriptionWarning",A1=({contentRef:n,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${vx(I1).contentName}}.`;return h.useEffect(()=>{var u;const c=(u=n.current)==null?void 0:u.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(o))},[o,n,a]),null},M1=ax,D1=ox,L1=cx,O1=dx,F1=fx,z1=mx,$1=xx;function $t(n){return t.jsx(M1,{"data-slot":"dialog",...n})}function B1(n){return t.jsx(D1,{...n})}const yx=h.forwardRef(({className:n,...a},l)=>t.jsx(L1,{ref:l,className:Je("fixed inset-0 z-50 bg-black/50",n),...a}));yx.displayName="DialogOverlay";const It=h.forwardRef(({className:n,children:a,showCloseButton:l=!0,...o},c)=>t.jsxs(B1,{children:[t.jsx(yx,{}),t.jsxs(O1,{ref:c,"aria-describedby":void 0,className:Je("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",n),...o,children:[a,l&&t.jsxs($1,{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:[t.jsx(pr,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));It.displayName="DialogContent";function Bt({className:n,...a}){return t.jsx("div",{className:Je("flex flex-col gap-2 text-center sm:text-left",n),...a})}function Kt({className:n,...a}){return t.jsx("div",{className:Je("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...a})}function Ut(n){return t.jsx(F1,{className:"text-lg font-semibold leading-none",...n})}function U1(n){return t.jsx(z1,{className:"text-sm text-muted-foreground",...n})}function Xd(n,a){const[l,o]=h.useState(n);return h.useEffect(()=>{const c=setTimeout(()=>o(n),a);return()=>clearTimeout(c)},[n,a]),l}function In({page:n,totalPages:a,total:l,pageSize:o,onPageChange:c,onPageSizeChange:u,pageSizeOptions:f=[10,20,50,100]}){return a<=1&&!u?null:t.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[t.jsxs("span",{children:["共 ",l," 条"]}),u&&t.jsx("select",{value:o,onChange:p=>u(Number(p.target.value)),className:"bg-[#0f2137] border border-gray-600 rounded px-2 py-1 text-gray-300 text-sm",children:f.map(p=>t.jsxs("option",{value:p,children:[p," 条/页"]},p))})]}),a>1&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{type:"button",onClick:()=>c(1),disabled:n<=1,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"首页"}),t.jsx("button",{type:"button",onClick:()=>c(n-1),disabled:n<=1,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"上一页"}),t.jsxs("span",{className:"px-3 py-1 text-gray-400 text-sm",children:[n," / ",a]}),t.jsx("button",{type:"button",onClick:()=>c(n+1),disabled:n>=a,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"下一页"}),t.jsx("button",{type:"button",onClick:()=>c(a),disabled:n>=a,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"末页"})]})]})}function V1(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState(0),[f,p]=h.useState(0),[x,g]=h.useState(0),[v,y]=h.useState(1),[P,R]=h.useState(10),[C,j]=h.useState(""),b=Xd(C,300),[S,E]=h.useState("all"),[w,M]=h.useState(!0),[D,V]=h.useState(null),[k,T]=h.useState(null),[U,Q]=h.useState(""),[te,oe]=h.useState(!1);async function he(){M(!0),V(null);try{const z=S==="all"?"":S==="completed"?"completed":S,A=new URLSearchParams({page:String(v),pageSize:String(P),...z&&{status:z},...b&&{search:b}}),[F,G]=await Promise.all([Ge(`/api/orders?${A}`),Ge("/api/db/users?page=1&pageSize=500")]);F!=null&&F.success&&(a(F.orders||[]),u(F.total??0),p(F.totalRevenue??0),g(F.todayRevenue??0)),G!=null&&G.success&&G.users&&o(G.users)}catch(z){console.error("加载订单失败",z),V("加载订单失败,请检查网络后重试")}finally{M(!1)}}h.useEffect(()=>{y(1)},[b,S]),h.useEffect(()=>{he()},[v,P,b,S]);const ne=z=>{var A;return z.userNickname||((A=l.find(F=>F.id===z.userId))==null?void 0:A.nickname)||"匿名用户"},le=z=>{var A;return((A=l.find(F=>F.id===z))==null?void 0:A.phone)||"-"},Z=z=>{const A=z.productType||z.type||"",F=z.description||"";if(F){if(A==="section"&&F.includes("章节")){if(F.includes("-")){const G=F.split("-");if(G.length>=3)return{name:`第${G[1]}章 第${G[2]}节`,type:"《一场Soul的创业实验》"}}return{name:F,type:"章节购买"}}return A==="fullbook"||F.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:A==="vip"||F.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:A==="match"||F.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:F,type:"其他"}}return A==="section"?{name:`章节 ${z.productId||z.sectionId||""}`,type:"单章"}:A==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:A==="vip"?{name:"VIP年度会员",type:"VIP"}:A==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:A||"其他"}},$=Math.ceil(c/P)||1;async function _(){var z;if(!(!(k!=null&&k.orderSn)&&!(k!=null&&k.id))){oe(!0),V(null);try{const A=await St("/api/admin/orders/refund",{orderSn:k.orderSn||k.id,reason:U||void 0});A!=null&&A.success?(T(null),Q(""),he()):V((A==null?void 0:A.error)||"退款失败")}catch(A){const F=A;V(((z=F==null?void 0:F.data)==null?void 0:z.error)||"退款失败,请检查网络后重试")}finally{oe(!1)}}}function q(){if(n.length===0){alert("暂无数据可导出");return}const z=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],A=n.map(me=>{const re=Z(me);return[me.orderSn||me.id||"",ne(me),le(me.userId),re.name,Number(me.amount||0).toFixed(2),me.paymentMethod==="wechat"?"微信支付":me.paymentMethod==="alipay"?"支付宝":me.paymentMethod||"微信支付",me.status==="refunded"?"已退款":me.status==="paid"||me.status==="completed"?"已完成":me.status==="pending"||me.status==="created"?"待支付":"已失败",me.status==="refunded"&&me.refundReason?me.refundReason:"-",me.referrerEarnings?Number(me.referrerEarnings).toFixed(2):"-",me.createdAt?new Date(me.createdAt).toLocaleString("zh-CN"):""].join(",")}),F="\uFEFF"+[z.join(","),...A].join(`
|
||
`),G=new Blob([F],{type:"text/csv;charset=utf-8"}),J=URL.createObjectURL(G),xe=document.createElement("a");xe.href=J,xe.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,xe.click(),URL.revokeObjectURL(J)}return t.jsxs("div",{className:"p-8 w-full",children:[D&&t.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[t.jsx("span",{children:D}),t.jsx("button",{type:"button",onClick:()=>V(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"订单管理"}),t.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",n.length," 笔订单"]})]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs(ee,{variant:"outline",onClick:he,disabled:w,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${w?"animate-spin":""}`}),"刷新"]}),t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"text-gray-400",children:"总收入:"}),t.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",f.toFixed(2)]}),t.jsx("span",{className:"text-gray-600",children:"|"}),t.jsx("span",{className:"text-gray-400",children:"今日:"}),t.jsxs("span",{className:"text-[#FFD700] font-bold",children:["¥",x.toFixed(2)]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[t.jsxs("div",{className:"relative flex-1 max-w-md",children:[t.jsx(rs,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),t.jsx(ae,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:C,onChange:z=>j(z.target.value)})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Gj,{className:"w-4 h-4 text-gray-400"}),t.jsxs("select",{value:S,onChange:z=>E(z.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[t.jsx("option",{value:"all",children:"全部状态"}),t.jsx("option",{value:"completed",children:"已完成"}),t.jsx("option",{value:"pending",children:"待支付"}),t.jsx("option",{value:"created",children:"已创建"}),t.jsx("option",{value:"failed",children:"已失败"}),t.jsx("option",{value:"refunded",children:"已退款"})]})]}),t.jsxs(ee,{variant:"outline",onClick:q,disabled:n.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Uj,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(Re,{className:"p-0",children:w?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsxs("div",{children:[t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"订单号"}),t.jsx(Te,{className:"text-gray-400",children:"用户"}),t.jsx(Te,{className:"text-gray-400",children:"商品"}),t.jsx(Te,{className:"text-gray-400",children:"金额"}),t.jsx(Te,{className:"text-gray-400",children:"支付方式"}),t.jsx(Te,{className:"text-gray-400",children:"状态"}),t.jsx(Te,{className:"text-gray-400",children:"退款原因"}),t.jsx(Te,{className:"text-gray-400",children:"分销佣金"}),t.jsx(Te,{className:"text-gray-400",children:"下单时间"}),t.jsx(Te,{className:"text-gray-400",children:"操作"})]})}),t.jsxs(tn,{children:[n.map(z=>{const A=Z(z);return t.jsxs(ot,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsxs(Ce,{className:"font-mono text-xs text-gray-400",children:[(z.orderSn||z.id||"").slice(0,12),"..."]}),t.jsx(Ce,{children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white text-sm",children:ne(z)}),t.jsx("p",{className:"text-gray-500 text-xs",children:le(z.userId)})]})}),t.jsx(Ce,{children:t.jsxs("div",{children:[t.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[A.name,(z.productType||z.type)==="vip"&&t.jsx($e,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0 text-xs",children:"VIP"})]}),t.jsx("p",{className:"text-gray-500 text-xs",children:A.type})]})}),t.jsxs(Ce,{className:"text-[#38bdac] font-bold",children:["¥",Number(z.amount||0).toFixed(2)]}),t.jsx(Ce,{className:"text-gray-300",children:z.paymentMethod==="wechat"?"微信支付":z.paymentMethod==="alipay"?"支付宝":z.paymentMethod||"微信支付"}),t.jsx(Ce,{children:z.status==="refunded"?t.jsx($e,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):z.status==="paid"||z.status==="completed"?t.jsx($e,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):z.status==="pending"||z.status==="created"?t.jsx($e,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):t.jsx($e,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),t.jsx(Ce,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:z.refundReason,children:z.status==="refunded"&&z.refundReason?z.refundReason:"-"}),t.jsx(Ce,{className:"text-[#FFD700]",children:z.referrerEarnings?`¥${Number(z.referrerEarnings).toFixed(2)}`:"-"}),t.jsx(Ce,{className:"text-gray-400 text-sm",children:new Date(z.createdAt).toLocaleString("zh-CN")}),t.jsx(Ce,{children:(z.status==="paid"||z.status==="completed")&&t.jsxs(ee,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{T(z),Q("")},children:[t.jsx(kp,{className:"w-3 h-3 mr-1"}),"退款"]})})]},z.id)}),n.length===0&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),t.jsx(In,{page:v,totalPages:$,total:c,pageSize:P,onPageChange:y,onPageSizeChange:z=>{R(z),y(1)}})]})})}),t.jsx($t,{open:!!k,onOpenChange:z=>!z&&T(null),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Bt,{children:t.jsx(Ut,{className:"text-white",children:"订单退款"})}),k&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",k.orderSn||k.id]}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(k.amount||0).toFixed(2)]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),t.jsx("div",{className:"form-input",children:t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:U,onChange:z=>Q(z.target.value)})})]}),t.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>T(null),disabled:te,children:"取消"}),t.jsx(ee,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:_,disabled:te,children:te?"退款中...":"确认退款"})]})]})})]})}var W1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],H1=W1.reduce((n,a)=>{const l=Pp(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:f,...p}=c,x=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(x,{...p,ref:u})});return o.displayName=`Primitive.${a}`,{...n,[a]:o}},{}),K1="Label",jx=h.forwardRef((n,a)=>t.jsx(H1.label,{...n,ref:a,onMouseDown:l=>{var c;l.target.closest("button, input, select, textarea")||((c=n.onMouseDown)==null||c.call(n,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));jx.displayName=K1;var Nx=jx;const X=h.forwardRef(({className:n,...a},l)=>t.jsx(Nx,{ref:l,className:Je("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...a}));X.displayName=Nx.displayName;function Jd(n){const a=h.useRef({value:n,previous:n});return h.useMemo(()=>(a.current.value!==n&&(a.current.previous=a.current.value,a.current.value=n),a.current.previous),[n])}function Zd(n){const[a,l]=h.useState(void 0);return Vt(()=>{if(n){l({width:n.offsetWidth,height:n.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const u=c[0];let f,p;if("borderBoxSize"in u){const x=u.borderBoxSize,g=Array.isArray(x)?x[0]:x;f=g.inlineSize,p=g.blockSize}else f=n.offsetWidth,p=n.offsetHeight;l({width:f,height:p})});return o.observe(n,{box:"border-box"}),()=>o.unobserve(n)}else l(void 0)},[n]),a}var $i="Switch",[Y1]=On($i),[G1,Q1]=Y1($i),bx=h.forwardRef((n,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:u,required:f,disabled:p,value:x="on",onCheckedChange:g,form:v,...y}=n,[P,R]=h.useState(null),C=Xe(a,w=>R(w)),j=h.useRef(!1),b=P?v||!!P.closest("form"):!0,[S,E]=ls({prop:c,defaultProp:u??!1,onChange:g,caller:$i});return t.jsxs(G1,{scope:l,checked:S,disabled:p,children:[t.jsx(Ue.button,{type:"button",role:"switch","aria-checked":S,"aria-required":f,"data-state":kx(S),"data-disabled":p?"":void 0,disabled:p,value:x,...y,ref:C,onClick:Fe(n.onClick,w=>{E(M=>!M),b&&(j.current=w.isPropagationStopped(),j.current||w.stopPropagation())})}),b&&t.jsx(Cx,{control:P,bubbles:!j.current,name:o,value:x,checked:S,required:f,disabled:p,form:v,style:{transform:"translateX(-100%)"}})]})});bx.displayName=$i;var wx="SwitchThumb",Sx=h.forwardRef((n,a)=>{const{__scopeSwitch:l,...o}=n,c=Q1(wx,l);return t.jsx(Ue.span,{"data-state":kx(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:a})});Sx.displayName=wx;var q1="SwitchBubbleInput",Cx=h.forwardRef(({__scopeSwitch:n,control:a,checked:l,bubbles:o=!0,...c},u)=>{const f=h.useRef(null),p=Xe(f,u),x=Jd(l),g=Zd(a);return h.useEffect(()=>{const v=f.current;if(!v)return;const y=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(y,"checked").set;if(x!==l&&R){const C=new Event("click",{bubbles:o});R.call(v,l),v.dispatchEvent(C)}},[x,l,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:p,style:{...c.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Cx.displayName=q1;function kx(n){return n?"checked":"unchecked"}var Ex=bx,X1=Sx;const gt=h.forwardRef(({className:n,...a},l)=>t.jsx(Ex,{className:Je("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]",n),...a,ref:l,children:t.jsx(X1,{className:Je("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")})}));gt.displayName=Ex.displayName;function eu(n){const a=n+"CollectionProvider",[l,o]=On(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=j=>{const{scope:b,children:S}=j,E=Sn.useRef(null),w=Sn.useRef(new Map).current;return t.jsx(c,{scope:b,itemMap:w,collectionRef:E,children:S})};f.displayName=a;const p=n+"CollectionSlot",x=Ua(p),g=Sn.forwardRef((j,b)=>{const{scope:S,children:E}=j,w=u(p,S),M=Xe(b,w.collectionRef);return t.jsx(x,{ref:M,children:E})});g.displayName=p;const v=n+"CollectionItemSlot",y="data-radix-collection-item",P=Ua(v),R=Sn.forwardRef((j,b)=>{const{scope:S,children:E,...w}=j,M=Sn.useRef(null),D=Xe(b,M),V=u(v,S);return Sn.useEffect(()=>(V.itemMap.set(M,{ref:M,...w}),()=>void V.itemMap.delete(M))),t.jsx(P,{[y]:"",ref:D,children:E})});R.displayName=v;function C(j){const b=u(n+"CollectionConsumer",j);return Sn.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const w=Array.from(E.querySelectorAll(`[${y}]`));return Array.from(b.itemMap.values()).sort((V,k)=>w.indexOf(V.ref.current)-w.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:f,Slot:g,ItemSlot:R},C,o]}var J1=h.createContext(void 0);function Bi(n){const a=h.useContext(J1);return n||a||"ltr"}var nd="rovingFocusGroup.onEntryFocus",Z1={bubbles:!1,cancelable:!0},Ya="RovingFocusGroup",[Nd,Px,e2]=eu(Ya),[t2,Rx]=On(Ya,[e2]),[r2,n2]=t2(Ya),Tx=h.forwardRef((n,a)=>t.jsx(Nd.Provider,{scope:n.__scopeRovingFocusGroup,children:t.jsx(Nd.Slot,{scope:n.__scopeRovingFocusGroup,children:t.jsx(s2,{...n,ref:a})})}));Tx.displayName=Ya;var s2=h.forwardRef((n,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:u,currentTabStopId:f,defaultCurrentTabStopId:p,onCurrentTabStopIdChange:x,onEntryFocus:g,preventScrollOnEntryFocus:v=!1,...y}=n,P=h.useRef(null),R=Xe(a,P),C=Bi(u),[j,b]=ls({prop:f,defaultProp:p??null,onChange:x,caller:Ya}),[S,E]=h.useState(!1),w=An(g),M=Px(l),D=h.useRef(!1),[V,k]=h.useState(0);return h.useEffect(()=>{const T=P.current;if(T)return T.addEventListener(nd,w),()=>T.removeEventListener(nd,w)},[w]),t.jsx(r2,{scope:l,orientation:o,dir:C,loop:c,currentTabStopId:j,onItemFocus:h.useCallback(T=>b(T),[b]),onItemShiftTab:h.useCallback(()=>E(!0),[]),onFocusableItemAdd:h.useCallback(()=>k(T=>T+1),[]),onFocusableItemRemove:h.useCallback(()=>k(T=>T-1),[]),children:t.jsx(Ue.div,{tabIndex:S||V===0?-1:0,"data-orientation":o,...y,ref:R,style:{outline:"none",...n.style},onMouseDown:Fe(n.onMouseDown,()=>{D.current=!0}),onFocus:Fe(n.onFocus,T=>{const U=!D.current;if(T.target===T.currentTarget&&U&&!S){const Q=new CustomEvent(nd,Z1);if(T.currentTarget.dispatchEvent(Q),!Q.defaultPrevented){const te=M().filter(Z=>Z.focusable),oe=te.find(Z=>Z.active),he=te.find(Z=>Z.id===j),le=[oe,he,...te].filter(Boolean).map(Z=>Z.ref.current);Ax(le,v)}}D.current=!1}),onBlur:Fe(n.onBlur,()=>E(!1))})})}),_x="RovingFocusGroupItem",Ix=h.forwardRef((n,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:u,children:f,...p}=n,x=_n(),g=u||x,v=n2(_x,l),y=v.currentTabStopId===g,P=Px(l),{onFocusableItemAdd:R,onFocusableItemRemove:C,currentTabStopId:j}=v;return h.useEffect(()=>{if(o)return R(),()=>C()},[o,R,C]),t.jsx(Nd.ItemSlot,{scope:l,id:g,focusable:o,active:c,children:t.jsx(Ue.span,{tabIndex:y?0:-1,"data-orientation":v.orientation,...p,ref:a,onMouseDown:Fe(n.onMouseDown,b=>{o?v.onItemFocus(g):b.preventDefault()}),onFocus:Fe(n.onFocus,()=>v.onItemFocus(g)),onKeyDown:Fe(n.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){v.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const S=i2(b,v.orientation,v.dir);if(S!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=P().filter(M=>M.focusable).map(M=>M.ref.current);if(S==="last")w.reverse();else if(S==="prev"||S==="next"){S==="prev"&&w.reverse();const M=w.indexOf(b.currentTarget);w=v.loop?o2(w,M+1):w.slice(M+1)}setTimeout(()=>Ax(w))}}),children:typeof f=="function"?f({isCurrentTabStop:y,hasTabStop:j!=null}):f})})});Ix.displayName=_x;var a2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function l2(n,a){return a!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function i2(n,a,l){const o=l2(n.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return a2[o]}function Ax(n,a=!1){const l=document.activeElement;for(const o of n)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function o2(n,a){return n.map((l,o)=>n[(a+o)%n.length])}var c2=Tx,d2=Ix,Ui="Tabs",[u2]=On(Ui,[Rx]),Mx=Rx(),[f2,tu]=u2(Ui),Dx=h.forwardRef((n,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:u,orientation:f="horizontal",dir:p,activationMode:x="automatic",...g}=n,v=Bi(p),[y,P]=ls({prop:o,onChange:c,defaultProp:u??"",caller:Ui});return t.jsx(f2,{scope:l,baseId:_n(),value:y,onValueChange:P,orientation:f,dir:v,activationMode:x,children:t.jsx(Ue.div,{dir:v,"data-orientation":f,...g,ref:a})})});Dx.displayName=Ui;var Lx="TabsList",Ox=h.forwardRef((n,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=n,u=tu(Lx,l),f=Mx(l);return t.jsx(c2,{asChild:!0,...f,orientation:u.orientation,dir:u.dir,loop:o,children:t.jsx(Ue.div,{role:"tablist","aria-orientation":u.orientation,...c,ref:a})})});Ox.displayName=Lx;var Fx="TabsTrigger",zx=h.forwardRef((n,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...u}=n,f=tu(Fx,l),p=Mx(l),x=Ux(f.baseId,o),g=Vx(f.baseId,o),v=o===f.value;return t.jsx(d2,{asChild:!0,...p,focusable:!c,active:v,children:t.jsx(Ue.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,...u,ref:a,onMouseDown:Fe(n.onMouseDown,y=>{!c&&y.button===0&&y.ctrlKey===!1?f.onValueChange(o):y.preventDefault()}),onKeyDown:Fe(n.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&f.onValueChange(o)}),onFocus:Fe(n.onFocus,()=>{const y=f.activationMode!=="manual";!v&&!c&&y&&f.onValueChange(o)})})})});zx.displayName=Fx;var $x="TabsContent",Bx=h.forwardRef((n,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:u,...f}=n,p=tu($x,l),x=Ux(p.baseId,o),g=Vx(p.baseId,o),v=o===p.value,y=h.useRef(v);return h.useEffect(()=>{const P=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(P)},[]),t.jsx(Ka,{present:c||v,children:({present:P})=>t.jsx(Ue.div,{"data-state":v?"active":"inactive","data-orientation":p.orientation,role:"tabpanel","aria-labelledby":x,hidden:!P,id:g,tabIndex:0,...f,ref:a,style:{...n.style,animationDuration:y.current?"0s":void 0},children:P&&u})})});Bx.displayName=$x;function Ux(n,a){return`${n}-trigger-${a}`}function Vx(n,a){return`${n}-content-${a}`}var h2=Dx,Wx=Ox,Hx=zx,Kx=Bx;const ru=h2,Vi=h.forwardRef(({className:n,...a},l)=>t.jsx(Wx,{ref:l,className:Je("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...a}));Vi.displayName=Wx.displayName;const hr=h.forwardRef(({className:n,...a},l)=>t.jsx(Hx,{ref:l,className:Je("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",n),...a}));hr.displayName=Hx.displayName;const mr=h.forwardRef(({className:n,...a},l)=>t.jsx(Kx,{ref:l,className:Je("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...a}));mr.displayName=Kx.displayName;function m2({open:n,onClose:a,userId:l,onUserUpdated:o}){var Z;const[c,u]=h.useState(null),[f,p]=h.useState([]),[x,g]=h.useState([]),[v,y]=h.useState(!1),[P,R]=h.useState(!1),[C,j]=h.useState(!1),[b,S]=h.useState("info"),[E,w]=h.useState(""),[M,D]=h.useState(""),[V,k]=h.useState([]),[T,U]=h.useState("");h.useEffect(()=>{n&&l&&Q()},[n,l]);async function Q(){if(l){y(!0);try{const $=await Ge(`/api/db/users?id=${encodeURIComponent(l)}`);if($!=null&&$.success&&$.user){const _=$.user;u(_),w(_.phone||""),D(_.nickname||""),k(typeof _.tags=="string"?JSON.parse(_.tags||"[]"):[])}try{const _=await Ge(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);_!=null&&_.success&&_.tracks&&p(_.tracks)}catch{p([])}try{const _=await Ge(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);_!=null&&_.success&&_.referrals&&g(_.referrals)}catch{g([])}}catch($){console.error("Load user detail error:",$)}finally{y(!1)}}}async function te(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}R(!0);try{const $=await Ct("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});$!=null&&$.success?(alert("同步成功"),Q()):alert("同步失败: "+($==null?void 0:$.error))}catch($){console.error("Sync CKB error:",$),alert("同步失败")}finally{R(!1)}}async function oe(){if(c){j(!0);try{const $={id:c.id,phone:E||void 0,nickname:M||void 0,tags:JSON.stringify(V)},_=await St("/api/db/users",$);_!=null&&_.success?(alert("保存成功"),Q(),o==null||o()):alert("保存失败: "+(_==null?void 0:_.error))}catch($){console.error("Save user error:",$),alert("保存失败")}finally{j(!1)}}}const he=()=>{T&&!V.includes(T)&&(k([...V,T]),U(""))},ne=$=>{k(V.filter(_=>_!==$))},le=$=>{const q={view_chapter:Qr,purchase:pd,match:Cr,login:ns,register:ns,share:ts,bind_phone:RN,bind_wechat:bN}[$]||Nm;return t.jsx(q,{className:"w-4 h-4"})};return n?t.jsx($t,{open:n,onOpenChange:()=>a(),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(ns,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&t.jsx($e,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"})]})}),v?t.jsxs("div",{className:"flex items-center justify-center py-20",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):c?t.jsxs("div",{className:"flex flex-col h-[70vh]",children:[t.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-4",children:[t.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac]",children:c.avatar?t.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Z=c.nickname)==null?void 0:Z.charAt(0))||"?"}),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h3",{className:"text-lg font-bold text-white",children:c.nickname}),c.isAdmin&&t.jsx($e,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&t.jsx($e,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"})]}),t.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechatId&&` · 💬 ${c.wechatId}`]}),t.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["ID: ",c.id," · 推广码: ",c.referralCode??"-"]})]}),t.jsxs("div",{className:"text-right",children:[t.jsxs("p",{className:"text-[#38bdac] font-bold",children:["¥",(c.earnings||0).toFixed(2)]}),t.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"})]})]}),t.jsxs(ru,{value:b,onValueChange:S,className:"flex-1 flex flex-col overflow-hidden",children:[t.jsxs(Vi,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-4",children:[t.jsx(hr,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"基础信息"}),t.jsx(hr,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"标签体系"}),t.jsx(hr,{value:"tracks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"行为轨迹"}),t.jsx(hr,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"关系链路"})]}),t.jsxs(mr,{value:"info",className:"flex-1 overflow-auto space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"手机号"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:E,onChange:$=>w($.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"昵称"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:M,onChange:$=>D($.target.value)})]})]}),t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"推荐人数"}),t.jsx("p",{className:"text-2xl font-bold text-white",children:c.referralCount??0})]}),t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"待提现"}),t.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["¥",(c.pendingEarnings??0).toFixed(2)]})]}),t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"创建时间"}),t.jsx("p",{className:"text-sm text-white",children:c.createdAt?new Date(c.createdAt).toLocaleDateString():"-"})]})]}),t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ts,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),t.jsx(ee,{size:"sm",onClick:te,disabled:P||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:P?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-1"})," 同步数据"]})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-gray-500",children:"同步状态:"}),c.ckbSyncedAt?t.jsx($e,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):t.jsx($e,{className:"bg-gray-500/20 text-gray-400 border-0 ml-1",children:"未同步"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-gray-500",children:"最后同步:"}),t.jsx("span",{className:"text-gray-300 ml-1",children:c.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),t.jsx(mr,{value:"tags",className:"flex-1 overflow-auto space-y-4",children:t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[t.jsx(UN,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx("span",{className:"text-white font-medium",children:"系统标签"})]}),t.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[V.map(($,_)=>t.jsxs($e,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[$,t.jsx("button",{type:"button",onClick:()=>ne($),className:"ml-1 hover:text-red-400",children:t.jsx(pr,{className:"w-3 h-3"})})]},_)),V.length===0&&t.jsx("span",{className:"text-gray-500 text-sm",children:"暂无标签"})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ae,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"添加新标签",value:T,onChange:$=>U($.target.value),onKeyDown:$=>$.key==="Enter"&&he()}),t.jsx(ee,{onClick:he,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})}),t.jsx(mr,{value:"tracks",className:"flex-1 overflow-auto",children:t.jsx("div",{className:"space-y-2",children:f.length>0?f.map($=>t.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[t.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:le($.action)}),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-white font-medium",children:$.actionLabel}),$.chapterTitle&&t.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",$.chapterTitle]})]}),t.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[t.jsx(wp,{className:"w-3 h-3 inline mr-1"}),$.timeAgo," · ",new Date($.createdAt).toLocaleString()]})]})]},$.id)):t.jsxs("div",{className:"text-center py-12",children:[t.jsx(Nm,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),t.jsx("p",{className:"text-gray-400",children:"暂无行为轨迹"})]})})}),t.jsx(mr,{value:"relations",className:"flex-1 overflow-auto space-y-4",children:t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ts,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx("span",{className:"text-white font-medium",children:"推荐的用户"})]}),t.jsxs($e,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:["共 ",x.length," 人"]})]}),t.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:x.length>0?x.map(($,_)=>{var z;const q=$;return t.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#162840] rounded",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:((z=q.nickname)==null?void 0:z.charAt(0))||"?"}),t.jsx("span",{className:"text-white text-sm",children:q.nickname})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[q.status==="vip"&&t.jsx($e,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),t.jsx("span",{className:"text-gray-500 text-xs",children:q.createdAt?new Date(q.createdAt).toLocaleDateString():""})]})]},q.id||_)}):t.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-700 mt-4",children:[t.jsxs(ee,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"关闭"]}),t.jsxs(ee,{onClick:oe,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),C?"保存中...":"保存修改"]})]})]}):t.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const sd={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function p2({open:n,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[u,f]=h.useState(sd),[p,x]=h.useState([]),[g,v]=h.useState(!1),[y,P]=h.useState(!1);h.useEffect(()=>{if(!n){f(sd);return}let C=!1;return v(!0),Promise.all([Ge("/api/db/vip-roles"),l?Ge(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([j,b])=>{if(C)return;const S=j!=null&&j.success&&j.data?j.data:[];x(S);const E=b&&b.user?b.user:null;if(E){const w=String(E.vipRole??""),M=S.some(D=>D.name===w);f({isVip:!!(E.isVip??!1),vipExpireDate:E.vipExpireDate?String(E.vipExpireDate).slice(0,10):"",vipSort:typeof E.vipSort=="number"?E.vipSort:"",vipRole:M?w:w?"__custom__":"",vipRoleCustom:M?"":w,vipName:String(E.vipName??""),vipProject:String(E.vipProject??""),vipContact:String(E.vipContact??""),vipBio:String(E.vipBio??"")})}else f(sd)}).catch(j=>{C||console.error("Load error:",j)}).finally(()=>{C||v(!1)}),()=>{C=!0}},[n,l]);async function R(){if(l){if(u.isVip&&!u.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(u.isVip&&u.vipExpireDate.trim()){const C=new Date(u.vipExpireDate);if(isNaN(C.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}P(!0);try{const C=u.vipRole==="__custom__"?u.vipRoleCustom.trim():u.vipRole,j={id:l,isVip:u.isVip,vipExpireDate:u.isVip?u.vipExpireDate:void 0,vipSort:u.vipSort===""?void 0:u.vipSort,vipRole:C||void 0,vipName:u.vipName||void 0,vipProject:u.vipProject||void 0,vipContact:u.vipContact||void 0,vipBio:u.vipBio||void 0},b=await St("/api/db/users",j);b!=null&&b.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(b==null?void 0:b.error))}catch(C){console.error("Save VIP error:",C),alert("保存失败")}finally{P(!1)}}}return n?t.jsx($t,{open:n,onOpenChange:()=>a(),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(Li,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",o||l]})}),g?t.jsx("div",{className:"py-8 text-center text-gray-400",children:"加载中..."}):t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(X,{className:"text-gray-300",children:"VIP 会员"}),t.jsx(gt,{checked:u.isVip,onCheckedChange:C=>f(j=>({...j,isVip:C}))})]}),u.isVip&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",t.jsx("span",{className:"text-amber-400",children:"*"})]}),t.jsx(ae,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:u.vipExpireDate,onChange:C=>f(j=>({...j,vipExpireDate:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"排序"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:u.vipSort===""?"":u.vipSort,onChange:C=>{const j=C.target.value;f(b=>({...b,vipSort:j===""?"":parseInt(j,10)||0}))}})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"角色"}),t.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md px-3 py-2",value:u.vipRole,onChange:C=>f(j=>({...j,vipRole:C.target.value})),children:[t.jsx("option",{value:"",children:"请选择或下方手动填写"}),p.map(C=>t.jsx("option",{value:C.name,children:C.name},C.id)),t.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),u.vipRole==="__custom__"&&t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:u.vipRoleCustom,onChange:C=>f(j=>({...j,vipRoleCustom:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"VIP 展示名"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:u.vipName,onChange:C=>f(j=>({...j,vipName:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"项目/公司"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:u.vipProject,onChange:C=>f(j=>({...j,vipProject:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"联系方式"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:u.vipContact,onChange:C=>f(j=>({...j,vipContact:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"一句话简介"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:u.vipBio,onChange:C=>f(j=>({...j,vipBio:C.target.value}))})]})]}),t.jsxs(Kt,{children:[t.jsxs(ee,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(ee,{onClick:R,disabled:y||g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),y?"保存中...":"保存"]})]})]})}):null}function x2(){var Le,Ie,At,rn,Pt;const[n,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[f,p]=h.useState(10),[x,g]=h.useState(""),v=Xd(x,300),[y,P]=h.useState("all"),[R,C]=h.useState(!0),[j,b]=h.useState(null),[S,E]=h.useState(!1),[w,M]=h.useState(!1),[D,V]=h.useState(null),[k,T]=h.useState(""),[U,Q]=h.useState(""),[te,oe]=h.useState(!1),[he,ne]=h.useState(!1),[le,Z]=h.useState({referrals:[],stats:{}}),[$,_]=h.useState(!1),[q,z]=h.useState(null),[A,F]=h.useState(!1),[G,J]=h.useState(null),[xe,me]=h.useState(!1),[re,ye]=h.useState(null),[L,de]=h.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1});async function ge(){C(!0),b(null);try{const se=new URLSearchParams({page:String(c),pageSize:String(f),search:v,...y==="vip"&&{vip:"true"}}),Ke=await Ge(`/api/db/users?${se}`);Ke!=null&&Ke.success?(a(Ke.users||[]),o(Ke.total??0)):b((Ke==null?void 0:Ke.error)||"加载失败")}catch(se){console.error("Load users error:",se),b("网络错误,请检查连接")}finally{C(!1)}}h.useEffect(()=>{u(1)},[v,y]),h.useEffect(()=>{ge()},[c,f,v,y]);const _e=Math.ceil(l/f)||1;async function Oe(se){if(confirm("确定要删除这个用户吗?"))try{const Ke=await ss(`/api/db/users?id=${encodeURIComponent(se)}`);Ke!=null&&Ke.success?ge():alert("删除失败: "+((Ke==null?void 0:Ke.error)||"未知错误"))}catch(Ke){console.error("Delete user error:",Ke),alert("删除失败")}}const ze=se=>{V(se),de({phone:se.phone||"",nickname:se.nickname||"",password:"",isAdmin:!!(se.isAdmin??!1),hasFullBook:!!(se.hasFullBook??!1)}),E(!0)},qe=()=>{V(null),de({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),E(!0)};async function rt(){if(!L.phone||!L.nickname){alert("请填写手机号和昵称");return}oe(!0);try{if(D){const se=await St("/api/db/users",{id:D.id,nickname:L.nickname,isAdmin:L.isAdmin,hasFullBook:L.hasFullBook,...L.password&&{password:L.password}});if(!(se!=null&&se.success)){alert("更新失败: "+((se==null?void 0:se.error)||"未知错误"));return}}else{const se=await Ct("/api/db/users",{phone:L.phone,nickname:L.nickname,password:L.password,isAdmin:L.isAdmin});if(!(se!=null&&se.success)){alert("创建失败: "+((se==null?void 0:se.error)||"未知错误"));return}}E(!1),ge()}catch(se){console.error("Save user error:",se),alert("保存失败")}finally{oe(!1)}}const et=se=>{V(se),T(""),Q(""),M(!0)};async function kt(se){z(se),ne(!0),_(!0);try{const Ke=await Ge(`/api/db/users/referrals?userId=${encodeURIComponent(se.id)}`);Ke!=null&&Ke.success?Z({referrals:Ke.referrals||[],stats:Ke.stats||{}}):Z({referrals:[],stats:{}})}catch(Ke){console.error("Load referrals error:",Ke),Z({referrals:[],stats:{}})}finally{_(!1)}}const Et=se=>{J(se.id),F(!0)},K=se=>{ye(se),me(!0)};async function pe(){if(!k){alert("请输入新密码");return}if(k!==U){alert("两次输入的密码不一致");return}if(k.length<6){alert("密码长度不能少于6位");return}oe(!0);try{const se=await St("/api/db/users",{id:D==null?void 0:D.id,password:k});se!=null&&se.success?(alert("密码修改成功"),M(!1)):alert("密码修改失败: "+((se==null?void 0:se.error)||"未知错误"))}catch(se){console.error("Change password error:",se),alert("密码修改失败")}finally{oe(!1)}}return t.jsxs("div",{className:"p-8 w-full",children:[j&&t.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[t.jsx("span",{children:j}),t.jsx("button",{type:"button",onClick:()=>b(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"用户管理"}),t.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",l," 位注册用户",y==="vip"&&",当前筛选 VIP"]})]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs(ee,{variant:"outline",onClick:ge,disabled:R,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${R?"animate-spin":""}`}),"刷新"]}),t.jsxs("select",{value:y,onChange:se=>{P(se.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[t.jsx("option",{value:"all",children:"全部用户"}),t.jsx("option",{value:"vip",children:"VIP会员"})]}),t.jsxs("div",{className:"relative",children:[t.jsx(rs,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),t.jsx(ae,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:x,onChange:se=>g(se.target.value)})]}),t.jsxs(ee,{onClick:qe,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Cm,{className:"w-4 h-4 mr-2"}),"添加用户"]})]})]}),t.jsx($t,{open:S,onOpenChange:E,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[D?t.jsx(Ft,{className:"w-5 h-5 text-[#38bdac]"}):t.jsx(Cm,{className:"w-5 h-5 text-[#38bdac]"}),D?"编辑用户":"添加用户"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"手机号"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:L.phone,onChange:se=>de({...L,phone:se.target.value}),disabled:!!D})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"昵称"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:L.nickname,onChange:se=>de({...L,nickname:se.target.value})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:D?"新密码 (留空则不修改)":"密码"}),t.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:D?"留空则不修改":"请输入密码",value:L.password,onChange:se=>de({...L,password:se.target.value})})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(X,{className:"text-gray-300",children:"管理员权限"}),t.jsx(gt,{checked:L.isAdmin,onCheckedChange:se=>de({...L,isAdmin:se})})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(X,{className:"text-gray-300",children:"已购全书"}),t.jsx(gt,{checked:L.hasFullBook,onCheckedChange:se=>de({...L,hasFullBook:se})})]})]}),t.jsxs(Kt,{children:[t.jsxs(ee,{variant:"outline",onClick:()=>E(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(ee,{onClick:rt,disabled:te,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),te?"保存中...":"保存"]})]})]})}),t.jsx($t,{open:w,onOpenChange:M,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(bm,{className:"w-5 h-5 text-[#38bdac]"}),"修改密码"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["用户:",D==null?void 0:D.nickname]}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",D==null?void 0:D.phone]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"新密码"}),t.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:k,onChange:se=>T(se.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"确认密码"}),t.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:U,onChange:se=>Q(se.target.value)})]})]}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",onClick:()=>M(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsx(ee,{onClick:pe,disabled:te,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:te?"保存中...":"确认修改"})]})]})}),t.jsx(m2,{open:A,onClose:()=>F(!1),userId:G,onUserUpdated:ge}),t.jsx(p2,{open:xe,onClose:()=>{me(!1),ye(null)},userId:(re==null?void 0:re.id)??null,userNickname:re==null?void 0:re.nickname,onSaved:ge}),t.jsx($t,{open:he,onOpenChange:ne,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(Cr,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系详情 - ",q==null?void 0:q.nickname]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[t.jsx("div",{className:"text-2xl font-bold text-[#38bdac]",children:((Le=le.stats)==null?void 0:Le.total)||0}),t.jsx("div",{className:"text-xs text-gray-400",children:"绑定总数"})]}),t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[t.jsx("div",{className:"text-2xl font-bold text-green-400",children:((Ie=le.stats)==null?void 0:Ie.purchased)||0}),t.jsx("div",{className:"text-xs text-gray-400",children:"已付费"})]}),t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[t.jsxs("div",{className:"text-2xl font-bold text-yellow-400",children:["¥",(((At=le.stats)==null?void 0:At.earnings)||0).toFixed(2)]}),t.jsx("div",{className:"text-xs text-gray-400",children:"累计收益"})]}),t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[t.jsxs("div",{className:"text-2xl font-bold text-orange-400",children:["¥",(((rn=le.stats)==null?void 0:rn.pendingEarnings)||0).toFixed(2)]}),t.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),$?t.jsxs("div",{className:"flex items-center justify-center py-8",children:[t.jsx(tt,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((Pt=le.referrals)==null?void 0:Pt.length)??0)>0?t.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(le.referrals??[]).map((se,Ke)=>{var xr;const Rt=se;return t.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg p-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:((xr=Rt.nickname)==null?void 0:xr.charAt(0))||"?"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-white text-sm",children:Rt.nickname}),t.jsx("div",{className:"text-xs text-gray-500",children:Rt.phone||(Rt.hasOpenId?"微信用户":"未绑定")})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[Rt.status==="vip"&&t.jsx($e,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),Rt.status==="paid"&&t.jsxs($e,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",Rt.purchasedSections,"章"]}),Rt.status==="free"&&t.jsx($e,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),t.jsx("span",{className:"text-xs text-gray-500",children:Rt.createdAt?new Date(Rt.createdAt).toLocaleDateString():""})]})]},Rt.id||Ke)})}):t.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),t.jsx(Kt,{children:t.jsx(ee,{variant:"outline",onClick:()=>ne(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(Re,{className:"p-0",children:R?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsxs("div",{children:[t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"用户信息"}),t.jsx(Te,{className:"text-gray-400",children:"绑定信息"}),t.jsx(Te,{className:"text-gray-400",children:"购买状态"}),t.jsx(Te,{className:"text-gray-400",children:"分销收益"}),t.jsx(Te,{className:"text-gray-400",children:"推广码"}),t.jsx(Te,{className:"text-gray-400",children:"注册时间"}),t.jsx(Te,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsxs(tn,{children:[n.map(se=>{var Ke,Rt,xr;return t.jsxs(ot,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsx(Ce,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:se.avatar?t.jsx("img",{src:se.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Ke=se.nickname)==null?void 0:Ke.charAt(0))||"?"}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"font-medium text-white",children:se.nickname}),se.isAdmin&&t.jsx($e,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),se.openId&&!((Rt=se.id)!=null&&Rt.startsWith("user_"))&&t.jsx($e,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0 text-xs",children:"微信"})]}),t.jsx("p",{className:"text-xs text-gray-500 font-mono",children:se.openId?se.openId.slice(0,12)+"...":(xr=se.id)==null?void 0:xr.slice(0,12)})]})]})}),t.jsx(Ce,{children:t.jsxs("div",{className:"space-y-1",children:[se.phone&&t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[t.jsx("span",{className:"text-gray-500",children:"📱"}),t.jsx("span",{className:"text-gray-300",children:se.phone})]}),se.wechatId&&t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[t.jsx("span",{className:"text-gray-500",children:"💬"}),t.jsx("span",{className:"text-gray-300",children:se.wechatId})]}),se.openId&&t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[t.jsx("span",{className:"text-gray-500",children:"🔗"}),t.jsxs("span",{className:"text-gray-500 truncate max-w-[100px]",title:se.openId,children:[se.openId.slice(0,12),"..."]})]}),!se.phone&&!se.wechatId&&!se.openId&&t.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),t.jsx(Ce,{children:se.hasFullBook?t.jsx($e,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):t.jsx($e,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),t.jsx(Ce,{children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(se.earnings||0)).toFixed(2)]}),parseFloat(String(se.pendingEarnings||0))>0&&t.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(se.pendingEarnings||0)).toFixed(2)]}),t.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>kt(se),onKeyDown:$n=>$n.key==="Enter"&&kt(se),role:"button",tabIndex:0,children:[t.jsx(Cr,{className:"w-3 h-3"}),"绑定",se.referralCount||0,"人"]})]})}),t.jsx(Ce,{children:t.jsx("code",{className:"text-[#38bdac] text-xs bg-[#38bdac]/10 px-2 py-0.5 rounded",children:se.referralCode||"-"})}),t.jsx(Ce,{className:"text-gray-400",children:se.createdAt?new Date(se.createdAt).toLocaleDateString():"-"}),t.jsx(Ce,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>K(se),className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:t.jsx(Li,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>Et(se),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:t.jsx(Pn,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>ze(se),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:t.jsx(Ft,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>et(se),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:t.jsx(bm,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>Oe(se.id),title:"删除",children:t.jsx(sr,{className:"w-4 h-4"})})]})})]},se.id)}),n.length===0&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),t.jsx(In,{page:c,totalPages:_e,total:l,pageSize:f,onPageChange:u,onPageSizeChange:se=>{p(se),u(1)}})]})})})]})}function g2(){const[n,a]=h.useState("overview"),[l,o]=h.useState([]),[c,u]=h.useState(null),[f,p]=h.useState([]),[x,g]=h.useState([]),[v,y]=h.useState([]),[P,R]=h.useState(!0),[C,j]=h.useState(null),[b,S]=h.useState(""),[E,w]=h.useState("all"),[M,D]=h.useState(1),[V,k]=h.useState(10),[T,U]=h.useState(0),[Q,te]=h.useState(new Set),[oe,he]=h.useState(null),[ne,le]=h.useState(""),[Z,$]=h.useState(!1);h.useEffect(()=>{_()},[]),h.useEffect(()=>{D(1)},[n,E]),h.useEffect(()=>{q(n)},[n]),h.useEffect(()=>{["orders","bindings","withdrawals"].includes(n)&&q(n,!0)},[M,V,E,b]);async function _(){j(null);try{const L=await Ge("/api/admin/distribution/overview");L!=null&&L.success&&L.overview&&u(L.overview)}catch(L){console.error("[Admin] 概览接口异常:",L),j("加载概览失败")}try{const L=await Ge("/api/db/users");y((L==null?void 0:L.users)||[])}catch(L){console.error("[Admin] 用户数据加载失败:",L)}}async function q(L,de=!1){var ge;if(!(!de&&Q.has(L))){R(!0);try{const _e=v;switch(L){case"overview":break;case"orders":{try{const Oe=new URLSearchParams({page:String(M),pageSize:String(V),...E!=="all"&&{status:E},...b&&{search:b}}),ze=await Ge(`/api/orders?${Oe}`);if(ze!=null&&ze.success&&ze.orders){const qe=ze.orders.map(rt=>{const et=_e.find(Et=>Et.id===rt.userId),kt=rt.referrerId?_e.find(Et=>Et.id===rt.referrerId):null;return{...rt,amount:parseFloat(String(rt.amount))||0,userNickname:(et==null?void 0:et.nickname)||rt.userNickname||"未知用户",userPhone:(et==null?void 0:et.phone)||rt.userPhone||"-",referrerNickname:(kt==null?void 0:kt.nickname)||null,referrerCode:(kt==null?void 0:kt.referralCode)??null,type:rt.productType||rt.type}});o(qe),U(ze.total??qe.length)}else o([]),U(0)}catch(Oe){console.error(Oe),j("加载订单失败"),o([])}break}case"bindings":{try{const Oe=new URLSearchParams({page:String(M),pageSize:String(V),...E!=="all"&&{status:E}}),ze=await Ge(`/api/db/distribution?${Oe}`);p((ze==null?void 0:ze.bindings)||[]),U((ze==null?void 0:ze.total)??((ge=ze==null?void 0:ze.bindings)==null?void 0:ge.length)??0)}catch(Oe){console.error(Oe),j("加载绑定数据失败"),p([])}break}case"withdrawals":{try{const Oe=E==="completed"?"success":E==="rejected"?"failed":E,ze=new URLSearchParams({...Oe&&Oe!=="all"&&{status:Oe},page:String(M),pageSize:String(V)}),qe=await Ge(`/api/admin/withdrawals?${ze}`);if(qe!=null&&qe.success&&qe.withdrawals){const rt=qe.withdrawals.map(et=>({...et,account:et.account??"未绑定微信号",status:et.status==="success"?"completed":et.status==="failed"?"rejected":et.status}));g(rt),U((qe==null?void 0:qe.total)??rt.length)}else qe!=null&&qe.success||j(`获取提现记录失败: ${(qe==null?void 0:qe.error)||"未知错误"}`),g([])}catch(Oe){console.error(Oe),j("加载提现数据失败"),g([])}break}}te(Oe=>new Set(Oe).add(L))}catch(_e){console.error(_e)}finally{R(!1)}}}async function z(){j(null),te(L=>{const de=new Set(L);return de.delete(n),de}),n==="overview"&&_(),await q(n,!0)}async function A(L){if(confirm("确认审核通过并打款?"))try{const de=await St("/api/admin/withdrawals",{id:L,action:"approve"});if(!(de!=null&&de.success)){const ge=(de==null?void 0:de.message)||(de==null?void 0:de.error)||"操作失败";alert(ge);return}await z()}catch(de){console.error(de),alert("操作失败")}}async function F(L){const de=prompt("请输入拒绝原因:");if(de)try{const ge=await St("/api/admin/withdrawals",{id:L,action:"reject",errorMessage:de});if(!(ge!=null&&ge.success)){alert((ge==null?void 0:ge.error)||"操作失败");return}await z()}catch(ge){console.error(ge),alert("操作失败")}}async function G(){var L;if(!(!(oe!=null&&oe.orderSn)&&!(oe!=null&&oe.id))){$(!0),j(null);try{const de=await St("/api/admin/orders/refund",{orderSn:oe.orderSn||oe.id,reason:ne||void 0});de!=null&&de.success?(he(null),le(""),await q("orders",!0)):j((de==null?void 0:de.error)||"退款失败")}catch(de){const ge=de;j(((L=ge==null?void 0:ge.data)==null?void 0:L.error)||"退款失败,请检查网络后重试")}finally{$(!1)}}}function J(L){const de={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",pending_confirm:"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"},ge={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return t.jsx($e,{className:`${de[L]||"bg-gray-500/20 text-gray-400"} border-0`,children:ge[L]||L})}const xe=Math.ceil(T/V)||1,me=l,re=f.filter(L=>{var ge,_e,Oe,ze;if(!b)return!0;const de=b.toLowerCase();return((ge=L.refereeNickname)==null?void 0:ge.toLowerCase().includes(de))||((_e=L.refereePhone)==null?void 0:_e.includes(de))||((Oe=L.referrerName)==null?void 0:Oe.toLowerCase().includes(de))||((ze=L.referrerCode)==null?void 0:ze.toLowerCase().includes(de))}),ye=x.filter(L=>{var ge;if(!b)return!0;const de=b.toLowerCase();return((ge=L.userName)==null?void 0:ge.toLowerCase().includes(de))||L.account&&L.account.toLowerCase().includes(de)});return t.jsxs("div",{className:"p-8 w-full",children:[C&&t.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[t.jsx("span",{children:C}),t.jsx("button",{type:"button",onClick:()=>j(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex items-center justify-between mb-8",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-white",children:"交易中心"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),t.jsxs(ee,{onClick:z,disabled:P,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${P?"animate-spin":""}`}),"刷新数据"]})]}),t.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4",children:[{key:"overview",label:"数据概览",icon:gd},{key:"orders",label:"订单管理",icon:ji},{key:"bindings",label:"绑定管理",icon:ts},{key:"withdrawals",label:"提现审核",icon:Us}].map(L=>t.jsxs("button",{type:"button",onClick:()=>{a(L.key),w("all"),S("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${n===L.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[t.jsx(L.icon,{className:"w-4 h-4"}),L.label]},L.key))}),P?t.jsxs("div",{className:"flex items-center justify-center py-20",children:[t.jsx(tt,{className:"w-8 h-8 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsxs(t.Fragment,{children:[n==="overview"&&c&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),t.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks})]}),t.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:t.jsx(Pn,{className:"w-6 h-6 text-blue-400"})})]})})}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),t.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),t.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:t.jsx(ts,{className:"w-6 h-6 text-green-400"})})]})})}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),t.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),t.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:t.jsx(ym,{className:"w-6 h-6 text-purple-400"})})]})})}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),t.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),t.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:t.jsx(ji,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(Pe,{className:"bg-orange-500/10 border-orange-500/30",children:t.jsx(Re,{className:"p-6",children:t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:t.jsx(wp,{className:"w-6 h-6 text-orange-400"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),t.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),t.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期,需关注转化"})]})]})})}),t.jsx(Pe,{className:"bg-blue-500/10 border-blue-500/30",children:t.jsx(Re,{className:"p-6",children:t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:t.jsx(Us,{className:"w-6 h-6 text-blue-400"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),t.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),t.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),t.jsx(ee,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx(We,{children:t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx($a,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),t.jsx(Re,{children:t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),t.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx(We,{children:t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(gd,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),t.jsxs(Re,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),t.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),t.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[t.jsx("span",{className:"text-gray-300",children:"点击转化率"}),t.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx(We,{children:t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(Cr,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),t.jsx(Re,{children:t.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[t.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),t.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[t.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),t.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[t.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),t.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[t.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),t.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),n==="orders"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(rs,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx(ae,{value:b,onChange:L=>S(L.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),t.jsxs("select",{value:E,onChange:L=>w(L.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[t.jsx("option",{value:"all",children:"全部状态"}),t.jsx("option",{value:"completed",children:"已完成"}),t.jsx("option",{value:"pending",children:"待支付"}),t.jsx("option",{value:"failed",children:"已失败"}),t.jsx("option",{value:"refunded",children:"已退款"})]})]}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{className:"p-0",children:[l.length===0?t.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[t.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"退款原因"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"操作"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-700/50",children:me.map(L=>{var de,ge;return t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsxs("td",{className:"p-4 font-mono text-xs text-gray-400",children:[(de=L.id)==null?void 0:de.slice(0,12),"..."]}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white text-sm",children:L.userNickname}),t.jsx("p",{className:"text-gray-500 text-xs",children:L.userPhone})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white text-sm",children:(()=>{const _e=L.productType||L.type;return _e==="fullbook"?`${L.bookName||"《底层逻辑》"} - 全本`:_e==="match"?"匹配次数购买":`${L.bookName||"《底层逻辑》"} - ${L.sectionTitle||L.chapterTitle||`章节${L.productId||L.sectionId||""}`}`})()}),t.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const _e=L.productType||L.type;return _e==="fullbook"?"全书解锁":_e==="match"?"功能权益":L.chapterTitle||"单章购买"})()})]})}),t.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof L.amount=="number"?L.amount.toFixed(2):parseFloat(String(L.amount||"0")).toFixed(2)]}),t.jsx("td",{className:"p-4 text-gray-300",children:L.paymentMethod==="wechat"?"微信支付":L.paymentMethod==="alipay"?"支付宝":L.paymentMethod||"微信支付"}),t.jsx("td",{className:"p-4",children:L.status==="refunded"?t.jsx($e,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):L.status==="completed"||L.status==="paid"?t.jsx($e,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):L.status==="pending"||L.status==="created"?t.jsx($e,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):t.jsx($e,{className:"bg-red-500/20 text-red-400 border-0",children:"已失败"})}),t.jsx("td",{className:"p-4 text-gray-400 text-sm max-w-[120px]",title:L.refundReason,children:L.status==="refunded"&&L.refundReason?L.refundReason:"-"}),t.jsx("td",{className:"p-4 text-gray-300 text-sm",children:L.referrerId||L.referralCode?t.jsxs("span",{title:L.referralCode||L.referrerCode||L.referrerId||"",children:[L.referrerNickname||L.referralCode||L.referrerCode||((ge=L.referrerId)==null?void 0:ge.slice(0,8)),(L.referralCode||L.referrerCode)&&` (${L.referralCode||L.referrerCode})`]}):"-"}),t.jsx("td",{className:"p-4 text-[#FFD700]",children:L.referrerEarnings?`¥${(typeof L.referrerEarnings=="number"?L.referrerEarnings:parseFloat(String(L.referrerEarnings))).toFixed(2)}`:"-"}),t.jsx("td",{className:"p-4 text-gray-400 text-sm",children:L.createdAt?new Date(L.createdAt).toLocaleString("zh-CN"):"-"}),t.jsx("td",{className:"p-4",children:(L.status==="paid"||L.status==="completed")&&t.jsxs(ee,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{he(L),le("")},children:[t.jsx(kp,{className:"w-3 h-3 mr-1"}),"退款"]})})]},L.id)})})]})}),n==="orders"&&t.jsx(In,{page:M,totalPages:xe,total:T,pageSize:V,onPageChange:D,onPageSizeChange:L=>{k(L),D(1)}})]})})]}),n==="bindings"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(rs,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx(ae,{value:b,onChange:L=>S(L.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),t.jsxs("select",{value:E,onChange:L=>w(L.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[t.jsx("option",{value:"all",children:"全部状态"}),t.jsx("option",{value:"active",children:"有效"}),t.jsx("option",{value:"converted",children:"已转化"}),t.jsx("option",{value:"expired",children:"已过期"})]})]}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{className:"p-0",children:[re.length===0?t.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[t.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-700/50",children:re.map(L=>t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white font-medium",children:L.refereeNickname||"匿名用户"}),t.jsx("p",{className:"text-gray-500 text-xs",children:L.refereePhone})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white",children:L.referrerName||"-"}),t.jsx("p",{className:"text-gray-500 text-xs font-mono",children:L.referrerCode})]})}),t.jsx("td",{className:"p-4 text-gray-400",children:L.boundAt?new Date(L.boundAt).toLocaleDateString("zh-CN"):"-"}),t.jsx("td",{className:"p-4 text-gray-400",children:L.expiresAt?new Date(L.expiresAt).toLocaleDateString("zh-CN"):"-"}),t.jsx("td",{className:"p-4",children:J(L.status)}),t.jsx("td",{className:"p-4",children:L.commission?t.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",L.commission.toFixed(2)]}):t.jsx("span",{className:"text-gray-500",children:"-"})})]},L.id))})]})}),n==="bindings"&&t.jsx(In,{page:M,totalPages:xe,total:T,pageSize:V,onPageChange:D,onPageSizeChange:L=>{k(L),D(1)}})]})})]}),n==="withdrawals"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(rs,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx(ae,{value:b,onChange:L=>S(L.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),t.jsxs("select",{value:E,onChange:L=>w(L.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[t.jsx("option",{value:"all",children:"全部状态"}),t.jsx("option",{value:"pending",children:"待审核"}),t.jsx("option",{value:"completed",children:"已完成"}),t.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{className:"p-0",children:[ye.length===0?t.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[t.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),t.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-700/50",children:ye.map(L=>t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsx("td",{className:"p-4",children:t.jsxs("div",{className:"flex items-center gap-2",children:[L.userAvatar?t.jsx("img",{src:L.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):t.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(L.userName||L.name||"?").slice(0,1)}),t.jsx("p",{className:"text-white font-medium",children:L.userName||L.name})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",L.amount.toFixed(2)]})}),t.jsx("td",{className:"p-4",children:t.jsx($e,{className:L.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:L.method==="wechat"?"微信":"支付宝"})}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white font-mono text-xs",children:L.account}),t.jsx("p",{className:"text-gray-500 text-xs",children:L.name})]})}),t.jsx("td",{className:"p-4 text-gray-400",children:L.createdAt?new Date(L.createdAt).toLocaleString("zh-CN"):"-"}),t.jsx("td",{className:"p-4",children:J(L.status)}),t.jsx("td",{className:"p-4 text-right",children:L.status==="pending"&&t.jsxs("div",{className:"flex gap-2 justify-end",children:[t.jsxs(ee,{size:"sm",onClick:()=>A(L.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(ym,{className:"w-4 h-4 mr-1"}),"通过"]}),t.jsxs(ee,{size:"sm",variant:"outline",onClick:()=>F(L.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[t.jsx(Dj,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},L.id))})]})}),n==="withdrawals"&&t.jsx(In,{page:M,totalPages:xe,total:T,pageSize:V,onPageChange:D,onPageSizeChange:L=>{k(L),D(1)}})]})})]})]}),t.jsx($t,{open:!!oe,onOpenChange:L=>!L&&he(null),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Bt,{children:t.jsx(Ut,{className:"text-white",children:"订单退款"})}),oe&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",oe.orderSn||oe.id]}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof oe.amount=="number"?oe.amount.toFixed(2):parseFloat(String(oe.amount||"0")).toFixed(2)]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),t.jsx("div",{className:"form-input",children:t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:ne,onChange:L=>le(L.target.value)})})]}),t.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>he(null),disabled:Z,children:"取消"}),t.jsx(ee,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:G,disabled:Z,children:Z?"退款中...":"确认退款"})]})]})})]})}function v2(){const[n,a]=h.useState([]),[l,o]=h.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,u]=h.useState(!0),[f,p]=h.useState(null),[x,g]=h.useState("all"),[v,y]=h.useState(1),[P,R]=h.useState(10),[C,j]=h.useState(0),[b,S]=h.useState(null);async function E(){var k,T,U,Q,te,oe,he;u(!0),p(null);try{const ne=new URLSearchParams({status:x,page:String(v),pageSize:String(P)}),le=await Ge(`/api/admin/withdrawals?${ne}`);if(le!=null&&le.success){const Z=le.withdrawals||[];a(Z),j(le.total??((k=le.stats)==null?void 0:k.total)??Z.length),o({total:((T=le.stats)==null?void 0:T.total)??le.total??Z.length,pendingCount:((U=le.stats)==null?void 0:U.pendingCount)??0,pendingAmount:((Q=le.stats)==null?void 0:Q.pendingAmount)??0,successCount:((te=le.stats)==null?void 0:te.successCount)??0,successAmount:((oe=le.stats)==null?void 0:oe.successAmount)??0,failedCount:((he=le.stats)==null?void 0:he.failedCount)??0})}else p("加载提现记录失败")}catch(ne){console.error("Load withdrawals error:",ne),p("加载失败,请检查网络后重试")}finally{u(!1)}}h.useEffect(()=>{y(1)},[x]),h.useEffect(()=>{E()},[x,v,P]);const w=Math.ceil(C/P)||1;async function M(k){const T=n.find(U=>U.id===k);if(T!=null&&T.userCommissionInfo&&T.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${T.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。
|
||
|
||
确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;S(k);try{const U=await St("/api/admin/withdrawals",{id:k,action:"approve"});U!=null&&U.success?E():alert("操作失败: "+((U==null?void 0:U.error)??""))}catch{alert("操作失败")}finally{S(null)}}async function D(k){const T=prompt("请输入拒绝原因(将返还用户余额):");if(T){S(k);try{const U=await St("/api/admin/withdrawals",{id:k,action:"reject",errorMessage:T});U!=null&&U.success?E():alert("操作失败: "+((U==null?void 0:U.error)??""))}catch{alert("操作失败")}finally{S(null)}}}function V(k){switch(k){case"pending":return t.jsx($e,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"pending_confirm":return t.jsx($e,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待用户确认"});case"processing":return t.jsx($e,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"已审批等待打款"});case"success":case"completed":return t.jsx($e,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return t.jsx($e,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return t.jsx($e,{className:"bg-gray-500/20 text-gray-400 border-0",children:k})}}return t.jsxs("div",{className:"p-8 w-full",children:[f&&t.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[t.jsx("span",{children:f}),t.jsx("button",{type:"button",onClick:()=>p(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex justify-between items-start mb-8",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),t.jsxs(ee,{variant:"outline",onClick:E,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),t.jsx(Pe,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:t.jsx(Re,{className:"p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(ji,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),t.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[t.jsxs("p",{children:["• ",t.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",t.jsx("span",{className:"text-white font-medium",children:"90%"})]}),t.jsxs("p",{children:["• ",t.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),t.jsxs("p",{children:["• ",t.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),t.jsxs("p",{children:["• ",t.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),t.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{className:"p-4 text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),t.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{className:"p-4 text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),t.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),t.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{className:"p-4 text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),t.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),t.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{className:"p-4 text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),t.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),t.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(k=>t.jsx(ee,{variant:x===k?"default":"outline",size:"sm",onClick:()=>g(k),className:x===k?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:k==="all"?"全部":k==="pending"?"待处理":k==="success"?"已完成":"已拒绝"},k))}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(Re,{className:"p-0",children:c?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.length===0?t.jsxs("div",{className:"text-center py-12",children:[t.jsx(Us,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),t.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[t.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"确认收款"}),t.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-700/50",children:n.map(k=>t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsx("td",{className:"p-4 text-gray-400",children:new Date(k.createdAt??"").toLocaleString()}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{className:"flex items-center gap-2",children:[k.userAvatar?t.jsx("img",{src:k.userAvatar,alt:k.userName??"",className:"w-8 h-8 rounded-full object-cover"}):t.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:(k.userName??"?").charAt(0)}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-white",children:k.userName??"未知"}),t.jsx("p",{className:"text-xs text-gray-500",children:k.userPhone??k.referralCode??(k.userId??"").slice(0,10)})]})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(k.amount).toFixed(2)]})}),t.jsx("td",{className:"p-4",children:k.userCommissionInfo?t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{className:"flex justify-between gap-4",children:[t.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),t.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",k.userCommissionInfo.totalCommission.toFixed(2)]})]}),t.jsxs("div",{className:"flex justify-between gap-4",children:[t.jsx("span",{className:"text-gray-500",children:"已提现:"}),t.jsxs("span",{className:"text-gray-400",children:["¥",k.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),t.jsxs("div",{className:"flex justify-between gap-4",children:[t.jsx("span",{className:"text-gray-500",children:"待审核:"}),t.jsxs("span",{className:"text-orange-400",children:["¥",k.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),t.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[t.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),t.jsxs("span",{className:k.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",k.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):t.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),t.jsxs("td",{className:"p-4",children:[V(k.status),k.errorMessage&&t.jsx("p",{className:"text-xs text-red-400 mt-1",children:k.errorMessage})]}),t.jsx("td",{className:"p-4 text-gray-400",children:k.processedAt?new Date(k.processedAt).toLocaleString():"-"}),t.jsx("td",{className:"p-4 text-gray-400",children:k.userConfirmedAt?t.jsxs("span",{className:"text-green-400",title:k.userConfirmedAt,children:["已确认 ",new Date(k.userConfirmedAt).toLocaleString()]}):"-"}),t.jsxs("td",{className:"p-4 text-right",children:[(k.status==="pending"||k.status==="pending_confirm")&&t.jsxs("div",{className:"flex items-center justify-end gap-2",children:[t.jsxs(ee,{size:"sm",onClick:()=>M(k.id),disabled:b===k.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[t.jsx(Di,{className:"w-4 h-4 mr-1"}),"批准"]}),t.jsxs(ee,{size:"sm",variant:"outline",onClick:()=>D(k.id),disabled:b===k.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[t.jsx(pr,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(k.status==="success"||k.status==="completed")&&k.transactionId&&t.jsx("span",{className:"text-xs text-gray-500 font-mono",children:k.transactionId})]})]},k.id))})]})}),t.jsx(In,{page:v,totalPages:w,total:C,pageSize:P,onPageChange:y,onPageSizeChange:k=>{R(k),y(1)}})]})})})]})}const as=h.forwardRef(({className:n,...a},l)=>t.jsx("textarea",{className:Je("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",n),ref:l,...a}));as.displayName="Textarea";function Ei(n,[a,l]){return Math.min(l,Math.max(a,n))}const y2=["top","right","bottom","left"],Mn=Math.min,ar=Math.max,Pi=Math.round,ui=Math.floor,Lr=n=>({x:n,y:n}),j2={left:"right",right:"left",bottom:"top",top:"bottom"},N2={start:"end",end:"start"};function bd(n,a,l){return ar(n,Mn(a,l))}function qr(n,a){return typeof n=="function"?n(a):n}function Xr(n){return n.split("-")[0]}function Qs(n){return n.split("-")[1]}function nu(n){return n==="x"?"y":"x"}function su(n){return n==="y"?"height":"width"}const b2=new Set(["top","bottom"]);function Dr(n){return b2.has(Xr(n))?"y":"x"}function au(n){return nu(Dr(n))}function w2(n,a,l){l===void 0&&(l=!1);const o=Qs(n),c=au(n),u=su(c);let f=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=Ri(f)),[f,Ri(f)]}function S2(n){const a=Ri(n);return[wd(n),a,wd(a)]}function wd(n){return n.replace(/start|end/g,a=>N2[a])}const Ym=["left","right"],Gm=["right","left"],C2=["top","bottom"],k2=["bottom","top"];function E2(n,a,l){switch(n){case"top":case"bottom":return l?a?Gm:Ym:a?Ym:Gm;case"left":case"right":return a?C2:k2;default:return[]}}function P2(n,a,l,o){const c=Qs(n);let u=E2(Xr(n),l==="start",o);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(wd)))),u}function Ri(n){return n.replace(/left|right|bottom|top/g,a=>j2[a])}function R2(n){return{top:0,right:0,bottom:0,left:0,...n}}function Yx(n){return typeof n!="number"?R2(n):{top:n,right:n,bottom:n,left:n}}function Ti(n){const{x:a,y:l,width:o,height:c}=n;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function Qm(n,a,l){let{reference:o,floating:c}=n;const u=Dr(a),f=au(a),p=su(f),x=Xr(a),g=u==="y",v=o.x+o.width/2-c.width/2,y=o.y+o.height/2-c.height/2,P=o[p]/2-c[p]/2;let R;switch(x){case"top":R={x:v,y:o.y-c.height};break;case"bottom":R={x:v,y:o.y+o.height};break;case"right":R={x:o.x+o.width,y};break;case"left":R={x:o.x-c.width,y};break;default:R={x:o.x,y:o.y}}switch(Qs(a)){case"start":R[f]-=P*(l&&g?-1:1);break;case"end":R[f]+=P*(l&&g?-1:1);break}return R}async function T2(n,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:u,rects:f,elements:p,strategy:x}=n,{boundary:g="clippingAncestors",rootBoundary:v="viewport",elementContext:y="floating",altBoundary:P=!1,padding:R=0}=qr(a,n),C=Yx(R),b=p[P?y==="floating"?"reference":"floating":y],S=Ti(await u.getClippingRect({element:(l=await(u.isElement==null?void 0:u.isElement(b)))==null||l?b:b.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(p.floating)),boundary:g,rootBoundary:v,strategy:x})),E=y==="floating"?{x:o,y:c,width:f.floating.width,height:f.floating.height}:f.reference,w=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),M=await(u.isElement==null?void 0:u.isElement(w))?await(u.getScale==null?void 0:u.getScale(w))||{x:1,y:1}:{x:1,y:1},D=Ti(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:E,offsetParent:w,strategy:x}):E);return{top:(S.top-D.top+C.top)/M.y,bottom:(D.bottom-S.bottom+C.bottom)/M.y,left:(S.left-D.left+C.left)/M.x,right:(D.right-S.right+C.right)/M.x}}const _2=async(n,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:f}=l,p=u.filter(Boolean),x=await(f.isRTL==null?void 0:f.isRTL(a));let g=await f.getElementRects({reference:n,floating:a,strategy:c}),{x:v,y}=Qm(g,o,x),P=o,R={},C=0;for(let b=0;b<p.length;b++){var j;const{name:S,fn:E}=p[b],{x:w,y:M,data:D,reset:V}=await E({x:v,y,initialPlacement:o,placement:P,strategy:c,middlewareData:R,rects:g,platform:{...f,detectOverflow:(j=f.detectOverflow)!=null?j:T2},elements:{reference:n,floating:a}});v=w??v,y=M??y,R={...R,[S]:{...R[S],...D}},V&&C<=50&&(C++,typeof V=="object"&&(V.placement&&(P=V.placement),V.rects&&(g=V.rects===!0?await f.getElementRects({reference:n,floating:a,strategy:c}):V.rects),{x:v,y}=Qm(g,P,x)),b=-1)}return{x:v,y,placement:P,strategy:c,middlewareData:R}},I2=n=>({name:"arrow",options:n,async fn(a){const{x:l,y:o,placement:c,rects:u,platform:f,elements:p,middlewareData:x}=a,{element:g,padding:v=0}=qr(n,a)||{};if(g==null)return{};const y=Yx(v),P={x:l,y:o},R=au(c),C=su(R),j=await f.getDimensions(g),b=R==="y",S=b?"top":"left",E=b?"bottom":"right",w=b?"clientHeight":"clientWidth",M=u.reference[C]+u.reference[R]-P[R]-u.floating[C],D=P[R]-u.reference[R],V=await(f.getOffsetParent==null?void 0:f.getOffsetParent(g));let k=V?V[w]:0;(!k||!await(f.isElement==null?void 0:f.isElement(V)))&&(k=p.floating[w]||u.floating[C]);const T=M/2-D/2,U=k/2-j[C]/2-1,Q=Mn(y[S],U),te=Mn(y[E],U),oe=Q,he=k-j[C]-te,ne=k/2-j[C]/2+T,le=bd(oe,ne,he),Z=!x.arrow&&Qs(c)!=null&&ne!==le&&u.reference[C]/2-(ne<oe?Q:te)-j[C]/2<0,$=Z?ne<oe?ne-oe:ne-he:0;return{[R]:P[R]+$,data:{[R]:le,centerOffset:ne-le-$,...Z&&{alignmentOffset:$}},reset:Z}}}),A2=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(a){var l,o;const{placement:c,middlewareData:u,rects:f,initialPlacement:p,platform:x,elements:g}=a,{mainAxis:v=!0,crossAxis:y=!0,fallbackPlacements:P,fallbackStrategy:R="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:j=!0,...b}=qr(n,a);if((l=u.arrow)!=null&&l.alignmentOffset)return{};const S=Xr(c),E=Dr(p),w=Xr(p)===p,M=await(x.isRTL==null?void 0:x.isRTL(g.floating)),D=P||(w||!j?[Ri(p)]:S2(p)),V=C!=="none";!P&&V&&D.push(...P2(p,j,C,M));const k=[p,...D],T=await x.detectOverflow(a,b),U=[];let Q=((o=u.flip)==null?void 0:o.overflows)||[];if(v&&U.push(T[S]),y){const ne=w2(c,f,M);U.push(T[ne[0]],T[ne[1]])}if(Q=[...Q,{placement:c,overflows:U}],!U.every(ne=>ne<=0)){var te,oe;const ne=(((te=u.flip)==null?void 0:te.index)||0)+1,le=k[ne];if(le&&(!(y==="alignment"?E!==Dr(le):!1)||Q.every(_=>Dr(_.placement)===E?_.overflows[0]>0:!0)))return{data:{index:ne,overflows:Q},reset:{placement:le}};let Z=(oe=Q.filter($=>$.overflows[0]<=0).sort(($,_)=>$.overflows[1]-_.overflows[1])[0])==null?void 0:oe.placement;if(!Z)switch(R){case"bestFit":{var he;const $=(he=Q.filter(_=>{if(V){const q=Dr(_.placement);return q===E||q==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(q=>q>0).reduce((q,z)=>q+z,0)]).sort((_,q)=>_[1]-q[1])[0])==null?void 0:he[0];$&&(Z=$);break}case"initialPlacement":Z=p;break}if(c!==Z)return{reset:{placement:Z}}}return{}}}};function qm(n,a){return{top:n.top-a.height,right:n.right-a.width,bottom:n.bottom-a.height,left:n.left-a.width}}function Xm(n){return y2.some(a=>n[a]>=0)}const M2=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...u}=qr(n,a);switch(c){case"referenceHidden":{const f=await o.detectOverflow(a,{...u,elementContext:"reference"}),p=qm(f,l.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:Xm(p)}}}case"escaped":{const f=await o.detectOverflow(a,{...u,altBoundary:!0}),p=qm(f,l.floating);return{data:{escapedOffsets:p,escaped:Xm(p)}}}default:return{}}}}},Gx=new Set(["left","top"]);async function D2(n,a){const{placement:l,platform:o,elements:c}=n,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),f=Xr(l),p=Qs(l),x=Dr(l)==="y",g=Gx.has(f)?-1:1,v=u&&x?-1:1,y=qr(a,n);let{mainAxis:P,crossAxis:R,alignmentAxis:C}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof C=="number"&&(R=p==="end"?C*-1:C),x?{x:R*v,y:P*g}:{x:P*g,y:R*v}}const L2=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var l,o;const{x:c,y:u,placement:f,middlewareData:p}=a,x=await D2(a,n);return f===((l=p.offset)==null?void 0:l.placement)&&(o=p.arrow)!=null&&o.alignmentOffset?{}:{x:c+x.x,y:u+x.y,data:{...x,placement:f}}}}},O2=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(a){const{x:l,y:o,placement:c,platform:u}=a,{mainAxis:f=!0,crossAxis:p=!1,limiter:x={fn:S=>{let{x:E,y:w}=S;return{x:E,y:w}}},...g}=qr(n,a),v={x:l,y:o},y=await u.detectOverflow(a,g),P=Dr(Xr(c)),R=nu(P);let C=v[R],j=v[P];if(f){const S=R==="y"?"top":"left",E=R==="y"?"bottom":"right",w=C+y[S],M=C-y[E];C=bd(w,C,M)}if(p){const S=P==="y"?"top":"left",E=P==="y"?"bottom":"right",w=j+y[S],M=j-y[E];j=bd(w,j,M)}const b=x.fn({...a,[R]:C,[P]:j});return{...b,data:{x:b.x-l,y:b.y-o,enabled:{[R]:f,[P]:p}}}}}},F2=function(n){return n===void 0&&(n={}),{options:n,fn(a){const{x:l,y:o,placement:c,rects:u,middlewareData:f}=a,{offset:p=0,mainAxis:x=!0,crossAxis:g=!0}=qr(n,a),v={x:l,y:o},y=Dr(c),P=nu(y);let R=v[P],C=v[y];const j=qr(p,a),b=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(x){const w=P==="y"?"height":"width",M=u.reference[P]-u.floating[w]+b.mainAxis,D=u.reference[P]+u.reference[w]-b.mainAxis;R<M?R=M:R>D&&(R=D)}if(g){var S,E;const w=P==="y"?"width":"height",M=Gx.has(Xr(c)),D=u.reference[y]-u.floating[w]+(M&&((S=f.offset)==null?void 0:S[y])||0)+(M?0:b.crossAxis),V=u.reference[y]+u.reference[w]+(M?0:((E=f.offset)==null?void 0:E[y])||0)-(M?b.crossAxis:0);C<D?C=D:C>V&&(C=V)}return{[P]:R,[y]:C}}}},z2=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(a){var l,o;const{placement:c,rects:u,platform:f,elements:p}=a,{apply:x=()=>{},...g}=qr(n,a),v=await f.detectOverflow(a,g),y=Xr(c),P=Qs(c),R=Dr(c)==="y",{width:C,height:j}=u.floating;let b,S;y==="top"||y==="bottom"?(b=y,S=P===(await(f.isRTL==null?void 0:f.isRTL(p.floating))?"start":"end")?"left":"right"):(S=y,b=P==="end"?"top":"bottom");const E=j-v.top-v.bottom,w=C-v.left-v.right,M=Mn(j-v[b],E),D=Mn(C-v[S],w),V=!a.middlewareData.shift;let k=M,T=D;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(T=w),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(k=E),V&&!P){const Q=ar(v.left,0),te=ar(v.right,0),oe=ar(v.top,0),he=ar(v.bottom,0);R?T=C-2*(Q!==0||te!==0?Q+te:ar(v.left,v.right)):k=j-2*(oe!==0||he!==0?oe+he:ar(v.top,v.bottom))}await x({...a,availableWidth:T,availableHeight:k});const U=await f.getDimensions(p.floating);return C!==U.width||j!==U.height?{reset:{rects:!0}}:{}}}};function Wi(){return typeof window<"u"}function qs(n){return Qx(n)?(n.nodeName||"").toLowerCase():"#document"}function lr(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function Fr(n){var a;return(a=(Qx(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function Qx(n){return Wi()?n instanceof Node||n instanceof lr(n).Node:!1}function kr(n){return Wi()?n instanceof Element||n instanceof lr(n).Element:!1}function Or(n){return Wi()?n instanceof HTMLElement||n instanceof lr(n).HTMLElement:!1}function Jm(n){return!Wi()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof lr(n).ShadowRoot}const $2=new Set(["inline","contents"]);function Ga(n){const{overflow:a,overflowX:l,overflowY:o,display:c}=Er(n);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!$2.has(c)}const B2=new Set(["table","td","th"]);function U2(n){return B2.has(qs(n))}const V2=[":popover-open",":modal"];function Hi(n){return V2.some(a=>{try{return n.matches(a)}catch{return!1}})}const W2=["transform","translate","scale","rotate","perspective"],H2=["transform","translate","scale","rotate","perspective","filter"],K2=["paint","layout","strict","content"];function lu(n){const a=iu(),l=kr(n)?Er(n):n;return W2.some(o=>l[o]?l[o]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||H2.some(o=>(l.willChange||"").includes(o))||K2.some(o=>(l.contain||"").includes(o))}function Y2(n){let a=Dn(n);for(;Or(a)&&!Ws(a);){if(lu(a))return a;if(Hi(a))return null;a=Dn(a)}return null}function iu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const G2=new Set(["html","body","#document"]);function Ws(n){return G2.has(qs(n))}function Er(n){return lr(n).getComputedStyle(n)}function Ki(n){return kr(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Dn(n){if(qs(n)==="html")return n;const a=n.assignedSlot||n.parentNode||Jm(n)&&n.host||Fr(n);return Jm(a)?a.host:a}function qx(n){const a=Dn(n);return Ws(a)?n.ownerDocument?n.ownerDocument.body:n.body:Or(a)&&Ga(a)?a:qx(a)}function Va(n,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=qx(n),u=c===((o=n.ownerDocument)==null?void 0:o.body),f=lr(c);if(u){const p=Sd(f);return a.concat(f,f.visualViewport||[],Ga(c)?c:[],p&&l?Va(p):[])}return a.concat(c,Va(c,[],l))}function Sd(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Xx(n){const a=Er(n);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=Or(n),u=c?n.offsetWidth:l,f=c?n.offsetHeight:o,p=Pi(l)!==u||Pi(o)!==f;return p&&(l=u,o=f),{width:l,height:o,$:p}}function ou(n){return kr(n)?n:n.contextElement}function Bs(n){const a=ou(n);if(!Or(a))return Lr(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:u}=Xx(a);let f=(u?Pi(l.width):l.width)/o,p=(u?Pi(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const Q2=Lr(0);function Jx(n){const a=lr(n);return!iu()||!a.visualViewport?Q2:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function q2(n,a,l){return a===void 0&&(a=!1),!l||a&&l!==lr(n)?!1:a}function os(n,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),u=ou(n);let f=Lr(1);a&&(o?kr(o)&&(f=Bs(o)):f=Bs(n));const p=q2(u,l,o)?Jx(u):Lr(0);let x=(c.left+p.x)/f.x,g=(c.top+p.y)/f.y,v=c.width/f.x,y=c.height/f.y;if(u){const P=lr(u),R=o&&kr(o)?lr(o):o;let C=P,j=Sd(C);for(;j&&o&&R!==C;){const b=Bs(j),S=j.getBoundingClientRect(),E=Er(j),w=S.left+(j.clientLeft+parseFloat(E.paddingLeft))*b.x,M=S.top+(j.clientTop+parseFloat(E.paddingTop))*b.y;x*=b.x,g*=b.y,v*=b.x,y*=b.y,x+=w,g+=M,C=lr(j),j=Sd(C)}}return Ti({width:v,height:y,x,y:g})}function Yi(n,a){const l=Ki(n).scrollLeft;return a?a.left+l:os(Fr(n)).left+l}function Zx(n,a){const l=n.getBoundingClientRect(),o=l.left+a.scrollLeft-Yi(n,l),c=l.top+a.scrollTop;return{x:o,y:c}}function X2(n){let{elements:a,rect:l,offsetParent:o,strategy:c}=n;const u=c==="fixed",f=Fr(o),p=a?Hi(a.floating):!1;if(o===f||p&&u)return l;let x={scrollLeft:0,scrollTop:0},g=Lr(1);const v=Lr(0),y=Or(o);if((y||!y&&!u)&&((qs(o)!=="body"||Ga(f))&&(x=Ki(o)),Or(o))){const R=os(o);g=Bs(o),v.x=R.x+o.clientLeft,v.y=R.y+o.clientTop}const P=f&&!y&&!u?Zx(f,x):Lr(0);return{width:l.width*g.x,height:l.height*g.y,x:l.x*g.x-x.scrollLeft*g.x+v.x+P.x,y:l.y*g.y-x.scrollTop*g.y+v.y+P.y}}function J2(n){return Array.from(n.getClientRects())}function Z2(n){const a=Fr(n),l=Ki(n),o=n.ownerDocument.body,c=ar(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),u=ar(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let f=-l.scrollLeft+Yi(n);const p=-l.scrollTop;return Er(o).direction==="rtl"&&(f+=ar(a.clientWidth,o.clientWidth)-c),{width:c,height:u,x:f,y:p}}const Zm=25;function eS(n,a){const l=lr(n),o=Fr(n),c=l.visualViewport;let u=o.clientWidth,f=o.clientHeight,p=0,x=0;if(c){u=c.width,f=c.height;const v=iu();(!v||v&&a==="fixed")&&(p=c.offsetLeft,x=c.offsetTop)}const g=Yi(o);if(g<=0){const v=o.ownerDocument,y=v.body,P=getComputedStyle(y),R=v.compatMode==="CSS1Compat"&&parseFloat(P.marginLeft)+parseFloat(P.marginRight)||0,C=Math.abs(o.clientWidth-y.clientWidth-R);C<=Zm&&(u-=C)}else g<=Zm&&(u+=g);return{width:u,height:f,x:p,y:x}}const tS=new Set(["absolute","fixed"]);function rS(n,a){const l=os(n,!0,a==="fixed"),o=l.top+n.clientTop,c=l.left+n.clientLeft,u=Or(n)?Bs(n):Lr(1),f=n.clientWidth*u.x,p=n.clientHeight*u.y,x=c*u.x,g=o*u.y;return{width:f,height:p,x,y:g}}function ep(n,a,l){let o;if(a==="viewport")o=eS(n,l);else if(a==="document")o=Z2(Fr(n));else if(kr(a))o=rS(a,l);else{const c=Jx(n);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return Ti(o)}function eg(n,a){const l=Dn(n);return l===a||!kr(l)||Ws(l)?!1:Er(l).position==="fixed"||eg(l,a)}function nS(n,a){const l=a.get(n);if(l)return l;let o=Va(n,[],!1).filter(p=>kr(p)&&qs(p)!=="body"),c=null;const u=Er(n).position==="fixed";let f=u?Dn(n):n;for(;kr(f)&&!Ws(f);){const p=Er(f),x=lu(f);!x&&p.position==="fixed"&&(c=null),(u?!x&&!c:!x&&p.position==="static"&&!!c&&tS.has(c.position)||Ga(f)&&!x&&eg(n,f))?o=o.filter(v=>v!==f):c=p,f=Dn(f)}return a.set(n,o),o}function sS(n){let{element:a,boundary:l,rootBoundary:o,strategy:c}=n;const f=[...l==="clippingAncestors"?Hi(a)?[]:nS(a,this._c):[].concat(l),o],p=f[0],x=f.reduce((g,v)=>{const y=ep(a,v,c);return g.top=ar(y.top,g.top),g.right=Mn(y.right,g.right),g.bottom=Mn(y.bottom,g.bottom),g.left=ar(y.left,g.left),g},ep(a,p,c));return{width:x.right-x.left,height:x.bottom-x.top,x:x.left,y:x.top}}function aS(n){const{width:a,height:l}=Xx(n);return{width:a,height:l}}function lS(n,a,l){const o=Or(a),c=Fr(a),u=l==="fixed",f=os(n,!0,u,a);let p={scrollLeft:0,scrollTop:0};const x=Lr(0);function g(){x.x=Yi(c)}if(o||!o&&!u)if((qs(a)!=="body"||Ga(c))&&(p=Ki(a)),o){const R=os(a,!0,u,a);x.x=R.x+a.clientLeft,x.y=R.y+a.clientTop}else c&&g();u&&!o&&c&&g();const v=c&&!o&&!u?Zx(c,p):Lr(0),y=f.left+p.scrollLeft-x.x-v.x,P=f.top+p.scrollTop-x.y-v.y;return{x:y,y:P,width:f.width,height:f.height}}function ad(n){return Er(n).position==="static"}function tp(n,a){if(!Or(n)||Er(n).position==="fixed")return null;if(a)return a(n);let l=n.offsetParent;return Fr(n)===l&&(l=l.ownerDocument.body),l}function tg(n,a){const l=lr(n);if(Hi(n))return l;if(!Or(n)){let c=Dn(n);for(;c&&!Ws(c);){if(kr(c)&&!ad(c))return c;c=Dn(c)}return l}let o=tp(n,a);for(;o&&U2(o)&&ad(o);)o=tp(o,a);return o&&Ws(o)&&ad(o)&&!lu(o)?l:o||Y2(n)||l}const iS=async function(n){const a=this.getOffsetParent||tg,l=this.getDimensions,o=await l(n.floating);return{reference:lS(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function oS(n){return Er(n).direction==="rtl"}const cS={convertOffsetParentRelativeRectToViewportRelativeRect:X2,getDocumentElement:Fr,getClippingRect:sS,getOffsetParent:tg,getElementRects:iS,getClientRects:J2,getDimensions:aS,getScale:Bs,isElement:kr,isRTL:oS};function rg(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function dS(n,a){let l=null,o;const c=Fr(n);function u(){var p;clearTimeout(o),(p=l)==null||p.disconnect(),l=null}function f(p,x){p===void 0&&(p=!1),x===void 0&&(x=1),u();const g=n.getBoundingClientRect(),{left:v,top:y,width:P,height:R}=g;if(p||a(),!P||!R)return;const C=ui(y),j=ui(c.clientWidth-(v+P)),b=ui(c.clientHeight-(y+R)),S=ui(v),w={rootMargin:-C+"px "+-j+"px "+-b+"px "+-S+"px",threshold:ar(0,Mn(1,x))||1};let M=!0;function D(V){const k=V[0].intersectionRatio;if(k!==x){if(!M)return f();k?f(!1,k):o=setTimeout(()=>{f(!1,1e-7)},1e3)}k===1&&!rg(g,n.getBoundingClientRect())&&f(),M=!1}try{l=new IntersectionObserver(D,{...w,root:c.ownerDocument})}catch{l=new IntersectionObserver(D,w)}l.observe(n)}return f(!0),u}function uS(n,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:x=!1}=o,g=ou(n),v=c||u?[...g?Va(g):[],...Va(a)]:[];v.forEach(S=>{c&&S.addEventListener("scroll",l,{passive:!0}),u&&S.addEventListener("resize",l)});const y=g&&p?dS(g,l):null;let P=-1,R=null;f&&(R=new ResizeObserver(S=>{let[E]=S;E&&E.target===g&&R&&(R.unobserve(a),cancelAnimationFrame(P),P=requestAnimationFrame(()=>{var w;(w=R)==null||w.observe(a)})),l()}),g&&!x&&R.observe(g),R.observe(a));let C,j=x?os(n):null;x&&b();function b(){const S=os(n);j&&!rg(j,S)&&l(),j=S,C=requestAnimationFrame(b)}return l(),()=>{var S;v.forEach(E=>{c&&E.removeEventListener("scroll",l),u&&E.removeEventListener("resize",l)}),y==null||y(),(S=R)==null||S.disconnect(),R=null,x&&cancelAnimationFrame(C)}}const fS=L2,hS=O2,mS=A2,pS=z2,xS=M2,rp=I2,gS=F2,vS=(n,a,l)=>{const o=new Map,c={platform:cS,...l},u={...c.platform,_c:o};return _2(n,a,{...c,platform:u})};var yS=typeof document<"u",jS=function(){},xi=yS?h.useLayoutEffect:jS;function _i(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(typeof n=="function"&&n.toString()===a.toString())return!0;let l,o,c;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(l=n.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!_i(n[o],a[o]))return!1;return!0}if(c=Object.keys(n),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const u=c[o];if(!(u==="_owner"&&n.$$typeof)&&!_i(n[u],a[u]))return!1}return!0}return n!==n&&a!==a}function ng(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function np(n,a){const l=ng(n);return Math.round(a*l)/l}function ld(n){const a=h.useRef(n);return xi(()=>{a.current=n}),a}function NS(n){n===void 0&&(n={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:u,floating:f}={},transform:p=!0,whileElementsMounted:x,open:g}=n,[v,y]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[P,R]=h.useState(o);_i(P,o)||R(o);const[C,j]=h.useState(null),[b,S]=h.useState(null),E=h.useCallback(_=>{_!==V.current&&(V.current=_,j(_))},[]),w=h.useCallback(_=>{_!==k.current&&(k.current=_,S(_))},[]),M=u||C,D=f||b,V=h.useRef(null),k=h.useRef(null),T=h.useRef(v),U=x!=null,Q=ld(x),te=ld(c),oe=ld(g),he=h.useCallback(()=>{if(!V.current||!k.current)return;const _={placement:a,strategy:l,middleware:P};te.current&&(_.platform=te.current),vS(V.current,k.current,_).then(q=>{const z={...q,isPositioned:oe.current!==!1};ne.current&&!_i(T.current,z)&&(T.current=z,Wa.flushSync(()=>{y(z)}))})},[P,a,l,te,oe]);xi(()=>{g===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,y(_=>({..._,isPositioned:!1})))},[g]);const ne=h.useRef(!1);xi(()=>(ne.current=!0,()=>{ne.current=!1}),[]),xi(()=>{if(M&&(V.current=M),D&&(k.current=D),M&&D){if(Q.current)return Q.current(M,D,he);he()}},[M,D,he,Q,U]);const le=h.useMemo(()=>({reference:V,floating:k,setReference:E,setFloating:w}),[E,w]),Z=h.useMemo(()=>({reference:M,floating:D}),[M,D]),$=h.useMemo(()=>{const _={position:l,left:0,top:0};if(!Z.floating)return _;const q=np(Z.floating,v.x),z=np(Z.floating,v.y);return p?{..._,transform:"translate("+q+"px, "+z+"px)",...ng(Z.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:q,top:z}},[l,p,Z.floating,v.x,v.y]);return h.useMemo(()=>({...v,update:he,refs:le,elements:Z,floatingStyles:$}),[v,he,le,Z,$])}const bS=n=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:n,fn(l){const{element:o,padding:c}=typeof n=="function"?n(l):n;return o&&a(o)?o.current!=null?rp({element:o.current,padding:c}).fn(l):{}:o?rp({element:o,padding:c}).fn(l):{}}}},wS=(n,a)=>({...fS(n),options:[n,a]}),SS=(n,a)=>({...hS(n),options:[n,a]}),CS=(n,a)=>({...gS(n),options:[n,a]}),kS=(n,a)=>({...mS(n),options:[n,a]}),ES=(n,a)=>({...pS(n),options:[n,a]}),PS=(n,a)=>({...xS(n),options:[n,a]}),RS=(n,a)=>({...bS(n),options:[n,a]});var TS="Arrow",sg=h.forwardRef((n,a)=>{const{children:l,width:o=10,height:c=5,...u}=n;return t.jsx(Ue.svg,{...u,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?l:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});sg.displayName=TS;var _S=sg,cu="Popper",[ag,lg]=On(cu),[IS,ig]=ag(cu),og=n=>{const{__scopePopper:a,children:l}=n,[o,c]=h.useState(null);return t.jsx(IS,{scope:a,anchor:o,onAnchorChange:c,children:l})};og.displayName=cu;var cg="PopperAnchor",dg=h.forwardRef((n,a)=>{const{__scopePopper:l,virtualRef:o,...c}=n,u=ig(cg,l),f=h.useRef(null),p=Xe(a,f),x=h.useRef(null);return h.useEffect(()=>{const g=x.current;x.current=(o==null?void 0:o.current)||f.current,g!==x.current&&u.onAnchorChange(x.current)}),o?null:t.jsx(Ue.div,{...c,ref:p})});dg.displayName=cg;var du="PopperContent",[AS,MS]=ag(du),ug=h.forwardRef((n,a)=>{var re,ye,L,de,ge,_e;const{__scopePopper:l,side:o="bottom",sideOffset:c=0,align:u="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:x=!0,collisionBoundary:g=[],collisionPadding:v=0,sticky:y="partial",hideWhenDetached:P=!1,updatePositionStrategy:R="optimized",onPlaced:C,...j}=n,b=ig(du,l),[S,E]=h.useState(null),w=Xe(a,Oe=>E(Oe)),[M,D]=h.useState(null),V=Zd(M),k=(V==null?void 0:V.width)??0,T=(V==null?void 0:V.height)??0,U=o+(u!=="center"?"-"+u:""),Q=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},te=Array.isArray(g)?g:[g],oe=te.length>0,he={padding:Q,boundary:te.filter(LS),altBoundary:oe},{refs:ne,floatingStyles:le,placement:Z,isPositioned:$,middlewareData:_}=NS({strategy:"fixed",placement:U,whileElementsMounted:(...Oe)=>uS(...Oe,{animationFrame:R==="always"}),elements:{reference:b.anchor},middleware:[wS({mainAxis:c+T,alignmentAxis:f}),x&&SS({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?CS():void 0,...he}),x&&kS({...he}),ES({...he,apply:({elements:Oe,rects:ze,availableWidth:qe,availableHeight:rt})=>{const{width:et,height:kt}=ze.reference,Et=Oe.floating.style;Et.setProperty("--radix-popper-available-width",`${qe}px`),Et.setProperty("--radix-popper-available-height",`${rt}px`),Et.setProperty("--radix-popper-anchor-width",`${et}px`),Et.setProperty("--radix-popper-anchor-height",`${kt}px`)}}),M&&RS({element:M,padding:p}),OS({arrowWidth:k,arrowHeight:T}),P&&PS({strategy:"referenceHidden",...he})]}),[q,z]=mg(Z),A=An(C);Vt(()=>{$&&(A==null||A())},[$,A]);const F=(re=_.arrow)==null?void 0:re.x,G=(ye=_.arrow)==null?void 0:ye.y,J=((L=_.arrow)==null?void 0:L.centerOffset)!==0,[xe,me]=h.useState();return Vt(()=>{S&&me(window.getComputedStyle(S).zIndex)},[S]),t.jsx("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...le,transform:$?le.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[(de=_.transformOrigin)==null?void 0:de.x,(ge=_.transformOrigin)==null?void 0:ge.y].join(" "),...((_e=_.hide)==null?void 0:_e.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:t.jsx(AS,{scope:l,placedSide:q,onArrowChange:D,arrowX:F,arrowY:G,shouldHideArrow:J,children:t.jsx(Ue.div,{"data-side":q,"data-align":z,...j,ref:w,style:{...j.style,animation:$?void 0:"none"}})})})});ug.displayName=du;var fg="PopperArrow",DS={top:"bottom",right:"left",bottom:"top",left:"right"},hg=h.forwardRef(function(a,l){const{__scopePopper:o,...c}=a,u=MS(fg,o),f=DS[u.placedSide];return t.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:t.jsx(_S,{...c,ref:l,style:{...c.style,display:"block"}})})});hg.displayName=fg;function LS(n){return n!==null}var OS=n=>({name:"transformOrigin",options:n,fn(a){var b,S,E;const{placement:l,rects:o,middlewareData:c}=a,f=((b=c.arrow)==null?void 0:b.centerOffset)!==0,p=f?0:n.arrowWidth,x=f?0:n.arrowHeight,[g,v]=mg(l),y={start:"0%",center:"50%",end:"100%"}[v],P=(((S=c.arrow)==null?void 0:S.x)??0)+p/2,R=(((E=c.arrow)==null?void 0:E.y)??0)+x/2;let C="",j="";return g==="bottom"?(C=f?y:`${P}px`,j=`${-x}px`):g==="top"?(C=f?y:`${P}px`,j=`${o.floating.height+x}px`):g==="right"?(C=`${-x}px`,j=f?y:`${R}px`):g==="left"&&(C=`${o.floating.width+x}px`,j=f?y:`${R}px`),{data:{x:C,y:j}}}});function mg(n){const[a,l="center"]=n.split("-");return[a,l]}var FS=og,zS=dg,$S=ug,BS=hg,pg=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"}),US="VisuallyHidden",VS=h.forwardRef((n,a)=>t.jsx(Ue.span,{...n,ref:a,style:{...pg,...n.style}}));VS.displayName=US;var WS=[" ","Enter","ArrowUp","ArrowDown"],HS=[" ","Enter"],cs="Select",[Gi,Qi,KS]=eu(cs),[Xs]=On(cs,[KS,lg]),qi=lg(),[YS,Fn]=Xs(cs),[GS,QS]=Xs(cs),xg=n=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:u,value:f,defaultValue:p,onValueChange:x,dir:g,name:v,autoComplete:y,disabled:P,required:R,form:C}=n,j=qi(a),[b,S]=h.useState(null),[E,w]=h.useState(null),[M,D]=h.useState(!1),V=Bi(g),[k,T]=ls({prop:o,defaultProp:c??!1,onChange:u,caller:cs}),[U,Q]=ls({prop:f,defaultProp:p,onChange:x,caller:cs}),te=h.useRef(null),oe=b?C||!!b.closest("form"):!0,[he,ne]=h.useState(new Set),le=Array.from(he).map(Z=>Z.props.value).join(";");return t.jsx(FS,{...j,children:t.jsxs(YS,{required:R,scope:a,trigger:b,onTriggerChange:S,valueNode:E,onValueNodeChange:w,valueNodeHasChildren:M,onValueNodeHasChildrenChange:D,contentId:_n(),value:U,onValueChange:Q,open:k,onOpenChange:T,dir:V,triggerPointerDownPosRef:te,disabled:P,children:[t.jsx(Gi.Provider,{scope:a,children:t.jsx(GS,{scope:n.__scopeSelect,onNativeOptionAdd:h.useCallback(Z=>{ne($=>new Set($).add(Z))},[]),onNativeOptionRemove:h.useCallback(Z=>{ne($=>{const _=new Set($);return _.delete(Z),_})},[]),children:l})}),oe?t.jsxs(Fg,{"aria-hidden":!0,required:R,tabIndex:-1,name:v,autoComplete:y,value:U,onChange:Z=>Q(Z.target.value),disabled:P,form:C,children:[U===void 0?t.jsx("option",{value:""}):null,Array.from(he)]},le):null]})})};xg.displayName=cs;var gg="SelectTrigger",vg=h.forwardRef((n,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=n,u=qi(l),f=Fn(gg,l),p=f.disabled||o,x=Xe(a,f.onTriggerChange),g=Qi(l),v=h.useRef("touch"),[y,P,R]=$g(j=>{const b=g().filter(w=>!w.disabled),S=b.find(w=>w.value===f.value),E=Bg(b,j,S);E!==void 0&&f.onValueChange(E.value)}),C=j=>{p||(f.onOpenChange(!0),R()),j&&(f.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})};return t.jsx(zS,{asChild:!0,...u,children:t.jsx(Ue.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:p,"data-disabled":p?"":void 0,"data-placeholder":zg(f.value)?"":void 0,...c,ref:x,onClick:Fe(c.onClick,j=>{j.currentTarget.focus(),v.current!=="mouse"&&C(j)}),onPointerDown:Fe(c.onPointerDown,j=>{v.current=j.pointerType;const b=j.target;b.hasPointerCapture(j.pointerId)&&b.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(C(j),j.preventDefault())}),onKeyDown:Fe(c.onKeyDown,j=>{const b=y.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&P(j.key),!(b&&j.key===" ")&&WS.includes(j.key)&&(C(),j.preventDefault())})})})});vg.displayName=gg;var yg="SelectValue",jg=h.forwardRef((n,a)=>{const{__scopeSelect:l,className:o,style:c,children:u,placeholder:f="",...p}=n,x=Fn(yg,l),{onValueNodeHasChildrenChange:g}=x,v=u!==void 0,y=Xe(a,x.onValueNodeChange);return Vt(()=>{g(v)},[g,v]),t.jsx(Ue.span,{...p,ref:y,style:{pointerEvents:"none"},children:zg(x.value)?t.jsx(t.Fragment,{children:f}):u})});jg.displayName=yg;var qS="SelectIcon",Ng=h.forwardRef((n,a)=>{const{__scopeSelect:l,children:o,...c}=n;return t.jsx(Ue.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});Ng.displayName=qS;var XS="SelectPortal",bg=n=>t.jsx(Kd,{asChild:!0,...n});bg.displayName=XS;var ds="SelectContent",wg=h.forwardRef((n,a)=>{const l=Fn(ds,n.__scopeSelect),[o,c]=h.useState();if(Vt(()=>{c(new DocumentFragment)},[]),!l.open){const u=o;return u?Wa.createPortal(t.jsx(Sg,{scope:n.__scopeSelect,children:t.jsx(Gi.Slot,{scope:n.__scopeSelect,children:t.jsx("div",{children:n.children})})}),u):null}return t.jsx(Cg,{...n,ref:a})});wg.displayName=ds;var Sr=10,[Sg,zn]=Xs(ds),JS="SelectContentImpl",ZS=Ua("SelectContent.RemoveScroll"),Cg=h.forwardRef((n,a)=>{const{__scopeSelect:l,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,side:p,sideOffset:x,align:g,alignOffset:v,arrowPadding:y,collisionBoundary:P,collisionPadding:R,sticky:C,hideWhenDetached:j,avoidCollisions:b,...S}=n,E=Fn(ds,l),[w,M]=h.useState(null),[D,V]=h.useState(null),k=Xe(a,re=>M(re)),[T,U]=h.useState(null),[Q,te]=h.useState(null),oe=Qi(l),[he,ne]=h.useState(!1),le=h.useRef(!1);h.useEffect(()=>{if(w)return nx(w)},[w]),Gp();const Z=h.useCallback(re=>{const[ye,...L]=oe().map(_e=>_e.ref.current),[de]=L.slice(-1),ge=document.activeElement;for(const _e of re)if(_e===ge||(_e==null||_e.scrollIntoView({block:"nearest"}),_e===ye&&D&&(D.scrollTop=0),_e===de&&D&&(D.scrollTop=D.scrollHeight),_e==null||_e.focus(),document.activeElement!==ge))return},[oe,D]),$=h.useCallback(()=>Z([T,w]),[Z,T,w]);h.useEffect(()=>{he&&$()},[he,$]);const{onOpenChange:_,triggerPointerDownPosRef:q}=E;h.useEffect(()=>{if(w){let re={x:0,y:0};const ye=de=>{var ge,_e;re={x:Math.abs(Math.round(de.pageX)-(((ge=q.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(de.pageY)-(((_e=q.current)==null?void 0:_e.y)??0))}},L=de=>{re.x<=10&&re.y<=10?de.preventDefault():w.contains(de.target)||_(!1),document.removeEventListener("pointermove",ye),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",L,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",L,{capture:!0})}}},[w,_,q]),h.useEffect(()=>{const re=()=>_(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[_]);const[z,A]=$g(re=>{const ye=oe().filter(ge=>!ge.disabled),L=ye.find(ge=>ge.ref.current===document.activeElement),de=Bg(ye,re,L);de&&setTimeout(()=>de.ref.current.focus())}),F=h.useCallback((re,ye,L)=>{const de=!le.current&&!L;(E.value!==void 0&&E.value===ye||de)&&(U(re),de&&(le.current=!0))},[E.value]),G=h.useCallback(()=>w==null?void 0:w.focus(),[w]),J=h.useCallback((re,ye,L)=>{const de=!le.current&&!L;(E.value!==void 0&&E.value===ye||de)&&te(re)},[E.value]),xe=o==="popper"?Cd:kg,me=xe===Cd?{side:p,sideOffset:x,align:g,alignOffset:v,arrowPadding:y,collisionBoundary:P,collisionPadding:R,sticky:C,hideWhenDetached:j,avoidCollisions:b}:{};return t.jsx(Sg,{scope:l,content:w,viewport:D,onViewportChange:V,itemRefCallback:F,selectedItem:T,onItemLeave:G,itemTextRefCallback:J,focusSelectedItem:$,selectedItemText:Q,position:o,isPositioned:he,searchRef:z,children:t.jsx(Yd,{as:ZS,allowPinchZoom:!0,children:t.jsx(Hd,{asChild:!0,trapped:E.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:Fe(c,re=>{var ye;(ye=E.trigger)==null||ye.focus({preventScroll:!0}),re.preventDefault()}),children:t.jsx(Wd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:t.jsx(xe,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:re=>re.preventDefault(),...S,...me,onPlaced:()=>ne(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Fe(S.onKeyDown,re=>{const ye=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!ye&&re.key.length===1&&A(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let de=oe().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(re.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const ge=re.target,_e=de.indexOf(ge);de=de.slice(_e+1)}setTimeout(()=>Z(de)),re.preventDefault()}})})})})})})});Cg.displayName=JS;var eC="SelectItemAlignedPosition",kg=h.forwardRef((n,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=n,u=Fn(ds,l),f=zn(ds,l),[p,x]=h.useState(null),[g,v]=h.useState(null),y=Xe(a,k=>v(k)),P=Qi(l),R=h.useRef(!1),C=h.useRef(!0),{viewport:j,selectedItem:b,selectedItemText:S,focusSelectedItem:E}=f,w=h.useCallback(()=>{if(u.trigger&&u.valueNode&&p&&g&&j&&b&&S){const k=u.trigger.getBoundingClientRect(),T=g.getBoundingClientRect(),U=u.valueNode.getBoundingClientRect(),Q=S.getBoundingClientRect();if(u.dir!=="rtl"){const ge=Q.left-T.left,_e=U.left-ge,Oe=k.left-_e,ze=k.width+Oe,qe=Math.max(ze,T.width),rt=window.innerWidth-Sr,et=Ei(_e,[Sr,Math.max(Sr,rt-qe)]);p.style.minWidth=ze+"px",p.style.left=et+"px"}else{const ge=T.right-Q.right,_e=window.innerWidth-U.right-ge,Oe=window.innerWidth-k.right-_e,ze=k.width+Oe,qe=Math.max(ze,T.width),rt=window.innerWidth-Sr,et=Ei(_e,[Sr,Math.max(Sr,rt-qe)]);p.style.minWidth=ze+"px",p.style.right=et+"px"}const te=P(),oe=window.innerHeight-Sr*2,he=j.scrollHeight,ne=window.getComputedStyle(g),le=parseInt(ne.borderTopWidth,10),Z=parseInt(ne.paddingTop,10),$=parseInt(ne.borderBottomWidth,10),_=parseInt(ne.paddingBottom,10),q=le+Z+he+_+$,z=Math.min(b.offsetHeight*5,q),A=window.getComputedStyle(j),F=parseInt(A.paddingTop,10),G=parseInt(A.paddingBottom,10),J=k.top+k.height/2-Sr,xe=oe-J,me=b.offsetHeight/2,re=b.offsetTop+me,ye=le+Z+re,L=q-ye;if(ye<=J){const ge=te.length>0&&b===te[te.length-1].ref.current;p.style.bottom="0px";const _e=g.clientHeight-j.offsetTop-j.offsetHeight,Oe=Math.max(xe,me+(ge?G:0)+_e+$),ze=ye+Oe;p.style.height=ze+"px"}else{const ge=te.length>0&&b===te[0].ref.current;p.style.top="0px";const Oe=Math.max(J,le+j.offsetTop+(ge?F:0)+me)+L;p.style.height=Oe+"px",j.scrollTop=ye-J+j.offsetTop}p.style.margin=`${Sr}px 0`,p.style.minHeight=z+"px",p.style.maxHeight=oe+"px",o==null||o(),requestAnimationFrame(()=>R.current=!0)}},[P,u.trigger,u.valueNode,p,g,j,b,S,u.dir,o]);Vt(()=>w(),[w]);const[M,D]=h.useState();Vt(()=>{g&&D(window.getComputedStyle(g).zIndex)},[g]);const V=h.useCallback(k=>{k&&C.current===!0&&(w(),E==null||E(),C.current=!1)},[w,E]);return t.jsx(rC,{scope:l,contentWrapper:p,shouldExpandOnScrollRef:R,onScrollButtonChange:V,children:t.jsx("div",{ref:x,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:t.jsx(Ue.div,{...c,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});kg.displayName=eC;var tC="SelectPopperPosition",Cd=h.forwardRef((n,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=Sr,...u}=n,f=qi(l);return t.jsx($S,{...f,...u,ref:a,align:o,collisionPadding:c,style:{boxSizing:"border-box",...u.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)"}})});Cd.displayName=tC;var[rC,uu]=Xs(ds,{}),kd="SelectViewport",Eg=h.forwardRef((n,a)=>{const{__scopeSelect:l,nonce:o,...c}=n,u=zn(kd,l),f=uu(kd,l),p=Xe(a,u.onViewportChange),x=h.useRef(0);return t.jsxs(t.Fragment,{children:[t.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:o}),t.jsx(Gi.Slot,{scope:l,children:t.jsx(Ue.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:p,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Fe(c.onScroll,g=>{const v=g.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:P}=f;if(P!=null&&P.current&&y){const R=Math.abs(x.current-v.scrollTop);if(R>0){const C=window.innerHeight-Sr*2,j=parseFloat(y.style.minHeight),b=parseFloat(y.style.height),S=Math.max(j,b);if(S<C){const E=S+R,w=Math.min(C,E),M=E-w;y.style.height=w+"px",y.style.bottom==="0px"&&(v.scrollTop=M>0?M:0,y.style.justifyContent="flex-end")}}}x.current=v.scrollTop})})})]})});Eg.displayName=kd;var Pg="SelectGroup",[nC,sC]=Xs(Pg),aC=h.forwardRef((n,a)=>{const{__scopeSelect:l,...o}=n,c=_n();return t.jsx(nC,{scope:l,id:c,children:t.jsx(Ue.div,{role:"group","aria-labelledby":c,...o,ref:a})})});aC.displayName=Pg;var Rg="SelectLabel",lC=h.forwardRef((n,a)=>{const{__scopeSelect:l,...o}=n,c=sC(Rg,l);return t.jsx(Ue.div,{id:c.id,...o,ref:a})});lC.displayName=Rg;var Ii="SelectItem",[iC,Tg]=Xs(Ii),_g=h.forwardRef((n,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:u,...f}=n,p=Fn(Ii,l),x=zn(Ii,l),g=p.value===o,[v,y]=h.useState(u??""),[P,R]=h.useState(!1),C=Xe(a,E=>{var w;return(w=x.itemRefCallback)==null?void 0:w.call(x,E,o,c)}),j=_n(),b=h.useRef("touch"),S=()=>{c||(p.onValueChange(o),p.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> 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 t.jsx(iC,{scope:l,value:o,disabled:c,textId:j,isSelected:g,onItemTextChange:h.useCallback(E=>{y(w=>w||((E==null?void 0:E.textContent)??"").trim())},[]),children:t.jsx(Gi.ItemSlot,{scope:l,value:o,disabled:c,textValue:v,children:t.jsx(Ue.div,{role:"option","aria-labelledby":j,"data-highlighted":P?"":void 0,"aria-selected":g&&P,"data-state":g?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...f,ref:C,onFocus:Fe(f.onFocus,()=>R(!0)),onBlur:Fe(f.onBlur,()=>R(!1)),onClick:Fe(f.onClick,()=>{b.current!=="mouse"&&S()}),onPointerUp:Fe(f.onPointerUp,()=>{b.current==="mouse"&&S()}),onPointerDown:Fe(f.onPointerDown,E=>{b.current=E.pointerType}),onPointerMove:Fe(f.onPointerMove,E=>{var w;b.current=E.pointerType,c?(w=x.onItemLeave)==null||w.call(x):b.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Fe(f.onPointerLeave,E=>{var w;E.currentTarget===document.activeElement&&((w=x.onItemLeave)==null||w.call(x))}),onKeyDown:Fe(f.onKeyDown,E=>{var M;((M=x.searchRef)==null?void 0:M.current)!==""&&E.key===" "||(HS.includes(E.key)&&S(),E.key===" "&&E.preventDefault())})})})})});_g.displayName=Ii;var Oa="SelectItemText",Ig=h.forwardRef((n,a)=>{const{__scopeSelect:l,className:o,style:c,...u}=n,f=Fn(Oa,l),p=zn(Oa,l),x=Tg(Oa,l),g=QS(Oa,l),[v,y]=h.useState(null),P=Xe(a,S=>y(S),x.onItemTextChange,S=>{var E;return(E=p.itemTextRefCallback)==null?void 0:E.call(p,S,x.value,x.disabled)}),R=v==null?void 0:v.textContent,C=h.useMemo(()=>t.jsx("option",{value:x.value,disabled:x.disabled,children:R},x.value),[x.disabled,x.value,R]),{onNativeOptionAdd:j,onNativeOptionRemove:b}=g;return Vt(()=>(j(C),()=>b(C)),[j,b,C]),t.jsxs(t.Fragment,{children:[t.jsx(Ue.span,{id:x.textId,...u,ref:P}),x.isSelected&&f.valueNode&&!f.valueNodeHasChildren?Wa.createPortal(u.children,f.valueNode):null]})});Ig.displayName=Oa;var Ag="SelectItemIndicator",Mg=h.forwardRef((n,a)=>{const{__scopeSelect:l,...o}=n;return Tg(Ag,l).isSelected?t.jsx(Ue.span,{"aria-hidden":!0,...o,ref:a}):null});Mg.displayName=Ag;var Ed="SelectScrollUpButton",Dg=h.forwardRef((n,a)=>{const l=zn(Ed,n.__scopeSelect),o=uu(Ed,n.__scopeSelect),[c,u]=h.useState(!1),f=Xe(a,o.onScrollButtonChange);return Vt(()=>{if(l.viewport&&l.isPositioned){let p=function(){const g=x.scrollTop>0;u(g)};const x=l.viewport;return p(),x.addEventListener("scroll",p),()=>x.removeEventListener("scroll",p)}},[l.viewport,l.isPositioned]),c?t.jsx(Og,{...n,ref:f,onAutoScroll:()=>{const{viewport:p,selectedItem:x}=l;p&&x&&(p.scrollTop=p.scrollTop-x.offsetHeight)}}):null});Dg.displayName=Ed;var Pd="SelectScrollDownButton",Lg=h.forwardRef((n,a)=>{const l=zn(Pd,n.__scopeSelect),o=uu(Pd,n.__scopeSelect),[c,u]=h.useState(!1),f=Xe(a,o.onScrollButtonChange);return Vt(()=>{if(l.viewport&&l.isPositioned){let p=function(){const g=x.scrollHeight-x.clientHeight,v=Math.ceil(x.scrollTop)<g;u(v)};const x=l.viewport;return p(),x.addEventListener("scroll",p),()=>x.removeEventListener("scroll",p)}},[l.viewport,l.isPositioned]),c?t.jsx(Og,{...n,ref:f,onAutoScroll:()=>{const{viewport:p,selectedItem:x}=l;p&&x&&(p.scrollTop=p.scrollTop+x.offsetHeight)}}):null});Lg.displayName=Pd;var Og=h.forwardRef((n,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=n,u=zn("SelectScrollButton",l),f=h.useRef(null),p=Qi(l),x=h.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return h.useEffect(()=>()=>x(),[x]),Vt(()=>{var v;const g=p().find(y=>y.ref.current===document.activeElement);(v=g==null?void 0:g.ref.current)==null||v.scrollIntoView({block:"nearest"})},[p]),t.jsx(Ue.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Fe(c.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(o,50))}),onPointerMove:Fe(c.onPointerMove,()=>{var g;(g=u.onItemLeave)==null||g.call(u),f.current===null&&(f.current=window.setInterval(o,50))}),onPointerLeave:Fe(c.onPointerLeave,()=>{x()})})}),oC="SelectSeparator",cC=h.forwardRef((n,a)=>{const{__scopeSelect:l,...o}=n;return t.jsx(Ue.div,{"aria-hidden":!0,...o,ref:a})});cC.displayName=oC;var Rd="SelectArrow",dC=h.forwardRef((n,a)=>{const{__scopeSelect:l,...o}=n,c=qi(l),u=Fn(Rd,l),f=zn(Rd,l);return u.open&&f.position==="popper"?t.jsx(BS,{...c,...o,ref:a}):null});dC.displayName=Rd;var uC="SelectBubbleInput",Fg=h.forwardRef(({__scopeSelect:n,value:a,...l},o)=>{const c=h.useRef(null),u=Xe(o,c),f=Jd(a);return h.useEffect(()=>{const p=c.current;if(!p)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(p,a),p.dispatchEvent(y)}},[f,a]),t.jsx(Ue.select,{...l,style:{...pg,...l.style},ref:u,defaultValue:a})});Fg.displayName=uC;function zg(n){return n===""||n===void 0}function $g(n){const a=An(n),l=h.useRef(""),o=h.useRef(0),c=h.useCallback(f=>{const p=l.current+f;a(p),(function x(g){l.current=g,window.clearTimeout(o.current),g!==""&&(o.current=window.setTimeout(()=>x(""),1e3))})(p)},[a]),u=h.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,u]}function Bg(n,a,l){const c=a.length>1&&Array.from(a).every(g=>g===a[0])?a[0]:a,u=l?n.indexOf(l):-1;let f=fC(n,Math.max(u,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 fC(n,a){return n.map((l,o)=>n[(a+o)%n.length])}var hC=xg,Ug=vg,mC=jg,pC=Ng,xC=bg,Vg=wg,gC=Eg,Wg=_g,vC=Ig,yC=Mg,jC=Dg,NC=Lg;const id=hC,od=mC,gi=h.forwardRef(({className:n,children:a,...l},o)=>t.jsxs(Ug,{ref:o,className:Je("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",n),...l,children:[a,t.jsx(pC,{asChild:!0,children:t.jsx(Ba,{className:"h-4 w-4 opacity-50"})})]}));gi.displayName=Ug.displayName;const vi=h.forwardRef(({className:n,children:a,position:l="popper",...o},c)=>t.jsx(xC,{children:t.jsxs(Vg,{ref:c,className:Je("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",n),position:l,...o,children:[t.jsx(jC,{className:"flex cursor-default items-center justify-center py-1",children:t.jsx(Np,{className:"h-4 w-4"})}),t.jsx(gC,{className:"p-1",children:a}),t.jsx(NC,{className:"flex cursor-default items-center justify-center py-1",children:t.jsx(Ba,{className:"h-4 w-4"})})]})}));vi.displayName=Vg.displayName;const En=h.forwardRef(({className:n,children:a,...l},o)=>t.jsxs(Wg,{ref:o,className:Je("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",n),...l,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(yC,{children:t.jsx(Di,{className:"h-4 w-4"})})}),t.jsx(vC,{children:a})]}));En.displayName=Wg.displayName;const bC=["一","二","三","四","五","六","七","八","九","十"],wC=["序言","尾声","附录","2026每日派对干货"];function fi(n){return n?wC.some(a=>n.includes(a)):!1}function cd(n){return n.startsWith("part:")?{type:"part",id:n.slice(5)}:n.startsWith("chapter:")?{type:"chapter",id:n.slice(8)}:n.startsWith("section:")?{type:"section",id:n.slice(8)}:null}function SC({parts:n,expandedParts:a,onTogglePart:l,onReorder:o,onReadSection:c,onDeleteSection:u,onAddSectionInPart:f,onAddChapterInPart:p,onDeleteChapter:x,onEditPart:g,onDeletePart:v}){const[y,P]=h.useState(null),[R,C]=h.useState(null),j=(D,V)=>(y==null?void 0:y.type)===D&&(y==null?void 0:y.id)===V,b=(D,V)=>(R==null?void 0:R.type)===D&&(R==null?void 0:R.id)===V,S=h.useCallback(()=>{const D=[];for(const V of n)for(const k of V.chapters)for(const T of k.sections)D.push({id:T.id,partId:V.id,partTitle:V.title,chapterId:k.id,chapterTitle:k.title});return D},[n]),E=h.useCallback(async(D,V,k,T)=>{var he;D.preventDefault(),D.stopPropagation();const U=D.dataTransfer.getData("text/plain"),Q=cd(U);if(!Q||Q.type===V&&Q.id===k)return;const te=S(),oe=new Map(te.map(ne=>[ne.id,ne]));if(Q.type==="section"){const ne=oe.get(Q.id);if(ne&&fi(ne.partTitle))return}else{const ne=Q.type==="part"?n.find(le=>le.id===Q.id):n.find(le=>le.chapters.some(Z=>Z.id===Q.id));if(ne&&fi(ne.title))return}if(!(T&&fi(T.partTitle))){if(V==="part"){const ne=n.find(le=>le.id===k);if(ne&&fi(ne.title))return}if(Q.type==="part"&&V==="part"){const ne=n.map(q=>q.id),le=ne.indexOf(Q.id),Z=ne.indexOf(k);if(le===-1||Z===-1)return;const $=[...ne];$.splice(le,1),$.splice(le<Z?Z-1:Z,0,Q.id);const _=[];for(const q of $){const z=n.find(A=>A.id===q);if(z)for(const A of z.chapters)for(const F of A.sections){const G=oe.get(F.id);G&&_.push(G)}}await o(_);return}if(Q.type==="chapter"&&(V==="chapter"||V==="section"||V==="part")){const ne=n.find(G=>G.chapters.some(J=>J.id===Q.id)),le=ne==null?void 0:ne.chapters.find(G=>G.id===Q.id);if(!ne||!le)return;let Z,$,_=null;if(V==="section"){const G=oe.get(k);if(!G)return;Z=G.partId,$=G.partTitle,_=k}else if(V==="chapter"){const G=n.find(me=>me.chapters.some(re=>re.id===k)),J=G==null?void 0:G.chapters.find(me=>me.id===k);if(!G||!J)return;Z=G.id,$=G.title;const xe=te.filter(me=>me.chapterId===k).pop();_=(xe==null?void 0:xe.id)??null}else{const G=n.find(xe=>xe.id===k);if(!G||!G.chapters[0])return;Z=G.id,$=G.title;const J=te.filter(xe=>xe.partId===G.id&&xe.chapterId===G.chapters[0].id);_=((he=J[J.length-1])==null?void 0:he.id)??null}const q=le.sections.map(G=>G.id),z=te.filter(G=>!q.includes(G.id));let A=z.length;if(_){const G=z.findIndex(J=>J.id===_);G>=0&&(A=G+1)}const F=q.map(G=>({...oe.get(G),partId:Z,partTitle:$,chapterId:le.id,chapterTitle:le.title}));await o([...z.slice(0,A),...F,...z.slice(A)]);return}if(Q.type==="section"&&(V==="section"||V==="chapter"||V==="part")){if(!T)return;const{partId:ne,partTitle:le,chapterId:Z,chapterTitle:$}=T;let _;if(V==="section")_=te.findIndex(J=>J.id===k);else if(V==="chapter"){const J=te.filter(xe=>xe.chapterId===k).pop();_=J?te.findIndex(xe=>xe.id===J.id)+1:te.length}else{const J=n.find(re=>re.id===k);if(!(J!=null&&J.chapters[0]))return;const xe=te.filter(re=>re.partId===J.id&&re.chapterId===J.chapters[0].id),me=xe[xe.length-1];_=me?te.findIndex(re=>re.id===me.id)+1:0}const q=te.findIndex(J=>J.id===Q.id);if(q===-1)return;const z=te.filter(J=>J.id!==Q.id),A=q<_?_-1:_,G={...te[q],partId:ne,partTitle:le,chapterId:Z,chapterTitle:$};z.splice(A,0,G),await o(z)}}},[n,S,o]),w=(D,V,k)=>({onDragEnter:T=>{T.preventDefault(),T.stopPropagation(),T.dataTransfer.dropEffect="move",C({type:D,id:V})},onDragOver:T=>{T.preventDefault(),T.stopPropagation(),T.dataTransfer.dropEffect="move",C({type:D,id:V})},onDragLeave:()=>C(null),onDrop:T=>{C(null);const U=cd(T.dataTransfer.getData("text/plain"));if(U&&!(D==="section"&&U.type==="section"&&U.id===V))if(D==="part")if(U.type==="part")E(T,"part",V);else{const Q=n.find(oe=>oe.id===V);(Q==null?void 0:Q.chapters[0])&&k&&E(T,"part",V,k)}else D==="chapter"&&k?(U.type==="section"||U.type==="chapter")&&E(T,"chapter",V,k):D==="section"&&k&&E(T,"section",V,k)}}),M=D=>bC[D]??String(D+1);return t.jsx("div",{className:"space-y-3",children:n.map((D,V)=>{var le,Z;const k=D.title==="序言"||D.title.includes("序言"),T=D.title==="尾声"||D.title.includes("尾声"),U=D.title==="附录"||D.title.includes("附录"),Q=b("part",D.id),te=a.includes(D.id),oe=D.chapters.length,he=D.chapters.reduce(($,_)=>$+_.sections.length,0);if(k&&D.chapters.length===1&&D.chapters[0].sections.length===1){const $=D.chapters[0].sections[0];return t.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[t.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:t.jsx(Qr,{className:"w-4 h-4 text-gray-400"})}),t.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[D.chapters[0].title," | ",$.title]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:_=>_.stopPropagation(),onClick:_=>_.stopPropagation(),children:[$.price===0||$.isFree?t.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):t.jsxs("span",{className:"text-xs text-gray-500",children:["¥",$.price]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c($),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Pn,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c($),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u($),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]}),t.jsx(Cn,{className:"w-4 h-4 text-gray-500"})]})]},D.id)}if(D.title==="2026每日派对干货"||D.title.includes("2026每日派对干货"))return t.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between p-4 cursor-pointer select-none hover:bg-[#162840]/50 transition-all",onClick:()=>l(D.id),children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac]/80 flex items-center justify-center text-white font-bold shrink-0",children:"派"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-bold text-white text-base",children:D.title}),t.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",he," 节"]})]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:$=>$.stopPropagation(),onClick:$=>$.stopPropagation(),children:[f&&t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>f(D),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:t.jsx(zt,{className:"w-3.5 h-3.5"})}),te?t.jsx(Ba,{className:"w-5 h-5 text-gray-500"}):t.jsx(Cn,{className:"w-5 h-5 text-gray-500"})]})]}),te&&D.chapters.length>0&&t.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:D.chapters.map(($,_)=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("p",{className:"text-xs text-gray-500 pb-1",children:["第",_+1,"章 | ",$.title]}),t.jsx("div",{className:"space-y-1 pl-2",children:$.sections.map(q=>t.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg hover:bg-[#162840]/50 min-h-[40px]",children:[t.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[q.id," ",q.title]}),t.jsxs("div",{className:"flex gap-1 shrink-0",children:[t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(q),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Pn,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(q),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(q),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]})]},q.id))})]},$.id))})]},D.id);if(U)return t.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[t.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"附录"}),t.jsx("div",{className:"space-y-3",children:D.chapters.map(($,_)=>$.sections.length>0?$.sections.map(q=>t.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2 group",children:[t.jsxs("span",{className:"text-sm text-gray-300 truncate",children:["附录",_+1," | ",$.title," | ",q.title]}),t.jsxs("div",{className:"flex gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>c(q),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Pn,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>c(q),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>u(q),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]}),t.jsx(Cn,{className:"w-4 h-4 text-gray-500 shrink-0"})]},q.id)):t.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2",children:[t.jsxs("span",{className:"text-sm text-gray-500",children:["附录",_+1," | ",$.title,"(空)"]}),t.jsx(Cn,{className:"w-4 h-4 text-gray-500 shrink-0"})]},$.id))})]},D.id);if(T&&D.chapters.length===1&&D.chapters[0].sections.length===1){const $=D.chapters[0].sections[0];return t.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[t.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:t.jsx(Qr,{className:"w-4 h-4 text-gray-400"})}),t.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[D.chapters[0].title," | ",$.title]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:_=>_.stopPropagation(),onClick:_=>_.stopPropagation(),children:[$.price===0||$.isFree?t.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):t.jsxs("span",{className:"text-xs text-gray-500",children:["¥",$.price]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c($),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Pn,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c($),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u($),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]}),t.jsx(Cn,{className:"w-4 h-4 text-gray-500"})]})]},D.id)}return T?t.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[t.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"尾声"}),t.jsx("div",{className:"space-y-3",children:D.chapters.map($=>$.sections.map(_=>t.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2",children:[t.jsxs("span",{className:"text-sm text-gray-300",children:[$.title," | ",_.title]}),t.jsxs("div",{className:"flex gap-1 shrink-0",children:[t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Pn,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(_),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]})]},_.id)))})]},D.id):t.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${Q?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...w("part",D.id,{partId:D.id,partTitle:D.title,chapterId:((le=D.chapters[0])==null?void 0:le.id)??"",chapterTitle:((Z=D.chapters[0])==null?void 0:Z.title)??""}),children:[t.jsxs("div",{draggable:!0,onDragStart:$=>{$.stopPropagation(),$.dataTransfer.setData("text/plain","part:"+D.id),$.dataTransfer.effectAllowed="move",P({type:"part",id:D.id})},onDragEnd:()=>{P(null),C(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",D.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(D.id),children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(Yc,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),t.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac] flex items-center justify-center text-white font-bold shadow-lg shadow-[#38bdac]/30 shrink-0",children:M(V)}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-bold text-white text-base",children:D.title}),t.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",he," 节"]})]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:$=>$.stopPropagation(),onClick:$=>$.stopPropagation(),children:[f&&t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>f(D),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:t.jsx(zt,{className:"w-3.5 h-3.5"})}),g&&t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(D),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),v&&t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>v(D),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:t.jsx(sr,{className:"w-3.5 h-3.5"})}),t.jsxs("span",{className:"text-xs text-gray-500",children:[oe,"章"]}),te?t.jsx(Ba,{className:"w-5 h-5 text-gray-500"}):t.jsx(Cn,{className:"w-5 h-5 text-gray-500"})]})]}),te&&t.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:D.chapters.map(($,_)=>{const q=b("chapter",$.id);return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[t.jsxs("div",{draggable:!0,onDragStart:z=>{z.stopPropagation(),z.dataTransfer.setData("text/plain","chapter:"+$.id),z.dataTransfer.effectAllowed="move",P({type:"chapter",id:$.id})},onDragEnd:()=>{P(null),C(null)},onDragEnter:z=>{z.preventDefault(),z.stopPropagation(),z.dataTransfer.dropEffect="move",C({type:"chapter",id:$.id})},onDragOver:z=>{z.preventDefault(),z.stopPropagation(),z.dataTransfer.dropEffect="move",C({type:"chapter",id:$.id})},onDragLeave:()=>C(null),onDrop:z=>{C(null);const A=cd(z.dataTransfer.getData("text/plain"));if(!A)return;const F={partId:D.id,partTitle:D.title,chapterId:$.id,chapterTitle:$.title};(A.type==="section"||A.type==="chapter")&&E(z,"chapter",$.id,F)},className:`flex-1 min-w-0 py-2 px-2 rounded cursor-grab active:cursor-grabbing select-none -mx-2 transition-all duration-200 flex items-center gap-2 ${q?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${j("chapter",$.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[t.jsx(Yc,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),t.jsxs("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:["第",_+1,"章 | ",$.title]})]}),t.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:z=>z.stopPropagation(),children:[p&&t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>p(D),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:t.jsx(zt,{className:"w-3.5 h-3.5"})}),x&&t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>x(D,$),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]})]}),t.jsx("div",{className:"space-y-1 pl-2",children:$.sections.map(z=>{const A=b("section",z.id);return t.jsxs("div",{draggable:!0,onDragStart:F=>{F.stopPropagation(),F.dataTransfer.setData("text/plain","section:"+z.id),F.dataTransfer.effectAllowed="move",P({type:"section",id:z.id})},onDragEnd:()=>{P(null),C(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg group cursor-grab active:cursor-grabbing select-none min-h-[40px] transition-all duration-200 ${A?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",z.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,...w("section",z.id,{partId:D.id,partTitle:D.title,chapterId:$.id,chapterTitle:$.title}),children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[t.jsx(Yc,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),t.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${z.price===0||z.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),t.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[z.id," ",z.title]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:F=>F.stopPropagation(),onClick:F=>F.stopPropagation(),children:[z.isNew&&t.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),z.price===0||z.isFree?t.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):t.jsxs("span",{className:"text-xs text-gray-500",children:["¥",z.price]}),t.jsxs("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(z),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Pn,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(z),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(z),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]}),t.jsx(Cn,{className:"w-4 h-4 text-gray-500"})]})]},z.id)})})]},$.id)})})]},D.id)})})}function CC(n){const a=new Map;for(const f of n){const p=f.partId||"part-1",x=f.partTitle||"未分类",g=f.chapterId||"chapter-1",v=f.chapterTitle||"未分类";a.has(p)||a.set(p,{id:p,title:x,chapters:new Map});const y=a.get(p);y.chapters.has(g)||y.chapters.set(g,{id:g,title:v,sections:[]}),y.chapters.get(g).sections.push({id:f.id,title:f.title,price:f.price??1,filePath:f.filePath,isFree:f.isFree,isNew:f.isNew})}const l="part-2026-daily",o="2026每日派对干货";a.has(l)||a.set(l,{id:l,title:o,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:o,sections:[]}]])});const c=Array.from(a.values()).map(f=>({...f,chapters:Array.from(f.chapters.values())})),u=f=>f.includes("序言")?0:f.includes(o)?1.5:f.includes("附录")?2:f.includes("尾声")?3:1;return c.sort((f,p)=>{const x=u(f.title),g=u(p.title);return x!==g?x-g:0})}function kC(){var Et;const[n,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState([]),[f,p]=h.useState(null),[x,g]=h.useState(!1),[v,y]=h.useState(!1),[P,R]=h.useState(!1),[C,j]=h.useState(""),[b,S]=h.useState([]),[E,w]=h.useState(!1),[M,D]=h.useState(!1),V=h.useRef(null),[k,T]=h.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[U,Q]=h.useState(null),[te,oe]=h.useState(!1),[he,ne]=h.useState(!1),[le,Z]=h.useState(""),[$,_]=h.useState(!1),q=CC(n),z=n.length,A=async()=>{o(!0);try{const K=await Ge("/api/db/book?action=list");a(Array.isArray(K==null?void 0:K.sections)?K.sections:[])}catch(K){console.error(K),a([])}finally{o(!1)}};h.useEffect(()=>{A()},[]);const F=K=>{u(pe=>pe.includes(K)?pe.filter(Le=>Le!==K):[...pe,K])},G=h.useCallback(K=>{const pe=n,Le=K.flatMap(Ie=>{const At=pe.find(rn=>rn.id===Ie.id);return At?[{...At,partId:Ie.partId,partTitle:Ie.partTitle,chapterId:Ie.chapterId,chapterTitle:Ie.chapterTitle}]:[]});return a(Le),St("/api/db/book",{action:"reorder",items:K}).then(Ie=>{Ie&&Ie.success===!1&&(a(pe),alert("排序失败: "+(Ie&&typeof Ie=="object"&&"error"in Ie?Ie.error:"未知错误")))}).catch(Ie=>{a(pe),console.error("排序失败:",Ie),alert("排序失败: "+(Ie instanceof Error?Ie.message:"网络或服务异常"))}),Promise.resolve()},[n]),J=async K=>{if(confirm(`确定要删除章节「${K.title}」吗?此操作不可恢复。`))try{const pe=await ss(`/api/db/book?id=${encodeURIComponent(K.id)}`);pe&&pe.success!==!1?(alert("已删除"),A()):alert("删除失败: "+(pe&&typeof pe=="object"&&"error"in pe?pe.error:"未知错误"))}catch(pe){console.error(pe),alert("删除失败")}},xe=async K=>{y(!0);try{const pe=await Ge(`/api/db/book?action=read&id=${encodeURIComponent(K.id)}`);if(pe!=null&&pe.success&&pe.section){const Le=pe.section;p({id:K.id,title:pe.section.title??K.title,price:pe.section.price??K.price,content:pe.section.content??"",filePath:K.filePath,isFree:K.isFree||K.price===0,isNew:Le.isNew??K.isNew})}else p({id:K.id,title:K.title,price:K.price,content:"",filePath:K.filePath,isFree:K.isFree,isNew:K.isNew}),pe&&!pe.success&&alert("无法读取文件内容: "+(pe.error||"未知错误"))}catch(pe){console.error(pe),p({id:K.id,title:K.title,price:K.price,content:"",filePath:K.filePath,isFree:K.isFree})}finally{y(!1)}},me=async()=>{var K;if(f){R(!0);try{let pe=f.content||"";const Le=[new RegExp(`^#+\\s*${f.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${f.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(K=f.title)==null?void 0:K.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const At of Le)pe=pe.replace(At,"");pe=pe.replace(/^\s*\n+/,"").trim();const Ie=await St("/api/db/book",{id:f.id,title:f.title,price:f.isFree?0:f.price,content:pe,isFree:f.isFree||f.price===0,isNew:f.isNew,saveToFile:!0});Ie&&Ie.success!==!1?(alert(`已保存章节: ${f.title}`),p(null),A()):alert("保存失败: "+(Ie&&typeof Ie=="object"&&"error"in Ie?Ie.error:"未知错误"))}catch(pe){console.error(pe),alert("保存失败")}finally{R(!1)}}},re=async()=>{if(!k.id||!k.title){alert("请填写章节ID和标题");return}R(!0);try{const K=await St("/api/db/book",{id:k.id,title:k.title,price:k.price,content:k.content,partId:k.partId,chapterId:k.chapterId,saveToFile:!1});K&&K.success!==!1?(alert(`章节创建成功: ${k.title}`),g(!1),T({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),A()):alert("创建失败: "+(K&&typeof K=="object"&&"error"in K?K.error:"未知错误"))}catch(K){console.error(K),alert("创建失败")}finally{R(!1)}},ye=K=>{T(pe=>{var Le;return{...pe,partId:K.id,chapterId:((Le=K.chapters[0])==null?void 0:Le.id)??"chapter-1"}}),g(!0)},L=K=>{Q({id:K.id,title:K.title})},de=async()=>{var K;if((K=U==null?void 0:U.title)!=null&&K.trim()){oe(!0);try{const pe=n.map(Ie=>({id:Ie.id,partId:Ie.partId||"part-1",partTitle:Ie.partId===U.id?U.title.trim():Ie.partTitle||"",chapterId:Ie.chapterId||"chapter-1",chapterTitle:Ie.chapterTitle||""})),Le=await St("/api/db/book",{action:"reorder",items:pe});Le&&Le.success!==!1?(Q(null),A()):alert("更新篇名失败: "+(Le&&typeof Le=="object"&&"error"in Le?Le.error:"未知错误"))}catch(pe){console.error(pe),alert("更新篇名失败")}finally{oe(!1)}}},ge=K=>{const pe=K.chapters.length+1,Le=`chapter-${K.id}-${pe}-${Date.now()}`;T({id:`${pe}.1`,title:"新章节",price:1,partId:K.id,chapterId:Le,content:""}),g(!0)},_e=async(K,pe)=>{const Le=pe.sections.map(Ie=>Ie.id);if(Le.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${K.chapters.indexOf(pe)+1}章 | ${pe.title}」吗?将删除共 ${Le.length} 节,此操作不可恢复。`))try{for(const Ie of Le)await ss(`/api/db/book?id=${encodeURIComponent(Ie)}`);A()}catch(Ie){console.error(Ie),alert("删除失败")}},Oe=async()=>{if(!le.trim()){alert("请输入篇名");return}_(!0);try{const K=`part-new-${Date.now()}`,pe="chapter-1",Le=`part-placeholder-${Date.now()}`,Ie=await St("/api/db/book",{id:Le,title:"占位节(可编辑)",price:0,content:"",partId:K,partTitle:le.trim(),chapterId:pe,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Ie&&Ie.success!==!1?(alert(`篇「${le}」创建成功,请编辑占位节`),ne(!1),Z(""),A()):alert("创建失败: "+(Ie&&typeof Ie=="object"&&"error"in Ie?Ie.error:"未知错误"))}catch(K){console.error(K),alert("创建失败")}finally{_(!1)}},ze=async K=>{const pe=n.filter(Le=>Le.partId===K.id).map(Le=>Le.id);if(pe.length!==0&&confirm(`确定要删除「${K.title}」整篇吗?将删除共 ${pe.length} 节内容,此操作不可恢复。`))try{for(const Le of pe)await ss(`/api/db/book?id=${encodeURIComponent(Le)}`);A()}catch(Le){console.error(Le),alert("删除失败")}},qe=async K=>{var Le,Ie;const pe=(Le=K.target.files)==null?void 0:Le[0];if(pe){D(!0);try{const At=new FormData;At.append("file",pe),At.append("folder","book-images");const Pt=await(await fetch(Vs("/api/upload"),{method:"POST",body:At,credentials:"include"})).json();if(Pt!=null&&Pt.success&&((Ie=Pt==null?void 0:Pt.data)!=null&&Ie.url)){const se=``;f&&p({...f,content:(f.content||"")+`
|
||
|
||
`+se}),alert(`图片上传成功: ${Pt.data.url}`)}else alert("上传失败: "+((Pt==null?void 0:Pt.error)||"未知错误"))}catch(At){console.error(At),alert("上传失败")}finally{D(!1),V.current&&(V.current.value="")}}},rt=async()=>{var K;if(C.trim()){w(!0);try{const pe=await Ge(`/api/search?q=${encodeURIComponent(C)}`);pe!=null&&pe.success&&((K=pe.data)!=null&&K.results)?S(pe.data.results):(S([]),pe&&!pe.success&&alert("搜索失败: "+pe.error))}catch(pe){console.error(pe),S([]),alert("搜索失败")}finally{w(!1)}}},et=q.find(K=>K.id===k.partId),kt=(et==null?void 0:et.chapters)??[];return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"内容管理"}),t.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",q.length," 篇 · ",z," 节内容"]})]}),t.jsx("div",{className:"flex gap-2",children:t.jsxs(ee,{onClick:()=>{const K=typeof window<"u"?`${window.location.origin}/api-doc`:"";K&&window.open(K,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(ts,{className:"w-4 h-4 mr-2"}),"API 接口"]})})]}),t.jsx($t,{open:x,onOpenChange:g,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(zt,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"章节ID *"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:k.id,onChange:K=>T({...k,id:K.target.value})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"价格 (元)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:k.price,onChange:K=>T({...k,price:Number(K.target.value)})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"章节标题 *"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:k.title,onChange:K=>T({...k,title:K.target.value})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"所属篇"}),t.jsxs(id,{value:k.partId,onValueChange:K=>T({...k,partId:K,chapterId:"chapter-1"}),children:[t.jsx(gi,{className:"bg-[#0a1628] border-gray-700 text-white",children:t.jsx(od,{})}),t.jsxs(vi,{className:"bg-[#0f2137] border-gray-700",children:[q.map(K=>t.jsx(En,{value:K.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:K.title},K.id)),q.length===0&&t.jsx(En,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"所属章"}),t.jsxs(id,{value:k.chapterId,onValueChange:K=>T({...k,chapterId:K}),children:[t.jsx(gi,{className:"bg-[#0a1628] border-gray-700 text-white",children:t.jsx(od,{})}),t.jsxs(vi,{className:"bg-[#0f2137] border-gray-700",children:[kt.map(K=>t.jsx(En,{value:K.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:K.title},K.id)),kt.length===0&&t.jsx(En,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"内容 (Markdown格式)"}),t.jsx(as,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:k.content,onChange:K=>T({...k,content:K.target.value})})]})]}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",onClick:()=>g(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsx(ee,{onClick:re,disabled:P||!k.id||!k.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:P?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),t.jsx($t,{open:!!U,onOpenChange:K=>!K&&Q(null),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(Ft,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),U&&t.jsx("div",{className:"space-y-4 py-4",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"篇名"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:U.title,onChange:K=>Q({...U,title:K.target.value}),placeholder:"输入篇名"})]})}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",onClick:()=>Q(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsx(ee,{onClick:de,disabled:te||!((Et=U==null?void 0:U.title)!=null&&Et.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:te?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),t.jsx($t,{open:he,onOpenChange:ne,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(zt,{className:"w-5 h-5 text-amber-400"}),"新建篇"]})}),t.jsx("div",{className:"space-y-4 py-4",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"篇名(如:第六篇|真实的社会)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:le,onChange:K=>Z(K.target.value),placeholder:"输入篇名"})]})}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",onClick:()=>{ne(!1),Z("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsx(ee,{onClick:Oe,disabled:$||!le.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:$?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"创建篇"]})})]})]})}),t.jsx($t,{open:!!f,onOpenChange:()=>p(null),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(Ft,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),f&&t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"章节ID"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.id,disabled:!0})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"价格 (元)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:f.isFree?0:f.price,onChange:K=>p({...f,price:Number(K.target.value),isFree:Number(K.target.value)===0}),disabled:f.isFree})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"免费章节(唯一入口,小程序以 is_free 或 price=0 为准)"}),t.jsx("div",{className:"flex items-center h-10",children:t.jsxs("label",{className:"flex items-center cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:f.isFree||f.price===0,onChange:K=>p({...f,isFree:K.target.checked,price:K.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),t.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"最新新增"}),t.jsx("div",{className:"flex items-center h-10",children:t.jsxs("label",{className:"flex items-center cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:f.isNew??!1,onChange:K=>p({...f,isNew:K.target.checked}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),t.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"标记 NEW"})]})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"章节标题"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.title,onChange:K=>p({...f,title:K.target.value})})]}),f.filePath&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"文件路径"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:f.filePath,disabled:!0})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(X,{className:"text-gray-300",children:"内容 (Markdown格式)"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{ref:V,type:"file",accept:"image/*",onChange:qe,className:"hidden"}),t.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>{var K;return(K=V.current)==null?void 0:K.click()},disabled:M,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[M?t.jsx(tt,{className:"w-4 h-4 mr-1 animate-spin"}):t.jsx(Cp,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),v?t.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsx(as,{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:K=>p({...f,content:K.target.value})})]})]}),t.jsxs(Kt,{children:[t.jsxs(ee,{variant:"outline",onClick:()=>p(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsx(ee,{onClick:me,disabled:P,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:P?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),t.jsxs(ru,{defaultValue:"chapters",className:"space-y-6",children:[t.jsxs(Vi,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[t.jsxs(hr,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[t.jsx(Qr,{className:"w-4 h-4 mr-2"}),"章节管理"]}),t.jsxs(hr,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[t.jsx(rs,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),t.jsxs(hr,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[t.jsx(ON,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),t.jsxs(mr,{value:"chapters",className:"space-y-4",children:[t.jsxs("div",{className:"rounded-2xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between shadow-sm",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac] flex items-center justify-center text-white shadow-lg shadow-[#38bdac]/20 shrink-0",children:t.jsx(Qr,{className:"w-6 h-6"})}),t.jsxs("div",{children:[t.jsx("h2",{className:"font-bold text-base text-white leading-tight mb-1",children:"一场SOUL的创业实验场"}),t.jsx("p",{className:"text-xs text-gray-500",children:"来自Soul派对房的真实商业故事"})]})]}),t.jsxs("div",{className:"text-center shrink-0",children:[t.jsx("span",{className:"block text-2xl font-bold text-[#38bdac]",children:z}),t.jsx("span",{className:"text-xs text-gray-500",children:"章节"})]})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(ee,{onClick:()=>g(!0),className:"flex-1 bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"新建章节"]}),t.jsxs(ee,{onClick:()=>ne(!0),className:"flex-1 bg-amber-500/10 hover:bg-amber-500/20 text-amber-400 border border-amber-500/30",children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"新建篇"]})]}),l?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsx(SC,{parts:q,expandedParts:c,onTogglePart:F,onReorder:G,onReadSection:xe,onDeleteSection:J,onAddSectionInPart:ye,onAddChapterInPart:ge,onDeleteChapter:_e,onEditPart:L,onDeletePart:ze})]}),t.jsx(mr,{value:"search",className:"space-y-4",children:t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"内容搜索"})}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:C,onChange:K=>j(K.target.value),onKeyDown:K=>K.key==="Enter"&&rt()}),t.jsx(ee,{onClick:rt,disabled:E||!C.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?t.jsx(tt,{className:"w-4 h-4 animate-spin"}):t.jsx(rs,{className:"w-4 h-4"})})]}),b.length>0&&t.jsxs("div",{className:"space-y-2 mt-4",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",b.length," 个结果"]}),b.map(K=>t.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>xe({id:K.id,title:K.title,price:K.price??1,filePath:""}),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:K.id}),t.jsx("span",{className:"text-white",children:K.title})]}),t.jsx($e,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:K.matchType==="title"?"标题匹配":"内容匹配"})]}),K.snippet&&t.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:K.snippet}),(K.partTitle||K.chapterTitle)&&t.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[K.partTitle," · ",K.chapterTitle]})]},K.id))]})]})]})}),t.jsx(mr,{value:"hooks",className:"space-y-4",children:t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"引流钩子配置"})}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[t.jsx(X,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),t.jsxs(id,{defaultValue:"3",children:[t.jsx(gi,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:t.jsx(od,{placeholder:"选择章节"})}),t.jsxs(vi,{className:"bg-[#0f2137] border-gray-700",children:[t.jsx(En,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),t.jsx(En,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),t.jsx(En,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),t.jsxs("div",{className:"grid w-full gap-1.5",children:[t.jsx(X,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),t.jsx(as,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),t.jsx(ee,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}var Hg=["PageUp","PageDown"],Kg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Yg={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Js="Slider",[Td,EC,PC]=eu(Js),[Gg]=On(Js,[PC]),[RC,Xi]=Gg(Js),Qg=h.forwardRef((n,a)=>{const{name:l,min:o=0,max:c=100,step:u=1,orientation:f="horizontal",disabled:p=!1,minStepsBetweenThumbs:x=0,defaultValue:g=[o],value:v,onValueChange:y=()=>{},onValueCommit:P=()=>{},inverted:R=!1,form:C,...j}=n,b=h.useRef(new Set),S=h.useRef(0),w=f==="horizontal"?TC:_C,[M=[],D]=ls({prop:v,defaultProp:g,onChange:te=>{var he;(he=[...b.current][S.current])==null||he.focus(),y(te)}}),V=h.useRef(M);function k(te){const oe=LC(M,te);Q(te,oe)}function T(te){Q(te,S.current)}function U(){const te=V.current[S.current];M[S.current]!==te&&P(M)}function Q(te,oe,{commit:he}={commit:!1}){const ne=$C(u),le=BC(Math.round((te-o)/u)*u+o,ne),Z=Ei(le,[o,c]);D(($=[])=>{const _=MC($,Z,oe);if(zC(_,x*u)){S.current=_.indexOf(Z);const q=String(_)!==String($);return q&&he&&P(_),q?_:$}else return $})}return t.jsx(RC,{scope:n.__scopeSlider,name:l,disabled:p,min:o,max:c,valueIndexToChangeRef:S,thumbs:b.current,values:M,orientation:f,form:C,children:t.jsx(Td.Provider,{scope:n.__scopeSlider,children:t.jsx(Td.Slot,{scope:n.__scopeSlider,children:t.jsx(w,{"aria-disabled":p,"data-disabled":p?"":void 0,...j,ref:a,onPointerDown:Fe(j.onPointerDown,()=>{p||(V.current=M)}),min:o,max:c,inverted:R,onSlideStart:p?void 0:k,onSlideMove:p?void 0:T,onSlideEnd:p?void 0:U,onHomeKeyDown:()=>!p&&Q(o,0,{commit:!0}),onEndKeyDown:()=>!p&&Q(c,M.length-1,{commit:!0}),onStepKeyDown:({event:te,direction:oe})=>{if(!p){const le=Hg.includes(te.key)||te.shiftKey&&Kg.includes(te.key)?10:1,Z=S.current,$=M[Z],_=u*le*oe;Q($+_,Z,{commit:!0})}}})})})})});Qg.displayName=Js;var[qg,Xg]=Gg(Js,{startEdge:"left",endEdge:"right",size:"width",direction:1}),TC=h.forwardRef((n,a)=>{const{min:l,max:o,dir:c,inverted:u,onSlideStart:f,onSlideMove:p,onSlideEnd:x,onStepKeyDown:g,...v}=n,[y,P]=h.useState(null),R=Xe(a,w=>P(w)),C=h.useRef(void 0),j=Bi(c),b=j==="ltr",S=b&&!u||!b&&u;function E(w){const M=C.current||y.getBoundingClientRect(),D=[0,M.width],k=fu(D,S?[l,o]:[o,l]);return C.current=M,k(w-M.left)}return t.jsx(qg,{scope:n.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:t.jsx(Jg,{dir:j,"data-orientation":"horizontal",...v,ref:R,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const M=E(w.clientX);f==null||f(M)},onSlideMove:w=>{const M=E(w.clientX);p==null||p(M)},onSlideEnd:()=>{C.current=void 0,x==null||x()},onStepKeyDown:w=>{const D=Yg[S?"from-left":"from-right"].includes(w.key);g==null||g({event:w,direction:D?-1:1})}})})}),_C=h.forwardRef((n,a)=>{const{min:l,max:o,inverted:c,onSlideStart:u,onSlideMove:f,onSlideEnd:p,onStepKeyDown:x,...g}=n,v=h.useRef(null),y=Xe(a,v),P=h.useRef(void 0),R=!c;function C(j){const b=P.current||v.current.getBoundingClientRect(),S=[0,b.height],w=fu(S,R?[o,l]:[l,o]);return P.current=b,w(j-b.top)}return t.jsx(qg,{scope:n.__scopeSlider,startEdge:R?"bottom":"top",endEdge:R?"top":"bottom",size:"height",direction:R?1:-1,children:t.jsx(Jg,{"data-orientation":"vertical",...g,ref:y,style:{...g.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:j=>{const b=C(j.clientY);u==null||u(b)},onSlideMove:j=>{const b=C(j.clientY);f==null||f(b)},onSlideEnd:()=>{P.current=void 0,p==null||p()},onStepKeyDown:j=>{const S=Yg[R?"from-bottom":"from-top"].includes(j.key);x==null||x({event:j,direction:S?-1:1})}})})}),Jg=h.forwardRef((n,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:u,onHomeKeyDown:f,onEndKeyDown:p,onStepKeyDown:x,...g}=n,v=Xi(Js,l);return t.jsx(Ue.span,{...g,ref:a,onKeyDown:Fe(n.onKeyDown,y=>{y.key==="Home"?(f(y),y.preventDefault()):y.key==="End"?(p(y),y.preventDefault()):Hg.concat(Kg).includes(y.key)&&(x(y),y.preventDefault())}),onPointerDown:Fe(n.onPointerDown,y=>{const P=y.target;P.setPointerCapture(y.pointerId),y.preventDefault(),v.thumbs.has(P)?P.focus():o(y)}),onPointerMove:Fe(n.onPointerMove,y=>{y.target.hasPointerCapture(y.pointerId)&&c(y)}),onPointerUp:Fe(n.onPointerUp,y=>{const P=y.target;P.hasPointerCapture(y.pointerId)&&(P.releasePointerCapture(y.pointerId),u(y))})})}),Zg="SliderTrack",e0=h.forwardRef((n,a)=>{const{__scopeSlider:l,...o}=n,c=Xi(Zg,l);return t.jsx(Ue.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});e0.displayName=Zg;var _d="SliderRange",t0=h.forwardRef((n,a)=>{const{__scopeSlider:l,...o}=n,c=Xi(_d,l),u=Xg(_d,l),f=h.useRef(null),p=Xe(a,f),x=c.values.length,g=c.values.map(P=>s0(P,c.min,c.max)),v=x>1?Math.min(...g):0,y=100-Math.max(...g);return t.jsx(Ue.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:p,style:{...n.style,[u.startEdge]:v+"%",[u.endEdge]:y+"%"}})});t0.displayName=_d;var Id="SliderThumb",r0=h.forwardRef((n,a)=>{const l=EC(n.__scopeSlider),[o,c]=h.useState(null),u=Xe(a,p=>c(p)),f=h.useMemo(()=>o?l().findIndex(p=>p.ref.current===o):-1,[l,o]);return t.jsx(IC,{...n,ref:u,index:f})}),IC=h.forwardRef((n,a)=>{const{__scopeSlider:l,index:o,name:c,...u}=n,f=Xi(Id,l),p=Xg(Id,l),[x,g]=h.useState(null),v=Xe(a,E=>g(E)),y=x?f.form||!!x.closest("form"):!0,P=Zd(x),R=f.values[o],C=R===void 0?0:s0(R,f.min,f.max),j=DC(o,f.values.length),b=P==null?void 0:P[p.size],S=b?OC(b,C,p.direction):0;return h.useEffect(()=>{if(x)return f.thumbs.add(x),()=>{f.thumbs.delete(x)}},[x,f.thumbs]),t.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[p.startEdge]:`calc(${C}% + ${S}px)`},children:[t.jsx(Td.ItemSlot,{scope:n.__scopeSlider,children:t.jsx(Ue.span,{role:"slider","aria-label":n["aria-label"]||j,"aria-valuemin":f.min,"aria-valuenow":R,"aria-valuemax":f.max,"aria-orientation":f.orientation,"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,tabIndex:f.disabled?void 0:0,...u,ref:v,style:R===void 0?{display:"none"}:n.style,onFocus:Fe(n.onFocus,()=>{f.valueIndexToChangeRef.current=o})})}),y&&t.jsx(n0,{name:c??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:R},o)]})});r0.displayName=Id;var AC="RadioBubbleInput",n0=h.forwardRef(({__scopeSlider:n,value:a,...l},o)=>{const c=h.useRef(null),u=Xe(c,o),f=Jd(a);return h.useEffect(()=>{const p=c.current;if(!p)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(p,a),p.dispatchEvent(y)}},[f,a]),t.jsx(Ue.input,{style:{display:"none"},...l,ref:u,defaultValue:a})});n0.displayName=AC;function MC(n=[],a,l){const o=[...n];return o[l]=a,o.sort((c,u)=>c-u)}function s0(n,a,l){const u=100/(l-a)*(n-a);return Ei(u,[0,100])}function DC(n,a){return a>2?`Value ${n+1} of ${a}`:a===2?["Minimum","Maximum"][n]:void 0}function LC(n,a){if(n.length===1)return 0;const l=n.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function OC(n,a,l){const o=n/2,u=fu([0,50],[0,o]);return(o-u(a)*l)*l}function FC(n){return n.slice(0,-1).map((a,l)=>n[l+1]-a)}function zC(n,a){if(a>0){const l=FC(n);return Math.min(...l)>=a}return!0}function fu(n,a){return l=>{if(n[0]===n[1]||a[0]===a[1])return a[0];const o=(a[1]-a[0])/(n[1]-n[0]);return a[0]+o*(l-n[0])}}function $C(n){return(String(n).split(".")[1]||"").length}function BC(n,a){const l=Math.pow(10,a);return Math.round(n*l)/l}var UC=Qg,VC=e0,WC=t0,HC=r0;function KC({className:n,defaultValue:a,value:l,min:o=0,max:c=100,...u}){const f=h.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[o,c],[l,a,o,c]);return t.jsxs(UC,{defaultValue:a,value:l,min:o,max:c,className:Je("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",n),...u,children:[t.jsx(VC,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:t.jsx(WC,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:f.length},(p,x)=>t.jsx(HC,{className:"block size-4 shrink-0 rounded-full border-2 border-[#38bdac] bg-white shadow-sm focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},x))]})}const YC={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function GC(){const[n,a]=h.useState(YC),[l,o]=h.useState(!0),[c,u]=h.useState(!1);h.useEffect(()=>{Ge("/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,vipOrderShareVip:g.vipOrderShareVip??20,vipOrderShareNonVip:g.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>o(!1))},[]);const f=async()=>{u(!0);try{const x={distributorShare:Number(n.distributorShare)||0,minWithdrawAmount:Number(n.minWithdrawAmount)||0,bindingDays:Number(n.bindingDays)||0,userDiscount:Number(n.userDiscount)||0,enableAutoWithdraw:!!n.enableAutoWithdraw,vipOrderShareVip:Number(n.vipOrderShareVip)||20,vipOrderShareNonVip:Number(n.vipOrderShareNonVip)||10},g=await Ct("/api/admin/referral-settings",x);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{u(!1)}},p=x=>g=>{const v=parseFloat(g.target.value||"0");a(y=>({...y,[x]:isNaN(v)?0:v}))};return l?t.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(Us,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),t.jsxs(ee,{onClick:f,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"flex items-center gap-2 text-white",children:[t.jsx(EN,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),t.jsx(ft,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),t.jsx(Re,{className:"space-y-6",children:t.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(ni,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),t.jsx(ae,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:n.userDiscount,onChange:p("userDiscount")}),t.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(Cr,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(KC,{className:"flex-1",min:10,max:100,step:1,value:[n.distributorShare],onValueChange:([x])=>a(g=>({...g,distributorShare:x}))}),t.jsx(ae,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:n.distributorShare,onChange:p("distributorShare")})]}),t.jsxs("p",{className:"text-xs text-gray-500",children:["内容订单佣金 = 订单金额 ×"," ",t.jsxs("span",{className:"text-[#38bdac] font-mono",children:[n.distributorShare,"%"]}),";会员订单见下方。"]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(ni,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),t.jsx(ae,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:n.vipOrderShareVip,onChange:p("vipOrderShareVip")}),t.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(ni,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),t.jsx(ae,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:n.vipOrderShareNonVip,onChange:p("vipOrderShareNonVip")}),t.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(Cr,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),t.jsx(ae,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:n.bindingDays,onChange:p("bindingDays")}),t.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"flex items-center gap-2 text-white",children:[t.jsx(Us,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),t.jsx(ft,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),t.jsx(Re,{className:"space-y-6",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"最低提现金额(元)"}),t.jsx(ae,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:n.minWithdrawAmount,onChange:p("minWithdrawAmount")}),t.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",t.jsx($e,{variant:"outline",className:"border-[#38bdac]/40 text-[#38bdac] text-[10px]",children:"预留"})]}),t.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[t.jsx(gt,{checked:n.enableAutoWithdraw,onCheckedChange:x=>a(g=>({...g,enableAutoWithdraw:x}))}),t.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx(We,{children:t.jsxs(He,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[t.jsx(ni,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),t.jsxs(Re,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[t.jsxs("p",{children:["1. 以上配置会写入"," ",t.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),",小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),t.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),t.jsx("p",{children:"3. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}const Gr={name:"卡若",avatar:"K",avatarImg:"",title:"Soul派对房主理人 · 私域运营专家",bio:'每天早上6点到9点,在Soul派对房分享真实的创业故事。专注私域运营与项目变现,用"云阿米巴"模式帮助创业者构建可持续的商业体系。',stats:[{label:"商业案例",value:"62"},{label:"连续直播",value:"365天"},{label:"派对分享",value:"1000+"}],highlights:["5年私域运营经验","帮助100+品牌从0到1增长","连续创业者,擅长商业模式设计"]};function sp(n){return Array.isArray(n)?n.map(a=>a&&typeof a=="object"&&"label"in a&&"value"in a?{label:String(a.label),value:String(a.value)}:{label:"",value:""}).filter(a=>a.label||a.value):Gr.stats}function ap(n){return Array.isArray(n)?n.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):Gr.highlights}function QC(){const[n,a]=h.useState(Gr),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[f,p]=h.useState(!1),x=h.useRef(null);h.useEffect(()=>{Ge("/api/admin/author-settings").then(S=>{const E=S==null?void 0:S.data;E&&typeof E=="object"&&a({name:String(E.name??Gr.name),avatar:String(E.avatar??Gr.avatar),avatarImg:String(E.avatarImg??""),title:String(E.title??Gr.title),bio:String(E.bio??Gr.bio),stats:sp(E.stats).length?sp(E.stats):Gr.stats,highlights:ap(E.highlights).length?ap(E.highlights):Gr.highlights})}).catch(console.error).finally(()=>o(!1))},[]);const g=async()=>{u(!0);try{const S={name:n.name,avatar:n.avatar||"K",avatarImg:n.avatarImg,title:n.title,bio:n.bio,stats:n.stats.filter(M=>M.label||M.value),highlights:n.highlights.filter(Boolean)},E=await Ct("/api/admin/author-settings",S);if(!E||E.success===!1){alert("保存失败: "+(E&&typeof E=="object"&&"error"in E?E.error:""));return}u(!1);const w=document.createElement("div");w.className="fixed top-4 right-4 z-50 px-4 py-2 rounded-lg bg-[#38bdac] text-white text-sm shadow-lg",w.textContent="作者设置已保存",document.body.appendChild(w),setTimeout(()=>w.remove(),2e3)}catch(S){console.error(S),alert("保存失败: "+(S instanceof Error?S.message:String(S)))}finally{u(!1)}},v=async S=>{var w;const E=(w=S.target.files)==null?void 0:w[0];if(E){p(!0);try{const M=new FormData;M.append("file",E),M.append("folder","avatars");const D=Bd(),V={};D&&(V.Authorization=`Bearer ${D}`);const T=await(await fetch(Vs("/api/upload"),{method:"POST",body:M,credentials:"include",headers:V})).json();T!=null&&T.success&&(T!=null&&T.url)?a(U=>({...U,avatarImg:T.url})):alert("上传失败: "+((T==null?void 0:T.error)||"未知错误"))}catch(M){console.error(M),alert("上传失败")}finally{p(!1),x.current&&(x.current.value="")}}},y=()=>a(S=>({...S,stats:[...S.stats,{label:"",value:""}]})),P=S=>a(E=>({...E,stats:E.stats.filter((w,M)=>M!==S)})),R=(S,E,w)=>a(M=>({...M,stats:M.stats.map((D,V)=>V===S?{...D,[E]:w}:D)})),C=()=>a(S=>({...S,highlights:[...S.highlights,""]})),j=S=>a(E=>({...E,highlights:E.highlights.filter((w,M)=>M!==S)})),b=(S,E)=>a(w=>({...w,highlights:w.highlights.map((M,D)=>D===S?E:M)}));return l?t.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(ns,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),t.jsxs(ee,{onClick:g,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"flex items-center gap-2 text-white",children:[t.jsx(ns,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),t.jsx(ft,{className:"text-gray-400",children:"作者姓名、头像、头衔与个人简介,将展示在「关于作者」页顶部。"})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"姓名"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:n.name,onChange:S=>a(E=>({...E,name:S.target.value})),placeholder:"卡若"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:n.avatar,onChange:S=>a(E=>({...E,avatar:S.target.value.slice(0,1)||"K"})),placeholder:"K"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(Cp,{className:"w-3 h-3 text-[#38bdac]"}),"头像图片"]}),t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsx(ae,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:n.avatarImg,onChange:S=>a(E=>({...E,avatarImg:S.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),t.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:v}),t.jsxs(ee,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:f,onClick:()=>{var S;return(S=x.current)==null?void 0:S.click()},children:[t.jsx(wi,{className:"w-4 h-4 mr-2"}),f?"上传中...":"上传"]})]}),n.avatarImg&&t.jsx("div",{className:"mt-2",children:t.jsx("img",{src:n.avatarImg.startsWith("http")?n.avatarImg:Vs(n.avatarImg),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"头衔"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:n.title,onChange:S=>a(E=>({...E,title:S.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"个人简介"}),t.jsx(as,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:n.bio,onChange:S=>a(E=>({...E,bio:S.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsx(He,{className:"text-white",children:"统计数据"}),t.jsx(ft,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),t.jsxs(Re,{className:"space-y-3",children:[n.stats.map((S,E)=>t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsx(ae,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:S.label,onChange:w=>R(E,"label",w.target.value),placeholder:"标签"}),t.jsx(ae,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:S.value,onChange:w=>R(E,"value",w.target.value),placeholder:"数值"}),t.jsx(ee,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>P(E),children:t.jsx(pr,{className:"w-4 h-4"})})]},E)),t.jsxs(ee,{variant:"outline",size:"sm",onClick:y,className:"border-gray-600 text-gray-400",children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsx(He,{className:"text-white",children:"亮点标签"}),t.jsx(ft,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),t.jsxs(Re,{className:"space-y-3",children:[n.highlights.map((S,E)=>t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsx(ae,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:S,onChange:w=>b(E,w.target.value),placeholder:"5年私域运营经验"}),t.jsx(ee,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>j(E),children:t.jsx(pr,{className:"w-4 h-4"})})]},E)),t.jsxs(ee,{variant:"outline",size:"sm",onClick:C,className:"border-gray-600 text-gray-400",children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"添加亮点"]})]})]})]})]})}const qC={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},XC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},JC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...XC}},ZC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0};function e4(){const[n,a]=h.useState(JC),[l,o]=h.useState(ZC),[c,u]=h.useState(qC),[f,p]=h.useState(!1),[x,g]=h.useState(!0),[v,y]=h.useState(!1),[P,R]=h.useState(""),[C,j]=h.useState(""),[b,S]=h.useState(!1),[E,w]=h.useState(!1),M=(T,U,Q=!1)=>{R(T),j(U),S(Q),y(!0)};h.useEffect(()=>{(async()=>{try{const U=await Ge("/api/admin/settings");if(!U||U.success===!1)return;if(U.featureConfig&&Object.keys(U.featureConfig).length&&o(Q=>({...Q,...U.featureConfig})),U.mpConfig&&typeof U.mpConfig=="object"&&u(Q=>({...Q,...U.mpConfig})),U.siteSettings&&typeof U.siteSettings=="object"){const Q=U.siteSettings;a(te=>({...te,...typeof Q.sectionPrice=="number"&&{sectionPrice:Q.sectionPrice},...typeof Q.baseBookPrice=="number"&&{baseBookPrice:Q.baseBookPrice},...typeof Q.distributorShare=="number"&&{distributorShare:Q.distributorShare},...Q.authorInfo&&typeof Q.authorInfo=="object"&&{authorInfo:{...te.authorInfo,...Q.authorInfo}}}))}}catch(U){console.error("Load settings error:",U)}finally{g(!1)}})()},[]);const D=async(T,U)=>{w(!0);try{const Q=await Ct("/api/admin/settings",{featureConfig:T});if(!Q||Q.success===!1){U(),M("保存失败",(Q==null?void 0:Q.error)??"未知错误",!0);return}M("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(Q){console.error("Save feature config error:",Q),U(),M("保存失败",Q instanceof Error?Q.message:String(Q),!0)}finally{w(!1)}},V=(T,U)=>{const Q=l,te={...Q,[T]:U};o(te),D(te,()=>o(Q))},k=async()=>{p(!0);try{const T=await Ct("/api/admin/settings",{featureConfig:l,siteSettings:{sectionPrice:n.sectionPrice,baseBookPrice:n.baseBookPrice,distributorShare:n.distributorShare,authorInfo:n.authorInfo},mpConfig:{...c,appId:c.appId||"",withdrawSubscribeTmplId:c.withdrawSubscribeTmplId||"",mchId:c.mchId||"",minWithdraw:typeof c.minWithdraw=="number"?c.minWithdraw:10}});if(!T||T.success===!1){M("保存失败",(T==null?void 0:T.error)??"未知错误",!0);return}M("已保存","设置已保存成功。")}catch(T){console.error("Save settings error:",T),M("保存失败",T instanceof Error?T.message:String(T),!0)}finally{p(!1)}};return x?t.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),t.jsxs(ee,{onClick:k,disabled:f,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),f?"保存中...":"保存设置"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(jm,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),t.jsx(ft,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(jm,{className:"w-3 h-3"}),"主理人名称"]}),t.jsx(ae,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:n.authorInfo.name??"",onChange:T=>a(U=>({...U,authorInfo:{...U.authorInfo,name:T.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[t.jsx($a,{className:"w-3 h-3"}),"开播日期"]}),t.jsx(ae,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:n.authorInfo.startDate??"",onChange:T=>a(U=>({...U,authorInfo:{...U.authorInfo,startDate:T.target.value}}))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[t.jsx($a,{className:"w-3 h-3"}),"直播时间"]}),t.jsx(ae,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:n.authorInfo.liveTime??"",onChange:T=>a(U=>({...U,authorInfo:{...U.authorInfo,liveTime:T.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(vN,{className:"w-3 h-3"}),"直播平台"]}),t.jsx(ae,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:n.authorInfo.platform??"",onChange:T=>a(U=>({...U,authorInfo:{...U.authorInfo,platform:T.target.value}}))})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(Qr,{className:"w-3 h-3"}),"简介描述"]}),t.jsx(ae,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:n.authorInfo.description??"",onChange:T=>a(U=>({...U,authorInfo:{...U.authorInfo,description:T.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),t.jsx(as,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:n.authorInfo.bio??"",onChange:T=>a(U=>({...U,authorInfo:{...U.authorInfo,bio:T.target.value}}))})]}),t.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.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:(n.authorInfo.name??"K").charAt(0)}),t.jsxs("div",{children:[t.jsx("p",{className:"text-white font-semibold",children:n.authorInfo.name}),t.jsx("p",{className:"text-gray-400 text-xs",children:n.authorInfo.description}),t.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",n.authorInfo.liveTime," · ",n.authorInfo.platform]})]})]})]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(ji,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),t.jsx(ft,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),t.jsx(Re,{className:"space-y-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"单节价格 (元)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:n.sectionPrice,onChange:T=>a(U=>({...U,sectionPrice:Number.parseFloat(T.target.value)||1}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"整本价格 (元)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:n.baseBookPrice,onChange:T=>a(U=>({...U,baseBookPrice:Number.parseFloat(T.target.value)||9.9}))})]})]})})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(xd,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),t.jsx(ft,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),t.jsx(Re,{className:"space-y-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"小程序 AppID"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:c.appId??"",onChange:T=>u(U=>({...U,appId:T.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"提现订阅模板 ID"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:c.withdrawSubscribeTmplId??"",onChange:T=>u(U=>({...U,withdrawSubscribeTmplId:T.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"微信支付商户号"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:c.mchId??"",onChange:T=>u(U=>({...U,mchId:T.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"最低提现金额 (元)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.minWithdraw??10,onChange:T=>u(U=>({...U,minWithdraw:Number.parseFloat(T.target.value)||10}))})]})]})})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(bi,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),t.jsx(ft,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Cr,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(X,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),t.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),t.jsx(gt,{id:"match-enabled",checked:l.matchEnabled,disabled:E,onCheckedChange:T=>V("matchEnabled",T)})]}),t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(qj,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(X,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),t.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),t.jsx(gt,{id:"referral-enabled",checked:l.referralEnabled,disabled:E,onCheckedChange:T=>V("referralEnabled",T)})]}),t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Qr,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(X,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),t.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),t.jsx(gt,{id:"search-enabled",checked:l.searchEnabled,disabled:E,onCheckedChange:T=>V("searchEnabled",T)})]}),t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(bi,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(X,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),t.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),t.jsx(gt,{id:"about-enabled",checked:l.aboutEnabled,disabled:E,onCheckedChange:T=>V("aboutEnabled",T)})]})]}),t.jsx("div",{className:"p-3 rounded-lg bg-blue-500/10 border border-blue-500/30",children:t.jsx("p",{className:"text-xs text-blue-300",children:"💡 关闭功能后,相关入口会自动隐藏。建议在功能开发完成后再开启。"})})]})]})]}),t.jsx($t,{open:v,onOpenChange:y,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[t.jsxs(Bt,{children:[t.jsx(Ut,{className:b?"text-red-400":"text-[#38bdac]",children:P}),t.jsx(U1,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:C})]}),t.jsx(Kt,{className:"mt-4",children:t.jsx(ee,{onClick:()=>y(!1),className:b?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const lp={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 t4(){const[n,a]=h.useState(!1),[l,o]=h.useState(lp),[c,u]=h.useState(""),f=async()=>{a(!0);try{const S=await Ge("/api/config");S!=null&&S.paymentMethods&&o({...lp,...S.paymentMethods})}catch(S){console.error(S)}finally{a(!1)}};h.useEffect(()=>{f()},[]);const p=async()=>{a(!0);try{await Ct("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(S){console.error("保存失败:",S),alert("保存失败: "+(S instanceof Error?S.message:String(S)))}finally{a(!1)}},x=(S,E)=>{navigator.clipboard.writeText(S),u(E),setTimeout(()=>u(""),2e3)},g=(S,E)=>{o(w=>({...w,wechat:{...w.wechat,[S]:E}}))},v=(S,E)=>{o(w=>({...w,alipay:{...w.alipay,[S]:E}}))},y=(S,E)=>{o(w=>({...w,usdt:{...w.usdt,[S]:E}}))},P=(S,E)=>{o(w=>({...w,paypal:{...w.paypal,[S]:E}}))},R=l.wechat,C=l.alipay,j=l.usdt,b=l.paypal;return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),t.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(ee,{variant:"outline",onClick:f,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${n?"animate-spin":""}`}),"同步配置"]}),t.jsxs(ee,{onClick:p,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),"保存配置"]})]})]}),t.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(bp,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm",children:[t.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"如何获取微信群跳转链接?"}),t.jsxs("ol",{className:"text-[#07C160]/80 space-y-1 list-decimal list-inside",children:[t.jsx("li",{children:"打开微信,进入目标微信群"}),t.jsx("li",{children:'点击右上角"..." → "群二维码"'}),t.jsx("li",{children:'点击右上角"..." → "发送到电脑"'}),t.jsx("li",{children:"在电脑上保存二维码图片,上传到图床获取URL"}),t.jsx("li",{children:"或使用草料二维码等工具解析二维码获取链接"})]}),t.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"提示:微信群二维码7天后失效,建议使用活码工具"})]})]})}),t.jsxs(ru,{defaultValue:"wechat",className:"space-y-6",children:[t.jsxs(Vi,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[t.jsxs(hr,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[t.jsx(xd,{className:"w-4 h-4 mr-2"}),"微信"]}),t.jsxs(hr,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[t.jsx(hd,{className:"w-4 h-4 mr-2"}),"支付宝"]}),t.jsxs(hr,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[t.jsx(vm,{className:"w-4 h-4 mr-2"}),"USDT"]}),t.jsxs(hr,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[t.jsx(md,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),t.jsx(mr,{value:"wechat",className:"space-y-4",children:t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(He,{className:"text-[#07C160] flex items-center gap-2",children:[t.jsx(xd,{className:"w-5 h-5"}),"微信支付配置"]}),t.jsx(ft,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),t.jsx(gt,{checked:!!R.enabled,onCheckedChange:S=>g("enabled",S)})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"网站AppID"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(R.websiteAppId??""),onChange:S=>g("websiteAppId",S.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"商户号"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(R.merchantId??""),onChange:S=>g("merchantId",S.target.value)})]})]}),t.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[t.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[t.jsx(Ni,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"微信收款码/支付链接"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(R.qrCode??""),onChange:S=>g("qrCode",S.target.value)}),t.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),t.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[t.jsx(X,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),t.jsx(ae,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(R.groupQrCode??""),onChange:S=>g("groupQrCode",S.target.value)}),t.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),t.jsx(mr,{value:"alipay",className:"space-y-4",children:t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(He,{className:"text-[#1677FF] flex items-center gap-2",children:[t.jsx(hd,{className:"w-5 h-5"}),"支付宝配置"]}),t.jsx(ft,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),t.jsx(gt,{checked:!!C.enabled,onCheckedChange:S=>v("enabled",S)})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"合作者身份 (PID)"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(C.partnerId??""),onChange:S=>v("partnerId",S.target.value)}),t.jsx(ee,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>x(String(C.partnerId??""),"pid"),children:c==="pid"?t.jsx(Di,{className:"w-4 h-4 text-green-500"}):t.jsx(Sp,{className:"w-4 h-4 text-gray-400"})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"安全校验码 (Key)"}),t.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(C.securityKey??""),onChange:S=>v("securityKey",S.target.value)})]})]}),t.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[t.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[t.jsx(Ni,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(C.qrCode??""),onChange:S=>v("qrCode",S.target.value)}),t.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),t.jsx(mr,{value:"usdt",className:"space-y-4",children:t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(He,{className:"text-[#26A17B] flex items-center gap-2",children:[t.jsx(vm,{className:"w-5 h-5"}),"USDT配置"]}),t.jsx(ft,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),t.jsx(gt,{checked:!!j.enabled,onCheckedChange:S=>y("enabled",S)})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"网络类型"}),t.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(j.network??"TRC20"),onChange:S=>y("network",S.target.value),children:[t.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),t.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),t.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"收款地址"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(j.address??""),onChange:S=>y("address",S.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(j.exchangeRate)??7.2,onChange:S=>y("exchangeRate",Number.parseFloat(S.target.value)||7.2)})]})]})]})}),t.jsx(mr,{value:"paypal",className:"space-y-4",children:t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(He,{className:"text-[#169BD7] flex items-center gap-2",children:[t.jsx(md,{className:"w-5 h-5"}),"PayPal配置"]}),t.jsx(ft,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),t.jsx(gt,{checked:!!b.enabled,onCheckedChange:S=>P("enabled",S)})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"PayPal邮箱"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(b.email??""),onChange:S=>P("email",S.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:S=>P("exchangeRate",Number(S.target.value)||7.2)})]})]})]})})]})]})}const r4={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},n4={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},s4={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function a4(){const[n,a]=h.useState({siteConfig:{...r4},menuConfig:{...n4},pageConfig:{...s4}}),[l,o]=h.useState(!1),[c,u]=h.useState(!1);h.useEffect(()=>{Ge("/api/config").then(v=>{v!=null&&v.siteConfig&&a(y=>({...y,siteConfig:{...y.siteConfig,...v.siteConfig}})),v!=null&&v.menuConfig&&a(y=>({...y,menuConfig:{...y.menuConfig,...v.menuConfig}})),v!=null&&v.pageConfig&&a(y=>({...y,pageConfig:{...y.pageConfig,...v.pageConfig}}))}).catch(console.error)},[]);const f=async()=>{u(!0);try{await Ct("/api/db/config",{key:"site_config",value:n.siteConfig,description:"网站基础配置"}),await Ct("/api/db/config",{key:"menu_config",value:n.menuConfig,description:"底部菜单配置"}),await Ct("/api/db/config",{key:"page_config",value:n.pageConfig,description:"页面标题配置"}),o(!0),setTimeout(()=>o(!1),2e3),alert("配置已保存")}catch(v){console.error(v),alert("保存失败: "+(v instanceof Error?v.message:String(v)))}finally{u(!1)}},p=n.siteConfig,x=n.menuConfig,g=n.pageConfig;return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"网站配置"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"配置网站名称、图标、菜单和页面标题"})]}),t.jsxs(ee,{onClick:f,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(md,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),t.jsx(ft,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),t.jsx(ae,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:p.siteName??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,siteName:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),t.jsx(ae,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:p.siteTitle??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,siteTitle:v.target.value}}))})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),t.jsx(ae,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:p.siteDescription??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,siteDescription:v.target.value}}))})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),t.jsx(ae,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:p.logo??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,logo:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),t.jsx(ae,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:p.favicon??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,favicon:v.target.value}}))})]})]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(SN,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),t.jsx(ft,{className:"text-gray-400",children:"配置网站主题色"})]}),t.jsx(Re,{children:t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:"space-y-2 flex-1",children:[t.jsx(X,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ae,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:p.primaryColor??"#00CED1",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,primaryColor:v.target.value}}))}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:p.primaryColor??"#00CED1",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,primaryColor:v.target.value}}))})]})]}),t.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:p.primaryColor??"#00CED1"},children:"预览"})]})})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(jN,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),t.jsx(ft,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),t.jsx(Re,{className:"space-y-4",children:Object.entries(x).map(([v,y])=>t.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[t.jsx(gt,{checked:(y==null?void 0:y.enabled)??!0,onCheckedChange:P=>a(R=>({...R,menuConfig:{...R.menuConfig,[v]:{...y,enabled:P}}}))}),t.jsx("span",{className:"text-gray-300 w-16 capitalize",children:v}),t.jsx(ae,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(y==null?void 0:y.label)??"",onChange:P=>a(R=>({...R,menuConfig:{...R.menuConfig,[v]:{...y,label:P.target.value}}}))})]}),t.jsx("span",{className:`text-sm ${y!=null&&y.enabled?"text-green-400":"text-gray-500"}`,children:y!=null&&y.enabled?"显示":"隐藏"})]},v))})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(Kj,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),t.jsx(ft,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"首页标题"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.homeTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,homeTitle:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"首页副标题"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.homeSubtitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,homeSubtitle:v.target.value}}))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"目录页标题"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.chaptersTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,chaptersTitle:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"匹配页标题"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.matchTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,matchTitle:v.target.value}}))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"我的页标题"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.myTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,myTitle:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"关于作者标题"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.aboutTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,aboutTitle:v.target.value}}))})]})]})]})]})]})]})}function l4(){const[n,a]=h.useState(""),[l,o]=h.useState(""),[c,u]=h.useState(""),[f,p]=h.useState({}),x=async()=>{var R,C,j,b;try{const S=await Ge("/api/config"),E=(C=(R=S==null?void 0:S.liveQRCodes)==null?void 0:R[0])==null?void 0:C.urls;Array.isArray(E)&&a(E.join(`
|
||
`));const w=(b=(j=S==null?void 0:S.paymentMethods)==null?void 0:j.wechat)==null?void 0:b.groupQrCode;w&&o(w),p({paymentMethods:S==null?void 0:S.paymentMethods,liveQRCodes:S==null?void 0:S.liveQRCodes})}catch(S){console.error(S)}};h.useEffect(()=>{x()},[]);const g=(R,C)=>{navigator.clipboard.writeText(R),u(C),setTimeout(()=>u(""),2e3)},v=async()=>{try{const R=n.split(`
|
||
`).map(j=>j.trim()).filter(Boolean),C=[...f.liveQRCodes||[]];C[0]?C[0].urls=R:C.push({id:"live-1",name:"微信群活码",urls:R,clickCount:0}),await Ct("/api/db/config",{key:"live_qr_codes",value:C,description:"群活码配置"}),alert("群活码配置已保存!"),await x()}catch(R){console.error(R),alert("保存失败: "+(R instanceof Error?R.message:String(R)))}},y=async()=>{var R;try{await Ct("/api/db/config",{key:"payment_methods",value:{...f.paymentMethods||{},wechat:{...((R=f.paymentMethods)==null?void 0:R.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await x()}catch(C){console.error(C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}},P=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"mb-8",children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),t.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(bp,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm",children:[t.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),t.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[t.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),t.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[t.jsx("li",{children:"访问草料二维码创建活码"}),t.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),t.jsx("li",{children:"复制生成的短链接填入下方配置"}),t.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),t.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),t.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[t.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),t.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),t.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意:微信原生群二维码7天后失效,建议使用草料活码"})]})]})]})}),t.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-[#07C160] flex items-center gap-2",children:[t.jsx(Sm,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),t.jsx(ft,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(wm,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ae,{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:R=>o(R.target.value)}),t.jsx(ee,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>g(l,"group"),children:c==="group"?t.jsx(Di,{className:"w-4 h-4 text-green-500"}):t.jsx(Sp,{className:"w-4 h-4 text-gray-400"})})]}),t.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[t.jsx(Ni,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(ee,{onClick:y,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[t.jsx(wi,{className:"w-4 h-4 mr-2"}),"保存配置"]}),t.jsxs(ee,{onClick:P,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[t.jsx(Ni,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(Sm,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),t.jsx(ft,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(wm,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),t.jsx(as,{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:n,onChange:R=>a(R.target.value)}),t.jsx("p",{className:"text-xs text-gray-500",children:"每行填写一个群链接,系统将按顺序或随机分配"})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[t.jsx("span",{className:"text-sm text-gray-400",children:"已配置群数量"}),t.jsxs("span",{className:"font-bold text-[#38bdac]",children:[n.split(`
|
||
`).filter(Boolean).length," 个"]})]}),t.jsxs(ee,{onClick:v,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(wi,{className:"w-4 h-4 mr-2"}),"保存多群配置"]})]})]})]}),t.jsxs("div",{className:"mt-6 bg-[#0f2137] rounded-xl p-4 border border-gray-700/50",children:[t.jsx("h4",{className:"text-white font-medium mb-3",children:"常见问题"}),t.jsxs("div",{className:"space-y-3 text-sm",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-[#38bdac]",children:"Q: 为什么推荐使用草料活码?"}),t.jsx("p",{className:"text-gray-400",children:"A: 草料活码是永久链接,群满后可直接在后台更换新群码,无需修改网站配置。微信原生群码7天失效。"})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[#38bdac]",children:"Q: 支付后没有跳转怎么办?"}),t.jsx("p",{className:"text-gray-400",children:"A: 1) 检查链接是否正确填写 2) 部分浏览器可能拦截弹窗,用户需手动允许 3) 建议使用https开头的链接"})]})]})]})]})}const ip={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}},i4=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function o4(){const[n,a]=h.useState(ip),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[f,p]=h.useState(!1),[x,g]=h.useState(null),[v,y]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),P=async()=>{o(!0);try{const w=await Ge("/api/db/config/full?key=match_config"),M=(w==null?void 0:w.data)??(w==null?void 0:w.config);M&&a({...ip,...M})}catch(w){console.error("加载匹配配置失败:",w)}finally{o(!1)}};h.useEffect(()=>{P()},[]);const R=async()=>{u(!0);try{const w=await Ct("/api/db/config",{key:"match_config",value:n,description:"匹配功能配置"});w&&w.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(w&&typeof w=="object"&&"error"in w?w.error:"未知错误"))}catch(w){console.error("保存配置失败:",w),alert("保存失败")}finally{u(!1)}},C=w=>{g(w),y({id:w.id,label:w.label,matchLabel:w.matchLabel,icon:w.icon,matchFromDB:w.matchFromDB,showJoinAfterMatch:w.showJoinAfterMatch,price:w.price,enabled:w.enabled}),p(!0)},j=()=>{g(null),y({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),p(!0)},b=()=>{if(!v.id||!v.label){alert("请填写类型ID和名称");return}const w=[...n.matchTypes];if(x){const M=w.findIndex(D=>D.id===x.id);M!==-1&&(w[M]={...v})}else{if(w.some(M=>M.id===v.id)){alert("类型ID已存在");return}w.push({...v})}a({...n,matchTypes:w}),p(!1)},S=w=>{confirm("确定要删除这个匹配类型吗?")&&a({...n,matchTypes:n.matchTypes.filter(M=>M.id!==w)})},E=w=>{a({...n,matchTypes:n.matchTypes.map(M=>M.id===w?{...M,enabled:!M.enabled}:M)})};return t.jsxs("div",{className:"p-8 w-full space-y-6",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(bi,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(ee,{variant:"outline",onClick:P,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),t.jsxs(ee,{onClick:R,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(ZN,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),t.jsx(ft,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),t.jsxs(Re,{className:"space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"每日免费匹配次数"}),t.jsx(ae,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:n.freeMatchLimit,onChange:w=>a({...n,freeMatchLimit:parseInt(w.target.value,10)||0})}),t.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"付费匹配价格(元)"}),t.jsx(ae,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:n.matchPrice,onChange:w=>a({...n,matchPrice:parseFloat(w.target.value)||1})}),t.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"每日最大匹配次数"}),t.jsx(ae,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:n.settings.maxMatchesPerDay,onChange:w=>a({...n,settings:{...n.settings,maxMatchesPerDay:parseInt(w.target.value,10)||10}})}),t.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),t.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(gt,{checked:n.settings.enableFreeMatches,onCheckedChange:w=>a({...n,settings:{...n.settings,enableFreeMatches:w}})}),t.jsx(X,{className:"text-gray-300",children:"启用免费匹配"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(gt,{checked:n.settings.enablePaidMatches,onCheckedChange:w=>a({...n,settings:{...n.settings,enablePaidMatches:w}})}),t.jsx(X,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsxs(We,{className:"flex flex-row items-center justify-between",children:[t.jsxs("div",{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(Cr,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),t.jsx(ft,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),t.jsxs(ee,{onClick:j,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(zt,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),t.jsx(Re,{children:t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"图标"}),t.jsx(Te,{className:"text-gray-400",children:"类型ID"}),t.jsx(Te,{className:"text-gray-400",children:"显示名称"}),t.jsx(Te,{className:"text-gray-400",children:"匹配标签"}),t.jsx(Te,{className:"text-gray-400",children:"价格"}),t.jsx(Te,{className:"text-gray-400",children:"数据库匹配"}),t.jsx(Te,{className:"text-gray-400",children:"状态"}),t.jsx(Te,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsx(tn,{children:n.matchTypes.map(w=>t.jsxs(ot,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsx(Ce,{children:t.jsx("span",{className:"text-2xl",children:w.icon})}),t.jsx(Ce,{className:"font-mono text-gray-300",children:w.id}),t.jsx(Ce,{className:"text-white font-medium",children:w.label}),t.jsx(Ce,{className:"text-gray-300",children:w.matchLabel}),t.jsx(Ce,{children:t.jsxs($e,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",w.price]})}),t.jsx(Ce,{children:w.matchFromDB?t.jsx($e,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):t.jsx($e,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),t.jsx(Ce,{children:t.jsx(gt,{checked:w.enabled,onCheckedChange:()=>E(w.id)})}),t.jsx(Ce,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>C(w),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:t.jsx(Ft,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>S(w.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:t.jsx(sr,{className:"w-4 h-4"})})]})})]},w.id))})]})})]}),t.jsx($t,{open:f,onOpenChange:p,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[x?t.jsx(Ft,{className:"w-5 h-5 text-[#38bdac]"}):t.jsx(zt,{className:"w-5 h-5 text-[#38bdac]"}),x?"编辑匹配类型":"添加匹配类型"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"类型ID(英文)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:v.id,onChange:w=>y({...v,id:w.target.value}),disabled:!!x})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"图标"}),t.jsx("div",{className:"flex gap-1 flex-wrap",children:i4.map(w=>t.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${v.icon===w?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>y({...v,icon:w}),children:w},w))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"显示名称"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:v.label,onChange:w=>y({...v,label:w.target.value})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"匹配标签"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:v.matchLabel,onChange:w=>y({...v,matchLabel:w.target.value})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"单次匹配价格(元)"}),t.jsx(ae,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:v.price,onChange:w=>y({...v,price:parseFloat(w.target.value)||1})})]}),t.jsxs("div",{className:"flex gap-6 pt-2",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(gt,{checked:v.matchFromDB,onCheckedChange:w=>y({...v,matchFromDB:w})}),t.jsx(X,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(gt,{checked:v.showJoinAfterMatch,onCheckedChange:w=>y({...v,showJoinAfterMatch:w})}),t.jsx(X,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(gt,{checked:v.enabled,onCheckedChange:w=>y({...v,enabled:w})}),t.jsx(X,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",onClick:()=>p(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsxs(ee,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const op={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function c4(){const[n,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[f,p]=h.useState(10),[x,g]=h.useState(""),[v,y]=h.useState(!0),[P,R]=h.useState(null);async function C(){y(!0),R(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(f)});x&&b.set("matchType",x);const S=await Ge(`/api/db/match-records?${b}`);S!=null&&S.success?(a(S.records||[]),o(S.total??0)):R("加载匹配记录失败")}catch(b){console.error("加载匹配记录失败",b),R("加载失败,请检查网络后重试")}finally{y(!1)}}h.useEffect(()=>{C()},[c,x]);const j=Math.ceil(l/f)||1;return t.jsxs("div",{className:"p-8 w-full",children:[P&&t.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[t.jsx("span",{children:P}),t.jsx("button",{type:"button",onClick:()=>R(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"匹配记录"}),t.jsxs("p",{className:"text-gray-400 mt-1",children:["找伙伴匹配统计,共 ",l," 条记录"]})]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("select",{value:x,onChange:b=>{g(b.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[t.jsx("option",{value:"",children:"全部类型"}),Object.entries(op).map(([b,S])=>t.jsx("option",{value:b,children:S},b))]}),t.jsxs("button",{type:"button",onClick:C,disabled:v,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[t.jsx(tt,{className:`w-4 h-4 ${v?"animate-spin":""}`}),"刷新"]})]})]}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(Re,{className:"p-0",children:v?t.jsxs("div",{className:"flex justify-center py-12",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsxs(t.Fragment,{children:[t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"发起人"}),t.jsx(Te,{className:"text-gray-400",children:"匹配到"}),t.jsx(Te,{className:"text-gray-400",children:"类型"}),t.jsx(Te,{className:"text-gray-400",children:"联系方式"}),t.jsx(Te,{className:"text-gray-400",children:"匹配时间"})]})}),t.jsxs(tn,{children:[n.map(b=>t.jsxs(ot,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsx(Ce,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("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 overflow-hidden",children:[b.userAvatar?t.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:S=>{S.currentTarget.style.display="none";const E=S.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,t.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),t.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),t.jsx(Ce,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("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 overflow-hidden",children:[b.matchedUserAvatar?t.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:S=>{S.currentTarget.style.display="none";const E=S.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,t.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),t.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),t.jsx(Ce,{children:t.jsx($e,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:op[b.matchType]||b.matchType})}),t.jsxs(Ce,{className:"text-gray-400 text-sm",children:[b.phone&&t.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&t.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),t.jsx(Ce,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),n.length===0&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),t.jsx(In,{page:c,totalPages:j,total:l,pageSize:f,onPageChange:u,onPageSizeChange:b=>{p(b),u(1)}})]})})})]})}function d4(){const[n,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[f,p]=h.useState(null),[x,g]=h.useState(""),[v,y]=h.useState(0),[P,R]=h.useState(!1);async function C(){o(!0);try{const w=await Ge("/api/db/vip-roles");w!=null&&w.success&&w.data&&a(w.data)}catch(w){console.error("Load roles error:",w)}finally{o(!1)}}h.useEffect(()=>{C()},[]);const j=()=>{p(null),g(""),y(n.length>0?Math.max(...n.map(w=>w.sort))+1:0),u(!0)},b=w=>{p(w),g(w.name),y(w.sort),u(!0)},S=async()=>{if(!x.trim()){alert("角色名称不能为空");return}R(!0);try{if(f){const w=await St("/api/db/vip-roles",{id:f.id,name:x.trim(),sort:v});w!=null&&w.success?(u(!1),C()):alert("更新失败: "+(w==null?void 0:w.error))}else{const w=await Ct("/api/db/vip-roles",{name:x.trim(),sort:v});w!=null&&w.success?(u(!1),C()):alert("新增失败: "+(w==null?void 0:w.error))}}catch(w){console.error("Save error:",w),alert("保存失败")}finally{R(!1)}},E=async w=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const M=await ss(`/api/db/vip-roles?id=${w}`);M!=null&&M.success?C():alert("删除失败: "+(M==null?void 0:M.error))}catch(M){console.error("Delete error:",M),alert("删除失败")}};return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(Li,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),t.jsxs(ee,{onClick:j,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{className:"p-0",children:l?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{className:"bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"ID"}),t.jsx(Te,{className:"text-gray-400",children:"角色名称"}),t.jsx(Te,{className:"text-gray-400",children:"排序"}),t.jsx(Te,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsxs(tn,{children:[n.map(w=>t.jsxs(ot,{className:"border-gray-700/50",children:[t.jsx(Ce,{className:"text-gray-300",children:w.id}),t.jsx(Ce,{className:"text-white",children:w.name}),t.jsx(Ce,{className:"text-gray-400",children:w.sort}),t.jsxs(Ce,{className:"text-right",children:[t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>b(w),className:"text-gray-400 hover:text-[#38bdac]",children:t.jsx(Ft,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>E(w.id),className:"text-gray-400 hover:text-red-400",children:t.jsx(sr,{className:"w-4 h-4"})})]})]},w.id)),n.length===0&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),t.jsx($t,{open:c,onOpenChange:u,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[t.jsx(Bt,{children:t.jsx(Ut,{className:"text-white",children:f?"编辑角色":"新增角色"})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"角色名称"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:x,onChange:w=>g(w.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:v,onChange:w=>y(parseInt(w.target.value,10)||0)})]})]}),t.jsxs(Kt,{children:[t.jsxs(ee,{variant:"outline",onClick:()=>u(!1),className:"border-gray-600 text-gray-300",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(ee,{onClick:S,disabled:P,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),P?"保存中...":"保存"]})]})]})})]})}function u4(){const[n,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[f,p]=h.useState(null),[x,g]=h.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[v,y]=h.useState(!1),[P,R]=h.useState(!1),C=h.useRef(null),j=async k=>{var U;const T=(U=k.target.files)==null?void 0:U[0];if(T){R(!0);try{const Q=new FormData;Q.append("file",T),Q.append("folder","mentors");const te=Bd(),oe={};te&&(oe.Authorization=`Bearer ${te}`);const ne=await(await fetch(Vs("/api/upload"),{method:"POST",body:Q,credentials:"include",headers:oe})).json();ne!=null&&ne.success&&(ne!=null&&ne.url)?g(le=>({...le,avatar:ne.url})):alert("上传失败: "+((ne==null?void 0:ne.error)||"未知错误"))}catch(Q){console.error(Q),alert("上传失败")}finally{R(!1),C.current&&(C.current.value="")}}};async function b(){o(!0);try{const k=await Ge("/api/db/mentors");k!=null&&k.success&&k.data&&a(k.data)}catch(k){console.error("Load mentors error:",k)}finally{o(!1)}}h.useEffect(()=>{b()},[]);const S=()=>{g({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:n.length>0?Math.max(...n.map(k=>k.sort))+1:0,enabled:!0})},E=()=>{p(null),S(),u(!0)},w=k=>{p(k),g({name:k.name,avatar:k.avatar||"",intro:k.intro||"",tags:k.tags||"",priceSingle:k.priceSingle!=null?String(k.priceSingle):"",priceHalfYear:k.priceHalfYear!=null?String(k.priceHalfYear):"",priceYear:k.priceYear!=null?String(k.priceYear):"",quote:k.quote||"",whyFind:k.whyFind||"",offering:k.offering||"",judgmentStyle:k.judgmentStyle||"",sort:k.sort,enabled:k.enabled??!0}),u(!0)},M=async()=>{if(!x.name.trim()){alert("导师姓名不能为空");return}y(!0);try{const k=U=>U===""?void 0:parseFloat(U),T={name:x.name.trim(),avatar:x.avatar.trim()||void 0,intro:x.intro.trim()||void 0,tags:x.tags.trim()||void 0,priceSingle:k(x.priceSingle),priceHalfYear:k(x.priceHalfYear),priceYear:k(x.priceYear),quote:x.quote.trim()||void 0,whyFind:x.whyFind.trim()||void 0,offering:x.offering.trim()||void 0,judgmentStyle:x.judgmentStyle.trim()||void 0,sort:x.sort,enabled:x.enabled};if(f){const U=await St("/api/db/mentors",{id:f.id,...T});U!=null&&U.success?(u(!1),b()):alert("更新失败: "+(U==null?void 0:U.error))}else{const U=await Ct("/api/db/mentors",T);U!=null&&U.success?(u(!1),b()):alert("新增失败: "+(U==null?void 0:U.error))}}catch(k){console.error("Save error:",k),alert("保存失败")}finally{y(!1)}},D=async k=>{if(confirm("确定删除该导师?"))try{const T=await ss(`/api/db/mentors?id=${k}`);T!=null&&T.success?b():alert("删除失败: "+(T==null?void 0:T.error))}catch(T){console.error("Delete error:",T),alert("删除失败")}},V=k=>k!=null?`¥${k}`:"-";return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(Cr,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),t.jsxs(ee,{onClick:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{className:"p-0",children:l?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{className:"bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"ID"}),t.jsx(Te,{className:"text-gray-400",children:"姓名"}),t.jsx(Te,{className:"text-gray-400",children:"简介"}),t.jsx(Te,{className:"text-gray-400",children:"单次"}),t.jsx(Te,{className:"text-gray-400",children:"半年"}),t.jsx(Te,{className:"text-gray-400",children:"年度"}),t.jsx(Te,{className:"text-gray-400",children:"排序"}),t.jsx(Te,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsxs(tn,{children:[n.map(k=>t.jsxs(ot,{className:"border-gray-700/50",children:[t.jsx(Ce,{className:"text-gray-300",children:k.id}),t.jsx(Ce,{className:"text-white",children:k.name}),t.jsx(Ce,{className:"text-gray-400 max-w-[200px] truncate",children:k.intro||"-"}),t.jsx(Ce,{className:"text-gray-400",children:V(k.priceSingle)}),t.jsx(Ce,{className:"text-gray-400",children:V(k.priceHalfYear)}),t.jsx(Ce,{className:"text-gray-400",children:V(k.priceYear)}),t.jsx(Ce,{className:"text-gray-400",children:k.sort}),t.jsxs(Ce,{className:"text-right",children:[t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>w(k),className:"text-gray-400 hover:text-[#38bdac]",children:t.jsx(Ft,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>D(k.id),className:"text-gray-400 hover:text-red-400",children:t.jsx(sr,{className:"w-4 h-4"})})]})]},k.id)),n.length===0&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),t.jsx($t,{open:c,onOpenChange:u,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsx(Bt,{children:t.jsx(Ut,{className:"text-white",children:f?"编辑导师":"新增导师"})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"姓名 *"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:x.name,onChange:k=>g(T=>({...T,name:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"排序"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:x.sort,onChange:k=>g(T=>({...T,sort:parseInt(k.target.value,10)||0}))})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"头像"}),t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsx(ae,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:x.avatar,onChange:k=>g(T=>({...T,avatar:k.target.value})),placeholder:"点击上传或粘贴图片地址"}),t.jsx("input",{ref:C,type:"file",accept:"image/*",className:"hidden",onChange:j}),t.jsxs(ee,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:P,onClick:()=>{var k;return(k=C.current)==null?void 0:k.click()},children:[t.jsx(wi,{className:"w-4 h-4 mr-2"}),P?"上传中...":"上传"]})]}),x.avatar&&t.jsx("div",{className:"mt-2",children:t.jsx("img",{src:x.avatar.startsWith("http")?x.avatar:Vs(x.avatar),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"简介"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:x.intro,onChange:k=>g(T=>({...T,intro:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:x.tags,onChange:k=>g(T=>({...T,tags:k.target.value}))})]}),t.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[t.jsx(X,{className:"text-gray-300 block mb-2",children:"价格配置(每个导师独立)"}),t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),t.jsx(ae,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:x.priceSingle,onChange:k=>g(T=>({...T,priceSingle:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),t.jsx(ae,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:x.priceHalfYear,onChange:k=>g(T=>({...T,priceHalfYear:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),t.jsx(ae,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:x.priceYear,onChange:k=>g(T=>({...T,priceYear:k.target.value}))})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"引言"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:x.quote,onChange:k=>g(T=>({...T,quote:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"为什么找(文本)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:x.whyFind,onChange:k=>g(T=>({...T,whyFind:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"提供什么(文本)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:x.offering,onChange:k=>g(T=>({...T,offering:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:x.judgmentStyle,onChange:k=>g(T=>({...T,judgmentStyle:k.target.value}))})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"checkbox",id:"enabled",checked:x.enabled,onChange:k=>g(T=>({...T,enabled:k.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),t.jsx(X,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),t.jsxs(Kt,{children:[t.jsxs(ee,{variant:"outline",onClick:()=>u(!1),className:"border-gray-600 text-gray-300",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(ee,{onClick:M,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})})]})}function f4(){const[n,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState("");async function f(){o(!0);try{const g=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",v=await Ge(g);v!=null&&v.success&&v.data&&a(v.data)}catch(g){console.error("Load consultations error:",g)}finally{o(!1)}}h.useEffect(()=>{f()},[c]);const p={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},x={single:"单次",half_year:"半年",year:"年度"};return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx($a,{className:"w-5 h-5 text-[#38bdac]"}),"导师预约列表"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师咨询预约记录"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("select",{value:c,onChange:g=>u(g.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[t.jsx("option",{value:"",children:"全部状态"}),Object.entries(p).map(([g,v])=>t.jsx("option",{value:g,children:v},g))]}),t.jsxs(ee,{onClick:f,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})]})]}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{className:"p-0",children:l?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{className:"bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"ID"}),t.jsx(Te,{className:"text-gray-400",children:"用户ID"}),t.jsx(Te,{className:"text-gray-400",children:"导师ID"}),t.jsx(Te,{className:"text-gray-400",children:"类型"}),t.jsx(Te,{className:"text-gray-400",children:"金额"}),t.jsx(Te,{className:"text-gray-400",children:"状态"}),t.jsx(Te,{className:"text-gray-400",children:"创建时间"})]})}),t.jsxs(tn,{children:[n.map(g=>t.jsxs(ot,{className:"border-gray-700/50",children:[t.jsx(Ce,{className:"text-gray-300",children:g.id}),t.jsx(Ce,{className:"text-gray-400",children:g.userId}),t.jsx(Ce,{className:"text-gray-400",children:g.mentorId}),t.jsx(Ce,{className:"text-gray-400",children:x[g.consultationType]||g.consultationType}),t.jsxs(Ce,{className:"text-white",children:["¥",g.amount]}),t.jsx(Ce,{className:"text-gray-400",children:p[g.status]||g.status}),t.jsx(Ce,{className:"text-gray-500 text-sm",children:g.createdAt})]},g.id)),n.length===0&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function h4(){const[n,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[f]=h.useState(10),[p,x]=h.useState(0),[g,v]=h.useState(""),y=Xd(g,300),[P,R]=h.useState(!0),[C,j]=h.useState(null),[b,S]=h.useState(!1),[E,w]=h.useState(null),[M,D]=h.useState(""),[V,k]=h.useState(""),[T,U]=h.useState(""),[Q,te]=h.useState("admin"),[oe,he]=h.useState("active"),[ne,le]=h.useState(!1);async function Z(){var F;R(!0),j(null);try{const G=new URLSearchParams({page:String(c),pageSize:String(f)});y.trim()&&G.set("search",y.trim());const J=await Ge(`/api/admin/users?${G}`);J!=null&&J.success?(a(J.records||[]),o(J.total??0),x(J.totalPages??0)):j(J.error||"加载失败")}catch(G){const J=G;j(J.status===403?"无权限访问":((F=J==null?void 0:J.data)==null?void 0:F.error)||"加载失败"),a([])}finally{R(!1)}}h.useEffect(()=>{Z()},[c,f,y]);const $=()=>{w(null),D(""),k(""),U(""),te("admin"),he("active"),S(!0)},_=F=>{w(F),D(F.username),k(""),U(F.name||""),te(F.role==="super_admin"?"super_admin":"admin"),he(F.status==="disabled"?"disabled":"active"),S(!0)},q=async()=>{var F;if(!M.trim()){j("用户名不能为空");return}if(!E&&!V){j("新建时密码必填,至少 6 位");return}if(V&&V.length<6){j("密码至少 6 位");return}j(null),le(!0);try{if(E){const G=await St("/api/admin/users",{id:E.id,password:V||void 0,name:T.trim(),role:Q,status:oe});G!=null&&G.success?(S(!1),Z()):j((G==null?void 0:G.error)||"保存失败")}else{const G=await Ct("/api/admin/users",{username:M.trim(),password:V,name:T.trim(),role:Q});G!=null&&G.success?(S(!1),Z()):j((G==null?void 0:G.error)||"保存失败")}}catch(G){const J=G;j(((F=J==null?void 0:J.data)==null?void 0:F.error)||"保存失败")}finally{le(!1)}},z=async F=>{var G;if(confirm("确定删除该管理员?"))try{const J=await ss(`/api/admin/users?id=${F}`);J!=null&&J.success?Z():j((J==null?void 0:J.error)||"删除失败")}catch(J){const xe=J;j(((G=xe==null?void 0:xe.data)==null?void 0:G.error)||"删除失败")}},A=F=>{if(!F)return"-";try{const G=new Date(F);return isNaN(G.getTime())?F:G.toLocaleString("zh-CN")}catch{return F}};return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-6",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(zd,{className:"w-5 h-5 text-[#38bdac]"}),"管理员用户"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"后台登录账号管理,仅超级管理员可操作"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ae,{placeholder:"搜索用户名/昵称",value:g,onChange:F=>v(F.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),t.jsx(ee,{variant:"outline",size:"sm",onClick:Z,disabled:P,className:"border-gray-600 text-gray-300",children:t.jsx(tt,{className:`w-4 h-4 ${P?"animate-spin":""}`})}),t.jsxs(ee,{onClick:$,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"新增管理员"]})]})]}),C&&t.jsxs("div",{className:"mb-4 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm flex justify-between items-center",children:[t.jsx("span",{children:C}),t.jsx("button",{type:"button",onClick:()=>j(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{className:"p-0",children:P?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(t.Fragment,{children:[t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{className:"bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"ID"}),t.jsx(Te,{className:"text-gray-400",children:"用户名"}),t.jsx(Te,{className:"text-gray-400",children:"昵称"}),t.jsx(Te,{className:"text-gray-400",children:"角色"}),t.jsx(Te,{className:"text-gray-400",children:"状态"}),t.jsx(Te,{className:"text-gray-400",children:"创建时间"}),t.jsx(Te,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsxs(tn,{children:[n.map(F=>t.jsxs(ot,{className:"border-gray-700/50",children:[t.jsx(Ce,{className:"text-gray-300",children:F.id}),t.jsx(Ce,{className:"text-white font-medium",children:F.username}),t.jsx(Ce,{className:"text-gray-400",children:F.name||"-"}),t.jsx(Ce,{children:t.jsx($e,{variant:"outline",className:F.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:F.role==="super_admin"?"超级管理员":"管理员"})}),t.jsx(Ce,{children:t.jsx($e,{variant:"outline",className:F.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:F.status==="active"?"正常":"已禁用"})}),t.jsx(Ce,{className:"text-gray-500 text-sm",children:A(F.createdAt)}),t.jsxs(Ce,{className:"text-right",children:[t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>_(F),className:"text-gray-400 hover:text-[#38bdac]",children:t.jsx(Ft,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>z(F.id),className:"text-gray-400 hover:text-red-400",children:t.jsx(sr,{className:"w-4 h-4"})})]})]},F.id)),n.length===0&&!P&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:7,className:"text-center py-12 text-gray-500",children:C==="无权限访问"?"仅超级管理员可查看":"暂无管理员"})})]})]}),p>1&&t.jsx("div",{className:"p-4 border-t border-gray-700/50",children:t.jsx(In,{page:c,pageSize:f,total:l,totalPages:p,onPageChange:u})})]})})}),t.jsx($t,{open:b,onOpenChange:S,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[t.jsx(Bt,{children:t.jsx(Ut,{className:"text-white",children:E?"编辑管理员":"新增管理员"})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"用户名"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:M,onChange:F=>D(F.target.value),disabled:!!E}),E&&t.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:E?"新密码(留空不改)":"密码"}),t.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:E?"留空表示不修改":"至少 6 位",value:V,onChange:F=>k(F.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"昵称"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:T,onChange:F=>U(F.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"角色"}),t.jsxs("select",{value:Q,onChange:F=>te(F.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[t.jsx("option",{value:"admin",children:"管理员"}),t.jsx("option",{value:"super_admin",children:"超级管理员"})]})]}),E&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"状态"}),t.jsxs("select",{value:oe,onChange:F=>he(F.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[t.jsx("option",{value:"active",children:"正常"}),t.jsx("option",{value:"disabled",children:"禁用"})]})]})]}),t.jsxs(Kt,{children:[t.jsxs(ee,{variant:"outline",onClick:()=>S(!1),className:"border-gray-600 text-gray-300",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(ee,{onClick:q,disabled:ne,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),ne?"保存中...":"保存"]})]})]})})]})}function m4(){return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[t.jsx(ts,{className:"w-8 h-8 text-[#38bdac]"}),t.jsx("h1",{className:"text-2xl font-bold text-white",children:"API 接口文档"})]}),t.jsx("p",{className:"text-gray-400 mb-6",children:"API 风格:RESTful · 版本 v1.0 · 基础路径 /api · 简单、清晰、易用。"}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"1. 接口总览"})}),t.jsxs(Re,{className:"space-y-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 mb-2",children:"接口分类"}),t.jsxs("ul",{className:"space-y-1 text-gray-300 font-mono",children:[t.jsx("li",{children:"/api/book — 书籍内容(章节列表、内容获取、同步)"}),t.jsx("li",{children:"/api/payment — 支付系统(订单创建、回调、状态查询)"}),t.jsx("li",{children:"/api/referral — 分销系统(邀请码、收益、提现)"}),t.jsx("li",{children:"/api/user — 用户系统(登录、注册、信息更新)"}),t.jsx("li",{children:"/api/match — 匹配系统(寻找匹配、匹配历史)"}),t.jsx("li",{children:"/api/admin — 管理后台(内容/订单/用户/分销管理)"}),t.jsx("li",{children:"/api/config — 配置系统"})]})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 mb-2",children:"认证方式"}),t.jsx("p",{className:"text-gray-300",children:"用户:Cookie session_id(可选)"}),t.jsx("p",{className:"text-gray-300",children:"管理端:Authorization: Bearer admin-token-secret"})]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"2. 书籍内容"})}),t.jsxs(Re,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[t.jsx("p",{children:"GET /api/book/all-chapters — 获取所有章节"}),t.jsx("p",{children:"GET /api/book/chapter/:id — 获取单章内容"}),t.jsx("p",{children:"POST /api/book/sync — 同步章节(需管理员认证)"})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"3. 支付"})}),t.jsxs(Re,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[t.jsx("p",{children:"POST /api/payment/create-order — 创建订单"}),t.jsx("p",{children:"POST /api/payment/alipay/notify — 支付宝回调"}),t.jsx("p",{children:"POST /api/payment/wechat/notify — 微信回调"})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"4. 分销与用户"})}),t.jsxs(Re,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[t.jsx("p",{children:"/api/referral/* — 邀请码、收益查询、提现"}),t.jsx("p",{children:"/api/user/* — 登录、注册、信息更新"}),t.jsx("p",{children:"/api/match/* — 匹配、匹配历史"})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"5. 管理后台"})}),t.jsxs(Re,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[t.jsx("p",{children:"GET/POST /api/admin/referral-settings — 推广/分销设置(含 VIP 配置)"}),t.jsx("p",{children:"GET /api/db/users、/api/db/book — 用户与章节数据"}),t.jsx("p",{children:"GET /api/orders — 订单列表"})]})]}),t.jsx("p",{className:"text-gray-500 text-xs",children:"完整说明见项目内 开发文档/5、接口/API接口完整文档.md"})]})}function p4(){const n=us();return t.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:t.jsxs("div",{className:"text-center max-w-md",children:[t.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:t.jsx(Tj,{className:"w-10 h-10"})}),t.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),t.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),t.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:n.pathname}),t.jsx(ee,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:t.jsxs(hi,{to:"/",children:[t.jsx(aN,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function x4(){return t.jsxs(lj,{children:[t.jsx(it,{path:"/login",element:t.jsx(rw,{})}),t.jsxs(it,{path:"/",element:t.jsx(ab,{}),children:[t.jsx(it,{index:!0,element:t.jsx(nj,{to:"/dashboard",replace:!0})}),t.jsx(it,{path:"dashboard",element:t.jsx(sw,{})}),t.jsx(it,{path:"orders",element:t.jsx(V1,{})}),t.jsx(it,{path:"users",element:t.jsx(x2,{})}),t.jsx(it,{path:"distribution",element:t.jsx(g2,{})}),t.jsx(it,{path:"withdrawals",element:t.jsx(v2,{})}),t.jsx(it,{path:"content",element:t.jsx(kC,{})}),t.jsx(it,{path:"referral-settings",element:t.jsx(GC,{})}),t.jsx(it,{path:"author-settings",element:t.jsx(QC,{})}),t.jsx(it,{path:"vip-roles",element:t.jsx(d4,{})}),t.jsx(it,{path:"mentors",element:t.jsx(u4,{})}),t.jsx(it,{path:"mentor-consultations",element:t.jsx(f4,{})}),t.jsx(it,{path:"admin-users",element:t.jsx(h4,{})}),t.jsx(it,{path:"settings",element:t.jsx(e4,{})}),t.jsx(it,{path:"payment",element:t.jsx(t4,{})}),t.jsx(it,{path:"site",element:t.jsx(a4,{})}),t.jsx(it,{path:"qrcodes",element:t.jsx(l4,{})}),t.jsx(it,{path:"match",element:t.jsx(o4,{})}),t.jsx(it,{path:"match-records",element:t.jsx(c4,{})}),t.jsx(it,{path:"api-doc",element:t.jsx(m4,{})})]}),t.jsx(it,{path:"*",element:t.jsx(p4,{})})]})}cy.createRoot(document.getElementById("root")).render(t.jsx(h.StrictMode,{children:t.jsx(hj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:t.jsx(x4,{})})}));
|